From 873e64746e0f64889392a34dbe62dc8913d9ecf3 Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期四, 30 五月 2024 10:44:29 +0800 Subject: [PATCH] # --- pages/phyz/wrkMast/DBList.vue | 214 ++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 160 insertions(+), 54 deletions(-) diff --git a/pages/phyz/wrkMast/DBList.vue b/pages/phyz/wrkMast/DBList.vue index 3faf48d..1d69a8e 100644 --- a/pages/phyz/wrkMast/DBList.vue +++ b/pages/phyz/wrkMast/DBList.vue @@ -1,9 +1,9 @@ <template> <view class="container"> <view class="code"> - <uni-search-bar :focus="searchValueFocus" v-model="searchValue" + <!-- <uni-search-bar :focus="searchValueFocus" v-model="searchValue" maxlength="500" ancel="cancel" @confirm="searchValueInput2()" @clear="clear" placeholder="杈撳叆 / 鎵弿 璁㈠崟鍙�"> - </uni-search-bar> + </uni-search-bar> --> <view class="code-title"> <view></view> <view style="width: 100%;text-align: center;margin: 16rpx 0;">{{searchValue}} 鎬绘暟閲忥細- {{total}} -</view> @@ -14,14 +14,16 @@ <view class="list list-font-color" :class="orderDetl.color" v-for="(orderDetl,index) in dataList" :key="index"> <view class="list-left"> <view class="detl-threeCode">{{orderDetl.wrkNo}}</view> - <view>宸ヤ綔绫诲瀷锛歿{orderDetl.ioType$}}</view> + <view>宸ヤ綔鏃堕棿锛歿{orderDetl.ioTime$}}</view> + <view>璋冩嫧绫诲瀷锛歿{orderDetl.ioType$}}</view> <view>宸ヤ綔鐘跺喌锛歿{orderDetl.wrkSts$}}</view> <view>婧愬簱浣嶏細{{orderDetl.sourceLocNo}}</view> <view>鐩爣搴撲綅锛歿{orderDetl.locNo}}</view> + <view>鐩爣妤煎眰锛歿{orderDetl.crnNo}}</view> <view>璐ф灦鐮侊細{{orderDetl.barcode}}</view> </view> - <view class="list-right" @click="addItem(index)"> - <uni-icons type="folder-add" size="25" color="#fff"></uni-icons> + <view class="list-right" @click="opt(orderDetl)"> + <uni-icons type="bars" size="25" color="#fff"></uni-icons> </view> </view> @@ -54,37 +56,66 @@ <view class="title">绛涢��</view> <view class="popup-item" style="background-color: #dfdfdf;"> <view class="item-cl"> - <view>閿�鍞鍗曪細</view> - <input type="text" v-model="searchValue"> + <view>宸ヤ綔鍙凤細</view> + <input type="text" v-model="wrk_no"> </view> </view> <view class="popup-item" style="background-color: #dfdfdf;"> <view class="item-cl"> - <view>涓昏鍗曞彿锛�</view> - <input type="text" v-model="orderNo"> + <view>宸ヤ綔绫诲瀷锛�</view> + <input type="text" v-model="io_type"> </view> </view> <view class="popup-item" style="background-color: #dfdfdf;"> <view class="item-cl"> - <view>鍟嗗搧缂栧彿锛�</view> - <input type="text" v-model="matnr"> + <view>宸ヤ綔鐘舵�侊細</view> + <input type="text" v-model="wrk_sts"> </view> </view> <view class="popup-item" style="background-color: #dfdfdf;"> <view class="item-cl"> - <view>鍟嗗搧鍚嶇О锛�</view> - <input type="text" v-model="maktx"> + <view>婧愬簱浣嶏細</view> + <input type="text" v-model="source_loc_no"> </view> </view> <view class="popup-item" style="background-color: #dfdfdf;"> <view class="item-cl"> - <view>鍟嗗搧绉嶇被锛�</view> - <input type="text" v-model="brand"> + <view>鐩爣搴撲綅锛�</view> + <input type="text" v-model="loc_no"> + </view> + </view> + <view class="popup-item" style="background-color: #dfdfdf;"> + <view class="item-cl"> + <view>璐ф灦鐮侊細</view> + <input type="text" v-model="barcode"> + </view> + </view> + <view class="popup-item" style="background-color: #dfdfdf;"> + <view class="item-cl"> + <view>鐩爣妤煎眰锛�</view> + <input type="text" v-model="crn_no"> </view> </view> <view class="btn filter-btn"> <view class="btn-left" @click="filterClose">閲嶇疆</view> <view class="btn-right" @click="filterConfirm()">纭</view> + </view> + </view> + </uni-popup> + </view> + <!-- 鎿嶄綔寮圭獥 --> + <view> + <uni-popup ref="option" type="dialog"> + <view class="filter-popup" style="height: 50vh;"> + <!-- 鏍囬 --> + <view class="title">鎿嶄綔</view> + <view style="display: flex;flex-wrap: wrap;"> + <button size="mini" type="primary" @click="handControlWrkMast('1')" v-show="complete" >瀹屾垚</button> + <button size="mini" type="warn" @click="handControlWrkMast('2')">鍙栨秷(AGV)</button> + <button size="mini" @click="handControlWrkMast('5')">鍙栨秷</button> + </view> + <view style="display: flex;" v-show="tranType != 'N'"> + <button size="mini" @click="changeType()">{{tranType}}</button> </view> </view> </uni-popup> @@ -100,25 +131,34 @@ token: '', searchValueFocus: true, searchValue: '', - orderNo: '', - matnr: '', - maktx: '', - brand: '', + wrk_no: '', + barcode: '', + wrk_sts: '', + crn_no: '', + source_loc_no: '', + loc_no: '', + io_type: '', total: '', dataList: [], orderCarList: [], data: { curr: 1, limit: 100, - three_code: '', - matnr: '', - maktx: '', - order_no: '', - brand: '' + wrk_no: '', + barcode: '', + wrk_sts: '', + crn_no: '', + source_loc_no: '', + loc_no: '', + io_type: '' }, index: 0, count: 0, - mask: false + mask: false, + wrkNo: '', + tranType: '杞墜鍔�', + complete: true, + } }, @@ -143,10 +183,12 @@ methods: { getOrderDetlList(threeCode,limit) { uni.showLoading({}) + if (limit == 1) { + this.dataList = [] + this.data.curr = 1 + } let _this = this - _this.mask = true - _this.data.three_code = threeCode - _this.data.limit = limit + _this.data.limit = 10 uni.request({ url: `${_this.baseUrl}/agv/wrkMast/list/auth/dbList`, header: {'token': uni.getStorageSync('token')}, @@ -157,12 +199,12 @@ res = res.data if (res.code === 200) { for (let k of res.data.records) { - if (k.anfme > k.qty && k.qty == 0) { + if ([21, 22, 201].includes(k.wrkSts)) { k['color'] = 'order-sts-start' - } else if (k.anfme > k.qty && k.qty != 0) { - k['color'] = 'order-sts-working' - } else { + } else if ([205,206].includes(k.wrkSts)) { k['color'] = 'order-sts-end' + } else { + k['color'] = 'order-sts-working' } } let list = res.data.records @@ -198,20 +240,21 @@ this.getOrderDetlList(this.searchValue,10) },300) }, - // 娣诲姞鍏ュ簱鍟嗗搧鑷� 寰呯粍鎵樺垪琛� - addItem(index) { - // 鍒ゆ柇娣诲姞鐨勫晢鍝佹槸鍚﹀拰宸茬粡娣诲姞鐨勯噸澶� - let dataList = this.dataList - for (let k of this.orderCarList) { - if (k.orderNo == dataList[index].orderNo - && k.threeCode == dataList[index].threeCode - && k.matnr == dataList[index].matnr) { - uni.showToast({ title: '璇峰嬁閲嶅娣诲姞鍟嗗搧锛�', icon: "none", position: 'top' }) - return + // 鎿嶄綔 + opt(orderDetl) { + this.wrkNo = orderDetl.wrkNo + if (orderDetl.wrkSts != 22) { + this.tranType = 'N' + } else { + if (orderDetl.ioType == 108) { + this.tranType = '杞墜鍔�' + } else { + this.tranType = '杞嚜鍔�' } } - this.index = index - this.$refs.addItem.open() + + + this.$refs.option.open('bottom') }, addClose() { this.$refs.addItem.close() @@ -264,22 +307,81 @@ filterConfirm() { this.dataList = [] this.data.curr = 1 - this.data.maktx = this.maktx - this.data.matnr = this.matnr - this.data.order_no = this.order_no - this.data.brand = this.brand - this.getOrderDetlList(this.searchValue,10) + this.data.wrk_no = this.wrk_no + this.data.barcode = this.barcode + this.data.wrk_sts = this.wrk_sts + this.data.crn_no = this.crn_no + this.data.source_loc_no = this.source_loc_no + this.data.loc_no = this.loc_no + this.data.io_type = this.io_type + this.getOrderDetlList(this.data.wrk_no,10) this.$refs.filter.close() }, filterClose() { this.dataList = [] - this.data.curr = 1 - this.data.maktx = '' - this.data.matnr = '' - this.data.order_no = '' - this.data.brand = '' + this.data.wrk_no = '' + this.data.barcode = '' + this.data.wrk_sts = '' + this.data.crn_no = '' + this.data.source_loc_no = '' + this.data.loc_no = '' + this.data.io_type = '' this.getOrderDetlList(this.searchValue,10) this.$refs.filter.close() + }, + handControlWrkMast(type) { + let _this = this + let param = {workNo: _this.wrkNo,type: type} + uni.request({ + url: `${_this.baseUrl}/agv/hand/control/wrkMast`, + header: { + 'token': uni.getStorageSync('token'), + 'content-type': 'application/x-www-form-urlencoded' + }, + data: param, + method: 'POST', + success(res) { + res = res.data + if (res.code === 200) { + _this.$refs.option.close() + setTimeout(()=>{ + _this.getOrderDetlList('',1) + },100) + } else if (res.code == 403) { + uni.showToast({ title: res.msg, icon: "error", position: 'top' }) + setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000); + } else { + uni.showToast({ title: res.msg, icon: "error", position: 'top' }) + } + } + }) + }, + changeType() { + let _this = this + let param = {workNo: _this.wrkNo} + uni.request({ + url: `${_this.baseUrl}/agv/hand/control/wrkMast/changeType`, + header: { + 'token': uni.getStorageSync('token'), + 'content-type': 'application/x-www-form-urlencoded' + }, + data: param, + method: 'POST', + success(res) { + res = res.data + if (res.code === 200) { + _this.$refs.option.close() + setTimeout(()=>{ + _this.getOrderDetlList('',1) + },100) + } else if (res.code == 403) { + uni.showToast({ title: res.msg, icon: "error", position: 'top' }) + setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000); + } else { + uni.showToast({ title: res.msg, icon: "error", position: 'top' }) + } + } + }) } } @@ -415,6 +517,10 @@ position: relative; border-radius: 30rpx 30rpx 0rpx 0rpx; } + .filter-popup button { + flex: 1; + margin: 16rpx; + } .filter-popup-item { height: 100%; width: 100%; -- Gitblit v1.9.1