|
|
@@ -27,7 +27,7 @@
|
|
|
clearable
|
|
|
readonly
|
|
|
v-model="form.code"
|
|
|
- @click.native="$refs.produceRef.open()"
|
|
|
+ @click.native="$refs.productListRef.open()"
|
|
|
placeholder="请选择"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
@@ -37,7 +37,7 @@
|
|
|
<el-input clearable disabled v-model="form.name" placeholder=" " />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <!-- <el-col :span="12">
|
|
|
<el-form-item label="BOM类型" prop="bomCategory">
|
|
|
<el-select
|
|
|
v-model="form.bomCategory"
|
|
|
@@ -105,7 +105,7 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
</el-row>
|
|
|
<headerTitle title="工位节拍"> </headerTitle>
|
|
|
<ele-pro-table
|
|
|
@@ -120,7 +120,7 @@
|
|
|
<template v-slot:toolbar>
|
|
|
<div style="display: flex">
|
|
|
<el-form-item label="工序名称" prop="operationId">
|
|
|
- <el-select
|
|
|
+ <!-- <el-select
|
|
|
v-model="form.operationId"
|
|
|
style="width: 230px"
|
|
|
v-if="form.produceRoutingId"
|
|
|
@@ -132,20 +132,18 @@
|
|
|
:value="item.sourceTaskId"
|
|
|
@click.native="changeOperationId(item)"
|
|
|
></el-option>
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
<el-input
|
|
|
- v-if="!form.produceRoutingId"
|
|
|
style="width: 230px"
|
|
|
readonly
|
|
|
:value="form.operationName"
|
|
|
placeholder=" "
|
|
|
/>
|
|
|
<el-button
|
|
|
- v-if="!form.produceRoutingId"
|
|
|
size="small"
|
|
|
type="primary"
|
|
|
style="margin-left: 10px"
|
|
|
- @click.native="taskinstanceDialogFlag = true"
|
|
|
+ @click.native="taskinstanceDialogOpen"
|
|
|
>选择
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
@@ -158,7 +156,7 @@
|
|
|
placeholder=" "
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label-width="0">
|
|
|
+ <!-- <el-form-item label-width="0">
|
|
|
<el-button
|
|
|
size="small"
|
|
|
type="primary"
|
|
|
@@ -166,7 +164,7 @@
|
|
|
@click.native="$refs.stationBeatDialogRef.open()"
|
|
|
>新增工位
|
|
|
</el-button>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-slot:stationCycleTime="{ row, $index }">
|
|
|
@@ -215,10 +213,10 @@
|
|
|
|
|
|
<el-button @click="cancel">返回</el-button>
|
|
|
</div>
|
|
|
- <ProductModal
|
|
|
- ref="produceRef"
|
|
|
+ <productList
|
|
|
+ ref="productListRef"
|
|
|
@changeParent="produceConfirm"
|
|
|
- ></ProductModal>
|
|
|
+ ></productList>
|
|
|
<taskinstanceDialog
|
|
|
ref="taskinstanceDialogRef"
|
|
|
v-if="taskinstanceDialogFlag"
|
|
|
@@ -253,7 +251,8 @@
|
|
|
list: [] //表格数据
|
|
|
};
|
|
|
import { getFactoryarea } from '@/api/factoryModel';
|
|
|
- import ProductModal from '@/components/productList/product-list.vue';
|
|
|
+ import productList from '@/components/productList/product-list.vue';
|
|
|
+
|
|
|
import taskinstanceDialog from '@/components/procedure/taskinstanceDialog.vue';
|
|
|
import stationBeatDialog from '@/views/factoryModel/station/components/stationBeatDialog.vue';
|
|
|
import {
|
|
|
@@ -266,7 +265,11 @@
|
|
|
selectFactoryWorkstation
|
|
|
} from '@/api/productionScheduling/stationBeat';
|
|
|
export default {
|
|
|
- components: { ProductModal, taskinstanceDialog, stationBeatDialog },
|
|
|
+ components: {
|
|
|
+ productList,
|
|
|
+ taskinstanceDialog,
|
|
|
+ stationBeatDialog
|
|
|
+ },
|
|
|
computed: {},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -293,9 +296,9 @@
|
|
|
// ],
|
|
|
code: [{ required: true, message: '编码不能为空', trigger: 'change' }]
|
|
|
},
|
|
|
- factoryList: [],
|
|
|
+ // factoryList: [],
|
|
|
selection: [],
|
|
|
- productionLineList: [],
|
|
|
+ // productionLineList: [],
|
|
|
columns: [
|
|
|
{
|
|
|
width: 60,
|
|
|
@@ -381,12 +384,12 @@
|
|
|
},
|
|
|
computed: {
|
|
|
cycleTime() {
|
|
|
+ let num = this.form.list.length;
|
|
|
let cycleTime = this.form.list.reduce((pre, cur) => {
|
|
|
return pre + Number(cur.stationCycleTime);
|
|
|
}, 0);
|
|
|
- this.form.cycleTime =
|
|
|
- cycleTime / this.form.list.length / this.form.list.length;
|
|
|
- return cycleTime / this.form.list.length / this.form.list.length || 0;
|
|
|
+ this.form.cycleTime = Math.ceil(cycleTime / num / num)||0;
|
|
|
+ return this.form.cycleTime;
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -401,12 +404,12 @@
|
|
|
this.form.list.forEach((item, index) => {
|
|
|
item.key = index;
|
|
|
});
|
|
|
- this.getBomInfo(this.form.productId);
|
|
|
- this.changeProductType('init');
|
|
|
+ // this.getBomInfo(this.form.productId);
|
|
|
+ // this.changeProductType('init');
|
|
|
|
|
|
- if (this.form.factoriesId) {
|
|
|
- this.change_factoryId({ id: this.form.factoriesId });
|
|
|
- }
|
|
|
+ // if (this.form.factoriesId) {
|
|
|
+ // this.change_factoryId({ id: this.form.factoriesId });
|
|
|
+ // }
|
|
|
}
|
|
|
},
|
|
|
handParent() {
|
|
|
@@ -427,20 +430,28 @@
|
|
|
});
|
|
|
this.factoryList = list || [];
|
|
|
},
|
|
|
- async change_factoryId(item) {
|
|
|
- const { list } = await getFactoryarea({
|
|
|
- pageNum: 1,
|
|
|
- size: 999,
|
|
|
- type: 4,
|
|
|
- factoryId: item.id,
|
|
|
- enable: 1
|
|
|
+ taskinstanceDialogOpen() {
|
|
|
+ this.taskinstanceDialogFlag = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.taskinstanceDialogRef.open({
|
|
|
+ productId: this.form.productId
|
|
|
+ });
|
|
|
});
|
|
|
- this.productionLineList = list || [];
|
|
|
- this.form.factoriesName = item.name;
|
|
|
- },
|
|
|
- change_productionLineId(item, index) {
|
|
|
- this.$set(this.form.list[index], 'productionLineName', item.name);
|
|
|
},
|
|
|
+ // async change_factoryId(item) {
|
|
|
+ // const { list } = await getFactoryarea({
|
|
|
+ // pageNum: 1,
|
|
|
+ // size: 999,
|
|
|
+ // type: 4,
|
|
|
+ // factoryId: item.id,
|
|
|
+ // enable: 1
|
|
|
+ // });
|
|
|
+ // this.productionLineList = list || [];
|
|
|
+ // this.form.factoriesName = item.name;
|
|
|
+ // },
|
|
|
+ // change_productionLineId(item, index) {
|
|
|
+ // this.$set(this.form.list[index], 'productionLineName', item.name);
|
|
|
+ // },
|
|
|
produceConfirm(data) {
|
|
|
this.form.name = data[0].name;
|
|
|
this.form.code = data[0].code;
|
|
|
@@ -448,91 +459,91 @@
|
|
|
this.form.brandNo = data[0].brandNum;
|
|
|
this.form.modelType = data[0].modelType;
|
|
|
this.form.specification = data[0].specification;
|
|
|
- this.produceCancel();
|
|
|
- this.getBomInfo(data[0].id);
|
|
|
- },
|
|
|
- produceCancel() {
|
|
|
- this.form.bomCategory = '';
|
|
|
- this.bomCategoryList = [];
|
|
|
- this.form.bomVersion = '';
|
|
|
- this.form.bomId = '';
|
|
|
- this.bomVersionList = [];
|
|
|
- this.routingList = [];
|
|
|
- this.form.produceRoutingId = '';
|
|
|
- this.form.produceRoutingName = '';
|
|
|
- this.produceRoutingList = [];
|
|
|
- this.form.operationId = '';
|
|
|
- this.form.operationName = '';
|
|
|
- this.taskList = [];
|
|
|
- this.form.list = [];
|
|
|
+ // this.produceCancel();
|
|
|
+ // this.getBomInfo(data[0].id);
|
|
|
},
|
|
|
+ // produceCancel() {
|
|
|
+ // this.form.bomCategory = '';
|
|
|
+ // this.bomCategoryList = [];
|
|
|
+ // this.form.bomVersion = '';
|
|
|
+ // this.form.bomId = '';
|
|
|
+ // this.bomVersionList = [];
|
|
|
+ // this.routingList = [];
|
|
|
+ // this.form.produceRoutingId = '';
|
|
|
+ // this.form.produceRoutingName = '';
|
|
|
+ // this.produceRoutingList = [];
|
|
|
+ // this.form.operationId = '';
|
|
|
+ // this.form.operationName = '';
|
|
|
+ // this.taskList = [];
|
|
|
+ // this.form.list = [];
|
|
|
+ // },
|
|
|
|
|
|
// 获取bom信息
|
|
|
- async getBomInfo(id) {
|
|
|
- const res = await listBomType({ categoryId: id });
|
|
|
- if (!res || res.length == 0) return;
|
|
|
- let bomMap = {
|
|
|
- 2: { code: '2', name: 'MBOM' },
|
|
|
- 3: { code: '3', name: 'ABOM' }
|
|
|
- };
|
|
|
- let arr = [];
|
|
|
- res.map((item) => {
|
|
|
- if (bomMap[item.bomType]) {
|
|
|
- arr.push(bomMap[item.bomType]);
|
|
|
- }
|
|
|
- });
|
|
|
- this.bomCategoryList = arr;
|
|
|
- },
|
|
|
+ // async getBomInfo(id) {
|
|
|
+ // const res = await listBomType({ categoryId: id });
|
|
|
+ // if (!res || res.length == 0) return;
|
|
|
+ // let bomMap = {
|
|
|
+ // 2: { code: '2', name: 'MBOM' },
|
|
|
+ // 3: { code: '3', name: 'ABOM' }
|
|
|
+ // };
|
|
|
+ // let arr = [];
|
|
|
+ // res.map((item) => {
|
|
|
+ // if (bomMap[item.bomType]) {
|
|
|
+ // arr.push(bomMap[item.bomType]);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // this.bomCategoryList = arr;
|
|
|
+ // },
|
|
|
|
|
|
// 根据bom类型和产品id获取bom版本
|
|
|
- async changeProductType(type) {
|
|
|
- let data = await bomListByPlan({
|
|
|
- bomType: this.form.bomCategory,
|
|
|
- categoryId: this.form.productId
|
|
|
- });
|
|
|
- this.bomVersionList = data;
|
|
|
- if (data.length) {
|
|
|
- if (type != 'init') {
|
|
|
- this.form.bomId = data[0].id;
|
|
|
- this.form.bomVersion = data[0].versions;
|
|
|
- }
|
|
|
- this.changeBomId(type);
|
|
|
- }
|
|
|
- },
|
|
|
- async changeBomId(type) {
|
|
|
- const res = await bomRoutingList(this.form.bomId);
|
|
|
- let arr = res || [];
|
|
|
- this.routingList = arr;
|
|
|
- if (type != 'init') {
|
|
|
- this.form.bomVersion = this.bomVersionList.find(
|
|
|
- (item) => item.id == this.form.bomId
|
|
|
- )?.versions;
|
|
|
- this.taskList = [];
|
|
|
- this.form.produceRoutingId = '';
|
|
|
- this.form.produceRoutingName = '';
|
|
|
- this.form.operationName = '';
|
|
|
- this.form.operationId = '';
|
|
|
- this.form.list = [];
|
|
|
- }
|
|
|
+ // async changeProductType(type) {
|
|
|
+ // let data = await bomListByPlan({
|
|
|
+ // bomType: this.form.bomCategory,
|
|
|
+ // categoryId: this.form.productId
|
|
|
+ // });
|
|
|
+ // this.bomVersionList = data;
|
|
|
+ // if (data.length) {
|
|
|
+ // if (type != 'init') {
|
|
|
+ // this.form.bomId = data[0].id;
|
|
|
+ // this.form.bomVersion = data[0].versions;
|
|
|
+ // }
|
|
|
+ // this.changeBomId(type);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // async changeBomId(type) {
|
|
|
+ // const res = await bomRoutingList(this.form.bomId);
|
|
|
+ // let arr = res || [];
|
|
|
+ // this.routingList = arr;
|
|
|
+ // if (type != 'init') {
|
|
|
+ // this.form.bomVersion = this.bomVersionList.find(
|
|
|
+ // (item) => item.id == this.form.bomId
|
|
|
+ // )?.versions;
|
|
|
+ // this.taskList = [];
|
|
|
+ // this.form.produceRoutingId = '';
|
|
|
+ // this.form.produceRoutingName = '';
|
|
|
+ // this.form.operationName = '';
|
|
|
+ // this.form.operationId = '';
|
|
|
+ // this.form.list = [];
|
|
|
+ // }
|
|
|
|
|
|
- if (arr.length) {
|
|
|
- if (type != 'init') {
|
|
|
- this.form.produceRoutingId = arr[0].id;
|
|
|
- this.form.produceRoutingName = arr[0].name;
|
|
|
- }
|
|
|
- this.changeRoutingList(type);
|
|
|
- }
|
|
|
- },
|
|
|
- async changeRoutingList(type) {
|
|
|
- const res = await listByRoutingIds([this.form.produceRoutingId]);
|
|
|
- let arr = res || [];
|
|
|
- this.taskList = arr;
|
|
|
- if (type != 'init') {
|
|
|
- this.form.operationName = '';
|
|
|
- this.form.operationId = '';
|
|
|
- this.form.list = [];
|
|
|
- }
|
|
|
- },
|
|
|
+ // if (arr.length) {
|
|
|
+ // if (type != 'init') {
|
|
|
+ // this.form.produceRoutingId = arr[0].id;
|
|
|
+ // this.form.produceRoutingName = arr[0].name;
|
|
|
+ // }
|
|
|
+ // this.changeRoutingList(type);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // async changeRoutingList(type) {
|
|
|
+ // const res = await listByRoutingIds([this.form.produceRoutingId]);
|
|
|
+ // let arr = res || [];
|
|
|
+ // this.taskList = arr;
|
|
|
+ // if (type != 'init') {
|
|
|
+ // this.form.operationName = '';
|
|
|
+ // this.form.operationId = '';
|
|
|
+ // this.form.list = [];
|
|
|
+ // }
|
|
|
+ // },
|
|
|
async changeOperationId(item) {
|
|
|
this.form.operationName = item.name;
|
|
|
this.form.operationId = item.sourceTaskId || item.id;
|