zhangxiaoxu123
2022-07-29 0c4086cfdbc5bbff567bd05ebcc6e34e36cb2bf9
pages/new-application-form-data/new-application-form-data.vue
@@ -70,9 +70,8 @@
                  <view class="searchResultList">
                     <u-cell-group :right-icon="false">
                        <u-cell v-for="(item, index) in customerData" :title="item.customerFullName" :arrow="false">
                           <text slot="value" class="u-slot-value">
                           <view slot="value" class="u-slot-value">
                              <button
                                 class="mini-btn"
                                 type="default"
                                 size="mini"
                                 style="background: #007aff;
@@ -87,7 +86,7 @@
                              >
                                 选择
                              </button>
                           </text>
                           </view>
                        </u-cell>
                     </u-cell-group>
                  </view>
@@ -363,7 +362,7 @@
                     <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="editApplicationIndex != null ? '添加修改':'添加'" type="primary" @click="addContractSanConfirm"></u-button></view>
               </view>
               <!-- 选择煤厂 -->
@@ -392,7 +391,7 @@
                                       <view :style="tdStyle">{{ item.compName }}</view>
                                    </uni-td>
                                    <uni-td align="left">
                                       <view :style="tdStyle">{{ item.remark }}</view>
                                       <view :style="tdStyle">{{ item.remark == null ? '' : item.remark }}</view>
                                    </uni-td>
                                 </uni-tr>
                              </uni-table>
@@ -444,7 +443,7 @@
                           <view class="searchResultList">
                              <u-cell-group :right-icon="false">
                                 <u-cell v-for="(item, index) in customerData" :title="item.customerFullName" :arrow="false">
                                    <text slot="value" class="u-slot-value">
                                    <view slot="value" class="u-slot-value">
                                       <button
                                          class="mini-btn"
                                          type="default"
@@ -461,7 +460,7 @@
                                       >
                                          选择
                                       </button>
                                    </text>
                                    </view>
                                 </u-cell>
                              </u-cell-group>
                           </view>
@@ -540,12 +539,12 @@
         <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 == null ? 0 :accountDetails.balanceTotal.toFixed(2) }},承兑余额:{{ 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">
               <view class="cardList">
                  <view class="" class="cardListIcon"><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">
                        收货人:
@@ -785,25 +784,25 @@
         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
            // 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
         },
         dust: null, // 抑尘费
         trainfreight: {}, //路运运费
@@ -825,7 +824,8 @@
            {
               text: '删除'
            }
         ]
         ],
      editApplicationIndex:null
      };
   },
   onShow() {
@@ -1227,24 +1227,12 @@
         // 价格参数赋值
         this.getNewPriceData.type = e.type;
         // 选定合同详情
         uni
            .request({
               url: `/yunxiao/contractitem/getByContractId/${e.id}`,
               method: 'GET',
               header: {
                  'TENANT-ID': 5,
                  Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
                  VERSION: 'zzl'
               }
            })
            .then(res => {
               this.contractDetails = res[1].data.data;
               console.log('合同详情', res, this.contractDetails);
            })
            .catch(err => {
               console.log(err);
            });
            // 选定合同详情
         this.$reqGet('getByContractId',{},e.id).then(res=>{
               this.contractDetails = res.data
         }).catch(err=>{
            console.log(err);
         })
      },
      // 添加合同按钮
      addContractClick() {
@@ -1304,6 +1292,8 @@
      // 添加合同弹出框
      addContractClose() {
         this.addContractShow = false;
         this.addContractFormdata = {};
         this.editApplicationIndex = null;
      },
      addContractOpen() {
         console.log('添加订单打开');
@@ -1317,6 +1307,7 @@
      },
      // 选择的煤厂
      coalFiledSelectClick(e) {
        console.log('选择的煤厂',e);
         this.addContractFormdata.compName = e.compName;
         this.addContractFormdata.filedName = e.name;
         this.addContractFormdata.compId = e.compId;
@@ -1325,7 +1316,14 @@
         this.selectCoalFiledData = e;
         this.coalFiledSelectShow = false;
         // 获取价格参数
      this.getNewPriceData.compId = e.compId;
      this.getNewPriceData.compName = e.compName;
      this.getNewPriceData.filedId = e.id;
      this.getNewPriceData.filedName = e.name;
      this.coalFiledSelectShow = false;
      },
      // 收货人
      addContractConsigneeClose() {
@@ -1405,7 +1403,7 @@
                  //    this.currentCoal.type = 1;
                  // }
                  this.addContractFormdata.modifyId = data.modifyId;
                  this.addContractFormdata.id = data.id;
                  // this.addContractFormdata.id = data.id;
               } else {
                  uni.$u.toast('煤种价格未设置');
               }
@@ -1477,11 +1475,14 @@
      },
      addContractSanConfirm() {
         if (this.addContractFormdata.compId && this.addContractFormdata.customerId && this.addContractFormdata.filedId) {
            this.newFormData.contractOrders.push(this.addContractFormdata);
            console.log('添加子订单',this.addContractFormdata);
            this.$nextTick(() => {
               this.addContractShow = false;
            });
           if(this.editApplicationIndex != null){
          this.newFormData.contractOrders[this.editApplicationIndex] = this.addContractFormdata;
        } else {
          this.newFormData.contractOrders.push(this.addContractFormdata);
          console.log('添加子订单',this.addContractFormdata);
        }
        this.addContractShow = false;// 关闭弹出框
        console.log('this.newFormData.contractOrders当前关闭后',this.newFormData.contractOrders)
         } else {
            uni.$u.toast('请规范输入所有信息');
         }
@@ -1607,6 +1608,11 @@
         console.log('删除订单卡片', e);
         this.newFormData.contractOrders.splice(e, 1);
      },
    editApplicationClick(index){
        this.editApplicationIndex = index;
      this.addContractFormdata = this.newFormData.contractOrders[index];
      this.addContractShow = true;
    },
      xswaybill() {
         console.log('新建发运申请', this.newFormData);
         uni.showLoading({
@@ -1616,17 +1622,19 @@
            uni.hideLoading();
            console.log('新建发运申请', res);
            if (res.code == 0) {
               uni.showToast({
                  title: '添加成功!',
                  icon: 'success',
                  duration: 2000
               });
               this.$nextTick(() => {
                  uni.navigateBack({
                     // url: '/pages/my-application/my-application'
                     delta: 2
                  });
               });
               // uni.showToast({
               //    title: '添加成功!',
               //    icon: 'success',
               //    duration: 1000
               // });
          this.$u.toast('添加成功,即将返回申请页!!!')
               setTimeout(() => {
            uni.navigateBack({
              // url: '/pages/my-application/my-application'
              delta: 2
            });
          },2000)
            }
         });
      },