|
@@ -580,11 +580,6 @@
|
|
|
class="el-icon-arrow-down"
|
|
class="el-icon-arrow-down"
|
|
|
@click="handleAdd(row, '', 'toolName')"
|
|
@click="handleAdd(row, '', 'toolName')"
|
|
|
></i>
|
|
></i>
|
|
|
- <i
|
|
|
|
|
- v-else
|
|
|
|
|
- class="el-icon-close"
|
|
|
|
|
- @click="clearTool(row, '', 'toolName')"
|
|
|
|
|
- ></i>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</el-link>
|
|
</el-link>
|
|
|
</template>
|
|
</template>
|
|
@@ -599,10 +594,19 @@
|
|
|
class="el-icon-arrow-down"
|
|
class="el-icon-arrow-down"
|
|
|
@click="handleAdd(row, $index, 'substanceName')"
|
|
@click="handleAdd(row, $index, 'substanceName')"
|
|
|
></i>
|
|
></i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-link>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:iotPointName="{ row, $index }">
|
|
|
|
|
+ <el-link :underline="false" style="cursor: pointer">
|
|
|
|
|
+ <div class="ele-cell">
|
|
|
|
|
+ <div @click="handleAdd(row, $index, 'iotPointName')">
|
|
|
|
|
+ {{ row.iotPointName || '请选择' }}
|
|
|
|
|
+ </div>
|
|
|
<i
|
|
<i
|
|
|
- v-else
|
|
|
|
|
- class="el-icon-close"
|
|
|
|
|
- @click="clearTool(row, $index, 'substanceName')"
|
|
|
|
|
|
|
+ v-if="!row.iotPointName"
|
|
|
|
|
+ class="el-icon-arrow-down"
|
|
|
|
|
+ @click="handleAdd(row, $index, 'iotPointName')"
|
|
|
></i>
|
|
></i>
|
|
|
</div>
|
|
</div>
|
|
|
</el-link>
|
|
</el-link>
|
|
@@ -712,7 +716,9 @@
|
|
|
'paramValue',
|
|
'paramValue',
|
|
|
'maxValue',
|
|
'maxValue',
|
|
|
'minValue',
|
|
'minValue',
|
|
|
- 'unitName'
|
|
|
|
|
|
|
+ 'unitName',
|
|
|
|
|
+ 'iotId',
|
|
|
|
|
+ 'iotPointName'
|
|
|
];
|
|
];
|
|
|
const formBaseData = {
|
|
const formBaseData = {
|
|
|
address: '',
|
|
address: '',
|
|
@@ -934,6 +940,7 @@
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'iotPointName',
|
|
prop: 'iotPointName',
|
|
|
|
|
+ slot: 'iotPointName',
|
|
|
label: '物联点位',
|
|
label: '物联点位',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
minWidth: 150
|
|
minWidth: 150
|
|
@@ -1281,6 +1288,7 @@
|
|
|
},
|
|
},
|
|
|
// 打开选择车间弹窗
|
|
// 打开选择车间弹窗
|
|
|
openWorkShops(type) {
|
|
openWorkShops(type) {
|
|
|
|
|
+ this.currentIndex = 9999;
|
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
|
this.$refs.selectWorkshopRef.open();
|
|
this.$refs.selectWorkshopRef.open();
|
|
|
} else {
|
|
} else {
|
|
@@ -1288,7 +1296,29 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
confirmWorkshops(info) {
|
|
confirmWorkshops(info) {
|
|
|
- console.log('info', info);
|
|
|
|
|
|
|
+ if (this.currentIndex != 9999) {
|
|
|
|
|
+ substanceKey.forEach((key) => {
|
|
|
|
|
+ if (key != 'paramValue') {
|
|
|
|
|
+ this.$set(this.addForm.detailList[this.currentIndex], key, '');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.addForm.detailList[this.currentIndex],
|
|
|
|
|
+ 'substanceId',
|
|
|
|
|
+ info.id
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.addForm.detailList[this.currentIndex],
|
|
|
|
|
+ 'substanceName',
|
|
|
|
|
+ info.name
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.addForm.detailList[this.currentIndex],
|
|
|
|
|
+ 'substanceCode',
|
|
|
|
|
+ info.code
|
|
|
|
|
+ );
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (this.addForm.associatedObject == 1) {
|
|
if (this.addForm.associatedObject == 1) {
|
|
|
this.addForm.workshopId = info.workshopId;
|
|
this.addForm.workshopId = info.workshopId;
|
|
|
this.addForm.workshopName = info.workshopName;
|
|
this.addForm.workshopName = info.workshopName;
|
|
@@ -1371,7 +1401,7 @@
|
|
|
handleAdd(row, index, type) {
|
|
handleAdd(row, index, type) {
|
|
|
this.currentRow = row;
|
|
this.currentRow = row;
|
|
|
this.currentIndex = index;
|
|
this.currentIndex = index;
|
|
|
- if (type == 'substanceName') {
|
|
|
|
|
|
|
+ if (type == 'iotPointName') {
|
|
|
if (!this.addForm.deviceId) {
|
|
if (!this.addForm.deviceId) {
|
|
|
this.$message.error('请选择主设备!');
|
|
this.$message.error('请选择主设备!');
|
|
|
return;
|
|
return;
|
|
@@ -1381,6 +1411,8 @@
|
|
|
this.addForm.deviceName,
|
|
this.addForm.deviceName,
|
|
|
this.addForm.deviceCode
|
|
this.addForm.deviceCode
|
|
|
);
|
|
);
|
|
|
|
|
+ } else if (type == 'substanceName') {
|
|
|
|
|
+ this.$refs.MaterialAddRef.open();
|
|
|
} else {
|
|
} else {
|
|
|
this.$refs.toolModalRef.open(row.toolCodes);
|
|
this.$refs.toolModalRef.open(row.toolCodes);
|
|
|
}
|
|
}
|
|
@@ -1403,6 +1435,10 @@
|
|
|
this.$set(this.addForm.detailList[currentIndex], key, item[key]);
|
|
this.$set(this.addForm.detailList[currentIndex], key, item[key]);
|
|
|
});
|
|
});
|
|
|
this.$set(this.addForm.detailList[currentIndex], 'paramType', 7);
|
|
this.$set(this.addForm.detailList[currentIndex], 'paramType', 7);
|
|
|
|
|
+ console.log(
|
|
|
|
|
+ this.addForm.detailList[currentIndex],
|
|
|
|
|
+ 'this.addForm.detailList[currentIndex]'
|
|
|
|
|
+ );
|
|
|
} else {
|
|
} else {
|
|
|
this.addForm.detailList.push({
|
|
this.addForm.detailList.push({
|
|
|
id: new Date().getTime(),
|
|
id: new Date().getTime(),
|
|
@@ -1411,7 +1447,7 @@
|
|
|
minValue: item.minValue,
|
|
minValue: item.minValue,
|
|
|
paramType: 7,
|
|
paramType: 7,
|
|
|
paramValue: item.paramValue,
|
|
paramValue: item.paramValue,
|
|
|
- iotPointName: item.paramValue,
|
|
|
|
|
|
|
+ iotPointName: item.iotPointName,
|
|
|
iotId: item.iotId,
|
|
iotId: item.iotId,
|
|
|
remark: '',
|
|
remark: '',
|
|
|
symbol: null,
|
|
symbol: null,
|
|
@@ -1442,16 +1478,10 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- // 清空工具
|
|
|
|
|
- clearTool(row, index) {
|
|
|
|
|
- if (type == 'substanceName') {
|
|
|
|
|
- substanceKey.forEach((key) => {
|
|
|
|
|
- this.$set(this.addForm.details[index], key, '');
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- row.tools = [];
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // // 清空工具
|
|
|
|
|
+ // clearTool(row, index) {
|
|
|
|
|
+ // row.tools = [];
|
|
|
|
|
+ // },
|
|
|
// 选择物品 产品、物料等
|
|
// 选择物品 产品、物料等
|
|
|
selectChooseModalProduct(row) {
|
|
selectChooseModalProduct(row) {
|
|
|
this.currentRow = row;
|
|
this.currentRow = row;
|