From fe16b1af4bbfabda8726eca582b04f00d1b1de6f Mon Sep 17 00:00:00 2001 From: liuying <1427574514@qq.com> Date: 周二, 10 12月 2024 11:13:13 +0800 Subject: [PATCH] pda --- LA24030_LuLiPackageLine_Pda/api/putIn/artificial.js | 29 + LA24030_LuLiPackageLine_Pda/pages/untie/untie.vue | 1201 +++++++++++++++++++++++++++++++++------------------------ LA24030_LuLiPackageLine_Pda/pages/index/index.vue | 4 LA24030_LuLiPackageLine_Pda/pages.json | 2 4 files changed, 718 insertions(+), 518 deletions(-) diff --git a/LA24030_LuLiPackageLine_Pda/api/putIn/artificial.js b/LA24030_LuLiPackageLine_Pda/api/putIn/artificial.js index 22cf08f..04ae317 100644 --- a/LA24030_LuLiPackageLine_Pda/api/putIn/artificial.js +++ b/LA24030_LuLiPackageLine_Pda/api/putIn/artificial.js @@ -87,13 +87,6 @@ data: data }) } -export function getBhbMaterialList(data){ //瀹瑰櫒鏌ヨ - return request({ - url: `/api/WmsGroupDisk/PdaContainerWithMaterial?${qs.stringify(data)}`, - // url: `/api/wmsContainerMaterial/list?${qs.stringify(data)}`, - method: 'get', - }) -} export function PdaBindListForSNCode(data){ //鐗╂枡鏌ヨ return request({ url: `/api/WmsGroupDisk/PdaBindListForSNCode?${qs.stringify(data)}`, @@ -211,4 +204,24 @@ method: 'post', data }) -} \ No newline at end of file +} + + + +//====================== +export function getBhbMaterialList(data){ + return request({ + url: `/api/WmsCommonnQuery/QueryUpiListByUpi`, + method: 'post', + data: data + }) +} + +export function getenumDataList(data){ + return request({ + url: `/api/sysEnum/enumDataList?${qs.stringify(data)}`, + method: 'get', + data: data + }) +} + diff --git a/LA24030_LuLiPackageLine_Pda/pages.json b/LA24030_LuLiPackageLine_Pda/pages.json index 21a85c8..ec4292a 100644 --- a/LA24030_LuLiPackageLine_Pda/pages.json +++ b/LA24030_LuLiPackageLine_Pda/pages.json @@ -57,7 +57,7 @@ { "path": "pages/untie/untie", "style": { - "navigationBarTitleText": "鐗╂枡瑙g粦", + "navigationBarTitleText": "鏁村寘鏌ョ湅", "enablePullDownRefresh": false } }, diff --git a/LA24030_LuLiPackageLine_Pda/pages/index/index.vue b/LA24030_LuLiPackageLine_Pda/pages/index/index.vue index 6786f92..5581230 100644 --- a/LA24030_LuLiPackageLine_Pda/pages/index/index.vue +++ b/LA24030_LuLiPackageLine_Pda/pages/index/index.vue @@ -110,13 +110,13 @@ }, { - name: '鐗╂枡缁勭洏/涓婃灦', + name: '鏉夸欢鏌ョ湅', icon: 'icon-kuaidiguanli', src: '../../static/index/artificial.png', pages: '../artificial/artificial' }, { - name: '鐗╂枡瑙g粦', + name: '鏁村寘鏌ョ湅', //NG澶勭悊 icon: 'icon-kuaidiguanli', src: '../../static/index/untie.png', pages: '../untie/untie' diff --git a/LA24030_LuLiPackageLine_Pda/pages/untie/untie.vue b/LA24030_LuLiPackageLine_Pda/pages/untie/untie.vue index 57ab0b1..d002003 100644 --- a/LA24030_LuLiPackageLine_Pda/pages/untie/untie.vue +++ b/LA24030_LuLiPackageLine_Pda/pages/untie/untie.vue @@ -1,524 +1,711 @@ <template> - <view class="overflow" style="padding-bottom: 150rpx"> - <cu-custom bgColor="bg-white" :isBack="true"> - <block slot="backText"> - </block> - <block slot="content">鐗╂枡瑙g粦</block> - </cu-custom> - <u-form labelPosition="left" label-width="180rpx" :model="warehouse" ref="warehouseRef"> - <u-row class="border_bottom margin_top10rpx padding_left25rpx" style="background-color: #fff;"> - <u-col span="12"> - <u-form-item label="瀹瑰櫒缂栧彿:" prop="containerCode" required class="uFormItem"> - <u-input v-model.trim="warehouse.containerCode" @confirm="getContainerData(1)" - :disabled="kwbhAllowed" placeholder="璇峰綍鍏ユ垨鎵爜" class="width" :focus="curFoucus"> - </u-input> - </u-form-item> - </u-col> - </u-row> - <u-row class="border_bottom margin_top10rpx padding_left25rpx" style="background-color: #fff;" - v-if="warehouse.containerCode"> - <u-col span="12"> - <u-form-item label="鐗╂枡璺熻釜鐮�:" class="uFormItem"> - <u-input v-model="warehouse.snCode" ref="materialRef" placeholder="璇锋壂鐮佸綍鍏�" - @focus="warehouse.snCode = ''" @confirm="getContainerData" - style="font-weight: bolder;margin-left: 15rpx;" class="width padding_left25rpx"> - </u-input> - </u-form-item> - </u-col> - </u-row> - - </u-form> - <!-- 鍒楄〃 --> - <view class="margin_top10rpx"> - <u-swipe-action :show="item.show" :index="eindex" v-for="(item, eindex) in singlist" :key="eindex" - :options="options" @click="longpress" @open="open" @close="close" class="margin_bottom10rpx"> - <view class="item u-border-bottom"> - <!-- 姝ゅ眰wrap鍦ㄦ涓哄繀鍐欑殑锛屽惁鍒欏彲鑳戒細鍑虹幇鏍囬瀹氫綅閿欒 --> - <view class="title-wrap"> - <!-- --> - <view :class="item.checked ? 'bg_item' : ''" - class="fontSize32rpx width margin_auto background_fff padding10 relative box_sizing transition"> - <u-row> - <u-col span="12" class="flex align-center"> - <u-checkbox v-model="item.checked" size="50rpx"></u-checkbox> - <view class="flex justify-center align-center" - style="background-color: #f18202;color: #fff;border-radius: 50vh;width: 40rpx;height: 40rpx;"> - {{ eindex + 1 }} - </view> - <text class="color_f18202 padding_left10rpx"> - {{ item.materialCode }}({{ item.materialName }}) - </text> - </u-col> - </u-row> - <u-row> - <u-col span="8"> - <text class="color_80 padding_left25rpx"> - 璐ㄦ鐘舵�侊細{{ item.qcStatusName }} - </text> - </u-col> - <u-col span="4"> - <text class="color_80"> - 鎵规锛歿{ item.batch }} - </text> - </u-col> - </u-row> - <u-row> - <u-col span="8"> - <text class="color_80 padding_left25rpx"> - </text> - </u-col> - <u-col span="4"> - <text class="color_f18202"> - 鏁伴噺锛歿{ item.quantity }} - </text> - </u-col> - </u-row> - </view> - </view> - </view> - </u-swipe-action> - </view> - <modal-code :rescode='rescode' :resmessage='resmessage' ref="resmodal" /> - <u-popup v-model="detailshow" border-radius="14" @close="detailshow = false" mode="bottom"> - <!-- <view class="pop "> --> - <h2 class="text_align_center padding_bottom18 padding15">鐗╂枡淇℃伅</h2> - <view class="line flex justify-between"> - <text class="text-gray">鐗╂枡缂栧彿</text> - <text>{{ this.materlist.materialCode }}</text> - </view> - <view class="line flex justify-between"> - <text class="text-gray">鐗╂枡鍚嶇О</text> - <text>{{ this.materlist.materialName }}</text> - </view> - <view class="line flex justify-between"> - <text class="text-gray">鐗╂枡灏忕被</text> - <text>{{ this.materlist.materialTypeName }}</text> - </view> - <view class="line flex justify-between"> - <text class="text-gray">鎵规</text> - <text>{{ this.materlist.batchNo }}</text> - </view> - <view class="line flex justify-between"> - <text class="text-gray">鐗╂枡瑙勬牸</text> - <text>{{ this.materlist.specificationModel }}</text> - </view> - <view class="line flex justify-between"> - <text class="text-gray">鏁伴噺</text> - <text>{{ this.materlist.unBindQuantity }}</text> - </view> - <!-- </view> --> - <view class="margin_top140rpx"> - <button-modal :subShow='true' garmenTitle='鎵撳嵃' @submit='init' @reset='rest' /> - </view> - </u-popup> - <button-modal :empTytowerShow='true' cleaningTitle="閲嶇疆" garmenTitle='鐗╂枡瑙g粦' @submit='submit' @reset='back' /> - - </view> + <view class="overflow" style="padding-bottom: 150rpx"> + <cu-custom bgColor="bg-white" :isBack="true"> + <block slot="backText"> </block> + <block slot="content">鏁村寘鏌ョ湅</block> + </cu-custom> + <u-form + labelPosition="left" + label-width="180rpx" + :model="warehouse" + ref="warehouseRef" + > + <u-row + class="border_bottom margin_top10rpx padding_left25rpx" + style="background-color: #fff" + > + <u-col span="12"> + <u-form-item + label="鍖呰鍙�:" + prop="packageCode" + required + class="uFormItem" + > + <u-input + v-model.trim="warehouse.packageCode" + @confirm="getContainerData(1)" + placeholder="璇峰綍鍏ユ垨鎵爜" + class="width" + :focus="curFoucus" + > + </u-input> + </u-form-item> + </u-col> + </u-row> + <u-row + class="border_bottom margin_top10rpx padding_left25rpx" + style="background-color: #fff" + > + <u-col span="12"> + <u-form-item label="鏉夸欢鍙�:" class="uFormItem"> + <u-input + v-model="warehouse.upi" + ref="materialRef" + placeholder="璇锋壂鐮佸綍鍏�" + @focus="warehouse.upi = ''" + @confirm="getContainerData" + style="font-weight: bolder; margin-left: 15rpx" + class="width padding_left25rpx" + > + </u-input> + </u-form-item> + </u-col> + </u-row> + </u-form> + <!-- 鍒楄〃 --> + <view class="margin_top10rpx"> + <u-swipe-action + :show="item.show" + :index="eindex" + v-for="(item, eindex) in singlist" + :key="eindex" + :options="options" + @click="longpress" + @open="open" + @close="close" + class="margin_bottom10rpx" + > + <view class="item u-border-bottom"> + <!-- 姝ゅ眰wrap鍦ㄦ涓哄繀鍐欑殑锛屽惁鍒欏彲鑳戒細鍑虹幇鏍囬瀹氫綅閿欒 --> + <view class="title-wrap"> + <view + :class="item.checked ? 'bg_item' : ''" + class="fontSize32rpx width margin_auto background_fff padding10 relative box_sizing transition" + > + <!-- 閮ㄤ欢鍚嶇О upi銆佹潗鏂欍�佸昂瀵革紝浣嶇疆銆佹澘浠剁姸鎬� --> + <u-row> + <u-col span="12" class="flex align-center"> + <u-checkbox v-model="item.checked" size="50rpx"></u-checkbox> + <view + class="flex justify-center align-center" + style=" + background-color: #f18202; + color: #fff; + border-radius: 50vh; + width: 40rpx; + height: 40rpx; + " + > + {{ eindex + 1 }} + </view> + <text class="color_f18202 padding_left10rpx"> + {{ item.upi }} + </text> + </u-col> + </u-row> + <u-row> + <u-col span="8"> + <text class="color_80 padding_left25rpx"> + 閮ㄤ欢鍚嶇О锛� {{ item.detailName }} + </text> + </u-col> + <u-col span="4"> + <text class="color_80"> 浣嶇疆锛歿{ item.location }} </text> + </u-col> + </u-row> + <u-row> + <u-col span="8"> + <text class="color_80 padding_left25rpx"> + 鏉愭枡锛歿{ item.info18 }} + </text> + </u-col> + <u-col span="4"> + <text class="color_80"> 灏哄锛歿{ item.info16 }} </text> + </u-col> + </u-row> + <u-row> + <u-col span="8"> + <text class="color_80 padding_left25rpx"> + 鏉夸欢鐘舵�侊細{{ item.upiStatus }} + </text> + </u-col> + <u-col span="4"> + <text class="color_80"> 娆″簭锛歿{ item.shelf }} </text> + </u-col> + </u-row> + </view> + </view> + </view> + </u-swipe-action> + </view> + <modal-code :rescode="rescode" :resmessage="resmessage" ref="resmodal" /> + <u-popup + v-model="detailshow" + border-radius="14" + @close="detailshow = false" + mode="bottom" + > + <!-- <view class="pop "> --> + <h2 class="text_align_center padding_bottom18 padding15">鐗╂枡淇℃伅</h2> + <view class="line flex justify-between"> + <text class="text-gray">鐗╂枡缂栧彿</text> + <text>{{ this.materlist.materialCode }}</text> + </view> + <view class="line flex justify-between"> + <text class="text-gray">鐗╂枡鍚嶇О</text> + <text>{{ this.materlist.materialName }}</text> + </view> + <view class="line flex justify-between"> + <text class="text-gray">鐗╂枡灏忕被</text> + <text>{{ this.materlist.materialTypeName }}</text> + </view> + <view class="line flex justify-between"> + <text class="text-gray">鎵规</text> + <text>{{ this.materlist.batchNo }}</text> + </view> + <view class="line flex justify-between"> + <text class="text-gray">鐗╂枡瑙勬牸</text> + <text>{{ this.materlist.specificationModel }}</text> + </view> + <view class="line flex justify-between"> + <text class="text-gray">鏁伴噺</text> + <text>{{ this.materlist.unBindQuantity }}</text> + </view> + <!-- </view> --> + <view class="margin_top140rpx"> + <button-modal + :subShow="true" + garmenTitle="鎵撳嵃" + @submit="init" + @reset="rest" + /> + </view> + </u-popup> + <button-modal + :empTytowerShow="true" + cleaningTitle="閲嶇疆" + garmenTitle="鐗╂枡瑙g粦" + @submit="submit" + @reset="back" + /> + </view> </template> <script> -import { getContainerMaterial, unbindOrder } from '@/api/putIn/untie.js' -import BluePrint from '@/pages/print/bluePrint.js' -import ButtonModal from '../../components/buttonModal.vue' -import ModalCode from '../../components/ModalCode.vue' -import { getAttrValue } from '@/utils/tool.js' -import { getContainDetail, onlyUpdateDutyCycle, getBhbMaterialList } from '../../api/putIn/artificial.js' +import { getContainerMaterial, unbindOrder } from "@/api/putIn/untie.js"; +import BluePrint from "@/pages/print/bluePrint.js"; +import ButtonModal from "../../components/buttonModal.vue"; +import ModalCode from "../../components/ModalCode.vue"; +import { getAttrValue } from "@/utils/tool.js"; +import { + getContainDetail, + onlyUpdateDutyCycle, + getBhbMaterialList, + getenumDataList, +} from "../../api/putIn/artificial.js"; export default { - data() { - return { - operator: '', - warehouse: { - containerCode: '', - materialCode: '', - dutyCycle: '', - gridNumber: 1, - useNumber: 0, - exitNumber: 0 - }, - singlist: [ - // {} - ], //璇︽儏鍒楄〃 - ordersId: 0, //褰撳墠瀹瑰櫒缁戝畾鐨勪笂鏋跺崟 - rescode: 0, - resmessage: '', - options: [{ - text: '鎵撳嵃', - style: { - backgroundColor: '#fc9f35' - } - } - ], - detailshow: false, - materlist: {}, - curFoucus: true, - timer: null, - timerSm: null, - detailableZb: false, - detailable: false, - gridFocus: false, - gridable: true, - kwbhAllowed: false - } + data() { + return { + operator: "", + warehouse: { + packageCode: "", + materialCode: "", + dutyCycle: "", + gridNumber: 1, + useNumber: 0, + exitNumber: 0, + }, + singlist: [ + // {} + ], //璇︽儏鍒楄〃 + ordersId: 0, //褰撳墠瀹瑰櫒缁戝畾鐨勪笂鏋跺崟 + rescode: 0, + resmessage: "", + options: [ + { + text: "鎵撳嵃", + style: { + backgroundColor: "#fc9f35", + }, + }, + ], + detailshow: false, + materlist: {}, + curFoucus: true, + timer: null, + timerSm: null, + detailableZb: false, + detailable: false, + gridFocus: false, + gridable: true, + kwbhAllowed: false, + }; + }, + components: { + ButtonModal, + ModalCode, + }, + onLoad() { + this.operator = JSON.parse(uni.getStorageSync("userInfo")).name; + }, + mounted() { + getenumDataList({ + EnumName: "UpiStatusEnum", + }).then((res) => { + this.singlist = res.data.result || []; + }); + }, - }, - components: { - ButtonModal, - ModalCode - }, - onLoad() { - this.operator = JSON.parse(uni.getStorageSync('userInfo')).name - }, - watch: { - containerCode(val) { - if (!val) { - this.detailable = false; - this.detailableZb = false; - this.warehouse.exitNumber = 0 - } - } - }, - methods: { - // 濡傛灉鎵撳紑涓�涓殑鏃跺�欙紝涓嶉渶瑕佸叧闂叾浠栵紝鍒欐棤闇�瀹炵幇鏈柟娉� - open(index) { - // 鍏堝皢姝e湪琚搷浣滅殑swipeAction鏍囪涓烘墦寮�鐘舵�侊紝鍚﹀垯鐢变簬props鐨勭壒鎬ч檺鍒讹紝 - // 鍘熸湰涓�'false'锛屽啀娆¤缃负'false'浼氭棤鏁� - this.singlist[index].show = true; - this.singlist.map((val, idx) => { - if (index != idx) this.singlist[idx].show = false; - }) - }, - close(index) { - this.singlist[index].show = false; - }, - //鐗╂枡璇︽儏 - longpress(index, eindex) { - this.materlist = this.singlist[index] - this.detailshow = true - }, - //鏍囩閲嶆柊鎵撳嵃 - init() { - const arr = ['materialCode', 'unBindQuantity']; - const arrzw = ['鐗╂枡缂栧彿', '鏈瑙g粦鏁伴噺'] - let isAllow = '' - Object.keys(this.materlist).forEach(item => { - if (arr.includes(item)) { - if (!this.materlist[item]) { - isAllow = arr.indexOf(item) - // this.rescode = 400 - // this.resmessage = `${arrzw[isAllow]}涓虹┖锛屼笉鑳界户缁墦鍗癭 - // this.resmessage = `${item}涓虹┖锛屼笉鑳界户缁墦鍗癭 - // this.$refs.resmodal.show = true - return - } - } - }) - if (isAllow != '') { - this.detailshow = false - this.rescode = 400 - this.resmessage = `${arrzw[isAllow]}涓虹┖锛屼笉鑳界户缁墦鍗癭 - this.$refs.resmodal.show = true - return - } - if (this.materlist.unBindQuantity <= 0 || this.materlist.unBindQuantity > this.materlist.quantity) { - this.detailshow = false - this.rescode = 400 - this.resmessage = `鏁伴噺涓嶇鍚堣鑼冿紝涓嶈兘缁х画鎵撳嵃` - this.$refs.resmodal.show = true - return - } - if (!this.materlist.specificationModel) { - this.materlist.specificationModel = '' - } - let ptintContext = [ - { type: 'text', x: 0, y: 0, text: '', size: 2, rotate: 0, bold: 0, underline: false, reverse: false }, - { type: 'text', x: 0, y: 0, text: '', size: 2, rotate: 0, bold: 0, underline: false, reverse: false }, - { type: 'text', x: 0, y: 0, text: '', size: 2, rotate: 0, bold: 0, underline: false, reverse: false }, - /* 浠ヤ笂绌烘暟鎹紝涓洪槻姝涪鍖呮椂鎵撳嵃涓嶆甯� */ - { type: 'line', x1: 3, y1: 3, x2: 565, y2: 3, width: 2 }, - { type: 'line', x1: 3, y1: 3, x2: 3, y2: 345, width: 2 }, - { type: 'line', x1: 3, y1: 345, x2: 565, y2: 345, width: 2 }, - { type: 'line', x1: 565, y1: 345, x2: 565, y2: 3, width: 2 }, - { type: 'text', x: 80, y: 15, text: '鐗ч噹姹借溅瑁呭(姝︽眽)鏈夐檺鍏徃', size: 3, rotate: 0, bold: 1, underline: false, reverse: false }, - { type: 'line', x1: 3, y1: 60, x2: 565, y2: 60, width: 2 }, - { type: 'text', x: 10, y: 75, text: `鐗╂枡缂栧彿: ${this.materlist.materialCode}`, size: 2, rotate: 0, bold: 1, underline: false, reverse: false }, - { type: 'line', x1: 3, y1: 110, x2: 380, y2: 110, width: 2 }, - { type: 'text', x: 10, y: 125, text: `鐗╂枡鍚嶇О: ${this.materlist.materialTypeName || ''}`, size: 2, rotate: 0, bold: 1, underline: false, reverse: false }, - { type: 'line', x1: 3, y1: 160, x2: 380, y2: 160, width: 2 }, - { type: 'text', x: 10, y: 175, text: `鎵规: ${this.materlist.batchNo}`, size: 2, rotate: 0, bold: 1, underline: false, reverse: false }, - { type: 'line', x1: 3, y1: 210, x2: 565, y2: 210, width: 2 }, - { type: 'line', x1: 380, y1: 60, x2: 380, y2: 210, width: 2 }, - { type: 'qr', x: 410, y: 72, text: `PARTS NUMBER: ${this.materlist.materialCode},SAP: ${this.materlist.sap_Location || ''},BOXNUM: ${this.materlist.boxNo || ''},LOT NO: ${this.materlist.batchNo},QUANTITY: ${this.materlist.unBindQuantity}`, width: 3, level: 1 }, - { type: 'text', x: 10, y: 225, text: `瑙勬牸鍨嬪彿: ${this.materlist.specificationModel.length > 32 ? this.materlist.specificationModel.substr(0, 32) : this.materlist.specificationModel}`, size: 2, rotate: 0, bold: 1, underline: false, reverse: false }, - { type: 'line', x1: 3, y1: 260, x2: 565, y2: 260, width: 2 }, - { type: 'text', x: 120, y: 290, text: 'MAKINO J(CHINA) CO.LTD', size: 3, rotate: 0, bold: 1, underline: false, reverse: false }, - ] - console.log(ptintContext) - BluePrint.print(this.$store, ptintContext).then(() => { - // 鍏抽棴寮规 骞舵仮澶嶆粦鍔ㄥ潡 - this.detailshow = false - this.addForm.code = this.materlist.materlist; - this.addForm.name = this.materlist.materialName; - this.addForm.batchNo = this.materlist.batchNo; - this.addForm.specificationModel = this.materlist.specificationModel; - addPrintRecord(this.addForm).then(res => { - console.log(res); - }) - uni.showToast({ - title: '鎵撳嵃鎴愬姛', - duration: 2000 - }) - }).catch((err) => { - // uni.showToast({ - // title:'鎵撳嵃澶辫触', - // duration: 2000 - // }) - }) - }, - materialBlur() { - clearTimeout(this.timerSm) - this.timerSm = null - if (this.warehouse.materialCode == '') { - return - } + methods: { + // 濡傛灉鎵撳紑涓�涓殑鏃跺�欙紝涓嶉渶瑕佸叧闂叾浠栵紝鍒欐棤闇�瀹炵幇鏈柟娉� + open(index) { + // 鍏堝皢姝e湪琚搷浣滅殑swipeAction鏍囪涓烘墦寮�鐘舵�侊紝鍚﹀垯鐢变簬props鐨勭壒鎬ч檺鍒讹紝 + // 鍘熸湰涓�'false'锛屽啀娆¤缃负'false'浼氭棤鏁� + this.singlist[index].show = true; + this.singlist.map((val, idx) => { + if (index != idx) this.singlist[idx].show = false; + }); + }, + close(index) { + this.singlist[index].show = false; + }, + //鐗╂枡璇︽儏 + longpress(index, eindex) { + this.materlist = this.singlist[index]; + this.detailshow = true; + }, + //鏍囩閲嶆柊鎵撳嵃 + init() { + const arr = ["materialCode", "unBindQuantity"]; + const arrzw = ["鐗╂枡缂栧彿", "鏈瑙g粦鏁伴噺"]; + let isAllow = ""; + Object.keys(this.materlist).forEach((item) => { + if (arr.includes(item)) { + if (!this.materlist[item]) { + isAllow = arr.indexOf(item); + // this.rescode = 400 + // this.resmessage = `${arrzw[isAllow]}涓虹┖锛屼笉鑳界户缁墦鍗癭 + // this.resmessage = `${item}涓虹┖锛屼笉鑳界户缁墦鍗癭 + // this.$refs.resmodal.show = true + return; + } + } + }); + if (isAllow != "") { + this.detailshow = false; + this.rescode = 400; + this.resmessage = `${arrzw[isAllow]}涓虹┖锛屼笉鑳界户缁墦鍗癭; + this.$refs.resmodal.show = true; + return; + } + if ( + this.materlist.unBindQuantity <= 0 || + this.materlist.unBindQuantity > this.materlist.quantity + ) { + this.detailshow = false; + this.rescode = 400; + this.resmessage = `鏁伴噺涓嶇鍚堣鑼冿紝涓嶈兘缁х画鎵撳嵃`; + this.$refs.resmodal.show = true; + return; + } + if (!this.materlist.specificationModel) { + this.materlist.specificationModel = ""; + } + let ptintContext = [ + { + type: "text", + x: 0, + y: 0, + text: "", + size: 2, + rotate: 0, + bold: 0, + underline: false, + reverse: false, + }, + { + type: "text", + x: 0, + y: 0, + text: "", + size: 2, + rotate: 0, + bold: 0, + underline: false, + reverse: false, + }, + { + type: "text", + x: 0, + y: 0, + text: "", + size: 2, + rotate: 0, + bold: 0, + underline: false, + reverse: false, + }, + /* 浠ヤ笂绌烘暟鎹紝涓洪槻姝涪鍖呮椂鎵撳嵃涓嶆甯� */ + { type: "line", x1: 3, y1: 3, x2: 565, y2: 3, width: 2 }, + { type: "line", x1: 3, y1: 3, x2: 3, y2: 345, width: 2 }, + { type: "line", x1: 3, y1: 345, x2: 565, y2: 345, width: 2 }, + { type: "line", x1: 565, y1: 345, x2: 565, y2: 3, width: 2 }, + { + type: "text", + x: 80, + y: 15, + text: "鐗ч噹姹借溅瑁呭(姝︽眽)鏈夐檺鍏徃", + size: 3, + rotate: 0, + bold: 1, + underline: false, + reverse: false, + }, + { type: "line", x1: 3, y1: 60, x2: 565, y2: 60, width: 2 }, + { + type: "text", + x: 10, + y: 75, + text: `鐗╂枡缂栧彿: ${this.materlist.materialCode}`, + size: 2, + rotate: 0, + bold: 1, + underline: false, + reverse: false, + }, + { type: "line", x1: 3, y1: 110, x2: 380, y2: 110, width: 2 }, + { + type: "text", + x: 10, + y: 125, + text: `鐗╂枡鍚嶇О: ${this.materlist.materialTypeName || ""}`, + size: 2, + rotate: 0, + bold: 1, + underline: false, + reverse: false, + }, + { type: "line", x1: 3, y1: 160, x2: 380, y2: 160, width: 2 }, + { + type: "text", + x: 10, + y: 175, + text: `鎵规: ${this.materlist.batchNo}`, + size: 2, + rotate: 0, + bold: 1, + underline: false, + reverse: false, + }, + { type: "line", x1: 3, y1: 210, x2: 565, y2: 210, width: 2 }, + { type: "line", x1: 380, y1: 60, x2: 380, y2: 210, width: 2 }, + { + type: "qr", + x: 410, + y: 72, + text: `PARTS NUMBER: ${this.materlist.materialCode},SAP: ${ + this.materlist.sap_Location || "" + },BOXNUM: ${this.materlist.boxNo || ""},LOT NO: ${ + this.materlist.batchNo + },QUANTITY: ${this.materlist.unBindQuantity}`, + width: 3, + level: 1, + }, + { + type: "text", + x: 10, + y: 225, + text: `瑙勬牸鍨嬪彿: ${ + this.materlist.specificationModel.length > 32 + ? this.materlist.specificationModel.substr(0, 32) + : this.materlist.specificationModel + }`, + size: 2, + rotate: 0, + bold: 1, + underline: false, + reverse: false, + }, + { type: "line", x1: 3, y1: 260, x2: 565, y2: 260, width: 2 }, + { + type: "text", + x: 120, + y: 290, + text: "MAKINO J(CHINA) CO.LTD", + size: 3, + rotate: 0, + bold: 1, + underline: false, + reverse: false, + }, + ]; + console.log(ptintContext); + BluePrint.print(this.$store, ptintContext) + .then(() => { + // 鍏抽棴寮规 骞舵仮澶嶆粦鍔ㄥ潡 + this.detailshow = false; + this.addForm.code = this.materlist.materlist; + this.addForm.name = this.materlist.materialName; + this.addForm.batchNo = this.materlist.batchNo; + this.addForm.specificationModel = this.materlist.specificationModel; + addPrintRecord(this.addForm).then((res) => { + console.log(res); + }); + uni.showToast({ + title: "鎵撳嵃鎴愬姛", + duration: 2000, + }); + }) + .catch((err) => { + // uni.showToast({ + // title:'鎵撳嵃澶辫触', + // duration: 2000 + // }) + }); + }, + materialBlur() { + clearTimeout(this.timerSm); + this.timerSm = null; + if (this.warehouse.materialCode == "") { + return; + } - this.timer = setTimeout(() => { //澶氭瑙﹀彂bug 寤惰繜bug - //鍒ゆ柇褰撳墠鐗╂枡鏄惁鍦ㄧ洏鐐瑰垪琛ㄤ腑 - const index = this.singlist.findIndex(item => item.materialCode == this.warehouse.materialCode && item.batchNo == lotNo); - if (index > -1) { - this.singlist[index].checked = 1 - this.singlist.unshift(...this.singlist.splice(index, 1)) - return - } else { - clearTimeout(this.timer) - this.timer = null - this.containerBlur() - } - }, 100) - }, - containerBlur() { - if (this.warehouse.containerCode == '' || this.warehouse.materialCode == '') { - return - } - getContainerMaterial(this.warehouse).then(res => { - if (res.data == null || res.data.length == 0) { - this.rescode = 400 - this.resmessage = '鏆傛棤鏁版嵁' - this.$refs.resmodal.show = true - return; - } - this.warehouse.dutyCycle = res.data[0].dutyCycle || 0; - //缁欐墍鏈夌殑鏉愭枡涓�涓湭閫変腑鐨勭姸鎬� - res.data.map(item => { - item.checked = true, - item.unBindQuantity = '' - }) - this.singlist.unshift(...res.data) - this.ordersId = res.data[0].ordersId - }) - }, - //瑙g粦鏁伴噺澶辩劍浜嬩欢 - changeNum(option) { - //鍒ゆ柇鏄惁鍕鹃�夛紝濡傛灉鍕鹃�変簡锛屽氨瑕佸鏁伴噺鏍¢獙 - if (!option.checked) { - return - } - if (option.unBindQuantity == '') { - this.rescode = 400 - this.resmessage = '瑙g粦鏁伴噺涓嶈兘涓虹┖' - this.$refs.resmodal.show = true - } + this.timer = setTimeout(() => { + //澶氭瑙﹀彂bug 寤惰繜bug + //鍒ゆ柇褰撳墠鐗╂枡鏄惁鍦ㄧ洏鐐瑰垪琛ㄤ腑 + const index = this.singlist.findIndex( + (item) => + item.materialCode == this.warehouse.materialCode && + item.batchNo == lotNo + ); + if (index > -1) { + this.singlist[index].checked = 1; + this.singlist.unshift(...this.singlist.splice(index, 1)); + return; + } else { + clearTimeout(this.timer); + this.timer = null; + this.containerBlur(); + } + }, 100); + }, + containerBlur() { + if ( + this.warehouse.packageCode == "" || + this.warehouse.materialCode == "" + ) { + return; + } + getContainerMaterial(this.warehouse).then((res) => { + if (res.data == null || res.data.length == 0) { + this.rescode = 400; + this.resmessage = "鏆傛棤鏁版嵁"; + this.$refs.resmodal.show = true; + return; + } + this.warehouse.dutyCycle = res.data[0].dutyCycle || 0; + //缁欐墍鏈夌殑鏉愭枡涓�涓湭閫変腑鐨勭姸鎬� + res.data.map((item) => { + (item.checked = true), (item.unBindQuantity = ""); + }); + this.singlist.unshift(...res.data); + this.ordersId = res.data[0].ordersId; + }); + }, + //瑙g粦鏁伴噺澶辩劍浜嬩欢 + changeNum(option) { + //鍒ゆ柇鏄惁鍕鹃�夛紝濡傛灉鍕鹃�変簡锛屽氨瑕佸鏁伴噺鏍¢獙 + if (!option.checked) { + return; + } + if (option.unBindQuantity == "") { + this.rescode = 400; + this.resmessage = "瑙g粦鏁伴噺涓嶈兘涓虹┖"; + this.$refs.resmodal.show = true; + } - if (option.unBindQuantity <= 0) { - this.rescode = 400 - this.resmessage = '瑙g粦鏁伴噺蹇呴』澶т簬0' - this.$refs.resmodal.show = true - } - if (option.unBindQuantity > option.quantity) { - this.rescode = 400 - this.resmessage = '瑙g粦鏁伴噺涓嶈兘澶т簬搴撳瓨鏁伴噺' - this.$refs.resmodal.show = true - } - if (this.detailable) { - let filterHas = this.singlist.filter(item => item.unBindQuantity == Number(item.quantity)); - if (filterHas.length > 0) { - this.warehouse.exitNumber = this.warehouse.useNumber - filterHas.length - } - } - }, - //纭瑙g粦 - submit() { - const filterArr = this.singlist.filter(item => item.checked); - if (filterArr.length <= 0) { - this.rescode = 400 - this.resmessage = '璇烽�夋嫨瑙g粦鐨勭墿鏂欙紒' - this.$refs.resmodal.show = true - return - } - //鍒ゆ柇閫変腑鐨勯噷闈㈡槸鍚﹀瓨鍦ㄨВ缁戠殑鏁伴噺涓嶇鍚堣鑼冪殑 - // const index = filterArr.findIndex(item => item.unBindQuantity == '' || item.unBindQuantity <= 0 || item.unBindQuantity > item.quantity) - // if (index > -1) { - // this.rescode = 400 - // this.resmessage = '瑙g粦鏁伴噺涓嶇鍚堣姹�' - // this.$refs.resmodal.show = true - // return - // } - const warehousOrderDetails = filterArr.reduce((curr, item) => { - curr.push({ - ...item - }) - return curr; - }, []) - const params = { - flag:3,//3锛氱墿鏂欒В缁� - containerCode: this.warehouse.containerCode, - orderDetails: warehousOrderDetails - } - uni.showModal({ - title: '瑙g粦', - content: '鏄惁纭瑙g粦锛�', - showCancel: true, - cancelColor: '#333333', - success: (res => { - if (res.confirm) { - unbindOrder(params).then(res => { - this.rescode = 200 - this.$refs.resmodal.show = true; - this.resmessage = '瑙g粦鎴愬姛' - this.back(); - }) - } else if (res.cancel) { + if (option.unBindQuantity <= 0) { + this.rescode = 400; + this.resmessage = "瑙g粦鏁伴噺蹇呴』澶т簬0"; + this.$refs.resmodal.show = true; + } + if (option.unBindQuantity > option.quantity) { + this.rescode = 400; + this.resmessage = "瑙g粦鏁伴噺涓嶈兘澶т簬搴撳瓨鏁伴噺"; + this.$refs.resmodal.show = true; + } + if (this.detailable) { + let filterHas = this.singlist.filter( + (item) => item.unBindQuantity == Number(item.quantity) + ); + if (filterHas.length > 0) { + this.warehouse.exitNumber = + this.warehouse.useNumber - filterHas.length; + } + } + }, + //纭瑙g粦 + submit() { + const filterArr = this.singlist.filter((item) => item.checked); + if (filterArr.length <= 0) { + this.rescode = 400; + this.resmessage = "璇烽�夋嫨瑙g粦鐨勭墿鏂欙紒"; + this.$refs.resmodal.show = true; + return; + } + //鍒ゆ柇閫変腑鐨勯噷闈㈡槸鍚﹀瓨鍦ㄨВ缁戠殑鏁伴噺涓嶇鍚堣鑼冪殑 + // const index = filterArr.findIndex(item => item.unBindQuantity == '' || item.unBindQuantity <= 0 || item.unBindQuantity > item.quantity) + // if (index > -1) { + // this.rescode = 400 + // this.resmessage = '瑙g粦鏁伴噺涓嶇鍚堣姹�' + // this.$refs.resmodal.show = true + // return + // } + const warehousOrderDetails = filterArr.reduce((curr, item) => { + curr.push({ + ...item, + }); + return curr; + }, []); + const params = { + flag: 3, //3锛氱墿鏂欒В缁� + packageCode: this.warehouse.packageCode, + orderDetails: warehousOrderDetails, + }; + uni.showModal({ + title: "瑙g粦", + content: "鏄惁纭瑙g粦锛�", + showCancel: true, + cancelColor: "#333333", + success: (res) => { + if (res.confirm) { + unbindOrder(params).then((res) => { + this.rescode = 200; + this.$refs.resmodal.show = true; + this.resmessage = "瑙g粦鎴愬姛"; + this.back(); + }); + } else if (res.cancel) { + } + }, + }); + }, + rest() {}, + //妫�鏌ュ鍣ㄦ爡鏍兼暟 + checkGrid() {}, + //鑾峰彇瀹瑰櫒鐨勪俊鎭� + getContainerData(param) { + if (param == 1) { + this.warehouse.upi = ""; + } + if (this.warehouse.packageCode == "") { + uni.showToast({ + title: "璇锋壂瀹瑰櫒缂栧彿", + icon: "none", + duration: 2000, + }); + return; + } + getBhbMaterialList({ + packageCode: this.warehouse.packageCode, + upi: this.warehouse.upi, + }).then((res) => { + // //debugger + const result = res.result; + if (Array.isArray(result) && result.length == 0) { + uni.showToast({ + title: "鏁版嵁涓嶅瓨鍦�", + icon: "none", + duration: 2000, + }); + return; + // this.kwbhAllowed = true + } + //瀹瑰櫒缂栧彿鍏ュ彛 + // if (param == 1) { + // } + if (res.result && res.result.length == 1) { + res.result[0].checked = true; + } + this.singlist = res.result; - } - }) - }); - }, - rest() { - }, - //妫�鏌ュ鍣ㄦ爡鏍兼暟 - checkGrid() { - }, - //鑾峰彇瀹瑰櫒鐨勪俊鎭� - getContainerData(param) { - if (this.warehouse.containerCode == '') { - uni.showToast({ - title: '璇锋壂瀹瑰櫒缂栧彿', - icon: 'none', - duration: 2000 - }); - return - } - // this.kwbhAllowed = false; - getBhbMaterialList({ - 'containerCode': this.warehouse.containerCode, - 'SNCode': this.warehouse.snCode - }).then(res => { - // //debugger - const result = res.result; - if (Array.isArray(result) && result.length == 0) { - uni.showToast({ - title: '鏁版嵁涓嶅瓨鍦�', - icon: 'none', - duration: 2000 - }); - return - // this.kwbhAllowed = true - } - //瀹瑰櫒缂栧彿鍏ュ彛 - // if (param == 1) { - // } - if(res.result && res.result.length==1){ - res.result[0].checked=true; - } - this.singlist = res.result; - - //鐗╂枡鍏ュ彛 鏍规嵁id 鍒ゆ柇鐗╂枡鏄惁瀛樺湪 - // res.result.forEach(item => { - // let index = this.singlist.findIndex(v => v.snCode == item.snCode); - // if (index == -1) { - - // this.singlist.unshift({ - // ...item - // }) - // } - // }); - }) - }, - onlyUpdateDutyCycleClick() { - this.$refs.warehouseRef.setRules(this.warehouseRules) - this.$refs.warehouseRef.validate(valid => { - if (valid) { - //璇锋眰鍙傛暟 - let params = { - wareContainerCode: this.warehouse.containerCode, - dutyCycle: this.warehouse.dutyCycle - } - uni.showModal({ - title: '鎻愮ず', - content: '鏄惁纭浠呮洿鏂扮┖闂村崰姣旀暟鎹紵', - showCancel: true, - cancelColor: '#333333', - success: (res => { - if (res.confirm) { - onlyUpdateDutyCycle(params).then(res => { - this.warhouseTph = this.warehouse.containerCode - this.rescode = res.code - this.resmessage = res.message - this.$refs.resmodal.show = true - this.rest() - }) - } else if (res.cancel) { + //鐗╂枡鍏ュ彛 鏍规嵁id 鍒ゆ柇鐗╂枡鏄惁瀛樺湪 + // res.result.forEach(item => { + // let index = this.singlist.findIndex(v => v.upi == item.upi); + // if (index == -1) { - } - }) - }); - } - }) - }, - gridBtnClick() { - this.gridable = !this.gridable - if (!this.gridable) { - this.$nextTick(() => { - this.gridFocus = true; - }) - } else { - this.$nextTick(() => { - this.gridFocus = false; - }) - } - }, - //鍏ㄩ儴鍙栨秷 - back() { - this.ordersId = 0; - this.singlist = []; - this.$refs.warehouseRef.resetFields(); - this.warehouse.containerCode = '' - } - }, - unmounted() { - if (this.timer) { - clearTimeout(this.timer) - this.timer = null - } - }, -} + // this.singlist.unshift({ + // ...item + // }) + // } + // }); + }); + }, + onlyUpdateDutyCycleClick() { + this.$refs.warehouseRef.setRules(this.warehouseRules); + this.$refs.warehouseRef.validate((valid) => { + if (valid) { + //璇锋眰鍙傛暟 + let params = { + warepackageCode: this.warehouse.packageCode, + dutyCycle: this.warehouse.dutyCycle, + }; + uni.showModal({ + title: "鎻愮ず", + content: "鏄惁纭浠呮洿鏂扮┖闂村崰姣旀暟鎹紵", + showCancel: true, + cancelColor: "#333333", + success: (res) => { + if (res.confirm) { + onlyUpdateDutyCycle(params).then((res) => { + this.warhouseTph = this.warehouse.packageCode; + this.rescode = res.code; + this.resmessage = res.message; + this.$refs.resmodal.show = true; + this.rest(); + }); + } else if (res.cancel) { + } + }, + }); + } + }); + }, + gridBtnClick() { + this.gridable = !this.gridable; + if (!this.gridable) { + this.$nextTick(() => { + this.gridFocus = true; + }); + } else { + this.$nextTick(() => { + this.gridFocus = false; + }); + } + }, + //鍏ㄩ儴鍙栨秷 + back() { + this.ordersId = 0; + this.singlist = []; + this.$refs.warehouseRef.resetFields(); + this.warehouse.packageCode = ""; + }, + }, + unmounted() { + if (this.timer) { + clearTimeout(this.timer); + this.timer = null; + } + }, +}; </script> <style lang="scss"> .content { - height: 500rpx; - overflow-y: scroll; - width: 100%; - padding: 15rpx; - box-sizing: border-box; + height: 500rpx; + overflow-y: scroll; + width: 100%; + padding: 15rpx; + box-sizing: border-box; - .content-item { - padding: 15rpx; - background-color: #fff; - margin-bottom: 15rpx; - border-radius: 8rpx; - font-size: 32rpx; - } + .content-item { + padding: 15rpx; + background-color: #fff; + margin-bottom: 15rpx; + border-radius: 8rpx; + font-size: 32rpx; + } } .bg_item { - background: #FFEBCD !important; + background: #ffebcd !important; } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3