|  |  |  | 
|---|
|  |  |  | <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="item.id"> | 
|---|
|  |  |  | <view class="cardList"> | 
|---|
|  |  |  | <view class="" class="cardListIcon" @click="editApplicationClick(index)"> | 
|---|
|  |  |  | <view class="" class="cardListIcon" @click="editApplicationClick(item,index)"> | 
|---|
|  |  |  | <u-icon name="edit-pen" color="#2979ff" size="35"></u-icon> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="cardList-container"> | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | computed: { | 
|---|
|  |  |  | afterPrice() { | 
|---|
|  |  |  | console.log(this.currentCoal,'this.currentCoal---computed') | 
|---|
|  |  |  | let temp = this.currentCoal; | 
|---|
|  |  |  | console.log(temp,'temp======================') | 
|---|
|  |  |  | let temp = { | 
|---|
|  |  |  | coalName: "", | 
|---|
|  |  |  | cokingPrice: 0, | 
|---|
|  |  |  | modifyId: 0, | 
|---|
|  |  |  | modifyInfoId: 0, | 
|---|
|  |  |  | noImportantPrice: 0, | 
|---|
|  |  |  | quotePrice: 0, | 
|---|
|  |  |  | steelMillPrice: 0, | 
|---|
|  |  |  | type: null | 
|---|
|  |  |  | } | 
|---|
|  |  |  | temp = Object.assign({},this.currentCoal); | 
|---|
|  |  |  | // temp.coalName = this.currentCoal.coalName | 
|---|
|  |  |  | // temp.cokingPrice = this.currentCoal.cokingPrice | 
|---|
|  |  |  | // temp.modifyId = this.currentCoal.modifyId | 
|---|
|  |  |  | // temp.modifyInfoId = this.currentCoal.modifyInfoId | 
|---|
|  |  |  | // temp.noImportantPrice = this.currentCoal.noImportantPrice | 
|---|
|  |  |  | // temp.quotePrice = this.currentCoal.quotePrice | 
|---|
|  |  |  | // temp.steelMillPrice = this.currentCoal.steelMillPrice | 
|---|
|  |  |  | // temp.type = this.currentCoal.type | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let favouredpolicyIds = ''; | 
|---|
|  |  |  | if (this.favouredpolicyList.length > 0) { | 
|---|
|  |  |  | this.multipleSelection.forEach(e => { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.addContractFormdata.favouredpolicyIds = favouredpolicyIds; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | console.log(temp,'quotePrice1111111111111111======111111111111111111111111') | 
|---|
|  |  |  | console.log(temp,'after-------temp') | 
|---|
|  |  |  | return temp; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | showPrice() { | 
|---|
|  |  |  | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | async currentRowComputed() { | 
|---|
|  |  |  | console.log('进入计算,currentRowComputed'); | 
|---|
|  |  |  | console.log('路运-------------进来',this.addContractFormdata,'this.addContractFormdata-----'); | 
|---|
|  |  |  | // return true | 
|---|
|  |  |  | console.log('currentRowComputed-------------进来',this.addContractFormdata,'this.addContractFormdata-----'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //变价格用的 | 
|---|
|  |  |  | this.changePriceMode(this.addContractFormdata.priceMode); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //变订单量 | 
|---|
|  |  |  | 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('地销'); | 
|---|
|  |  |  | 
|---|
|  |  |  | this.addContractFormdata.quant = q.toFixed(2); | 
|---|
|  |  |  | this.addContractFormdata.cost1 = null; //运费 | 
|---|
|  |  |  | this.addContractFormdata.cost2 = null; //抑尘费 | 
|---|
|  |  |  | } else if (this.addContractFormdata.trainType == 2) { | 
|---|
|  |  |  | } else if (this.addContractFormdata.trainType == 2&& (this.addContractFormdata.amount > 0 || this.addContractFormdata.quant > 0)) { | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | editApplicationFormData(){ | 
|---|
|  |  |  | this.$reqGet('formData',{},this.editApplicationTableId).then(res=>{ | 
|---|
|  |  |  | console.log('整体详情',res.data); | 
|---|
|  |  |  | this.newFormData = res.data; | 
|---|
|  |  |  | console.log(this.newFormData.contractOrders,'初始化列表-----------newFormData----------初始化') | 
|---|
|  |  |  | this.timeDataStr = this.newFormData.startDate; | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | editApplicationClick(index){ | 
|---|
|  |  |  | editApplicationClick(item,index){ | 
|---|
|  |  |  | console.log(item,'item=========') | 
|---|
|  |  |  | this.applicationOrderIndex = index;// 待修改订单index | 
|---|
|  |  |  | this.addContractFormdata = this.newFormData.contractOrders[index]; | 
|---|
|  |  |  | console.log('修改的订单详情1',this.addContractFormdata,index,this.newFormData.contractOrders); | 
|---|
|  |  |  | this.addContractFormdata.priceMode = this.newFormData.contractOrders[this.applicationOrderIndex].priceMode.toString(); | 
|---|
|  |  |  | this.addContractFormdata = item; | 
|---|
|  |  |  | console.log(this.addContractFormdata,'this.addContractFormdata=============点击进来的某列') | 
|---|
|  |  |  | this.addContractFormdata.priceMode = item.priceMode.toString(); | 
|---|
|  |  |  | // 修改订单优惠初始化 | 
|---|
|  |  |  | if(this.newFormData.contractOrders[index].favouredpolicyIds){ | 
|---|
|  |  |  | this.newFormData.contractOrders[index].favouredpolicyIds.split(',').map(item=>{ | 
|---|
|  |  |  | this.selectOKfavouredpolicyValue.push(Number(item)); | 
|---|
|  |  |  | if(item.favouredpolicyIds){ | 
|---|
|  |  |  | item.favouredpolicyIds.split(',').map(e=>{ | 
|---|
|  |  |  | this.selectOKfavouredpolicyValue.push(Number(e)); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | // 获取合同详情,煤种 | 
|---|
|  |  |  | this.getContractDetails(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.changePriceMode(this.addContractFormdata.priceMode); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.$nextTick(()=>{ | 
|---|
|  |  |  | this.addContractShow = true; | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | console.log('修改的订单详情',this.addContractFormdata); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getContractDetails(){ | 
|---|
|  |  |  | uni.showLoading({ | 
|---|
|  |  |  | 
|---|
|  |  |  | // console.log('单选框小组', e); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changePriceMode(e) { | 
|---|
|  |  |  | console.log('进入单选框',this.addContractFormdata,'this.addContractFormdata===111'); | 
|---|
|  |  |  | console.log(e,'e==========') | 
|---|
|  |  |  | console.log(this.currentCoal,'this.currentCoal==========') | 
|---|
|  |  |  | 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') | 
|---|
|  |  |  | console.log(this.addContractFormdata.price,'this.currentCoal.price=====afterPrice333333333333') | 
|---|
|  |  |  | switch (this.addContractFormdata.priceMode) { | 
|---|
|  |  |  | case '0': | 
|---|
|  |  |  | console.log('价格',this.afterPrice.steelMillPrice); | 
|---|
|  |  |  | this.addContractFormdata.price = this.afterPrice.steelMillPrice; | 
|---|
|  |  |  | this.addContractFormdata.price = this.currentCoal.steelMillPrice; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case '1': | 
|---|
|  |  |  | this.addContractFormdata.price = this.afterPrice.cokingPrice; | 
|---|
|  |  |  | this.addContractFormdata.price = this.currentCoal.cokingPrice; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case '2': | 
|---|
|  |  |  | this.addContractFormdata.price = this.afterPrice.noImportantPrice; | 
|---|
|  |  |  | this.addContractFormdata.price = this.currentCoal.noImportantPrice; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case '3': | 
|---|
|  |  |  | this.addContractFormdata.price = this.afterPrice.quotePrice; | 
|---|
|  |  |  | console.log('进入单选框',this.addContractFormdata,'this.addContractFormdata===444'); | 
|---|
|  |  |  | this.addContractFormdata.price = this.currentCoal.quotePrice; | 
|---|
|  |  |  | console.log('进入单选框',this.currentCoal,'this.addContractFormdata===444'); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | this.newFormData.contractOrders.splice(e, 1); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | xswaybill() { | 
|---|
|  |  |  | console.log('新建发运申请', this.newFormData); | 
|---|
|  |  |  | uni.showLoading({ | 
|---|
|  |  |  | title: '加载中...' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | this.$reqPost('xswaybill', this.newFormData).then(res => { | 
|---|
|  |  |  | uni.hideLoading(); | 
|---|
|  |  |  | console.log('新建发运申请', res); | 
|---|
|  |  |  | if (res.code == 0) { | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: '添加成功!', | 
|---|