付延余
2022-12-19 8fc8838a441ae3d3b1616f4fc003b16292978b54
pages/new-application-form-data/new-application-form-data.vue
@@ -11,27 +11,24 @@
    <!-- <u-alert :title="accountMsg" :type="accountMsgType" :description="accountMsgType"></u-alert> -->
    <view class="formDataContaniner">
      <u--form labelPosition="left" :model="newFormData" :rules="rules" ref="formRef">
        <u-form-item @click="selectCustomer" labelWidth="20%" label="结算客户" prop="customerName" borderBottom
                     ref="customerNameRef">
            <u-form-item @click="selectLedger" labelWidth="20%" label="账套" borderBottom>
               <u--input disabled disabledColor="#ffffff" v-model="ledgerName" border="none"></u--input>
            </u-form-item>
            <u-form-item @click="selectCustomer" labelWidth="20%" label="结算客户" prop="customerName" borderBottom ref="customerNameRef">
          <u--input disabled disabledColor="#ffffff" v-model="newFormData.customerName" border="none"></u--input>
        </u-form-item>
        <u-form-item @click="selectContract" labelWidth="20%" label="合同编号" prop="contractNum" borderBottom
                     ref="contractNumRef">
            <u-form-item @click="selectContract" labelWidth="20%" label="合同编号" prop="contractNum" borderBottom ref="contractNumRef">
          <u--input disabled disabledColor="#ffffff" v-model="newFormData.contractNum" border="none"></u--input>
        </u-form-item>
        <u-form-item labelWidth="20%" label="合同名称" borderBottom ref="contractNameRef">
          <u--input disabled disabledColor="#ffffff" v-model="newFormData.contractName" border="none"></u--input>
        </u-form-item>
        <u-form-item @click="showPayType = true" prop="payType" labelWidth="20%" label="付款方式" borderBottom
                     ref="payTypeRef">
          <u--input v-model="selectValue" disabled disabledColor="#ffffff" placeholder="请选择付款方式"
                    border="none"></u--input>
            <u-form-item @click="showPayType = true" prop="payType" labelWidth="20%" label="付款方式" borderBottom ref="payTypeRef">
               <u--input v-model="selectValue" disabled disabledColor="#ffffff" placeholder="请选择付款方式" border="none"></u--input>
          <u-icon slot="right" name="arrow-right"></u-icon>
        </u-form-item>
        <u-form-item @click="timeShow = true" prop="startDate" labelWidth="20%" label="日期" borderBottom
                     ref="timeDataRef">
          <u--input v-model="timeDataStr" border="none" disabled disabledColor="#ffffff"
                    placeholder="请选择范围日期"></u--input>
            <u-form-item @click="timeShow = true" prop="startDate" labelWidth="20%" label="日期" borderBottom ref="timeDataRef">
               <u--input v-model="timeDataStr" border="none" disabled disabledColor="#ffffff" placeholder="请选择范围日期"></u--input>
          <u-icon slot="right" name="arrow-right"></u-icon>
        </u-form-item>
        <u-form-item labelWidth="20%" label="编号" borderBottom>
@@ -40,37 +37,59 @@
      </u--form>
    </view>
      <!-- 选择账套 -->
      <u-picker
         @change="selectLedgerChange"
         @confirm="selectLedgerConfirm"
         @cancel="selectLedgerCancel"
         @close="selectLedgerClose"
         :show="selectLedgerShow"
         :columns="ledgerList"
         keyName="name"
         :closeOnClickOverlay="true"
      ></u-picker>
    <!-- 申请日历、范围时间 -->
    <u-calendar :show="timeShow" :mode="mode" @confirm="confirmTime" @close="timeClose" rowHeight="110"
                :maxDate="maxDate"></u-calendar>
      <u-calendar :show="timeShow" :mode="mode" @confirm="confirmTime" @close="timeClose" rowHeight="110" ></u-calendar>
    <!-- 申请付款方式弹出菜单 -->
    <u-action-sheet :show="showPayType" :actions="actions" title="请选择付款方式" @close="showPayType = false"
                    @select="sexSelect"></u-action-sheet>
      <u-action-sheet :show="showPayType" :actions="actions" title="请选择付款方式" @close="showPayType = false" @select="sexSelect"></u-action-sheet>
    <!-- 选择客户弹框 -->
    <!--  @touchmove.stop.prevent="moveHandleCustomer":防止图层穿透 -->
    <view class="selectCustomerPopup">
      <u-popup :show="selectCustomerShow" @close="selectCustomerClose" @open="selectCustomerOpen" mode="bottom"
               round="22">
         <u-popup :show="selectCustomerShow" @close="selectCustomerClose" @open="selectCustomerOpen" mode="bottom" round="22">
        <scroll-view scroll-y="true" style="height:100%;">
          <combination-title class="selectCustomerTitle" title="选择客户"></combination-title>
          <view class="selectCustomerContainer">
            <view class="searchContainer">
              <u--form labelPosition="left" :model="searchCustomerForm" ref="selectformRef">
                <u-form-item @click="selectCustomerCompShow = true;hideKeyboard() " labelWidth="12%" label="单位"
                             borderBottom ref="compRef">
                  <u--input v-model="searchCustomerForm.compName" disabled disabledColor="#ffffff" placeholder="点击选择单位"
                            border="none"></u--input>
                        <u-form-item
                           @click="
                              selectCustomerCompShow = true;
                              hideKeyboard();
                           "
                           labelWidth="12%"
                           label="单位"
                           borderBottom
                           ref="compRef"
                        >
                           <u--input v-model="searchCustomerForm.compName" disabled disabledColor="#ffffff" placeholder="点击选择单位" border="none"></u--input>
                  <!--                           <u-icon slot="right" name="close-circle-fill" @click="searchCustomerForm.compName = ''"></u-icon>-->
                </u-form-item>
                <u-form-item labelWidth="20%" label="客户名称" borderBottom ref="timeDataRef">
                  <u--input v-model="selectCustomerData.customerFullName" border="none" placeholder="输入客户名称"></u--input>
                  <u-icon slot="right" name="close-circle-fill"
                          @click="selectCustomerData.customerFullName = ''"></u-icon>
                           <u-icon slot="right" name="close-circle-fill" @click="selectCustomerData.customerFullName = ''"></u-icon>
                </u-form-item>
                <u-form-item @click="selectLevelShow = true;hideKeyboard()" labelWidth="20%" label="客户级别" borderBottom>
                  <u--input border="none" v-model="searchCustomerForm.levelText" disabled disabledColor="#ffffff"
                            placeholder="点击选择级别"></u--input>
                        <u-form-item
                           @click="
                              selectLevelShow = true;
                              hideKeyboard();
                           "
                           labelWidth="20%"
                           label="客户级别"
                           borderBottom
                        >
                           <u--input border="none" v-model="searchCustomerForm.levelText" disabled disabledColor="#ffffff" placeholder="点击选择级别"></u--input>
                  <!--                           <u-icon slot="right" name="close-circle-fill" @click="searchCustomerForm.levelText = ''"></u-icon>-->
                </u-form-item>
              </u--form>
@@ -104,8 +123,7 @@
              </u-cell-group>
            </view>
            <view class="loadmoreClass">
              <u-loadmore loadmoreText="点击加载更多" nomoreText="无更多数据!!!" :status="status" @loadmore="loadingCustomer"
                          fontSize="20" height="30px"/>
                     <u-loadmore loadmoreText="点击加载更多" nomoreText="无更多数据!!!" :status="status" @loadmore="loadingCustomer" fontSize="20" height="30px" />
            </view>
            <!-- 选择用户菜单项 -->
            <view class="selectCustomerCompSheet">
@@ -120,8 +138,7 @@
            <!-- 级别菜单项 -->
            <view class="selectLevelSheet">
              <u-action-sheet :show="selectLevelShow" :actions="levelList" title="请选择级别"
                              @close="selectLevelShow = false" @select="selectLevelSelect"></u-action-sheet>
                     <u-action-sheet :show="selectLevelShow" :actions="levelList" title="请选择级别" @close="selectLevelShow = false" @select="selectLevelSelect"></u-action-sheet>
            </view>
          </view>
        </scroll-view>
@@ -131,39 +148,30 @@
    <!-- 选择合同 -->
    <!-- @touchmove.stop.prevent="moveHandleContract" -->
    <view class="selectCustomerPopup">
      <u-popup :show="selectContractShow" @close="selectContractClose" @open="selectContractOpen" mode="bottom"
               round="22">
         <u-popup :show="selectContractShow" @close="selectContractClose" @open="selectContractOpen" mode="bottom" round="22">
        <scroll-view scroll-y="true" style="height:100%;">
          <combination-title class="selectCustomerTitle" title="选择合同"></combination-title>
          <view class="selectCustomerContainer">
            <view class="searchContainer">
              <u--form labelPosition="left" :model="searchContractForm" ref="selectformRef">
                <u-form-item labelWidth="18%" label="合同编号" borderBottom ref="compRef">
                        <u-form-item labelWidth="20%" label="合同编号" borderBottom ref="compRef">
                  <u--input v-model="searchContractForm.num" placeholder="请输入合同编号" border="none"></u--input>
                  <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.num != ''"
                          @click="searchContractForm.num = ''"></u-icon>
                           <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.num != ''" @click="searchContractForm.num = ''"></u-icon>
                </u-form-item>
                <u-form-item labelWidth="18%" label="客户名称" borderBottom ref="compRef">
                        <u-form-item labelWidth="20%" label="客户名称" borderBottom ref="compRef">
                  <u--input v-model="searchContractForm.customerName" placeholder="请输入客户名称" border="none"></u--input>
                  <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.customerName != ''"
                          @click="searchContractForm.customerName = ''"></u-icon>
                           <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.customerName != ''" @click="searchContractForm.customerName = ''"></u-icon>
                </u-form-item>
                <u-form-item labelWidth="18%" label="合同类型" borderBottom ref="compRef"
                             @click="searchContractFormTypeFocus">
                  <u--input v-model="searchContractForm.type" disabled disabledColor="#ffffff" placeholder="请输入合同类型"
                            border="none"></u--input>
                        <u-form-item labelWidth="20%" label="合同类型" borderBottom ref="compRef" @click="searchContractFormTypeFocus">
                           <u--input v-model="searchContractForm.type" disabled disabledColor="#ffffff" placeholder="请输入合同类型" border="none"></u--input>
                  <!--                           <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.type != ''" @click="searchContractForm.type = ''"></u-icon>-->
                </u-form-item>
                <u-form-item labelWidth="18%" label="签订日期" borderBottom ref="compRef"
                             @click="selectContractStartTimeShow = true">
                  <u--input v-model="searchContractForm.startDate" disabled disabledColor="#ffffff"
                            placeholder="点击选择签订日期" border="none"></u--input>
                        <u-form-item labelWidth="20%" label="签订日期" borderBottom ref="compRef" @click="selectContractStartTimeShow = true">
                           <u--input v-model="searchContractForm.startDate" disabled disabledColor="#ffffff" placeholder="点击选择签订日期" border="none"></u--input>
                  <!--                           <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.startDate != ''" @click="searchContractForm.startDate = ''"></u-icon>-->
                </u-form-item>
                <u-form-item labelWidth="18%" label="结束日期" borderBottom ref="compRef"
                             @click="selectContractEndTimeShow = true">
                  <u--input v-model="searchContractForm.endDate" disabled disabledColor="#ffffff" placeholder="点击选择结束日期"
                            border="none"></u--input>
                        <u-form-item labelWidth="20%" label="结束日期" borderBottom ref="compRef" @click="selectContractEndTimeShow = true">
                           <u--input v-model="searchContractForm.endDate" disabled disabledColor="#ffffff" placeholder="点击选择结束日期" border="none"></u--input>
                  <!--                           <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.endDate != ''" @click="searchContractForm.endDate = ''"></u-icon>-->
                </u-form-item>
              </u--form>
@@ -173,30 +181,31 @@
              <u-button text="清空" @click="selectContractResetFields"></u-button>
            </view>
            <!-- 合同列表 -->
                  <!-- 滚动通知 -->
                  <view class="tapStyle">
                    <u-notice-bar :text="noticeText" fontSize="24"></u-notice-bar>
                  </view>
            <view class="tableContract">
              <view class="tableBody">
                <uni-table border emptyText="暂无更多数据">
                  <uni-tr>
                    <uni-th width="100" align="center">组织结构</uni-th>
                              <uni-th width="130" align="center">煤种名称</uni-th>
                    <uni-th width="250" align="center">客户名称</uni-th>
                    <uni-th width="180" align="center">煤种名称</uni-th>
                    <uni-th width="220" align="center">合同编号</uni-th>
                    <uni-th width="90" align="center">合同类型</uni-th>
                              <uni-th width="230" align="center">合同编号</uni-th>
                              <uni-th width="100" align="center">合同类型</uni-th>
                    <uni-th width="130" align="center">签订日期</uni-th>
                    <uni-th width="130" align="center">终止日期</uni-th>
                    <uni-th width="100" align="center">合同总量</uni-th>
                    <uni-th width="100" align="center">合同金额</uni-th>
                              <uni-th width="120" align="center">合同金额</uni-th>
                    <uni-th width="70" align="center">状态</uni-th>
                              <uni-th width="130" align="center">组织结构</uni-th>
                  </uni-tr>
                  <uni-tr v-for="(item, index) in contractData" :key="index">
                    <uni-td align="center">
                      <view :style="tdStyle">{{ item.compName }}</view>
                                 <view :style="tdStyle">{{ item.coalNames }}</view>
                    </uni-td>
                    <uni-td align="left">
                      <view class="contractTableTd">{{ item.customerName }}</view>
              </uni-td>
                    <uni-td align="center">
                      <view class="contractTableTd">{{ item.coalNames }}</view>
                    </uni-td>
                    <uni-td align="left">
                      <view :style="tdStyle">{{ item.num }}</view>
@@ -219,22 +228,20 @@
                    <uni-td align="center">
                      <view :style="tdStyle">{{ item.status }}</view>
                    </uni-td>
                              <uni-td align="center">
                                 <view :style="tdStyle">{{ item.compName }}</view>
                              </uni-td>
                  </uni-tr>
                </uni-table>
              </view>
              <view class="TableUtilBtn">
                <uni-table border emptyText="暂无更多数据">
                  <uni-tr>
                    <uni-th align="center">操作</uni-th>
                  </uni-tr>
                           <uni-tr><uni-th align="center">操作</uni-th></uni-tr>
                  <uni-tr v-for="(item, index) in contractData" :key="index">
                    <uni-td align="center">
                      <!-- 选择合同 -->
                      <view class="TableUtilBtnContainer">
                        <u-button type="primary" @click="selectContractClick(item)" icon="checkbox-mark"
                                  size="mini"></u-button>
                      </view>
                                 <view class="TableUtilBtnContainer"><u-button type="primary" @click="selectContractClick(item)" icon="checkbox-mark" size="mini"></u-button></view>
                    </uni-td>
                  </uni-tr>
                </uni-table>
@@ -242,8 +249,7 @@
            </view>
            <!-- 合同加载更多 -->
            <view class="loadmoreClass">
              <u-loadmore loadmoreText="点击加载更多" nomoreText="无更多数据!!!" :status="statusContractLoading" @loadmore="loadingContract"
                          fontSize="20" height="30px"/>
                     <u-loadmore loadmoreText="点击加载更多" nomoreText="无更多数据!!!" :status="statusContractLoading" @loadmore="loadingContract" fontSize="20" height="30px" />
            </view>
            <!-- 合同类型选择器 -->
            <view class="selectContractTypePicker">
@@ -266,8 +272,7 @@
              ></u-calendar>
            </view>
            <view class="selectContractEndTime">
              <u-calendar :show="selectContractEndTimeShow" @close="selectContractEndTimeClose"
                          :mode="selectContractTimeMode" @confirm="selectContractEndTimeConfirm"></u-calendar>
                     <u-calendar :show="selectContractEndTimeShow" @close="selectContractEndTimeClose" :mode="selectContractTimeMode" @confirm="selectContractEndTimeConfirm"></u-calendar>
            </view>
          </view>
        </scroll-view>
@@ -284,8 +289,7 @@
            <u--form labelPosition="left" :model="addContractFormdata" :rules="addContractRules" ref="form1">
              <view class="formUpCard">
                <u-form-item label="矿厂" labelWidth="20%" ref="item1">
                  <u--input v-model="addContractFormdata.filedName" disabled disabledColor="#ffffff"
                            border="none"></u--input>
                           <u--input v-model="addContractFormdata.filedName" disabled disabledColor="#ffffff" border="none"></u--input>
                </u-form-item>
                <u-form-item @click="coalFiledSelectShow = true" label="煤厂" labelWidth="20%" ref="item1">
                  <u--input v-model="addContractFormdata.compName" disabled disabledColor="#ffffff"></u--input>
@@ -304,24 +308,19 @@
                      <view class="currentPriceBox">
                        <u--form :model="currentCoal" labelPosition="left">
                          <u-form-item label="煤种" labelWidth="35%">
                            <u--input v-model="currentCoal.coalName" disabled disabledColor="#ffffff"
                                      border="none"></u--input>
                                          <u--input v-model="currentCoal.coalName" disabled disabledColor="#ffffff" border="none"></u--input>
                          </u-form-item>
                          <u-form-item :label="currentCoal.type == 1 ? '钢厂长协' : '基准价'" labelWidth="35%">
                            <u--input v-model="currentCoal.steelMillPrice" disabled disabledColor="#ffffff"
                                      border="none"></u--input>
                                          <u--input v-model="currentCoal.steelMillPrice" disabled disabledColor="#ffffff" border="none"></u--input>
                          </u-form-item>
                          <u-form-item :label="currentCoal.type == 1 ? '焦化长协' : '电厂基准'" labelWidth="35%">
                            <u--input v-model="currentCoal.cokingPrice" disabled disabledColor="#ffffff"
                                      border="none"></u--input>
                                          <u--input v-model="currentCoal.cokingPrice" disabled disabledColor="#ffffff" border="none"></u--input>
                          </u-form-item>
                          <u-form-item :label="currentCoal.type == 1 ? '非长协' : '区域外电厂价'" labelWidth="35%">
                            <u--input v-model="currentCoal.noImportantPrice" disabled disabledColor="#ffffff"
                                      border="none"></u--input>
                                          <u--input v-model="currentCoal.noImportantPrice" disabled disabledColor="#ffffff" border="none"></u--input>
                          </u-form-item>
                          <u-form-item label="挂牌价" labelWidth="35%">
                            <u--input v-model="currentCoal.quotePrice" disabled disabledColor="#ffffff"
                                      border="none"></u--input>
                                          <u--input v-model="currentCoal.quotePrice" disabled disabledColor="#ffffff" border="none"></u--input>
                          </u-form-item>
                        </u--form>
                      </view>
@@ -331,42 +330,32 @@
                      <view class="selectPricebox">
                        <u--form labelPosition="left">
                          <u-form-item label="煤种" labelWidth="35%">
                            <u--input v-model="currentCoal.coalName" disabled disabledColor="#ffffff"
                                      border="none"></u--input>
                                          <u--input v-model="currentCoal.coalName" disabled disabledColor="#ffffff" border="none"></u--input>
                          </u-form-item>
                          <u-radio-group v-model="addContractFormdata.priceMode" placement="column"
                                         @change="groupChange">
                                       <u-radio-group v-model="addContractFormdata.priceMode" placement="column" @change="groupChange">
                            <view class="selectPriceboxItem">
                              <u-form-item :label="currentCoal.type == 1 ? '钢厂长协' : '基准价'" labelWidth="35%">
                                <u--input v-model="afterPrice.steelMillPrice" disabled disabledColor="#ffffff"
                                          border="none"></u--input>
                                                <u--input v-model="afterPrice.steelMillPrice" disabled disabledColor="#ffffff" border="none"></u--input>
                              </u-form-item>
                              <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="0"
                                       @change="changePriceMode"></u-radio>
                                             <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="0" @change="changePriceMode"></u-radio>
                            </view>
                            <view class="selectPriceboxItem">
                              <u-form-item :label="currentCoal.type == 1 ? '焦化长协' : '电厂基准'" labelWidth="35%">
                                <u--input v-model="afterPrice.cokingPrice" disabled disabledColor="#ffffff"
                                          border="none"></u--input>
                                                <u--input v-model="afterPrice.cokingPrice" disabled disabledColor="#ffffff" border="none"></u--input>
                              </u-form-item>
                              <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="1"
                                       @change="changePriceMode"></u-radio>
                                             <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="1" @change="changePriceMode"></u-radio>
                            </view>
                            <view class="selectPriceboxItem">
                              <u-form-item :label="currentCoal.type == 1 ? '非长协' : '区域外电厂价'" labelWidth="35%">
                                <u--input v-model="afterPrice.noImportantPrice" disabled disabledColor="#ffffff"
                                          border="none"></u--input>
                                                <u--input v-model="afterPrice.noImportantPrice" disabled disabledColor="#ffffff" border="none"></u--input>
                              </u-form-item>
                              <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="2"
                                       @change="changePriceMode"></u-radio>
                                             <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="2" @change="changePriceMode"></u-radio>
                            </view>
                            <view class="selectPriceboxItem">
                              <u-form-item label="挂牌价" labelWidth="35%">
                                <u--input v-model="afterPrice.quotePrice" disabled disabledColor="#ffffff"
                                          border="none"></u--input>
                                                <u--input v-model="afterPrice.quotePrice" disabled disabledColor="#ffffff" border="none"></u--input>
                              </u-form-item>
                              <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="3"
                                       @change="changePriceMode"></u-radio>
                                             <u-radio shape="square" size="30" :customStyle="{ marginBottom: '8px' }" name="3" @change="changePriceMode"></u-radio>
                            </view>
                          </u-radio-group>
                        </u--form>
@@ -375,8 +364,7 @@
                    <view class="selectFavouredPolicy">
                      <u-divider text="选择优惠政策"></u-divider>
                      <view class="selectFavouredPolicyBox">
                        <uni-table ref="priceTableRef" :loading="loading" border stripe type="selection"
                                   emptyText="暂无更多数据" @selection-change="selectionChange">
                                    <uni-table ref="priceTableRef" :loading="loading" border stripe type="selection" emptyText="暂无更多数据" @selection-change="selectionChange">
                          <uni-tr>
                            <uni-th width="150" align="center">优惠方式</uni-th>
                            <uni-th width="60" align="center">符号</uni-th>
@@ -400,16 +388,13 @@
              </view>
              <view class="formDownCard">
                <u-form-item label="单价" labelWidth="20%" ref="item1">
                  <u--input v-model="addContractFormdata.price" disabled disabledColor="#ffffff"
                            border="none"></u--input>
                           <u--input v-model="addContractFormdata.price" disabled disabledColor="#ffffff" border="none"></u--input>
                </u-form-item>
                <u-form-item label="订单金额" labelWidth="20%" ref="item1">
                  <u--input :disabled="addContractFormdata.trainType == 2" v-show="currentRowComputed"
                            v-model="addContractFormdata.amount"></u--input>
                           <u--input :disabled="addContractFormdata.trainType == 2" v-show="currentRowComputed" v-model="addContractFormdata.amount"></u--input>
                </u-form-item>
                <u-form-item label="订单数量" labelWidth="20%" ref="item1">
                  <u--input :disabled="addContractFormdata.trainType == 1" @input="jisuanAmount"
                            v-model="addContractFormdata.quant"></u--input>
                           <u--input :disabled="addContractFormdata.trainType == 1" @input="jisuanAmount" v-model="addContractFormdata.quant"></u--input>
                </u-form-item>
              </view>
@@ -419,16 +404,12 @@
              <u-form-item label="抑尘费" labelWidth="18%" borderBottom ref="item1"><u--input v-model="addContractFormdata.cost2" border="none"></u--input></u-form-item> -->
            </u--form>
            <view class="addContractConfirm">
              <u-button :text="editApplicationIndex != null ? '添加修改':'添加'" type="primary"
                        @click="addContractSanConfirm"></u-button>
            </view>
                  <view class="addContractConfirm"><u-button :text="editApplicationIndex != null ? '添加修改' : '添加'" type="primary" @click="addContractSanConfirm"></u-button></view>
          </view>
          <!-- 选择煤厂 -->
          <view class="coalFiledSelectPopup">
            <u-popup :show="coalFiledSelectShow" @close="coalFiledSelectClose" @open="coalFiledSelectOpen" mode="bottom"
                     round="22">
                  <u-popup :show="coalFiledSelectShow" @close="coalFiledSelectClose" @open="coalFiledSelectOpen" mode="bottom" round="22">
              <scroll-view scroll-y="true" style="height:100%;">
                <combination-title class="selectCustomerTitle" title="选择煤厂"></combination-title>
                <view class="coalFiledSelectSearch"></view>
@@ -460,16 +441,11 @@
                  <view class="TableUtilBtn">
                    <uni-table border emptyText="暂无更多数据">
                      <uni-tr>
                        <uni-th align="center">操作</uni-th>
                      </uni-tr>
                                 <uni-tr><uni-th align="center">操作</uni-th></uni-tr>
                      <uni-tr v-for="(item, index) in coalfiledData" :key="index">
                        <uni-td align="center">
                          <!-- 选择合同 -->
                          <view class="TableUtilBtnContainer">
                            <u-button type="primary" @click="coalFiledSelectClick(item)" icon="checkbox-mark"
                                      size="mini"></u-button>
                          </view>
                                       <view class="TableUtilBtnContainer"><u-button type="primary" @click="coalFiledSelectClick(item)" icon="checkbox-mark" size="mini"></u-button></view>
                        </uni-td>
                      </uni-tr>
                    </uni-table>
@@ -481,30 +457,23 @@
          <!-- 选择收货人 -->
          <view class="selectCustomerPopup">
            <u-popup :show="addContractConsigneeShow" @close="addContractConsigneeClose"
                     @open="addContractConsigneeOpen" mode="bottom" round="22">
                  <u-popup :show="addContractConsigneeShow" @close="addContractConsigneeClose" @open="addContractConsigneeOpen" mode="bottom" round="22">
              <scroll-view scroll-y="true" style="height:100%;">
                <combination-title class="selectCustomerTitle" title="选择收货人"></combination-title>
                <view class="selectCustomerContainer">
                  <view class="searchContainer">
                    <u--form labelPosition="left" :model="searchCustomerForm" ref="selectformRef">
                      <u-form-item labelWidth="12%" label="单位" borderBottom ref="compRef">
                        <u--input @focus="selectCustomerCompShow = true" v-model="searchCustomerForm.compName"
                                  placeholder="点击选择单位" border="none"></u--input>
                        <u-icon slot="right" name="close-circle-fill" v-if="searchCustomerForm.compName != ''"
                                @click="searchCustomerForm.compName = ''"></u-icon>
                                    <u--input @focus="selectCustomerCompShow = true" v-model="searchCustomerForm.compName" placeholder="点击选择单位" border="none"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-if="searchCustomerForm.compName != ''" @click="searchCustomerForm.compName = ''"></u-icon>
                      </u-form-item>
                      <u-form-item labelWidth="20%" label="客户名称" borderBottom ref="timeDataRef">
                        <u--input v-model="selectCustomerData.customerFullName" border="none"
                                  placeholder="输入客户名称"></u--input>
                        <u-icon slot="right" name="close-circle-fill" v-if="selectCustomerData.customerFullName != ''"
                                @click="selectCustomerData.customerName = ''"></u-icon>
                                    <u--input v-model="selectCustomerData.customerFullName" border="none" placeholder="输入客户名称"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-if="selectCustomerData.customerFullName != ''" @click="selectCustomerData.customerName = ''"></u-icon>
                      </u-form-item>
                      <u-form-item labelWidth="20%" label="客户级别" borderBottom>
                        <u--input @focus="selectLevelShow = true" border="none" v-model="searchCustomerForm.levelText"
                                  placeholder="点击选择级别"></u--input>
                        <u-icon slot="right" name="close-circle-fill" v-if="searchCustomerForm.levelText != ''"
                                @click="searchCustomerForm.levelText = ''"></u-icon>
                                    <u--input @focus="selectLevelShow = true" border="none" v-model="searchCustomerForm.levelText" placeholder="点击选择级别"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-if="searchCustomerForm.levelText != ''" @click="searchCustomerForm.levelText = ''"></u-icon>
                      </u-form-item>
                    </u--form>
                  </view>
@@ -538,8 +507,7 @@
                    </u-cell-group>
                  </view>
                  <view class="loadmoreClass">
                    <u-loadmore loadmoreText="点击加载更多" nomoreText="无更多数据!!!" :status="status" @loadmore="loadingCustomer"
                                fontSize="20" height="30px"/>
                              <u-loadmore loadmoreText="点击加载更多" nomoreText="无更多数据!!!" :status="status" @loadmore="loadingCustomer" fontSize="20" height="30px" />
                  </view>
                  <!-- 选择用户菜单项 -->
                  <view class="selectCustomerCompSheet">
@@ -553,8 +521,7 @@
                  </view>
                  <!-- 级别菜单项 -->
                  <view class="selectLevelSheet">
                    <u-action-sheet :show="selectLevelShow" :actions="levelList" title="请选择级别"
                                    @close="selectLevelShow = false" @select="selectLevelSelect"></u-action-sheet>
                              <u-action-sheet :show="selectLevelShow" :actions="levelList" title="请选择级别" @close="selectLevelShow = false" @select="selectLevelSelect"></u-action-sheet>
                  </view>
                </view>
              </scroll-view>
@@ -611,23 +578,19 @@
          </uni-td>
        </uni-tr>
      </uni-table> -->
      <view class="balanceNo" v-if="accountDetails.balanceTotal < 0">
        <text style="color:red;">客户账户当前处于欠款状态</text>
      </view>
         <view class="balanceNo" v-if="accountDetails.balanceTotal < 0"><text style="color:red;">客户账户当前处于欠款状态</text></view>
      <view class="messageCustomerBalance" v-if="accountDetails.balanceTotal >= 0">
        <text style="color: #FFA500;">客户账户现汇余额:{{
            accountDetails.balance == null || undefined ? 0 : accountDetails.balance.toFixed(2)
          }},承兑余额:{{ accountDetails.balance2 == null || undefined ? 0 : accountDetails.balance2 }}
            <text style="color: #FFA500;">
               客户账户现汇余额:{{ accountDetails.balance == null || undefined ? 0 : accountDetails.balance.toFixed(2) }},承兑余额:{{
                  accountDetails.balance2 == null || undefined ? 0 : accountDetails.balance2
               }}
        </text>
      </view>
      <u-swipe-action>
        <u-swipe-action-item @click="deleteContractCardClick" :options="options1"
                             v-for="(item, index) in newFormData.contractOrders" :key="index">
            <u-swipe-action-item @click="deleteContractCardClick" :options="options1" v-for="(item, index) in newFormData.contractOrders" :key="index">
          <view class="cardList">
            <view class="cardListIcon" @click="editApplicationClick(index)">
              <u-icon name="edit-pen" color="#2979ff" size="35"></u-icon>
            </view>
                  <view class="cardListIcon" @click="editApplicationClick(index)"><u-icon name="edit-pen" color="#2979ff" size="35"></u-icon></view>
            <view class="cardList-container">
              <view class="cardList_item">
                收货人:
@@ -673,9 +636,7 @@
      </u-swipe-action>
      <view class="addCard" @click="addContractClick">
        <view class="addCard-icon">
          <u-icon name="plus" size="100"></u-icon>
        </view>
            <view class="addCard-icon"><u-icon name="plus" size="100"></u-icon></view>
      </view>
    </view>
@@ -692,6 +653,7 @@
<script>
import combinationTitle from '@/components/common/combined-title/combined-title.vue';
import popupMenu from '@/components/common/popup-menu/popup-menu.vue';
import { callWithErrorHandling } from 'vue';
// 最大显示的日期
const d = new Date();
@@ -702,6 +664,11 @@
export default {
  data() {
    return {
         noticeText:'左右滑动表格可查看更多详情',
         // 账套选择器
         selectLedgerShow: false,
         ledgerList: [],
         ledgerName: '',
      // accountMsgType: 'error',
      tdStyle: 'max-height: 30px;overflow: auto;',
      spanStyle: 'overflow:auto',
@@ -725,7 +692,9 @@
        quant: null,
        remark: '',
        startDate: '',
        type: ''
            type: '',
            ledgerId: null
            // ledgerName:''
      },
      accountDetails: {},
      // 时间
@@ -770,7 +739,6 @@
      // 时间
      timeShow: false,
      mode: 'range',
      maxDate: `${year}-${month}-${date + 70}`,
      // 选择客户
      selectCustomerData: {
        compIds: '',
@@ -795,10 +763,16 @@
      selectCustomerActions: [],
      // 级别
      selectLevelShow: false,
      levelList: [{name: '一星级', value: 'A'}, {name: '二星级', value: 'B'}, {name: '三星级', value: 'C'}, {
         levelList: [
            { name: '一星级', value: 'A' },
            { name: '二星级', value: 'B' },
            { name: '三星级', value: 'C' },
            {
        name: '四星级',
        value: 'D'
      }, {name: '五星级', value: 'E'}],
            },
            { name: '五星级', value: 'E' }
         ],
      // 选择合同
      selectContractShow: false,
      searchContractForm: {
@@ -826,31 +800,7 @@
      addContractShow: false,
      // 添加合同表单
      addContractRules: {},
      addContractFormdata: {
        // amount: null,
        // coalId: null,
        // coalName: '',
        // compId: null,
        // compName: '',
        // cost1: '',
        // cost2: '',
        // customerId: null,
        // customerName: '',
        // edit: true,
        // favouredpolicyIds: '',
        // filedId: null,
        // filedName: '',
        // fromStation: '',
        // modifyId: null,
        // modifyInfoId: null,
        // customerAddressId: null,
        // price: null,
        // priceMode: '0',
        // quant: '',
        // toStation: '',
        // trainType: 1,
        // type: ''
      },
         addContractFormdata: {},
      contractDetails: [], // 选择的合同详情
      // 选择煤厂
      coalFiledSelectShow: false,
@@ -873,27 +823,7 @@
      // 品种价格表格
      loading: false,
      // 价格请求参数
      getNewPriceData: {
        // compId: 133,
        // compName: '邢台矿',
        // customerAddressName: '邢台国泰发电有限责任公司',
        // customerAddressId: 236,
        // coalId: 45,
        // coalName: '',
        // trainType: 1,
        // fromStation: '小康庄',
        // toStation: '小康庄',
        // quant: '',
        // price: '',
        // amount: '',
        // priceMode: null,
        // filedName: '邢台矿主煤场',
        // filedId: 4,
        // type: '',
        // cost1: '',
        // cost2: '',
        // edit: true
      },
         getNewPriceData: {},
      dust: null, // 抑尘费
      trainfreight: {}, //路运运费
      // 运输类型
@@ -948,7 +878,6 @@
          this.addContractFormdata.favouredpolicyIds = favouredpolicyIds;
        }
      }
      return temp;
    },
    showPrice() {
@@ -975,20 +904,15 @@
        //运距
        if (this.addContractFormdata.trainType == 2) {
          if (e.type.indexOf('A') != -1) {
            //根据发站到站获取运距
            list.push(e);
                  list.push(e); //根据发站到站获取运距
          }
        }
      });
      this.favouredpolicyList = list;
      return true;
    },
    async currentRowComputed() {
      console.log('currentRowComputed');
      //变价格用的
      this.changePriceMode(this.addContractFormdata.priceMode);
         this.changePriceMode(this.addContractFormdata.priceMode); //变价格用的
      //变订单量
      if (this.addContractFormdata.price > 0 && (this.addContractFormdata.amount > 0 || this.addContractFormdata.quant > 0)) {
        let price = this.addContractFormdata.price;
@@ -998,7 +922,7 @@
          this.addContractFormdata.cost1 = null; //运费
          this.addContractFormdata.cost2 = null; //抑尘费
        } else if (this.addContractFormdata.trainType == 2) {
          //如果路运价格增加抑尘费和运费
               //如果路运价格增加,抑尘费和运费
          let cost1Price = await this.getFreight(this.addContractFormdata.fromStation, this.addContractFormdata.toStation, this.addContractFormdata.customerAddressId); //路运运费
          price += cost1Price;
          price += this.dust;
@@ -1015,31 +939,6 @@
      }
      return true;
    }
    // accountMsg() {
    //    this.accountMsgType = 'error';
    //    if (this.accountDetails) {
    //       if (this.accountDetails.balanceType == '贷') {
    //          return '客户账户余额当前处于欠款状态!';
    //       } else {
    //          let amount = 0;
    //          this.newFormData.contractOrders.forEach(e => {
    //             amount += Number(e.amount);
    //          });
    //          if (this.newFormData.payType == '0') {
    //             if (this.accountDetails.balance < amount) {
    //                return '客户账户现汇余额不足,现汇余额:' + this.accountDetails.balance;
    //             }
    //          } else {
    //             if (this.accountDetails.balance2 < amount) {
    //                return '客户账户承兑余额不足,承兑余额:' + this.accountDetails.balance2;
    //             }
    //          }
    //       }
    //       this.accountMsgType = 'warning';
    //       return '客户账户现汇余额:' + this.accountDetails.balance + ',承兑余额:' + (this.accountDetails.balance2 ? this.accountDetails.balance2 : 0);
    //    }
    //    return null;
    // }
  },
  watch: {
    // 立即处理 进入页面就触发 // immediate: true,
@@ -1076,6 +975,7 @@
      }
    },
    init() {
         this.getLedgerList();
      this.jcfavouredpolicyitem();
      this.coalfiled();
      this.coalprice();
@@ -1091,6 +991,44 @@
        });
      });
    },
      /**
       * 获取分类账套
       */
      getLedgerList() {
         this.$reqGet('zhaccountledger', { compId: uni.getStorageSync('userInfo').compId }).then(res => {
            this.ledgerList.push(res.data.records);
            console.log('账套列表', this.ledgerList);
            if (res.data.records) {
               this.newFormData.ledgerId = res.data.records[0].id;
               // this.newFormData.ledgerName = res.data.records[0].name;
               this.ledgerName = res.data.records[0].name;
            }
         });
      },
      selectLedger() {
         this.selectLedgerShow = true;
      },
      selectLedgerChange(index) {
         console.log('账套选择器', index);
         this.ledgerName = index.value[0].name;
         this.newFormData.ledgerId = index.value[0].id;
         // this.newFormData.ledgerName = index.value[0].name;
         if (this.newFormData.customerName || this.newFormData.contractNum || this.newFormData.contractName) {
            this.newFormData.customerName = '';
            this.newFormData.contractNum = '';
            this.newFormData.contractName = '';
         }
      },
      selectLedgerConfirm(index) {
         console.log('选择账套点击确定', index);
         this.selectLedgerShow = false;
      },
      selectLedgerCancel() {
         this.selectLedgerShow = false;
      },
      selectLedgerClose() {
         this.selectLedgerShow = false;
      },
    // 选择客户
    selectCustomer() {
      this.selectLevelShow = false;
@@ -1101,7 +1039,6 @@
      this.selectCustomerShow = true;
      this.selectCustomerData.current = 1;
      this.$reqGet('customer', this.selectCustomerData).then(res => {
        console.log('客户呵呵哈哈哈或', res);
        uni.hideLoading();
        if (res.code == 0) {
          this.customerData = res.data.records;
@@ -1111,7 +1048,6 @@
    },
    // 客户选择弹框打开了
    selectCustomerOpen() {
      // this.spanStyle = 'overflow:hidden'; //当蒙层弹起时,固定界面禁止滚动,当蒙层关闭时,允许滚动
    },
    selectCustomerClose() {
@@ -1168,12 +1104,13 @@
      console.log('外层客户选择', v);
      this.newFormData.customerName = v.customerName;
      this.newFormData.customerId = v.id;
      this.$reqGet('getAccount', {customerId: v.id}).then(res => {
         this.$reqGet('getAccount', { customerId: v.id, ledgerId: this.newFormData.ledgerId }).then(res => {
        console.log('客户选择账户', res);
        this.accountDetails = res.data;
        this.searchContractForm.customerName = res.data.customerName;
        this.reqContract();
        this.$nextTick(() => {
               console.log('zhezhezhe');
          this.contractData.forEach(item => {
            this.contractNumList.push(item.num);
          });
@@ -1211,9 +1148,10 @@
    // 时间
    confirmTime(v) {
      this.timeShow = false;
         console.log('时间', v);
      v.forEach(e => {
        this.newFormData.startDate = v[0];
        this.newFormData.endDate = v[v.lenght - 1];
            this.newFormData.endDate = v[v.length - 1];
        this.timeDataStr = v[0] + ' 至 ' + v[v.length - 1];
      });
    },
@@ -1224,12 +1162,11 @@
        if (this.newFormData.contractOrders != []) {
          uni.showToast({
            title: '添加订单后,不能修改合同!',
            icon: 'error',
                  icon: 'none',
            duration: 2000
          });
        }
        this.selectContractShow = true;
      } else {
        this.$refs.formRef
            .validate()
@@ -1245,10 +1182,6 @@
    searchContractFormTypeFocus() {
      // 类型弹出框
      this.selectContractTypeShow = true;
      // 弹出框类型请求
      // this.$nextTick(() => {
      // });
    },
    // 选择合同弹框
    selectContractOpen() {
@@ -1350,10 +1283,11 @@
      // 选定合同详情
      uni.showLoading({
        title: '加载中...'
      })
      this.$reqGet('getByContractId', {}, e.id).then(res => {
         });
         this.$reqGet('getByContractId', {}, e.id)
            .then(res => {
        uni.hideLoading();
        this.contractDetails = res.data
               this.contractDetails = res.data;
        this.contractDetails.forEach(item => {
          let a = [{label: '', id: ''}];
          a[0].label = item.coalName;
@@ -1363,12 +1297,12 @@
          }
          this.addContractCoalData.push(a);
        });
      }).catch(err => {
        console.log(err);
      })
            .catch(err => {
               console.log(err);
            });
      // 添加煤种选项
    },
    // 添加合同按钮
    addContractClick() {
@@ -1379,7 +1313,7 @@
            if (this.accountDetails.balanceType == '贷') {
              uni.showToast({
                title: '客户账户余额当前处于欠款状态!',
                icon: 'error',
                     icon: 'none',
                duration: 2000
              });
            } else {
@@ -1459,7 +1393,6 @@
      this.getNewPriceData.filedId = e.id;
      this.getNewPriceData.filedName = e.name;
      this.coalFiledSelectShow = false;
    },
    // 收货人
@@ -1467,26 +1400,14 @@
      this.addContractConsigneeShow = false;
    },
    // 添加合同子项收货人打开
    addContractConsigneeOpen() {
    },
      addContractConsigneeOpen() {},
    addContractConsignee() {
      this.addContractConsigneeShow = true;
    },
    addContractConsigneeConfirm(v) {
      console.log('收货人', v);
      this.addContractFormdata.toStation = v.toStation;
      this.addContractFormdata.customerName = v.customerName;
      this.addContractFormdata.customerId = v.id;
      this.$reqGet('getAccount', {customerId: v.id}).then(res => {
        console.log('获取收货人账号', res);
        // this.accountDetails = res.data;
        // this.newFormData.customerName = res.data.customerName;
        // this.newFormData.customerId = res.data.id;
        // this.searchContractForm.customerName = res.data.customerName;
      });
      this.$nextTick(() => {
        this.addContractConsigneeShow = false;
      });
      // 赋值给取价格请求参数
      this.getNewPriceData.customerAddressName = v.customerFullName;
@@ -1495,8 +1416,7 @@
      this.addContractFormdata.toStation = v.toStation;
      this.addContractFormdata.customerAddressId = v.id;
         this.addContractConsigneeShow = false;
    },
    // 品种选择器
    addContractCoalConfirm(e) {
@@ -1607,12 +1527,12 @@
        if (this.editApplicationIndex != null) {
          this.newFormData.contractOrders[this.editApplicationIndex] = this.addContractFormdata;
        } else {
               this.addContractFormdata.type = this.newFormData.type
               this.addContractFormdata.type = this.newFormData.type;
          this.newFormData.contractOrders.push(this.addContractFormdata);
          console.log('添加子订单', this.addContractFormdata);
        }
        this.addContractShow = false;// 关闭弹出框
        console.log('this.newFormData.contractOrders当前关闭后', this.newFormData.contractOrders)
            console.log('this.newFormData.contractOrders当前关闭后', this.newFormData.contractOrders);
      } else {
        uni.$u.toast('请规范输入所有信息');
      }
@@ -1705,7 +1625,7 @@
                let msg = this.accountDetails.balance == null ? 0 : this.accountDetails.balance;
                uni.showToast({
                  title: '客户账户现汇余额不足,现汇余额:' + msg,
                  icon: 'error',
                        icon: 'none',
                  duration: 2000
                });
              } else {
@@ -1720,7 +1640,7 @@
                let msg = this.accountDetails.balance2 == null ? 0 : this.accountDetails.balance2;
                uni.showToast({
                  title: '客户账户承兑余额不足,承兑余额:' + msg,
                  icon: 'error',
                        icon: 'none',
                  duration: 2000
                });
              } else {
@@ -1752,19 +1672,13 @@
        uni.hideLoading();
        console.log('新建发运申请', res);
        if (res.code == 0) {
          // uni.showToast({
          //    title: '添加成功!',
          //    icon: 'success',
          //    duration: 1000
          // });
          this.$u.toast('添加成功,即将返回申请页!!!')
               this.$u.toast('添加成功,即将返回申请页!!!');
          setTimeout(() => {
            uni.navigateBack({
              // url: '/pages/my-application/my-application'
              delta: 2
            });
          }, 2000)
               }, 1500);
        }
      });
    },
@@ -1856,9 +1770,13 @@
              margin-top: vww(16);
            }
                  // 滚动通知
                  .tapStyle{
                     margin-top: vww(30);
                  }
            // 合同表格
            .tableContract {
              margin-top: vww(30);
              display: flex;
              justify-content: center;