|
@@ -336,6 +336,7 @@
|
|
|
icon="el-icon-plus"
|
|
icon="el-icon-plus"
|
|
|
class="ele-btn-icon"
|
|
class="ele-btn-icon"
|
|
|
@click="bindSubstanceListOpen"
|
|
@click="bindSubstanceListOpen"
|
|
|
|
|
+ v-if="this.formData.reportWorkType==5"
|
|
|
>
|
|
>
|
|
|
添加物联参数
|
|
添加物联参数
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -564,13 +565,9 @@
|
|
|
}}</span>
|
|
}}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:toolName="{ row, $index }">
|
|
<template v-slot:toolName="{ row, $index }">
|
|
|
- <el-link
|
|
|
|
|
- :underline="false"
|
|
|
|
|
- style="cursor: pointer"
|
|
|
|
|
- v-if="formData.reportWorkType != 5"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-link :underline="false" style="cursor: pointer">
|
|
|
<div class="ele-cell">
|
|
<div class="ele-cell">
|
|
|
- <div @click="handleAdd(row)">
|
|
|
|
|
|
|
+ <div @click="handleAdd(row, '', 'toolName')">
|
|
|
{{
|
|
{{
|
|
|
row.tools && row.tools.length > 0
|
|
row.tools && row.tools.length > 0
|
|
|
? row.tools.map((i) => i.toolName).join(',')
|
|
? row.tools.map((i) => i.toolName).join(',')
|
|
@@ -580,32 +577,37 @@
|
|
|
<i
|
|
<i
|
|
|
v-if="row.tools.length == 0"
|
|
v-if="row.tools.length == 0"
|
|
|
class="el-icon-arrow-down"
|
|
class="el-icon-arrow-down"
|
|
|
- @click="handleAdd(row)"
|
|
|
|
|
|
|
+ @click="handleAdd(row, '', 'toolName')"
|
|
|
|
|
+ ></i>
|
|
|
|
|
+ <i
|
|
|
|
|
+ v-else
|
|
|
|
|
+ class="el-icon-close"
|
|
|
|
|
+ @click="clearTool(row, '', 'toolName')"
|
|
|
></i>
|
|
></i>
|
|
|
- <i v-else class="el-icon-close" @click="clearTool(row)"></i>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</el-link>
|
|
</el-link>
|
|
|
- <el-link :underline="false" style="cursor: pointer" v-else>
|
|
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:substanceName="{ row, $index }">
|
|
|
|
|
+ <el-link :underline="false" style="cursor: pointer">
|
|
|
<div class="ele-cell">
|
|
<div class="ele-cell">
|
|
|
- <div @click="handleAdd(row, $index)">
|
|
|
|
|
|
|
+ <div @click="handleAdd(row, $index, 'substanceName')">
|
|
|
{{ row.substanceName || '请选择' }}
|
|
{{ row.substanceName || '请选择' }}
|
|
|
</div>
|
|
</div>
|
|
|
<i
|
|
<i
|
|
|
v-if="!row.substanceName"
|
|
v-if="!row.substanceName"
|
|
|
class="el-icon-arrow-down"
|
|
class="el-icon-arrow-down"
|
|
|
- @click="handleAdd(row, $index)"
|
|
|
|
|
|
|
+ @click="handleAdd(row, $index, 'substanceName')"
|
|
|
></i>
|
|
></i>
|
|
|
<i
|
|
<i
|
|
|
v-else
|
|
v-else
|
|
|
class="el-icon-close"
|
|
class="el-icon-close"
|
|
|
- @click="clearTool(row, $index)"
|
|
|
|
|
|
|
+ @click="clearTool(row, $index, 'substanceName')"
|
|
|
></i>
|
|
></i>
|
|
|
</div>
|
|
</div>
|
|
|
</el-link>
|
|
</el-link>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:toolCodes="{ row }">
|
|
<template v-slot:toolCodes="{ row }">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-if="formData.reportWorkType != 5"
|
|
|
|
|
:value="
|
|
:value="
|
|
|
row.tools && row.tools.length > 0
|
|
row.tools && row.tools.length > 0
|
|
|
? row.tools.map((i) => i.toolCode).join(',')
|
|
? row.tools.map((i) => i.toolCode).join(',')
|
|
@@ -615,8 +617,9 @@
|
|
|
disabled
|
|
disabled
|
|
|
size="mini"
|
|
size="mini"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:substanceCode="{ row }">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-else
|
|
|
|
|
:value="row.substanceCode"
|
|
:value="row.substanceCode"
|
|
|
placeholder="自动带出"
|
|
placeholder="自动带出"
|
|
|
disabled
|
|
disabled
|
|
@@ -690,12 +693,7 @@
|
|
|
<el-button :loading="btnLoading" @click="handleClose">取消</el-button>
|
|
<el-button :loading="btnLoading" @click="handleClose">取消</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
- <toolModal
|
|
|
|
|
- ref="toolModalRef"
|
|
|
|
|
- @chooseModal="chooseModal"
|
|
|
|
|
- :isMain="formData.reportWorkType != 5"
|
|
|
|
|
- :multiple="formData.reportWorkType != 5"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <toolModal ref="toolModalRef" @chooseModal="chooseModal" />
|
|
|
|
|
|
|
|
<toolModal
|
|
<toolModal
|
|
|
ref="toolModalTowRef"
|
|
ref="toolModalTowRef"
|
|
@@ -789,7 +787,7 @@
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
bankColumns() {
|
|
bankColumns() {
|
|
|
- const list = [
|
|
|
|
|
|
|
+ let list = [
|
|
|
{
|
|
{
|
|
|
width: 110,
|
|
width: 110,
|
|
|
type: 'index',
|
|
type: 'index',
|
|
@@ -853,20 +851,35 @@
|
|
|
slot: 'unitName',
|
|
slot: 'unitName',
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'substanceName',
|
|
|
|
|
+ label: '设备名称',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ slot: 'substanceName',
|
|
|
|
|
+ minWidth: 110
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'substanceCode',
|
|
|
|
|
+ label: '设备编码',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ slot: 'substanceCode',
|
|
|
|
|
+ minWidth: 110
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
prop: 'toolName',
|
|
prop: 'toolName',
|
|
|
- label: this.formData.reportWorkType == 5 ? '设备名称' : '工具名称',
|
|
|
|
|
|
|
+ label: '工具名称',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
slot: 'toolName',
|
|
slot: 'toolName',
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'toolCodes',
|
|
prop: 'toolCodes',
|
|
|
- label: this.formData.reportWorkType == 5 ? '设备编码' : '工具编码',
|
|
|
|
|
|
|
+ label: '工具编码',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
slot: 'toolCodes',
|
|
slot: 'toolCodes',
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
prop: 'remark',
|
|
prop: 'remark',
|
|
|
label: '备注',
|
|
label: '备注',
|
|
@@ -886,7 +899,13 @@
|
|
|
];
|
|
];
|
|
|
if (this.formData.recordTemplateStyle != '4') {
|
|
if (this.formData.recordTemplateStyle != '4') {
|
|
|
// 过滤掉 计算公式 列
|
|
// 过滤掉 计算公式 列
|
|
|
- return list.filter((i) => i.prop != 'formula');
|
|
|
|
|
|
|
+ list = list.filter((i) => i.prop != 'formula');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (this.formData.reportWorkType != 5) {
|
|
|
|
|
+ list = list.filter(
|
|
|
|
|
+ (i) => !['substanceName', 'substanceCode'].includes(i.prop)
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
return list;
|
|
return list;
|
|
|
},
|
|
},
|
|
@@ -1770,6 +1789,9 @@
|
|
|
console.log('data', data, index, categoryId);
|
|
console.log('data', data, index, categoryId);
|
|
|
this.formData.deviceId = data?.id || null;
|
|
this.formData.deviceId = data?.id || null;
|
|
|
this.formData.deviceName = data?.name || '';
|
|
this.formData.deviceName = data?.name || '';
|
|
|
|
|
+ if (this.formData.reportWorkType == 5) {
|
|
|
|
|
+ this.formData.details = [];
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 添加
|
|
// 添加
|
|
|
addRow() {
|
|
addRow() {
|
|
@@ -1821,14 +1843,14 @@
|
|
|
this.formData.details.splice(index, 1);
|
|
this.formData.details.splice(index, 1);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- handleAdd(row, index) {
|
|
|
|
|
|
|
+ handleAdd(row, index, type) {
|
|
|
this.currentRow = row;
|
|
this.currentRow = row;
|
|
|
this.currentIndex = index;
|
|
this.currentIndex = index;
|
|
|
- if (this.formData.reportWorkType == 5) {
|
|
|
|
|
|
|
+ if (type == 'substanceName') {
|
|
|
this.$refs.bindSubstanceRef.open(
|
|
this.$refs.bindSubstanceRef.open(
|
|
|
this.formData.deviceId,
|
|
this.formData.deviceId,
|
|
|
this.formData.deviceName,
|
|
this.formData.deviceName,
|
|
|
- this.formData.deviceCode,
|
|
|
|
|
|
|
+ this.formData.deviceCode
|
|
|
);
|
|
);
|
|
|
} else {
|
|
} else {
|
|
|
this.$refs.toolModalRef.open(row.toolCodes);
|
|
this.$refs.toolModalRef.open(row.toolCodes);
|
|
@@ -1839,7 +1861,7 @@
|
|
|
this.$refs.bindSubstanceRef.open(
|
|
this.$refs.bindSubstanceRef.open(
|
|
|
this.formData.deviceId,
|
|
this.formData.deviceId,
|
|
|
this.formData.deviceName,
|
|
this.formData.deviceName,
|
|
|
- this.formData.deviceCode,
|
|
|
|
|
|
|
+ this.formData.deviceCode
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
bindSubstanceSuccess(list) {
|
|
bindSubstanceSuccess(list) {
|
|
@@ -1911,7 +1933,7 @@
|
|
|
},
|
|
},
|
|
|
// 清空工具
|
|
// 清空工具
|
|
|
clearTool(row, index) {
|
|
clearTool(row, index) {
|
|
|
- if (this.formData.reportWorkType == 5) {
|
|
|
|
|
|
|
+ if (type == 'substanceName') {
|
|
|
substanceKey.forEach((key) => {
|
|
substanceKey.forEach((key) => {
|
|
|
this.$set(this.formData.details[index], key, '');
|
|
this.$set(this.formData.details[index], key, '');
|
|
|
});
|
|
});
|