|
|
@@ -65,6 +65,19 @@
|
|
|
<span slot="reference"> {{ row.batchNo }}</span>
|
|
|
</el-popover>
|
|
|
</template>
|
|
|
+ <!-- 库存保质期 -->
|
|
|
+ <template v-slot:expirationDate="{ row }">
|
|
|
+ <span v-if="row.expirationDate">
|
|
|
+ {{ row.expirationDate ? row.expirationDate : '-' }}
|
|
|
+ {{
|
|
|
+ row.expirationDateUnit == 'year'
|
|
|
+ ? '年'
|
|
|
+ : row.expirationDateUnit == 'month'
|
|
|
+ ? '月'
|
|
|
+ : '日'
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
<el-link
|
|
|
@@ -115,6 +128,7 @@
|
|
|
},
|
|
|
isShow: false,
|
|
|
isPack: false,
|
|
|
+ isMeta: false,
|
|
|
selectedDime: 1
|
|
|
};
|
|
|
},
|
|
|
@@ -184,25 +198,26 @@
|
|
|
// showOverflowTooltip: true
|
|
|
// },
|
|
|
{
|
|
|
- prop: '',
|
|
|
+ prop: 'expirationDate',
|
|
|
+ slot: 'expirationDate',
|
|
|
label: '库存保质期',
|
|
|
showOverflowTooltip: true,
|
|
|
width: 100
|
|
|
},
|
|
|
{
|
|
|
- prop: '',
|
|
|
+ prop: 'expirationTime',
|
|
|
label: '周期倒计时',
|
|
|
showOverflowTooltip: true,
|
|
|
width: 100
|
|
|
},
|
|
|
{
|
|
|
- prop: '',
|
|
|
+ prop: 'qualityStatus',
|
|
|
label: '质检状态',
|
|
|
showOverflowTooltip: true,
|
|
|
width: 100
|
|
|
},
|
|
|
{
|
|
|
- prop: '',
|
|
|
+ prop: 'qualityResult',
|
|
|
label: '质检结果',
|
|
|
showOverflowTooltip: true,
|
|
|
width: 100
|
|
|
@@ -251,6 +266,36 @@
|
|
|
label: '批次号',
|
|
|
showOverflowTooltip: true
|
|
|
});
|
|
|
+ // 寻找现有的 'code' 对象的索引
|
|
|
+ let codeIndex = obj.findIndex((item) => item.prop === 'code');
|
|
|
+
|
|
|
+ if (codeIndex !== -1) {
|
|
|
+ // 删除现有的 'code' 对象
|
|
|
+ obj.splice(codeIndex, 1, {
|
|
|
+ prop: 'packagingCode',
|
|
|
+ label: '包装编码',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.isMeta) {
|
|
|
+ obj.splice(1, 0, {
|
|
|
+ slot: 'batchNum',
|
|
|
+ prop: 'batchNum',
|
|
|
+ label: '批次号',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ });
|
|
|
+ // 寻找现有的 'code' 对象的索引
|
|
|
+ let codeIndex = obj.findIndex((item) => item.prop === 'code');
|
|
|
+
|
|
|
+ if (codeIndex !== -1) {
|
|
|
+ // 删除现有的 'code' 对象
|
|
|
+ obj.splice(codeIndex, 1, {
|
|
|
+ prop: 'materialCode',
|
|
|
+ label: '物料编码',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
return obj;
|
|
|
}
|
|
|
@@ -259,6 +304,7 @@
|
|
|
handledime(val) {
|
|
|
this.$set(this, 'isShow', val == 2);
|
|
|
this.$set(this, 'isPack', val == 3);
|
|
|
+ this.$set(this, 'isMeta', val == 4);
|
|
|
// this.reload({
|
|
|
// ...this.$refs.refSeavch.params,
|
|
|
// dimension: this.$refs.refSeavch.dimension
|
|
|
@@ -307,13 +353,13 @@
|
|
|
size: limit,
|
|
|
dimension: dimension
|
|
|
});
|
|
|
- return data;
|
|
|
- // data.then((res) => {
|
|
|
- // let item = res.list.map((item) => {
|
|
|
- // return { ...item, paths: item.pathName.split(',')[0] };
|
|
|
- // });
|
|
|
- // return item;
|
|
|
- // });
|
|
|
+ const result = data.then((res) => {
|
|
|
+ let item = res.list.map((item) => {
|
|
|
+ return { ...item, paths: item.pathName.split(',')[0] };
|
|
|
+ });
|
|
|
+ return { ...res, list: item };
|
|
|
+ });
|
|
|
+ return result;
|
|
|
} else if (this.selectedDime == 2) {
|
|
|
const params = {
|
|
|
categoryLevelId: treeId,
|
|
|
@@ -323,17 +369,20 @@
|
|
|
};
|
|
|
const data = getBatchDetails({
|
|
|
...params,
|
|
|
- page: page,
|
|
|
+ pageNum: page,
|
|
|
size: limit
|
|
|
});
|
|
|
|
|
|
- return data;
|
|
|
- // data.then((res) => {
|
|
|
- // let item = res.list.map((item) => {
|
|
|
- // return { ...item, minUnit: item.packingUnit };
|
|
|
- // });
|
|
|
- // return item;
|
|
|
- // });
|
|
|
+ const result = data.then((res) => {
|
|
|
+ let item = res.list.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ minUnit: item.packingUnit
|
|
|
+ };
|
|
|
+ });
|
|
|
+ return { ...res, list: item };
|
|
|
+ });
|
|
|
+ return result;
|
|
|
} else {
|
|
|
const params = {
|
|
|
categoryLevelId: treeId,
|
|
|
@@ -343,21 +392,22 @@
|
|
|
};
|
|
|
const data = ouint.getInventoryDetails({
|
|
|
...params,
|
|
|
- page: page,
|
|
|
+ pageNum: page,
|
|
|
size: limit
|
|
|
});
|
|
|
- return data;
|
|
|
- // return data.then((res) => {
|
|
|
- // let item = res.list.map((item) => {
|
|
|
- // return {
|
|
|
- // ...item,
|
|
|
- // minUnit: item.packingUnit,
|
|
|
- // paths: item.pathName.split(',')[0]
|
|
|
- // };
|
|
|
- // });
|
|
|
- // console.log('item', item);
|
|
|
- // return item;
|
|
|
- // });
|
|
|
+ const result = data.then((res) => {
|
|
|
+ const data = res.list.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ minUnit: item.packingUnit,
|
|
|
+ paths: item.pathName.split(',')[0],
|
|
|
+ availableCountBase: 1,
|
|
|
+ packagingCode: item.code
|
|
|
+ };
|
|
|
+ });
|
|
|
+ return { ...res, list: data };
|
|
|
+ });
|
|
|
+ return result;
|
|
|
}
|
|
|
},
|
|
|
/* 刷新表格 */
|