|
@@ -78,6 +78,7 @@
|
|
|
size="small"
|
|
size="small"
|
|
|
@change="typeChange"
|
|
@change="typeChange"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
|
|
+ :disabled="addForm.autoOrder == 1 && type === 'dispatch'"
|
|
|
>
|
|
>
|
|
|
<el-option :value="1" label="班组"></el-option>
|
|
<el-option :value="1" label="班组"></el-option>
|
|
|
<el-option :value="0" label="个人"></el-option>
|
|
<el-option :value="0" label="个人"></el-option>
|
|
@@ -202,6 +203,7 @@
|
|
|
v-model="addForm.associatedObject"
|
|
v-model="addForm.associatedObject"
|
|
|
size="small"
|
|
size="small"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
|
|
+ @change="associatedObjectChange"
|
|
|
>
|
|
>
|
|
|
<el-option :value="1" label="车间"></el-option>
|
|
<el-option :value="1" label="车间"></el-option>
|
|
|
<el-option :value="2" label="设备"></el-option>
|
|
<el-option :value="2" label="设备"></el-option>
|
|
@@ -294,6 +296,14 @@
|
|
|
>
|
|
>
|
|
|
新建
|
|
新建
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ class="ele-btn-icon"
|
|
|
|
|
+ @click="bindSubstanceListOpen"
|
|
|
|
|
+ >
|
|
|
|
|
+ 添加物联参数
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -315,6 +325,7 @@
|
|
|
placeholder="请选择参数类型"
|
|
placeholder="请选择参数类型"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
@change="paramTypeChange(row)"
|
|
@change="paramTypeChange(row)"
|
|
|
|
|
+ :disabled="!!row.paramCode"
|
|
|
>
|
|
>
|
|
|
<el-option label="数值" :value="1" />
|
|
<el-option label="数值" :value="1" />
|
|
|
<el-option label="选择" :value="2" />
|
|
<el-option label="选择" :value="2" />
|
|
@@ -353,6 +364,7 @@
|
|
|
placeholder="请输入参数内容"
|
|
placeholder="请输入参数内容"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
type="textarea"
|
|
type="textarea"
|
|
|
|
|
+ :readonly="!!row.paramCode"
|
|
|
rows="1"
|
|
rows="1"
|
|
|
autosize
|
|
autosize
|
|
|
></el-input>
|
|
></el-input>
|
|
@@ -485,6 +497,9 @@
|
|
|
placeholder="请输入参数上限"
|
|
placeholder="请输入参数上限"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
|
|
+ <span v-else-if="row.paramType == 7 && row.paramCode">{{
|
|
|
|
|
+ row.maxValue
|
|
|
|
|
+ }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:minValue="{ row }">
|
|
<template v-slot:minValue="{ row }">
|
|
|
<el-input
|
|
<el-input
|
|
@@ -493,6 +508,9 @@
|
|
|
placeholder="请输入参数下限"
|
|
placeholder="请输入参数下限"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
|
|
+ <span v-else-if="row.paramType == 7 && row.paramCode">{{
|
|
|
|
|
+ row.minValue
|
|
|
|
|
+ }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:unitName="{ row }">
|
|
<template v-slot:unitName="{ row }">
|
|
|
<!-- <el-input
|
|
<!-- <el-input
|
|
@@ -509,34 +527,33 @@
|
|
|
size="mini"
|
|
size="mini"
|
|
|
>
|
|
>
|
|
|
</DictSelection>
|
|
</DictSelection>
|
|
|
|
|
+ <span v-else-if="row.paramType == 7 && row.paramCode">{{
|
|
|
|
|
+ row.unitName
|
|
|
|
|
+ }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-slot:toolName="{ row }">
|
|
|
|
|
|
|
+ <template v-slot:toolName="{ row, $index }">
|
|
|
<el-link :underline="false" style="cursor: pointer">
|
|
<el-link :underline="false" style="cursor: pointer">
|
|
|
<div class="ele-cell">
|
|
<div class="ele-cell">
|
|
|
- <div @click="handleAdd(row)">
|
|
|
|
|
- {{
|
|
|
|
|
- row.tools && row.tools.length > 0
|
|
|
|
|
- ? row.tools.map((i) => i.toolName).join(',')
|
|
|
|
|
- : '请选择'
|
|
|
|
|
- }}
|
|
|
|
|
|
|
+ <div @click="handleAdd(row, $index)">
|
|
|
|
|
+ {{ row.substanceName || '请选择' }}
|
|
|
</div>
|
|
</div>
|
|
|
<i
|
|
<i
|
|
|
- v-if="row.tools.length == 0"
|
|
|
|
|
|
|
+ v-if="!row.substanceName"
|
|
|
class="el-icon-arrow-down"
|
|
class="el-icon-arrow-down"
|
|
|
- @click="handleAdd(row)"
|
|
|
|
|
|
|
+ @click="handleAdd(row, $index)"
|
|
|
|
|
+ ></i>
|
|
|
|
|
+ <i
|
|
|
|
|
+ v-else
|
|
|
|
|
+ class="el-icon-close"
|
|
|
|
|
+ @click="clearTool(row, $index)"
|
|
|
></i>
|
|
></i>
|
|
|
- <i v-else class="el-icon-close" @click="clearTool(row)"></i>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</el-link>
|
|
</el-link>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:toolCodes="{ row }">
|
|
<template v-slot:toolCodes="{ row }">
|
|
|
<el-input
|
|
<el-input
|
|
|
- :value="
|
|
|
|
|
- row.tools && row.tools.length > 0
|
|
|
|
|
- ? row.tools.map((i) => i.toolCode).join(',')
|
|
|
|
|
- : ''
|
|
|
|
|
- "
|
|
|
|
|
- placeholder="工具自动带出"
|
|
|
|
|
|
|
+ :value="row.substanceCode"
|
|
|
|
|
+ placeholder="自动带出"
|
|
|
disabled
|
|
disabled
|
|
|
size="mini"
|
|
size="mini"
|
|
|
></el-input>
|
|
></el-input>
|
|
@@ -588,6 +605,10 @@
|
|
|
<toolModal ref="toolModalTowRef" @chooseModal="chooseModalProduct" />
|
|
<toolModal ref="toolModalTowRef" @chooseModal="chooseModalProduct" />
|
|
|
<MaterialAdd ref="MaterialAddRef" @chooseEquipment="confirmWorkshops" />
|
|
<MaterialAdd ref="MaterialAddRef" @chooseEquipment="confirmWorkshops" />
|
|
|
<toolModal ref="toolModalRef" @chooseModal="chooseModal" />
|
|
<toolModal ref="toolModalRef" @chooseModal="chooseModal" />
|
|
|
|
|
+ <bindSubstanceList
|
|
|
|
|
+ ref="bindSubstanceRef"
|
|
|
|
|
+ @bindSubstanceSuccess="bindSubstanceSuccess"
|
|
|
|
|
+ ></bindSubstanceList>
|
|
|
</ele-modal>
|
|
</ele-modal>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -609,7 +630,18 @@
|
|
|
import toolModal from '@/BIZComponents/toolModal.vue';
|
|
import toolModal from '@/BIZComponents/toolModal.vue';
|
|
|
import MaterialAdd from '@/components/common/MaterialAdd.vue';
|
|
import MaterialAdd from '@/components/common/MaterialAdd.vue';
|
|
|
import { getteampage } from '@/api/main/index.js';
|
|
import { getteampage } from '@/api/main/index.js';
|
|
|
-
|
|
|
|
|
|
|
+ import bindSubstanceList from './bindSubstanceList.vue';
|
|
|
|
|
+ //设备初始化字段
|
|
|
|
|
+ const substanceKey = [
|
|
|
|
|
+ 'substanceCode',
|
|
|
|
|
+ 'substanceId',
|
|
|
|
|
+ 'substanceName',
|
|
|
|
|
+ 'paramCode',
|
|
|
|
|
+ 'paramValue',
|
|
|
|
|
+ 'maxValue',
|
|
|
|
|
+ 'minValue',
|
|
|
|
|
+ 'unitName'
|
|
|
|
|
+ ];
|
|
|
const formBaseData = {
|
|
const formBaseData = {
|
|
|
address: '',
|
|
address: '',
|
|
|
areaId: 0,
|
|
areaId: 0,
|
|
@@ -644,7 +676,7 @@
|
|
|
recordTemplateStyle: null,
|
|
recordTemplateStyle: null,
|
|
|
reportWorkType: null,
|
|
reportWorkType: null,
|
|
|
executeIdList: [],
|
|
executeIdList: [],
|
|
|
- associatedObject: 1,
|
|
|
|
|
|
|
+ associatedObject: 2,
|
|
|
deviceName: '',
|
|
deviceName: '',
|
|
|
deviceId: '',
|
|
deviceId: '',
|
|
|
deviceCode: '',
|
|
deviceCode: '',
|
|
@@ -656,10 +688,12 @@
|
|
|
productLineName: ''
|
|
productLineName: ''
|
|
|
};
|
|
};
|
|
|
export default {
|
|
export default {
|
|
|
|
|
+
|
|
|
mixins: [dictMixins, tableColumnsMixin],
|
|
mixins: [dictMixins, tableColumnsMixin],
|
|
|
components: {
|
|
components: {
|
|
|
deptSelect,
|
|
deptSelect,
|
|
|
selectReleaseRules,
|
|
selectReleaseRules,
|
|
|
|
|
+ bindSubstanceList,
|
|
|
selectWorkshop,
|
|
selectWorkshop,
|
|
|
toolModal,
|
|
toolModal,
|
|
|
MaterialAdd
|
|
MaterialAdd
|
|
@@ -667,10 +701,9 @@
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
visible: false,
|
|
visible: false,
|
|
|
- classify: '',
|
|
|
|
|
-
|
|
|
|
|
title: '新增记录计划配置',
|
|
title: '新增记录计划配置',
|
|
|
activeIndex: 0,
|
|
activeIndex: 0,
|
|
|
|
|
+ classify: '',
|
|
|
addForm: JSON.parse(JSON.stringify(formBaseData)),
|
|
addForm: JSON.parse(JSON.stringify(formBaseData)),
|
|
|
rules: {
|
|
rules: {
|
|
|
name: [
|
|
name: [
|
|
@@ -854,14 +887,14 @@
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'toolName',
|
|
prop: 'toolName',
|
|
|
- label: '工具名称',
|
|
|
|
|
|
|
+ label: '设备名称',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
slot: 'toolName',
|
|
slot: 'toolName',
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'toolCodes',
|
|
prop: 'toolCodes',
|
|
|
- label: '工具编码',
|
|
|
|
|
|
|
+ label: '设备编码',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
slot: 'toolCodes',
|
|
slot: 'toolCodes',
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
@@ -907,9 +940,9 @@
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 外部调用,打开弹窗
|
|
// 外部调用,打开弹窗
|
|
|
- async open(type, data,classify) {
|
|
|
|
|
- this.classify=classify;
|
|
|
|
|
|
|
+ async open(type, data, classify) {
|
|
|
console.log('type data', type, data);
|
|
console.log('type data', type, data);
|
|
|
|
|
+ this.classify = classify;
|
|
|
this.type = type;
|
|
this.type = type;
|
|
|
await this.getAllTeamList();
|
|
await this.getAllTeamList();
|
|
|
if (type == 'add') {
|
|
if (type == 'add') {
|
|
@@ -959,6 +992,21 @@
|
|
|
|
|
|
|
|
console.log('this.addForm', this.addForm);
|
|
console.log('this.addForm', this.addForm);
|
|
|
},
|
|
},
|
|
|
|
|
+ associatedObjectChange() {
|
|
|
|
|
+ this.addForm.detailList = [];
|
|
|
|
|
+ this.addForm.deviceCode = '';
|
|
|
|
|
+ this.addForm.deviceId = '';
|
|
|
|
|
+ this.addForm.deviceName = '';
|
|
|
|
|
+ this.addForm.workshopId = '';
|
|
|
|
|
+ this.addForm.workshopName = '';
|
|
|
|
|
+ this.addForm.workshopPlanId = '';
|
|
|
|
|
+ this.addForm.workshopPlanName = '';
|
|
|
|
|
+ this.addForm.address = '';
|
|
|
|
|
+ this.addForm.areaId = '';
|
|
|
|
|
+ this.addForm.areaName = '';
|
|
|
|
|
+ this.addForm.factoryId = '';
|
|
|
|
|
+ this.addForm.factoryName = '';
|
|
|
|
|
+ },
|
|
|
// 关闭时清理表单
|
|
// 关闭时清理表单
|
|
|
handleClose() {
|
|
handleClose() {
|
|
|
this.addForm = JSON.parse(JSON.stringify(formBaseData));
|
|
this.addForm = JSON.parse(JSON.stringify(formBaseData));
|
|
@@ -979,6 +1027,9 @@
|
|
|
console.log('this.addForm', this.addForm);
|
|
console.log('this.addForm', this.addForm);
|
|
|
this.$refs.formRef.validate(async (valid) => {
|
|
this.$refs.formRef.validate(async (valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
|
+ if (!this.addForm.detailList?.length) {
|
|
|
|
|
+ return this.$message.error('规则明细不能为空');
|
|
|
|
|
+ }
|
|
|
this.butLoading = true;
|
|
this.butLoading = true;
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
@@ -990,7 +1041,7 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const body = this.formMateBody();
|
|
const body = this.formMateBody();
|
|
|
- body.planType = 5;
|
|
|
|
|
|
|
+ body.planType =5
|
|
|
|
|
|
|
|
if (this.type == 'dispatch') {
|
|
if (this.type == 'dispatch') {
|
|
|
await recordrulesplanManualDispatchOrder(body);
|
|
await recordrulesplanManualDispatchOrder(body);
|
|
@@ -1097,6 +1148,12 @@
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
console.log('规则明细数据', data.details);
|
|
console.log('规则明细数据', data.details);
|
|
|
|
|
+ if (data.deviceId) {
|
|
|
|
|
+ this.addForm.deviceId = data.deviceId;
|
|
|
|
|
+ this.addForm.deviceName = data.deviceName;
|
|
|
|
|
+ this.addForm.deviceCode = data.deviceCode;
|
|
|
|
|
+ this.addForm.associatedObject = 2;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
this.addForm.ruleId = rules.id;
|
|
this.addForm.ruleId = rules.id;
|
|
|
this.addForm.ruleName = rules.name;
|
|
this.addForm.ruleName = rules.name;
|
|
@@ -1178,6 +1235,76 @@
|
|
|
row.formula = '';
|
|
row.formula = '';
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ handleAdd(row, index) {
|
|
|
|
|
+ this.currentRow = row;
|
|
|
|
|
+ this.currentIndex = index;
|
|
|
|
|
+ this.$refs.bindSubstanceRef.open(
|
|
|
|
|
+ this.addForm.deviceId,
|
|
|
|
|
+ this.addForm.deviceCode,
|
|
|
|
|
+ this.addForm.deviceName
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ bindSubstanceListOpen() {
|
|
|
|
|
+ this.currentIndex = 9999;
|
|
|
|
|
+ this.$refs.bindSubstanceRef.open(
|
|
|
|
|
+ this.addForm.deviceId,
|
|
|
|
|
+ this.addForm.deviceName,
|
|
|
|
|
+ this.addForm.deviceCode
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ bindSubstanceSuccess(list) {
|
|
|
|
|
+ console.log(list, 'list');
|
|
|
|
|
+ const currentIndex = this.currentIndex;
|
|
|
|
|
+ list.forEach((item, index) => {
|
|
|
|
|
+ if (!index && currentIndex != 9999) {
|
|
|
|
|
+ substanceKey.forEach((key) => {
|
|
|
|
|
+ this.$set(this.addForm.detailList[currentIndex], key, item[key]);
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$set(this.addForm.detailList[currentIndex], 'paramType', 7);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.addForm.detailList.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.substanceCode,
|
|
|
|
|
+ substanceName: item.substanceName,
|
|
|
|
|
+ // 1-成品统计,2-物料统计,3-工序统计"
|
|
|
|
|
+ statisticsType:
|
|
|
|
|
+ this.addForm.recordTemplateStyle == '4'
|
|
|
|
|
+ ? this.statisticsType
|
|
|
|
|
+ : null,
|
|
|
|
|
+ // 公式
|
|
|
|
|
+ formula: '',
|
|
|
|
|
+ _paramSelect: null,
|
|
|
|
|
+ _opSelect: null,
|
|
|
|
|
+ _replaceOrAppend: '',
|
|
|
|
|
+ formulaParts: [],
|
|
|
|
|
+ sortNum:
|
|
|
|
|
+ Math.max(
|
|
|
|
|
+ ...this.addForm.detailList.map((item) => item.sortNum || 0)
|
|
|
|
|
+ ) + 1
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 清空工具
|
|
|
|
|
+ clearTool(row, index) {
|
|
|
|
|
+ substanceKey.forEach((key) => {
|
|
|
|
|
+ this.$set(this.addForm.detailList[index], key, '');
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
// 选择物品 产品、物料等
|
|
// 选择物品 产品、物料等
|
|
|
selectChooseModalProduct(row) {
|
|
selectChooseModalProduct(row) {
|
|
|
this.currentRow = row;
|
|
this.currentRow = row;
|
|
@@ -1290,9 +1417,11 @@
|
|
|
row.tools = [];
|
|
row.tools = [];
|
|
|
},
|
|
},
|
|
|
deleteRow(time, row) {
|
|
deleteRow(time, row) {
|
|
|
- const index = this.addForm.findIndex((item) => item.id === row.id);
|
|
|
|
|
|
|
+ const index = this.addForm.detailList.findIndex(
|
|
|
|
|
+ (item) => item.id === row.id
|
|
|
|
|
+ );
|
|
|
if (index !== -1) {
|
|
if (index !== -1) {
|
|
|
- this.addForm.splice(index, 1);
|
|
|
|
|
|
|
+ this.addForm.detailList.splice(index, 1);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 负责人变更 同步执行人列表
|
|
// 负责人变更 同步执行人列表
|
|
@@ -1328,15 +1457,17 @@
|
|
|
this.addForm.productLineName = '';
|
|
this.addForm.productLineName = '';
|
|
|
this.addForm.productLineId = '';
|
|
this.addForm.productLineId = '';
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- this.productLineList = currentTeam.factoryWorkstationVOList.map(
|
|
|
|
|
- (item) => {
|
|
|
|
|
- return {
|
|
|
|
|
|
|
+ this.productLineList = [];
|
|
|
|
|
+ currentTeam.factoryWorkstationVOList.forEach((item) => {
|
|
|
|
|
+ if (
|
|
|
|
|
+ !this.productLineList.find((p) => p.id === item.productionLineId)
|
|
|
|
|
+ ) {
|
|
|
|
|
+ this.productLineList.push({
|
|
|
name: item.productionLineName,
|
|
name: item.productionLineName,
|
|
|
id: item.productionLineId
|
|
id: item.productionLineId
|
|
|
- };
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- );
|
|
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
// if (currentTeam) {
|
|
// if (currentTeam) {
|
|
|
// // 同步执行人
|
|
// // 同步执行人
|