From 50072669bacb4c0fc842817ea0129cef98932d0b Mon Sep 17 00:00:00 2001 From: zhangxiaoxu123 <819527061@qq.com> Date: 星期四, 28 七月 2022 20:01:24 +0800 Subject: [PATCH] '解决冲突' --- pages/home/home.vue | 3 pages/edit-my-application/edit-my-application.vue | 1362 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ project.private.config.json | 20 project.config.json | 30 + 4 files changed, 1,415 insertions(+), 0 deletions(-) diff --git a/pages/edit-my-application/edit-my-application.vue b/pages/edit-my-application/edit-my-application.vue index 3225f38..f566b64 100644 --- a/pages/edit-my-application/edit-my-application.vue +++ b/pages/edit-my-application/edit-my-application.vue @@ -516,6 +516,7 @@ width: 43px; font-size: 10px; padding: 0;" +<<<<<<< Updated upstream @click="addContractConsigneeConfirm(item)" > 閫夋嫨 @@ -674,6 +675,156 @@ <!-- 鑿滃崟鏍� --> <popup-menu @menuShow="menushow" ref="menuRef"></popup-menu> </view> +======= + @click="addContractConsigneeConfirm(item)" + > + 閫夋嫨 + </button> + </text> + </u-cell> + </u-cell-group> + </view> + <view class="loadmoreClass"> + <u-loadmore loadmoreText="鐐瑰嚮鍔犺浇鏇村" nomoreText="鏃犳洿澶氭暟鎹�!!!" :status="status" @loadmore="loadingCustomer" fontSize="20" height="30px"/> + </view> + <!-- 閫夋嫨鐢ㄦ埛鑿滃崟椤� --> + <view class="selectCustomerCompSheet"> + <u-action-sheet + :show="selectCustomerCompShow" + :actions="selectCustomerActions" + title="璇烽�夋嫨鍗曚綅" + @close="selectCustomerCompShow = false" + @select="selectCustomerSelect" + ></u-action-sheet> + </view> + <!-- 绾у埆鑿滃崟椤� --> + <view class="selectLevelSheet"> + <u-action-sheet :show="selectLevelShow" :actions="levelList" title="璇烽�夋嫨绾у埆" @close="selectLevelShow = false" @select="selectLevelSelect"></u-action-sheet> + </view> + </view> + </scroll-view> + </u-popup> + </view> + + <!-- 鍝佺閫夋嫨鍣� --> + <view class="addContractCoalPicker"> + <u-picker + :show="addContractCoalShow" + :columns="addContractCoalData" + @close="addContractCoalClose" + @cancel="addContractCoalShow = false" + @confirm="addContractCoalConfirm" + :closeOnClickOverlay="true" + keyName="label" + ></u-picker> + </view> + + <!-- 杩愯緭閫夋嫨鍣� --> + <view class="addContractCoalPicker"> + <u-picker + :show="addContractTransportShow" + :columns="addContractTransportData" + @close="addContractTransportClose" + @cancel="addContractTransportShow = false" + @confirm="addContractTransportConfirm" + :closeOnClickOverlay="true" + keyName="label" + ></u-picker> + </view> + </scroll-view> + </u-popup> + </view> + + <!-- 鐢宠琛ㄦ牸 --> + + <view class="newApplicationTable"> + <!-- <uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁"> + <uni-tr v-for="(item, index) in 12" :key="index"> + <uni-th align="center">瀛楁鏍囬</uni-th> + <uni-td> + <view class="text">杈撳叆/閫夋嫨鍐呭</view> + <view class="icon"><image src="@/static/icon/select.png" mode=""></image></view> + </uni-td> + </uni-tr> + <uni-tr> + <uni-th align="center">鎿嶄綔</uni-th> + <uni-td> + <view class="newApplicationTableUtil"> + <u-button type="primary" text="淇敼" size="mini"></u-button> + <u-button type="error" text="鍒犻櫎" size="mini"></u-button> + </view> + </uni-td> + </uni-tr> + </uni-table> --> + <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> + </view> + <u-swipe-action> + <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(item,index)"> + <u-icon name="edit-pen" color="#2979ff" size="35"></u-icon> + </view> + <view class="cardList-container"> + <view class="cardList_item"> + 鏀惰揣浜猴細 + <text>{{ item.customerName }}</text> + </view> + <view class="cardList_item"> + <view class=""> + 鐭垮巶锛� + <text>{{ item.filedName }}</text> + </view> + <view class=""> + 鐓ゅ巶锛� + <text>{{ item.compName }}</text> + </view> + </view> + + <view class="cardList_item"> + <view class=""> + 鍝佺锛� + <text>{{ item.coalName }}</text> + </view> + <view class=""> + 杩愯緭锛� + <text>{{ item.trainType == 1 ? '鍦伴攢':'璺繍' }}</text> + </view> + </view> + <view class="cardList_item"> + <view class=""> + 鍗曚环锛� + <text>{{ item.price }}</text> + </view> + <view class=""> + 璁㈠崟閲戦锛� + <text>{{ item.amount }}</text> + </view> + <!-- <view class=""> + 璁㈠崟鏁伴噺锛�<text>218.899</text> + </view> --> + </view> + </view> + </view> + </u-swipe-action-item> + </u-swipe-action> + + <view class="addCard" @click="addContractClick"> + <view class="addCard-icon"><u-icon name="plus" size="100"></u-icon></view> + </view> + </view> + + <view class="new-application-button"> + <u-button text="鍙栨秷" :plain="true" type="primary" @click="backPage"></u-button> + <u-button text="纭畾" type="primary" @click="newApplicationFormDataClick"></u-button> + </view> + + <!-- 鑿滃崟鏍� --> + <popup-menu @menuShow="menushow" ref="menuRef"></popup-menu> + </view> +>>>>>>> Stashed changes </template> <script> @@ -687,6 +838,7 @@ month = month < 10 ? `0${month}` : month; const date = d.getDate(); export default { +<<<<<<< Updated upstream data() { return { applicationOrderIndex: null, @@ -1892,6 +2044,1216 @@ }); } } +======= + 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: '澶栭攢' + }, + accountDetails: {}, + // 鏃堕棿 + timeDataStr: '', + menuShow: false, + // 琛ㄥ崟 + // selectCustomerShow: false, // 閫夋嫨鐢ㄦ埛寮规 + showPayType: false, // 浠樻鏂瑰紡寮规 + payData: [], + 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'] + } + ] + }, + // 鏃堕棿 + timeShow: false, + mode: 'range', + maxDate: `${year}-${month}-${date + 70}`, + // 閫夋嫨瀹㈡埛 + selectCustomerData: { + compIds: '', + customerName: '', + level: '', + current: 1, + size: 10 + }, + status:'loadmore', + customerDataAllNum:0,//瀹㈡埛鍒楄〃鎬绘潯鏁� + account: null, //瀹㈡埛璐︽埛淇℃伅 + // 鎼滅储瀛楁 + selectCompsData: [], + selectCustomerLevel: [], + searchCustomerForm: { + compName: '', + levelText: '' + }, + customerData: [], + // 閫夋嫨鍗曚綅 + selectCustomerCompShow: false, + selectCustomerActions: [], + // 绾у埆 + selectLevelShow: false, + levelList: [{ name: '涓�鏄熺骇', value: 'A' }, { name: '浜屾槦绾�', value: 'B' }, { name: '涓夋槦绾�', value: 'C' }, { name: '鍥涙槦绾�', value: 'D' }, { name: '浜旀槦绾�', value: 'E' }], + // 閫夋嫨鍚堝悓 + // selectContractShow: false, + // searchContractForm: { + // current: 1, + // size: 10, + // num: '', + // startDate: '', + // endDate: '', + // result: 2, + // type: '', + // customerName: '' + // }, + // contractData: [], + // 绫诲瀷 + // selectContractTypeShow: false, + // selectContractTypeData: [[]], + // 鏃堕棿 + // selectContractTimeMode: 'single', + // selectContractStartTimeShow: false, + // selectContractEndTimeShow: false, + // 娣诲姞鍚堝悓 + 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: '' + + }, + contractDetails: [], // 閫夋嫨鐨勫悎鍚岃鎯� + // 閫夋嫨鐓ゅ巶 + coalFiledSelectShow: false, + coalfiledData: [], + coalfiledParams: { current: 1, size: 10 }, + selectCoalFiledData: {}, + // 閫夋嫨鏀惰揣浜� + addContractConsigneeShow: false, + // 鍝佺閫夋嫨鍣� + addContractCoalShow: false, + addContractCoalData: [[]], + // 杩愯緭绫诲瀷 + + // 浼樻儬 + favouredpolicyListAll: [], //浼樻儬鏀跨瓥鍒楄〃鎵�鏈夌殑 + favouredpolicyList: [], // 浼樻儬鏀跨瓥鍒楄〃 + multipleSelection: [], //閫変腑鐨勪紭鎯犳斂绛� + selectOKfavouredpolicyValue:[],//澶嶉�夋閫変腑 + // 鍗曢�夋 + addContractTransport: '', + // 鍝佺浠锋牸琛ㄦ牸 + loading: false, + // 浠锋牸璇锋眰鍙傛暟 + getNewPriceData: { + // compId: 133, + // compName: '閭㈠彴鐭�', + // customerAddressName: '閭㈠彴鍥芥嘲鍙戠數鏈夐檺璐d换鍏徃', + // 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: {}, //璺繍杩愯垂 + // 杩愯緭绫诲瀷 + addContractTransportShow: false, + addContractTransportData: [[{ label: '鍦伴攢', value: 1 }, { label: '璺繍', value: 2 }]], + currentCoal: { + coalName: '', + cokingPrice: null, + modifyId: null, + modifyInfoId: null, + noImportantPrice: null, + quotePrice: null, + steelMillPrice: null, + type: null + }, + // 婊戝姩鍗曞厓鏍� + options1: [ + { + text: '鍒犻櫎' + } + ], + editApplicationTableId:'' + }; + }, + onLoad(options){ + this.editApplicationTableId = JSON.parse(options.index); + + }, + onShow() { + if (this.menuShow == true) { + this.$refs.menuRef.menuClick(); + } + this.init(); + }, + // 鐐瑰嚮瀵艰埅鏍忚彍鍗曞悗 + onNavigationBarButtonTap(e) { + this.$refs.menuRef.menuClick(); + }, + computed: { + afterPrice() { + 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 => { + if (favouredpolicyIds.length > 0) { + favouredpolicyIds += ','; + } + favouredpolicyIds += e.id; + temp.steelMillPrice -= e.price; + temp.cokingPrice -= e.price; + temp.noImportantPrice -= e.price; + temp.quotePrice -= e.price; + }); + if (this.multipleSelection.length > 0) { + this.addContractFormdata.favouredpolicyIds = favouredpolicyIds; + } + } + console.log(temp,'after-------temp') + return temp; + }, + showPrice() { + if (this.addContractFormdata) { + let row = this.addContractFormdata; + if (row.compId && row.customerAddressId && row.coalId) { + // this.rowClik(this.currentRow); + return true; + } + } + return false; + }, + //浼樻儬鏀跨瓥 + favouredpolicyListcomputed() { + let list = []; + this.favouredpolicyListAll.forEach(e => { + //鏀粯鏂瑰紡 + if (e.type.indexOf('B') != -1 && e.coalIds) { + if (e.coalIds.indexOf(this.addContractFormdata.coalId) != -1) { + list.push(e); + } + } + //杩愯窛 + if (this.addContractFormdata.trainType == 2) { + if (e.type.indexOf('A') != -1) { + //鏍规嵁鍙戠珯鍒扮珯鑾峰彇杩愯窛 + list.push(e); + } + } + }); + this.favouredpolicyList = list; + + return true; + }, + async currentRowComputed() { + // 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)) { + 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&& (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); //璺繍杩愯垂 + price += cost1Price; + price += this.dust; + 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); + 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() { + // 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, + // 娣卞害鐩戝惉 灞炴�х殑鍙樺寲// deep: true + // 閫夋嫨瀹㈡埛鏌ヨ鏉′欢 + 'searchCustomerForm.compName'(newV, oldV) { + if (newV == '') { + this.selectCustomerData.compIds = ''; + } + }, + 'searchCustomerForm.levelText'(newV, oldV) { + if (newV == '') { + this.selectCustomerData.level = ''; + } + }, + // 'selectOKfavouredpolicyValue'(newV,oleV){ + // } + }, + components: { + popupMenu, + combinationTitle + }, + methods: { + async jisuanAmount() { + console.log('杩涘叆璁$畻'); + if (this.addContractFormdata.trainType == 2) { + let price = this.addContractFormdata.price; + //濡傛灉璺繍浠锋牸澧炲姞鎶戝皹璐瑰拰杩愯垂 + let cost1Price = await this.getFreight(this.addContractFormdata.fromStation, this.addContractFormdata.toStation, this.addContractFormdata.customerAddressId); //璺繍杩愯垂 + price += cost1Price; + price += this.dust; + 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); + this.addContractFormdata.amount = amount.toFixed(2); + } + }, + init() { + this.jcfavouredpolicyitem(); + this.coalfiled(); + this.coalprice(); + this.operato(); + this.pay_type(); + this.others_params(); + this.fetchCompTree(); + this.getFavouredPolicyItem(); + this.editApplicationFormData(); // 淇敼鐢宠琛ㄥ崟璇︽儏 + }, + editApplicationFormData(){ + this.$reqGet('formData',{},this.editApplicationTableId).then(res=>{ + this.newFormData = res.data; + console.log(this.newFormData.contractOrders,'鍒濆鍖栧垪琛�-----------newFormData----------鍒濆鍖�') + this.timeDataStr = this.newFormData.startDate; + }) + }, + editApplicationClick(item,index){ + console.log(item,'item=========') + this.applicationOrderIndex = index;// 寰呬慨鏀硅鍗昳ndex + this.addContractFormdata = item; + console.log(this.addContractFormdata,'this.addContractFormdata=============鐐瑰嚮杩涙潵鐨勬煇鍒�') + this.addContractFormdata.priceMode = item.priceMode.toString(); + // 淇敼璁㈠崟浼樻儬鍒濆鍖� + if(item.favouredpolicyIds){ + item.favouredpolicyIds.split(',').map(e=>{ + this.selectOKfavouredpolicyValue.push(Number(e)); + }); + } + + + // 鑾峰彇浠锋牸 + // 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.getNewPrice(); + + // 鍒濆鍖栫涓�娆′紭鎯犱环鏍艰绠� + // this.$nextTick(()=>{ + if(this.selectOKfavouredpolicyValue.length == 0){ + this.multipleSelection = []; + } else { + this.multipleSelection = []; + this.favouredpolicyList.forEach((item)=>{ + if(this.selectOKfavouredpolicyValue.indexOf(item.id) != -1){ + this.multipleSelection.push(item); + } + }) + } + // }) + + // 璁㈠崟杩愯緭绫诲瀷 + switch(this.addContractFormdata.trainType){ + case 1: + this.addContractTransport = '鍦伴攢'; + break; + case 2: + this.addContractTransport = '璺繍'; + break; + } + + // 鑾峰彇鍚堝悓璇︽儏锛岀叅绉� + this.getContractDetails(); + + this.changePriceMode(this.addContractFormdata.priceMode); + + this.$nextTick(()=>{ + this.addContractShow = true; + }) + + }, + getContractDetails(){ + uni.showLoading({ + title:'鍔犺浇涓�...' + }) + this.$reqGet('getByContractId',{},this.newFormData.contractId).then(res=>{ + uni.hideLoading(); + if(res.code == 0){ + this.contractDetails = res.data; + } + }) + this.$nextTick(()=>{ + this.contractDetails.forEach(item => { + let a = [{ label: '', id: '' }]; + a[0].label = item.coalName; + a[0].id = item.coalId; + if (this.addContractCoalData[0]) { + this.addContractCoalData = []; + } + this.addContractCoalData.push(a); + }); + }) + }, + checkboxChangeFavouredpolicy(e){ + // this.selectOKfavouredpolicyValue = e; + if(e.length == 0){ + this.multipleSelection = []; + } else { + this.multipleSelection = []; + this.favouredpolicyList.forEach((item,i)=>{ + if(e.indexOf(item.id) != -1){ + this.multipleSelection.push(item); + } + }) + } + + }, + // 閫夋嫨瀹㈡埛 + selectCustomer() { + this.selectLevelShow = false; + this.selectCustomerCompShow = false; + uni.showLoading({ + title: '鍔犺浇涓�...' + }); + // this.selectCustomerShow = true; + this.selectCustomerData.current = 1; + this.$reqGet('customer', this.selectCustomerData).then(res => { + uni.hideLoading(); + if (res.code == 0) { + this.customerData = res.data.records; + this.customerDataAllNum = res.data.total; + } + }); + }, + // 瀹㈡埛閫夋嫨寮规鎵撳紑浜� + // selectCustomerOpen() { + // // this.spanStyle = 'overflow:hidden'; //褰撹挋灞傚脊璧锋椂锛屽浐瀹氱晫闈㈢姝㈡粴鍔紝褰撹挋灞傚叧闂椂锛屽厑璁告粴鍔� + // }, + // selectCustomerClose() { + // // this.spanStyle = 'overflow:auto'; // 璁﹉tml鐨刡ody鍙粦鍔� + // // this.selectCustomerShow = false; + // }, + // 鑾峰彇鍗曚綅鏍� + fetchCompTree() { + this.selectCustomerActions = []; + this.$reqGet('fetchCompTree').then(res => { + if (res.code == 0) { + let a = { name: '', id: '' }; + a.name = res.data[0].name; + a.id = res.data[0].id; + this.selectCustomerActions.push(a); + res.data[0].children.forEach(item => { + let a = { name: '', id: '' }; + a.name = item.name; + a.id = item.id; + this.selectCustomerActions.push(a); + }); + } + }); + }, + // 瀹㈡埛閫夋嫨妗嗗崟浣嶉�夋嫨鑿滃崟 + selectCustomerSelect(v) { + uni.hideKeyboard(); + this.selectCustomerData.compIds = v.id; + this.searchCustomerForm.compName = v.name; + }, + // 绾у埆 + selectLevelSelect(v) { + uni.hideKeyboard(); + this.selectCustomerData.level = v.value; + this.searchCustomerForm.levelText = v.name; + }, + // 浠樻绫诲瀷 + sexSelect(v) { + uni.hideKeyboard(); + this.selectValue = v.name; + this.newFormData.payType = v.value; + // this.newFormData.payType = e.name; + // this.$refs.form1.validateField('userInfo.sex'); + }, + // 娓呯┖閫夋嫨瀹㈡埛琛ㄥ崟 + selectCustomerResetFields() { + this.$refs.selectformRef.resetFields(); // 涓嶈捣鏁堟灉 + this.selectCustomerData.customerName = ''; + this.searchCustomerForm.compName = ''; + this.searchCustomerForm.levelText = ''; + this.selectCustomer(); + }, + selectCustomerOkClick(v) { + this.newFormData.customerName = v.customerName; + this.newFormData.customerId = v.id; + this.$reqGet('getAccount', { customerId: v.id }).then(res => { + this.accountDetails = res.data; + + this.searchContractForm.customerName = res.data.customerName; + }); + this.$nextTick(() => { + // this.selectCustomerShow = false; + }); + }, + loadingCustomer(){ + if(this.selectCustomerData.current >= this.customerDataAllNum / 10) return; + this.status = 'loading'; + this.selectCustomerData.current = ++this.selectCustomerData.current; + this.$reqGet('customer', this.selectCustomerData).then(res => { + if(this.selectCustomerData.current >= this.customerDataAllNum / 10){ + this.status = 'nomore'; + this.$u.toast('娌℃湁鏇村鏁版嵁浜嗭紒') + } + uni.hideLoading(); + if (res.code == 0) { + this.customerDataAllNum = res.data.total; + this.customerData = this.customerData.concat(res.data.records); + this.status = 'loadmore'; + } + }); + }, + // 鏃堕棿 + confirmTime(v) { + this.timeShow = false; + v.forEach(e => { + this.newFormData.startDate = v[0]; + this.newFormData.endDate = v[v.lenght - 1]; + this.timeDataStr = v[0] + ' 鑷� ' + v[v.length - 1]; + }); + }, + + // 閫夋嫨鍚堝悓 + // selectContract() { + // if (this.newFormData.customerName != '') { + // if (this.newFormData.contractOrders != []) { + // uni.showToast({ + // title: '娣诲姞璁㈠崟鍚庯紝涓嶈兘淇敼鍚堝悓锛�', + // icon: 'error', + // duration: 2000 + // }); + // } + // this.selectContractShow = true; + // } else { + // this.$refs.formRef + // .validate() + // .then(res => { + // uni.$u.toast('鏍¢獙鎴愬姛'); + // }) + // .catch(err => { + // uni.$u.toast('璇烽�夋嫨缁撶畻瀹㈡埛'); + // }); + // } + // }, + // 閫夋嫨鍚堝悓绫诲瀷杈撳叆妗嗚幏鍙栫劍鐐硅Е鍙� + // searchContractFormTypeFocus() { + // // 绫诲瀷寮瑰嚭妗� + // this.selectContractTypeShow = true; + // // 寮瑰嚭妗嗙被鍨嬭姹� + // this.$nextTick(() => { + // this.$reqGet('contract_type').then(res => { + // res.data.forEach(item => { + // this.selectContractTypeData[0].push(item.value); + // }); + // }); + // }); + // }, + // 閫夋嫨鍚堝悓寮规 + // selectContractOpen() { + // uni.showLoading({ + // title: '鍔犺浇涓�...' + // }); + // this.$reqGet('contract_status').then(res => { + // // console.log('鐘舵��', res); + // }); + // this.$reqGet('contract', this.searchContractForm).then(res => { + // uni.hideLoading(); + // if (res.code == 0) { + // // console.log('鍚堝悓', res); + // this.contractData = res.data.records; + // } + // }); + // }, + // selectContractClose() { + // this.selectContractShow = false; + // }, + // 鍚堝悓绫诲瀷閫夋嫨鍣� + // selectContractTypeConfirm(v) { + // this.searchContractForm.type = v.value[0]; + // this.selectContractTypeShow = false; + // console.log('閫夋嫨鍣ㄧ‘瀹氬悗鐨勫��', v, this.searchContractForm.type); + // }, + // selectContractTypeClose(v) { + // // 鍒濆鍖栧悎鍚岀被鍨嬮�夋嫨鍣� + // this.selectContractTypeData[0] = []; + + // this.selectContractTypeShow = false; + // if (v) { + // this.searchContractForm.type = v.value[0]; + // } + // }, + // 鍚堝悓鏃堕棿閫夋嫨鍣� + // selectContractStartTimeConfirm(e) { + // this.selectContractStartTimeShow = false; + // this.searchContractForm.startDate = e[0]; + // }, + // selectContractStartTimeClose() { + // this.selectContractStartTimeShow = false; + // }, + // selectContractEndTimeConfirm(e) { + // this.selectContractEndTimeShow = false; + // this.searchContractForm.endDate = e[0]; + // }, + // selectContractEndTimeClose() { + // this.selectContractEndTimeShow = false; + // }, + // 閲嶇疆琛ㄥ崟鎵�鏈夊瓧娈� + // selectContractResetFields() { + // this.searchContractForm.num = ''; + // this.searchContractForm.startDate = ''; + // this.searchContractForm.endDate = ''; + // this.searchContractForm.customerName = ''; + // this.searchContractForm.type = ''; + // }, + // selectContractClick(e) { + // console.log('閫夋嫨鍚堝悓', e); + // this.newFormData.contractName = e.contractName; + // this.newFormData.contractNum = e.num; + // this.newFormData.contractId = e.id; + // this.selectContractShow = false; + + // // 浠锋牸鍙傛暟璧嬪�� + // 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); + // }); + // }, + // 娣诲姞璁㈠崟鎸夐挳 + addContractClick() { + // 鎵撳嵃true鎴杅alse + this.$refs.formRef + .validate() + .then(res => { + if (this.accountDetails.balanceType == '璐�') { + uni.showToast({ + title: '瀹㈡埛璐︽埛浣欓褰撳墠澶勪簬娆犳鐘舵�侊紒', + icon: 'error', + duration: 2000 + }); + } else { + if (this.accountDetails.balance == 0 || (null && this.accountDetails.balance2 == 0) || null) { + uni.showToast({ + title: '璐︽埛浣欓涓嶈冻锛�', + icon: 'error', + duration: 2000 + }); + } else { + this.addContractShow = true; + this.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: '' + }; + + // 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.getNewPrice(); + + // 杩愯緭绫诲瀷鍒濆鍖� + switch(this.addContractFormdata.trainType){ + case 1: + this.addContractTransport = '鍦伴攢'; + break; + case 2: + this.addContractTransport = '璺繍'; + break; + } + + // 鑾峰彇鍚堝悓璇︽儏锛岀叅绉� + this.getContractDetails(); + + // console.log('this.addContractFormdata',this.addContractFormdata); + this.multipleSelection = []; + } + } + }) + .catch(err => { + uni.$u.toast('鏁堥獙澶辫触'); + }); + }, + // 娣诲姞鍚堝悓寮瑰嚭妗� + addContractClose() { + this.addContractFormdata = {}; + this.addContractShow = false; + }, + addContractOpen() { + console.log('娣诲姞鐢宠瀛愰」绐楀彛鎵撳紑this.addContractFormdata',this.addContractFormdata); + // console.log('娣诲姞璁㈠崟鎵撳紑'); + }, + // 閫夋嫨鐓ゅ巶 + coalFiledSelectOpen(e) { + // console.log('coalfiledSelect: ', e); + }, + coalFiledSelectClose() { + this.coalFiledSelectShow = false; + }, + // 閫夋嫨鐨勭叅鍘� + coalFiledSelectClick(e) { + this.addContractFormdata.compName = e.compName; + this.addContractFormdata.filedName = e.name; + this.addContractFormdata.compId = e.compId; + this.addContractFormdata.filedId = e.id; + this.addContractFormdata.fromStation = e.toStation; + + this.selectCoalFiledData = e; + + this.coalFiledSelectShow = false; + }, + // 鏀惰揣浜� + addContractConsigneeClose() { + this.addContractConsigneeShow = false; + }, + // 娣诲姞鍚堝悓瀛愰」鏀惰揣浜烘墦寮� + addContractConsigneeOpen() { + this.selectCustomer() + }, + 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; + this.getNewPriceData.customerAddressId = v.id; + this.getNewPriceData.toStation = v.toStation; + + this.addContractFormdata.toStation = v.toStation; + this.addContractFormdata.customerAddressId = v.id; + + // 娣诲姞鐓ょ閫夐」 + this.contractDetails.forEach(item => { + let a = [{ label: '', id: '' }]; + a[0].label = item.coalName; + a[0].id = item.coalId; + if (this.addContractCoalData[0]) { + this.addContractCoalData = []; + } + this.addContractCoalData.push(a); + }); + + }, + // 鍝佺閫夋嫨鍣� + addContractCoalConfirm(e) { + // console.log('鍝佺閫夋嫨鍣�', e); + + this.addContractCoalShow = false; // 鍏抽棴閫夋嫨鍣� + this.addContractFormdata.coalId = e.value[0].id; + this.addContractFormdata.coalName = e.value[0].label; + // 鐓ょ浠锋牸璇锋眰(鐓ゅ巶=>浠锋牸鍙傛暟) + this.getNewPriceData.coalId = e.value[0].id; + this.getNewPriceData.coalName = e.value[0].label; + + // this.selectCoalFiledData.compId = e.compId; + // this.selectCoalFiledData.compName = e.compName; + // this.selectCoalFiledData.toStation = e.fromStation; + + this.getNewPrice(); + }, + getNewPrice(){ + this.$reqGet('getNewPrice', this.getNewPriceData).then(res => { + if (res.code == 0) { + // console.log('鑾峰彇浠锋牸',res); + let data = res.data; + if (data) { + this.currentCoal.coalName = data.coalName; + this.currentCoal.cokingPrice = data.cokingPrice; //鐒﹀寲浠锋牸 + this.currentCoal.noImportantPrice = data.noImportantPrice; //涓嶉噸瑕佷环鏍� + this.currentCoal.quotePrice = data.quotePrice; // 鎸傜墝浠锋牸 + this.currentCoal.steelMillPrice = data.steelMillPrice; // 閽㈠巶浠锋牸 + this.currentCoal.modifyId = data.modifyId; //淇敼id + this.currentCoal.modifyInfoId = data.id; + + this.addContractFormdata.price = data.steelMillPrice; + this.addContractFormdata.modifyId = data.modifyId; + this.addContractFormdata.id = data.id; + } else { + uni.$u.toast('鐓ょ浠锋牸鏈缃�'); + } + } + }); + }, + addContractCoalClose() { + this.addContractCoalShow = false; + }, + // 鐓ゅ搧绉嶄环鏍� + groupChange(e) { + // console.log('鍗曢�夋灏忕粍', e); + }, + changePriceMode(e) { + console.log(e,'e==========') + console.log(this.currentCoal,'this.currentCoal==========') + if (!this.currentCoal) return; + if(e){ + this.addContractFormdata.priceMode = e; + } + this.addContractFormdata.price = this.afterPrice.quotePrice; + console.log(this.addContractFormdata.price,'this.currentCoal.price=====afterPrice333333333333') + switch (this.addContractFormdata.priceMode) { + case '0': + console.log('浠锋牸',this.afterPrice.steelMillPrice); + this.addContractFormdata.price = this.currentCoal.steelMillPrice; + break; + case '1': + this.addContractFormdata.price = this.currentCoal.cokingPrice; + break; + case '2': + this.addContractFormdata.price = this.currentCoal.noImportantPrice; + break; + case '3': + this.addContractFormdata.price = this.currentCoal.quotePrice; + console.log('杩涘叆鍗曢�夋',this.currentCoal,'this.addContractFormdata===444'); + break; + } + }, + // 浼樻儬閫夋嫨 + selectionChange(e) { + // console.log('浼樻儬閫夋嫨',e); + this.multipleSelection = []; + this.favouredpolicyList.forEach((item, i) => { + if (e.detail.index.indexOf(i) != -1) { + this.multipleSelection.push(item); + } + }); + }, + // 杩愯緭閫夋嫨鍣� + addContractTransportConfirm(e) { + this.addContractTransportShow = false; + this.addContractFormdata.trainType = e.value[0].value; + switch (this.addContractFormdata.trainType) { + case 1: + this.addContractTransport = '鍦伴攢'; + break; + case 2: + this.addContractTransport = '璺繍'; + break; + } + }, + addContractTransportClose() { + this.addContractTransportShow = false; + }, + // 鑾峰彇杩愯垂 + async getFreight(from, to, customerId) { + let key = from + to + customerId; + let price = this.trainfreight[key]; + price = await this.$reqGet('trainFreightFind', { from, to, customerId }).then(res => { + let resPrice = 10; //榛樿浠锋牸涓�10 + if (res.data) { + resPrice = res.data.price; + } + return resPrice; + }); + return price; + }, + addContractSanConfirm() { + if (this.addContractFormdata.compId && this.addContractFormdata.customerId && this.addContractFormdata.filedId) { + if(this.applicationOrderIndex == null){ + this.newFormData.contractOrders.push(this.addContractFormdata); + this.$nextTick(() => { + this.addContractShow = false; + }); + this.$u.toast('娣诲姞鎴愬姛'); + } else { + // this.newFormData.contractOrders.map(i => { + // return this.newformData.contractOrders[] + // }) + this.newFormData.contractOrders[this.applicationOrderIndex] = this.addContractFormdata; + this.addContractShow = false; // 闅愯棌寮瑰嚭妗� + this.applicationOrderIndex = null; // 鍒濆鍖栦慨鏀硅鍗昳ndex + this.$u.toast('淇敼鎴愬姛'); + } + + + } else { + uni.$u.toast('璇疯鑼冭緭鍏ユ墍鏈変俊鎭�'); + } + }, + // 鍒濆鏁版嵁璇锋眰 + operato() { + this.$reqGet('operator').then(res => { + this.operator = res.data; + }); + }, + pay_type() { + this.actions = []; + this.$reqGet('pay_type').then(res => { + // console.log('paytype', res); + this.payData = res.data; + res.data.forEach(e => { + let a = { name: '', value: '' }; + a.name = e.label; + a.value = e.value; + this.actions.push(a); + }); + }); + // console.log(this.actions); + }, + // 鎶戝皹璐� + others_params() { + this.$reqGet('others_params').then(res => { + // console.log('others_params', res); + res.data.forEach(e => { + if (e.label == 'dust') { + this.dust = parseFloat(e.value); + } + }); + }); + }, + coalprice() { + this.$reqGet('coalprice', { current: 1, size: 1000 }).then(res => { + // console.log('coalprice', res); + }); + }, + // 绾у埆璺濅紭鎯� + jcfavouredpolicyitem() { + this.$reqGet('jcfavouredpolicyitem', { current: 1, size: 1000, status: 0 }).then(res => { + // console.log('绾у埆璺濅紭鎯�', res); + // this.favouredpolicyListAll = res.data.records; + }); + }, + // 鑾峰彇鎵�鏈夌殑浼樻儬鏀跨瓥 + getFavouredPolicyItem() { + this.$reqGet('getFavouredPolicyItem', { current: 1, size: 1000, status: 0 }).then(res => { + // console.log('鎵�鏈変环鏍间紭鎯�',res.data.records); + this.favouredpolicyListAll = res.data.records; + }); + }, + // 鐓ゅ満 + coalfiled() { + this.$reqGet('coalfiled', this.coalfiledParams).then(res => { + this.coalfiledData = res.data.records; + }); + }, + // 鏃堕棿 + timeClose() { + this.timeShow = false; + }, + menushow(e) { + this.menuShow = e; + }, + // 閫夋嫨瀹㈡埛 + // moveHandleCustomer() { + // return true; + // }, + // moveHandleContract(){ + // return true; + // }, + // 鏂板缓鍙戣繍鐢宠 + newApplicationFormDataClick() { + this.$refs.formRef + .validate() + .then(res => { + let amount = 0; + this.newFormData.contractOrders.forEach(e => { + amount += Number(e.amount); + }); + if (this.newFormData.payType == '0') { + if(this.newFormData.contractOrders.length <= 0){ + this.$u.toast('璇锋坊鍔犺鍗曞瓙椤癸紒'); + return false; + }else if (this.accountDetails.balance < amount) { + let msg = this.accountDetails.balance == null ? 0 : this.accountDetails.balance; + uni.showToast({ + title: '瀹㈡埛璐︽埛鐜版眹浣欓涓嶈冻锛岀幇姹囦綑棰�:' + msg, + icon: 'error', + duration: 2000 + }); + } else { + this.editShenQing(); + // this.xswaybill(); + } + } else { + if(this.newFormData.contractOrders.length <= 0){ + this.$u.toast('璇锋坊鍔犺鍗曞瓙椤癸紒'); + return false; + }else if (this.accountDetails.balance2 < amount) { + let msg = this.accountDetails.balance2 == null ? 0 : this.accountDetails.balance2; + uni.showToast({ + title: '瀹㈡埛璐︽埛鎵垮厬浣欓涓嶈冻锛屾壙鍏戜綑棰�:' + msg, + icon: 'error', + duration: 2000 + }); + } else { + this.editShenQing(); + + // this.xswaybill(); + } + } + }) + .catch(err => { + uni.$u.toast('鏍¢獙澶辫触'); + }); + }, + // 淇敼鐢宠淇℃伅 + editShenQing(){ + uni.request({ + url:'/yunxiao/xswaybill', + method:"PUT", + data:this.newFormData, + header:{ + '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('淇敼鎴愬姛') + } + uni.navigateBack({ + delta: 1 + }); + }) + }, + // 鍒犻櫎璁㈠崟鍗$墖 + deleteContractCardClick(e) { + // console.log('鍒犻櫎璁㈠崟鍗$墖', e); + this.newFormData.contractOrders.splice(e, 1); + }, + xswaybill() { + uni.showLoading({ + title: '鍔犺浇涓�...' + }); + this.$reqPost('xswaybill', this.newFormData).then(res => { + uni.hideLoading(); + if (res.code == 0) { + uni.showToast({ + title: '娣诲姞鎴愬姛锛�', + icon: 'success', + duration: 2000 + }); + // this.$nextTick(() => { + // uni.navigateBack({ + // // url: '/pages/my-application/my-application' + // delta: 2 + // }); + // }); + } + }); + }, + backPage() { + uni.navigateBack({ + delta: 1 + }); + } + } +>>>>>>> Stashed changes }; </script> diff --git a/pages/home/home.vue b/pages/home/home.vue index e53f9b8..eb6a9a3 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -691,9 +691,12 @@ justify-content: center; align-content: center; margin-right: vww(10); +<<<<<<< Updated upstream &:nth-last-child(1) { margin-right: 0; } +======= +>>>>>>> Stashed changes view { display: inline-block; } diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..2c2dbb2 --- /dev/null +++ b/project.config.json @@ -0,0 +1,30 @@ +{ + "miniprogramRoot": "unpackage/dist/dev/mp-weixin/", + "appid": "wx7bcc7aa2be8a2a6d", + "compileType": "miniprogram", + "libVersion": "2.25.2", + "packOptions": { + "ignore": [], + "include": [] + }, + "setting": { + "coverView": true, + "es6": true, + "postcss": true, + "minified": true, + "enhance": true, + "showShadowRootInWxmlPanel": true, + "packNpmRelationList": [], + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } + }, + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 + }, + "srcMiniprogramRoot": "unpackage/dist/dev/mp-weixin/" +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..d388962 --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,20 @@ +{ + "description": "椤圭洰绉佹湁閰嶇疆鏂囦欢銆傛鏂囦欢涓殑鍐呭灏嗚鐩� project.config.json 涓殑鐩稿悓瀛楁銆傞」鐩殑鏀瑰姩浼樺厛鍚屾鍒版鏂囦欢涓�傝瑙佹枃妗o細https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "group-app", + "setting": { + "compileHotReLoad": true + }, + "condition": { + "miniprogram": { + "list": [ + { + "name": "", + "pathName": "/pages/login/login", + "query": "", + "launchMode": "default", + "scene": null + } + ] + } + } +} \ No newline at end of file -- Gitblit v1.9.1