成本汇总
This commit is contained in:
parent
dc232af445
commit
5b192ab987
|
|
@ -3,24 +3,23 @@
|
||||||
|
|
||||||
|
|
||||||
<vxe-table border show-overflow keep-source ref="xTable" :data="detailsData" @pulldownSelected="onPulldownSelected"
|
<vxe-table border show-overflow keep-source ref="xTable" :data="detailsData" @pulldownSelected="onPulldownSelected"
|
||||||
@popupSelected="onPopupSelected" :export-config="{}" @edit-closed="afterEditEvent"
|
@popupSelected="onPopupSelected" :export-config="{}" @edit-closed="afterEditEvent" @edit-actived="beforeEditEvent"
|
||||||
@edit-actived="beforeEditEvent"
|
|
||||||
:edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false, beforeEditMethod: beforeEditMethod }">
|
:edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false, beforeEditMethod: beforeEditMethod }">
|
||||||
<vxe-column title="图片" width="120" align="center">
|
<vxe-column title="图片" width="120" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div v-if="row.component_img" style="position: relative;" class="imgbox">
|
<div v-if="row.component_img" style="position: relative;" class="imgbox">
|
||||||
<img style="width:50px;height:50px;" :src="row.component_img"
|
<img style="width:50px;height:50px;" :src="row.component_img"
|
||||||
@click.stop="$hevueImgPreview(row.component_img)"/>
|
@click.stop="$hevueImgPreview(row.component_img)" />
|
||||||
<div class="imgicons" style="position:absolute;right:0px;top:0px;">
|
<div class="imgicons" style="position:absolute;right:0px;top:0px;">
|
||||||
<div>
|
<div>
|
||||||
<a @click="imgDel({ row })">
|
<a @click="imgDel({ row })">
|
||||||
<a-icon type="close-circle"/>
|
<a-icon type="close-circle" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a-upload name="file" accept="image/*" :before-upload="beforeUpload" :show-upload-list="false">
|
<a-upload name="file" accept="image/*" :before-upload="beforeUpload" :show-upload-list="false">
|
||||||
<a @click="uploadClick({ row })">
|
<a @click="uploadClick({ row })">
|
||||||
<a-icon type="edit"/>
|
<a-icon type="edit" />
|
||||||
</a>
|
</a>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -65,7 +64,7 @@
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div v-if="row.id">
|
<div v-if="row.id">
|
||||||
<div v-if="row.complete_time">
|
<div v-if="row.complete_time">
|
||||||
<a-tooltip placement="topLeft" :title="'完成时间:'+$mk.getDateString(row.complete_time)"
|
<a-tooltip placement="topLeft" :title="'完成时间:' + $mk.getDateString(row.complete_time)"
|
||||||
arrow-point-at-center>
|
arrow-point-at-center>
|
||||||
{{ $mk.getDate(row.complete_time) }}
|
{{ $mk.getDate(row.complete_time) }}
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
|
@ -90,7 +89,7 @@
|
||||||
:edit-render="{ name: '$input', props: {} }"></vxe-column>
|
:edit-render="{ name: '$input', props: {} }"></vxe-column>
|
||||||
|
|
||||||
<vxe-column field="processing_cost" title="成本价" align="center" width="auto"
|
<vxe-column field="processing_cost" title="成本价" align="center" width="auto"
|
||||||
:edit-render="{ name: '$input', props: {type: 'number' } }"></vxe-column>
|
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
|
||||||
<vxe-column field="remark" title="备注" align="center" width="auto"
|
<vxe-column field="remark" title="备注" align="center" width="auto"
|
||||||
:edit-render="{ name: '$input', props: {} }"></vxe-column>
|
:edit-render="{ name: '$input', props: {} }"></vxe-column>
|
||||||
|
|
||||||
|
|
@ -105,10 +104,10 @@
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="oplinks2">
|
<div class="oplinks2">
|
||||||
<a @click.stop="pageAdd2(row)" title="新增">
|
<a @click.stop="pageAdd2(row)" title="新增">
|
||||||
<a-icon class="icon" type="plus-circle"/>
|
<a-icon class="icon" type="plus-circle" />
|
||||||
</a>
|
</a>
|
||||||
<a @click.stop="pageDelete2(row)" title="删除">
|
<a @click.stop="pageDelete2(row)" title="删除">
|
||||||
<a-icon class="icon" type="delete"/>
|
<a-icon class="icon" type="delete" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -123,8 +122,7 @@
|
||||||
<vxe-column v-if="false" field="process_uid_detail" title="加工人员" width="160" :params="editor_process_uid"
|
<vxe-column v-if="false" field="process_uid_detail" title="加工人员" width="160" :params="editor_process_uid"
|
||||||
formatter="formatRef" :edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
|
formatter="formatRef" :edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
|
||||||
|
|
||||||
<vxe-column field="progress" v-if="isEdit" :cellRender="{ name: 'progress' }" title="进度"
|
<vxe-column field="progress" v-if="isEdit" :cellRender="{ name: 'progress' }" title="进度" width="100"></vxe-column>
|
||||||
width="100"></vxe-column>
|
|
||||||
|
|
||||||
<vxe-column field="prepare_process_time" title="预备加工日期" width="130" formatter="formatDate" align="center"
|
<vxe-column field="prepare_process_time" title="预备加工日期" width="130" formatter="formatDate" align="center"
|
||||||
:edit-render="{ name: '$input', props: { type: 'date' } }"></vxe-column>
|
:edit-render="{ name: '$input', props: { type: 'date' } }"></vxe-column>
|
||||||
|
|
@ -138,8 +136,7 @@
|
||||||
<a-button v-if="!row.is_send" @click.stop="pageSend(row)" type="primary">发料</a-button>
|
<a-button v-if="!row.is_send" @click.stop="pageSend(row)" type="primary">发料</a-button>
|
||||||
<div v-if="row.is_send">
|
<div v-if="row.is_send">
|
||||||
|
|
||||||
<a-tooltip placement="topLeft" :title="'发料时间:'+$mk.getDateString(row.send_time)"
|
<a-tooltip placement="topLeft" :title="'发料时间:' + $mk.getDateString(row.send_time)" arrow-point-at-center>
|
||||||
arrow-point-at-center>
|
|
||||||
<a-button v-if="!isComponentDone() && !row.is_complete" @click.stop="pageSend(row, true)">撤销
|
<a-button v-if="!isComponentDone() && !row.is_complete" @click.stop="pageSend(row, true)">撤销
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
|
@ -151,15 +148,14 @@
|
||||||
<vxe-column title="完成" width="100" align="center" v-if="getDataId()">
|
<vxe-column title="完成" width="100" align="center" v-if="getDataId()">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div v-if="row.id && row.is_send">
|
<div v-if="row.id && row.is_send">
|
||||||
<a-tooltip placement="topLeft" :title="'发料时间:'+$mk.getDateString(row.send_time)" arrow-point-at-center>
|
<a-tooltip placement="topLeft" :title="'发料时间:' + $mk.getDateString(row.send_time)" arrow-point-at-center>
|
||||||
<a-button v-if="!row.is_complete" @click.stop="pageDone(row)" type="primary">完成</a-button>
|
<a-button v-if="!row.is_complete" @click.stop="pageDone(row)" type="primary">完成</a-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<div v-if="row.is_complete">
|
<div v-if="row.is_complete">
|
||||||
<a-tooltip placement="topLeft"
|
<a-tooltip placement="topLeft" arrow-point-at-center>
|
||||||
arrow-point-at-center>
|
|
||||||
<template #title>
|
<template #title>
|
||||||
{{ row.send_time ? '发料时间:' + $mk.getDateString(row.send_time) : '' }}
|
{{ row.send_time ? '发料时间:' + $mk.getDateString(row.send_time) : '' }}
|
||||||
<br/>
|
<br />
|
||||||
{{ row.complete_time ? '完成时间:' + $mk.getDateString(row.complete_time) : '' }}
|
{{ row.complete_time ? '完成时间:' + $mk.getDateString(row.complete_time) : '' }}
|
||||||
</template>
|
</template>
|
||||||
<a-button v-if="!isComponentDone()" @click.stop="pageDone(row, true)">撤销</a-button>
|
<a-button v-if="!isComponentDone()" @click.stop="pageDone(row, true)">撤销</a-button>
|
||||||
|
|
@ -177,7 +173,7 @@
|
||||||
:params="{ data: options_user_type }" formatter='formatEnum'></vxe-column>
|
:params="{ data: options_user_type }" formatter='formatEnum'></vxe-column>
|
||||||
|
|
||||||
<vxe-column field="processing_cost" title="加工成本(元)" width="130"
|
<vxe-column field="processing_cost" title="加工成本(元)" width="130"
|
||||||
:edit-render="{ name: '$input', props: {type: 'number' } }"></vxe-column>
|
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
|
||||||
<vxe-column field="remark" title="备注" width="auto" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
<vxe-column field="remark" title="备注" width="auto" :edit-render="{ name: '$input', props: {} }"></vxe-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -264,7 +260,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'MoldComponent',
|
listdataFieldName: 'MoldComponent',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "component_id"}
|
{ fromField: "id", field: "component_id" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MoldComponent/v1/mold/component/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MoldComponent/v1/mold/component/list`
|
||||||
},
|
},
|
||||||
|
|
@ -274,7 +270,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'BaseDepartment',
|
listdataFieldName: 'BaseDepartment',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "department_id"}
|
{ fromField: "id", field: "department_id" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/BaseDepartment/v1/base/department/list`
|
dataUrl: `${BASE_URL.BASE_URL}/BaseDepartment/v1/base/department/list`
|
||||||
},
|
},
|
||||||
|
|
@ -285,7 +281,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'MesProcesses',
|
listdataFieldName: 'MesProcesses',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "process_id"}
|
{ fromField: "id", field: "process_id" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MesProcesses/v1/mes/processes/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MesProcesses/v1/mes/processes/list`
|
||||||
},
|
},
|
||||||
|
|
@ -296,7 +292,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'MesStaff',
|
listdataFieldName: 'MesStaff',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "process_uid"}
|
{ fromField: "id", field: "process_uid" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||||
},
|
},
|
||||||
|
|
@ -306,7 +302,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'MesStaff',
|
listdataFieldName: 'MesStaff',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "send_uid"}
|
{ fromField: "id", field: "send_uid" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||||
},
|
},
|
||||||
|
|
@ -316,7 +312,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'MesStaff',
|
listdataFieldName: 'MesStaff',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "process_uid"}
|
{ fromField: "id", field: "process_uid" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||||
},
|
},
|
||||||
|
|
@ -606,23 +602,23 @@ export default {
|
||||||
deletedList: this.deletedDetailsData,
|
deletedList: this.deletedDetailsData,
|
||||||
fieldName: 'production_id',
|
fieldName: 'production_id',
|
||||||
dataRule: [
|
dataRule: [
|
||||||
{field: 'production_type', type: 'integer'},
|
{ field: 'production_type', type: 'integer' },
|
||||||
{field: 'component_num', type: 'integer'},
|
{ field: 'component_num', type: 'integer' },
|
||||||
{field: 'prepare_process_time', type: 'timestamp'},
|
{ field: 'prepare_process_time', type: 'timestamp' },
|
||||||
{field: 'plan_complete_time', type: 'timestamp'},
|
{ field: 'plan_complete_time', type: 'timestamp' },
|
||||||
|
|
||||||
{field: 'order_id', type: 'bigint'},
|
{ field: 'order_id', type: 'bigint' },
|
||||||
{field: 'id', type: 'bigint'},
|
{ field: 'id', type: 'bigint' },
|
||||||
{field: 'update_uid', type: 'bigint'},
|
{ field: 'update_uid', type: 'bigint' },
|
||||||
{field: 'complete_uid', type: 'bigint'},
|
{ field: 'complete_uid', type: 'bigint' },
|
||||||
{field: 'create_uid', type: 'bigint'},
|
{ field: 'create_uid', type: 'bigint' },
|
||||||
{field: 'mold_id', type: 'bigint'},
|
{ field: 'mold_id', type: 'bigint' },
|
||||||
{field: 'component_id', type: 'bigint'},
|
{ field: 'component_id', type: 'bigint' },
|
||||||
{field: 'process_uid', type: 'bigint'},
|
{ field: 'process_uid', type: 'bigint' },
|
||||||
{field: 'send_uid', type: 'bigint'},
|
{ field: 'send_uid', type: 'bigint' },
|
||||||
{field: 'process_id', type: 'bigint'},
|
{ field: 'process_id', type: 'bigint' },
|
||||||
{field: 'purchase_cost', type: 'bigint'},
|
{ field: 'purchase_cost', type: 'bigint' },
|
||||||
{field: 'processing_cost', type: 'bigint'},
|
{ field: 'processing_cost', type: 'bigint' },
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -649,22 +645,22 @@ export default {
|
||||||
fieldName: 'production_id',
|
fieldName: 'production_id',
|
||||||
dataRule: [
|
dataRule: [
|
||||||
|
|
||||||
{field: 'id', type: 'bigint'},
|
{ field: 'id', type: 'bigint' },
|
||||||
{field: 'prepare_process_time', type: 'timestamp'},
|
{ field: 'prepare_process_time', type: 'timestamp' },
|
||||||
{field: 'plan_complete_time', type: 'timestamp'},
|
{ field: 'plan_complete_time', type: 'timestamp' },
|
||||||
|
|
||||||
|
|
||||||
{field: 'order_id', type: 'bigint'},
|
{ field: 'order_id', type: 'bigint' },
|
||||||
{field: 'send_uid', type: 'bigint'},
|
{ field: 'send_uid', type: 'bigint' },
|
||||||
{field: 'complete_uid', type: 'bigint'},
|
{ field: 'complete_uid', type: 'bigint' },
|
||||||
{field: 'update_uid', type: 'bigint'},
|
{ field: 'update_uid', type: 'bigint' },
|
||||||
{field: 'create_uid', type: 'bigint'},
|
{ field: 'create_uid', type: 'bigint' },
|
||||||
{field: 'component_id', type: 'bigint'},
|
{ field: 'component_id', type: 'bigint' },
|
||||||
{field: 'department_id', type: 'bigint'},
|
{ field: 'department_id', type: 'bigint' },
|
||||||
{field: 'process_id', type: 'bigint'},
|
{ field: 'process_id', type: 'bigint' },
|
||||||
{field: 'process_uid', type: 'bigint'},
|
{ field: 'process_uid', type: 'bigint' },
|
||||||
{field: 'purchase_cost', type: 'bigint'},
|
{ field: 'purchase_cost', type: 'bigint' },
|
||||||
{field: 'processing_cost', type: 'bigint'},
|
{ field: 'processing_cost', type: 'bigint' },
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -673,21 +669,24 @@ export default {
|
||||||
this.itemData.postdata = postdata;
|
this.itemData.postdata = postdata;
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeEditMethod({column, row}) {
|
beforeEditMethod({ column, row }) {
|
||||||
if (this.readonly) {
|
if (this.readonly) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
console.log(column, row);
|
console.log(column, row);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
afterEditEvent({column, row}) {
|
afterEditEvent({ column, row }) {
|
||||||
console.log(column, row);
|
console.log(column, row);
|
||||||
|
|
||||||
this.postDataUpdate();
|
this.postDataUpdate();
|
||||||
|
|
||||||
|
if (column.field == "processing_cost") { // 如果编辑的字段是加工成本
|
||||||
|
|
||||||
|
this.$emit("updateData");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
afterEditEvent2({column, row}) { // 编辑后事件
|
afterEditEvent2({ column, row }) { // 编辑后事件
|
||||||
console.log(column, row);
|
console.log(column, row);
|
||||||
|
|
||||||
if (column.field == "processing_cost") { // 如果编辑的字段是加工成本
|
if (column.field == "processing_cost") { // 如果编辑的字段是加工成本
|
||||||
|
|
@ -699,19 +698,23 @@ export default {
|
||||||
this.detailsData.forEach(item => { // 遍历所有的行
|
this.detailsData.forEach(item => { // 遍历所有的行
|
||||||
item.processing_cost = processing_cost; // 设置每一行的加工成本
|
item.processing_cost = processing_cost; // 设置每一行的加工成本
|
||||||
})
|
})
|
||||||
|
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
}
|
}
|
||||||
this.postDataUpdate();
|
this.postDataUpdate();
|
||||||
|
if (column.field == "processing_cost") { // 如果编辑的字段是加工成本
|
||||||
|
|
||||||
|
this.$emit("updateData");
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
beforeEditEvent({column, row}) {
|
beforeEditEvent({ column, row }) {
|
||||||
console.log(column, row);
|
console.log(column, row);
|
||||||
if (this.readonly) {
|
if (this.readonly) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPulldownSelected({row, selectedData, column}) {
|
onPulldownSelected({ row, selectedData, column }) {
|
||||||
console.log(selectedData);
|
console.log(selectedData);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -720,7 +723,7 @@ export default {
|
||||||
row.department_id = selectedData.department_id;
|
row.department_id = selectedData.department_id;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPopupSelected({rows, name, params}) {
|
onPopupSelected({ rows, name, params }) {
|
||||||
console.log(rows, name, params);
|
console.log(rows, name, params);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -734,7 +737,7 @@ export default {
|
||||||
if (this.currentRow.id) {
|
if (this.currentRow.id) {
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/upload`,
|
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/upload`,
|
||||||
data: {id: this.currentRow.id, image: url},
|
data: { id: this.currentRow.id, image: url },
|
||||||
useBigInt: true
|
useBigInt: true
|
||||||
}).then(a => {
|
}).then(a => {
|
||||||
console.log(a);
|
console.log(a);
|
||||||
|
|
@ -745,12 +748,12 @@ export default {
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
|
||||||
imgDel({row}) {
|
imgDel({ row }) {
|
||||||
|
|
||||||
row.component_img = "";
|
row.component_img = "";
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/upload`,
|
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/upload`,
|
||||||
data: {id: row.id, image: ""},
|
data: { id: row.id, image: "" },
|
||||||
useBigInt: true
|
useBigInt: true
|
||||||
}).then(a => {
|
}).then(a => {
|
||||||
console.log(a);
|
console.log(a);
|
||||||
|
|
@ -758,7 +761,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
uploadClick({row}) {
|
uploadClick({ row }) {
|
||||||
this.currentRow = row;
|
this.currentRow = row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -810,7 +813,8 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
.imgicons {
|
.imgicons {
|
||||||
display: none;;
|
display: none;
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imgbox:hover .imgicons {
|
.imgbox:hover .imgicons {
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,9 @@
|
||||||
|
|
||||||
<a-collapse-panel v-for="(info, index) in infos" :key="info.key" :header="info.header">
|
<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)"/>
|
<a-icon slot="extra" type="delete" @click.stop="removeInfo(index)" />
|
||||||
<component-detail ref="componentDetail" :dataId="getDataId()" :itemData="info.data"
|
<component-detail ref="componentDetail" :dataId="getDataId()" :itemData="info.data" @reloadData="pageInit"
|
||||||
@reloadData="pageInit"></component-detail>
|
@updateData="pageUpdateData"></component-detail>
|
||||||
|
|
||||||
</a-collapse-panel>
|
</a-collapse-panel>
|
||||||
</a-collapse>
|
</a-collapse>
|
||||||
|
|
@ -59,8 +59,7 @@
|
||||||
总成本:{{ ProcessingCost }} 元
|
总成本:{{ ProcessingCost }} 元
|
||||||
</h3>
|
</h3>
|
||||||
<vxe-form :data="formOptions2.data" ref="xForm2" :title-width="formOptions2.titleWidth"
|
<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>
|
</vxe-form>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -83,7 +82,7 @@ const settings = require('../basic/settings.js');
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
name: '',
|
name: '',
|
||||||
components: {ComponentDetail},
|
components: { ComponentDetail },
|
||||||
props: {
|
props: {
|
||||||
pageMode: {
|
pageMode: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -145,13 +144,13 @@ export default {
|
||||||
// 表单校验规则
|
// 表单校验规则
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{required: true, message: '请输入编号'}
|
{ required: true, message: '请输入编号' }
|
||||||
],
|
],
|
||||||
mold_order: [
|
mold_order: [
|
||||||
{required: true, message: '请选择订单'}
|
{ required: true, message: '请选择订单' }
|
||||||
],
|
],
|
||||||
mold_detail: [
|
mold_detail: [
|
||||||
{required: true, message: '请选择模具'}
|
{ required: true, message: '请选择模具' }
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// 表单项
|
// 表单项
|
||||||
|
|
@ -182,86 +181,86 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{field: 'code', title: '编号', span: 6, itemRender: {name: '$input'}},
|
{ field: 'code', title: '编号', span: 6, itemRender: { name: '$input' } },
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'production_type',
|
field: 'production_type',
|
||||||
dataRule: {type: 'integer'},
|
dataRule: { type: 'integer' },
|
||||||
title: '布产类型',
|
title: '布产类型',
|
||||||
span: 6,
|
span: 6,
|
||||||
itemRender: {name: '$select', props: {options: options_production_type}}
|
itemRender: { name: '$select', props: { options: options_production_type } }
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{field: 'rubber', title: '胶件材质/缩水', span: 6, itemRender: {name: '$input'}},
|
{ field: 'rubber', title: '胶件材质/缩水', span: 6, itemRender: { name: '$input' } },
|
||||||
{field: 'hole', title: '模具穴数', span: 6, itemRender: {name: '$input'}},
|
{ field: 'hole', title: '模具穴数', span: 6, itemRender: { name: '$input' } },
|
||||||
{field: 'water', title: '入水口类型/位置', span: 6, itemRender: {name: '$input'}},
|
{ field: 'water', title: '入水口类型/位置', span: 6, itemRender: { name: '$input' } },
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'manufacture_cycle',
|
field: 'manufacture_cycle',
|
||||||
dataRule: {type: 'timestamp'},
|
dataRule: { type: 'timestamp' },
|
||||||
title: '制作周期',
|
title: '制作周期',
|
||||||
span: 6,
|
span: 6,
|
||||||
itemRender: {name: '$input', props: {type: 'date'}}
|
itemRender: { name: '$input', props: { type: 'date' } }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'draw_start_time',
|
field: 'draw_start_time',
|
||||||
dataRule: {type: 'timestamp'},
|
dataRule: { type: 'timestamp' },
|
||||||
title: '预计开始画图时间',
|
title: '预计开始画图时间',
|
||||||
span: 6,
|
span: 6,
|
||||||
itemRender: {name: '$input', props: {type: 'date'}}
|
itemRender: { name: '$input', props: { type: 'date' } }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'split_design_time',
|
field: 'split_design_time',
|
||||||
dataRule: {type: 'timestamp'},
|
dataRule: { type: 'timestamp' },
|
||||||
title: '分模设计时间预计',
|
title: '分模设计时间预计',
|
||||||
span: 6,
|
span: 6,
|
||||||
itemRender: {name: '$input', props: {type: 'date'}}
|
itemRender: { name: '$input', props: { type: 'date' } }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'draw_time',
|
field: 'draw_time',
|
||||||
dataRule: {type: 'timestamp'},
|
dataRule: { type: 'timestamp' },
|
||||||
title: '出图时间预计',
|
title: '出图时间预计',
|
||||||
span: 6,
|
span: 6,
|
||||||
itemRender: {name: '$input', props: {type: 'date'}}
|
itemRender: { name: '$input', props: { type: 'date' } }
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'draw2D_time',
|
field: 'draw2D_time',
|
||||||
dataRule: {type: 'timestamp'},
|
dataRule: { type: 'timestamp' },
|
||||||
title: '出2D时间预计',
|
title: '出2D时间预计',
|
||||||
span: 6,
|
span: 6,
|
||||||
itemRender: {name: '$input', props: {type: 'date'}}
|
itemRender: { name: '$input', props: { type: 'date' } }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'draw3D_time',
|
field: 'draw3D_time',
|
||||||
dataRule: {type: 'timestamp'},
|
dataRule: { type: 'timestamp' },
|
||||||
title: '出3D时间预计',
|
title: '出3D时间预计',
|
||||||
span: 6,
|
span: 6,
|
||||||
itemRender: {name: '$input', props: {type: 'date'}}
|
itemRender: { name: '$input', props: { type: 'date' } }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'inlay_deep_hole_time',
|
field: 'inlay_deep_hole_time',
|
||||||
dataRule: {type: 'timestamp'},
|
dataRule: { type: 'timestamp' },
|
||||||
title: '镶件深孔钻到厂日期预计',
|
title: '镶件深孔钻到厂日期预计',
|
||||||
span: 6,
|
span: 6,
|
||||||
itemRender: {name: '$input', props: {type: 'date'}}
|
itemRender: { name: '$input', props: { type: 'date' } }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'horizontal_frame_time',
|
field: 'horizontal_frame_time',
|
||||||
dataRule: {type: 'timestamp'},
|
dataRule: { type: 'timestamp' },
|
||||||
title: '横架到厂日期预计',
|
title: '横架到厂日期预计',
|
||||||
span: 6,
|
span: 6,
|
||||||
itemRender: {name: '$input', props: {type: 'date'}}
|
itemRender: { name: '$input', props: { type: 'date' } }
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'complete_time',
|
field: 'complete_time',
|
||||||
dataRule: {type: 'timestamp'},
|
dataRule: { type: 'timestamp' },
|
||||||
title: '要求完成时间',
|
title: '要求完成时间',
|
||||||
span: 6,
|
span: 6,
|
||||||
itemRender: {name: '$input', props: {type: 'date'}}
|
itemRender: { name: '$input', props: { type: 'date' } }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '模具师傅', span: 6,
|
title: '模具师傅', span: 6,
|
||||||
|
|
@ -312,7 +311,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: {
|
field: 'progress', title: '进度', span: 18, itemRender: {
|
||||||
name: 'MkFormProgress', props: {
|
name: 'MkFormProgress', props: {
|
||||||
|
|
@ -339,8 +338,8 @@ export default {
|
||||||
items: [
|
items: [
|
||||||
|
|
||||||
|
|
||||||
{field: 'problem', title: '出现问题及建议反馈', span: 24, itemRender: {name: '$input', props: {}}},
|
{ field: 'problem', title: '出现问题及建议反馈', span: 24, itemRender: { name: '$input', props: {} } },
|
||||||
{field: 'remark', title: '备注', span: 24, itemRender: {name: '$textarea', props: {}}},
|
{ field: 'remark', title: '备注', span: 24, itemRender: { name: '$textarea', props: {} } },
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
@ -363,7 +362,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'MoldComponent',
|
listdataFieldName: 'MoldComponent',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "component_id"}
|
{ fromField: "id", field: "component_id" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MoldComponent/v1/mold/component/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MoldComponent/v1/mold/component/list`
|
||||||
},
|
},
|
||||||
|
|
@ -373,7 +372,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'BaseDepartment',
|
listdataFieldName: 'BaseDepartment',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "department_id"}
|
{ fromField: "id", field: "department_id" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/BaseDepartment/v1/base/department/list`
|
dataUrl: `${BASE_URL.BASE_URL}/BaseDepartment/v1/base/department/list`
|
||||||
},
|
},
|
||||||
|
|
@ -384,7 +383,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'MesProcesses',
|
listdataFieldName: 'MesProcesses',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "process_id"}
|
{ fromField: "id", field: "process_id" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MesProcesses/v1/mes/processes/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MesProcesses/v1/mes/processes/list`
|
||||||
},
|
},
|
||||||
|
|
@ -395,7 +394,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'MesStaff',
|
listdataFieldName: 'MesStaff',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "process_uid"}
|
{ fromField: "id", field: "process_uid" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||||
},
|
},
|
||||||
|
|
@ -405,7 +404,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'MesStaff',
|
listdataFieldName: 'MesStaff',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "send_uid"}
|
{ fromField: "id", field: "send_uid" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||||
},
|
},
|
||||||
|
|
@ -415,7 +414,7 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'MesStaff',
|
listdataFieldName: 'MesStaff',
|
||||||
mapper: [
|
mapper: [
|
||||||
{fromField: "id", field: "process_uid"}
|
{ fromField: "id", field: "process_uid" }
|
||||||
],
|
],
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
|
||||||
},
|
},
|
||||||
|
|
@ -470,7 +469,7 @@ export default {
|
||||||
this.$mk.post({
|
this.$mk.post({
|
||||||
url: this.actions.get,
|
url: this.actions.get,
|
||||||
loading: "加载中...",
|
loading: "加载中...",
|
||||||
data: {id: this.$mk.toBigInt(dataId)},
|
data: { id: this.$mk.toBigInt(dataId) },
|
||||||
useBigInt: true
|
useBigInt: true
|
||||||
}).then(a => {
|
}).then(a => {
|
||||||
|
|
||||||
|
|
@ -520,6 +519,28 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
pageUpdateData() {
|
||||||
|
console.log(this.infos);
|
||||||
|
let processing_cost = 0;
|
||||||
|
this.infos.forEach(info => {
|
||||||
|
|
||||||
|
let list = [];
|
||||||
|
let postdata = info.data.postdata.mold_production_order_component;
|
||||||
|
|
||||||
|
if (postdata.updateList) {
|
||||||
|
list = [...postdata.insertList, ...postdata.updateList];
|
||||||
|
} else {
|
||||||
|
list = postdata;
|
||||||
|
}
|
||||||
|
list.forEach(item => {
|
||||||
|
processing_cost += parseFloat(item.processing_cost || 0)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
this.ProcessingCost = processing_cost;
|
||||||
|
},
|
||||||
|
|
||||||
initComponentDetail() {
|
initComponentDetail() {
|
||||||
|
|
||||||
|
|
@ -574,7 +595,7 @@ 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}) {
|
existComonent({ component_id }) {
|
||||||
let exist = false;
|
let exist = false;
|
||||||
this.infos.forEach(info => {
|
this.infos.forEach(info => {
|
||||||
info.data.mold_production_order_component.forEach(row => {
|
info.data.mold_production_order_component.forEach(row => {
|
||||||
|
|
@ -587,14 +608,14 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
pageSelectComponent() {
|
pageSelectComponent() {
|
||||||
let {width, height} = this.$mk.getWindowSize();
|
let { width, height } = this.$mk.getWindowSize();
|
||||||
this.$mk.dialog.open({
|
this.$mk.dialog.open({
|
||||||
page: () => import("../MoldComponent/selector"),
|
page: () => import("../MoldComponent/selector"),
|
||||||
title: "选择部件",
|
title: "选择部件",
|
||||||
showFooter: true,
|
showFooter: true,
|
||||||
width: width * 0.9,
|
width: width * 0.9,
|
||||||
height: height * 0.9,
|
height: height * 0.9,
|
||||||
callback: ({data}) => {
|
callback: ({ data }) => {
|
||||||
if (!data || !data.row1) {
|
if (!data || !data.row1) {
|
||||||
this.$mk.error("未选择行");
|
this.$mk.error("未选择行");
|
||||||
return;
|
return;
|
||||||
|
|
@ -622,14 +643,14 @@ export default {
|
||||||
component_line: component_line,
|
component_line: component_line,
|
||||||
component_id: row.id,
|
component_id: row.id,
|
||||||
component_num: 1,
|
component_num: 1,
|
||||||
component_detail: {id: row.id, name: row.name},
|
component_detail: { id: row.id, name: row.name },
|
||||||
})
|
})
|
||||||
mold_component_processes.forEach(pitem => {
|
mold_component_processes.forEach(pitem => {
|
||||||
currentAddRows2.push({
|
currentAddRows2.push({
|
||||||
component_line: component_line,
|
component_line: component_line,
|
||||||
component_id: row.id,
|
component_id: row.id,
|
||||||
process_id: pitem.mes_processes_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 },
|
||||||
})
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -651,7 +672,7 @@ export default {
|
||||||
this.collapseActiveKey = [];
|
this.collapseActiveKey = [];
|
||||||
this.infos = [];
|
this.infos = [];
|
||||||
},
|
},
|
||||||
addInfo({rows1, rows2, header}) {
|
addInfo({ rows1, rows2, header }) {
|
||||||
let key = this.infos.length + '';
|
let key = this.infos.length + '';
|
||||||
let info = {
|
let info = {
|
||||||
key: key, data: {
|
key: key, data: {
|
||||||
|
|
@ -664,14 +685,14 @@ export default {
|
||||||
this.infos = [...this.infos, info];
|
this.infos = [...this.infos, info];
|
||||||
},
|
},
|
||||||
pageSelectOrder() {
|
pageSelectOrder() {
|
||||||
let {width, height} = this.$mk.getWindowSize();
|
let { width, height } = this.$mk.getWindowSize();
|
||||||
this.$mk.dialog.open({
|
this.$mk.dialog.open({
|
||||||
page: () => import("../MoldOrder/selector"),
|
page: () => import("../MoldOrder/selector"),
|
||||||
title: "选择订单",
|
title: "选择订单",
|
||||||
showFooter: true,
|
showFooter: true,
|
||||||
width: width * 0.9,
|
width: width * 0.9,
|
||||||
height: height * 0.9,
|
height: height * 0.9,
|
||||||
callback: ({data}) => {
|
callback: ({ data }) => {
|
||||||
if (!data || !data.row2) {
|
if (!data || !data.row2) {
|
||||||
this.$mk.error("未选择明细行");
|
this.$mk.error("未选择明细行");
|
||||||
return;
|
return;
|
||||||
|
|
@ -755,7 +776,7 @@ export default {
|
||||||
currentAddRows1.push({
|
currentAddRows1.push({
|
||||||
component_id: pitem.component_id.toString(),
|
component_id: pitem.component_id.toString(),
|
||||||
component_num: 1,
|
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 },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -763,7 +784,7 @@ export default {
|
||||||
currentAddRows2.push({
|
currentAddRows2.push({
|
||||||
component_id: pitem.component_id.toString(),
|
component_id: pitem.component_id.toString(),
|
||||||
process_id: pitem.mes_processes_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 },
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -841,7 +862,7 @@ export default {
|
||||||
let postdata = Object.assign({}, this.formOptions.data, this.formOptions2.data);
|
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) {
|
if (postdata.id) {
|
||||||
|
|
@ -868,7 +889,7 @@ export default {
|
||||||
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 = !this.isEdit ? [] : { insertList: [], deleteList: [], updateList: [] };
|
||||||
postdata.mold_production_order_component_processes = !this.isEdit ? [] : {
|
postdata.mold_production_order_component_processes = !this.isEdit ? [] : {
|
||||||
insertList: [],
|
insertList: [],
|
||||||
deleteList: [],
|
deleteList: [],
|
||||||
|
|
@ -953,7 +974,7 @@ export default {
|
||||||
|
|
||||||
|
|
||||||
// 验证表单
|
// 验证表单
|
||||||
this.$mk.validateForm({form: this.$refs.xForm}).then(() => { // 验证表单
|
this.$mk.validateForm({ form: this.$refs.xForm }).then(() => { // 验证表单
|
||||||
|
|
||||||
save(); // 提交保存
|
save(); // 提交保存
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue