|
|
@@ -7,7 +7,8 @@
|
|
|
>
|
|
|
<div class="search-box">
|
|
|
生产工单号:
|
|
|
- <el-input placeholder="请输入" v-model="orderCode"></el-input>
|
|
|
+ <el-input placeholder="请输入" v-model="orderCode" clearable></el-input>
|
|
|
+ <el-button type="primary" @click="reload">搜索</el-button>
|
|
|
</div>
|
|
|
<!-- 数据表格 -->
|
|
|
<ele-pro-table
|
|
|
@@ -15,8 +16,6 @@
|
|
|
:columns="columns"
|
|
|
@done="handleDone"
|
|
|
row-key="id"
|
|
|
- :needPage="false"
|
|
|
- :initLoad="false"
|
|
|
:selection.sync="selectionList"
|
|
|
:datasource="datasource"
|
|
|
height="45vh"
|
|
|
@@ -44,19 +43,13 @@
|
|
|
computed: {
|
|
|
columns () {
|
|
|
const list = [
|
|
|
- {
|
|
|
- type: 'selection',
|
|
|
- width: 55,
|
|
|
- align: 'center',
|
|
|
- fixed: 'left',
|
|
|
- reserveSelection: true
|
|
|
- },
|
|
|
{
|
|
|
columnKey: 'index',
|
|
|
label: '序号',
|
|
|
type: 'index',
|
|
|
width: 55,
|
|
|
align: 'center',
|
|
|
+ fixed: 'left',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
{
|
|
|
@@ -146,14 +139,11 @@
|
|
|
minWidth: 110
|
|
|
},
|
|
|
{
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 350,
|
|
|
+ type: 'selection',
|
|
|
+ width: 55,
|
|
|
align: 'center',
|
|
|
- resizable: false,
|
|
|
fixed: 'right',
|
|
|
- slot: 'action',
|
|
|
- showOverflowTooltip: true
|
|
|
+ reserveSelection: true
|
|
|
}
|
|
|
];
|
|
|
|
|
|
@@ -166,27 +156,34 @@
|
|
|
this.visible = true;
|
|
|
},
|
|
|
handleDone ({ data }) {
|
|
|
- if (this.memoList.length) {
|
|
|
+ if (this.memoList.length && data.length) {
|
|
|
this.$nextTick(() => {
|
|
|
- this.memoList.length &&
|
|
|
- this.$refs.table.setSelectedRowKeys(
|
|
|
- this.memoList.map((i) => i.id)
|
|
|
- );
|
|
|
+ this.$refs.table.setSelectedRowKeys(this.memoList.map((i) => i.id));
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ reload () {
|
|
|
+ this.$refs.table.reload();
|
|
|
+ },
|
|
|
/* 表格数据源 */
|
|
|
datasource ({ page, limit }) {
|
|
|
return getPage({
|
|
|
pageNum: page,
|
|
|
size: limit,
|
|
|
- code: this.orderCode
|
|
|
+ code: this.orderCode,
|
|
|
+ statusList: [5, 4, 7]
|
|
|
});
|
|
|
},
|
|
|
confirm () {
|
|
|
if (!this.selectionList?.length)
|
|
|
return this.$message.error('请选择数据');
|
|
|
- this.$emit('success', this.selectionList);
|
|
|
+
|
|
|
+ this.$emit('success', [
|
|
|
+ ...this.selectionList,
|
|
|
+ ...this.memoList.filter(
|
|
|
+ (item) => !this.selectionList.find((p) => p.id === item.id)
|
|
|
+ )
|
|
|
+ ]);
|
|
|
|
|
|
this.cancel();
|
|
|
},
|