This commit is contained in:
parent
803d6eb9e3
commit
2041996371
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
import XEUtils from 'xe-utils' // 加载xe-utils
|
||||
import JSONbig from 'json-bigint'
|
||||
export default {
|
||||
|
||||
|
|
@ -11,6 +12,16 @@ export default {
|
|||
},
|
||||
|
||||
|
||||
getDateString(cellValue) {
|
||||
if (!cellValue) {
|
||||
return '';
|
||||
}
|
||||
if (typeof (cellValue) == "number") {
|
||||
cellValue = new Date(cellValue * 1000);
|
||||
}
|
||||
return XEUtils.toDateString(cellValue, 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
|
||||
formatDetailData({ data, rules }) {
|
||||
|
||||
if (data.create_time) {
|
||||
|
|
@ -55,29 +66,29 @@ export default {
|
|||
|
||||
//格式化提交的明细类型 字段
|
||||
//如果要提交的数据(value) 已经不存在 原有数据 (oldlistdata) ,那么需要把id放到 value.deleteList
|
||||
formatPostFieldValue({dataId,oldlistdata,value}){
|
||||
if(!dataId){
|
||||
formatPostFieldValue({ dataId, oldlistdata, value }) {
|
||||
if (!dataId) {
|
||||
return;
|
||||
}
|
||||
if(!oldlistdata){
|
||||
if (!oldlistdata) {
|
||||
return;
|
||||
}
|
||||
if(!value){
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
if(!value.insertList){
|
||||
if (!value.insertList) {
|
||||
return;
|
||||
}
|
||||
oldlistdata.forEach(item=>{
|
||||
if(!item.id){
|
||||
oldlistdata.forEach(item => {
|
||||
if (!item.id) {
|
||||
return;
|
||||
}
|
||||
let exist1 = value.insertList.filter(a=>a.id && a.id.toString() == item.id.toString()).length;
|
||||
let exist2 = value.updateList.filter(a=>a.id && a.id.toString() == item.id.toString()).length;
|
||||
let exist3 = value.deleteList.filter(a=>a == item.id.toString()).length;
|
||||
if(!exist1 && !exist2 && !exist3){
|
||||
let exist1 = value.insertList.filter(a => a.id && a.id.toString() == item.id.toString()).length;
|
||||
let exist2 = value.updateList.filter(a => a.id && a.id.toString() == item.id.toString()).length;
|
||||
let exist3 = value.deleteList.filter(a => a == item.id.toString()).length;
|
||||
if (!exist1 && !exist2 && !exist3) {
|
||||
value.deleteList.push(item.id.toString());
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return value;
|
||||
|
|
@ -104,13 +115,13 @@ export default {
|
|||
item[rule.field] = parseFloat(value);
|
||||
}
|
||||
else if (rule.type == "timestamp") {
|
||||
if(value){
|
||||
if(typeof(value) == 'string'){
|
||||
if (value) {
|
||||
if (typeof (value) == 'string') {
|
||||
item[rule.field] = parseInt(new Date(value).getTime() / 1000);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (rule.type == "bigint") {
|
||||
if (typeof (item[rule.field]) == 'string') {
|
||||
|
|
@ -127,7 +138,7 @@ export default {
|
|||
list.forEach(item => {
|
||||
item[fieldName] = dataId;
|
||||
})
|
||||
}
|
||||
}
|
||||
if (dataId && type !== 'array') {
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
</template>
|
||||
</vxe-column>
|
||||
|
||||
<vxe-column field="process_detail" title="加工人员" width="160" :params="editor_d1_process" formatter="formatRef"
|
||||
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
|
||||
<vxe-column v-if="false" field="process_detail" title="加工人员" width="160" :params="editor_d1_process"
|
||||
formatter="formatRef" :edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
|
||||
|
||||
|
||||
<vxe-column field="prepare_process_time" title="预备加工日期" width="160" formatter="formatDate"
|
||||
|
|
@ -28,39 +28,18 @@
|
|||
<vxe-column field="plan_complete_time" title="计划完成日期" width="160" formatter="formatDate"
|
||||
:edit-render="{ name: '$input', props: { type: 'date' } }"></vxe-column>
|
||||
|
||||
<vxe-column field="is_send" title="是否发料" width="160" :params="{ data: options_is_send }" formatter='formatEnum'
|
||||
:edit-render="{}">
|
||||
<template #edit="{ row }">
|
||||
<vxe-select v-model="row.is_send" transfer>
|
||||
<vxe-option v-for="item in options_is_send" :key="item.value" :value="item.value"
|
||||
:label="item.label"></vxe-option>
|
||||
</vxe-select>
|
||||
|
||||
<vxe-column title="完成" width="160">
|
||||
<template #default="{ row }">
|
||||
<div v-if="getDataId()">
|
||||
|
||||
<a-button v-if="pageIsComplete()" @click.stop="pageComplete(row)">完成</a-button>
|
||||
|
||||
<div v-if="row.complete_time">{{ $mk.getDateString(row.complete_time) }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
<vxe-column field="send_time" title="发料时间" width="160" formatter="formatDate"
|
||||
:edit-render="{ name: '$input', props: { type: 'date' } }"></vxe-column>
|
||||
|
||||
<vxe-column field="send_detail" title="发料人员" width="160" :params="editor_d1_send" formatter="formatRef"
|
||||
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
|
||||
|
||||
|
||||
<vxe-column field="is_complete" title="是否完成" width="160" :params="{ data: options_is_complete }"
|
||||
formatter='formatEnum' :edit-render="{}">
|
||||
<template #edit="{ row }">
|
||||
<vxe-select v-model="row.is_complete" transfer>
|
||||
<vxe-option v-for="item in options_is_complete" :key="item.value" :value="item.value"
|
||||
:label="item.label"></vxe-option>
|
||||
</vxe-select>
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
<vxe-column field="complete_time" title="实际完成时间" width="160" formatter="formatDate"
|
||||
:edit-render="{ name: '$input', props: { type: 'date' } }"></vxe-column>
|
||||
|
||||
|
||||
<vxe-column field="send_type" title="发料人员类型" width="160" :params="{ data: options_user_type }"
|
||||
formatter='formatEnum' :edit-render="{ name: '$select', props: { options: options_user_type } }"></vxe-column>
|
||||
|
||||
|
||||
<vxe-column field="complete_type" title="完工人员类型" width="160" :params="{ data: options_user_type }"
|
||||
|
|
@ -73,7 +52,7 @@
|
|||
<vxe-table border show-overflow keep-source ref="xTable2" :data="detailsData2" @pulldownSelected="onPulldownSelected"
|
||||
@popupSelected="onPopupSelected" :export-config="{}" @edit-closed="afterEditEvent" @edit-actived="beforeEditEvent"
|
||||
:edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false, beforeEditMethod: beforeEditMethod }">
|
||||
<vxe-column width="60" v-if="pageStatus != 'approved'">
|
||||
<vxe-column width="60" v-if="!readonly">
|
||||
<template #default="{ row }">
|
||||
<div class="oplinks2">
|
||||
<a @click.stop="pageAdd2(row)" title="新增">
|
||||
|
|
@ -91,8 +70,8 @@
|
|||
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
|
||||
|
||||
|
||||
<vxe-column field="process_uid_detail" title="加工人员" width="160" :params="editor_process_uid" formatter="formatRef"
|
||||
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
|
||||
<vxe-column v-if="false" field="process_uid_detail" title="加工人员" width="160" :params="editor_process_uid"
|
||||
formatter="formatRef" :edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
|
||||
|
||||
<vxe-column field="progress" v-if="isEdit" :cellRender="{ name: 'progress' }" title="进度" width="180"></vxe-column>
|
||||
|
||||
|
|
@ -102,13 +81,23 @@
|
|||
:edit-render="{ name: '$input', props: { type: 'date' } }"></vxe-column>
|
||||
|
||||
|
||||
<vxe-column field="is_send" title="是否发料" width="160" :params="{ data: options_is_send }"
|
||||
formatter='formatEnum'></vxe-column>
|
||||
<vxe-column field="send_time" title="发料时间" width="160" formatter="formatDate"></vxe-column>
|
||||
<vxe-column title="发料" width="160">
|
||||
<template #default="{ row }">
|
||||
<div v-if="getDataId()">
|
||||
<a-button v-if="!row.is_send" @click.stop="pageSend(row)">发料</a-button>
|
||||
<div v-if="row.is_send">{{ $mk.getDateString(row.send_time) }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
<vxe-column field="is_complete" title="是否完成" width="160" :params="{ data: options_is_complete }"
|
||||
formatter='formatEnum'></vxe-column>
|
||||
<vxe-column field="complete_time" title="实际完成时间" width="160" formatter="formatDate"></vxe-column>
|
||||
<vxe-column title="完成" width="160">
|
||||
<template #default="{ row }">
|
||||
<div v-if="getDataId()">
|
||||
<a-button v-if="!row.is_complete" @click.stop="pageDone(row)">完成</a-button>
|
||||
<div v-if="row.is_complete">{{ $mk.getDateString(row.complete_time) }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
<vxe-column field="send_type" title="发料人员类型" width="160" :params="{ data: options_user_type }"
|
||||
formatter='formatEnum'></vxe-column>
|
||||
|
|
@ -143,6 +132,10 @@ export default {
|
|||
type: String,
|
||||
default: "edit"
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
itemData: {
|
||||
type: Object
|
||||
},
|
||||
|
|
@ -371,12 +364,57 @@ export default {
|
|||
this.detailsData = JSON.parse(JSON.stringify(this.itemData.mold_production_order_component || []));
|
||||
this.detailsData2 = JSON.parse(JSON.stringify(this.itemData.mold_production_order_component_processes || []));
|
||||
|
||||
this.loadDepartment();
|
||||
|
||||
this.detailsDataInit();
|
||||
|
||||
this.postDataUpdate();
|
||||
|
||||
},
|
||||
|
||||
loadDepartment() {
|
||||
|
||||
for (let i = 0; i < this.detailsData2.length; i++) {
|
||||
if (this.detailsData2[i].process_id && !this.detailsData2[i].department_id) {
|
||||
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/MesProcesses/v1/mes/processes/detail`,
|
||||
data: {
|
||||
id: this.$mk.toBigInt(this.detailsData2[i].process_id)
|
||||
},
|
||||
useBigInt: true,
|
||||
}).then(a => {
|
||||
if (a.code == 200) {
|
||||
let row = a.data.mes_processes;
|
||||
if (row.department_id) {
|
||||
this.detailsData2[i].department_id = row.department_id;
|
||||
this.detailsData2[i].department_detail = row.department_detail;
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
pageIsComplete() {
|
||||
for (let i = 0; i < this.detailsData.length; i++) {
|
||||
if (this.detailsData[i].is_complete) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.detailsData2.length; i++) {
|
||||
if (!this.detailsData2[i].is_complete) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
|
||||
|
||||
getDateValue(v) {
|
||||
|
|
@ -397,17 +435,57 @@ export default {
|
|||
},
|
||||
// 获取路由的id参数
|
||||
getDataId() {
|
||||
let dataId = this.dataId;
|
||||
let dataId = this.dataId;
|
||||
return dataId;
|
||||
},
|
||||
getDataId_BigInt() {
|
||||
let dataId = this.getDataId();
|
||||
return this.$mk.toBigInt(dataId);
|
||||
},
|
||||
pageComplete(row) {
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/reporting`,
|
||||
data: {
|
||||
id: row.id
|
||||
},
|
||||
useBigInt: true,
|
||||
}).then(a => {
|
||||
if (a.code == 200) {
|
||||
this.$mk.success("操作成功");
|
||||
this.$emit("reloadData");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
pageDone(row) {
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/processes/Reporting`,
|
||||
data: {
|
||||
id: row.id
|
||||
},
|
||||
useBigInt: true,
|
||||
}).then(a => {
|
||||
if (a.code == 200) {
|
||||
this.$mk.success("操作成功");
|
||||
this.$emit("reloadData");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
pageSend(row) {
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/processes/SendMaterial`,
|
||||
data: {
|
||||
id: row.id
|
||||
},
|
||||
useBigInt: true,
|
||||
}).then(a => {
|
||||
if (a.code == 200) {
|
||||
this.$mk.success("操作成功");
|
||||
this.$emit("reloadData");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
pageAdd(row) {
|
||||
const $table = this.$refs.xTable
|
||||
|
|
@ -435,7 +513,6 @@ export default {
|
|||
this.postDataUpdate();
|
||||
},
|
||||
|
||||
|
||||
pageAdd2(row) {
|
||||
const $table = this.$refs.xTable2
|
||||
const record = {
|
||||
|
|
@ -462,7 +539,7 @@ export default {
|
|||
this.postDataUpdate();
|
||||
},
|
||||
|
||||
postDataUpdate(){
|
||||
postDataUpdate() {
|
||||
let postdata = {};
|
||||
postdata.mold_production_order_component = this.$mk.getPostFieldValue({
|
||||
rowFilter: (row) => { return row.id || row.component_id },
|
||||
|
|
@ -475,9 +552,10 @@ export default {
|
|||
{ field: 'component_num', type: 'integer' },
|
||||
{ field: 'prepare_process_time', type: 'timestamp' },
|
||||
{ field: 'plan_complete_time', type: 'timestamp' },
|
||||
|
||||
|
||||
{ field: 'id', type: 'bigint' },
|
||||
{ field: 'update_uid', type: 'bigint' },
|
||||
{ field: 'complete_uid', type: 'bigint' },
|
||||
{ field: 'create_uid', type: 'bigint' },
|
||||
{ field: 'mold_id', type: 'bigint' },
|
||||
{ field: 'component_id', type: 'bigint' },
|
||||
|
|
@ -497,8 +575,10 @@ export default {
|
|||
{ field: 'id', type: 'bigint' },
|
||||
{ field: 'prepare_process_time', type: 'timestamp' },
|
||||
{ field: 'plan_complete_time', type: 'timestamp' },
|
||||
|
||||
|
||||
|
||||
{ field: 'send_uid', type: 'bigint' },
|
||||
{ field: 'complete_uid', type: 'bigint' },
|
||||
{ field: 'update_uid', type: 'bigint' },
|
||||
{ field: 'create_uid', type: 'bigint' },
|
||||
{ field: 'component_id', type: 'bigint' },
|
||||
|
|
@ -523,10 +603,13 @@ export default {
|
|||
|
||||
this.postDataUpdate();
|
||||
|
||||
|
||||
|
||||
},
|
||||
beforeEditEvent({ column, row }) {
|
||||
console.log(column, row);
|
||||
if(this.readonly){
|
||||
return false;
|
||||
}
|
||||
},
|
||||
onPulldownSelected({ row, selectedData, column }) {
|
||||
console.log(selectedData);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,907 @@
|
|||
<template>
|
||||
<div class="page-body">
|
||||
|
||||
<div class="approvedbg" v-if="pageStatus == 'approved'"></div>
|
||||
|
||||
<div class="voucher-toolbar">
|
||||
<div class="voucher-toolbar-left">
|
||||
|
||||
|
||||
<a-button @click="print">打印</a-button>
|
||||
|
||||
<a-button @click="back">关闭</a-button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
|
||||
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
|
||||
</vxe-form>
|
||||
|
||||
<a-tabs>
|
||||
|
||||
<a-tab-pane key="2" tab="工序详情">
|
||||
|
||||
|
||||
<a-collapse :activeKey="collapseActiveKey">
|
||||
|
||||
<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 :readonly="true" :dataId="getDataId()" :itemData="info.data" @reloadData="pageInit"></component-detail>
|
||||
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
|
||||
|
||||
|
||||
</a-tab-pane>
|
||||
|
||||
|
||||
<a-tab-pane key="3" tab="部门进度汇总" v-if="isEdit">
|
||||
<vxe-table border show-overflow keep-source ref="xTable3" :height="table1Height" :data="detailsData3">
|
||||
|
||||
<vxe-column field="name" title="部门名称" width="160"></vxe-column>
|
||||
<vxe-column field="process_num" title="工序数量" width="160"></vxe-column>
|
||||
<vxe-column field="progress" :cellRender="{ name: 'progress' }" title="进度" width="180"></vxe-column>
|
||||
</vxe-table>
|
||||
|
||||
</a-tab-pane>
|
||||
|
||||
</a-tabs>
|
||||
|
||||
|
||||
|
||||
<div class="mk-toolbar" v-if="isEdit">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import ComponentDetail from './ComponentDetail'
|
||||
import BASE_URL from '@/services/mes/api.js';
|
||||
|
||||
import XEUtils from 'xe-utils' // 加载xe-utils
|
||||
const settings = require('../basic/settings.js');
|
||||
|
||||
export default {
|
||||
|
||||
name: '',
|
||||
components: { ComponentDetail },
|
||||
props: {
|
||||
pageMode: {
|
||||
type: String,
|
||||
default: "edit"
|
||||
},
|
||||
dataId: {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
data() {
|
||||
|
||||
const options_production_type = settings.options_production_type;
|
||||
const options_is_complete = settings.options_is_complete;
|
||||
const options_is_send = settings.options_is_send;
|
||||
const options_user_type = settings.options_user_type;
|
||||
|
||||
//let _this = this;
|
||||
// 页面数据变量
|
||||
var pageData = {
|
||||
|
||||
|
||||
options_production_type: options_production_type,
|
||||
options_is_complete: options_is_complete,
|
||||
options_is_send: options_is_send,
|
||||
options_user_type: options_user_type,
|
||||
collapseActiveKey: [],
|
||||
|
||||
infos: [],
|
||||
|
||||
// 当前项目名称
|
||||
currentConfigName: "",
|
||||
// 当前项目ID
|
||||
currentBeid: 0,
|
||||
|
||||
pageStatus: '',
|
||||
|
||||
uploadDefaultImg: null,
|
||||
detailDataFieldName: "mold_production_order",
|
||||
|
||||
actions: {
|
||||
get: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/detail`,
|
||||
create: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/create`,
|
||||
update: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/update`
|
||||
},
|
||||
|
||||
keyName: 'id',
|
||||
// 是否编辑模式
|
||||
isEdit: false,
|
||||
// 表单数据
|
||||
formOptions: {
|
||||
data: {
|
||||
production_type: "1"
|
||||
},
|
||||
// 标题宽度
|
||||
titleWidth: 150,
|
||||
// 标题对齐方式
|
||||
titleAlign: 'right',
|
||||
|
||||
// 表单校验规则
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '请输入编号' }
|
||||
],
|
||||
mold_order: [
|
||||
{ required: true, message: '请选择订单' }
|
||||
],
|
||||
mold_scheme: [
|
||||
{ required: true, message: '请选择模具' }
|
||||
],
|
||||
},
|
||||
// 表单项
|
||||
items: [
|
||||
|
||||
{
|
||||
title: '订单', span: 8,
|
||||
field: 'mold_order',
|
||||
itemRender: {
|
||||
name: 'MkFormInputShow', props: {
|
||||
params: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "name"
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: '模具', span: 8,
|
||||
field: 'mold_detail',
|
||||
itemRender: {
|
||||
name: 'MkFormInputShow', props: {
|
||||
params: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "name"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{ 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: '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: 'split_design_time', dataRule: { type: 'timestamp' }, title: '分模设计时间预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'draw_time', dataRule: { type: 'timestamp' }, title: '出图时间预计', 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: 'inlay_deep_hole_time', dataRule: { type: 'timestamp' }, title: '镶件深孔钻到厂日期预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{ field: 'problem', title: '出现问题及建议反馈', span: 8, itemRender: { name: '$input', props: {} } },
|
||||
{
|
||||
field: 'progress', title: '进度', span: 24, itemRender: {
|
||||
name: 'MkFormProgress', props: {
|
||||
params: {
|
||||
type: "line"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
// 新增模式表单项
|
||||
addModeItems: [
|
||||
|
||||
],
|
||||
|
||||
|
||||
table1Height: 400,
|
||||
detailsSourceData: [
|
||||
],
|
||||
detailsData: [
|
||||
],
|
||||
deletedDetailsData: [
|
||||
|
||||
],
|
||||
|
||||
detailsData2: [
|
||||
],
|
||||
deletedDetailsData2: [
|
||||
|
||||
],
|
||||
editor_component: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MoldComponent',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "component_id" }
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MoldComponent/v1/mold/component/list`
|
||||
},
|
||||
editor_department: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "name",
|
||||
listdataFieldName: 'BaseDepartment',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "department_id" }
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/BaseDepartment/v1/base/department/list`
|
||||
},
|
||||
|
||||
editor_processes: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesProcesses',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "process_id" }
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesProcesses/v1/mes/processes/list`
|
||||
},
|
||||
|
||||
editor_d1_process: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesStaff',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "process_uid" }
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||
},
|
||||
editor_d1_send: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesStaff',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "send_uid" }
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||
},
|
||||
editor_process_uid: {
|
||||
dataType: "object",
|
||||
valueField: "id",
|
||||
textField: "name",
|
||||
listdataFieldName: 'MesStaff',
|
||||
mapper: [
|
||||
{ fromField: "id", field: "process_uid" }
|
||||
],
|
||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||
},
|
||||
|
||||
|
||||
loadCount : 0,
|
||||
|
||||
};
|
||||
|
||||
|
||||
// 合并表单数据及配置
|
||||
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
|
||||
|
||||
return pageData;
|
||||
},
|
||||
|
||||
computed: {
|
||||
desc() {
|
||||
return this.$t('editPageDesc')
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
created() {
|
||||
|
||||
|
||||
|
||||
this.pageInit();
|
||||
|
||||
|
||||
this.heightInit();
|
||||
|
||||
},
|
||||
// 函数
|
||||
methods: {
|
||||
|
||||
|
||||
removeInfo(index) {
|
||||
this.infos.splice(index, 1);
|
||||
},
|
||||
|
||||
pageInit() {
|
||||
|
||||
this.pageStatus = '';
|
||||
// 获取路由的id参数
|
||||
let dataId = this.getDataId();
|
||||
|
||||
// 如果有id参数,说明是编辑模式
|
||||
if (dataId) {
|
||||
this.$mk.post({
|
||||
url: this.actions.get,
|
||||
loading: "加载中...",
|
||||
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.detailsData = JSON.parse(JSON.stringify(a.data[this.detailDataFieldName].mold_production_order_component || []));
|
||||
this.detailsData2 = JSON.parse(JSON.stringify(a.data[this.detailDataFieldName].mold_production_order_component_processes || []));
|
||||
|
||||
this.initComponentDetail();
|
||||
|
||||
|
||||
this.detailsData3 = JSON.parse(JSON.stringify(a.data[this.detailDataFieldName].department_progress || []));
|
||||
|
||||
if (a.data[this.detailDataFieldName].auditor_uid) {
|
||||
this.pageStatus = 'approved';
|
||||
}
|
||||
|
||||
|
||||
this.setPageReadonly(this.pageStatus == 'approved');
|
||||
|
||||
this.$forceUpdate();
|
||||
|
||||
});
|
||||
|
||||
this.isEdit = true;
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
// 如果没有id参数,说明是新增模式
|
||||
this.addModeItems.forEach(item => {
|
||||
this.formOptions.items.push(item);
|
||||
})
|
||||
this.setPageReadonly(this.pageStatus == 'approved');
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
initComponentDetail() {
|
||||
|
||||
|
||||
let keys = [];
|
||||
let infos = [];
|
||||
this.loadCount ++;
|
||||
this.detailsData.forEach(item => {
|
||||
|
||||
if (!item.component_id) {
|
||||
return;
|
||||
}
|
||||
let key = infos.length + '' + (this.loadCount + '');
|
||||
let info = {
|
||||
key: key, data: {
|
||||
mold_production_order_component: [item],
|
||||
mold_production_order_component_processes: []
|
||||
},
|
||||
header: item.component_detail.name
|
||||
};
|
||||
this.detailsData2.forEach(pitem => {
|
||||
if (pitem.component_id && pitem.component_id.toString() == item.component_id.toString()) {
|
||||
info.data.mold_production_order_component_processes.push(pitem);
|
||||
}
|
||||
|
||||
});
|
||||
keys.push(key);
|
||||
infos.push(info);
|
||||
})
|
||||
|
||||
|
||||
this.collapseActiveKey = keys;
|
||||
this.infos = infos
|
||||
|
||||
console.log(JSON.stringify(this.infos))
|
||||
},
|
||||
|
||||
setPageReadonly(readonly) {
|
||||
this.formOptions.items.forEach(item => {
|
||||
if (item.itemRender && item.itemRender.name == "$select") {
|
||||
item.itemRender.props.disabled = readonly;
|
||||
}
|
||||
if (item.itemRender && item.itemRender.props) {
|
||||
item.itemRender.props.readonly = readonly;
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
getDateValue(v) {
|
||||
return new Date(v * 1000);
|
||||
},
|
||||
getDateValueString(v) {
|
||||
if (!v) return '';
|
||||
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() {
|
||||
this.collapseActiveKey = [];
|
||||
this.infos = [];
|
||||
},
|
||||
addInfo({ rows1, rows2, header }) {
|
||||
let key = this.infos.length + '';
|
||||
let info = {
|
||||
key: key, data: {
|
||||
mold_production_order_component: rows1,
|
||||
mold_production_order_component_processes: rows2
|
||||
},
|
||||
header: header
|
||||
};
|
||||
this.collapseActiveKey = [...this.collapseActiveKey, key];
|
||||
this.infos = [...this.infos, info];
|
||||
},
|
||||
pageSelectOrder() {
|
||||
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 }) => {
|
||||
if (!data || !data.row2) {
|
||||
this.$mk.error("未选择明细行");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.formOptions.data.mold_order = data.row1;
|
||||
this.formOptions.data.order_id = data.row1.id;
|
||||
|
||||
let detail = data.row2;
|
||||
|
||||
console.log(detail)
|
||||
this.formOptions.data.mold_detail = detail.mold_scheme;
|
||||
this.formOptions.data.mold_id = detail.mold_id;
|
||||
|
||||
|
||||
if (detail.draw_start_time) {
|
||||
this.formOptions.data.draw_start_time = this.getDateValue(detail.draw_start_time);
|
||||
}
|
||||
|
||||
if (detail.split_design_time) {
|
||||
this.formOptions.data.split_design_time = this.getDateValue(detail.split_design_time);
|
||||
}
|
||||
|
||||
if (detail.draw_time) {
|
||||
this.formOptions.data.draw_time = this.getDateValue(detail.draw_time);
|
||||
}
|
||||
if (detail.draw2D_time) {
|
||||
this.formOptions.data.draw2D_time = this.getDateValue(detail.draw2D_time);
|
||||
}
|
||||
if (detail.draw3D_time) {
|
||||
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 = JSON.parse(JSON.stringify(this.formOptions.data))
|
||||
|
||||
|
||||
this.loadMoleData(detail.mold_id);
|
||||
|
||||
|
||||
this.$forceUpdate()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
loadMoleData(mold_id) {
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/MoldScheme/v1/mold/scheme/detail`,
|
||||
data: {
|
||||
id: this.$mk.toBigInt(mold_id)
|
||||
},
|
||||
useBigInt: true
|
||||
}).then((a) => { // 成功回调
|
||||
if (a.data && a.data.mold_scheme) {
|
||||
|
||||
|
||||
let row = a.data.mold_scheme;
|
||||
let mold_scheme_processes = row.mold_scheme_processes || [];
|
||||
let currentAddRows1 = [];
|
||||
let currentAddRows2 = [];
|
||||
|
||||
mold_scheme_processes.forEach(pitem => {
|
||||
|
||||
if (!currentAddRows1.filter(a => a.component_id == pitem.component_id.toString()).length) {
|
||||
currentAddRows1.push({
|
||||
component_id: pitem.component_id.toString(),
|
||||
component_num: 1,
|
||||
component_detail: { id: pitem.mold_component.id, name: pitem.mold_component.name },
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
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 },
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
this.clearInfos();
|
||||
currentAddRows1.forEach(row => {
|
||||
this.addInfo({
|
||||
rows1: [row],
|
||||
rows2: currentAddRows2.filter(a => a.component_id == row.component_id),
|
||||
header: row.component_detail.name
|
||||
});
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
heightInit() {
|
||||
|
||||
this.$nextTick(() => {
|
||||
let h = this.$mk.getWindowSize().height - this.$mk.getOffsetTop(this.$refs.xTable.$el) - 500;
|
||||
if (h < 400) {
|
||||
h = 400;
|
||||
}
|
||||
|
||||
this.table1Height = h;
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 获取路由的id参数
|
||||
getDataId() {
|
||||
let dataId = this.dataId;
|
||||
if (this.$route && this.$route.params && this.$route.params.id) {
|
||||
dataId = this.$route.params.id;
|
||||
}
|
||||
if (!dataId) {
|
||||
dataId = 0;
|
||||
}
|
||||
return dataId;
|
||||
},
|
||||
getDataId_BigInt() {
|
||||
let dataId = this.getDataId();
|
||||
return this.$mk.toBigInt(dataId);
|
||||
},
|
||||
|
||||
|
||||
// 返回
|
||||
back() {
|
||||
// 如果是新增模式,关闭当前页面
|
||||
if (!this.isEdit) {
|
||||
this.$closePage({
|
||||
closeRoute: "/Mold/MoldProductionOrderAdd"
|
||||
});
|
||||
} else {
|
||||
// 如果是编辑模式,关闭当前页面
|
||||
this.$closePage({
|
||||
closeRoute: "/Mold/MoldProductionOrderUpdate"
|
||||
});
|
||||
}
|
||||
// 打开列表页面
|
||||
this.$openPage('/Mold/MoldProductionOrder')
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 保存
|
||||
ok() {
|
||||
|
||||
|
||||
|
||||
let save = () => {
|
||||
|
||||
|
||||
// 如果是新增模式,提交新增接口 如果是编辑模式,提交编辑接口
|
||||
let action = !this.isEdit ? this.actions.create : this.actions.update;
|
||||
// 如果是新增模式,提交的数据中加入id 如果是编辑模式,提交的数据中不加入id
|
||||
let postdata = Object.assign({}, this.formOptions.data);
|
||||
|
||||
|
||||
// 格式化提交的数据
|
||||
this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items });
|
||||
|
||||
|
||||
if (postdata.id) {
|
||||
postdata.id = this.$mk.toBigInt(postdata.id);
|
||||
}
|
||||
|
||||
if (postdata.mold_id) {
|
||||
postdata.mold_id = this.$mk.toBigInt(postdata.mold_id);
|
||||
}
|
||||
if (postdata.order_id) {
|
||||
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: [] };
|
||||
|
||||
this.infos.forEach(info => {
|
||||
if (!info.data.postdata) {
|
||||
return;
|
||||
}
|
||||
if (!this.isEdit) {
|
||||
postdata.mold_production_order_component = [...postdata.mold_production_order_component, ...info.data.postdata.mold_production_order_component];
|
||||
postdata.mold_production_order_component_processes = [...postdata.mold_production_order_component_processes, ...info.data.postdata.mold_production_order_component_processes];
|
||||
} else {
|
||||
|
||||
|
||||
postdata.mold_production_order_component.insertList = [...postdata.mold_production_order_component.insertList, ...info.data.postdata.mold_production_order_component.insertList];
|
||||
postdata.mold_production_order_component.deleteList = [...postdata.mold_production_order_component.deleteList, ...info.data.postdata.mold_production_order_component.deleteList];
|
||||
postdata.mold_production_order_component.updateList = [...postdata.mold_production_order_component.updateList, ...info.data.postdata.mold_production_order_component.updateList];
|
||||
|
||||
|
||||
postdata.mold_production_order_component_processes.insertList = [...postdata.mold_production_order_component_processes.insertList, ...info.data.postdata.mold_production_order_component_processes.insertList];
|
||||
postdata.mold_production_order_component_processes.deleteList = [...postdata.mold_production_order_component_processes.deleteList, ...info.data.postdata.mold_production_order_component_processes.deleteList];
|
||||
postdata.mold_production_order_component_processes.updateList = [...postdata.mold_production_order_component_processes.updateList, ...info.data.postdata.mold_production_order_component_processes.updateList];
|
||||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
if (this.isEdit) {
|
||||
postdata.mold_production_order_component = this.$mk.formatPostFieldValue({
|
||||
dataId: this.getDataId(),
|
||||
oldlistdata: this.detailsData,
|
||||
value: postdata.mold_production_order_component
|
||||
});
|
||||
postdata.mold_production_order_component_processes = this.$mk.formatPostFieldValue({
|
||||
dataId: this.getDataId(),
|
||||
oldlistdata: this.detailsData2,
|
||||
value: postdata.mold_production_order_component_processes
|
||||
});
|
||||
}
|
||||
|
||||
// 提交数据
|
||||
this.$mk.post({
|
||||
url: action,
|
||||
loading: "保存中...",
|
||||
data: postdata,
|
||||
useBigInt: true,
|
||||
}).then((a) => { // 成功回调
|
||||
if (a.code == "200") {
|
||||
|
||||
|
||||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
}
|
||||
|
||||
} else {
|
||||
this.$mk.error(a.message);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 验证表单
|
||||
this.$mk.validateForm({ form: this.$refs.xForm }).then(() => { // 验证表单
|
||||
|
||||
save(); // 提交保存
|
||||
|
||||
}).catch(count => { // 验证失败
|
||||
this.$mk.error(`存在${count}项错误,请检查`);
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
// 取消 返回
|
||||
cancel() {
|
||||
this.back();
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
pageApproved() {
|
||||
let dataId = this.getDataId();
|
||||
if (!dataId) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
let sendApproved = () => {
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/audit`,
|
||||
loading: '审批中...',
|
||||
data: {
|
||||
id: this.getDataId_BigInt()
|
||||
},
|
||||
useBigInt: true
|
||||
}).then(a => {
|
||||
if (a.code == "200") {
|
||||
this.$mk.success("审批成功");
|
||||
this.pageInit();
|
||||
}
|
||||
else {
|
||||
this.$mk.error(a.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
sendApproved("");
|
||||
|
||||
},
|
||||
|
||||
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: '工艺布产' }); // 打印
|
||||
},
|
||||
|
||||
},
|
||||
// 监听属性
|
||||
watch: {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped lang="less">
|
||||
.page-body {
|
||||
padding: 30px;
|
||||
background: @base-bg-color;
|
||||
}
|
||||
|
||||
.formtabs .ant-tabs-tabpane {
|
||||
/* background: white; */
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.gridPanel {
|
||||
height: calc(100vh - 600px);
|
||||
}
|
||||
|
||||
.footerbar {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.imagePanel {
|
||||
cursor: pointer;
|
||||
padding: 10px;
|
||||
width: 100px;
|
||||
|
||||
img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
}
|
||||
|
||||
.oplinks2 svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.oplinks2 i {
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
<a-button @click="pageSelectOrder" :disabled="pageStatus == 'approved'">选择订单</a-button>
|
||||
<a-button type="primary" @click="ok" :disabled="pageStatus == 'approved'">保存</a-button>
|
||||
<a-button @click="pageApproved" type="primary" :disabled="!this.getDataId() || pageStatus == 'approved'">审批
|
||||
<a-button v-if="false" @click="pageApproved" type="primary" :disabled="!this.getDataId() || pageStatus == 'approved'">审批
|
||||
</a-button>
|
||||
<a-button @click="print">打印</a-button>
|
||||
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
<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 :dataId="getDataId()" :itemData="info.data"></component-detail>
|
||||
<component-detail :dataId="getDataId()" :itemData="info.data" @reloadData="pageInit"></component-detail>
|
||||
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
|
|
@ -284,6 +284,9 @@ export default {
|
|||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||
},
|
||||
|
||||
|
||||
loadCount : 0,
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -354,6 +357,7 @@ export default {
|
|||
|
||||
this.setPageReadonly(this.pageStatus == 'approved');
|
||||
|
||||
this.$forceUpdate();
|
||||
|
||||
});
|
||||
|
||||
|
|
@ -377,13 +381,13 @@ export default {
|
|||
|
||||
let keys = [];
|
||||
let infos = [];
|
||||
|
||||
this.loadCount ++;
|
||||
this.detailsData.forEach(item => {
|
||||
|
||||
if (!item.component_id) {
|
||||
return;
|
||||
}
|
||||
let key = infos.length + '';
|
||||
let key = infos.length + '' + (this.loadCount + '');
|
||||
let info = {
|
||||
key: key, data: {
|
||||
mold_production_order_component: [item],
|
||||
|
|
@ -404,6 +408,8 @@ export default {
|
|||
|
||||
this.collapseActiveKey = keys;
|
||||
this.infos = infos
|
||||
|
||||
console.log(JSON.stringify(this.infos))
|
||||
},
|
||||
|
||||
setPageReadonly(readonly) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
<template>
|
||||
<basic-page-list ref="listPage" :desc="desc" :options="pageOptions"></basic-page-list>
|
||||
<basic-page-list ref="listPage" :desc="desc" :options="pageOptions">
|
||||
<template v-slot:column1="{ row }">
|
||||
<a-button type="link" @click.stop="pageDetail(row)">{{ row.code }}</a-button>
|
||||
</template>
|
||||
</basic-page-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -93,8 +97,7 @@ export default {
|
|||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||
|
||||
|
||||
{ field: 'code', sortable: true, title: '编码', width: 150 },
|
||||
{ slots: { default: 'column1' }, title: '编码', width: 180 },
|
||||
{ field: 'mold_order',formatter: 'formatRef',params:{dataType:"object",textField:"code"}, sortable: false, title: '订单编号', width: 150 },
|
||||
{ field: 'mold_detail',formatter: 'formatRef',params:{dataType:"object",textField:"name"}, sortable: false, title: '模具', width: 150 },
|
||||
{ field: 'progress', cellRender:{name: 'progress'}, width: 160, sortable: true, title: '进度', showHeaderOverflow: true },
|
||||
|
|
@ -115,7 +118,14 @@ export default {
|
|||
|
||||
this.pageOptions = pageData;
|
||||
},
|
||||
pageDetail(row){
|
||||
|
||||
if (!row) {
|
||||
this.$mk.msg("请选择行");
|
||||
return;
|
||||
}
|
||||
this.$openPage('/Mold/MoldProductionOrderDetail/' + row.id)
|
||||
}
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
|
@ -123,4 +133,4 @@ export default {
|
|||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -183,7 +183,19 @@ routerMap['MoldProductionOrderUpdate']= {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
routerMap['MoldProductionOrderDetail']= {
|
||||
name: '工艺布产',
|
||||
icon: 'idcard',
|
||||
path: `/Mold/MoldProductionOrderDetail/:id`,
|
||||
meta:{
|
||||
invisible: true,
|
||||
page:{ cacheAble:false}
|
||||
},
|
||||
component: () => import(`@/pages/Middle/Mold/MoldProductionOrder/Detail`),
|
||||
authority: {
|
||||
permission: [],
|
||||
}
|
||||
};
|
||||
|
||||
routerMap['MoldScheme']= {
|
||||
name: '模具设计',
|
||||
|
|
|
|||
Loading…
Reference in New Issue