付延余
2022-07-28 548b97b82e741b67c4258661352ae28462a34f66
pages/edit-my-application/edit-my-application.vue
@@ -10,32 +10,35 @@
      <!-- <u-notify :message="accountMsg" :show="trueMsg" :type="accountMsgType"></u-notify> -->
      <!-- <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 labelWidth="20%" label="结算客户" prop="customerName" borderBottom ref="customerNameRef">
      <u--form labelPosition="left" :model="newFormData"  ref="formRef">
        <u-form-item labelWidth="20%" label="结算客户"  borderBottom ref="customerNameRef">
               <u--input v-model="newFormData.customerName" disabled disabledColor="#ffffff" border="none"></u--input>
            </u-form-item>
            <u-form-item  labelWidth="20%" label="合同编号" prop="contractNum" borderBottom ref="contractNumRef">
        <u-form-item labelWidth="20%" label="合同编号"  borderBottom ref="contractNumRef">
               <u--input v-model="newFormData.contractNum" disabled disabledColor="#ffffff" 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 labelWidth="20%" label="付款方式" borderBottom ref="payTypeRef">
               <u--input :value="newFormData.payType == '0' ? '现汇':'承兑'" disabled disabledColor="#ffffff" placeholder="请选择付款方式" border="none"></u--input>
          <u--input :value="newFormData.payType == '0' ? '现汇':'承兑'" 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-form-item @click="timeShow = true" labelWidth="20%" label="日期" borderBottom
                     ref="timeDataRef">
               <u--input v-model="timeDataStr" border="none" placeholder="请选择范围日期"></u--input>
               <u-icon slot="right" name="arrow-right"></u-icon>
            </u-form-item>
            <u-form-item labelWidth="20%" label="编号" borderBottom>
               <u--input border="none" disabled disabledColor="#ffffff" value="自动生成" placeholder="请输入编号"></u--input>
          <u--input border="none" disabled disabledColor="#ffffff" v-model="newFormData.number" placeholder="请输入编号"></u--input>
            </u-form-item>
         </u--form>
      </view>
      <!-- 申请日历、范围时间 -->
      <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"
                :maxDate="maxDate"></u-calendar>
      <!-- 申请付款方式弹出菜单 -->
      <!-- <u-action-sheet :show="showPayType" :actions="actions" title="请选择付款方式" @close="showPayType = false" @select="sexSelect"></u-action-sheet> -->
@@ -242,11 +245,6 @@
 -->
      <!-- 添加合同子项 -->
      <view class="addContractContainer">
         <u-popup :show="addContractShow" @close="addContractClose" @open="addContractOpen" mode="bottom" round="22">
@@ -257,7 +255,8 @@
                  <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>
@@ -276,19 +275,24 @@
                                 <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>
@@ -298,32 +302,42 @@
                                 <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>
@@ -368,15 +382,22 @@
                              </view>
                           </view>
                        </template>
                        <u-form-item @click="addContractTransportShow = true" label="运输" labelWidth="20%" ref="item1"><u--input v-model="addContractTransport"></u--input></u-form-item>
                <u-form-item @click="addContractTransportShow = true" label="运输" labelWidth="20%" ref="item1">
                  <u--input v-model="addContractTransport"></u--input>
                </u-form-item>
                     </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-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-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>
@@ -386,12 +407,15 @@
                     <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="添加" type="primary" @click="addContractSanConfirm"></u-button></view>
            <view class="addContractConfirm">
              <u-button text="添加" 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>
@@ -423,11 +447,16 @@
                           <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>
@@ -439,23 +468,30 @@
               <!-- 选择收货人 -->
               <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-show="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-show="searchCustomerForm.compName != ''"
                                @click="searchCustomerForm.compName = ''"></u-icon>
                                 </u-form-item>
                                 <u-form-item labelWidth="20%" label="客户名称" borderBottom ref="timeDataRef">
                                    <u--input v-model="selectCustomerData.customerName" border="none" placeholder="输入客户名称"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-show="selectCustomerData.customerName != ''" @click="selectCustomerData.customerName = ''"></u-icon>
                        <u--input v-model="selectCustomerData.customerName" border="none"
                                  placeholder="输入客户名称"></u--input>
                        <u-icon slot="right" name="close-circle-fill" v-show="selectCustomerData.customerName != ''"
                                @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-show="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-show="searchCustomerForm.levelText != ''"
                                @click="searchCustomerForm.levelText = ''"></u-icon>
                                 </u-form-item>
                              </u--form>
                           </view>
@@ -489,7 +525,8 @@
                              </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">
@@ -503,7 +540,8 @@
                           </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>
@@ -560,13 +598,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.balanceTotal }},承兑余额:{{ accountDetails.balance2 == null ? 0 : customerChengdui }}</text>
        <text style="color: #FFA500;;">客户账户现汇余额:{{
            accountDetails.balanceTotal
          }},承兑余额:{{ accountDetails.balance2 == null ? 0 : customerChengdui }}
        </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="" class="cardListIcon" @click="editApplicationClick(index)">
                     <u-icon name="edit-pen" color="#2979ff" size="35"></u-icon>
@@ -616,7 +660,9 @@
         </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>
@@ -644,30 +690,29 @@
   data() {
      return {
         applicationOrderIndex:null,
         tdStyle: 'max-height: 30px;overflow: scroll;',
         spanStyle: 'overflow:auto',
         newFormData: {
            amount: null,
            coalId: '',
            coalName: '',
            contractId: 169,
            contractName: '',
            contractNum: '',
            contractOrders: [],
            customerAddressId: '',
            customerId: 236,
            customerName: '',
            endDate: '',
            executiveQuant: null,
            id: null,
            number: '',
            payType: '',
            price: null,
            quant: null,
            remark: '',
            startDate: '',
            type: '外销'
        // amount: null,
        // coalId: '',
        // coalName: '',
        // contractId: 169,
        // contractName: '',
        // contractNum: '',
        // contractOrders: [],
        // customerAddressId: '',
        // customerId: 236,
        // customerName: '',
        // endDate: '',
        // executiveQuant: null,
        // id: null,
        // number: '',
        // payType: '',
        // price: null,
        // quant: null,
        // remark: '',
        // startDate: '',
        // type: '外销'
         },
         accountDetails: {},
         // 时间
@@ -680,34 +725,34 @@
         actions: [],
         selectValue: '',
         rules: {
            customerName: [
               {
                  required: true,
                  message: '请选择结算客户',
                  trigger: ['blur', 'change']
               }
            ],
            contractNum: [
               {
                  required: true,
                  message: '请选择合同编号',
                  trigger: ['blur', 'change']
               }
            ],
            payType: [
               {
                  required: true,
                  message: '请选择付款方式',
                  trigger: ['blur', 'change']
               }
            ],
            startDate: [
               {
                  required: true,
                  message: '请选择时间',
                  trigger: ['blur', 'change']
               }
            ]
        // customerName: [
        //   {
        //     required: true,
        //     message: '请选择结算客户',
        //     trigger: ['blur', 'change']
        //   }
        // ],
        // contractNum: [
        //   {
        //     required: true,
        //     message: '请选择合同编号',
        //     trigger: ['blur', 'change']
        //   }
        // ],
        // payType: [
        //   {
        //     required: true,
        //     message: '请选择付款方式',
        //     trigger: ['blur', 'change']
        //   }
        // ],
        // startDate: [
        //   {
        //     required: true,
        //     message: '请选择时间',
        //     trigger: ['blur', 'change']
        //   }
        // ]
         },
         // 时间
         timeShow: false,
@@ -737,7 +782,10 @@
         selectCustomerActions: [],
         // 级别
         selectLevelShow: false,
         levelList: [{ name: '一星级', value: 'A' }, { name: '二星级', value: 'B' }, { name: '三星级', value: 'C' }, { name: '四星级', value: 'D' }, { name: '五星级', value: 'E' }],
      levelList: [{name: '一星级', value: 'A'}, {name: '二星级', value: 'B'}, {name: '三星级', value: 'C'}, {
        name: '四星级',
        value: 'D'
      }, {name: '五星级', value: 'E'}],
         // 选择合同
         // selectContractShow: false,
         // searchContractForm: {
@@ -761,31 +809,41 @@
         // 添加合同
         addContractShow: false,
         // 添加合同表单
         addContractRules: {},
      addContractRules: {
        // compName: [
        //   {
        //     required: true,
        //     message: '请选择煤厂',
        //     trigger: ['blur', 'change']
        //   }
        // ],
      },
         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: ''
        // id:null,
        // 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: '',
        // quant: '',
        // toStation: '',
        // trainType: 1,
        // type: ''
            
         },
         contractDetails: [], // 选择的合同详情
@@ -872,11 +930,10 @@
   },
   computed: {
      afterPrice() {
         console.log(this.currentCoal,'this.currentCoal---computed')
         let temp = this.currentCoal;
         console.log(temp,'temp======================')
      let temp = Object.assign({},this.currentCoal);
         let favouredpolicyIds = '';
         if (this.favouredpolicyList.length > 0) {
        console.log('变后的价格',this.multipleSelection,temp,this.currentCoal);
            this.multipleSelection.forEach(e => {
               if (favouredpolicyIds.length > 0) {
                  favouredpolicyIds += ',';
@@ -891,7 +948,6 @@
               this.addContractFormdata.favouredpolicyIds = favouredpolicyIds;
            }
         }
      console.log(temp,'quotePrice1111111111111111======111111111111111111111111')
         return temp;
      },
      showPrice() {
@@ -927,46 +983,34 @@
         return true;
      },
      async currentRowComputed() {
         console.log('进入计算,currentRowComputed');
         console.log('路运-------------进来',this.addContractFormdata,'this.addContractFormdata-----');
      
         //变价格用的
         this.changePriceMode(this.addContractFormdata.priceMode);
         //变订单量
      if (this.addContractFormdata.id != null) {
         if (this.addContractFormdata.price > 0 && (this.addContractFormdata.amount > 0 || this.addContractFormdata.quant > 0)) {
            console.log('路运-------------进来',this.addContractFormdata,'this.addContractFormdata-----222222222222222222222');
            let price = this.addContractFormdata.price;
            if (this.addContractFormdata.trainType == 1) {
               console.log('地销');
               let q = this.addContractFormdata.amount / price;
               this.addContractFormdata.quant = q.toFixed(2);
               this.addContractFormdata.cost1 = null; //运费
               this.addContractFormdata.cost2 = null; //抑尘费
            } else if (this.addContractFormdata.trainType == 2) {
               console.log('路运',this.addContractFormdata,'this.addContractFormdata-----');
               //如果路运价格增加抑尘费和运费
               let cost1Price = await this.getFreight(this.addContractFormdata.fromStation, this.addContractFormdata.toStation, this.addContractFormdata.customerAddressId); //路运运费
               console.log('运费',cost1Price);
               price += cost1Price;
               console.log(price,'price======')
               price += this.dust;
               console.log(this.addContractFormdata.quant,'this.addContractFormdata.quant===')
               this.addContractFormdata.cost1 = (this.addContractFormdata.quant * cost1Price).toFixed(2); //运费
               this.addContractFormdata.cost2 = (this.addContractFormdata.quant * this.dust).toFixed(2); //抑尘费
         
               let amount = Number(price * this.addContractFormdata.quant) + Number(this.addContractFormdata.cost1) + Number(this.addContractFormdata.cost2);
               console.log('金额',amount,price,Number(price * this.addContractFormdata.quant),Number(this.addContractFormdata.cost1),Number(this.addContractFormdata.cost2));
               console.log('quant:'+this.addContractFormdata.quant,'cost1:'+this.addContractFormdata.cost1,'cost2:'+this.addContractFormdata.cost2);
               this.addContractFormdata.amount = amount.toFixed(2);
          }
            }
         } else {
            this.addContractFormdata.quant = null;
         }
         // if (this.currentRow.quant > 0 && this.currentRow.price > 0) {
         //   this.currentRow.amount = this.currentRow.quant * this.currentRow.price;
         //   return true;
         // }
         return true;
      }
      // accountMsg() {
@@ -1018,7 +1062,6 @@
   },
   methods: {
      async jisuanAmount() {
         console.log('进入计算');
         if (this.addContractFormdata.trainType == 2) {
            let price = this.addContractFormdata.price;
            //如果路运价格增加抑尘费和运费
@@ -1042,17 +1085,33 @@
         this.getFavouredPolicyItem();
         this.editApplicationFormData(); // 修改申请表单详情
      },
      editApplicationFormData(){
         this.$reqGet('formData',{},this.editApplicationTableId).then(res=>{
    // 初始化申请表单
    async editApplicationFormData() {
      uni.showLoading({
        title:'加载中...'
      })
      // 通过申请id获取表单
      await this.$reqGet('formData', {}, this.editApplicationTableId).then(res => {
        uni.hideLoading();
            console.log('整体详情',res.data);
            this.newFormData = res.data;
            this.timeDataStr = this.newFormData.startDate;
         })
      // 获取合同详情,煤种
      await this.getContractDetails();
      // 初始化当前申请客户账户情况
      if(this.newFormData.customerId){
        await this.$reqGet('getAccount', {customerId: this.newFormData.customerId}).then(res => {
          this.accountDetails = res.data;
        });
      }
      },
      editApplicationClick(index){
         this.applicationOrderIndex = index;// 待修改订单index
         this.addContractFormdata = this.newFormData.contractOrders[index];
         console.log('修改的订单详情1',this.addContractFormdata,index,this.newFormData.contractOrders);
      this.addContractFormdata = Object.assign({},this.newFormData.contractOrders[index]);
      console.log('修改指定订单表单----------',this.addContractFormdata.id,this.addContractFormdata);
         this.addContractFormdata.priceMode = this.newFormData.contractOrders[this.applicationOrderIndex].priceMode.toString();
         // 修改订单优惠初始化
         if(this.newFormData.contractOrders[index].favouredpolicyIds){
@@ -1064,12 +1123,18 @@
         
         // 获取价格
         // this.getNewPriceData = this.addContractFormdata;
         this.getNewPriceData.type = this.newFormData.type;
         this.getNewPriceData.customerAddressName = this.addContractFormdata.customerFullName;
         this.getNewPriceData.customerAddressId = this.addContractFormdata.id;
         this.getNewPriceData.toStation = this.addContractFormdata.toStation;
         this.getNewPriceData.coalId = this.addContractFormdata.coalId;
         this.getNewPriceData.coalName =this.addContractFormdata.coalName;
      this.getNewPriceData.compName = this.newFormData.contractOrders[this.applicationOrderIndex].compName;
      this.getNewPriceData.traninType = this.newFormData.contractOrders[this.applicationOrderIndex].traninType;
      this.getNewPriceData.compId = this.newFormData.contractOrders[this.applicationOrderIndex].compId;
      this.getNewPriceData.fromStation = this.newFormData.contractOrders[this.applicationOrderIndex].fromStation;
      this.getNewPriceData.toStation = this.newFormData.contractOrders[this.applicationOrderIndex].toStation;
      this.getNewPriceData.filedId = this.newFormData.contractOrders[this.applicationOrderIndex].filedId;
      this.getNewPriceData.filedName = this.newFormData.contractOrders[this.applicationOrderIndex].filedName;
      this.getNewPriceData.customerAddressName = this.newFormData.contractOrders[this.applicationOrderIndex].customerAddressName;
      this.getNewPriceData.customerAddressId = this.newFormData.contractOrders[this.applicationOrderIndex].customerAddressId;
      this.getNewPriceData.toStation = this.newFormData.contractOrders[this.applicationOrderIndex].toStation;
      this.getNewPriceData.coalId = this.newFormData.contractOrders[this.applicationOrderIndex].coalId;
      this.getNewPriceData.coalName = this.newFormData.contractOrders[this.applicationOrderIndex].coalName;
         // 获取合同煤种价格
         this.getNewPrice();
         
@@ -1097,14 +1162,11 @@
            break;
         }
         
         // 获取合同详情,煤种
         this.getContractDetails();
         
         this.$nextTick(()=>{
            this.addContractShow = true;            
         })
         
         console.log('修改的订单详情',this.addContractFormdata);
      },
      getContractDetails(){
         uni.showLoading({
@@ -1375,9 +1437,9 @@
      // 添加订单按钮
      addContractClick() {
         // 打印true或false
         this.$refs.formRef
            .validate()
            .then(res => {
      // this.$refs.formRef
      //     .validate()
      //     .then(res => {
               if (this.accountDetails.balanceType == '贷') {
                  uni.showToast({
                     title: '客户账户余额当前处于欠款状态!',
@@ -1441,23 +1503,22 @@
                     // 获取合同详情,煤种
                     this.getContractDetails();
                     
                     // console.log('this.addContractFormdata',this.addContractFormdata);
                     this.multipleSelection = [];
                  }
               }
            })
            .catch(err => {
               uni.$u.toast('效验失败');
            });
          // })
          // .catch(err => {
          //   uni.$u.toast('效验失败');
          // });
      },
      // 添加合同弹出框
      addContractClose() {
         this.addContractFormdata = {};
         this.addContractShow = false;
      this.addContractFormdata = {};
      this.applicationOrderIndex = null;
      },
      addContractOpen() {
         console.log('添加申请子项窗口打开this.addContractFormdata',this.addContractFormdata);
         // console.log('添加订单打开');
      console.log('添加订单打开');
      },
      // 选择煤厂
      coalFiledSelectOpen(e) {
@@ -1558,7 +1619,7 @@
         
                  this.addContractFormdata.price = data.steelMillPrice;
                  this.addContractFormdata.modifyId = data.modifyId;
                  this.addContractFormdata.id = data.id;
            // this.addContractFormdata.id = data.id;
               } else {
                  uni.$u.toast('煤种价格未设置');
               }
@@ -1573,23 +1634,14 @@
         // console.log('单选框小组', e);
      },
      changePriceMode(e) {
         console.log('进入单选框',this.addContractFormdata,'this.addContractFormdata===111');
         if (!this.currentCoal) return;
         console.log('单选框数字',e,this.addContractFormdata.priceMode);
         console.log('进入单选框',this.addContractFormdata,'this.addContractFormdata===2222');
         if(e){
            this.addContractFormdata.priceMode = e;
            console.log('进入单选框',this.addContractFormdata,'this.addContractFormdata===3333');
            console.log(typeof this.addContractFormdata.priceMode,this.addContractFormdata.priceMode,'this.addContractFormdata.priceMode=======字符串')
         }
         console.log(this.afterPrice,'this.afterPrice.quotePrice=======afterPrice222222');
                  console.log(this.afterPrice.cokingPrice,'this.afterPrice.quotePrice=======afterPrice222222------------');
         console.log(this.afterPrice.quotePrice,'this.afterPrice.quotePrice=======afterPrice222222------------')
         this.addContractFormdata.price = this.afterPrice.quotePrice;
         console.log(this.addContractFormdata.price,'this.addContractFormdata.price=====afterPrice333333333333')
         switch (this.addContractFormdata.priceMode) {
            case '0':
               console.log('价格',this.afterPrice.steelMillPrice);
               this.addContractFormdata.price = this.afterPrice.steelMillPrice;
               break;
            case '1':
@@ -1600,7 +1652,6 @@
               break;
            case '3':
               this.addContractFormdata.price = this.afterPrice.quotePrice;
               console.log('进入单选框',this.addContractFormdata,'this.addContractFormdata===444');
               break;
         }
      },
@@ -1660,8 +1711,6 @@
               this.applicationOrderIndex = null; // 初始化修改订单index
               this.$u.toast('修改成功');   
            }
         } else {
            uni.$u.toast('请规范输入所有信息');
         }
@@ -1738,6 +1787,7 @@
      // },
      // 新建发运申请
      newApplicationFormDataClick() {
      console.log('提交申请按钮');
         this.$refs.formRef
            .validate()
            .then(res => {
@@ -1757,6 +1807,9 @@
                        duration: 2000
                     });
                  } else {
                uni.showLoading({
                  title:'加载中...'
                });
                     this.editShenQing();
                     // this.xswaybill();
                  }
@@ -1772,8 +1825,10 @@
                        duration: 2000
                     });
                  } else {
                uni.showLoading({
                  title:'加载中...'
                });
                     this.editShenQing();
                     // this.xswaybill();
                  }
               }
@@ -1792,21 +1847,15 @@
               'TENANT-ID': 5,
               Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
               VERSION: 'zzl'
            },
         }).then(res=>{
            // console.log(res);
            if(res.code == 0){
               uni.showToast({
                  title:'修改成功',
                  icon:'success',
                  duration:2000
               })
               this.$u.toast('修改成功')
            }
      }).then(res => {
        uni.hideLoading();
        this.$u.toast('修改成功');
        this.$nextTick(() => {
            uni.navigateBack({
                  delta: 1
               });
        })
         })
      },
      // 删除订单卡片
@@ -1855,11 +1904,13 @@
   .newApplicationTitle {
      margin-bottom: 0;
   }
   // 表单
   .formDataContaniner {
      .u-form {
         width: 91%;
         margin: 0 auto 0;
         .u-form-item {
            .u-form-item__body {
               .u-form-item__body__left {
@@ -1868,6 +1919,7 @@
                     }
                  }
               }
               .u-form-item__body__right {
                  .u-form-item__body__right__content {
                     .u-form-item__body__right__content__slot {
@@ -1884,11 +1936,14 @@
      .u-popup {
         .u-transition {
            height: 95%;
            .u-popup__content {
               overflow: scroll !important;
               .selectCustomerTitle {
                  margin-bottom: 0;
               }
               .selectCustomerContainer {
                  padding: 0 4%;
                  // .loadmoreClass{
@@ -1901,13 +1956,16 @@
                  // }
                  .searchContainer {
                  }
                  .searchCustomerBtn {
                     margin-top: vww(10);
                     display: flex;
                     .u-button {
                        width: 30%;
                     }
                  }
                  // 数据列表
                  .searchResultList {
                     margin-top: vww(16);
@@ -1918,12 +1976,15 @@
                     margin-top: vww(30);
                     display: flex;
                     justify-content: center;
                     .uni-table-scroll {
                        min-width: 0 !important;
                        .uni-table {
                           .uni-table-tr {
                              padding: 0;
                              font-size: vww(13);
                              .uni-table-th {
                                 width: vww(100);
                                 height: vww(32);
@@ -1942,15 +2003,19 @@
                           }
                        }
                     }
                     .tableBody {
                        width: 80%;
                     }
                     .TableUtilBtn {
                        width: 20%;
                        overflow: hidden;
                        .uni-table {
                           min-width: 0 !important;
                        }
                        .TableUtilBtnContainer {
                           .u-button {
                              width: vww(20);
@@ -1992,6 +2057,7 @@
                        }
                     }
                  }
                  .selectContractEndTime {
                     .u-popup {
                        .u-transition {
@@ -2010,8 +2076,10 @@
      .u-popup {
         .u-transition {
            height: 95%;
            .u-popup__content {
               overflow: scroll !important;
               .addContractFormTitle {
                  margin-bottom: 0;
               }
@@ -2019,11 +2087,13 @@
               // 搜索
               .coalFiledSelectSearch {
               }
               // 选择煤种
               .coalFiledSelectPopup {
                  .u-popup {
                     .u-transition {
                        height: 80%;
                        .u-popup__content {
                           overflow: scroll !important;
                           // 表格
@@ -2032,12 +2102,15 @@
                              display: flex;
                              justify-content: center;
                              margin: 0 auto;
                              .uni-table-scroll {
                                 min-width: 0 !important;
                                 .uni-table {
                                    .uni-table-tr {
                                       padding: 0;
                                       font-size: vww(13);
                                       .uni-table-th {
                                          width: vww(100);
                                          height: vww(32);
@@ -2056,15 +2129,19 @@
                                    }
                                 }
                              }
                              .tableBody {
                                 width: 80%;
                              }
                              .TableUtilBtn {
                                 width: 20%;
                                 overflow: hidden;
                                 .uni-table {
                                    min-width: 0 !important;
                                 }
                                 .TableUtilBtnContainer {
                                    .u-button {
                                       width: vww(20);
@@ -2086,9 +2163,11 @@
      .u-popup {
         .u-transition {
            height: 95%;
            .u-popup__content {
               // background-color: rgb(247, 247, 247);
               overflow: scroll !important;
               .addContractForm {
                  width: 92%;
                  margin: 0 auto;
@@ -2125,16 +2204,19 @@
                        box-shadow: 0 2px 16px #e5e5e5, 0 0 1px #e5e5e5, 0 0 1px #e5e5e5;
                        // margin-top:vww(10);
                        background-color: #ffffff;
                        .currentPriceContainer {
                           .currentPriceBox {
                              width: 92%;
                              margin: 0 auto;
                           }
                        }
                        .selectPriceContainer {
                           .selectPricebox {
                              width: 92%;
                              margin: 0 auto;
                              .selectPriceboxItem {
                                 display: flex;
                                 justify-content: space-between;
@@ -2143,6 +2225,7 @@
                        }
                     }
                  }
                  .formDownCard {
                     border-radius: vww(4);
                     padding: vww(10);
@@ -2175,10 +2258,12 @@
      width: 100%;
      padding: vww(0) vww(10) vww(60) vww(10);
      box-sizing: border-box;
      .u-swipe-action {
         .u-swipe-action-item {
            box-shadow: 0 2px 16px #e5e5e5, 0 0 1px #e5e5e5, 0 0 1px #e5e5e5;
            margin-top: vww(10);
            .u-swipe-action-item__right {
               .u-swipe-action-item__right__button {
                  .u-swipe-action-item__right__button__wrapper {
@@ -2188,21 +2273,28 @@
            }
         }
      }
      .cardList {
         height: vww(130);
         border-radius: vww(4);
         padding: vww(10);
         position: relative;
         .cardListIcon{
            position:absolute; right: vww(20); top:vww(20);
        position: absolute;
        right: vww(20);
        top: vww(20);
         }
         .cardList-container {
            .cardList_item {
               margin-top: vww(12);
               font-size: 14px;
               display: flex;
               view {
                  width: 50%;
                  &:nth-child(2) {
                     margin-left: vww(20);
                  }
@@ -2210,6 +2302,7 @@
            }
         }
      }
      .addCard {
         width: 100%;
         height: vww(130);