From da9921bedb5d77d9f615a36e6b4ffcbbfc063f13 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期二, 31 十月 2023 17:29:34 +0800 Subject: [PATCH] 修复偶尔打印错误,修复判断司机是否勾选默认打印样式错误,重做入场申请逻辑 --- pages/driver-page/driver-index/SelfDelivery/SelfDelivery.vue | 285 +++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 197 insertions(+), 88 deletions(-) diff --git a/pages/driver-page/driver-index/SelfDelivery/SelfDelivery.vue b/pages/driver-page/driver-index/SelfDelivery/SelfDelivery.vue index 094ce9b..64ead23 100644 --- a/pages/driver-page/driver-index/SelfDelivery/SelfDelivery.vue +++ b/pages/driver-page/driver-index/SelfDelivery/SelfDelivery.vue @@ -1,27 +1,6 @@ <!-- 鑷富閰嶉�� --> <template> <view class="main"> - <u-modal :show="selfDeliverShow" - title="閫夋嫨浜у搧" - showCancelButton - @confirm="selfDeliverConfirm" - @cancel="selfDeliverCancel"> - <view class="slot-content"> - <niceui-data-select-input v-model="deptId" - :localdata="deptList" - placeholder="璇烽�夋嫨鍗曚綅" - @change="deptChange"></niceui-data-select-input> - <niceui-data-select-input v-model="productName" - :localdata="productNameList" - label="浜у搧閫夋嫨" - placeholder="璇烽�夋嫨浜у搧"></niceui-data-select-input> - <niceui-data-select-input v-model="filedId" - :localdata="filedNameList" - label="鐓ゅ満閫夋嫨" - placeholder="璇烽�夋嫨鐓ゅ満" - @change="filedChange"></niceui-data-select-input> - </view> - </u-modal> <!-- 鍙告満閫夋嫨鐨勪骇鍝佷俊鎭� --> <view class="product-info"> <view class="product-info_block"> @@ -30,7 +9,10 @@ 褰撳墠閫夋嫨鍗曚綅 </view> <view class="selected-info_text"> - {{deptName}} + <niceui-data-select-input v-model="deptId" + :localdata="deptList" + placeholder="璇烽�夋嫨鍗曚綅" + @change="deptChange"></niceui-data-select-input> </view> </view> <view class="selected-info"> @@ -38,7 +20,11 @@ 褰撳墠閫夋嫨浜у搧 </view> <view class="selected-info_text"> - {{productName}} + <niceui-data-select-input v-model="productName" + :localdata="productNameList" + label="浜у搧閫夋嫨" + placeholder="璇烽�夋嫨浜у搧" + @change="productNameChange"></niceui-data-select-input> </view> </view> @@ -47,44 +33,85 @@ 褰撳墠閫夋嫨鐓ゅ満 </view> <view class="selected-info_text"> - {{filedName}} + <niceui-data-select-input v-model="filedId" + :localdata="filedNameList" + label="鐓ゅ満閫夋嫨" + placeholder="璇烽�夋嫨鐓ゅ満" + @change="filedChange"></niceui-data-select-input> </view> </view> - <view class="re-select"> - <u-button text="閲嶆柊閫夋嫨" - @click="reSelect"></u-button> + </view> + </view> + <view class="bottom-block"> + <!-- 閫夋嫨鍙戣繍鏃堕棿 --> + <view class="send-date"> + <view class="send-date_label"> + 鍙戣繍鏃堕棿 + </view> + <uni-datetime-picker type="date" + :clear-icon="false" + v-model="sendDate" + :start="sendDateStart" + :end="sendDateEnd" /> + </view> + <!-- 瀹㈡埛鍚嶇О --> + <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> </view> </view> - <!-- 閫夋嫨鍙戣繍鏃堕棿 --> - <view class="send-date"> - <view class="send-date_label"> - 鍙戣繍鏃堕棿 - </view> - <uni-datetime-picker type="date" - :clear-icon="false" - v-model="sendDate" - :start="sendDateStart" - :end="sendDateEnd" /> - </view> - <!-- 瀹㈡埛鍚嶇О --> - <view class="customer-name"> - <view class="customer-name_label"> - 閫夋嫨瀹㈡埛 - </view> - <niceui-data-select-input v-model="customerId" - :localdata="customerNameList" - placeholder="璇烽�夋嫨瀹㈡埛" - @change="customerNameChange"></niceui-data-select-input> - </view> <!-- 鎻愪氦 --> - <view class="re-select"> - <view class="re-select_block"> + <view class="confirm-build"> + <view class="confirm-build_block"> <u-button text="纭鍒涘缓" @click="confirmBuild" :loading="buildLoading" :disabled="abledBuild"></u-button> </view> + </view> + <view class=""> + <u-popup :closeable='true' + :round="30" + mode='bottom' + :show="selfDeliverShow" + @close="selfDeliverClose" + @open="selfDeliverOpen"> + <view class="name-list-section"> + <view class="name-list_title"> + 閫夋嫨瀹㈡埛 + </view> + <view class="name-list_container"> + <u-empty mode="data" + icon="http://cdn.uviewui.com/uview/empty/data.png" + text="鏆傛棤鏁版嵁" + textSize="30" + iconSize="1000" + v-if="customerNameList.length===0"></u-empty> + <view class="name-list_container_item" + v-for="item in customerNameList" + @click="selectCustomer(item)"> + <view class="item-image"> + <image src="https://mx.jzeg.cn:9096/appimg/image/banner/address.png" + mode="widthFix" + style="width: 18px;"></image> + </view> + <view class="item-customerName"> + {{item.customerName}} + </view> + </view> + </view> + </view> + </u-popup> </view> </view> </template> @@ -98,7 +125,9 @@ }, onLoad() { this.getCarNoByVarieties() - 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') }, @@ -118,7 +147,7 @@ sendDateEnd: '', customerId: '', customerName: '', - customerNameList: '', + customerNameList: [], buildLoading: false } }, @@ -133,20 +162,13 @@ uni.showLoading({ title: "鍔犺浇涓�" }) - this.$reqGet('getShipToList').then(res => { - uni.hideLoading() - if (res.code == 0) { - this.customerNameList = res.data - if (this.customerNameList.length !== 0) { - this.customerNameList = this.customerNameList.map(v => { - return { - value: v.customerId, - text: v.customerName - } - }) + this.$reqGet('getDeptAndProductNameByCustomer', { deptId: this.deptId, productName: this.productName }) + .then(res => { + uni.hideLoading() + if (res.code == 0) { + this.customerNameList = res.data } - } - }) + }) }, //鏌ヨ鐩稿叧鍗曚綅 getCarNoByVarieties() { @@ -162,17 +184,23 @@ text: v.deptName } }) - this.selfDeliverShow = true + 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() { @@ -183,7 +211,10 @@ text: v.productName } }) - this.productName = this.productNameList[0].value + this.productName = Array.isArray(this.productNameList) && this.productNameList.lenght !== 0 ? + this.productNameList[0].value : '' + }).then(() => { + this.getShipToList() }) }, // 鏍规嵁閮ㄩ棬鑾峰彇鐓ゅ満鍚嶇О @@ -202,20 +233,24 @@ filedChange(e) { this.filedName = this.filedNameList.find(v => v.value === e).text }, - customerNameChange(e) { - this.customerName = this.customerNameList.find(v => v.value === e).text + productNameChange(e) { + if (this.deptId && this.productName) { + this.getShipToList() + } }, - reSelect() { + selfDeliver() { this.selfDeliverShow = true }, - selfDeliverConfirm() { + selfDeliverClose() { this.selfDeliverShow = false }, - selfDeliverCancel() { + selfDeliverOpen() { + this.selfDeliverShow = true + }, + selectCustomer(value) { + this.customerId = value.customerId + this.customerName = value.customerName this.selfDeliverShow = false - uni.navigateBack({ - delta: 1 - }) }, confirmBuild() { let form = { @@ -276,30 +311,25 @@ align-items: center; } - .slot-content { - width: 100%; - height: vww(150); - @include flex; - flex-direction: column; - } .main { width: 100%; + color: #232323; .product-info { width: 96%; - height: vww(200); + height: vww(250); margin: vww(8); margin-top: vww(20); - background: #ffffff; 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; justify-content: center; &_block { width: 88%; - height: vww(150); + height: vww(200); margin-left: vww(10); @include flex; flex-direction: column; @@ -308,6 +338,7 @@ .selected-info { width: 100%; display: flex; + align-items: center; &_label { margin-right: vww(8); @@ -319,24 +350,55 @@ } .re-select { + position: absolute; width: vww(100); - margin: 0 auto; + bottom: vww(10); } } } + .bottom-block { + height: vww(200); + } + .send-date, .customer-name { - height: vww(40); margin: vww(40) vww(20); position: relative; &_label { margin: vww(8); } + + &_block { + width: 100%; + flex: 1; + height: vww(35); + border: 1px solid #e5e5e5; + box-sizing: border-box; + border-radius: 4px; + padding: 0 5px; + padding-left: 10px; + position: relative; + user-select: none; + @include flex; + + &-input { + width: 96%; + height: 96%; + color: #333; + position: absolute; + left: vww(10); + z-index: -1; + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + overflow: hidden; + } + } } - .re-select { + .confirm-build { width: 100%; height: vww(80); background-color: #ffffff; @@ -352,5 +414,52 @@ width: 94%; } } + + .name-list-section { + width: 100%; + height: vww(600); + position: relative; + @include flex; + justify-content: center; + align-items: flex-start; + + .name-list_title { + position: absolute; + top: vww(10); + font-size: vww(20); + } + + .name-list_container { + width: 94%; + padding-top: vww(10); + overflow: scroll; + @include flex; + justify-content: flex-start; + flex-direction: column; + margin-top: vww(40); + + &_item { + width: 100%; + height: vww(50); + @include flex; + justify-content: flex-start; + font-size: vww(18); + + .item-image { + height: 100%; + display: flex; + align-items: center; + } + + .item-customerName { + color: #252525; + margin-left: vww(8); + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } + } + } + } } </style> \ No newline at end of file -- Gitblit v1.9.1