UNPKG

logwire-wms-ui-test

Version:

运匠科技wms-PDA基础组件库

218 lines (217 loc) 13.7 kB
import { n as c, h as i, A as r, Q as u, i as l, f as o, s as p, j as v } from "./index.f1359381.mjs"; import "vue"; const d = { name: "LwInboundReceiveCaseExecutePage", components: { AsnSkuInfo: i, AsnInfo: r, QualityCard: u }, data() { return { asn: null, cases: [], caseNum: { value: "", focus: !0 }, receiveLoc: { value: "", focus: !1 }, receiveLpn: { value: "", focus: !1 }, currentSku: null, showAbnormal: !1 }; }, computed: { numStatistics() { return this.cases.map((a) => ({ skuCount: a.skuCount, qty: a.qty })).reduce((a, e) => ({ skuCount: a.skuCount + e.skuCount, qty: a.qty + e.qty }), { skuCount: 0, qty: 0 }); } }, created() { const { asnId: a, caseNum: e } = this.$route.query; if (!a) return this.$lwShowErrorMsg(this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.ttthaies", "\u9519\u8BEF\u7684\u5230\u8D27\u901A\u77E5\u5355\u53F7")); if (!e) return this.$lwShowErrorMsg(this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.sgkzzkbm", "\u9519\u8BEF\u7684\u7BB1\u53F7")); this.loadAsn(a, e); }, methods: { initCase(a) { if (this.cases.find((s) => s.caseNum === a.caseNum)) return this.$lwShowErrorMsg(this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.has.scan", "\u7BB1\u53F7\uFF1A{caseNum} \u5DF2\u7ECF\u5728\u5F53\u524D\u5DF2\u626B\u63CF\u5217\u8868\u4E2D\uFF0C\u8BF7\u68C0\u67E5", { caseNum: a.caseNum })); if (a && a.skuList) { a.isShrink = !0; for (let s of a.skuList) s.lotEl = "lot_" + s.sku.code, s.lotQuery = { warehouseId: this.asn.warehouseId, ownerId: s.ownerId, skuId: s.id, type: 1, lotType: "inventory", header: this.asn.map, line: s.map }; if (this.cases.push(a), this.caseNum.value = "", !this.receiveLoc.value) { const s = this.cases.findIndex((t) => t.receiveLocationCode); s >= 0 && (this.receiveLoc.value = this.cases[s].receiveLocationCode); } } else return this.$lwShowErrorMsg(this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.qaerzklp", "\u6CA1\u6709\u53EF\u7528\u7684\u5546\u54C1\u4FE1\u606F")); }, clearCase() { this.caseNum.value = "", this.caseNum.focus = !0; }, loadAsn(a, e = null) { l(a).then((s) => { this.asn = s, e && o(a, e).then(this.initCase).catch(() => this.clearCase()); }); }, addCase() { if (this.caseNum.value) { if (this.cases.find((e) => e.caseNum === this.caseNum.value)) return this.$lwShowErrorMsg(this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.has.scan", "\u7BB1\u53F7\uFF1A{caseNum} \u5DF2\u7ECF\u5728\u5F53\u524D\u5DF2\u626B\u63CF\u5217\u8868\u4E2D\uFF0C\u8BF7\u68C0\u67E5", { caseNum: this.caseNum.value })); o(this.asn.id, this.caseNum.value).then(this.initCase).catch(() => this.clearCase()); } }, submit() { if (this.cases.length === 0) return this.caseNum.focus = !0, this.$lwShowErrorMsg(this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.beevnrig", "\u8BF7\u626B\u63CF\u7BB1\u53F7")); if (!this.receiveLoc.value) return this.receiveLoc.focus = !0, this.$lwShowErrorMsg(this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.xymgmnid", "\u6536\u8D27\u5E93\u4F4D\u4E0D\u80FD\u4E3A\u7A7A")); if (!this.receiveLpn.value) return this.receiveLpn.focus = !0, this.$lwShowErrorMsg(this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.qdxoqyqo", "\u6536\u8D27\u6258\u76D8\u4E0D\u80FD\u4E3A\u7A7A")); const a = []; for (let s of this.cases) { if (!s.fastReceive) return this.$lwShowErrorMsg(this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.not.fast", "\u7BB1\u53F7\uFF1A{caseNum} \u4E0D\u80FD\u6574\u7BB1\u5FEB\u6536", { caseNum: s.caseNum })); for (let t of s.skuList) { const n = this.$refs[t.lotEl][0].getData(); if (!n.success) return; a.push({ caseNum: s.caseNum, skuId: t.sku.id, lotAttributes: n.data }); } } const e = { asnId: this.asn.id, locationCode: this.receiveLoc.value, lpn: this.receiveLpn.value, printDeviceId: null, printTemplate: null, warehouseId: this.asn.warehouseId, lines: a }; p(e).then(() => { this.$lwToast.success(this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.ivymtjgb", "\u64CD\u4F5C\u6210\u529F")), setTimeout(() => { this.$router.back(); }, 1e3); }).catch(() => this.clearCase()); }, removeCase(a) { this.$lwDialog.confirm({ title: this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.mblhcrvk", "\u786E\u8BA4\u79FB\u9664\u7BB1{caseNum}\u5417\uFF1F", { caseNum: a.caseNum }) }).then(() => { const e = this.cases.indexOf(a); e > -1 && this.cases.splice(e, 1); }).catch(() => { }); }, showAbnormalPop(a) { this.$refs[a.lotEl][0].getData().success && (this.currentSku = a, this.showAbnormal = !0); }, submitAbnormal() { const { success: a, data: e } = this.$refs.abnormal.getAllAbnormalData(); !a || v({ asnId: this.asn.id, ownerId: this.asn.ownerId, abnType: e.abnType, abnSubType: e.abnSubType, order: e.order, lines: [ { ...e.lines[0], originalLpn: this.currentSku.lpn, originalCaseNum: this.currentSku.caseNum } ] }).then(() => { this.showAbnormal = !1, this.currentSku = null, this.$lwToast.success(this.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.dxihbntd", "\u5F02\u5E38\u4E0A\u62A5\u6210\u529F")), this.loadAsn(this.asn.id); }); } } }; var g = function() { var e = this, s = e._self._c; return s("div", [s("lw-nav-bar", { attrs: { title: e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.kbmbivvl", "\u6574\u7BB1\u6536\u8D27") } }), e.asn ? s("div", { staticClass: "lw-global-page-box" }, [s("div", [s("asn-info", { attrs: { data: e.asn, shrinkable: "", radius: "" } })], 1), s("div", { staticClass: "lw-global-model-box", staticStyle: { "margin-top": "10px" } }, [s("lw-input", { attrs: { title: e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.ezcaseei", "\u7BB1\u53F7"), "get-focus": e.caseNum.focus }, on: { "update:getFocus": function(t) { return e.$set(e.caseNum, "focus", t); }, "update:get-focus": function(t) { return e.$set(e.caseNum, "focus", t); }, confirm: e.addCase }, model: { value: e.caseNum.value, callback: function(t) { e.$set(e.caseNum, "value", t); }, expression: "caseNum.value" } })], 1), s("div", { staticClass: "lw-global-model-box lw-global-flex-between case-nums" }, [s("div", [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.zueoponq", "\u626B\u63CF\u7ED3\u679C")))]), s("div", { staticClass: "lw-global-flex-between" }, [s("div", [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.mxfwsuxq", "\u7BB1\u6570: "))), s("span", [e._v(e._s(e.numStatistics.skuCount))])]), s("div", [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.eamyskqy", "\u6570\u91CF: "))), s("span", [e._v(e._s(e.numStatistics.qty))])])])]), e._l(e.cases, function(t) { return [s("div", { key: t.caseNum, staticClass: "lw-global-model-box" }, [s("div", [s("div", { staticClass: "lw-global-flex-between" }, [s("div", [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.ejccqqkk", "\u7BB1\u53F7: "))), s("span", [e._v(e._s(t.caseNum))])]), s("div", [t.fastReceive ? s("lw-tag", [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.clpdfnjk", "\u5FEB\u901F\u6536\u8D27")))]) : s("lw-tag", [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.tag.advance", "\u9884\u6536\u8D27")))]), s("van-icon", { staticClass: "btn-shrink", class: { inverted: t.isShrink }, attrs: { name: "arrow-up" }, on: { click: function(n) { n.stopPropagation(), t.isShrink = !t.isShrink; } } })], 1)]), s("div", { staticClass: "lw-global-sh", staticStyle: { margin: "10px 0" } }), s("div", { staticClass: "lw-global-flex-between" }, [s("div", [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.cytznwxn", "\u54C1\u79CD\u6570: "))), s("span", [e._v(e._s(t.skuCount))])]), s("div", [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.jkvbswog", "\u6570\u91CF: "))), s("span", [e._v(e._s(t.qty))])]), s("div", [s("lw-button", { attrs: { mini: "" }, on: { click: function(n) { return e.removeCase(t); } } }, [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.gkjijylo", "\u79FB\u9664")))])], 1)])]), s("div", { directives: [{ name: "show", rawName: "v-show", value: !t.isShrink, expression: "!c.isShrink" }] }, [s("van-divider", { attrs: { contentPosition: "center", textColor: "#1989fa" } }, [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.kpwjkeap", "\u5546\u54C1\u5217\u8868")))]), e._l(t.skuList, function(n) { return s("div", { key: n.id }, [s("asn-sku-info", { attrs: { data: n }, scopedSlots: e._u([{ key: "extend", fn: function() { return [s("div", { staticStyle: { margin: "10px 0" } }, [s("div", [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.glkfqpfz", "\u6570\u91CF"))), s("b", { staticStyle: { color: "red", "font-size": "1.1em" } }, [e._v(e._s(" " + n.qty))])]), s("div", [s("lw-button", { attrs: { color: "orange" }, on: { click: function(k) { return e.showAbnormalPop(n); } } }, [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.tkyllqtp", "\u6536\u8D27\u5F02\u5E38")))])], 1)])]; }, proxy: !0 }], null, !0) }), n ? s("quality-card", { attrs: { type: "asn", "obj-id": e.asn.id, skuCode: n.sku.code, "delay-load": !0, "card-mode": !1 } }) : e._e(), s("lw-lot-module", { ref: "lot_" + n.sku.code, refInFor: !0, attrs: { query: n.lotQuery } })], 1); })], 2)])]; }), s("div", { staticClass: "lw-global-model-box" }, [s("lw-input", { attrs: { title: e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.xjfjcsgo", "\u6536\u8D27\u5E93\u4F4D"), required: "", "get-focus": e.receiveLoc.focus }, on: { "update:getFocus": function(t) { return e.$set(e.receiveLoc, "focus", t); }, "update:get-focus": function(t) { return e.$set(e.receiveLoc, "focus", t); } }, model: { value: e.receiveLoc.value, callback: function(t) { e.$set(e.receiveLoc, "value", t); }, expression: "receiveLoc.value" } }), s("lw-input", { attrs: { title: e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.zhacwngt", "\u6536\u8D27\u6258\u76D8"), required: "", "get-focus": e.receiveLpn.focus }, on: { "update:getFocus": function(t) { return e.$set(e.receiveLpn, "focus", t); }, "update:get-focus": function(t) { return e.$set(e.receiveLpn, "focus", t); } }, model: { value: e.receiveLpn.value, callback: function(t) { e.$set(e.receiveLpn, "value", t); }, expression: "receiveLpn.value" } })], 1)], 2) : e._e(), s("lw-bottom-bar", [s("lw-button", { attrs: { plain: "" }, on: { click: function(t) { return e.$router.back(); } } }, [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.mvangcdg", "\u91CD\u65B0\u626B\u63CF\u7BB1\u53F7")))]), s("lw-button", { on: { click: e.submit } }, [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.frgsbxyo", "\u786E\u8BA4\u6536\u8D27")))])], 1), s("lw-popup", { staticClass: "abnormal-popup-bg", attrs: { title: e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.zgilmwhu", "\u6536\u8D27\u5F02\u5E38") }, scopedSlots: e._u([{ key: "button", fn: function() { return [s("lw-button", { on: { click: e.submitAbnormal } }, [e._v(e._s(e.$lwLanguage.get("wms_project.pda.components.page.inbound.receive.receive_case.wwbrznds", "\u4E0A\u62A5\u5F02\u5E38")))])]; }, proxy: !0 }]), model: { value: e.showAbnormal, callback: function(t) { e.showAbnormal = t; }, expression: "showAbnormal" } }, [e.currentSku ? s("lw-receive-abnormal-module", { ref: "abnormal", attrs: { multiple: !1, "sku-disabled": !0, "show-bottom-bar": !1, "original-lpn": !1, "original-case-num": !1, "asn-no": e.asn.asnNo, "sku-code": e.currentSku.sku.code, qty: e.currentSku.qty } }) : e._e()], 1)], 1); }, m = [], _ = /* @__PURE__ */ c( d, g, m, !1, null, "4bcabfee", null, null ); const w = _.exports, h = { name: "InboundReceiveCaseScanView", components: { LwInboundReceiveCaseExecutePage: w } }; var b = function() { var e = this, s = e._self._c; return s("lw-inbound-receive-case-execute-page"); }, f = [], $ = /* @__PURE__ */ c( h, b, f, !1, null, null, null, null ); const C = $.exports; export { C as default };