|
|
@@ -41,6 +41,11 @@
|
|
|
stripe
|
|
|
:header-cell-style="{ background: '#EEEEEE', border: 'none' }"
|
|
|
>
|
|
|
+ <el-table-column label="二维码" prop="qrcode" min-width="100" align="center">
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <el-link type="primary" @click="generateQrcode(row)">二维码</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="库区编号" prop="code" min-width="120">
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
<el-form-item
|
|
|
@@ -327,6 +332,11 @@
|
|
|
stripe
|
|
|
:header-cell-style="{ background: '#EEEEEE', border: 'none' }"
|
|
|
>
|
|
|
+ <el-table-column label="二维码" prop="qrcode" min-width="100" align="center">
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <el-link type="primary" @click="generateQrcode(row)">二维码</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
label="库区编号"
|
|
|
prop="reservoirAreaCode"
|
|
|
@@ -738,13 +748,15 @@
|
|
|
<el-button @click="handleMine" type="primary">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <!-- 二维码 -->
|
|
|
+ <qsCode ref="qsCodeRef"></qsCode>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
// import selectTree from '@/components/selectTree';
|
|
|
import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
|
|
|
-
|
|
|
+ import qsCode from './components/qsCode.vue'
|
|
|
import {
|
|
|
warehouseDefinition_areaType,
|
|
|
warehouseDefinition_areaAttribute,
|
|
|
@@ -755,6 +767,9 @@
|
|
|
|
|
|
// import { throttle } from 'lodash';
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ qsCode
|
|
|
+ },
|
|
|
// components: { selectTree },
|
|
|
filters: {
|
|
|
filterAreaType: useDictLabelFilter
|
|
|
@@ -1262,48 +1277,92 @@
|
|
|
},
|
|
|
generateAllocation(num, obj) {
|
|
|
console.log(obj);
|
|
|
- const pre =
|
|
|
- this.areaForm.allocationReqList[
|
|
|
- this.areaForm.allocationReqList.length - 1
|
|
|
- ];
|
|
|
-
|
|
|
- for (var i = 0; i < num; i++) {
|
|
|
- this.areaForm.allocationReqList.push({
|
|
|
- warehouseAreaCode: obj.reservoirAreaCode,
|
|
|
- warehouseAreaGoodsCode: obj.code,
|
|
|
- goodsAllocationCode: obj.code + '-' + (i + 1),
|
|
|
- // allocationBarcode: '',
|
|
|
- code: obj.code + '-' + (i + 1),
|
|
|
+ const rows = Number(obj.extInfo[0].line); // 行数
|
|
|
+ const cols = Number(obj.extInfo[0].column); // 列数
|
|
|
+
|
|
|
+ // 按行优先遍历:行从1到rows,列从1到cols
|
|
|
+ for (let row = 1; row <= rows; row++) {
|
|
|
+ for (let col = 1; col <= cols; col++) {
|
|
|
+ // 货位编号规则:货架编号-行号-列号
|
|
|
+ const allocationCode = `${obj.code}-${row}-${col}`;
|
|
|
+
|
|
|
+ this.areaForm.allocationReqList.push({
|
|
|
+ warehouseAreaCode: obj.reservoirAreaCode,
|
|
|
+ warehouseAreaGoodsCode: obj.code,
|
|
|
+ goodsAllocationCode: allocationCode,
|
|
|
+ // allocationBarcode: '',
|
|
|
+ code: allocationCode,
|
|
|
|
|
|
- extInfo: [
|
|
|
- {
|
|
|
- goodsAllocationWide: Number(obj.extInfo[0].areaWidth),
|
|
|
- goodsAllocationHigh: Number(
|
|
|
- obj.extInfo[0].areaHigh / Number(obj.extInfo[0].line)
|
|
|
- ).toFixed(0),
|
|
|
- goodsAllocationLength: Number(
|
|
|
- obj.extInfo[0].areaLength / Number(obj.extInfo[0].column)
|
|
|
- ).toFixed(0),
|
|
|
- weightLimit: '',
|
|
|
- volumeUnit:
|
|
|
- Number(
|
|
|
- obj.extInfo[0].areaLength / Number(obj.extInfo[0].column)
|
|
|
- ).toFixed(0) *
|
|
|
- Number(
|
|
|
- obj.extInfo[0].areaHigh / Number(obj.extInfo[0].line)
|
|
|
- ).toFixed(0) *
|
|
|
- Number(obj.extInfo[0].areaWidth)
|
|
|
- }
|
|
|
- ],
|
|
|
- goodsShelvesCode: obj.code,
|
|
|
- reservoirAreaCode: obj.reservoirAreaCode,
|
|
|
- warehouseId: this.formData.id, //?
|
|
|
+ extInfo: [
|
|
|
+ {
|
|
|
+ goodsAllocationWide: Number(obj.extInfo[0].areaWidth),
|
|
|
+ goodsAllocationHigh: Number(
|
|
|
+ obj.extInfo[0].areaHigh / rows
|
|
|
+ ).toFixed(0),
|
|
|
+ goodsAllocationLength: Number(
|
|
|
+ obj.extInfo[0].areaLength / cols
|
|
|
+ ).toFixed(0),
|
|
|
+ weightLimit: '',
|
|
|
+ volumeUnit:
|
|
|
+ Number(obj.extInfo[0].areaLength / cols).toFixed(0) *
|
|
|
+ Number(obj.extInfo[0].areaHigh / rows).toFixed(0) *
|
|
|
+ Number(obj.extInfo[0].areaWidth)
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ goodsShelvesCode: obj.code,
|
|
|
+ reservoirAreaCode: obj.reservoirAreaCode,
|
|
|
+ warehouseId: this.formData.id,
|
|
|
|
|
|
- type: 3,
|
|
|
- isEdit: true
|
|
|
- });
|
|
|
+ type: 3,
|
|
|
+ isEdit: true
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ // generateAllocation(num, obj) {
|
|
|
+ // console.log(obj);
|
|
|
+ // const pre =
|
|
|
+ // this.areaForm.allocationReqList[
|
|
|
+ // this.areaForm.allocationReqList.length - 1
|
|
|
+ // ];
|
|
|
+
|
|
|
+ // for (var i = 0; i < num; i++) {
|
|
|
+ // this.areaForm.allocationReqList.push({
|
|
|
+ // warehouseAreaCode: obj.reservoirAreaCode,
|
|
|
+ // warehouseAreaGoodsCode: obj.code,
|
|
|
+ // goodsAllocationCode: obj.code + '-' + (i + 1),
|
|
|
+ // // allocationBarcode: '',
|
|
|
+ // code: obj.code + '-' + (i + 1),
|
|
|
+
|
|
|
+ // extInfo: [
|
|
|
+ // {
|
|
|
+ // goodsAllocationWide: Number(obj.extInfo[0].areaWidth),
|
|
|
+ // goodsAllocationHigh: Number(
|
|
|
+ // obj.extInfo[0].areaHigh / Number(obj.extInfo[0].line)
|
|
|
+ // ).toFixed(0),
|
|
|
+ // goodsAllocationLength: Number(
|
|
|
+ // obj.extInfo[0].areaLength / Number(obj.extInfo[0].column)
|
|
|
+ // ).toFixed(0),
|
|
|
+ // weightLimit: '',
|
|
|
+ // volumeUnit:
|
|
|
+ // Number(
|
|
|
+ // obj.extInfo[0].areaLength / Number(obj.extInfo[0].column)
|
|
|
+ // ).toFixed(0) *
|
|
|
+ // Number(
|
|
|
+ // obj.extInfo[0].areaHigh / Number(obj.extInfo[0].line)
|
|
|
+ // ).toFixed(0) *
|
|
|
+ // Number(obj.extInfo[0].areaWidth)
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
+ // goodsShelvesCode: obj.code,
|
|
|
+ // reservoirAreaCode: obj.reservoirAreaCode,
|
|
|
+ // warehouseId: this.formData.id, //?
|
|
|
+
|
|
|
+ // type: 3,
|
|
|
+ // isEdit: true
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // },
|
|
|
saveArea(index) {
|
|
|
this.hjForm = { code: '', type: 1 };
|
|
|
if (
|
|
|
@@ -1812,6 +1871,20 @@
|
|
|
newArr.push({ ...arr[key].extInfo[0], ...arr[key] });
|
|
|
}
|
|
|
return newArr;
|
|
|
+ },
|
|
|
+ generateQrcode(row) {
|
|
|
+ console.log(row);
|
|
|
+ if(row.isEdit){
|
|
|
+ this.$message.warning('请先保存库区');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const codes = this.areaForm.areaGoodsshelvesList
|
|
|
+ .filter((item) => item.reservoirAreaCode === row.code)
|
|
|
+ .map((i) => i.code)
|
|
|
+ .join(',');
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.qsCodeRef.open(row, codes);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|