模具 布产单bug,详情增加部门筛选
This commit is contained in:
parent
1380815fb3
commit
c5601abdc6
|
|
@ -123,6 +123,7 @@ export default {
|
||||||
return new Promise((resolve, reject) => { // 返回一个Promise
|
return new Promise((resolve, reject) => { // 返回一个Promise
|
||||||
|
|
||||||
form.validate(a => { // 验证表单
|
form.validate(a => { // 验证表单
|
||||||
|
|
||||||
let count = 0; // 计数器
|
let count = 0; // 计数器
|
||||||
if (a) { // 如果有错误
|
if (a) { // 如果有错误
|
||||||
for (let name in a) { // 循环错误
|
for (let name in a) { // 循环错误
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@
|
||||||
<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" @edit-actived="beforeEditEvent"
|
@popupSelected="onPopupSelected" :export-config="{}" @edit-closed="afterEditEvent" @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 field="component_detail" title="部件" width="160" :params="editor_component" formatter="formatRef"
|
|
||||||
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
|
|
||||||
<vxe-column field="component_num" title="部件数量" width="160"
|
<vxe-column field="component_num" title="部件数量" width="160"
|
||||||
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
|
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
|
||||||
<vxe-column field="production_type" title="布产类型" width="160" :edit-render="{}">
|
<vxe-column field="production_type" title="布产类型" width="160" :edit-render="{}">
|
||||||
|
|
@ -307,7 +306,7 @@ export default {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.loadDepartment();
|
//this.loadDepartment();
|
||||||
|
|
||||||
this.detailsDataInit();
|
this.detailsDataInit();
|
||||||
|
|
||||||
|
|
@ -575,10 +574,15 @@ export default {
|
||||||
deleteList: []
|
deleteList: []
|
||||||
} : [];
|
} : [];
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
let list = [ ...this.detailsData2];
|
||||||
|
list.forEach(item=>{
|
||||||
|
item.component_id = this.detailsData[0].component_id;
|
||||||
|
})
|
||||||
postdata.mold_production_order_component_processes = this.$mk.getPostFieldValue({
|
postdata.mold_production_order_component_processes = this.$mk.getPostFieldValue({
|
||||||
rowFilter: (row) => { return row.id || (row.component_id && row.process_id) },
|
rowFilter: (row) => { return row.id || (row.component_id && row.process_id) },
|
||||||
dataId: this.getDataId_BigInt(),
|
dataId: this.getDataId_BigInt(),
|
||||||
list: this.detailsData2,
|
list: list,
|
||||||
deletedList: this.deletedDetailsData2,
|
deletedList: this.deletedDetailsData2,
|
||||||
fieldName: 'production_id',
|
fieldName: 'production_id',
|
||||||
dataRule: [
|
dataRule: [
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,14 @@
|
||||||
<a-tab-pane key="2" tab="工序详情">
|
<a-tab-pane key="2" tab="工序详情">
|
||||||
|
|
||||||
|
|
||||||
|
<div style="margin: 5px;">
|
||||||
|
<a-radio-group v-model="departmentId" :options="departmentOptions" @change="departmentChange">
|
||||||
|
</a-radio-group>
|
||||||
|
</div>
|
||||||
<a-collapse :activeKey="collapseActiveKey">
|
<a-collapse :activeKey="collapseActiveKey">
|
||||||
|
|
||||||
<a-collapse-panel v-for="(info, index) in infos" :key="info.key" :header="info.header">
|
<a-collapse-panel v-for="info 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>
|
<component-detail :readonly="true" :dataId="getDataId()" :itemData="info.data" @reloadData="pageInit"></component-detail>
|
||||||
|
|
||||||
</a-collapse-panel>
|
</a-collapse-panel>
|
||||||
|
|
@ -50,6 +53,11 @@
|
||||||
|
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
|
|
||||||
|
<h4 style="margin-top: 5px;">出现问题及建议反馈</h4>
|
||||||
|
<vxe-form :data="formOptions2.data" ref="xForm" :title-width="formOptions2.titleWidth"
|
||||||
|
:title-align="formOptions2.titleAlign" :rules="formOptions2.rules" :items="formOptions2.items" :titleColon="false"
|
||||||
|
vertical>
|
||||||
|
</vxe-form>
|
||||||
|
|
||||||
|
|
||||||
<div class="mk-toolbar" v-if="isEdit">
|
<div class="mk-toolbar" v-if="isEdit">
|
||||||
|
|
@ -100,8 +108,7 @@ export default {
|
||||||
options_user_type: options_user_type,
|
options_user_type: options_user_type,
|
||||||
collapseActiveKey: [],
|
collapseActiveKey: [],
|
||||||
|
|
||||||
infos: [],
|
infos: [], //所有的组件数据
|
||||||
|
|
||||||
// 当前项目名称
|
// 当前项目名称
|
||||||
currentConfigName: "",
|
currentConfigName: "",
|
||||||
// 当前项目ID
|
// 当前项目ID
|
||||||
|
|
@ -127,7 +134,7 @@ export default {
|
||||||
production_type: "1"
|
production_type: "1"
|
||||||
},
|
},
|
||||||
// 标题宽度
|
// 标题宽度
|
||||||
titleWidth: 150,
|
titleWidth: 180,
|
||||||
// 标题对齐方式
|
// 标题对齐方式
|
||||||
titleAlign: 'right',
|
titleAlign: 'right',
|
||||||
|
|
||||||
|
|
@ -183,7 +190,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: 'problem', title: '出现问题及建议反馈', span: 8, itemRender: { name: '$input', props: {} } },
|
{ 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: {
|
||||||
|
|
@ -196,6 +203,30 @@ export default {
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
formOptions2: {
|
||||||
|
data: {
|
||||||
|
},
|
||||||
|
// 标题宽度
|
||||||
|
titleWidth: 180,
|
||||||
|
// 标题对齐方式
|
||||||
|
titleAlign: 'top',
|
||||||
|
|
||||||
|
// 表单校验规则
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
// 表单项
|
||||||
|
items: [
|
||||||
|
|
||||||
|
|
||||||
|
{ showTitle: false, field: 'problem', title: '', span: 24, itemRender: { name: '$textarea', props: {} } },
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
},
|
||||||
|
departments: [],
|
||||||
|
departmentOptions: [],
|
||||||
|
departmentId: null,
|
||||||
|
|
||||||
// 新增模式表单项
|
// 新增模式表单项
|
||||||
addModeItems: [
|
addModeItems: [
|
||||||
|
|
||||||
|
|
@ -307,13 +338,44 @@ export default {
|
||||||
|
|
||||||
this.heightInit();
|
this.heightInit();
|
||||||
|
|
||||||
|
this.loadDepartments();
|
||||||
|
|
||||||
},
|
},
|
||||||
// 函数
|
// 函数
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
removeInfo(index) {
|
|
||||||
this.infos.splice(index, 1);
|
loadDepartments() {
|
||||||
|
this.$mk.post({
|
||||||
|
url: `${BASE_URL.BASE_URL}/BaseDepartment/v1/base/department/list`,
|
||||||
|
loading: '加载中...',
|
||||||
|
data: {
|
||||||
|
"page": 1,
|
||||||
|
"limit": 1000,
|
||||||
|
"end_time": 0,
|
||||||
|
"order_bys": [
|
||||||
|
],
|
||||||
|
"search_rules": [
|
||||||
|
],
|
||||||
|
"start_time": 0
|
||||||
|
},
|
||||||
|
useBigInt: true
|
||||||
|
}).then(a => {
|
||||||
|
this.departments = a.data.BaseDepartment;
|
||||||
|
this.departmentOptions = [{ value: null, label: '全部部门' }];
|
||||||
|
this.departments.forEach(item => {
|
||||||
|
|
||||||
|
this.departmentOptions = [... this.departmentOptions, {
|
||||||
|
value: item.id + '',
|
||||||
|
label: item.name
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
},
|
||||||
|
departmentChange() {
|
||||||
|
|
||||||
|
this.initComponentDetail();
|
||||||
},
|
},
|
||||||
|
|
||||||
pageInit() {
|
pageInit() {
|
||||||
|
|
@ -335,7 +397,9 @@ export default {
|
||||||
this.formOptions.data = this.$mk.formatDetailData({ data: a.data[this.detailDataFieldName], rules: this.formOptions.items });
|
this.formOptions.data = this.$mk.formatDetailData({ data: a.data[this.detailDataFieldName], rules: this.formOptions.items });
|
||||||
|
|
||||||
|
|
||||||
|
this.formOptions2.data = {
|
||||||
|
problem: a.data[this.detailDataFieldName].problem
|
||||||
|
}
|
||||||
|
|
||||||
this.detailsData = JSON.parse(JSON.stringify(a.data[this.detailDataFieldName].mold_production_order_component || []));
|
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.detailsData2 = JSON.parse(JSON.stringify(a.data[this.detailDataFieldName].mold_production_order_component_processes || []));
|
||||||
|
|
@ -374,8 +438,8 @@ export default {
|
||||||
initComponentDetail() {
|
initComponentDetail() {
|
||||||
|
|
||||||
|
|
||||||
let keys = [];
|
|
||||||
let infos = [];
|
let infos = [];
|
||||||
|
let keys = [];
|
||||||
this.loadCount++;
|
this.loadCount++;
|
||||||
this.detailsData.forEach(item => {
|
this.detailsData.forEach(item => {
|
||||||
|
|
||||||
|
|
@ -392,19 +456,31 @@ 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 (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{
|
||||||
|
info.data.mold_production_order_component_processes.push(pitem);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if(!info.data.mold_production_order_component_processes.length){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
keys.push(key);
|
keys.push(key);
|
||||||
infos.push(info);
|
infos.push(info);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(infos)
|
||||||
|
|
||||||
|
|
||||||
this.collapseActiveKey = keys;
|
this.collapseActiveKey = keys;
|
||||||
this.infos = infos
|
this.infos = infos
|
||||||
|
|
||||||
console.log(JSON.stringify(this.infos))
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setPageReadonly(readonly) {
|
setPageReadonly(readonly) {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
|
|
||||||
<h4 style="margin-top: 5px;">出现问题及建议反馈</h4>
|
<h4 style="margin-top: 5px;">出现问题及建议反馈</h4>
|
||||||
<vxe-form :data="formOptions2.data" ref="xForm" :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" :titleColon="false"
|
:title-align="formOptions2.titleAlign" :rules="formOptions2.rules" :items="formOptions2.items" :titleColon="false"
|
||||||
vertical>
|
vertical>
|
||||||
</vxe-form>
|
</vxe-form>
|
||||||
|
|
@ -150,7 +150,7 @@ export default {
|
||||||
mold_order: [
|
mold_order: [
|
||||||
{ required: true, message: '请选择订单' }
|
{ required: true, message: '请选择订单' }
|
||||||
],
|
],
|
||||||
mold_scheme: [
|
mold_detail: [
|
||||||
{ required: true, message: '请选择模具' }
|
{ required: true, message: '请选择模具' }
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -343,6 +343,8 @@ export default {
|
||||||
// 合并表单数据及配置
|
// 合并表单数据及配置
|
||||||
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
|
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
|
||||||
|
|
||||||
|
|
||||||
|
console.log(pageData.formOptions)
|
||||||
return pageData;
|
return pageData;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -669,7 +671,7 @@ export default {
|
||||||
heightInit() {
|
heightInit() {
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
let h = this.$mk.getWindowSize().height - this.$mk.getOffsetTop(this.$refs.xTable.$el) - 500;
|
let h = this.$mk.getWindowSize().height - 500;
|
||||||
if (h < 400) {
|
if (h < 400) {
|
||||||
h = 400;
|
h = 400;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<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 type="link" @click.stop="pageDetail(row)">{{ row.code }}</a-button>
|
<a-button @click.stop="pageDetail(row)">查看详情</a-button>
|
||||||
</template>
|
</template>
|
||||||
</basic-page-list>
|
</basic-page-list>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -97,7 +97,8 @@ export default {
|
||||||
|
|
||||||
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
{ title: '操作', slots: { default: 'op' }, width: 120 },
|
||||||
|
|
||||||
{ slots: { default: 'column1' }, title: '编码', width: 180 },
|
{ 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 },
|
{ 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: 'mold_detail',formatter: 'formatRef',params:{dataType:"object",textField:"name"}, sortable: false, title: '模具', width: 150 },
|
||||||
{ field: 'progress', cellRender:{name: 'progress'}, sortable: true, title: '进度', showHeaderOverflow: true },
|
{ field: 'progress', cellRender:{name: 'progress'}, sortable: true, title: '进度', showHeaderOverflow: true },
|
||||||
|
|
|
||||||
|
|
@ -475,11 +475,7 @@ export default {
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
let ds2 = this.detailsData2.filter( (row) => { return row.id || (row.component_id && row.mes_processes_id) });
|
|
||||||
if(!ds2.length){
|
|
||||||
this.$mk.success("工序未设置,操作失败");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
postdata.mold_scheme_processes = this.$mk.getPostFieldValue({
|
postdata.mold_scheme_processes = this.$mk.getPostFieldValue({
|
||||||
rowFilter: (row) => { return row.id || (row.component_id && row.mes_processes_id) },
|
rowFilter: (row) => { return row.id || (row.component_id && row.mes_processes_id) },
|
||||||
dataId: this.getDataId_BigInt(),
|
dataId: this.getDataId_BigInt(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue