模具 布产单bug,详情增加部门筛选
This commit is contained in:
parent
1380815fb3
commit
c5601abdc6
|
|
@ -123,6 +123,7 @@ export default {
|
|||
return new Promise((resolve, reject) => { // 返回一个Promise
|
||||
|
||||
form.validate(a => { // 验证表单
|
||||
|
||||
let count = 0; // 计数器
|
||||
if (a) { // 如果有错误
|
||||
for (let name in a) { // 循环错误
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@
|
|||
<vxe-table border show-overflow keep-source ref="xTable" :data="detailsData" @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 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"
|
||||
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
|
||||
<vxe-column field="production_type" title="布产类型" width="160" :edit-render="{}">
|
||||
|
|
@ -307,7 +306,7 @@ export default {
|
|||
|
||||
|
||||
|
||||
this.loadDepartment();
|
||||
//this.loadDepartment();
|
||||
|
||||
this.detailsDataInit();
|
||||
|
||||
|
|
@ -575,10 +574,15 @@ export default {
|
|||
deleteList: []
|
||||
} : [];
|
||||
} 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({
|
||||
rowFilter: (row) => { return row.id || (row.component_id && row.process_id) },
|
||||
dataId: this.getDataId_BigInt(),
|
||||
list: this.detailsData2,
|
||||
list: list,
|
||||
deletedList: this.deletedDetailsData2,
|
||||
fieldName: 'production_id',
|
||||
dataRule: [
|
||||
|
|
|
|||
|
|
@ -23,11 +23,14 @@
|
|||
<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-panel v-for="(info, index) in infos" :key="info.key" :header="info.header">
|
||||
|
||||
<a-icon slot="extra" type="delete" @click.stop="removeInfo(index)" />
|
||||
<a-collapse-panel v-for="info in infos" :key="info.key" :header="info.header">
|
||||
|
||||
<component-detail :readonly="true" :dataId="getDataId()" :itemData="info.data" @reloadData="pageInit"></component-detail>
|
||||
|
||||
</a-collapse-panel>
|
||||
|
|
@ -50,6 +53,11 @@
|
|||
|
||||
</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">
|
||||
|
|
@ -100,8 +108,7 @@ export default {
|
|||
options_user_type: options_user_type,
|
||||
collapseActiveKey: [],
|
||||
|
||||
infos: [],
|
||||
|
||||
infos: [], //所有的组件数据
|
||||
// 当前项目名称
|
||||
currentConfigName: "",
|
||||
// 当前项目ID
|
||||
|
|
@ -127,7 +134,7 @@ export default {
|
|||
production_type: "1"
|
||||
},
|
||||
// 标题宽度
|
||||
titleWidth: 150,
|
||||
titleWidth: 180,
|
||||
// 标题对齐方式
|
||||
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: '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: 'horizontal_frame_time', dataRule: { type: 'timestamp' }, title: '横架到厂日期预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } },
|
||||
{
|
||||
field: 'progress', title: '进度', span: 24, itemRender: {
|
||||
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: [
|
||||
|
||||
|
|
@ -307,13 +338,44 @@ export default {
|
|||
|
||||
this.heightInit();
|
||||
|
||||
this.loadDepartments();
|
||||
|
||||
},
|
||||
// 函数
|
||||
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() {
|
||||
|
|
@ -335,7 +397,9 @@ export default {
|
|||
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.detailsData2 = JSON.parse(JSON.stringify(a.data[this.detailDataFieldName].mold_production_order_component_processes || []));
|
||||
|
|
@ -374,9 +438,9 @@ export default {
|
|||
initComponentDetail() {
|
||||
|
||||
|
||||
let infos = [];
|
||||
let keys = [];
|
||||
let infos = [];
|
||||
this.loadCount ++;
|
||||
this.loadCount++;
|
||||
this.detailsData.forEach(item => {
|
||||
|
||||
if (!item.component_id) {
|
||||
|
|
@ -392,19 +456,31 @@ export default {
|
|||
};
|
||||
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);
|
||||
if(this.departmentId){
|
||||
if (pitem.department_id && pitem.department_id.toString() == this.departmentId) {
|
||||
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);
|
||||
infos.push(info);
|
||||
})
|
||||
|
||||
console.log(infos)
|
||||
|
||||
|
||||
this.collapseActiveKey = keys;
|
||||
this.infos = infos
|
||||
|
||||
console.log(JSON.stringify(this.infos))
|
||||
|
||||
},
|
||||
|
||||
setPageReadonly(readonly) {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
</a-tabs>
|
||||
|
||||
<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"
|
||||
vertical>
|
||||
</vxe-form>
|
||||
|
|
@ -150,7 +150,7 @@ export default {
|
|||
mold_order: [
|
||||
{ required: true, message: '请选择订单' }
|
||||
],
|
||||
mold_scheme: [
|
||||
mold_detail: [
|
||||
{ required: true, message: '请选择模具' }
|
||||
],
|
||||
},
|
||||
|
|
@ -343,6 +343,8 @@ export default {
|
|||
// 合并表单数据及配置
|
||||
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
|
||||
|
||||
|
||||
console.log(pageData.formOptions)
|
||||
return pageData;
|
||||
},
|
||||
|
||||
|
|
@ -669,7 +671,7 @@ export default {
|
|||
heightInit() {
|
||||
|
||||
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) {
|
||||
h = 400;
|
||||
}
|
||||
|
|
@ -831,8 +833,8 @@ export default {
|
|||
// 验证表单
|
||||
this.$mk.validateForm({ form: this.$refs.xForm }).then(() => { // 验证表单
|
||||
|
||||
save(); // 提交保存
|
||||
|
||||
save(); // 提交保存
|
||||
|
||||
}).catch(count => { // 验证失败
|
||||
this.$mk.error(`存在${count}项错误,请检查`);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<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>
|
||||
<a-button @click.stop="pageDetail(row)">查看详情</a-button>
|
||||
</template>
|
||||
</basic-page-list>
|
||||
</template>
|
||||
|
|
@ -97,7 +97,8 @@ export default {
|
|||
|
||||
{ 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_detail',formatter: 'formatRef',params:{dataType:"object",textField:"name"}, sortable: false, title: '模具', width: 150 },
|
||||
{ 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({
|
||||
rowFilter: (row) => { return row.id || (row.component_id && row.mes_processes_id) },
|
||||
dataId: this.getDataId_BigInt(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue