|
|
|
@ -188,6 +188,29 @@
|
|
|
|
|
<el-input-number :min="0" :step="1" v-model="form.workTime" placeholder="请输入工作时长" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="工作中心" prop="workCenter" style="width:310px">
|
|
|
|
|
<!-- <el-cascader
|
|
|
|
|
:show-all-levels="false"
|
|
|
|
|
:options="factoryOptions"
|
|
|
|
|
:props = "{checkStrictly: true , label:'factoryName',value:'factoryId',children:'children' }"
|
|
|
|
|
v-model="form.workCenter"
|
|
|
|
|
placeholder="请选择工作中心"
|
|
|
|
|
clearable
|
|
|
|
|
style="width:400px"
|
|
|
|
|
></el-cascader> -->
|
|
|
|
|
<template>
|
|
|
|
|
<el-select v-model="form.workCenter" filterable placeholder="请选择" @change="selectWorkCenter" >
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in options1"
|
|
|
|
|
:key="item.factoryCode"
|
|
|
|
|
:label="item.factoryName"
|
|
|
|
|
:value="item.factoryCode">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
@ -217,20 +240,6 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="工作中心" prop="workCenter">
|
|
|
|
|
<el-cascader
|
|
|
|
|
:options="factoryOptions"
|
|
|
|
|
:props="workCenter"
|
|
|
|
|
v-model="form.workCenter"
|
|
|
|
|
placeholder="请选择工作中心"
|
|
|
|
|
clearable
|
|
|
|
|
style="width:400px"
|
|
|
|
|
></el-cascader>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- <el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="参数1温度" prop="param1">
|
|
|
|
@ -282,7 +291,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listProcess, getProcess, delProcess, addProcess, updateProcess ,listEquipment,getEquipment,listFactory} from "@/api/technology/process";
|
|
|
|
|
import { listProcess, getProcess, delProcess, addProcess, updateProcess ,listEquipment,getEquipment,listFactory,getWorkCenterList} from "@/api/technology/process";
|
|
|
|
|
import Processcontent from "./content.vue";
|
|
|
|
|
import ItemSelect from "./single.vue";
|
|
|
|
|
import { Message } from 'element-ui'
|
|
|
|
@ -295,7 +304,9 @@ export default {
|
|
|
|
|
components: {Processcontent,ItemSelect},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
workCenter: { multiple: true,label:'factoryName',value:'factoryId',children:'children' },
|
|
|
|
|
workCenter:[],
|
|
|
|
|
options1: [],
|
|
|
|
|
// workCenter: { multiple: true,checkStrictly: true , label:'factoryName',value:'factoryId',children:'children' },
|
|
|
|
|
checkEquipment:null,
|
|
|
|
|
//自动生成编码
|
|
|
|
|
autoGenFlag:false,
|
|
|
|
@ -332,7 +343,9 @@ export default {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
processCode: null,
|
|
|
|
|
processName: null,
|
|
|
|
|
enableFlag: null,
|
|
|
|
|
enableFlag: null
|
|
|
|
|
// workCenter: null
|
|
|
|
|
// factoryCode: null
|
|
|
|
|
},
|
|
|
|
|
queryEquipmentParams: {
|
|
|
|
|
equipmentTypeName :null,
|
|
|
|
@ -366,6 +379,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
fileList:[],
|
|
|
|
|
equipmentId:'',
|
|
|
|
|
options: null,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -374,12 +388,18 @@ export default {
|
|
|
|
|
this.getTreeselect();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
selectWorkCenter(){
|
|
|
|
|
this.form.workshopCode = this.form.workCenter;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
activated(){
|
|
|
|
|
this.useTypeKey +=1
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleEquipmentSelectionChange (val) {
|
|
|
|
|
this.equipmentList = val
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//中山榄菊日化实业有限公司 A001
|
|
|
|
|
getTreeselect() {
|
|
|
|
|
listFactory().then(response => {
|
|
|
|
@ -389,6 +409,7 @@ export default {
|
|
|
|
|
this.factoryOptions.push(data);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 查询物料信息列表 */
|
|
|
|
|
getEquipmentList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
@ -400,10 +421,10 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 筛选节点
|
|
|
|
|
filterNode(value, data) {
|
|
|
|
|
if (!value) return true;
|
|
|
|
|
return data.label.indexOf(value) !== -1;
|
|
|
|
|
},
|
|
|
|
|
// filterNode(value, data) {
|
|
|
|
|
// if (!value) return true;
|
|
|
|
|
// return data.label.indexOf(value) !== -1;
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
// 节点单击事件
|
|
|
|
|
handleNodeClick(data) {
|
|
|
|
@ -507,6 +528,10 @@ export default {
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.reset();
|
|
|
|
|
getWorkCenterList().then(response =>{
|
|
|
|
|
this.options1 = response.rows;
|
|
|
|
|
console.log(this.options1);
|
|
|
|
|
});
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加生产工序";
|
|
|
|
|
this.optType = "add";
|
|
|
|
@ -533,8 +558,14 @@ export default {
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
const processId = row.processId || this.ids
|
|
|
|
|
getWorkCenterList().then(response =>{
|
|
|
|
|
this.options1 = response.rows;
|
|
|
|
|
console.log(this.options1);
|
|
|
|
|
});
|
|
|
|
|
getProcess(processId).then(response => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
// console.log(this.form.workCenter);
|
|
|
|
|
// this.form.workCenter = this.form.workCenter.split(',');
|
|
|
|
|
if(response.data.files != null){
|
|
|
|
|
var newFiles = [];
|
|
|
|
|
response.data.files.forEach(item =>{
|
|
|
|
@ -553,9 +584,10 @@ export default {
|
|
|
|
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
if(Array.isArray(this.form.fileList)){
|
|
|
|
|
this.form.fileList = this.listToString(this.form.fileList);
|
|
|
|
|
}
|
|
|
|
|
// console.log('workCENTER',this.form.workCenter);
|
|
|
|
|
// this.work = JSON.stringify(this.form.workCenter);
|
|
|
|
|
// this.form.workCenter = JSON.stringify(this.form.workCenter);
|
|
|
|
|
// console.log('2',this.form.workCenter);
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.processId != null) {
|
|
|
|
@ -575,18 +607,6 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
submitEquipmentForm() {
|
|
|
|
|
const table = this.$refs.myTable;
|
|
|
|
|
const data = table.data;
|
|
|
|
|
console.log(data);
|
|
|
|
|
for (const one of data) {
|
|
|
|
|
const equipmentCode = one.equipmentCode;
|
|
|
|
|
this.form.workCenter = this.form.workCenter + ','+ equipmentCode;
|
|
|
|
|
this.boundeEuipmentOpen = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const processIds = row.processId || this.ids;
|
|
|
|
@ -637,11 +657,17 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//新增 设备选择弹出框
|
|
|
|
|
handleSelectEquipment(){
|
|
|
|
|
this.$refs.itemSelect.showFlag = true;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// workCenterList(){
|
|
|
|
|
// console.log(查询workCenterList);
|
|
|
|
|
// getWorkCenterList().then(data => {
|
|
|
|
|
// this.options = data;
|
|
|
|
|
// });
|
|
|
|
|
// this.form.workCenter = this.options[0].factoryCode;
|
|
|
|
|
// },
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|