From 1654919972d6ad5ac9889cb9d986bdd80cc783bf Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期四, 01 八月 2024 14:27:04 +0800 Subject: [PATCH] feat:生产链接替换 --- subPages/addDailyPlan/addDailyPlan.vue | 64 +++++++++++++++++++++++++++---- 1 files changed, 55 insertions(+), 9 deletions(-) diff --git a/subPages/addDailyPlan/addDailyPlan.vue b/subPages/addDailyPlan/addDailyPlan.vue index cc9f5ad..8ca893d 100644 --- a/subPages/addDailyPlan/addDailyPlan.vue +++ b/subPages/addDailyPlan/addDailyPlan.vue @@ -9,10 +9,15 @@ 褰撳墠閫夋嫨璁㈠崟 </view> <view class="selected-info_text"> - <niceui-data-select-input v-model="deptId" + <uni-combox :candidates="customerNameList" placeholder="璇烽�夋嫨璁㈠崟" + labelKey="text" + valueKey="value" + ref='combox' + v-model="deptId" @input="(e)=>deptChange(e)"></uni-combox> + <!-- <niceui-data-select-input v-model="deptId" :localdata="customerNameList" placeholder="璇烽�夋嫨璁㈠崟" - @change="deptChange"></niceui-data-select-input> + @change="deptChange"></niceui-data-select-input> --> </view> </view> </view> @@ -45,6 +50,8 @@ </view> <view class="table"> <uni-table border stripe + @selection-change="selectionChange" + type="selection" emptyText="鏆傛棤鏇村鏁版嵁"> <uni-tr> <uni-th align="center">浜у搧鍚嶇О</uni-th> @@ -132,6 +139,7 @@ return { selfDeliverShow: false, deptId: '', + checkList:[], deptName: '', deptList: [], productName: '', @@ -152,18 +160,18 @@ }, computed: { abledBuild() { - return !this.subDataList.length || !this.sendDate || !this.value + return !this.subDataList.length || !this.sendDate || !this.value || !this.checkList.length } }, methods: { //鏌ヨ璁㈠崟 getDingdan(){ - this.$reqGet('getAppOrderList',{orderType:'澶栭攢'}) + this.$reqGet('getAppOrderList',{code:this.deptId}) .then(res => { uni.hideLoading() if (res.code == 0) { this.customerNameList = res.data.map(item=>{ - item.text = (item.productNames ? item.productNames : item.productName) + '-' + item.orderCode; + item.text = item.orderCode; item.value = item.id; return item; }); @@ -180,10 +188,34 @@ }) }, deptChange(e) { - console.log(e,'eee'); - this.subDataList = this.customerNameList.filter(item=>item.id === e).length ? - this.customerNameList.filter(item=>item.id === e)[0].tmOrderList : []; - ; + console.log(e,this.$refs.combox,'eee'); + this.$reqGet('getAppOrderList',{code:this.$refs.combox.inputVal}) + .then(res => { + uni.hideLoading() + if (res.code == 0) { + this.customerNameList = res.data.map(item=>{ + item.text = item.orderCode; + item.value = item.id; + return item; + }); + if(this.customerNameList.length === 1){ + this.deptId = this.customerNameList[0].value; //閫夋嫨褰撳墠 + // if(this.deptId){ + // this.deptChange(this.deptId); + // } + }else{ + this.deptId = ''; + } + + if(this.deptId){ + this.subDataList = this.customerNameList.filter(item=>item.id === e).length ? + this.customerNameList.filter(item=>item.id === e)[0].tmOrderList : []; + }else{ + this.subDataList = []; + } + } + }) + }, confirmBuild() { @@ -192,6 +224,7 @@ carNum:this.value, sendDate:this.sendDate, sendSign:0, + itemIds:this.checkList.join(",") + ',' } this.buildLoading = true this.$reqPost('addDeliveryPlan', form, 'json').then(res => { @@ -209,6 +242,17 @@ }).catch(e => { this.buildLoading = false }) + }, + selectionChange(item){ + //閫夋嫨 鏌愪釜浜у搧 + this.checkList = []; + console.log(item,'items') + if(item.detail.index.length){ + item.detail.index.forEach((v) => { + this.checkList.push(this.subDataList[v].id) + }) + console.log(this.checkList,'checkList') + } } }, } @@ -247,6 +291,8 @@ .main { width: 100%; color: #232323; + overflow: auto; + height: 80vh; .product-info { width: 96%; -- Gitblit v1.9.1