From 56ef552ecc4cf835f15547c7bdbb4151ecc023aa Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期二, 19 九月 2023 15:10:42 +0800 Subject: [PATCH] # --- pages/out/stockOut.vue | 100 ++++++++++++++---------- pages/out/handIn.vue | 100 ++++++++++++++++-------- 2 files changed, 123 insertions(+), 77 deletions(-) diff --git a/pages/out/handIn.vue b/pages/out/handIn.vue index 97550a5..70337de 100644 --- a/pages/out/handIn.vue +++ b/pages/out/handIn.vue @@ -80,7 +80,7 @@ <!-- 搴曢儴鎿嶄綔鎸夐挳 --> <view class="buttom"> <button size="mini" @click="reset('warn')">閲嶇疆</button> - <button size="mini" type="primary" @click="combConfirm('warn')">缁勬墭</button> + <button size="mini" type="primary" @click="combConfirm('warn')">鍏ュ簱</button> </view> <!-- 寮圭獥 --> <!-- 淇敼鏁伴噺 --> @@ -131,7 +131,7 @@ <uni-popup-message :type="msgType1" :message="messageText" :duration="2000"></uni-popup-message> </uni-popup> </view> - <!-- 纭缁勬墭 --> + <!-- 纭鍏ュ簱 --> <view> <uni-popup ref="combConfirm" type="dialog"> <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content" @@ -158,18 +158,7 @@ palletizingNo: '', boxType: '', createTime: '', - dataList: [ - // { - // matnr: '1', - // maktx: '2', - // boxNo: '3', - // position: '4', - // weight: '5', - // anfme: '6', - // batch: '7', - // specs: '8', - // } - ], + dataList: [], count: 0, rowNum: '', matnr: '', @@ -187,6 +176,7 @@ matFocus: false, matData: '', removeNum: 0, + checkFlag: true, } }, onLoad() { @@ -413,37 +403,27 @@ combConfirm(type) { this.msgType = type this.title = '璀﹀憡' - this.content = '鏄惁鐜板湪缁勬墭!' + this.content = '鏄惁鐜板湪鍏ュ簱!' this.$refs.combConfirm.open() }, combClose() { this.$refs.combConfirm.close() }, comb() { - uni.vibrateShort(); let that = this; - if (that.barcode === '') { - this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�" - this.messageToggle('error') - return; + that.combCheck(that.palletizingNo,that.boxType,that.createTime); + if (that.checkFlag) { + return } - if (that.dataList.length === 0) { - this.messageText = "璇锋坊鍔犲晢鍝佸垪琛�" - this.messageToggle('error') - return; - } - for (var i = 0; i < that.dataList.length; i++) { - if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') { - this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0' - this.messageToggle('error') - return; - } - } + console.log(that.dataList); uni.request({ - url: that.baseUrl + '/mobile/comb/auth', + url: that.baseUrl + '/mobile/truss/comd/auth', data: JSON.stringify({ barcode: that.barcode, - combMats: that.dataList + palletizingNo: that.palletizingNo, + boxType: that.boxType, + createTime: that.createTime, + matLists: that.dataList }), method: 'POST', header: { @@ -453,7 +433,7 @@ var res = result.data if (res.code === 200) { that.resst(); - that.messageText = "缁勬墭鎴愬姛" + that.messageText = "鍏ュ簱鎴愬姛" that.messageToggle('success') const innerAudioContext = uni.createInnerAudioContext(); innerAudioContext.src = '/static/music/pakinOk.mp3'; @@ -473,6 +453,56 @@ } }); }, + // 鎻愪氦鏍¢獙 + combCheck(palletizingNo,boxType,createTime) { + if (this.barcode === '') { + this.messageText = "璇锋坊鍔犳墭鐩樼爜" + this.messageToggle('error') + this.checkFlag = true; + return + } + if (palletizingNo === '') { + this.messageText = "璇锋坊鍔犵爜鍨涗綅" + this.messageToggle('error') + this.checkFlag = true; + return + } + if (boxType === '') { + this.messageText = "璇锋坊鍔犳湪绠辩被鍨�" + this.messageToggle('error') + this.checkFlag = true; + return + } + if (createTime === '') { + this.messageText = "璇锋坊鍔犲垱寤烘椂闂�" + this.messageToggle('error') + this.checkFlag = true; + return + } + if (this.dataList.length === 0) { + this.messageText = "璇锋坊鍔犲叆搴撳晢鍝�" + this.messageToggle('error') + this.checkFlag = true; + return + } + for (let i = 0; i < this.dataList.length; i++) { + if (this.dataList[i].anfme == 0 || this.dataList[i].anfme == '') { + this.messageText = this.dataList[i].matnr + '閫�搴撴暟閲忎笉鑳戒负0' + this.messageToggle('error') + this.checkFlag = true; + return + } + } + for (let i = 0; i < this.dataList.length; i++) { + if (this.dataList[i].anfme == 0 || this.dataList[i].anfme == '') { + this.messageText = this.dataList[i].matnr + '閫�搴撴暟閲忎笉鑳戒负0' + this.messageToggle('error') + this.checkFlag = true; + return + } + } + this.checkFlag = false; + }, reset(type) { this.msgType = type this.title = '璀﹀憡' diff --git a/pages/out/stockOut.vue b/pages/out/stockOut.vue index 97550a5..e7df698 100644 --- a/pages/out/stockOut.vue +++ b/pages/out/stockOut.vue @@ -2,10 +2,6 @@ <view> <view class="code"> <view class="item"> - <view class="code-decs">鎵樼洏鐮�:</view> - <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus"> - </view> - <view class="item"> <view class="code-decs">鐮佸灈浣�:</view> <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="palletizingNo" :focus="palletizingNoFocus"> </view> @@ -80,7 +76,7 @@ <!-- 搴曢儴鎿嶄綔鎸夐挳 --> <view class="buttom"> <button size="mini" @click="reset('warn')">閲嶇疆</button> - <button size="mini" type="primary" @click="combConfirm('warn')">缁勬墭</button> + <button size="mini" type="primary" @click="combConfirm('warn')">閫�搴�</button> </view> <!-- 寮圭獥 --> <!-- 淇敼鏁伴噺 --> @@ -131,7 +127,7 @@ <uni-popup-message :type="msgType1" :message="messageText" :duration="2000"></uni-popup-message> </uni-popup> </view> - <!-- 纭缁勬墭 --> + <!-- 纭閫�搴� --> <view> <uni-popup ref="combConfirm" type="dialog"> <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content" @@ -158,18 +154,7 @@ palletizingNo: '', boxType: '', createTime: '', - dataList: [ - // { - // matnr: '1', - // maktx: '2', - // boxNo: '3', - // position: '4', - // weight: '5', - // anfme: '6', - // batch: '7', - // specs: '8', - // } - ], + dataList: [], count: 0, rowNum: '', matnr: '', @@ -187,10 +172,8 @@ matFocus: false, matData: '', removeNum: 0, + checkFlag: true, } - }, - onLoad() { - }, onShow() { this.baseUrl = uni.getStorageSync('baseUrl'); @@ -413,34 +396,20 @@ combConfirm(type) { this.msgType = type this.title = '璀﹀憡' - this.content = '鏄惁鐜板湪缁勬墭!' + this.content = '鏄惁鐜板湪閫�搴�!' this.$refs.combConfirm.open() }, combClose() { this.$refs.combConfirm.close() }, comb() { - uni.vibrateShort(); let that = this; - if (that.barcode === '') { - this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�" - this.messageToggle('error') - return; - } - if (that.dataList.length === 0) { - this.messageText = "璇锋坊鍔犲晢鍝佸垪琛�" - this.messageToggle('error') - return; - } - for (var i = 0; i < that.dataList.length; i++) { - if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') { - this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0' - this.messageToggle('error') - return; - } + that.combCheck(that.palletizingNo,that.boxType,that.createTime); + if (that.checkFlag) { + return } uni.request({ - url: that.baseUrl + '/mobile/comb/auth', + url: that.baseUrl + '/mobile/truss/auth', data: JSON.stringify({ barcode: that.barcode, combMats: that.dataList @@ -453,7 +422,7 @@ var res = result.data if (res.code === 200) { that.resst(); - that.messageText = "缁勬墭鎴愬姛" + that.messageText = "閫�搴撴垚鍔�" that.messageToggle('success') const innerAudioContext = uni.createInnerAudioContext(); innerAudioContext.src = '/static/music/pakinOk.mp3'; @@ -472,6 +441,50 @@ } } }); + }, + // 鎻愪氦鏍¢獙 + combCheck(palletizingNo,boxType,createTime) { + if (palletizingNo === '') { + this.messageText = "璇锋坊鍔犵爜鍨涗綅" + this.messageToggle('error') + this.checkFlag = true; + return + } + if (boxType === '') { + this.messageText = "璇锋坊鍔犳湪绠辩被鍨�" + this.messageToggle('error') + this.checkFlag = true; + return + } + if (createTime === '') { + this.messageText = "璇锋坊鍔犲垱寤烘椂闂�" + this.messageToggle('error') + this.checkFlag = true; + return + } + if (this.dataList.length === 0) { + this.messageText = "璇锋坊鍔犻��搴撳晢鍝�" + this.messageToggle('error') + this.checkFlag = true; + return + } + for (let i = 0; i < this.dataList.length; i++) { + if (this.dataList[i].anfme == 0 || this.dataList[i].anfme == '') { + this.messageText = this.dataList[i].matnr + '閫�搴撴暟閲忎笉鑳戒负0' + this.messageToggle('error') + this.checkFlag = true; + return + } + } + for (let i = 0; i < this.dataList.length; i++) { + if (this.dataList[i].anfme == 0 || this.dataList[i].anfme == '') { + this.messageText = this.dataList[i].matnr + '閫�搴撴暟閲忎笉鑳戒负0' + this.messageToggle('error') + this.checkFlag = true; + return + } + } + this.checkFlag = false; }, reset(type) { this.msgType = type @@ -501,6 +514,9 @@ <style> @import url('../../static/css/wms.css/wms.css'); + .list:first-child { + margin-top: 320rpx; + } .empty-list { height: 50%; width: 100%; @@ -553,7 +569,7 @@ width: 100%; background-color: white; position: fixed; - margin-top: 280rpx; + margin-top: 210rpx; z-index: 9; /* border-top: 1px solid #DCDFE6; */ text-align: center; -- Gitblit v1.9.1