| | |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | v-if="isBatch === 0" |
| | | style="float: right; height: 20px" |
| | | @click="lockstocks" |
| | | >éå®åºå</el-link |
| | | @click="handleOpenPicking" |
| | | >æ£é</el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | v-if="isBatch === 1" |
| | | @click="handleOpenBatchPicking" |
| | | >åæ¹æ£é</el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | v-if="isBatch === 0" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="outbound" |
| | | >ç´æ¥åºåº</el-link |
| | |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | v-if="isBatch === 1" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="outboundbatch" |
| | | >åæ¹åºåº</el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="getData" |
| | | >å·æ°</el-link |
| | | ></el-col |
| | | > |
| | | > |
| | | </el-col> |
| | | </el-row> |
| | | </el-alert> |
| | | </div> |
| | |
| | | effect="dark" |
| | | :content="item.title" |
| | | placement="bottom" |
| | | ><el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | :disabled="getButtonEnable(item.prop, scoped.row)" |
| | | @click="tableButtonClick(scoped.row, item)" |
| | | ><i :class="item.icon" style="font-size: 22px"></i></el-link |
| | | ></el-tooltip> |
| | | > |
| | | <i :class="item.icon" style="font-size: 22px"></i> |
| | | </el-link> |
| | | </el-tooltip> |
| | | </div> |
| | | |
| | | <div v-else-if="item.type == 'tag'"> |
| | | <el-tag size="small"> |
| | | {{ getDictionary(scoped.row, item) }} |
| | | </el-tag> |
| | | </div> |
| | | <div v-else> |
| | | {{ scoped.row[item.prop] }} |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | ref="selectedStock" |
| | | @parentCall="parentCall" |
| | | ></selected-stock> |
| | | <NoStockOut ref="NoStockOut" @parentCall="parentCall"></NoStockOut> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import VolForm from "@/components/basic/VolForm.vue"; |
| | | import StockSelect from "./StockSelect.vue"; |
| | | import SelectedStock from "./SelectedStock.vue"; |
| | | import NoStockOut from "./NoStockOut.vue"; |
| | | import { h, createVNode, render, reactive } from "vue"; |
| | | import { |
| | | ElDialog, |
| | | ElForm, |
| | | ElFormItem, |
| | | ElSelect, |
| | | ElOption, |
| | | ElButton, |
| | | ElInput, |
| | | ElMessage, |
| | | } from "element-plus"; |
| | | |
| | | export default { |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock }, |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock, NoStockOut }, |
| | | data() { |
| | | return { |
| | | row: null, |
| | | isBatch: 0, |
| | | showDetialBox: false, |
| | | flag: false, |
| | | currentRow: null, |
| | | selection: [], |
| | | tableData: [], |
| | | mainBusinessType: null, // æ°å¢ï¼åå¨ä¸»åæ®çbusinessType |
| | | tableColumns: [ |
| | | { |
| | | prop: "id", |
| | |
| | | prop: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | width: 120, |
| | | }, |
| | | { |
| | | prop: "materielName", |
| | |
| | | { |
| | | prop: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "supplyCode", |
| | | title: "ä¾åºåç¼å·", |
| | | type: "string", |
| | | width: 90, |
| | | }, |
| | |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "overOutQuantity", |
| | | title: "æªææ°é", |
| | | type: "string", |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | | width: 90, |
| | | width: 80, |
| | | }, |
| | | { |
| | | prop: "orderDetailStatus", |
| | | title: "订åæç»ç¶æ", |
| | | type: "tag", |
| | | width: 180, |
| | | width: 90, |
| | | bindKey: "orderDetailStatusEnum", |
| | | }, |
| | | { |
| | |
| | | title: "æå®åºå", |
| | | type: "icon", |
| | | width: 90, |
| | | hidden: true, // é»è®¤éè |
| | | icon: "el-icon-s-grid", |
| | | }, |
| | | { |
| | |
| | | order: "desc", |
| | | Foots: "", |
| | | total: 0, |
| | | // 2020.08.29å¢å èªå®ä¹å页æ¡å¤§å° |
| | | sizes: [30, 60, 100, 120], |
| | | size: 30, // é»è®¤åé¡µå¤§å° |
| | | size: 30, |
| | | Wheres: [], |
| | | page: 1, |
| | | rows: 30, |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | toggleAssignStockColumn() { |
| | | const assignStockColumn = this.tableColumns.find( |
| | | (item) => item.prop === "assignStock" |
| | | ); |
| | | if (assignStockColumn) { |
| | | // businessType为22æ¶æ¾ç¤ºï¼å¦åéè |
| | | assignStockColumn.hidden = this.mainBusinessType !=='22'; |
| | | } |
| | | }, |
| | | open(row) { |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | | console.log("ä¸»åæ®æ°æ®ï¼", this.row); |
| | | this.isBatch = row.isBatch; |
| | | this.mainBusinessType = row.businessType; |
| | | this.getDictionaryData(); |
| | | this.getData(); |
| | | this.toggleAssignStockColumn(); |
| | | }, |
| | | getData() { |
| | | var wheres = [{ name: "orderId", value: this.row.id }]; |
| | |
| | | rows: this.paginations.rows, |
| | | sort: this.paginations.sort, |
| | | order: this.paginations.order, |
| | | wheres: JSON.stringify(wheres), // æ¥è¯¢æ¡ä»¶ï¼æ ¼å¼ä¸º[{ name: "åæ®µ", value: "xx" }] |
| | | wheres: JSON.stringify(wheres), |
| | | }; |
| | | this.http |
| | | .post("api/OutboundOrderDetail/GetPageData", param, "æ¥è¯¢ä¸") |
| | | .then((x) => { |
| | | this.tableData = x.rows; |
| | | this.toggleAssignStockColumn(); // æ°æ®å è½½åéæ°ç¡®è®¤åæ¾é |
| | | }); |
| | | }, |
| | | tableButtonClick(row, column) { |
| | | if (column.prop == "assignStock") { |
| | | this.$refs.child.open(row); |
| | | } else if (column.prop == "NoStockOut") { |
| | | this.$refs.NoStockOut.open(row); |
| | | } else { |
| | | //ç¹å»æå¼åºåºè¯¦æ
|
| | | this.$refs.selectedStock.open(row); |
| | | } |
| | | }, |
| | |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | var keys = this.selection.map((item) => item.id); // è·åéä¸è¡çid |
| | | var keys = this.selection.map((item) => item.id); |
| | | this.http |
| | | .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | handleOpenPicking() { |
| | | this.$router.push({ |
| | | path: "/outbound/picking", |
| | | query: { orderId: this.row.id, orderNo: this.row.orderNo }, |
| | | }); |
| | | }, |
| | | handleOpenBatchPicking() { |
| | | this.$router.push({ |
| | | path: "/outbound/batchpicking", |
| | | query: { orderId: this.row.id, orderNo: this.row.orderNo }, |
| | | }); |
| | | }, |
| | | outbound() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | var keys = this.selection.map((item) => item.id); // è·åéä¸è¡çid |
| | | const platformOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | ]; |
| | | const mountNode = document.createElement("div"); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | this.http |
| | | .post("api/Task/GenerateOutboundTasks", keys, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | }); |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, |
| | | }); |
| | | |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | | title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | width: "500px", |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | "onUpdate:modelValue": (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: "20px 0", |
| | | borderRadius: "8px", |
| | | }, |
| | | }, |
| | | { |
| | | default: () => |
| | | h( |
| | | ElForm, |
| | | { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | ], |
| | | }, |
| | | ref: "outboundForm", |
| | | labelWidth: "100px", |
| | | style: { |
| | | padding: "0 30px", |
| | | }, |
| | | }, |
| | | [ |
| | | h(ElFormItem, { |
| | | label: "åºåºç«å°", |
| | | prop: "selectedPlatform", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: "è¯·éæ©åºåºç«å°ï¼3-12ï¼", |
| | | modelValue: formData.selectedPlatform, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | }, platformOptions.map((platform) => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )), |
| | | ]), |
| | | h("div", { |
| | | style: { |
| | | textAlign: "right", |
| | | marginTop: "8px", |
| | | paddingRight: "4px", |
| | | }, |
| | | }, [ |
| | | h(ElButton, { |
| | | type: "text", |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info("åæ¶åºåºæä½"); |
| | | }, |
| | | style: { |
| | | marginRight: "8px", |
| | | color: "#606266", |
| | | }, |
| | | }, "åæ¶"), |
| | | h(ElButton, { |
| | | type: "primary", |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | taskIds: keys, |
| | | outboundPlatform: formData.selectedPlatform, |
| | | }; |
| | | |
| | | this.http |
| | | .post( |
| | | "api/Task/GenerateOutboundTasks", |
| | | requestParams, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: "4px", |
| | | padding: "8px 20px", |
| | | }, |
| | | }, "ç¡®å®åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | outboundbatch() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | if (this.selection.length > 1) { |
| | | return this.$message.error("åªè½éæ©ä¸æ¡åæ®æç»è¿è¡åæ¹åºåº"); |
| | | } |
| | | const platformOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | ]; |
| | | const mountNode = document.createElement("div"); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, |
| | | outboundDecimal: "", |
| | | }); |
| | | |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | | title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | width: "500px", |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | "onUpdate:modelValue": (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: "20px 0", |
| | | borderRadius: "8px", |
| | | }, |
| | | }, |
| | | { |
| | | default: () => |
| | | h( |
| | | ElForm, |
| | | { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | ], |
| | | outboundDecimal: [ |
| | | { required: true, message: "请è¾å
¥å°æ°æ°å¼", trigger: "blur" }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | const decimalReg = /^(([1-9]\d*)|0)(\.\d{1,2})?$/; |
| | | if (value && !decimalReg.test(value)) { |
| | | callback(new Error("请è¾å
¥ææçå°æ°ï¼æ£æ°ï¼æå¤2ä½å°æ°ï¼")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | ref: "outboundForm", |
| | | labelWidth: "100px", |
| | | style: { |
| | | padding: "0 30px", |
| | | }, |
| | | }, |
| | | [ |
| | | h(ElFormItem, { |
| | | label: "åºåºç«å°", |
| | | prop: "selectedPlatform", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: "è¯·éæ©åºåºç«å°ï¼3-12ï¼", |
| | | modelValue: formData.selectedPlatform, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | }, platformOptions.map((platform) => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )), |
| | | ]), |
| | | h(ElFormItem, { |
| | | label: "åºåºæ°", |
| | | prop: "outboundDecimal", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElInput, { |
| | | type: "number", |
| | | placeholder: "请è¾å
¥å°æ°æ°å¼ï¼æå¤2ä½å°æ°ï¼", |
| | | modelValue: formData.outboundDecimal, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.outboundDecimal = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | step: "0.01", |
| | | precision: 2, |
| | | min: 0.01, |
| | | }), |
| | | ]), |
| | | h("div", { |
| | | style: { |
| | | textAlign: "right", |
| | | marginTop: "8px", |
| | | paddingRight: "4px", |
| | | }, |
| | | }, [ |
| | | h(ElButton, { |
| | | type: "text", |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info("åæ¶åæ¹åºåºæä½"); |
| | | }, |
| | | style: { |
| | | marginRight: "8px", |
| | | color: "#606266", |
| | | }, |
| | | }, "åæ¶"), |
| | | h(ElButton, { |
| | | type: "primary", |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | orderDetailId: keys[0], |
| | | outboundPlatform: formData.selectedPlatform, |
| | | batchQuantity: formData.outboundDecimal, |
| | | }; |
| | | |
| | | this.http |
| | | .post( |
| | | "api/Task/GenerateOutboundBatchTasks", |
| | | requestParams, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: "4px", |
| | | padding: "8px 20px", |
| | | }, |
| | | }, "ç¡®å®åæ¹åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | setCurrent(row) { |
| | | this.$refs.singleTable.setCurrentRow(row); |
| | |
| | | var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey); |
| | | if (item) { |
| | | var dicItem = item.data.find((x) => x.key == row[column.prop]); |
| | | console.log(dicItem); |
| | | if (dicItem) { |
| | | return dicItem.value; |
| | | } else { |
| | |
| | | return row[column.prop]; |
| | | } |
| | | } |
| | | return row[column.prop]; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .text-button { |
| | | border: 0px; |
| | |
| | | |
| | | .box-table .el-table tbody tr:hover > td { |
| | | background-color: #d8e0d4 !important; |
| | | /* color: #ffffff; */ |
| | | } |
| | | |
| | | .box-table .el-table tbody tr.current-row > td { |
| | | background-color: #f0f9eb !important; |
| | | /* color: #ffffff; */ |
| | | } |
| | | |
| | | .el-table .success-row { |
| | |
| | | .box-table .el-table { |
| | | border: 1px solid #ebeef5; |
| | | } |
| | | </style> |
| | | </style> |