|
@@ -8,6 +8,7 @@
|
|
|
:datasource="form.datasource"
|
|
:datasource="form.datasource"
|
|
|
class="time-form"
|
|
class="time-form"
|
|
|
@columns-change="handleColumnChange"
|
|
@columns-change="handleColumnChange"
|
|
|
|
|
+ @header-dragend="handleHeaderDragend"
|
|
|
:cache-key="cacheKeyUrl"
|
|
:cache-key="cacheKeyUrl"
|
|
|
height="350"
|
|
height="350"
|
|
|
full-height="calc(100vh - 76px)"
|
|
full-height="calc(100vh - 76px)"
|
|
@@ -93,8 +94,8 @@
|
|
|
@change="batchNoChange(scope.$index, scope.row)"
|
|
@change="batchNoChange(scope.$index, scope.row)"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="item in scope.row.batchNoList || []"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
|
|
+ v-for="(item, optIndex) in scope.row.batchNoList || []"
|
|
|
|
|
+ :key="`${item.id}_${optIndex}`"
|
|
|
:label="item.batchNo"
|
|
:label="item.batchNo"
|
|
|
:value="item.id"
|
|
:value="item.id"
|
|
|
>
|
|
>
|
|
@@ -112,27 +113,6 @@
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
:prop="'datasource.' + scope.$index + '.blockCount'"
|
|
:prop="'datasource.' + scope.$index + '.blockCount'"
|
|
|
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
|
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
|
|
- <ele-pro-table
|
|
|
|
|
- ref="table"
|
|
|
|
|
- :needPage="false"
|
|
|
|
|
- :columns="columns"
|
|
|
|
|
- :datasource="form.datasource"
|
|
|
|
|
- class="time-form"
|
|
|
|
|
- :selection.sync="selection"
|
|
|
|
|
- @columns-change="handleColumnChange"
|
|
|
|
|
- @header-dragend="handleHeaderDragend"
|
|
|
|
|
- :cache-key="cacheKeyUrl"
|
|
|
|
|
- >
|
|
|
|
|
- <!-- 表头工具栏 -->
|
|
|
|
|
- <template v-slot:toolbar>
|
|
|
|
|
- <div class="headbox">
|
|
|
|
|
- <el-button
|
|
|
|
|
- v-if="isShowAdd && needProduce != 4"
|
|
|
|
|
- size="small"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- icon="el-icon-plus"
|
|
|
|
|
- class="ele-btn-icon"
|
|
|
|
|
- @click="handlAdd"
|
|
|
|
|
>
|
|
>
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="scope.row.blockCount"
|
|
v-model="scope.row.blockCount"
|
|
@@ -178,42 +158,6 @@
|
|
|
trigger: 'blur'
|
|
trigger: 'blur'
|
|
|
}
|
|
}
|
|
|
]"
|
|
]"
|
|
|
- 新增
|
|
|
|
|
- </el-button>
|
|
|
|
|
- <el-button
|
|
|
|
|
- size="small"
|
|
|
|
|
- type="danger"
|
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
|
- class="ele-btn-icon"
|
|
|
|
|
- :disabled="!selection.length"
|
|
|
|
|
- @click="batchRemove"
|
|
|
|
|
- >
|
|
|
|
|
- 批量删除
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-slot:technicalDrawings="{ row, $index }">
|
|
|
|
|
- <el-form-item :prop="'datasource.' + $index + '.technicalDrawings'">
|
|
|
|
|
- <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-slot:remark="{ row, $index }">
|
|
|
|
|
- <el-form-item :prop="'datasource.' + $index + '.remark'">
|
|
|
|
|
- <el-input
|
|
|
|
|
- clearable
|
|
|
|
|
- v-model="row.remark"
|
|
|
|
|
- type="textarea"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-slot:stockLedger="scope">
|
|
|
|
|
- <el-form-item>
|
|
|
|
|
- <el-popover
|
|
|
|
|
- @hide="() => (selection = [])"
|
|
|
|
|
- placement="right"
|
|
|
|
|
- width="60%"
|
|
|
|
|
- trigger="hover"
|
|
|
|
|
>
|
|
>
|
|
|
<el-select
|
|
<el-select
|
|
|
v-if="needProduce == 4 && orderNoList.length > 1"
|
|
v-if="needProduce == 4 && orderNoList.length > 1"
|
|
@@ -282,8 +226,8 @@
|
|
|
@change="warehouseChange(scope.$index, scope.row, true)"
|
|
@change="warehouseChange(scope.$index, scope.row, true)"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="item in scope.row.warehouseList"
|
|
|
|
|
- :key="item.warehouseId"
|
|
|
|
|
|
|
+ v-for="(item, optIndex) in scope.row.warehouseList"
|
|
|
|
|
+ :key="`${item.warehouseId}_${optIndex}`"
|
|
|
:label="item.warehouseName"
|
|
:label="item.warehouseName"
|
|
|
:value="item.warehouseId"
|
|
:value="item.warehouseId"
|
|
|
>
|
|
>
|
|
@@ -469,31 +413,25 @@
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 操作列 -->
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="scope">
|
|
<template v-slot:action="scope">
|
|
|
- <div>
|
|
|
|
|
- <el-popconfirm
|
|
|
|
|
- class="ele-action"
|
|
|
|
|
- title="确定要删除吗?"
|
|
|
|
|
- @confirm="remove(scope.$index)"
|
|
|
|
|
- >
|
|
|
|
|
- <template v-slot:reference>
|
|
|
|
|
- <el-link
|
|
|
|
|
- type="danger"
|
|
|
|
|
- :underline="false"
|
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
|
- >
|
|
|
|
|
- 删除
|
|
|
|
|
- </el-link>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-popconfirm>
|
|
|
|
|
- <el-link
|
|
|
|
|
- type="primary"
|
|
|
|
|
- :underline="false"
|
|
|
|
|
- icon="el-icon-edit"
|
|
|
|
|
- @click="selectStockLedgerDialogOpen(scope.row)"
|
|
|
|
|
- >
|
|
|
|
|
- 替代料
|
|
|
|
|
- </el-link>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <el-popconfirm
|
|
|
|
|
+ class="ele-action"
|
|
|
|
|
+ title="确定要删除吗?"
|
|
|
|
|
+ @confirm="remove(scope.$index)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template v-slot:reference>
|
|
|
|
|
+ <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-link>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-popconfirm>
|
|
|
|
|
+ <el-link
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :underline="false"
|
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
|
+ @click="selectStockLedgerDialogOpen(scope.row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 替代料
|
|
|
|
|
+ </el-link>
|
|
|
</template>
|
|
</template>
|
|
|
</ele-pro-table>
|
|
</ele-pro-table>
|
|
|
</div>
|
|
</div>
|
|
@@ -610,7 +548,6 @@
|
|
|
};
|
|
};
|
|
|
return {
|
|
return {
|
|
|
cacheKeyUrl: 'eos-saleManage-invoice-inventoryTable-2026082501',
|
|
cacheKeyUrl: 'eos-saleManage-invoice-inventoryTable-2026082501',
|
|
|
- widthsVersion: 0,
|
|
|
|
|
current: {},
|
|
current: {},
|
|
|
childrenColumns: [
|
|
childrenColumns: [
|
|
|
{
|
|
{
|
|
@@ -694,25 +631,9 @@
|
|
|
},
|
|
},
|
|
|
columns() {
|
|
columns() {
|
|
|
let columnsVersion = this.columnsVersion;
|
|
let columnsVersion = this.columnsVersion;
|
|
|
- // 强制重新计算(每次进入时读取缓存宽度)
|
|
|
|
|
- this.widthsVersion;
|
|
|
|
|
- const cacheWidths = this.getStorage(this.cacheKeyUrl + 'Widths') || {};
|
|
|
|
|
- const applyWidth = (col) => {
|
|
|
|
|
- if (col.prop && cacheWidths[col.prop]) {
|
|
|
|
|
- return { ...col, width: cacheWidths[col.prop], minWidth: undefined };
|
|
|
|
|
- }
|
|
|
|
|
- return col;
|
|
|
|
|
- };
|
|
|
|
|
return [
|
|
return [
|
|
|
{
|
|
{
|
|
|
width: 60,
|
|
width: 60,
|
|
|
- type: 'selection',
|
|
|
|
|
- columnKey: 'selection',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- fixed: 'left'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- width: 45,
|
|
|
|
|
type: 'index',
|
|
type: 'index',
|
|
|
columnKey: 'index',
|
|
columnKey: 'index',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
@@ -1144,7 +1065,7 @@
|
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
|
showOverflowTooltip: true
|
|
showOverflowTooltip: true
|
|
|
}
|
|
}
|
|
|
- ].map(applyWidth);
|
|
|
|
|
|
|
+ ];
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -1870,27 +1791,6 @@
|
|
|
this.setSort();
|
|
this.setSort();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- batchRemove() {
|
|
|
|
|
- if (!this.selection.length) return;
|
|
|
|
|
- this.$confirm('确定要批量删除选中的物品吗?', '提示', {
|
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- const ids = this.selection.map(item => item.tempId ?? item.id);
|
|
|
|
|
- this.form.datasource = this.form.datasource.filter(
|
|
|
|
|
- item => !ids.includes(item.tempId ?? item.id)
|
|
|
|
|
- );
|
|
|
|
|
- this.selection = [];
|
|
|
|
|
- this.setSort();
|
|
|
|
|
- this.$refs.table.reload();
|
|
|
|
|
- this.$message.success('删除成功');
|
|
|
|
|
- }).catch(() => {});
|
|
|
|
|
- },
|
|
|
|
|
- // 清空表格
|
|
|
|
|
- restTable() {
|
|
|
|
|
- this.form.datasource = [];
|
|
|
|
|
- },
|
|
|
|
|
// 重新排序
|
|
// 重新排序
|
|
|
setSort() {
|
|
setSort() {
|
|
|
this.form.datasource.forEach((n, index) => {
|
|
this.form.datasource.forEach((n, index) => {
|
|
@@ -1947,13 +1847,6 @@
|
|
|
|
|
|
|
|
callback(valid);
|
|
callback(valid);
|
|
|
});
|
|
});
|
|
|
- },
|
|
|
|
|
- // 列头拖拽结束 - 保存列宽到本地缓存
|
|
|
|
|
- handleHeaderDragend(newWidth, oldWidth, column) {
|
|
|
|
|
- if (!column.property) return;
|
|
|
|
|
- const widths = this.getStorage(this.cacheKeyUrl + 'Widths') || {};
|
|
|
|
|
- widths[column.property] = newWidth;
|
|
|
|
|
- this.setStorage(this.cacheKeyUrl + 'Widths', widths);
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|