|
|
@@ -7,7 +7,7 @@
|
|
|
height="calc(100vh - 435px)"
|
|
|
full-height="calc(100vh - 156px)"
|
|
|
tool-class="ele-toolbar-form"
|
|
|
- cache-key="inspectionClassify"
|
|
|
+ cache-key="newInspectionProjectList"
|
|
|
row-key="id"
|
|
|
>
|
|
|
<!-- 表头工具栏 -->
|
|
|
@@ -51,14 +51,13 @@
|
|
|
v-for="(item, idx) in row.toolList"
|
|
|
:key="idx"
|
|
|
>{{ item.name }}
|
|
|
- <span
|
|
|
- v-if="row.toolList && idx != row.toolList.length - 1"
|
|
|
+ <span v-if="row.toolList && idx != row.toolList.length - 1"
|
|
|
>,
|
|
|
</span></div
|
|
|
>
|
|
|
</template>
|
|
|
|
|
|
- <template v-slot:action="{ row }">
|
|
|
+ <template v-slot:action="{ row, $index }">
|
|
|
<el-popconfirm
|
|
|
class="ele-action"
|
|
|
title="确定要删除此质检项吗?"
|
|
|
@@ -92,8 +91,13 @@
|
|
|
watch: {
|
|
|
inspectList: {
|
|
|
handler(list) {
|
|
|
-
|
|
|
- this.$refs.table.setData([...list]);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (list.length > 0) {
|
|
|
+ this.$refs.table.setData([...list]);
|
|
|
+ } else {
|
|
|
+ this.$refs.table.setData([]);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
immediate: true,
|
|
|
deep: true
|
|
|
@@ -148,9 +152,7 @@
|
|
|
label: '工艺要求',
|
|
|
prop: 'inspectionStandard',
|
|
|
formatter: (row, column, cellValue) => {
|
|
|
- return (
|
|
|
- row.symbol + ' ' + cellValue + ' ' + row.unit
|
|
|
- );
|
|
|
+ return row.symbol + ' ' + cellValue + ' ' + row.unit;
|
|
|
},
|
|
|
minWidth: 150
|
|
|
},
|
|
|
@@ -201,6 +203,12 @@
|
|
|
datasource() {
|
|
|
return [];
|
|
|
},
|
|
|
+
|
|
|
+ remove(index) {
|
|
|
+ let _list = this.$refs.table.getData() || [];
|
|
|
+ _list.splice(index, 1);
|
|
|
+ this.$refs.table.setData([..._list]);
|
|
|
+ },
|
|
|
openAdd() {
|
|
|
this.$emit('openAdd');
|
|
|
}
|