|
|
@@ -194,7 +194,18 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-if="formData.recordTemplateStyle == '2'&&this.businessType != 3" :span="8">
|
|
|
+ <!-- <el-col :span="8">
|
|
|
+ <el-form-item label="物联设备" prop="stopDate">
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ <el-col
|
|
|
+ v-if="
|
|
|
+ (formData.recordTemplateStyle == '2' && this.businessType != 3) ||
|
|
|
+ formData.reportWorkType == 5
|
|
|
+ "
|
|
|
+ :span="8"
|
|
|
+ >
|
|
|
<el-form-item label="关联设备" prop="deviceName" required>
|
|
|
<el-input
|
|
|
v-model="formData.deviceName"
|
|
|
@@ -207,7 +218,10 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-if="formData.reportWorkType == 2&&this.businessType != 3" :span="8">
|
|
|
+ <el-col
|
|
|
+ v-if="formData.reportWorkType == 2 && this.businessType != 3"
|
|
|
+ :span="8"
|
|
|
+ >
|
|
|
<el-form-item label="关联工序">
|
|
|
<el-input
|
|
|
v-model="formData.produceTaskName"
|
|
|
@@ -227,7 +241,10 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-if="formData.reportWorkType == 2&&this.businessType != 3" :span="8">
|
|
|
+ <el-col
|
|
|
+ v-if="formData.reportWorkType == 2 && this.businessType != 3"
|
|
|
+ :span="8"
|
|
|
+ >
|
|
|
<el-form-item label="是否有执行方式" label-width="130px">
|
|
|
<el-radio-group
|
|
|
v-model="formData.isExecuteMethod"
|
|
|
@@ -239,7 +256,11 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col
|
|
|
- v-if="formData.isExecuteMethod == 1 && formData.reportWorkType == 2&&this.businessType != 3"
|
|
|
+ v-if="
|
|
|
+ formData.isExecuteMethod == 1 &&
|
|
|
+ formData.reportWorkType == 2 &&
|
|
|
+ this.businessType != 3
|
|
|
+ "
|
|
|
:span="8"
|
|
|
>
|
|
|
<el-form-item label="执行方式" required prop="executeMethodId">
|
|
|
@@ -331,6 +352,7 @@
|
|
|
placeholder="请选择参数类型"
|
|
|
size="mini"
|
|
|
@change="paramTypeChange(row)"
|
|
|
+ :disabled="!!row.paramCode"
|
|
|
>
|
|
|
<el-option label="数值" :value="1" />
|
|
|
<el-option label="选择" :value="2" />
|
|
|
@@ -371,6 +393,7 @@
|
|
|
type="textarea"
|
|
|
rows="1"
|
|
|
autosize
|
|
|
+ :readonly="!!row.paramCode"
|
|
|
></el-input>
|
|
|
</template>
|
|
|
|
|
|
@@ -498,6 +521,9 @@
|
|
|
placeholder="请输入参数上限"
|
|
|
size="mini"
|
|
|
></el-input>
|
|
|
+ <span v-else-if="row.paramType == 7 && row.substanceId">{{
|
|
|
+ row.maxValue
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
<template v-slot:minValue="{ row }">
|
|
|
<el-input
|
|
|
@@ -506,6 +532,9 @@
|
|
|
placeholder="请输入参数下限"
|
|
|
size="mini"
|
|
|
></el-input>
|
|
|
+ <span v-else-if="row.paramType == 7 && row.substanceId">{{
|
|
|
+ row.minValue
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
<template v-slot:unitName="{ row }">
|
|
|
<!-- <el-input
|
|
|
@@ -522,9 +551,16 @@
|
|
|
size="mini"
|
|
|
>
|
|
|
</DictSelection>
|
|
|
+ <span v-else-if="row.paramType == 7 && row.substanceId">{{
|
|
|
+ row.unitName
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
- <template v-slot:toolName="{ row }">
|
|
|
- <el-link :underline="false" style="cursor: pointer">
|
|
|
+ <template v-slot:toolName="{ row, $index }">
|
|
|
+ <el-link
|
|
|
+ :underline="false"
|
|
|
+ style="cursor: pointer"
|
|
|
+ v-if="formData.reportWorkType != 5"
|
|
|
+ >
|
|
|
<div class="ele-cell">
|
|
|
<div @click="handleAdd(row)">
|
|
|
{{
|
|
|
@@ -541,15 +577,40 @@
|
|
|
<i v-else class="el-icon-close" @click="clearTool(row)"></i>
|
|
|
</div>
|
|
|
</el-link>
|
|
|
+ <el-link :underline="false" style="cursor: pointer" v-else>
|
|
|
+ <div class="ele-cell">
|
|
|
+ <div @click="handleAdd(row, $index)">
|
|
|
+ {{ row.substanceName || '请选择' }}
|
|
|
+ </div>
|
|
|
+ <i
|
|
|
+ v-if="!row.substanceName"
|
|
|
+ class="el-icon-arrow-down"
|
|
|
+ @click="handleAdd(row, $index)"
|
|
|
+ ></i>
|
|
|
+ <i
|
|
|
+ v-else
|
|
|
+ class="el-icon-close"
|
|
|
+ @click="clearTool(row, $index)"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ </el-link>
|
|
|
</template>
|
|
|
<template v-slot:toolCodes="{ row }">
|
|
|
<el-input
|
|
|
+ v-if="formData.reportWorkType != 5"
|
|
|
:value="
|
|
|
row.tools && row.tools.length > 0
|
|
|
? row.tools.map((i) => i.toolCode).join(',')
|
|
|
: ''
|
|
|
"
|
|
|
- placeholder="工具自动带出"
|
|
|
+ placeholder="自动带出"
|
|
|
+ disabled
|
|
|
+ size="mini"
|
|
|
+ ></el-input>
|
|
|
+ <el-input
|
|
|
+ v-else
|
|
|
+ :value="row.substanceCode"
|
|
|
+ placeholder="自动带出"
|
|
|
disabled
|
|
|
size="mini"
|
|
|
></el-input>
|
|
|
@@ -621,7 +682,12 @@
|
|
|
<el-button :loading="btnLoading" @click="handleClose">取消</el-button>
|
|
|
</template>
|
|
|
|
|
|
- <toolModal ref="toolModalRef" @chooseModal="chooseModal" />
|
|
|
+ <toolModal
|
|
|
+ ref="toolModalRef"
|
|
|
+ @chooseModal="chooseModal"
|
|
|
+ :isMain="formData.reportWorkType != 5"
|
|
|
+ :multiple="formData.reportWorkType != 5"
|
|
|
+ />
|
|
|
|
|
|
<toolModal
|
|
|
ref="toolModalTowRef"
|
|
|
@@ -635,7 +701,10 @@
|
|
|
@chooseEquipment="chooseEquipment"
|
|
|
:multiple="false"
|
|
|
/>
|
|
|
-
|
|
|
+ <bindSubstanceList
|
|
|
+ ref="bindSubstanceRef"
|
|
|
+ @bindSubstanceSuccess="bindSubstanceSuccess"
|
|
|
+ ></bindSubstanceList>
|
|
|
<ProductModal
|
|
|
ref="ProductModalRef"
|
|
|
@changeProduct="changeProduct"
|
|
|
@@ -649,6 +718,17 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ //设备初始化字段
|
|
|
+ const substanceKey = [
|
|
|
+ 'substanceCode',
|
|
|
+ 'substanceId',
|
|
|
+ 'substanceName',
|
|
|
+ 'paramCode',
|
|
|
+ 'paramValue',
|
|
|
+ 'maxValue',
|
|
|
+ 'minValue',
|
|
|
+ 'unitName'
|
|
|
+ ];
|
|
|
import { getByCode } from '@/api/system/dictionary-data';
|
|
|
// import RuleCycle from '../../matterRules/components/rule-cycle.vue';
|
|
|
import RuleCycle from './rule-cycle.vue';
|
|
|
@@ -656,7 +736,9 @@
|
|
|
import Details from './details.vue';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import toolModal from './toolModal.vue';
|
|
|
+ import bindSubstanceList from './bindSubstanceList.vue';
|
|
|
import MaterialAdd from '../../components/MaterialAdd.vue';
|
|
|
+
|
|
|
import {
|
|
|
recordrulesSave,
|
|
|
recordrulesDetailPage,
|
|
|
@@ -687,7 +769,8 @@
|
|
|
toolModal,
|
|
|
processModal,
|
|
|
ProductModalCorrelation,
|
|
|
- experimentationProcess
|
|
|
+ experimentationProcess,
|
|
|
+ bindSubstanceList
|
|
|
},
|
|
|
props: {
|
|
|
typeInfo: {
|
|
|
@@ -764,14 +847,14 @@
|
|
|
},
|
|
|
{
|
|
|
prop: 'toolName',
|
|
|
- label: '工具名称',
|
|
|
+ label: this.formData.reportWorkType == 5 ? '设备名称' : '工具名称',
|
|
|
align: 'center',
|
|
|
slot: 'toolName',
|
|
|
minWidth: 110
|
|
|
},
|
|
|
{
|
|
|
prop: 'toolCodes',
|
|
|
- label: '工具编码',
|
|
|
+ label: this.formData.reportWorkType == 5 ? '设备编码' : '工具编码',
|
|
|
align: 'center',
|
|
|
slot: 'toolCodes',
|
|
|
minWidth: 110
|
|
|
@@ -1105,7 +1188,8 @@
|
|
|
{ label: '工序统计', value: '3' }
|
|
|
],
|
|
|
opSelectOptions: ['+', '-', '*', '/', '%', '(', ')'],
|
|
|
- typeList: []
|
|
|
+ typeList: [],
|
|
|
+ currentIndex: ''
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -1703,6 +1787,11 @@
|
|
|
unitName: null,
|
|
|
productName: '',
|
|
|
productCode: '',
|
|
|
+ paramCode: '',
|
|
|
+ substanceId: '',
|
|
|
+ substanceCode: '',
|
|
|
+
|
|
|
+ substanceName: '',
|
|
|
// 1-成品统计,2-物料统计,3-工序统计"
|
|
|
statisticsType:
|
|
|
this.formData.recordTemplateStyle == '4'
|
|
|
@@ -1724,9 +1813,60 @@
|
|
|
this.formData.details.splice(index, 1);
|
|
|
}
|
|
|
},
|
|
|
- handleAdd(row) {
|
|
|
+ handleAdd(row, index) {
|
|
|
this.currentRow = row;
|
|
|
- this.$refs.toolModalRef.open(row.toolCodes);
|
|
|
+ this.currentIndex = index;
|
|
|
+ if (this.formData.reportWorkType == 5) {
|
|
|
+ this.$refs.bindSubstanceRef.open(this.formData.deviceId);
|
|
|
+ } else {
|
|
|
+ this.$refs.toolModalRef.open(row.toolCodes);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ bindSubstanceSuccess(list) {
|
|
|
+ console.log(list, 'list');
|
|
|
+ const currentIndex = this.currentIndex;
|
|
|
+ list.forEach((item, index) => {
|
|
|
+ if (!index) {
|
|
|
+ substanceKey.forEach((key) => {
|
|
|
+ this.$set(this.formData.details[currentIndex], key, item[key]);
|
|
|
+ });
|
|
|
+ this.$set(this.formData.details[currentIndex], 'paramType', 7);
|
|
|
+ } else {
|
|
|
+ this.formData.details.push({
|
|
|
+ id: new Date().getTime(),
|
|
|
+ defaultValue: '',
|
|
|
+ maxValue: item.maxValue,
|
|
|
+ minValue: item.minValue,
|
|
|
+ paramType: 7,
|
|
|
+ paramValue: item.paramValue,
|
|
|
+ remark: '',
|
|
|
+ symbol: null,
|
|
|
+ tools: [],
|
|
|
+ unitName: item.unitName,
|
|
|
+ productName: '',
|
|
|
+ productCode: '',
|
|
|
+ paramCode: item.paramCode,
|
|
|
+ substanceId: item.substanceId,
|
|
|
+ substanceCode: item.paramCode,
|
|
|
+ substanceName: item.substanceName,
|
|
|
+ // 1-成品统计,2-物料统计,3-工序统计"
|
|
|
+ statisticsType:
|
|
|
+ this.formData.recordTemplateStyle == '4'
|
|
|
+ ? this.statisticsType
|
|
|
+ : null,
|
|
|
+ // 公式
|
|
|
+ formula: '',
|
|
|
+ _paramSelect: null,
|
|
|
+ _opSelect: null,
|
|
|
+ _replaceOrAppend: '',
|
|
|
+ formulaParts: [],
|
|
|
+ sortNum:
|
|
|
+ Math.max(
|
|
|
+ ...this.formData.details.map((item) => item.sortNum || 0)
|
|
|
+ ) + 1
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
chooseModal(data) {
|
|
|
console.log('data', data);
|
|
|
@@ -1749,8 +1889,14 @@
|
|
|
this.formData.details = list;
|
|
|
},
|
|
|
// 清空工具
|
|
|
- clearTool(row) {
|
|
|
- row.tools = [];
|
|
|
+ clearTool(row, index) {
|
|
|
+ if (this.formData.reportWorkType == 5) {
|
|
|
+ substanceKey.forEach((key) => {
|
|
|
+ this.$set(this.formData.details[index], key, '');
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ row.tools = [];
|
|
|
+ }
|
|
|
},
|
|
|
// 查询 recordrulesCyclePage
|
|
|
async recordrulesCyclePage(row) {
|