工作中心

master
A0010407 1 year ago
parent a159f56ab5
commit 9a28d79c98

@ -86,3 +86,11 @@ export function listFactory(query) {
params: query
});
}
// 查询工作中心
export function getWorkCenterList() {
return request({
url: '/technology/pro/process/getWorkCenterList',
method: 'get'
});
}

@ -42,3 +42,11 @@ export function delFactory(factoryId) {
method: 'delete'
});
}
// 查询工作中心
export function getWorkCenterList() {
return request({
url: '/wms/factory/getWorkCenterList',
method: 'get'
});
}

@ -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>

@ -17,6 +17,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备类型编码" prop="equipmentTypeCode">
<el-input
v-model="queryParams.equipmentTypeCode"
placeholder="请输入设备类型编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -92,8 +100,8 @@
<el-table-column label="规格型号" align="center" prop="equipmentSpec" />
<el-table-column label="设备类型编码" align="center" prop="equipmentTypeCode" width="120" />
<el-table-column label="设备类型名称" align="center" prop="equipmentTypeName" width="120"/>
<el-table-column label="所属车间编码" align="center" prop="workshopCode" width="120"/>
<el-table-column label="所属车间名称" align="center" prop="workshopName" width="120"/>
<el-table-column label="所属工作中心编码" align="center" prop="workshopCode" width="150"/>
<el-table-column label="所属工作中心名称" align="center" prop="workshopName" width="150"/>
<el-table-column label="设备状态" align="center" prop="status">
<template slot-scope="scope">
{{ scope.row.status == 1 ? "正常" : "停用" }}
@ -167,13 +175,22 @@
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="12">
<el-form-item label="所属车间编码" prop="workshopCode">
<el-input v-model="form.workshopCode" placeholder="请输入所属车间编码" />
</el-form-item>
<el-form-item label="所属工作中心" prop="workCenter">
<template>
<el-select v-model="form.workCenter" filterable placeholder="请选择" @change="selectWorkCenter" style="width:355px">
<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-col :span="12">
<el-form-item label="所属车间名称" prop="workshopName">
<el-input v-model="form.workshopName" placeholder="请输入所属车间名称" />
<el-form-item label="工作中心编码" prop="workshopCode">
<el-input v-model="form.workshopCode" placeholder="请输入所属车间编码" />
</el-form-item>
</el-col>
</el-row>
@ -216,12 +233,16 @@
</template>
<script>
import { listEquipment, getEquipment, delEquipment, addEquipment, updateEquipment } from "@/api/wms/equipment";
import { listEquipment, getEquipment, delEquipment, addEquipment, updateEquipment} from "@/api/wms/equipment";
import { getWorkCenterList,listFactory} from "@/api/wms/factory";
export default {
name: "Equipment",
dicts: ['sys_normal_disable', 'equ_type'],
data() {
return {
workCenter:[],
options1: [],
value: '',
//
loading: true,
//
@ -288,6 +309,9 @@ export default {
this.getList();
},
methods: {
selectWorkCenter(){
this.form.workshopCode = this.form.workCenter;
},
//
indexMethod(index){
return index+1 ;
@ -356,15 +380,24 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
getWorkCenterList().then(response =>{
this.options1 = response.rows;
console.log(this.options1);
});
this.open = true;
this.title = "添加设备管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const equipmentId = row.equipmentId || this.ids
const equipmentId = row.equipmentId || this.ids;
getWorkCenterList().then(response =>{
this.options1 = response.rows;
console.log(this.options1);
});
getEquipment(equipmentId).then(response => {
this.form = response.data;
this.form.workCenter = this.form.workshopCode;
this.open = true;
this.title = "修改设备管理";
});

Loading…
Cancel
Save