From 26cf5599ccc92203cb7313385c2bf3c26c42ac0c Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期四, 30 五月 2024 17:40:07 +0800 Subject: [PATCH] feat:库管模块提交新增 查看日计划页面 --- pages/customer-page/addDailyPlan/addDailyPlan.vue | 229 ++++++++++++++++---------------------------------------- 1 files changed, 66 insertions(+), 163 deletions(-) diff --git a/pages/customer-page/addDailyPlan/addDailyPlan.vue b/pages/customer-page/addDailyPlan/addDailyPlan.vue index afe1eea..4bd99cb 100644 --- a/pages/customer-page/addDailyPlan/addDailyPlan.vue +++ b/pages/customer-page/addDailyPlan/addDailyPlan.vue @@ -6,38 +6,13 @@ <view class="product-info_block"> <view class="selected-info"> <view class="selected-info_label"> - 褰撳墠閫夋嫨鍗曚綅 + 褰撳墠閫夋嫨璁㈠崟 </view> <view class="selected-info_text"> <niceui-data-select-input v-model="deptId" - :localdata="deptList" - placeholder="璇烽�夋嫨鍗曚綅" + :localdata="customerNameList" + placeholder="璇烽�夋嫨璁㈠崟" @change="deptChange"></niceui-data-select-input> - </view> - </view> - <view class="selected-info"> - <view class="selected-info_label"> - 褰撳墠閫夋嫨浜у搧 - </view> - <view class="selected-info_text"> - <niceui-data-select-input v-model="productName" - :localdata="productNameList" - label="浜у搧閫夋嫨" - placeholder="璇烽�夋嫨浜у搧" - @change="productNameChange"></niceui-data-select-input> - </view> - - </view> - <view class="selected-info"> - <view class="selected-info_label"> - 褰撳墠閫夋嫨鐓ゅ満 - </view> - <view class="selected-info_text"> - <niceui-data-select-input v-model="filedId" - :localdata="filedNameList" - label="鐓ゅ満閫夋嫨" - placeholder="璇烽�夋嫨鐓ゅ満" - @change="filedChange"></niceui-data-select-input> </view> </view> </view> @@ -57,18 +32,37 @@ <!-- 瀹㈡埛鍚嶇О --> <view class="customer-name"> <view class="customer-name_label"> - 閫夋嫨瀹㈡埛 + 杞︽暟 </view> - <view class="customer-name_block" - @click="selfDeliver"> - <input class="customer-name_block-input" - type="text" - placeholder="璇烽�夋嫨瀹㈡埛" - v-model="customerName" - @focus="selfDeliver" - ref="selectCustomer" /> + <view class="customer-name_block"> + <u--input + class="customer-name_block-input" + placeholder="璇疯緭鍏ヨ溅鏁�" + border="surround" + v-model="value" + ></u--input> </view> </view> + <view class="table"> + <uni-table border stripe + emptyText="鏆傛棤鏇村鏁版嵁"> + <uni-tr> + <uni-th align="center">浜у搧鍚嶇О</uni-th> + <uni-th align="center">绫诲瀷</uni-th> + <uni-th align="center">浠撳簱</uni-th> + </uni-tr> + <uni-tr v-for="(item, index) in subDataList" :key="index"> + <uni-td align="center"> + <view>{{ item.productName }}</view></uni-td> + <uni-td> + <view class="name">{{ item.orderType }}</view> + </uni-td> + + 聽 <uni-td align="center"> + <view>{{ item.bunkerName }}</view></uni-td> + </uni-tr> + </uni-table> + </view> </view> <!-- 鎻愪氦 --> <view class="confirm-build"> @@ -79,7 +73,8 @@ :disabled="abledBuild"></u-button> </view> </view> - <view class=""> + + <!-- <view class=""> <u-popup :closeable='true' :round="30" mode='bottom' @@ -112,7 +107,8 @@ </view> </view> </u-popup> - </view> + </view> --> + </view> </template> @@ -124,11 +120,11 @@ NiceUIDataSelectInput }, onLoad() { - this.getCarNoByVarieties() + // this.getCarNoByVarieties() this.getDingdan(); - if (this.deptId && this.productName) { - this.getShipToList() - } + // if (this.deptId && this.productName) { + // this.getShipToList() + // } this.sendDate = this.sendDateStart = dayjs().format('YYYY-MM-DD') this.sendDateEnd = dayjs().add(7, 'day').format('YYYY-MM-DD') }, @@ -147,145 +143,48 @@ sendDateStart: '', sendDateEnd: '', customerId: '', + value:'', customerName: '', customerNameList: [], - buildLoading: false + buildLoading: false, + subDataList:[], } }, computed: { abledBuild() { - return !this.filedId || !this.deptId || !this.productName || !this.customerId + return !this.subDataList.length || !this.sendDate || !this.value } }, methods: { - // 鑾峰彇瀹㈡埛 - getShipToList() { - uni.showLoading({ - title: "鍔犺浇涓�" - }) - this.$reqGet('getDeptAndProductNameByCustomer', { deptId: this.deptId, productName: this.productName }) - .then(res => { - uni.hideLoading() - if (res.code == 0) { - this.customerNameList = res.data - } - }) - }, //鏌ヨ璁㈠崟 getDingdan(){ - this.$reqGet('getOrderList') + this.$reqGet('getAppOrderList',{orderType:'澶栬喘'}) .then(res => { uni.hideLoading() if (res.code == 0) { - this.customerNameList = res.data + this.customerNameList = res.data.map(item=>{ + item.text = item.productName + '-' + item.orderCode; + item.value = item.id; + return item; + }) + console.log(this.customerNameList,'') } }) }, - //鏌ヨ鐩稿叧鍗曚綅 - getCarNoByVarieties() { - uni.showLoading({ - title: "鍔犺浇涓�" - }) - this.$reqGet('getCarNoByVarieties').then(res => { - uni.hideLoading() - if (res.code == 0) { - this.deptList = res.data.map(v => { - return { - value: v.deptId, - text: v.deptName - } - }) - this.deptId = Array.isArray(this.deptList) && this.deptList.length !== 0 ? this.deptList[0] - .value : '' - } else { - this.$u.toast('鍔犺浇澶辫触') - } - }).then(() => { - this.getDeptByProductName() - this.getDeptIdByFiledList() - }) - }, deptChange(e) { - this.deptName = this.deptList.find(v => v.value === e).text - this.getDeptByProductName() - this.getDeptIdByFiledList() - if (this.deptId && this.productName) { - this.getShipToList() - } - }, - // 鏍规嵁閮ㄩ棬鑾峰彇浜у搧鍚嶇О - getDeptByProductName() { - this.$reqGet('getDeptByProductName', { deptId: this.deptId }).then(res => { - this.productNameList = res.data.map(v => { - return { - value: v.productName, - text: v.productName - } - }) - this.productName = Array.isArray(this.productNameList) && this.productNameList.lenght !== 0 ? - this.productNameList[0].value : '' - }).then(() => { - this.getShipToList() - }) - }, - // 鏍规嵁閮ㄩ棬鑾峰彇鐓ゅ満鍚嶇О - getDeptIdByFiledList() { - this.$reqGet('getDeptIdByFiledList', { deptId: this.deptId }).then(res => { - this.filedNameList = res.data.map(v => { - return { - value: v.id, - text: v.name - } - }) - if (Array.isArray(this.filedNameList) && this.filedNameList.length === 1) { - this.filedId = this.filedNameList[0].value - this.filedName = this.filedNameList[0].text - } else if (Array.isArray(this.filedNameList) && this.filedNameList.length > 1) { - this.filedId = '' - this.filedName = '' - } - }) - }, - filedChange(e) { - this.filedName = this.filedNameList.find(v => v.value === e).text - }, - productNameChange(e) { - if (this.deptId && this.productName) { - this.getShipToList() - } - }, - selfDeliver() { - this.selfDeliverShow = true - }, - selfDeliverClose() { - this.selfDeliverShow = false - }, - selfDeliverOpen() { - this.selfDeliverShow = true - }, - selectCustomer(value) { - this.customerId = value.customerId - this.customerName = value.customerName - this.selfDeliverShow = false + console.log(e,'eee'); + this.subDataList = this.customerNameList.filter(item=>item.id === e); + }, confirmBuild() { let form = { - carNo: uni.getStorageSync('carNo'), - coalName: this.productName, - deptId: this.deptId, //閮ㄩ棬Id - deptName: this.deptName, //閮ㄩ棬鍚嶇О - filedId: this.filedId, //鐓ゅ満Id - filedName: this.filedName, //鐓ゅ満鍚嶇О - orderType: "澶栬喘", - sendDate: this.sendDate, //鍙戣繍鏃堕棿 - xsUserId1: uni.getStorageSync('userId'), //鐢ㄦ埛id - isPretendDischar: 1, //鏄惁鑳借鍗� 1宸茬粡纭瑁呭嵏 0涓嶉渶瑕佽鍗� - isSpecial: 1, //鏄惁鏄壒浜у搧 1鐗规畩浜у搧 0涓嶆槸鐗逛娇浜у搧 - customerId: this.customerId, - customerName: this.customerName + orderId:this.deptId, + carNum:this.value, + sendDate:this.sendDate, + sendSign:0, } this.buildLoading = true - this.$reqPost('saveDeliveryNote', form, 'json').then(res => { + this.$reqPost('addDeliveryPlan', form, 'json').then(res => { this.buildLoading = false if (res.code == 0) { this.$u.toast('鍒涘缓鎴愬姛') @@ -307,6 +206,13 @@ <style lang="scss" scoped> + .table{ + width: 94%; + margin-left: 20rpx; + /deep/ .uni-table{ + min-width: 340rpx!important; + } + } /deep/.u-button { width: 100%; height: 36px !important; @@ -334,10 +240,8 @@ .product-info { width: 96%; - height: vww(250); margin: vww(8); margin-top: vww(20); - box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12); border-radius: 20rpx; position: relative; @include flex; @@ -345,7 +249,6 @@ &_block { width: 88%; - height: vww(200); margin-left: vww(10); @include flex; flex-direction: column; @@ -416,7 +319,7 @@ .confirm-build { width: 100%; - height: vww(80); + height: vww(60); background-color: #ffffff; position: fixed; bottom: 0; -- Gitblit v1.9.1