模具 优化 打印
This commit is contained in:
parent
8fb12e6448
commit
c80453cb57
|
|
@ -45,15 +45,9 @@
|
||||||
:params="{ data: options_user_type }" formatter='formatEnum'></vxe-column>
|
:params="{ data: options_user_type }" formatter='formatEnum'></vxe-column>
|
||||||
|
|
||||||
|
|
||||||
<vxe-column field="spec" title="规格" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
<vxe-column field="spec" title="规格" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
||||||
<vxe-column field="color" title="颜色" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
<vxe-column field="surface" title="表面工艺" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
||||||
<vxe-column field="material" title="材质" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
<vxe-column field="inlay" title="镶件材料" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
||||||
<vxe-column field="surface" title="表面工艺" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
|
||||||
<vxe-column field="rubber" title="胶件材质/缩水" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
|
||||||
<vxe-column field="inlay" title="镶件材料" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
|
||||||
<vxe-column field="hole" title="模具穴数" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
|
||||||
<vxe-column field="water" title="入水口类型/位置" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
|
||||||
|
|
||||||
|
|
||||||
<vxe-column field="remark" title="备注" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
<vxe-column field="remark" title="备注" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
||||||
|
|
||||||
|
|
@ -120,11 +114,11 @@
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
|
|
||||||
<vxe-column field="send_type" v-if="getDataId()" title="发料人员类型" width="160" :params="{ data: options_user_type }"
|
<vxe-column field="send_type" v-if="getDataId() && readonly" title="发料人员类型" width="160" :params="{ data: options_user_type }"
|
||||||
formatter='formatEnum'></vxe-column>
|
formatter='formatEnum'></vxe-column>
|
||||||
|
|
||||||
|
|
||||||
<vxe-column field="complete_type" v-if="getDataId()" title="完工人员类型" width="160"
|
<vxe-column field="complete_type" v-if="getDataId() && readonly" title="完工人员类型" width="160"
|
||||||
:params="{ data: options_user_type }" formatter='formatEnum'></vxe-column>
|
:params="{ data: options_user_type }" formatter='formatEnum'></vxe-column>
|
||||||
<vxe-column field="remark" title="备注" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
<vxe-column field="remark" title="备注" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
<a-tabs>
|
<a-tabs>
|
||||||
|
|
||||||
<a-tab-pane key="2" tab="工序详情">
|
<a-tab-pane key="2" tab="工序详情">
|
||||||
|
|
||||||
|
|
||||||
<div style="margin: 5px;">
|
<div style="margin: 5px;">
|
||||||
<a-radio-group v-model="departmentId" :options="departmentOptions" @change="departmentChange">
|
<a-radio-group v-model="departmentId" :options="departmentOptions" @change="departmentChange">
|
||||||
|
|
@ -30,8 +30,9 @@
|
||||||
<a-collapse :activeKey="collapseActiveKey">
|
<a-collapse :activeKey="collapseActiveKey">
|
||||||
|
|
||||||
<a-collapse-panel v-for="info in infos" :key="info.key" :header="info.header">
|
<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>
|
<component-detail :readonly="true" :dataId="getDataId()" :itemData="info.data"
|
||||||
|
@reloadData="pageInit"></component-detail>
|
||||||
|
|
||||||
</a-collapse-panel>
|
</a-collapse-panel>
|
||||||
</a-collapse>
|
</a-collapse>
|
||||||
|
|
@ -190,7 +191,7 @@ export default {
|
||||||
{ field: 'draw2D_time', dataRule: { type: 'timestamp' }, title: '出2D时间预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
{ field: 'draw2D_time', dataRule: { type: 'timestamp' }, title: '出2D时间预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||||
{ field: 'draw3D_time', dataRule: { type: 'timestamp' }, title: '出3D时间预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
{ field: 'draw3D_time', dataRule: { type: 'timestamp' }, title: '出3D时间预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||||
{ field: 'inlay_deep_hole_time', dataRule: { type: 'timestamp' }, title: '镶件深孔钻到厂日期预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
{ field: 'inlay_deep_hole_time', dataRule: { type: 'timestamp' }, title: '镶件深孔钻到厂日期预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||||
{ field: 'horizontal_frame_time', dataRule: { type: 'timestamp' }, title: '横架到厂日期预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
{ field: 'horizontal_frame_time', dataRule: { type: 'timestamp' }, title: '横架到厂日期预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||||
{
|
{
|
||||||
field: 'progress', title: '进度', span: 24, itemRender: {
|
field: 'progress', title: '进度', span: 24, itemRender: {
|
||||||
name: 'MkFormProgress', props: {
|
name: 'MkFormProgress', props: {
|
||||||
|
|
@ -311,7 +312,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
loadCount : 0,
|
loadCount: 0,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -344,7 +345,7 @@ export default {
|
||||||
// 函数
|
// 函数
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
loadDepartments() {
|
loadDepartments() {
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
|
|
@ -438,7 +439,7 @@ export default {
|
||||||
initComponentDetail() {
|
initComponentDetail() {
|
||||||
|
|
||||||
|
|
||||||
let infos = [];
|
let infos = [];
|
||||||
let keys = [];
|
let keys = [];
|
||||||
this.loadCount++;
|
this.loadCount++;
|
||||||
this.detailsData.forEach(item => {
|
this.detailsData.forEach(item => {
|
||||||
|
|
@ -456,18 +457,18 @@ export default {
|
||||||
};
|
};
|
||||||
this.detailsData2.forEach(pitem => {
|
this.detailsData2.forEach(pitem => {
|
||||||
if (pitem.component_id && pitem.component_id.toString() == item.component_id.toString()) {
|
if (pitem.component_id && pitem.component_id.toString() == item.component_id.toString()) {
|
||||||
if(this.departmentId){
|
if (this.departmentId) {
|
||||||
if (pitem.department_id && pitem.department_id.toString() == this.departmentId) {
|
if (pitem.department_id && pitem.department_id.toString() == this.departmentId) {
|
||||||
info.data.mold_production_order_component_processes.push(pitem);
|
info.data.mold_production_order_component_processes.push(pitem);
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
info.data.mold_production_order_component_processes.push(pitem);
|
info.data.mold_production_order_component_processes.push(pitem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if(!info.data.mold_production_order_component_processes.length){
|
if (!info.data.mold_production_order_component_processes.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -480,7 +481,7 @@ export default {
|
||||||
|
|
||||||
this.collapseActiveKey = keys;
|
this.collapseActiveKey = keys;
|
||||||
this.infos = infos
|
this.infos = infos
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setPageReadonly(readonly) {
|
setPageReadonly(readonly) {
|
||||||
|
|
@ -503,61 +504,7 @@ export default {
|
||||||
return XEUtils.toDateString(new Date(v * 1000), 'yyyy-MM-dd');
|
return XEUtils.toDateString(new Date(v * 1000), 'yyyy-MM-dd');
|
||||||
},
|
},
|
||||||
|
|
||||||
pageSelectComponent() {
|
|
||||||
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 }) => {
|
|
||||||
if (!data || !data.row1) {
|
|
||||||
this.$mk.error("未选择行");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$mk.post({
|
|
||||||
url: `${BASE_URL.BASE_URL}/MoldComponent/v1/mold/component/detail`,
|
|
||||||
data: {
|
|
||||||
id: this.$mk.toBigInt(data.row1.id)
|
|
||||||
},
|
|
||||||
useBigInt: true
|
|
||||||
}).then((a) => { // 成功回调
|
|
||||||
if (a.data && a.data.mold_component) {
|
|
||||||
let row = a.data.mold_component;
|
|
||||||
let mold_component_processes = row.mold_component_processes || [];
|
|
||||||
let currentAddRows1 = [];
|
|
||||||
let currentAddRows2 = [];
|
|
||||||
currentAddRows1.push({
|
|
||||||
component_id: row.id,
|
|
||||||
component_num: 1,
|
|
||||||
component_detail: { id: row.id, name: row.name },
|
|
||||||
})
|
|
||||||
mold_component_processes.forEach(pitem => {
|
|
||||||
currentAddRows2.push({
|
|
||||||
component_id: row.id,
|
|
||||||
process_id: pitem.mes_processes_id,
|
|
||||||
process_detail: { id: pitem.mes_processes_id, name: pitem.mes_processes.name },
|
|
||||||
})
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
this.addInfo({
|
|
||||||
rows1: currentAddRows1,
|
|
||||||
rows2: currentAddRows2,
|
|
||||||
header: data.row1.name
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
clearInfos() {
|
clearInfos() {
|
||||||
this.collapseActiveKey = [];
|
this.collapseActiveKey = [];
|
||||||
this.infos = [];
|
this.infos = [];
|
||||||
|
|
@ -667,7 +614,7 @@ export default {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.clearInfos();
|
this.clearInfos();
|
||||||
currentAddRows1.forEach(row => {
|
currentAddRows1.forEach(row => {
|
||||||
this.addInfo({
|
this.addInfo({
|
||||||
|
|
@ -675,7 +622,7 @@ export default {
|
||||||
rows2: currentAddRows2.filter(a => a.component_id == row.component_id),
|
rows2: currentAddRows2.filter(a => a.component_id == row.component_id),
|
||||||
header: row.component_detail.name
|
header: row.component_detail.name
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -746,7 +693,7 @@ export default {
|
||||||
// 格式化提交的数据
|
// 格式化提交的数据
|
||||||
this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items });
|
this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items });
|
||||||
|
|
||||||
|
|
||||||
if (postdata.id) {
|
if (postdata.id) {
|
||||||
postdata.id = this.$mk.toBigInt(postdata.id);
|
postdata.id = this.$mk.toBigInt(postdata.id);
|
||||||
}
|
}
|
||||||
|
|
@ -797,7 +744,7 @@ export default {
|
||||||
value: postdata.mold_production_order_component_processes
|
value: postdata.mold_production_order_component_processes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提交数据
|
// 提交数据
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: action,
|
url: action,
|
||||||
|
|
@ -877,7 +824,6 @@ export default {
|
||||||
sendApproved("");
|
sendApproved("");
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
print() { // 打印
|
print() { // 打印
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -897,37 +843,155 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tdata.qrcode = tdata.qr_code;
|
tdata.qrcode = tdata.qr_code;
|
||||||
tdata.details = JSON.parse(JSON.stringify(this.detailsData2));
|
|
||||||
|
|
||||||
tdata.details.forEach(item => {
|
|
||||||
|
|
||||||
if (item.component_detail && item.component_detail.name) {
|
let template = JSON.parse(JSON.stringify(settings.printTemplate));
|
||||||
item.component_detail_name = item.component_detail.name;
|
let addedHeight = 0;
|
||||||
|
|
||||||
|
|
||||||
|
let departments = [];
|
||||||
|
this.detailsData2.forEach(item => {
|
||||||
|
if (item.department_detail && item.department_detail.name && !departments.filter(a=>a.id == item.department_detail.id + "").length) {
|
||||||
|
departments.push({
|
||||||
|
id: item.department_detail.id + "",
|
||||||
|
name: item.department_detail.name
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (item.department_detail && item.department_detail.name) {
|
|
||||||
item.department_detail_name = item.department_detail.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.process_detail && item.process_detail.name) {
|
|
||||||
item.process_detail_name = item.process_detail.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.process_uid_detail && item.process_uid_detail.name) {
|
|
||||||
item.process_u_name = item.process_uid_detail.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
item.prepare_process_time = this.getDateValueString(item.prepare_process_time);
|
|
||||||
item.plan_complete_time = this.getDateValueString(item.plan_complete_time);
|
|
||||||
item.send_time = this.getDateValueString(item.send_time);
|
|
||||||
item.complete_time = this.getDateValueString(item.complete_time);
|
|
||||||
|
|
||||||
})
|
})
|
||||||
tdata.details = tdata.details.filter(a => a.component_detail_name && a.process_detail_name);
|
|
||||||
console.log(tdata);
|
console.log(JSON.stringify(departments))
|
||||||
|
departments.forEach((department, index) => {
|
||||||
|
|
||||||
|
let details2 = JSON.parse(JSON.stringify(this.detailsData2));
|
||||||
|
let ds2 = [];
|
||||||
|
|
||||||
|
let componentIds = [];
|
||||||
|
details2.forEach(item => {
|
||||||
|
if (item.component_detail && item.component_detail.name) {
|
||||||
|
item.component_detail_name = item.component_detail.name;
|
||||||
|
}
|
||||||
|
if (item.department_detail && item.department_detail.name) {
|
||||||
|
if ((item.department_detail.id + '') != (department.id + '')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
item.department_detail_name = item.department_detail.name;
|
||||||
|
}
|
||||||
|
if (!item.component_id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!componentIds.filter(a => a == item.component_id.toString()).length) {
|
||||||
|
componentIds.push(item.component_id.toString());
|
||||||
|
}
|
||||||
|
if (item.process_detail && item.process_detail.name) {
|
||||||
|
item.process_detail_name = item.process_detail.name;
|
||||||
|
}
|
||||||
|
if (item.process_uid_detail && item.process_uid_detail.name) {
|
||||||
|
item.process_u_name = item.process_uid_detail.name;
|
||||||
|
}
|
||||||
|
item.prepare_process_time = this.getDateValueString(item.prepare_process_time);
|
||||||
|
item.plan_complete_time = this.getDateValueString(item.plan_complete_time);
|
||||||
|
item.send_time = this.getDateValueString(item.send_time);
|
||||||
|
item.complete_time = this.getDateValueString(item.complete_time);
|
||||||
|
item.progress = (item.progress || 0) +"%";
|
||||||
|
ds2.push(item);
|
||||||
|
});
|
||||||
|
|
||||||
|
let groups = []; //按部件进行分组
|
||||||
|
componentIds.forEach(componentId => {
|
||||||
|
|
||||||
|
let group = {};
|
||||||
|
let d1 = [];
|
||||||
|
let d2 = [];
|
||||||
|
let ds1 = JSON.parse(JSON.stringify(this.detailsData));
|
||||||
|
ds1.forEach(item => {
|
||||||
|
|
||||||
|
if (item.component_detail && item.component_detail.name) {
|
||||||
|
item.component_detail_name = item.component_detail.name;
|
||||||
|
}
|
||||||
|
if (item.process_detail && item.process_detail.name) {
|
||||||
|
item.process_detail_name = item.process_detail.name;
|
||||||
|
}
|
||||||
|
item.prepare_process_time = this.getDateValueString(item.prepare_process_time);
|
||||||
|
item.plan_complete_time = this.getDateValueString(item.plan_complete_time);
|
||||||
|
item.send_time = this.getDateValueString(item.send_time);
|
||||||
|
item.complete_time = this.getDateValueString(item.complete_time);
|
||||||
|
item.production_type = item.production_type == 1 ?'正常布产' :'委外布产';
|
||||||
|
if (item.component_id && item.component_id.toString() == componentId) {
|
||||||
|
d1.push(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
ds2.forEach(item => {
|
||||||
|
if (item.component_id && item.component_id.toString() == componentId) {
|
||||||
|
d2.push(item);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
group.d1 = d1;
|
||||||
|
group.d2 = d2;
|
||||||
|
groups.push(group);
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
let ele2 = JSON.parse(JSON.stringify(settings.printTemplateDepartment));
|
||||||
|
let ele3 = JSON.parse(JSON.stringify(settings.printTemplateProgress));
|
||||||
|
ele2.options.field = 'department_' + index;
|
||||||
|
ele3.options.field = 'progress_' + index;
|
||||||
|
let progress = 0;
|
||||||
|
var dps = this.detailsData3.filter(a => a.id.toString() == department.id.toString());
|
||||||
|
if (dps.length) {
|
||||||
|
progress = dps[0].progress;
|
||||||
|
}
|
||||||
|
tdata['department_' + index] = department.name;
|
||||||
|
tdata['progress_' + index] = progress + "%";
|
||||||
|
|
||||||
|
ele2.options.top += addedHeight;
|
||||||
|
ele3.options.top += addedHeight;
|
||||||
|
|
||||||
|
template.panels[0].printElements.push(ele2)
|
||||||
|
template.panels[0].printElements.push(ele3)
|
||||||
|
|
||||||
|
|
||||||
|
groups.forEach((group, groupIndex) => {
|
||||||
|
|
||||||
|
let key1 = 'details1_' + index + "_" + groupIndex;
|
||||||
|
let key2 = 'details2_' + index + "_" + groupIndex;
|
||||||
|
tdata[key1] = group.d1;
|
||||||
|
tdata[key2] = group.d2;
|
||||||
|
|
||||||
|
let elet1 = JSON.parse(JSON.stringify(settings.printTemplateTable1))
|
||||||
|
let elet2 = JSON.parse(JSON.stringify(settings.printTemplateTable2))
|
||||||
|
|
||||||
|
elet1.options.field = key1;
|
||||||
|
elet2.options.field = key2;
|
||||||
|
|
||||||
|
elet1.options.top += addedHeight;
|
||||||
|
elet2.options.top += addedHeight;
|
||||||
|
|
||||||
|
template.panels[0].printElements.push(elet1)
|
||||||
|
template.panels[0].printElements.push(elet2)
|
||||||
|
|
||||||
|
addedHeight += 80;
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
addedHeight += 20;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
hiprint.init(); // 初始化打印组件
|
hiprint.init(); // 初始化打印组件
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var hiprintTemplate = new hiprint.PrintTemplate({ // 创建打印模板
|
var hiprintTemplate = new hiprint.PrintTemplate({ // 创建打印模板
|
||||||
template: settings.printTemplate // 模板内容
|
template: template
|
||||||
});
|
});
|
||||||
hiprintTemplate.print(tdata, { printer: '', title: '工艺布产' }); // 打印
|
hiprintTemplate.print(tdata, { printer: '', title: '工艺布产' }); // 打印
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,7 @@
|
||||||
<a-button type="primary" @click="ok" :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"
|
<a-button v-if="false" @click="pageApproved" type="primary"
|
||||||
:disabled="!this.getDataId() || pageStatus == 'approved'">审批
|
:disabled="!this.getDataId() || pageStatus == 'approved'">审批
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button @click="print">打印</a-button>
|
|
||||||
|
|
||||||
<a-button @click="back">关闭</a-button>
|
<a-button @click="back">关闭</a-button>
|
||||||
|
|
||||||
|
|
@ -185,6 +184,12 @@ export default {
|
||||||
{ field: 'code', title: '编号', span: 8, itemRender: { name: '$input' } },
|
{ field: 'code', title: '编号', span: 8, itemRender: { name: '$input' } },
|
||||||
|
|
||||||
{ field: 'production_type', dataRule: { type: 'integer' }, title: '布产类型', span: 8, itemRender: { name: '$select', props: { options: options_production_type } } },
|
{ field: 'production_type', dataRule: { type: 'integer' }, title: '布产类型', span: 8, itemRender: { name: '$select', props: { options: options_production_type } } },
|
||||||
|
|
||||||
|
|
||||||
|
{ field: 'rubber', title: '胶件材质/缩水', span: 8, itemRender: { name: '$input' } },
|
||||||
|
{ field: 'hole', title: '模具穴数', span: 8, itemRender: { name: '$input' } },
|
||||||
|
{ field: 'water', title: '入水口类型/位置', span: 8, itemRender: { name: '$input' } },
|
||||||
|
|
||||||
|
|
||||||
{ field: 'manufacture_cycle', dataRule: { type: 'timestamp' }, title: '制作周期', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
{ field: 'manufacture_cycle', dataRule: { type: 'timestamp' }, title: '制作周期', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||||
{ field: 'draw_start_time', dataRule: { type: 'timestamp' }, title: '预计开始画图时间', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
{ field: 'draw_start_time', dataRule: { type: 'timestamp' }, title: '预计开始画图时间', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||||
|
|
@ -485,7 +490,18 @@ export default {
|
||||||
if (!v) return '';
|
if (!v) return '';
|
||||||
return XEUtils.toDateString(new Date(v * 1000), 'yyyy-MM-dd');
|
return XEUtils.toDateString(new Date(v * 1000), 'yyyy-MM-dd');
|
||||||
},
|
},
|
||||||
|
existComonent({ component_id }) {
|
||||||
|
let exist = false;
|
||||||
|
this.infos.forEach(info => {
|
||||||
|
info.data.mold_production_order_component.forEach(row => {
|
||||||
|
if (row.component_id.toString() == component_id) {
|
||||||
|
exist = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return exist;
|
||||||
|
|
||||||
|
},
|
||||||
pageSelectComponent() {
|
pageSelectComponent() {
|
||||||
let { width, height } = this.$mk.getWindowSize();
|
let { width, height } = this.$mk.getWindowSize();
|
||||||
this.$mk.dialog.open({
|
this.$mk.dialog.open({
|
||||||
|
|
@ -509,6 +525,10 @@ export default {
|
||||||
}).then((a) => { // 成功回调
|
}).then((a) => { // 成功回调
|
||||||
if (a.data && a.data.mold_component) {
|
if (a.data && a.data.mold_component) {
|
||||||
let row = a.data.mold_component;
|
let row = a.data.mold_component;
|
||||||
|
if (this.existComonent({ component_id: row.id.toString() })) {
|
||||||
|
this.$mk.error("该部件已经存在");
|
||||||
|
return;
|
||||||
|
}
|
||||||
let mold_component_processes = row.mold_component_processes || [];
|
let mold_component_processes = row.mold_component_processes || [];
|
||||||
let currentAddRows1 = [];
|
let currentAddRows1 = [];
|
||||||
let currentAddRows2 = [];
|
let currentAddRows2 = [];
|
||||||
|
|
@ -577,7 +597,6 @@ export default {
|
||||||
|
|
||||||
let detail = data.row2;
|
let detail = data.row2;
|
||||||
|
|
||||||
console.log(detail)
|
|
||||||
this.formOptions.data.mold_detail = detail.mold_scheme;
|
this.formOptions.data.mold_detail = detail.mold_scheme;
|
||||||
this.formOptions.data.mold_id = detail.mold_id;
|
this.formOptions.data.mold_id = detail.mold_id;
|
||||||
|
|
||||||
|
|
@ -611,7 +630,7 @@ export default {
|
||||||
this.formOptions.data = JSON.parse(JSON.stringify(this.formOptions.data))
|
this.formOptions.data = JSON.parse(JSON.stringify(this.formOptions.data))
|
||||||
|
|
||||||
|
|
||||||
this.loadMoleData(detail.mold_id);
|
//this.loadMoleData(detail.mold_id);
|
||||||
|
|
||||||
|
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
|
|
@ -881,59 +900,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
print() { // 打印
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let hiprint = this.$hiPrint; // 获取打印组件
|
|
||||||
let tdata = JSON.parse(JSON.stringify(this.formOptions.data)); // 复制表单数据
|
|
||||||
|
|
||||||
if (tdata.mold_order) {
|
|
||||||
tdata.order_code = tdata.mold_order.name || '';
|
|
||||||
}
|
|
||||||
if (tdata.mold_detail) {
|
|
||||||
tdata.mold_name = tdata.mold_detail.name || '';
|
|
||||||
}
|
|
||||||
for (let name in tdata) {
|
|
||||||
if (name.indexOf('_time') != -1 && tdata[name] && tdata[name].indexOf('T') != -1) {
|
|
||||||
tdata[name] = tdata[name].split('T')[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tdata.qrcode = tdata.qr_code;
|
|
||||||
tdata.details = JSON.parse(JSON.stringify(this.detailsData2));
|
|
||||||
|
|
||||||
tdata.details.forEach(item => {
|
|
||||||
|
|
||||||
if (item.component_detail && item.component_detail.name) {
|
|
||||||
item.component_detail_name = item.component_detail.name;
|
|
||||||
}
|
|
||||||
if (item.department_detail && item.department_detail.name) {
|
|
||||||
item.department_detail_name = item.department_detail.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.process_detail && item.process_detail.name) {
|
|
||||||
item.process_detail_name = item.process_detail.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.process_uid_detail && item.process_uid_detail.name) {
|
|
||||||
item.process_u_name = item.process_uid_detail.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
item.prepare_process_time = this.getDateValueString(item.prepare_process_time);
|
|
||||||
item.plan_complete_time = this.getDateValueString(item.plan_complete_time);
|
|
||||||
item.send_time = this.getDateValueString(item.send_time);
|
|
||||||
item.complete_time = this.getDateValueString(item.complete_time);
|
|
||||||
|
|
||||||
})
|
|
||||||
tdata.details = tdata.details.filter(a => a.component_detail_name && a.process_detail_name);
|
|
||||||
console.log(tdata);
|
|
||||||
|
|
||||||
hiprint.init(); // 初始化打印组件
|
|
||||||
var hiprintTemplate = new hiprint.PrintTemplate({ // 创建打印模板
|
|
||||||
template: settings.printTemplate // 模板内容
|
|
||||||
});
|
|
||||||
hiprintTemplate.print(tdata, { printer: '', title: '工艺布产' }); // 打印
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 监听属性
|
// 监听属性
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,26 @@
|
||||||
<template>
|
<template>
|
||||||
<basic-page-list ref="listPage" :desc="desc" :options="pageOptions">
|
<basic-page-list ref="listPage" :desc="desc" :options="pageOptions">
|
||||||
<template v-slot:column1="{ row }">
|
<template v-slot:column1="{ row }">
|
||||||
<a-button @click.stop="pageDetail(row)">查看详情</a-button>
|
<a-button @click.stop="pageDetail(row)">查看详情</a-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:column2="{ row }">
|
||||||
|
<a-table :columns="columns" :data-source="row.department_progress" style="border:1px solid #afafaf">
|
||||||
|
<span slot="progress" slot-scope="progress">
|
||||||
|
<a-progress type="line" :percent="progress" />
|
||||||
|
</span>
|
||||||
|
</a-table>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<template v-slot:column3="{ row }">
|
||||||
|
<a-table :columns="columns" :data-source="row.department_progress" style="border:1px solid #afafaf;margin: 15px;">
|
||||||
|
<span slot="progress" slot-scope="progress">
|
||||||
|
<a-progress type="line" :percent="progress" />
|
||||||
|
</span>
|
||||||
|
</a-table>
|
||||||
|
</template>
|
||||||
|
|
||||||
</basic-page-list>
|
</basic-page-list>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -17,6 +35,31 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
columns: [
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '部门名',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '部门编码',
|
||||||
|
dataIndex: 'code',
|
||||||
|
key: 'code',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '工序数量',
|
||||||
|
dataIndex: 'process_num',
|
||||||
|
key: 'process_num',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '进度',
|
||||||
|
dataIndex: 'progress',
|
||||||
|
key: 'progress',
|
||||||
|
slots: { title: 'progress' },
|
||||||
|
scopedSlots: { customRender: 'progress' },
|
||||||
|
},
|
||||||
|
],
|
||||||
pageOptions: {}
|
pageOptions: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -35,7 +78,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 动作
|
// 动作
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
optionsInit() {
|
optionsInit() {
|
||||||
|
|
@ -58,7 +101,7 @@ export default {
|
||||||
exportFileTitle: "模型",
|
exportFileTitle: "模型",
|
||||||
enabledExport: false,
|
enabledExport: false,
|
||||||
enabledImport: false,
|
enabledImport: false,
|
||||||
enabledImportTemplate: false,
|
enabledImportTemplate: false,
|
||||||
|
|
||||||
//搜索区
|
//搜索区
|
||||||
searchFormData: {
|
searchFormData: {
|
||||||
|
|
@ -66,14 +109,14 @@ export default {
|
||||||
desc: '',
|
desc: '',
|
||||||
},
|
},
|
||||||
// 搜索区配置
|
// 搜索区配置
|
||||||
searchRules: [
|
searchRules: [
|
||||||
{ key: "code", mode: "like" }
|
{ key: "code", mode: "like" }
|
||||||
],
|
],
|
||||||
//搜索区
|
//搜索区
|
||||||
searchFormItems: [ // 子项
|
searchFormItems: [ // 子项
|
||||||
|
|
||||||
|
|
||||||
{ field: 'code', title: '编码', span: 6, itemRender: { name: '$input', props: { placeholder: '请输入编码' } } },
|
{ field: 'code', title: '编码', span: 6, itemRender: { name: '$input', props: { placeholder: '请输入编码' } } },
|
||||||
|
|
||||||
{
|
{
|
||||||
align: 'right', span: 4, itemRender: { // 按钮列
|
align: 'right', span: 4, itemRender: { // 按钮列
|
||||||
|
|
@ -92,17 +135,21 @@ export default {
|
||||||
|
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
columns: [
|
columns: [
|
||||||
{ type: 'checkbox', width: 80 }, // 多选框
|
{ type: 'checkbox', width: 80 }, // 多选框
|
||||||
{ type: 'seq', width:80 }, // 序号
|
{ type: 'seq', width: 60 }, // 序号
|
||||||
|
|
||||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
{ title: '操作', slots: { default: 'op' }, width: 90 },
|
||||||
|
|
||||||
{ slots: { default: 'column1' }, title: '查看详情', width: 180 },
|
|
||||||
{ field:'code', title: '编码', width: 180 },
|
|
||||||
{ field: 'mold_order',formatter: 'formatRef',params:{dataType:"object",textField:"code"}, sortable: false, title: '订单编号', width: 150 },
|
{ slots: { default: 'column1' }, title: '查看详情', width: 120 },
|
||||||
{ field: 'mold_detail',formatter: 'formatRef',params:{dataType:"object",textField:"name"}, sortable: false, title: '模具', width: 150 },
|
{ field: 'code', title: '编码', width: 100 },
|
||||||
{ field: 'progress', cellRender:{name: 'progress'}, sortable: true, title: '进度', showHeaderOverflow: true },
|
{ field: 'mold_master_user_detail', formatter: 'formatRef', params: { dataType: "object", textField: "name" }, title: '模具师傅', width: 120 },
|
||||||
|
{ field: 'mold_order', formatter: 'formatRef', params: { dataType: "object", textField: "code" }, sortable: false, title: '订单编号', width: 120 },
|
||||||
|
{ field: 'mold_detail', formatter: 'formatRef', params: { dataType: "object", textField: "name" }, sortable: false, title: '模具', width: 120 },
|
||||||
|
{ field: 'progress', width: 100, cellRender: { name: 'progress' }, sortable: true, title: '总进度', showHeaderOverflow: true },
|
||||||
|
// { slots: { default: 'column2' },width: 200, title: '进度明细', showHeaderOverflow: true },
|
||||||
|
{ slots: { content: 'column3' }, type: "expand", width: 100, title: '进度明细', showHeaderOverflow: true },
|
||||||
{ field: 'create_time', formatter: 'formatDate', width: 100, sortable: true, title: '创建时间', showHeaderOverflow: true }, // 创建时间
|
{ field: 'create_time', formatter: 'formatDate', width: 100, sortable: true, title: '创建时间', showHeaderOverflow: true }, // 创建时间
|
||||||
{ field: 'update_time', formatter: 'formatDate', width: 100, sortable: true, title: '更新时间', showHeaderOverflow: true }, // 更新时间
|
{ field: 'update_time', formatter: 'formatDate', width: 100, sortable: true, title: '更新时间', showHeaderOverflow: true }, // 更新时间
|
||||||
|
|
||||||
|
|
@ -113,13 +160,13 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pageData.gridOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridOptions); // 合并表格数据
|
pageData.gridOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridOptions); // 合并表格数据
|
||||||
|
|
||||||
|
|
||||||
this.pageOptions = pageData;
|
this.pageOptions = pageData;
|
||||||
},
|
},
|
||||||
pageDetail(row){
|
pageDetail(row) {
|
||||||
|
|
||||||
if (!row) {
|
if (!row) {
|
||||||
this.$mk.msg("请选择行");
|
this.$mk.msg("请选择行");
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue