This commit is contained in:
parent
d294fd4125
commit
dc232af445
|
|
@ -321,9 +321,9 @@ export default {
|
|||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||
},
|
||||
|
||||
currentRow: null
|
||||
|
||||
};
|
||||
currentRow: null,
|
||||
allProcessingCost: 0,
|
||||
}
|
||||
|
||||
|
||||
return pageData;
|
||||
|
|
@ -364,6 +364,7 @@ export default {
|
|||
|
||||
this.postDataUpdate();
|
||||
|
||||
|
||||
},
|
||||
|
||||
isComponentDone() {
|
||||
|
|
@ -681,28 +682,24 @@ export default {
|
|||
},
|
||||
afterEditEvent({column, row}) {
|
||||
console.log(column, row);
|
||||
|
||||
|
||||
this.postDataUpdate();
|
||||
|
||||
|
||||
},
|
||||
afterEditEvent2({column, row}) {
|
||||
afterEditEvent2({column, row}) { // 编辑后事件
|
||||
console.log(column, row);
|
||||
|
||||
if(column.field == "processing_cost"){
|
||||
if (column.field == "processing_cost") { // 如果编辑的字段是加工成本
|
||||
|
||||
let processing_cost = 0;
|
||||
this.detailsData2.forEach(item=>{
|
||||
processing_cost += parseFloat(item.processing_cost || 0);
|
||||
});
|
||||
|
||||
this.detailsData.forEach(item=>{
|
||||
|
||||
item.processing_cost = processing_cost;
|
||||
})
|
||||
|
||||
console.log(processing_cost)
|
||||
this.$forceUpdate();
|
||||
let processing_cost = 0; // 加工成本设置为0
|
||||
this.detailsData2.forEach(item => { // 遍历所有的行
|
||||
processing_cost += parseFloat(item.processing_cost || 0); // 加上每一行的加工成本
|
||||
});
|
||||
this.detailsData.forEach(item => { // 遍历所有的行
|
||||
item.processing_cost = processing_cost; // 设置每一行的加工成本
|
||||
})
|
||||
this.$forceUpdate();
|
||||
}
|
||||
this.postDataUpdate();
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<a-button type="primary" @click="print">打印</a-button>
|
||||
|
||||
|
||||
<a-button @click="pageUnComplete" v-if="formOptions.data.is_complete">取消完成布产</a-button>
|
||||
<a-button @click="pageUnComplete" v-if="formOptions.data.is_complete">取消完成布产</a-button>
|
||||
<a-button type="primary" @click="pageComplete" v-else>完成布产</a-button>
|
||||
|
||||
<a-button type="primary" @click="pageCopy">改模</a-button>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
</div>
|
||||
|
||||
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
|
||||
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
|
||||
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
|
||||
</vxe-form>
|
||||
|
||||
<a-tabs>
|
||||
|
|
@ -38,13 +38,12 @@
|
|||
<a-collapse-panel v-for="info in infos" :key="info.key" :header="info.header">
|
||||
|
||||
<component-detail :readonly="true" :dataId="getDataId()" :itemData="info.data"
|
||||
@reloadData="pageInit"></component-detail>
|
||||
@reloadData="pageInit" @allProcessingCost="allProcessingCost"></component-detail>
|
||||
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
|
||||
|
||||
|
||||
</a-tab-pane>
|
||||
|
||||
|
||||
|
|
@ -60,10 +59,14 @@
|
|||
|
||||
</a-tabs>
|
||||
|
||||
<div>
|
||||
总成本:{{ ProcessingCost }}
|
||||
</div>
|
||||
<h4 style="margin-top: 5px;">出现问题及建议反馈</h4>
|
||||
<vxe-form :data="formOptions2.data" ref="xForm" :title-width="formOptions2.titleWidth"
|
||||
:title-align="formOptions2.titleAlign" :rules="formOptions2.rules" :items="formOptions2.items" :titleColon="false"
|
||||
vertical>
|
||||
:title-align="formOptions2.titleAlign" :rules="formOptions2.rules" :items="formOptions2.items"
|
||||
:titleColon="false"
|
||||
vertical>
|
||||
</vxe-form>
|
||||
|
||||
|
||||
|
|
@ -80,20 +83,19 @@
|
|||
import ComponentDetail from './ComponentDetail'
|
||||
import BASE_URL from '@/services/mes/api.js';
|
||||
|
||||
import XEUtils from 'xe-utils' // 加载xe-utils
|
||||
import XEUtils from 'xe-utils' // 加载xe-utils
|
||||
const settings = require('../basic/settings.js');
|
||||
|
||||
export default {
|
||||
|
||||
name: '',
|
||||
components: { ComponentDetail },
|
||||
components: {ComponentDetail},
|
||||
props: {
|
||||
pageMode: {
|
||||
type: String,
|
||||
default: "edit"
|
||||
},
|
||||
dataId: {
|
||||
}
|
||||
dataId: {}
|
||||
|
||||
},
|
||||
|
||||
|
|
@ -150,13 +152,13 @@ export default {
|
|||
// 表单校验规则
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '请输入编号' }
|
||||
{required: true, message: '请输入编号'}
|
||||
],
|
||||
mold_order: [
|
||||
{ required: true, message: '请选择订单' }
|
||||
{required: true, message: '请选择订单'}
|
||||
],
|
||||
mold_scheme: [
|
||||
{ required: true, message: '请选择模具' }
|
||||
{required: true, message: '请选择模具'}
|
||||
],
|
||||
},
|
||||
// 表单项
|
||||
|
|
@ -187,25 +189,85 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
{ field: 'code', title: '编号', span: 6, itemRender: { name: '$input' } },
|
||||
{field: 'code', title: '编号', span: 6, itemRender: {name: '$input'}},
|
||||
|
||||
{ field: 'production_type', dataRule: { type: 'integer' }, title: '布产类型', span: 6, itemRender: { name: '$select', props: { options: options_production_type } } },
|
||||
{
|
||||
field: 'production_type',
|
||||
dataRule: {type: 'integer'},
|
||||
title: '布产类型',
|
||||
span: 6,
|
||||
itemRender: {name: '$select', props: {options: options_production_type}}
|
||||
},
|
||||
|
||||
{ field: 'rubber', title: '胶件材质/缩水', span: 6, itemRender: { name: '$input' } },
|
||||
{ field: 'hole', title: '模具穴数', span: 6, itemRender: { name: '$input' } },
|
||||
{ field: 'water', title: '入水口类型/位置', span: 6, itemRender: { name: '$input' } },
|
||||
{field: 'rubber', title: '胶件材质/缩水', span: 6, itemRender: {name: '$input'}},
|
||||
{field: 'hole', title: '模具穴数', span: 6, itemRender: {name: '$input'}},
|
||||
{field: 'water', title: '入水口类型/位置', span: 6, itemRender: {name: '$input'}},
|
||||
|
||||
|
||||
{ field: 'manufacture_cycle', dataRule: { type: 'timestamp' }, title: '制作周期', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'draw_start_time', dataRule: { type: 'timestamp' }, title: '预计开始画图时间', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'split_design_time', dataRule: { type: 'timestamp' }, title: '分模设计时间预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'draw_time', dataRule: { type: 'timestamp' }, title: '出图时间预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{
|
||||
field: 'manufacture_cycle',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '制作周期',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'draw_start_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '预计开始画图时间',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'split_design_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '分模设计时间预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'draw_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '出图时间预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
|
||||
{ field: 'draw2D_time', dataRule: { type: 'timestamp' }, title: '出2D时间预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'draw3D_time', dataRule: { type: 'timestamp' }, title: '出3D时间预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'inlay_deep_hole_time', dataRule: { type: 'timestamp' }, title: '镶件深孔钻到厂日期预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'horizontal_frame_time', dataRule: { type: 'timestamp' }, title: '横架到厂日期预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'complete_time', dataRule: { type: 'timestamp' }, title: '要求完成时间', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{
|
||||
field: 'draw2D_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '出2D时间预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'draw3D_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '出3D时间预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'inlay_deep_hole_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '镶件深孔钻到厂日期预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'horizontal_frame_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '横架到厂日期预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'complete_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '要求完成时间',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
title: '模具师傅', span: 6,
|
||||
field: 'mold_master_user_detail',
|
||||
|
|
@ -232,12 +294,11 @@ export default {
|
|||
},
|
||||
itemRender: {
|
||||
name: 'MkFormInputShow', props: {
|
||||
params: {
|
||||
}
|
||||
params: {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'customer_name', title: '客户名称', span: 6, itemRender: { name: '$input' } },
|
||||
{field: 'customer_name', title: '客户名称', span: 6, itemRender: {name: '$input'}},
|
||||
{
|
||||
field: 'progress', title: '进度', span: 6, itemRender: {
|
||||
name: 'MkFormProgress', props: {
|
||||
|
|
@ -251,21 +312,19 @@ export default {
|
|||
]
|
||||
},
|
||||
formOptions2: {
|
||||
data: {
|
||||
},
|
||||
data: {},
|
||||
// 标题宽度
|
||||
titleWidth: 180,
|
||||
// 标题对齐方式
|
||||
titleAlign: 'top',
|
||||
|
||||
// 表单校验规则
|
||||
rules: {
|
||||
},
|
||||
rules: {},
|
||||
// 表单项
|
||||
items: [
|
||||
|
||||
|
||||
{ showTitle: false, field: 'problem', title: '', span: 24, itemRender: { name: '$textarea', props: {} } },
|
||||
{showTitle: false, field: 'problem', title: '', span: 24, itemRender: {name: '$textarea', props: {}}},
|
||||
|
||||
|
||||
]
|
||||
|
|
@ -275,32 +334,23 @@ export default {
|
|||
departmentId: null,
|
||||
|
||||
// 新增模式表单项
|
||||
addModeItems: [
|
||||
|
||||
],
|
||||
addModeItems: [],
|
||||
|
||||
|
||||
table1Height: 400,
|
||||
detailsSourceData: [
|
||||
],
|
||||
detailsData: [
|
||||
],
|
||||
deletedDetailsData: [
|
||||
detailsSourceData: [],
|
||||
detailsData: [],
|
||||
deletedDetailsData: [],
|
||||
|
||||
],
|
||||
|
||||
detailsData2: [
|
||||
],
|
||||
deletedDetailsData2: [
|
||||
|
||||
],
|
||||
detailsData2: [],
|
||||
deletedDetailsData2: [],
|
||||
editor_component: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MoldComponent',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "component_id" }
|
||||
{fromField: "id", field: "component_id"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MoldComponent/v1/mold/component/list`
|
||||
},
|
||||
|
|
@ -310,7 +360,7 @@ export default {
|
|||
textField: "name",
|
||||
listdataFieldName: 'BaseDepartment',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "department_id" }
|
||||
{fromField: "id", field: "department_id"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/BaseDepartment/v1/base/department/list`
|
||||
},
|
||||
|
|
@ -321,7 +371,7 @@ export default {
|
|||
textField: "name",
|
||||
listdataFieldName: 'MesProcesses',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "process_id" }
|
||||
{fromField: "id", field: "process_id"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesProcesses/v1/mes/processes/list`
|
||||
},
|
||||
|
|
@ -332,7 +382,7 @@ export default {
|
|||
textField: "name",
|
||||
listdataFieldName: 'MesStaff',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "process_uid" }
|
||||
{fromField: "id", field: "process_uid"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||
},
|
||||
|
|
@ -342,7 +392,7 @@ export default {
|
|||
textField: "name",
|
||||
listdataFieldName: 'MesStaff',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "send_uid" }
|
||||
{fromField: "id", field: "send_uid"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||
},
|
||||
|
|
@ -352,13 +402,14 @@ export default {
|
|||
textField: "name",
|
||||
listdataFieldName: 'MesStaff',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "process_uid" }
|
||||
{fromField: "id", field: "process_uid"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||
},
|
||||
|
||||
|
||||
loadCount: 0,
|
||||
ProcessingCost: 0,
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -379,7 +430,6 @@ export default {
|
|||
created() {
|
||||
|
||||
|
||||
|
||||
this.pageInit();
|
||||
|
||||
|
||||
|
|
@ -392,7 +442,6 @@ export default {
|
|||
methods: {
|
||||
|
||||
|
||||
|
||||
loadDepartments() {
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/BaseDepartment/v1/base/department/list`,
|
||||
|
|
@ -401,19 +450,17 @@ export default {
|
|||
"page": 1,
|
||||
"limit": 1000,
|
||||
"end_time": 0,
|
||||
"order_bys": [
|
||||
],
|
||||
"search_rules": [
|
||||
],
|
||||
"order_bys": [],
|
||||
"search_rules": [],
|
||||
"start_time": 0
|
||||
},
|
||||
useBigInt: true
|
||||
}).then(a => {
|
||||
this.departments = a.data.BaseDepartment;
|
||||
this.departmentOptions = [{ value: null, label: '全部部门' }];
|
||||
this.departmentOptions = [{value: null, label: '全部部门'}];
|
||||
this.departments.forEach(item => {
|
||||
|
||||
this.departmentOptions = [... this.departmentOptions, {
|
||||
this.departmentOptions = [...this.departmentOptions, {
|
||||
value: item.id + '',
|
||||
label: item.name
|
||||
}]
|
||||
|
|
@ -436,12 +483,15 @@ export default {
|
|||
this.$mk.post({
|
||||
url: this.actions.get,
|
||||
loading: "加载中...",
|
||||
data: { id: this.$mk.toBigInt(dataId) },
|
||||
data: {id: this.$mk.toBigInt(dataId)},
|
||||
useBigInt: true
|
||||
}).then(a => {
|
||||
|
||||
|
||||
this.formOptions.data = this.$mk.formatDetailData({ data: a.data[this.detailDataFieldName], rules: this.formOptions.items });
|
||||
this.formOptions.data = this.$mk.formatDetailData({
|
||||
data: a.data[this.detailDataFieldName],
|
||||
rules: this.formOptions.items
|
||||
});
|
||||
|
||||
|
||||
this.formOptions2.data = {
|
||||
|
|
@ -452,13 +502,13 @@ export default {
|
|||
this.detailsData2 = JSON.parse(JSON.stringify(a.data[this.detailDataFieldName].mold_production_order_component_processes || []));
|
||||
|
||||
|
||||
this.departmentOptions = [{ value: null, label: '全部部门' }];
|
||||
this.departmentOptions = [{value: null, label: '全部部门'}];
|
||||
this.detailsData2.forEach(item => {
|
||||
|
||||
if (item.department_detail && item.department_detail.id &&
|
||||
!this.departmentOptions.filter(a => a.value == item.department_detail.id.toString()).length
|
||||
!this.departmentOptions.filter(a => a.value == item.department_detail.id.toString()).length
|
||||
) {
|
||||
this.departmentOptions = [... this.departmentOptions, {
|
||||
this.departmentOptions = [...this.departmentOptions, {
|
||||
value: item.department_detail.id + '',
|
||||
label: item.department_detail.name
|
||||
}]
|
||||
|
|
@ -486,7 +536,6 @@ export default {
|
|||
this.isEdit = true;
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
// 如果没有id参数,说明是新增模式
|
||||
this.addModeItems.forEach(item => {
|
||||
|
|
@ -571,7 +620,7 @@ export default {
|
|||
this.collapseActiveKey = [];
|
||||
this.infos = [];
|
||||
},
|
||||
addInfo({ rows1, rows2, header }) {
|
||||
addInfo({rows1, rows2, header}) {
|
||||
let key = this.infos.length + '';
|
||||
let info = {
|
||||
key: key, data: {
|
||||
|
|
@ -584,14 +633,14 @@ export default {
|
|||
this.infos = [...this.infos, info];
|
||||
},
|
||||
pageSelectOrder() {
|
||||
let { width, height } = this.$mk.getWindowSize();
|
||||
let {width, height} = this.$mk.getWindowSize();
|
||||
this.$mk.dialog.open({
|
||||
page: () => import("../MoldOrder/selector"),
|
||||
title: "选择订单",
|
||||
showFooter: true,
|
||||
width: width * 0.9,
|
||||
height: height * 0.9,
|
||||
callback: ({ data }) => {
|
||||
callback: ({data}) => {
|
||||
if (!data || !data.row2) {
|
||||
this.$mk.error("未选择明细行");
|
||||
return;
|
||||
|
|
@ -664,7 +713,7 @@ export default {
|
|||
currentAddRows1.push({
|
||||
component_id: pitem.component_id.toString(),
|
||||
component_num: 1,
|
||||
component_detail: { id: pitem.mold_component.id, name: pitem.mold_component.name },
|
||||
component_detail: {id: pitem.mold_component.id, name: pitem.mold_component.name},
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -672,7 +721,7 @@ export default {
|
|||
currentAddRows2.push({
|
||||
component_id: pitem.component_id.toString(),
|
||||
process_id: pitem.mes_processes_id,
|
||||
process_detail: { id: pitem.mes_processes_id, name: pitem.mes_processes.name },
|
||||
process_detail: {id: pitem.mes_processes_id, name: pitem.mes_processes.name},
|
||||
})
|
||||
});
|
||||
|
||||
|
|
@ -737,12 +786,14 @@ export default {
|
|||
},
|
||||
|
||||
|
||||
allProcessingCost(data) {
|
||||
this.ProcessingCost = data;
|
||||
},
|
||||
|
||||
// 保存
|
||||
ok() {
|
||||
|
||||
|
||||
|
||||
let save = () => {
|
||||
|
||||
|
||||
|
|
@ -753,7 +804,7 @@ export default {
|
|||
|
||||
|
||||
// 格式化提交的数据
|
||||
this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items });
|
||||
this.$mk.formatFormData({data: postdata, rules: this.formOptions.items});
|
||||
|
||||
|
||||
if (postdata.id) {
|
||||
|
|
@ -767,8 +818,12 @@ export default {
|
|||
postdata.order_id = this.$mk.toBigInt(postdata.order_id);
|
||||
}
|
||||
|
||||
postdata.mold_production_order_component = !this.isEdit ? [] : { insertList: [], deleteList: [], updateList: [] };
|
||||
postdata.mold_production_order_component_processes = !this.isEdit ? [] : { insertList: [], deleteList: [], updateList: [] };
|
||||
postdata.mold_production_order_component = !this.isEdit ? [] : {insertList: [], deleteList: [], updateList: []};
|
||||
postdata.mold_production_order_component_processes = !this.isEdit ? [] : {
|
||||
insertList: [],
|
||||
deleteList: [],
|
||||
updateList: []
|
||||
};
|
||||
|
||||
this.infos.forEach(info => {
|
||||
if (!info.data.postdata) {
|
||||
|
|
@ -833,11 +888,8 @@ export default {
|
|||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 验证表单
|
||||
this.$mk.validateForm({ form: this.$refs.xForm }).then(() => { // 验证表单
|
||||
this.$mk.validateForm({form: this.$refs.xForm}).then(() => { // 验证表单
|
||||
|
||||
save(); // 提交保存
|
||||
|
||||
|
|
@ -854,7 +906,7 @@ export default {
|
|||
this.back();
|
||||
},
|
||||
|
||||
pageCopy(){
|
||||
pageCopy() {
|
||||
let dataId = this.getDataId();
|
||||
if (!dataId) {
|
||||
return;
|
||||
|
|
@ -873,14 +925,13 @@ export default {
|
|||
if (a.code == "200") {
|
||||
this.$mk.success("操作成功");
|
||||
this.$openPage(this.editPageUrl + a.data.id);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this.$mk.error(a.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.$mk.confirm('您确定要改模布产吗?').then(type => {
|
||||
if (type == 'confirm') {
|
||||
if (type == 'confirm') {
|
||||
sendCopy("");
|
||||
}
|
||||
});
|
||||
|
|
@ -906,14 +957,13 @@ export default {
|
|||
if (a.code == "200") {
|
||||
this.$mk.success("操作成功");
|
||||
this.pageInit();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this.$mk.error(a.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.$mk.confirm('您确定要完成布产吗?').then(type => {
|
||||
if (type == 'confirm') {
|
||||
if (type == 'confirm') {
|
||||
sendComplete("");
|
||||
}
|
||||
});
|
||||
|
|
@ -939,14 +989,13 @@ export default {
|
|||
if (a.code == "200") {
|
||||
this.$mk.success("操作成功");
|
||||
this.pageInit();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this.$mk.error(a.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.$mk.confirm('您确定要取消完成布产吗?').then(type => {
|
||||
if (type == 'confirm') {
|
||||
if (type == 'confirm') {
|
||||
sendComplete("");
|
||||
}
|
||||
});
|
||||
|
|
@ -971,8 +1020,7 @@ export default {
|
|||
if (a.code == "200") {
|
||||
this.$mk.success("审批成功");
|
||||
this.pageInit();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this.$mk.error(a.msg);
|
||||
}
|
||||
});
|
||||
|
|
@ -984,7 +1032,6 @@ export default {
|
|||
print() { // 打印
|
||||
|
||||
|
||||
|
||||
let hiprint = this.$hiPrint; // 获取打印组件
|
||||
let tdata = JSON.parse(JSON.stringify(this.formOptions.data)); // 复制表单数据
|
||||
|
||||
|
|
@ -997,9 +1044,9 @@ export default {
|
|||
for (let name in tdata) {
|
||||
|
||||
if (
|
||||
(name.indexOf('_time') != -1 || name == 'manufacture_cycle')
|
||||
(name.indexOf('_time') != -1 || name == 'manufacture_cycle')
|
||||
|
||||
&& tdata[name] && tdata[name].indexOf('T') != -1) {
|
||||
&& tdata[name] && tdata[name].indexOf('T') != -1) {
|
||||
tdata[name] = tdata[name].split('T')[0];
|
||||
}
|
||||
}
|
||||
|
|
@ -1058,21 +1105,18 @@ export default {
|
|||
});
|
||||
|
||||
|
||||
|
||||
hiprint.init(); // 初始化打印组件
|
||||
|
||||
|
||||
var hiprintTemplate = new hiprint.PrintTemplate({ // 创建打印模板
|
||||
template: template
|
||||
});
|
||||
hiprintTemplate.print(tdata, { printer: '', title: '工艺布产' }); // 打印
|
||||
hiprintTemplate.print(tdata, {printer: '', title: '工艺布产'}); // 打印
|
||||
},
|
||||
|
||||
},
|
||||
// 监听属性
|
||||
watch: {
|
||||
|
||||
}
|
||||
watch: {}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
<a-button v-if="!getDataId()" @click="pageSelectOrder" :disabled="pageStatus == 'approved'">选择订单</a-button>
|
||||
<a-button type="primary" @click="ok" :disabled="pageStatus == 'approved'">保存</a-button>
|
||||
<a-button v-if="false" @click="pageApproved" type="primary"
|
||||
:disabled="!this.getDataId() || pageStatus == 'approved'">审批
|
||||
</a-button>
|
||||
:disabled="!this.getDataId() || pageStatus == 'approved'">审批
|
||||
</a-button>
|
||||
|
||||
<a-button @click="back">关闭</a-button>
|
||||
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
|
||||
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
|
||||
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
|
||||
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
|
||||
</vxe-form>
|
||||
|
||||
<a-tabs>
|
||||
|
|
@ -32,14 +32,14 @@
|
|||
|
||||
<a-collapse-panel v-for="(info, index) in infos" :key="info.key" :header="info.header">
|
||||
|
||||
<a-icon slot="extra" type="delete" @click.stop="removeInfo(index)" />
|
||||
<component-detail ref="componentDetail" :dataId="getDataId()" :itemData="info.data" @reloadData="pageInit"></component-detail>
|
||||
<a-icon slot="extra" type="delete" @click.stop="removeInfo(index)"/>
|
||||
<component-detail ref="componentDetail" :dataId="getDataId()" :itemData="info.data"
|
||||
@reloadData="pageInit"></component-detail>
|
||||
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
|
||||
|
||||
|
||||
</a-tab-pane>
|
||||
|
||||
|
||||
|
|
@ -54,10 +54,13 @@
|
|||
</a-tab-pane>
|
||||
|
||||
</a-tabs>
|
||||
|
||||
|
||||
<h3 style="padding: 20px;text-align: right;">
|
||||
总成本:{{ ProcessingCost }} 元
|
||||
</h3>
|
||||
<vxe-form :data="formOptions2.data" ref="xForm2" :title-width="formOptions2.titleWidth"
|
||||
:title-align="formOptions2.titleAlign" :rules="formOptions2.rules" :items="formOptions2.items"
|
||||
>
|
||||
:title-align="formOptions2.titleAlign" :rules="formOptions2.rules" :items="formOptions2.items"
|
||||
>
|
||||
</vxe-form>
|
||||
|
||||
|
||||
|
|
@ -74,20 +77,19 @@
|
|||
import ComponentDetail from './ComponentDetail'
|
||||
import BASE_URL from '@/services/mes/api.js';
|
||||
|
||||
import XEUtils from 'xe-utils' // 加载xe-utils
|
||||
import XEUtils from 'xe-utils' // 加载xe-utils
|
||||
const settings = require('../basic/settings.js');
|
||||
|
||||
export default {
|
||||
|
||||
name: '',
|
||||
components: { ComponentDetail },
|
||||
components: {ComponentDetail},
|
||||
props: {
|
||||
pageMode: {
|
||||
type: String,
|
||||
default: "edit"
|
||||
},
|
||||
dataId: {
|
||||
}
|
||||
dataId: {}
|
||||
|
||||
},
|
||||
|
||||
|
|
@ -143,13 +145,13 @@ export default {
|
|||
// 表单校验规则
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '请输入编号' }
|
||||
{required: true, message: '请输入编号'}
|
||||
],
|
||||
mold_order: [
|
||||
{ required: true, message: '请选择订单' }
|
||||
{required: true, message: '请选择订单'}
|
||||
],
|
||||
mold_detail: [
|
||||
{ required: true, message: '请选择模具' }
|
||||
{required: true, message: '请选择模具'}
|
||||
],
|
||||
},
|
||||
// 表单项
|
||||
|
|
@ -180,27 +182,87 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
{ field: 'code', title: '编号', span: 6, itemRender: { name: '$input' } },
|
||||
{field: 'code', title: '编号', span: 6, itemRender: {name: '$input'}},
|
||||
|
||||
{ field: 'production_type', dataRule: { type: 'integer' }, title: '布产类型', span: 6, itemRender: { name: '$select', props: { options: options_production_type } } },
|
||||
|
||||
|
||||
{ field: 'rubber', title: '胶件材质/缩水', span: 6, itemRender: { name: '$input' } },
|
||||
{ field: 'hole', title: '模具穴数', span: 6, itemRender: { name: '$input' } },
|
||||
{ field: 'water', title: '入水口类型/位置', span: 6, itemRender: { name: '$input' } },
|
||||
|
||||
{
|
||||
field: 'production_type',
|
||||
dataRule: {type: 'integer'},
|
||||
title: '布产类型',
|
||||
span: 6,
|
||||
itemRender: {name: '$select', props: {options: options_production_type}}
|
||||
},
|
||||
|
||||
{ field: 'manufacture_cycle', dataRule: { type: 'timestamp' }, title: '制作周期', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'draw_start_time', dataRule: { type: 'timestamp' }, title: '预计开始画图时间', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'split_design_time', dataRule: { type: 'timestamp' }, title: '分模设计时间预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'draw_time', dataRule: { type: 'timestamp' }, title: '出图时间预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
|
||||
{ field: 'draw2D_time', dataRule: { type: 'timestamp' }, title: '出2D时间预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'draw3D_time', dataRule: { type: 'timestamp' }, title: '出3D时间预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'inlay_deep_hole_time', dataRule: { type: 'timestamp' }, title: '镶件深孔钻到厂日期预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'horizontal_frame_time', dataRule: { type: 'timestamp' }, title: '横架到厂日期预计', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
|
||||
{ field: 'complete_time', dataRule: { type: 'timestamp' }, title: '要求完成时间', span: 6, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{field: 'rubber', title: '胶件材质/缩水', span: 6, itemRender: {name: '$input'}},
|
||||
{field: 'hole', title: '模具穴数', span: 6, itemRender: {name: '$input'}},
|
||||
{field: 'water', title: '入水口类型/位置', span: 6, itemRender: {name: '$input'}},
|
||||
|
||||
|
||||
{
|
||||
field: 'manufacture_cycle',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '制作周期',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'draw_start_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '预计开始画图时间',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'split_design_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '分模设计时间预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'draw_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '出图时间预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'draw2D_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '出2D时间预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'draw3D_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '出3D时间预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'inlay_deep_hole_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '镶件深孔钻到厂日期预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
field: 'horizontal_frame_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '横架到厂日期预计',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'complete_time',
|
||||
dataRule: {type: 'timestamp'},
|
||||
title: '要求完成时间',
|
||||
span: 6,
|
||||
itemRender: {name: '$input', props: {type: 'date'}}
|
||||
},
|
||||
{
|
||||
title: '模具师傅', span: 6,
|
||||
field: 'mold_master_user_detail',
|
||||
|
|
@ -224,23 +286,23 @@ export default {
|
|||
title: '工程师傅', span: 6,
|
||||
field: 'engineer_detail',
|
||||
dataRule: {
|
||||
initType:'object',
|
||||
initType: 'object',
|
||||
|
||||
textField:'engineer_name',
|
||||
idField:'engineer_uid',
|
||||
textField: 'engineer_name',
|
||||
idField: 'engineer_uid',
|
||||
|
||||
|
||||
type:'object',
|
||||
fromTextField: "name",
|
||||
|
||||
type: 'object',
|
||||
fromTextField: "name",
|
||||
saveTextField: "engineer_name",
|
||||
|
||||
|
||||
fromField: "id",
|
||||
fromField: "id",
|
||||
saveField: "engineer_uid" // 如果表单项存储的是对象,将从fromField中取得值保存到saveField
|
||||
},
|
||||
itemRender: {
|
||||
name: 'MkFormDataSelector', props: {
|
||||
params: {
|
||||
params: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "name",
|
||||
|
|
@ -250,7 +312,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
{ field: 'customer_name', title: '客户名称', span: 6, itemRender: { name: '$input' } },
|
||||
{field: 'customer_name', title: '客户名称', span: 6, itemRender: {name: '$input'}},
|
||||
{
|
||||
field: 'progress', title: '进度', span: 18, itemRender: {
|
||||
name: 'MkFormProgress', props: {
|
||||
|
|
@ -266,53 +328,42 @@ export default {
|
|||
|
||||
|
||||
formOptions2: {
|
||||
data: {
|
||||
},
|
||||
data: {},
|
||||
// 标题宽度
|
||||
titleWidth: 180,
|
||||
// 标题对齐方式
|
||||
|
||||
// 表单校验规则
|
||||
rules: {
|
||||
},
|
||||
rules: {},
|
||||
// 表单项
|
||||
items: [
|
||||
|
||||
|
||||
{ field: 'problem', title: '出现问题及建议反馈', span: 24, itemRender: { name: '$input', props: {} } },
|
||||
{ field: 'remark', title: '备注', span: 24, itemRender: { name: '$textarea', props: {} } },
|
||||
{field: 'problem', title: '出现问题及建议反馈', span: 24, itemRender: {name: '$input', props: {}}},
|
||||
{field: 'remark', title: '备注', span: 24, itemRender: {name: '$textarea', props: {}}},
|
||||
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
// 新增模式表单项
|
||||
addModeItems: [
|
||||
|
||||
],
|
||||
addModeItems: [],
|
||||
|
||||
|
||||
table1Height: 400,
|
||||
detailsSourceData: [
|
||||
],
|
||||
detailsData: [
|
||||
],
|
||||
deletedDetailsData: [
|
||||
detailsSourceData: [],
|
||||
detailsData: [],
|
||||
deletedDetailsData: [],
|
||||
|
||||
],
|
||||
|
||||
detailsData2: [
|
||||
],
|
||||
deletedDetailsData2: [
|
||||
|
||||
],
|
||||
detailsData2: [],
|
||||
deletedDetailsData2: [],
|
||||
editor_component: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MoldComponent',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "component_id" }
|
||||
{fromField: "id", field: "component_id"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MoldComponent/v1/mold/component/list`
|
||||
},
|
||||
|
|
@ -322,7 +373,7 @@ export default {
|
|||
textField: "name",
|
||||
listdataFieldName: 'BaseDepartment',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "department_id" }
|
||||
{fromField: "id", field: "department_id"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/BaseDepartment/v1/base/department/list`
|
||||
},
|
||||
|
|
@ -333,7 +384,7 @@ export default {
|
|||
textField: "name",
|
||||
listdataFieldName: 'MesProcesses',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "process_id" }
|
||||
{fromField: "id", field: "process_id"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesProcesses/v1/mes/processes/list`
|
||||
},
|
||||
|
|
@ -344,7 +395,7 @@ export default {
|
|||
textField: "name",
|
||||
listdataFieldName: 'MesStaff',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "process_uid" }
|
||||
{fromField: "id", field: "process_uid"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||
},
|
||||
|
|
@ -354,7 +405,7 @@ export default {
|
|||
textField: "name",
|
||||
listdataFieldName: 'MesStaff',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "send_uid" }
|
||||
{fromField: "id", field: "send_uid"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||
},
|
||||
|
|
@ -364,13 +415,14 @@ export default {
|
|||
textField: "name",
|
||||
listdataFieldName: 'MesStaff',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "process_uid" }
|
||||
{fromField: "id", field: "process_uid"}
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||
},
|
||||
|
||||
|
||||
loadCount: 0,
|
||||
ProcessingCost: 0,
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -393,7 +445,6 @@ export default {
|
|||
created() {
|
||||
|
||||
|
||||
|
||||
this.pageInit();
|
||||
|
||||
|
||||
|
|
@ -419,17 +470,20 @@ export default {
|
|||
this.$mk.post({
|
||||
url: this.actions.get,
|
||||
loading: "加载中...",
|
||||
data: { id: this.$mk.toBigInt(dataId) },
|
||||
data: {id: this.$mk.toBigInt(dataId)},
|
||||
useBigInt: true
|
||||
}).then(a => {
|
||||
|
||||
|
||||
this.formOptions.data = this.$mk.formatDetailData({ data: a.data[this.detailDataFieldName], rules: this.formOptions.items });
|
||||
this.formOptions.data = this.$mk.formatDetailData({
|
||||
data: a.data[this.detailDataFieldName],
|
||||
rules: this.formOptions.items
|
||||
});
|
||||
|
||||
|
||||
this.formOptions2.data = {
|
||||
problem: a.data[this.detailDataFieldName].problem,
|
||||
|
||||
|
||||
remark: a.data[this.detailDataFieldName].remark
|
||||
}
|
||||
|
||||
|
|
@ -449,7 +503,6 @@ export default {
|
|||
this.setPageReadonly(this.pageStatus == 'approved');
|
||||
|
||||
|
||||
|
||||
this.$forceUpdate();
|
||||
|
||||
});
|
||||
|
|
@ -457,7 +510,6 @@ export default {
|
|||
this.isEdit = true;
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
// 如果没有id参数,说明是新增模式
|
||||
this.addModeItems.forEach(item => {
|
||||
|
|
@ -479,7 +531,7 @@ export default {
|
|||
|
||||
if (!item.component_id) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
let key = infos.length + '' + (this.loadCount + '');
|
||||
let info = {
|
||||
key: key, data: {
|
||||
|
|
@ -491,7 +543,7 @@ export default {
|
|||
this.detailsData2.forEach(pitem => {
|
||||
if (pitem.component_line == item.component_line) {
|
||||
info.data.mold_production_order_component_processes.push(pitem);
|
||||
}
|
||||
}
|
||||
});
|
||||
keys.push(key);
|
||||
infos.push(info);
|
||||
|
|
@ -500,7 +552,7 @@ export default {
|
|||
|
||||
this.collapseActiveKey = keys;
|
||||
this.infos = infos
|
||||
|
||||
|
||||
},
|
||||
|
||||
setPageReadonly(readonly) {
|
||||
|
|
@ -522,27 +574,27 @@ export default {
|
|||
if (!v) return '';
|
||||
return XEUtils.toDateString(new Date(v * 1000), 'yyyy-MM-dd');
|
||||
},
|
||||
existComonent({ component_id }) {
|
||||
existComonent({component_id}) {
|
||||
let exist = false;
|
||||
this.infos.forEach(info => {
|
||||
info.data.mold_production_order_component.forEach(row => {
|
||||
this.infos.forEach(info => {
|
||||
info.data.mold_production_order_component.forEach(row => {
|
||||
if (row.component_id.toString() == component_id) {
|
||||
exist = true;
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
return exist;
|
||||
|
||||
},
|
||||
pageSelectComponent() {
|
||||
let { width, height } = this.$mk.getWindowSize();
|
||||
let {width, height} = this.$mk.getWindowSize();
|
||||
this.$mk.dialog.open({
|
||||
page: () => import("../MoldComponent/selector"),
|
||||
title: "选择部件",
|
||||
showFooter: true,
|
||||
width: width * 0.9,
|
||||
height: height * 0.9,
|
||||
callback: ({ data }) => {
|
||||
callback: ({data}) => {
|
||||
if (!data || !data.row1) {
|
||||
this.$mk.error("未选择行");
|
||||
return;
|
||||
|
|
@ -558,26 +610,26 @@ export default {
|
|||
if (a.data && a.data.mold_component) {
|
||||
let row = a.data.mold_component;
|
||||
//if (this.existComonent({ component_id: row.id.toString() })) {
|
||||
//this.$mk.error("该部件已经存在");
|
||||
//return;
|
||||
//this.$mk.error("该部件已经存在");
|
||||
//return;
|
||||
//}
|
||||
let mold_component_processes = row.mold_component_processes || [];
|
||||
let currentAddRows1 = [];
|
||||
let currentAddRows2 = [];
|
||||
let component_line = this.$mk.getGuid();
|
||||
|
||||
|
||||
currentAddRows1.push({
|
||||
component_line: component_line,
|
||||
component_id: row.id,
|
||||
component_num: 1,
|
||||
component_detail: { id: row.id, name: row.name },
|
||||
component_detail: {id: row.id, name: row.name},
|
||||
})
|
||||
mold_component_processes.forEach(pitem => {
|
||||
currentAddRows2.push({
|
||||
component_line: component_line,
|
||||
component_id: row.id,
|
||||
process_id: pitem.mes_processes_id,
|
||||
process_detail: { id: pitem.mes_processes_id, name: pitem.mes_processes.name },
|
||||
process_detail: {id: pitem.mes_processes_id, name: pitem.mes_processes.name},
|
||||
})
|
||||
|
||||
});
|
||||
|
|
@ -589,8 +641,6 @@ export default {
|
|||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -601,7 +651,7 @@ export default {
|
|||
this.collapseActiveKey = [];
|
||||
this.infos = [];
|
||||
},
|
||||
addInfo({ rows1, rows2, header }) {
|
||||
addInfo({rows1, rows2, header}) {
|
||||
let key = this.infos.length + '';
|
||||
let info = {
|
||||
key: key, data: {
|
||||
|
|
@ -614,14 +664,14 @@ export default {
|
|||
this.infos = [...this.infos, info];
|
||||
},
|
||||
pageSelectOrder() {
|
||||
let { width, height } = this.$mk.getWindowSize();
|
||||
let {width, height} = this.$mk.getWindowSize();
|
||||
this.$mk.dialog.open({
|
||||
page: () => import("../MoldOrder/selector"),
|
||||
title: "选择订单",
|
||||
showFooter: true,
|
||||
width: width * 0.9,
|
||||
height: height * 0.9,
|
||||
callback: ({ data }) => {
|
||||
callback: ({data}) => {
|
||||
if (!data || !data.row2) {
|
||||
this.$mk.error("未选择明细行");
|
||||
return;
|
||||
|
|
@ -656,15 +706,18 @@ export default {
|
|||
this.formOptions.data.draw3D_time = this.getDateValue(detail.draw3D_time);
|
||||
}
|
||||
if (detail.horizontal_frame_time) {
|
||||
this.formOptions.data.horizontal_frame_time = this.getDateValue(detail.horizontal_frame_time);
|
||||
this.formOptions.data.horizontal_frame_time = this.getDateValue(detail.horizontal_frame_time);
|
||||
}
|
||||
if (detail.complete_time) {
|
||||
this.formOptions.data.complete_time = this.getDateValue(detail.complete_time);
|
||||
this.formOptions.data.complete_time = this.getDateValue(detail.complete_time);
|
||||
}
|
||||
|
||||
|
||||
if (detail.mold_master_uid) {
|
||||
this.formOptions.data.mold_master_uid = detail.mold_master_uid;
|
||||
this.formOptions.data.mold_master_user_detail = { id: detail.mold_master_user_detail.id, name: detail.mold_master_user_detail.name };
|
||||
this.formOptions.data.mold_master_user_detail = {
|
||||
id: detail.mold_master_user_detail.id,
|
||||
name: detail.mold_master_user_detail.name
|
||||
};
|
||||
}
|
||||
|
||||
this.formOptions.data = JSON.parse(JSON.stringify(this.formOptions.data))
|
||||
|
|
@ -702,7 +755,7 @@ export default {
|
|||
currentAddRows1.push({
|
||||
component_id: pitem.component_id.toString(),
|
||||
component_num: 1,
|
||||
component_detail: { id: pitem.mold_component.id, name: pitem.mold_component.name },
|
||||
component_detail: {id: pitem.mold_component.id, name: pitem.mold_component.name},
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -710,7 +763,7 @@ export default {
|
|||
currentAddRows2.push({
|
||||
component_id: pitem.component_id.toString(),
|
||||
process_id: pitem.mes_processes_id,
|
||||
process_detail: { id: pitem.mes_processes_id, name: pitem.mes_processes.name },
|
||||
process_detail: {id: pitem.mes_processes_id, name: pitem.mes_processes.name},
|
||||
})
|
||||
});
|
||||
|
||||
|
|
@ -730,7 +783,7 @@ export default {
|
|||
heightInit() {
|
||||
|
||||
this.$nextTick(() => {
|
||||
let h = this.$mk.getWindowSize().height - 500;
|
||||
let h = this.$mk.getWindowSize().height - 500;
|
||||
if (h < 400) {
|
||||
h = 400;
|
||||
}
|
||||
|
|
@ -775,12 +828,10 @@ export default {
|
|||
},
|
||||
|
||||
|
||||
|
||||
// 保存
|
||||
ok() {
|
||||
|
||||
|
||||
|
||||
let save = () => {
|
||||
|
||||
|
||||
|
|
@ -790,7 +841,7 @@ export default {
|
|||
let postdata = Object.assign({}, this.formOptions.data, this.formOptions2.data);
|
||||
|
||||
// 格式化提交的数据
|
||||
this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items });
|
||||
this.$mk.formatFormData({data: postdata, rules: this.formOptions.items});
|
||||
|
||||
|
||||
if (postdata.id) {
|
||||
|
|
@ -811,14 +862,18 @@ export default {
|
|||
}
|
||||
|
||||
if (postdata.mold_master_user_detail) {
|
||||
postdata.mold_master_name = postdata.mold_master_user_detail.name || '';
|
||||
postdata.mold_master_name = postdata.mold_master_user_detail.name || '';
|
||||
}
|
||||
if (postdata.engineer_detail) {
|
||||
postdata.engineer_name = postdata.engineer_detail.name || '';
|
||||
postdata.engineer_name = postdata.engineer_detail.name || '';
|
||||
}
|
||||
|
||||
postdata.mold_production_order_component = !this.isEdit ? [] : { insertList: [], deleteList: [], updateList: [] };
|
||||
postdata.mold_production_order_component_processes = !this.isEdit ? [] : { insertList: [], deleteList: [], updateList: [] };
|
||||
postdata.mold_production_order_component = !this.isEdit ? [] : {insertList: [], deleteList: [], updateList: []};
|
||||
postdata.mold_production_order_component_processes = !this.isEdit ? [] : {
|
||||
insertList: [],
|
||||
deleteList: [],
|
||||
updateList: []
|
||||
};
|
||||
|
||||
let componentDetails = this.$refs['componentDetail'];
|
||||
|
||||
|
|
@ -881,9 +936,8 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
}
|
||||
else{
|
||||
|
||||
} else {
|
||||
|
||||
this.pageInit();
|
||||
}
|
||||
|
||||
|
|
@ -898,14 +952,11 @@ export default {
|
|||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 验证表单
|
||||
this.$mk.validateForm({ form: this.$refs.xForm }).then(() => { // 验证表单
|
||||
this.$mk.validateForm({form: this.$refs.xForm}).then(() => { // 验证表单
|
||||
|
||||
save(); // 提交保存
|
||||
|
||||
save(); // 提交保存
|
||||
|
||||
}).catch(count => { // 验证失败
|
||||
this.$mk.error(`存在${count}项错误,请检查`);
|
||||
});
|
||||
|
|
@ -920,8 +971,6 @@ export default {
|
|||
},
|
||||
|
||||
|
||||
|
||||
|
||||
pageApproved() {
|
||||
let dataId = this.getDataId();
|
||||
if (!dataId) {
|
||||
|
|
@ -941,8 +990,7 @@ export default {
|
|||
if (a.code == "200") {
|
||||
this.$mk.success("审批成功");
|
||||
this.pageInit();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this.$mk.error(a.msg);
|
||||
}
|
||||
});
|
||||
|
|
@ -952,13 +1000,10 @@ export default {
|
|||
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 监听属性
|
||||
watch: {
|
||||
|
||||
}
|
||||
watch: {}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue