| | |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="80%" |
| | | width="78%" |
| | | :padding="15" |
| | | title="æå®åºå" |
| | | > |
| | |
| | | >éæ±æ°éï¼ {{ row.qtyPcs }} |
| | | </span> |
| | | <el-divider direction="vertical"></el-divider> |
| | | <span class="less-style" |
| | | >å·²åé
æ°éï¼ {{ row.lockQtyPcs }} |
| | | <span :class="selectionClass" |
| | | >已鿰éï¼ {{ selectionSum }} |
| | | </span> |
| | | </el-col> |
| | | <el-col> |
| | |
| | | align="center" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in tableColumns" |
| | | v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" |
| | | :key="index" |
| | | :prop="item.prop" |
| | | :label="item.title" |
| | | :width="item.width" |
| | | align="center" |
| | | > |
| | | <template #default="scoped" v-if="item.type == 'icon'"> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="item.title" |
| | | placement="bottom" |
| | | ><el-button |
| | | type="text" |
| | | @click="tableButtonClick(scoped.row, item)" |
| | | ><i :class="item.icon" style="font-size: 22px"></i></el-button |
| | | ></el-tooltip> |
| | | <template #default="scoped"> |
| | | <div v-if="item.type == 'icon'"> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="item.title" |
| | | placement="bottom" |
| | | ><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> |
| | | </div> |
| | | |
| | | <div v-else-if="item.type == 'tag'"> |
| | | <el-tag size="small"> |
| | | {{ getDictionary(scoped.row, item) }} |
| | | </el-tag> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import { fa } from "element-plus/es/locales.mjs"; |
| | | import { el } from 'element-plus/es/locale'; |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | |
| | | tableData: [], |
| | | tableColumns: [ |
| | | { |
| | | field: "proStockId", |
| | | prop: "proStockId", |
| | | title: "åºåä¿¡æ¯ä¸»é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left" |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "productCode", |
| | | prop: "proStockAttribute", |
| | | title: "åºå屿§", |
| | | type: "tag", |
| | | width: 110, |
| | | bindKey: "proStockAttributeEnum", |
| | | }, |
| | | { |
| | | prop: "locationCode", |
| | | title: "ä»å¨ä½ç½®", |
| | | type: "string", |
| | | width: 130, |
| | | }, |
| | | { |
| | | prop: "palletCode", |
| | | title: "å¤å
å·", |
| | | type: "string", |
| | | width: 130, |
| | | }, |
| | | { |
| | | prop: "productCode", |
| | | title: "产åç¼ç ", |
| | | type: "string", |
| | | width: 140, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productVersion", |
| | | prop: "productVersion", |
| | | title: "产åçæ¬", |
| | | type: "string", |
| | | width: 80, |
| | | align: "left", |
| | | width: 100, |
| | | }, |
| | | { |
| | | field: "dateCode", |
| | | prop: "dateCode", |
| | | title: "卿", |
| | | type: "string", |
| | | width: 80, |
| | | align: "left", |
| | | width: 120, |
| | | }, |
| | | { |
| | | field: "saleOrder", |
| | | prop: "erpOrder", |
| | | title: "ERPå·¥å", |
| | | type: "string", |
| | | width: 200, |
| | | }, |
| | | { |
| | | prop: "moNumber", |
| | | title: "å¶é å", |
| | | type: "string", |
| | | width: 140, |
| | | }, |
| | | { |
| | | prop: "saleOrder", |
| | | title: "éå®è®¢å", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "sumStocks", |
| | | prop: "sumStocks", |
| | | title: "åºåPCSæ°", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | width: 120, |
| | | }, |
| | | { |
| | | prop: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "string", |
| | | width: 160, |
| | | }, |
| | | // { |
| | | // field: "lotNumber", |
| | |
| | | // }, |
| | | ], |
| | | selection: [], |
| | | isTrue: false, |
| | | selectionSum: 0, |
| | | selectionClass: "less-style", |
| | | originalQuantity: 0, |
| | |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | | this.originalQuantity = this.row.lockQuantity; |
| | | this.selectionSum = this.row.lockQuantity; |
| | | this.selectionSum = this.row.lockQtyPcs; |
| | | this.getData(); |
| | | this.getDictionaryData(); |
| | | if (this.selectionSum == this.row.orderQuantity) { |
| | | this.selectionClass = "equle-style"; |
| | | } else if (this.selectionSum < this.row.orderQuantity) { |
| | |
| | | if (this.selection.length <= 0) { |
| | | return this.$message.error("请å¾é"); |
| | | } |
| | | let url = this.pkcx |
| | | ? "api/Task/GeneratePKOutboundTask?orderDetailId=" |
| | | : "api/Task/GenerateOutboundTask?orderDetailId="; |
| | | let url ="api/Task/OutProductSelect?orderDetailId="; |
| | | this.http |
| | | .post(url + this.row.id, this.selection, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | this.$parent.refresh(); |
| | | }); |
| | | }, |
| | | getData(a) { |
| | |
| | | }); |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.selection = val; |
| | | this.selectionSum = |
| | | val.reduce( |
| | | (accumulator, currentValue) => |
| | | accumulator + currentValue["useableQuantity"], |
| | | 0 |
| | | ) + this.originalQuantity; |
| | | if (this.selectionSum == this.row.orderQuantity) { |
| | | this.selectionClass = "equle-style"; |
| | | } else if (this.selectionSum < this.row.orderQuantity) { |
| | | this.selectionClass = "less-style"; |
| | | } else { |
| | | this.selectionClass = "more-style"; |
| | | } |
| | | this.selection=val; |
| | | this.CheckSelection(val); |
| | | //夿å¾éä¸çsumStocksæ°é妿å½åå¾éæ°å¤§äºrow.qtyPcsååæ¶å¾é |
| | | // if (this.selection.length<=0) { |
| | | // this.selection = val; |
| | | // this.selectionSum = val[0].sumStocks; |
| | | // }else{ |
| | | // if (this.selectionSum + val[0].sumStocks > this.row.qtyPcs) { |
| | | // this.$message.error("å¾éæ°éå·²æ»¡è¶³éæ±æ°é,æ éåå¾é"); |
| | | // }else { |
| | | // this.selection = val; |
| | | // this.selectionSum += val[0].sumStocks; |
| | | // } |
| | | // }1 |
| | | }, |
| | | CheckSelection(rows) { |
| | | if (rows.length <= 0) { |
| | | this.selectionSum = this.row.lockQtyPcs; |
| | | } else { |
| | | if (this.selectionSum >= this.row.qtyPcs) { |
| | | this.$message.error("å·²æ»¡è¶³éæ±æ°é,æ éåå¾é"); |
| | | //ç§»é¤this.selection䏿åä¸ä¸ª |
| | | this.$refs.singleTable.toggleRowSelection(this.selection[this.selection.length - 1],false); |
| | | this.selection.splice(-1, 1); |
| | | this.selectionSum = this.selection.reduce((sum, item) => { |
| | | return sum + item.sumStocks; |
| | | }, 0)+this.row.lockQtyPcs; |
| | | }else { |
| | | this.selectionSum=0; |
| | | rows.forEach(row => { |
| | | this.selectionSum+= row.sumStocks; |
| | | }); |
| | | this.selectionSum+=this.row.lockQtyPcs; |
| | | } |
| | | } |
| | | }, |
| | | toggleSelection(rows) { |
| | | if (rows) { |
| | |
| | | }, |
| | | handleRowClick(row) { |
| | | this.$refs.singleTable.toggleRowSelection(row); |
| | | }, |
| | | getDictionaryData() { |
| | | if (this.dictionaryList) { |
| | | return; |
| | | } |
| | | var param = []; |
| | | this.tableColumns.forEach((x) => { |
| | | if (x.type == "tag" && x.bindKey != "") { |
| | | param.push(x.bindKey); |
| | | } |
| | | }); |
| | | this.http |
| | | .post("api/Sys_Dictionary/GetVueDictionary", param, "æ¥è¯¢ä¸") |
| | | .then((x) => { |
| | | if (x.length > 0) { |
| | | this.dictionaryList = x; |
| | | console.log(this.dictionaryList); |
| | | } |
| | | }); |
| | | }, |
| | | getDictionary(row, column) { |
| | | if (this.dictionaryList) { |
| | | 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]; |
| | | } |
| | | } else { |
| | | return row[column.prop]; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | .box-head .el-alert__content { |
| | | width: 100%; |
| | | } |
| | | .el-table__header .el-checkbox { |
| | | display: none; |
| | | } |
| | | </style> |