From dc91d777ef776e5969fb9199d2eff1bae452d580 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期二, 26 三月 2024 13:30:12 +0800 Subject: [PATCH] # --- pages/phyz/wrkMast/wrkMast.vue | 28 ++++++ pages/phyz/wrkMast/wrkDetl.vue | 186 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 207 insertions(+), 7 deletions(-) diff --git a/pages/phyz/wrkMast/wrkDetl.vue b/pages/phyz/wrkMast/wrkDetl.vue index 8183fd0..56495a6 100644 --- a/pages/phyz/wrkMast/wrkDetl.vue +++ b/pages/phyz/wrkMast/wrkDetl.vue @@ -1,5 +1,23 @@ <template> <view> + <view class="code"> + <!-- <uni-search-bar :focus="matFocus" v-model="matnr" @input="matInput()" ma + maxlength="500" ancel="cancel" @clear="clear" placeholder="杈撳叆 / 鎵弿鍟嗗搧"> + </uni-search-bar> --> + </view> + <view class="list" v-for="(item,i) in dataList"> + <view class="list-left"> + <view>缂栧彿锛歿{item.matnr}}</view> + <view>鍚嶇О锛歿{item.maktx}}</view> + <view>瑙勬牸锛歿{item.specs}}</view> + <view>鎵瑰彿锛歿{item.batch}}</view> + <view class="list-anfme">鏁伴噺锛歿{item.anfme}}</view> + <view class="list-qty-1" v-if="item.anfme > item.qty">浣滀笟鏁伴噺锛歿{item.qty}}</view> + <view class="list-qty-2" v-if="item.anfme <= item.qty">浣滀笟鏁伴噺锛歿{item.qty}}</view> + </view> + </view> + <view style="height: 100rpx;"></view> + </view> </template> @@ -8,15 +26,175 @@ export default { data() { return { - + baseUrl: '', + token: '', + orderId: '', + matFocus: true, + matnr: '', + checck: true, + dataList: [], + oldDataList: [], + newDataList: [], + allCheck: false, + allCheckBtnTitle: '鍏ㄩ��', } }, - methods: { + onLoad() { + let that = this + this.baseUrl = uni.getStorageSync('baseUrl'); + this.token = uni.getStorageSync('token'); + // const eventChannel = this.$scope.eventChannel; // 鍏煎APP-NVUE + const eventChannel = this.getOpenerEventChannel(); + // 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� + eventChannel.on('item', function(data) { + console.log(data); + that.orderId = data.item + console.log(data.item.id); + uni.setNavigationBarTitle({ + title: `宸ヤ綔鍙�-${data.item}`, + + }) + that.getOrderDetl(data.item) + }) + }, + onShow() { + if (this.dataList.length > 0) { + this.oldDataList = [...this.dataList] + } + // this.getOrderDetl(this.orderId) + }, + methods: { + // 璁㈠崟鏄庣粏 + getOrderDetl(id) { + let _this = this + console.log(id); + uni.request({ + url: `${_this.baseUrl}/agv/wrkDetl/list/auth`, + header: {'token': uni.getStorageSync('token')}, + data: { + curr: 1, + limit: 1000, + wrk_no: id + }, + method: 'GET', + success(res) { + res = res.data + console.log(res); + if (res.code === 200) { + _this.dataList = res.data.records + _this.oldDataList = [..._this.dataList] + } + } + }) + }, + matInput() { + let count = 0 + let sign = 0 + if (this.oldDataList.length > 0) { + this.dataList = [...this.oldDataList] + } + this.newDataList = [] + for (let k in this.dataList) { + if (!this.dataList[k].matnr.includes(this.matnr)) { + count++; + } else { + this.newDataList.push(this.dataList[k]) + } + } + if (this.matnr != '') { + for (let j in this.dataList) { + if (!this.dataList[j].maktx.includes(this.matnr)) { + } else { + for (let i in this.newDataList) { + if (this.newDataList[i].matnr == this.dataList[j].matnr) { + sign++ + } + } + if (sign == 0) { + this.newDataList.push(this.dataList[j]) + } + } + } + } + this.dataList = this.newDataList + }, + checkboxChange(e) { + let items = this.dataList, + values = e.orderNo; + if (e.checked) { + this.$set(e,'checked',false) + } else { + if (e.anfme == e.qty) { + this.$set(e,'checked',false) + } else { + this.$set(e,'checked',true) + } + + } + }, + allChecked() { + if (this.allCheck) { + this.allCheck = false + this.allCheckBtnTitle = '鍏ㄩ��' + } else { + this.allCheck = true + this.allCheckBtnTitle = '鍙栨秷' + } + for (let item of this.dataList) { + if (this.allCheck) { + if (item.anfme == item.qty) { + this.$set(item,'checked',false) + } else { + this.$set(item,'checked',true) + } + } else { + this.$set(item,'checked',false) + } + } + }, + clear() { + this.matnr = '' + this.dataList = [...this.oldDataList] + }, + combConfirm(type) { + let _this = this + let combList = [] + for (let k of _this.dataList) { + if (k.checked) { + combList.push(k) + } + } + if (combList.length == 0) { + uni.showToast({ title: '璇烽�夋嫨缁勬墭鍟嗗搧', icon: "error", position: 'top'}) + return + } + uni.navigateTo({ + url: "../AGV/AGVPakin2", + success: function(res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑 + res.eventChannel.emit('mats', { + mats: combList + }) + }, + }); + }, } } </script> <style> - -</style> + @import url('../../../static/css/common/order.css'); + .list-anfme { + color: #0082ff; + font-weight: bold; + } + .list-qty-1 { + color: #33ba43; + font-weight: bold; + } + .list-qty-2 { + color: #e2231a; + font-weight: bold; + } +</style> \ No newline at end of file diff --git a/pages/phyz/wrkMast/wrkMast.vue b/pages/phyz/wrkMast/wrkMast.vue index 74f96c1..a0952ce 100644 --- a/pages/phyz/wrkMast/wrkMast.vue +++ b/pages/phyz/wrkMast/wrkMast.vue @@ -38,7 +38,7 @@ </view> <!-- 宸︿笅 --> <view class="list-left-bottom"> - <button size="mini">鏄庣粏</button> + <button size="mini" @click="getWrkDetlList(item.wrkNo)">鏄庣粏</button> <button size="mini">瀹屾垚</button> <button size="mini">鍙栨秷</button> </view> @@ -65,7 +65,7 @@ this.baseUrl = uni.getStorageSync('baseUrl'); this.token = uni.getStorageSync('token'); this.oldDataList = [...this.dataList] - this.getWaitPakinList() + this.getWrkMastList() }, methods: { // 鎼滅储妗嗚緭鍏� @@ -77,7 +77,7 @@ }, // 鑾峰彇宸ヤ綔鍒楄〃 - getWaitPakinList() { + getWrkMastList() { let _this = this _this.dataList = [] uni.request({ @@ -96,6 +96,28 @@ } }) }, + // 鑾峰彇宸ヤ綔鏄庣粏 + getWrkDetlList(e) { + let _this = this + uni.navigateTo({ + url: "./wrkDetl", + success: function(res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑 + res.eventChannel.emit('item', { + item: e + }) + }, + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� 鍙﹀涓�涓〉闈紶杩囨潵鐨� + acceptDataFromOpenedPage: function(data) { + // _this.matnr = data.data + _this.input(_this.matnr) + }, + }, + + + }); + } } } </script> -- Gitblit v1.9.1