|
|
@@ -165,6 +165,28 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
+ <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
+ <el-form-item label="首工序班组:" prop="teamId">
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.teamId"
|
|
|
+ placeholder="请选择首工序班组"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ :disabled="!form.produceRoutingId"
|
|
|
+ :loading="firstTaskTeamLoading"
|
|
|
+ @change="teamChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in firstTaskTeamList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="紧急程度:">
|
|
|
<el-select
|
|
|
@@ -210,7 +232,11 @@
|
|
|
|
|
|
<script>
|
|
|
import ProcessRoute from '@/components/selectionDialog/processRoute.vue';
|
|
|
- import { getFactoryList, createProductionOrder } from '@/api/beEntrusted';
|
|
|
+ import {
|
|
|
+ getFactoryList,
|
|
|
+ createProductionOrder,
|
|
|
+ listFirstTaskTeam
|
|
|
+ } from '@/api/beEntrusted';
|
|
|
import { getByCode } from '@/api/system/dictionary-data';
|
|
|
import { routeList } from '@/api/aps';
|
|
|
import dayjs from 'dayjs';
|
|
|
@@ -251,6 +277,8 @@
|
|
|
brandNo: '',
|
|
|
produceRoutingId: '',
|
|
|
produceRoutingName: '',
|
|
|
+ teamId: '',
|
|
|
+ teamName: '',
|
|
|
sourceId: '',
|
|
|
sourceCode: '',
|
|
|
priority: '',
|
|
|
@@ -261,6 +289,9 @@
|
|
|
rules: {
|
|
|
produceRoutingName: [
|
|
|
{ required: true, message: '请选择工艺路线', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ teamId: [
|
|
|
+ { required: true, message: '请选择首工序班组', trigger: 'change' }
|
|
|
]
|
|
|
},
|
|
|
|
|
|
@@ -277,6 +308,8 @@
|
|
|
|
|
|
routingList: [],
|
|
|
factoryList: [],
|
|
|
+ firstTaskTeamList: [],
|
|
|
+ firstTaskTeamLoading: false,
|
|
|
|
|
|
title: '受托转生产订单',
|
|
|
pickerOptions: {
|
|
|
@@ -393,6 +426,8 @@
|
|
|
row[0].bomType = '';
|
|
|
row[0].produceRoutingId = '';
|
|
|
row[0].produceRoutingName = '';
|
|
|
+ row[0].teamId = '';
|
|
|
+ row[0].teamName = '';
|
|
|
|
|
|
this.form = this.deepCopy(row[0]);
|
|
|
this.form.productCode = this.form.categoryCode;
|
|
|
@@ -400,7 +435,6 @@
|
|
|
this.form.model = this.form.modelType;
|
|
|
this.form.brandNo = this.form.brandNum;
|
|
|
this.form.contractNum = this.form.totalCount;
|
|
|
- this.form.measuringUnit = this.form.measuringUnit;
|
|
|
this.form.sourceCode = this.form.code;
|
|
|
this.form.sourceId = this.form.id;
|
|
|
this.form.formingWeight = this.form.totalWeight;
|
|
|
@@ -452,10 +486,13 @@
|
|
|
brandNo: '',
|
|
|
produceRoutingId: '',
|
|
|
produceRoutingName: '',
|
|
|
+ teamId: '',
|
|
|
+ teamName: '',
|
|
|
sourceId: '',
|
|
|
sourceCode: '',
|
|
|
priority: ''
|
|
|
};
|
|
|
+ this.firstTaskTeamList = [];
|
|
|
this.$refs.form.clearValidate();
|
|
|
this.visible = false;
|
|
|
},
|
|
|
@@ -475,10 +512,14 @@
|
|
|
// (item) => item.id === this.form.produceRoutingId
|
|
|
// )?.name;
|
|
|
|
|
|
- this.form.planDeliveryTime = this.form.planDeliveryTime.split(' ')[0];
|
|
|
+ this.form.planDeliveryTime = this.form.planDeliveryTime
|
|
|
+ ? String(this.form.planDeliveryTime).split(' ')[0]
|
|
|
+ : '';
|
|
|
|
|
|
let params = {
|
|
|
...this.form,
|
|
|
+ teamId: this.form.teamId,
|
|
|
+ teamName: this.form.teamName,
|
|
|
sourceType: 3
|
|
|
};
|
|
|
|
|
|
@@ -511,10 +552,40 @@
|
|
|
this.$refs.processRouteRef.open();
|
|
|
},
|
|
|
|
|
|
+ async getFirstTaskTeamList(routingId) {
|
|
|
+ this.firstTaskTeamLoading = true;
|
|
|
+ try {
|
|
|
+ const list = await listFirstTaskTeam(routingId);
|
|
|
+ if (String(this.form.produceRoutingId) !== String(routingId)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.firstTaskTeamList = Array.isArray(list) ? list : [];
|
|
|
+ if (!this.firstTaskTeamList.length) {
|
|
|
+ this.$message.warning('当前工艺路线未配置首工序班组');
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ this.firstTaskTeamList = [];
|
|
|
+ // this.$message.error(err.message);
|
|
|
+ } finally {
|
|
|
+ this.firstTaskTeamLoading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ teamChange(teamId) {
|
|
|
+ const team = this.firstTaskTeamList.find(
|
|
|
+ (item) => String(item.id) === String(teamId)
|
|
|
+ );
|
|
|
+ this.form.teamName = team ? team.name : '';
|
|
|
+ },
|
|
|
+
|
|
|
// 选择工艺路线
|
|
|
changeParent(item) {
|
|
|
this.form.produceRoutingName = item.name;
|
|
|
this.form.produceRoutingId = item.id;
|
|
|
+ this.form.teamId = '';
|
|
|
+ this.form.teamName = '';
|
|
|
+ this.firstTaskTeamList = [];
|
|
|
+ this.getFirstTaskTeamList(item.id);
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.form.clearValidate('produceRoutingName');
|