|
|
@@ -38,17 +38,17 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
|
|
|
+ <!-- <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
|
|
|
<el-form-item label="编码:" prop="code">
|
|
|
<el-input v-model="form.code" disabled />
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
<el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
|
|
|
<el-form-item label="名称:" prop="name">
|
|
|
<el-input v-model="form.name" :disabled="type == 'detail'" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
|
|
|
+ <!-- <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
|
|
|
<el-form-item label="生产工单:" prop="workOrderCode">
|
|
|
<el-input
|
|
|
v-model="form.workOrderCode"
|
|
|
@@ -60,8 +60,8 @@
|
|
|
>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
|
|
|
+ </el-col> -->
|
|
|
+ <!-- <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
|
|
|
<el-form-item label="工序:" prop="procedureList">
|
|
|
<el-select
|
|
|
style="width: 100%"
|
|
|
@@ -80,7 +80,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="请托部门:" prop="pleaseEntrustDeptId">
|
|
|
<el-input v-model="form.pleaseEntrustDeptName" clearable disabled>
|
|
|
@@ -132,7 +132,7 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <!-- <el-col :span="8">
|
|
|
<el-form-item label="完成时间:" prop="finishTime">
|
|
|
<el-date-picker
|
|
|
v-model="form.finishTime"
|
|
|
@@ -142,9 +142,9 @@
|
|
|
:disabled="type == 'detail'"
|
|
|
></el-date-picker>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 24, md: 24 } : { span: 24 }">
|
|
|
+ </el-col> -->
|
|
|
+
|
|
|
+ <!-- <el-col v-bind="styleResponsive ? { lg: 24, md: 24 } : { span: 24 }">
|
|
|
<el-form-item label="需求描述:">
|
|
|
<el-input
|
|
|
v-model="form.describes"
|
|
|
@@ -153,14 +153,63 @@
|
|
|
:disabled="type == 'detail'"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
<!-- <el-col :span="8">
|
|
|
s
|
|
|
</el-col> -->
|
|
|
</el-row>
|
|
|
<headerTitle title="产品信息" style="margin-top: 15px"></headerTitle>
|
|
|
|
|
|
- <el-table :data="form.pleaseEntrustObjList" border height="40vh">
|
|
|
+ <ele-pro-table
|
|
|
+ ref="entrustCreateTable"
|
|
|
+ :columns="columns"
|
|
|
+ :datasource="orderList"
|
|
|
+ :selection.sync="selection"
|
|
|
+ :current.sync="current"
|
|
|
+ highlight-current-row
|
|
|
+ row-key="id"
|
|
|
+ height="40vh"
|
|
|
+ >
|
|
|
+ <template v-slot:totalCount="{ row }">
|
|
|
+ <el-input v-model="row.totalCount"> </el-input>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:describes="{ row }">
|
|
|
+ <el-input v-model="row.describes"> </el-input>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:taskId="{ row, $index }">
|
|
|
+ <el-select
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="row.taskId"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="taskListChange(row, $index)"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in row.taskList"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ :key="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:planDeliveryTime="{ row }">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="row.planDeliveryTime"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择日期时间"
|
|
|
+ format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+
|
|
|
+ <!-- <el-table :data="orderList" border height="40vh">
|
|
|
<el-table-column label="序号" align="center" width="60">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.$index + 1 }}</span>
|
|
|
@@ -175,8 +224,6 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="批号" align="center" prop="batchNo">
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column label="型号" align="center" prop="model">
|
|
|
- </el-table-column> -->
|
|
|
<el-table-column label="规格" align="center" prop="specification">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="数量" align="center" prop="productNumber">
|
|
|
@@ -231,7 +278,7 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- </el-table>
|
|
|
+ </el-table> -->
|
|
|
</el-form>
|
|
|
|
|
|
<produceOrder ref="produceOrderRef" @choose="choose" />
|
|
|
@@ -239,186 +286,463 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import produceOrder from './produceOrder';
|
|
|
-import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
-import { getProduceTaskList } from '@/api/mes';
|
|
|
-import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
|
|
|
-import { details } from '@/api/bpm/components/entrust';
|
|
|
+ import produceOrder from './produceOrder';
|
|
|
+ import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
+ import { getProduceTaskList } from '@/api/mes';
|
|
|
+ import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
|
|
|
+ import { details } from '@/api/bpm/components/entrust';
|
|
|
|
|
|
-const defaultForm = function () {
|
|
|
- return {
|
|
|
- createTime: '', //创建时间
|
|
|
- code: '', //编码
|
|
|
- name: '', //名称
|
|
|
- workOrderCode: '', //工单编码
|
|
|
- pleaseEntrustUserId: '', //请托人id
|
|
|
- pleaseEntrustUserName: '', //请托人名称
|
|
|
- pleaseEntrustDeptId: '', //请托人部门id
|
|
|
- pleaseEntrustDeptName: '', //请托人部门名称
|
|
|
- beEntrustedDeptId: '', //受托人部门id.
|
|
|
- beEntrustedDeptName: '', //受托人部门名称
|
|
|
- produceRoutingId: null,
|
|
|
- produceRoutingName: '',
|
|
|
- procedureList: [],
|
|
|
- pleaseEntrustObjList: [], //具体请托对象
|
|
|
- type: '', //类型
|
|
|
- status: '',
|
|
|
- describes: '', //描述
|
|
|
- finishTime: '', //完成时间
|
|
|
- processInstanceId: '', //流程实例id
|
|
|
- factoriesName: '',
|
|
|
- factoriesId: '',
|
|
|
- priority: '',
|
|
|
- beEntrustedFactoriesId: '', //受托工厂id
|
|
|
- beEntrustedFactoriesName: '' //受托工厂名称
|
|
|
- };
|
|
|
-};
|
|
|
-export default {
|
|
|
- components: { produceOrder, deptSelect },
|
|
|
- data() {
|
|
|
+ const defaultForm = function () {
|
|
|
return {
|
|
|
- loading: false,
|
|
|
- form: { ...defaultForm() },
|
|
|
- options: [
|
|
|
- {
|
|
|
- name: '一般',
|
|
|
- value: 1
|
|
|
- },
|
|
|
- {
|
|
|
- name: '紧急',
|
|
|
- value: 2
|
|
|
- }
|
|
|
- ],
|
|
|
- // 表单验证规则
|
|
|
- rules: {
|
|
|
- type: [{ required: true, message: '请选择', trigger: 'change' }],
|
|
|
- name: [{ required: true, message: '请输入', trigger: 'change' }],
|
|
|
-
|
|
|
- workOrderCode: [
|
|
|
- { required: true, message: '请选择', trigger: 'change' }
|
|
|
+ createTime: '', //创建时间
|
|
|
+ code: '', //编码
|
|
|
+ name: '', //名称
|
|
|
+ workOrderCode: '', //工单编码
|
|
|
+ pleaseEntrustUserId: '', //请托人id
|
|
|
+ pleaseEntrustUserName: '', //请托人名称
|
|
|
+ pleaseEntrustDeptId: '', //请托人部门id
|
|
|
+ pleaseEntrustDeptName: '', //请托人部门名称
|
|
|
+ beEntrustedDeptId: '', //受托人部门id.
|
|
|
+ beEntrustedDeptName: '', //受托人部门名称
|
|
|
+ produceRoutingId: null,
|
|
|
+ produceRoutingName: '',
|
|
|
+ procedureList: [],
|
|
|
+ pleaseEntrustObjList: [], //具体请托对象
|
|
|
+ type: '', //类型
|
|
|
+ status: '',
|
|
|
+ describes: '', //描述
|
|
|
+ finishTime: '', //完成时间
|
|
|
+ processInstanceId: '', //流程实例id
|
|
|
+ factoriesName: '',
|
|
|
+ factoriesId: '',
|
|
|
+ priority: '',
|
|
|
+ beEntrustedFactoriesId: '', //受托工厂id
|
|
|
+ beEntrustedFactoriesName: '' //受托工厂名称
|
|
|
+ };
|
|
|
+ };
|
|
|
+ export default {
|
|
|
+ components: { produceOrder, deptSelect },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ form: { ...defaultForm() },
|
|
|
+ planType: [
|
|
|
+ { label: '所有计划类型', value: null },
|
|
|
+ { label: '内销计划', value: '1' },
|
|
|
+ { label: '外销计划', value: '2' },
|
|
|
+ { label: '预制计划', value: '3' }
|
|
|
],
|
|
|
- beEntrustedDeptId: [
|
|
|
- { required: true, message: '请选择', trigger: 'change' }
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ name: '一般',
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '紧急',
|
|
|
+ value: 2
|
|
|
+ }
|
|
|
],
|
|
|
- finishTime: [{ required: true, message: '请选择', trigger: 'change' }]
|
|
|
- },
|
|
|
- type: '',
|
|
|
- produceTaskList: [],
|
|
|
- factoryList: []
|
|
|
- };
|
|
|
- },
|
|
|
- props: {
|
|
|
- businessId: {
|
|
|
- default: ''
|
|
|
- },
|
|
|
- taskDefinitionKey: {
|
|
|
- default: ''
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- // 是否开启响应式布局
|
|
|
- styleResponsive() {
|
|
|
- return this.$store.state.theme.styleResponsive;
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getFactoryList();
|
|
|
- this.init();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- async init() {
|
|
|
- const data = await details(this.businessId);
|
|
|
- this.type = this.taskDefinitionKey == 'starter' ? 'edit' : 'detail';
|
|
|
- this.form = data;
|
|
|
- this.getProduceTaskList();
|
|
|
- this.form.procedureList = this.form.procedureList.map(
|
|
|
- (item) => item.produceTaskId
|
|
|
- );
|
|
|
- this.form.type = this.form.type + '';
|
|
|
- },
|
|
|
+ tabOptions: [
|
|
|
+ { key: 'main', name: '异常详情' },
|
|
|
+ { key: 'bpm', name: '流程详情' }
|
|
|
+ ],
|
|
|
+ // 表单验证规则
|
|
|
+ rules: {
|
|
|
+ type: [{ required: true, message: '请选择', trigger: 'change' }],
|
|
|
+ name: [{ required: true, message: '请输入', trigger: 'change' }],
|
|
|
|
|
|
- addProduct() {
|
|
|
- this.$refs.produceOrderRef.open();
|
|
|
+ workOrderCode: [
|
|
|
+ { required: true, message: '请选择', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ beEntrustedDeptId: [
|
|
|
+ { required: true, message: '请选择', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ finishTime: [{ required: true, message: '请选择', trigger: 'change' }]
|
|
|
+ },
|
|
|
+ type: '',
|
|
|
+ produceTaskList: [],
|
|
|
+ factoryList: [],
|
|
|
+ orderList: [],
|
|
|
+ selection: [],
|
|
|
+ current: null,
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ align: 'center',
|
|
|
+ reserveSelection: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'categoryName',
|
|
|
+ label: '产品名称',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // prop: 'apsWorkOrderCode',
|
|
|
+ // label: '生产订单号',
|
|
|
+ // slot: 'apsWorkOrderCode',
|
|
|
+ // align: 'center',
|
|
|
+ // minWidth: 110,
|
|
|
+ // showOverflowTooltip: true
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ prop: 'productionPlanCode',
|
|
|
+ label: '计划编号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'brandNum',
|
|
|
+ label: '牌号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'batchNo',
|
|
|
+ label: '批次号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'describes',
|
|
|
+ slot: 'describes',
|
|
|
+ label: '需求描述',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'totalCount',
|
|
|
+ slot: 'totalCount',
|
|
|
+ label: '请托数量',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planType',
|
|
|
+ label: '计划类型',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter: (row) => {
|
|
|
+ const obj = this.planType.find((i) => i.value == row.planType);
|
|
|
+ return obj && obj.label;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '生产工单号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'specification',
|
|
|
+ label: '规格',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '名称',
|
|
|
+ width: 130,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'modelType',
|
|
|
+ label: '型号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'produceRoutingName',
|
|
|
+ label: '工艺路线',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'bomType',
|
|
|
+ label: 'BOM分类',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter: (row) => {
|
|
|
+ if (row.bomType == 1) {
|
|
|
+ return '产品(PBOM)';
|
|
|
+ }
|
|
|
+ if (row.bomType == 2) {
|
|
|
+ return '加工(MBOM)';
|
|
|
+ }
|
|
|
+ if (row.bomType == 3) {
|
|
|
+ return '装配(ABOM)';
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'bomCategoryVersions',
|
|
|
+ label: 'BOM版本',
|
|
|
+ align: 'center',
|
|
|
+ width: 130,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter: (row) => {
|
|
|
+ if (row.bomCategoryName) {
|
|
|
+ return `${row.bomCategoryName} (V${row.bomCategoryVersions}.0)`;
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'taskId',
|
|
|
+ slot: 'taskId',
|
|
|
+ label: '工序',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 150,
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'categoryCode',
|
|
|
+ label: '编码',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planDeliveryTime',
|
|
|
+ slot: 'planDeliveryTime',
|
|
|
+ label: '完成日期',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 260
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planStartTime',
|
|
|
+ label: '计划开始时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130,
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planCompleteTime',
|
|
|
+ label: '计划结束时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130,
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'startTime',
|
|
|
+ label: '工单开始时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130,
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'completeTime',
|
|
|
+ label: '工单结束时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 130,
|
|
|
+ sortable: true
|
|
|
+ }
|
|
|
+ // {
|
|
|
+ // prop: 'priority',
|
|
|
+ // label: '优先级',
|
|
|
+ // align: 'center',
|
|
|
+ // minWidth: 120
|
|
|
+ // }
|
|
|
+ ]
|
|
|
+ };
|
|
|
},
|
|
|
-
|
|
|
- beEntrustedDeptIdChange(val, row) {
|
|
|
- this.form.beEntrustedDeptName = row.name;
|
|
|
+ props: {
|
|
|
+ businessId: {
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ taskDefinitionKey: {
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
},
|
|
|
- factoryListChange(row) {
|
|
|
- this.form.beEntrustedFactoriesName = row.name;
|
|
|
+ computed: {
|
|
|
+ // 是否开启响应式布局
|
|
|
+ styleResponsive() {
|
|
|
+ return this.$store.state.theme.styleResponsive;
|
|
|
+ }
|
|
|
},
|
|
|
- async getFactoryList() {
|
|
|
- const { list } = await warehouseDefinition.getFactoryarea({
|
|
|
- pageNum: 1,
|
|
|
- size: 999,
|
|
|
- type: 1
|
|
|
- });
|
|
|
- this.factoryList = list || [];
|
|
|
+ created() {
|
|
|
+ this.getFactoryList();
|
|
|
+ this.init();
|
|
|
},
|
|
|
+ methods: {
|
|
|
+ async init() {
|
|
|
+ const data = await details(this.businessId);
|
|
|
+ this.type = this.taskDefinitionKey == 'starter' ? 'edit' : 'detail';
|
|
|
+ // this.form = data;
|
|
|
+ const {
|
|
|
+ applyDeptName,
|
|
|
+ applyDeptId,
|
|
|
+ createUserName,
|
|
|
+ createUserId,
|
|
|
+ applyFactoriesId,
|
|
|
+ applyFactoriesName,
|
|
|
+ beEntrustedDeptId,
|
|
|
+ beEntrustedDeptName,
|
|
|
+ beEntrustedFactoriesName,
|
|
|
+ beEntrustedFactoriesId,
|
|
|
+ name,
|
|
|
+ type,
|
|
|
+ priority,
|
|
|
+ id: dataId
|
|
|
+ } = data;
|
|
|
|
|
|
- choose(data) {
|
|
|
- this.form.workOrderCode = data.code;
|
|
|
- this.form.produceRoutingId = data.produceRoutingId;
|
|
|
- this.form.produceRoutingName = data.produceRoutingName;
|
|
|
- this.form.pleaseEntrustObjList = [data];
|
|
|
- this.form.procedureList = [];
|
|
|
- this.getProduceTaskList();
|
|
|
- },
|
|
|
- async getProduceTaskList() {
|
|
|
- const res = await getProduceTaskList({
|
|
|
- isDetail: true,
|
|
|
- pageNum: 1,
|
|
|
- routingId: this.form.produceRoutingId,
|
|
|
- size: -1
|
|
|
- });
|
|
|
- this.produceTaskList = res.list;
|
|
|
- },
|
|
|
- async getTableValue() {
|
|
|
- let data = JSON.parse(JSON.stringify(this.form));
|
|
|
- data.procedureList = data.procedureList.map((item) => {
|
|
|
- return {
|
|
|
- produceTaskId: item,
|
|
|
- produceTaskName: this.produceTaskList.find((val) => val.id == item)
|
|
|
- .name
|
|
|
+ Object.assign(this.form, {
|
|
|
+ pleaseEntrustDeptName: applyDeptName,
|
|
|
+ pleaseEntrustDeptId: applyDeptId,
|
|
|
+ pleaseEntrustUserName: createUserName,
|
|
|
+ pleaseEntrustUserId: createUserId,
|
|
|
+ factoriesId: applyFactoriesId,
|
|
|
+ factoriesName: applyFactoriesName,
|
|
|
+ beEntrustedDeptId,
|
|
|
+ beEntrustedDeptName,
|
|
|
+ beEntrustedFactoriesName,
|
|
|
+ beEntrustedFactoriesId,
|
|
|
+ name,
|
|
|
+ type,
|
|
|
+ priority,
|
|
|
+ id: dataId
|
|
|
+ });
|
|
|
+
|
|
|
+ const newData = {
|
|
|
+ ...this.deepCopy(data),
|
|
|
+ taskList: []
|
|
|
};
|
|
|
- });
|
|
|
- if (await this.getValidate()) {
|
|
|
- return data;
|
|
|
- }
|
|
|
- return false;
|
|
|
- },
|
|
|
|
|
|
- getValidate() {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
- if (!valid) {
|
|
|
- resolve(false);
|
|
|
- } else {
|
|
|
- resolve(true);
|
|
|
- }
|
|
|
+ this.orderList.push(newData);
|
|
|
+ this.getOrderTaskList();
|
|
|
+ // this.form.procedureList = this.form.procedureList.map(
|
|
|
+ // (item) => item.produceTaskId
|
|
|
+ // );
|
|
|
+ this.form.type = this.form.type + '';
|
|
|
+ },
|
|
|
+
|
|
|
+ deepCopy(obj, hash = new WeakMap()) {
|
|
|
+ if (obj === null) return null;
|
|
|
+ if (obj instanceof Date) return new Date(obj);
|
|
|
+ if (obj instanceof RegExp) return new RegExp(obj);
|
|
|
+ if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
|
|
|
+ if (hash.has(obj)) return hash.get(obj);
|
|
|
+
|
|
|
+ const result = Array.isArray(obj) ? [] : {};
|
|
|
+ hash.set(obj, result);
|
|
|
+
|
|
|
+ return Object.keys(obj).reduce((acc, key) => {
|
|
|
+ acc[key] = this.deepCopy(obj[key], hash);
|
|
|
+ return acc;
|
|
|
+ }, result);
|
|
|
+ },
|
|
|
+
|
|
|
+ addProduct() {
|
|
|
+ this.$refs.produceOrderRef.open();
|
|
|
+ },
|
|
|
+
|
|
|
+ beEntrustedDeptIdChange(val, row) {
|
|
|
+ this.form.beEntrustedDeptName = row.name;
|
|
|
+ },
|
|
|
+ factoryListChange(row) {
|
|
|
+ this.form.beEntrustedFactoriesName = row.name;
|
|
|
+ },
|
|
|
+ async getFactoryList() {
|
|
|
+ const { list } = await warehouseDefinition.getFactoryarea({
|
|
|
+ pageNum: 1,
|
|
|
+ size: 999,
|
|
|
+ type: 1
|
|
|
+ });
|
|
|
+ this.factoryList = list || [];
|
|
|
+ },
|
|
|
+
|
|
|
+ choose(data) {
|
|
|
+ this.form.workOrderCode = data.code;
|
|
|
+ this.form.produceRoutingId = data.produceRoutingId;
|
|
|
+ this.form.produceRoutingName = data.produceRoutingName;
|
|
|
+ this.form.pleaseEntrustObjList = [data];
|
|
|
+ this.form.procedureList = [];
|
|
|
+ this.getProduceTaskList();
|
|
|
+ },
|
|
|
+ async getOrderTaskList() {
|
|
|
+ for (const item of this.orderList) {
|
|
|
+ const res = await getProduceTaskList({
|
|
|
+ isDetail: true,
|
|
|
+ pageNum: 1,
|
|
|
+ routingId: item.produceRoutingId,
|
|
|
+ size: -1
|
|
|
+ });
|
|
|
+
|
|
|
+ item.taskList = res.list;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getTableValue() {
|
|
|
+ let data = JSON.parse(JSON.stringify(this.form));
|
|
|
+ data.procedureList = data.procedureList.map((item) => {
|
|
|
+ return {
|
|
|
+ produceTaskId: item,
|
|
|
+ produceTaskName: this.produceTaskList.find((val) => val.id == item)
|
|
|
+ .name
|
|
|
+ };
|
|
|
+ });
|
|
|
+ if (await this.getValidate()) {
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+
|
|
|
+ getValidate() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ resolve(false);
|
|
|
+ } else {
|
|
|
+ resolve(true);
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-.basic-details-title {
|
|
|
- margin: 10px 0;
|
|
|
-}
|
|
|
+ .basic-details-title {
|
|
|
+ margin: 10px 0;
|
|
|
+ }
|
|
|
|
|
|
-.add-product {
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: flex-end;
|
|
|
- font-size: 30px;
|
|
|
- color: #1890ff;
|
|
|
- margin: 10px 0;
|
|
|
- cursor: pointer;
|
|
|
-}
|
|
|
+ .add-product {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+ font-size: 30px;
|
|
|
+ color: #1890ff;
|
|
|
+ margin: 10px 0;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
|
|
|
-.create-form .el-form-item {
|
|
|
- margin-bottom: 15px !important;
|
|
|
-}
|
|
|
+ .create-form .el-form-item {
|
|
|
+ margin-bottom: 15px !important;
|
|
|
+ }
|
|
|
</style>
|