| | |
| | | 当前选择订单 |
| | | </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> |
| | |
| | | </view> |
| | | <view class="table"> |
| | | <uni-table border stripe |
| | | @selection-change="selectionChange" |
| | | type="selection" |
| | | emptyText="暂无更多数据"> |
| | | <uni-tr> |
| | | <uni-th align="center">产品名称</uni-th> |
| | |
| | | v-for="item in customerNameList" |
| | | @click="selectCustomer(item)"> |
| | | <view class="item-image"> |
| | | <image src="https://mx.jzeg.cn:9096/appimg/image/banner/address.png" |
| | | <image src="https://wrzs.czjlchem.com:9090/appimg/image/banner/address.png" |
| | | mode="widthFix" |
| | | style="width: 18px;"></image> |
| | | </view> |
| | |
| | | return { |
| | | selfDeliverShow: false, |
| | | deptId: '', |
| | | checkList:[], |
| | | deptName: '', |
| | | deptList: [], |
| | | productName: '', |
| | |
| | | }, |
| | | 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; |
| | | }); |
| | |
| | | }) |
| | | }, |
| | | 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() { |
| | |
| | | carNum:this.value, |
| | | sendDate:this.sendDate, |
| | | sendSign:0, |
| | | itemIds:this.checkList.join(",") + ',' |
| | | } |
| | | this.buildLoading = true |
| | | this.$reqPost('addDeliveryPlan', form, 'json').then(res => { |
| | |
| | | }).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') |
| | | } |
| | | } |
| | | }, |
| | | } |
| | |
| | | .main { |
| | | width: 100%; |
| | | color: #232323; |
| | | overflow: auto; |
| | | height: 80vh; |
| | | |
| | | .product-info { |
| | | width: 96%; |