Browse Source

定制报表开发

master
Rui_Li 4 years ago
parent
commit
1f8e828578
  1. 3
      src/api/yieldReport/com_separate_roll_with_split.js
  2. 298
      src/views/modules/yieldReport/com_separate_roll_with_split.vue

3
src/api/yieldReport/com_separate_roll_with_split.js

@ -1,5 +1,8 @@
import { createAPI } from '@/utils/httpRequest.js' import { createAPI } from '@/utils/httpRequest.js'
// 获取分切工单的物料信息
export const getSplitOrderParts = data => createAPI('schedule/getSplitOrderParts', 'POST', data)
// 获取当前的卷的上机材料的主料 // 获取当前的卷的上机材料的主料
export const refreshCurrentPageData = data => createAPI('scheduling/getSplitScheduleCreateRollPageData', 'POST', data) export const refreshCurrentPageData = data => createAPI('scheduling/getSplitScheduleCreateRollPageData', 'POST', data)

298
src/views/modules/yieldReport/com_separate_roll_with_split.vue

@ -1,11 +1,38 @@
<template> <template>
<div class="customer-css"> <div class="customer-css">
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners" <el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
width="755px" style="height: 530px;" class="customer-dialog">
width="755px" style="height: 560px;" class="customer-dialog">
<el-form :inline="true" label-position="top" style="height: 400px;" <el-form :inline="true" label-position="top" style="height: 400px;"
label-width="80px"> label-width="80px">
<fieldset class="customer-fieldset" style="width: 730px;"> <fieldset class="customer-fieldset" style="width: 730px;">
<el-table height="100"
:data="orderPartList"
border ref="orderPartTable" highlight-current-row
v-loading="dataListLoading"
@current-change="changePartRow"
style="width: 730px; margin-left: 0px; margin-top: 0px;">
<el-table-column
v-for="(item,index) in columnPartArray" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<!--<el-input type="number" class="table-input" align="right" @blur="checkValidQty(scope.row)"-->
<el-input type="number" class="table-input" align="right" v-if="item.columnHidden"
v-model="scope.row[item.columnProp]"></el-input>
<span v-else>{{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
<el-row style="margin-left: 5px; margin-top: -5px;"> <el-row style="margin-left: 5px; margin-top: -5px;">
<el-col :span="4" > <el-col :span="4" >
<el-form-item :label="''"> <el-form-item :label="''">
@ -65,7 +92,7 @@
</el-col> </el-col>
</el-row> </el-row>
</fieldset> </fieldset>
<el-table height="300"
<el-table height="200"
:data="sfdcMaterialList" :data="sfdcMaterialList"
border border
v-loading="dataListLoading" v-loading="dataListLoading"
@ -94,7 +121,7 @@
</el-table> </el-table>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" > <span slot="footer" class="dialog-footer" >
<el-button type="primary" @click="closeDialog">关闭</el-button>
<el-button type="primary" @click="closeDialog" style="margin-bottom: 5px;">关闭</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!--列表的组件--> <!--列表的组件-->
@ -107,6 +134,7 @@
import Chooselist from '@/views/modules/common/Chooselist';/*列表组件*/ import Chooselist from '@/views/modules/common/Chooselist';/*列表组件*/
/*js请求*/ /*js请求*/
import { import {
getSplitOrderParts,/*获取分切工单的物料信息*/
refreshCurrentPageData, refreshCurrentPageData,
refreshCurrentPageTable, refreshCurrentPageTable,
checkCreateSeparateRoll,/*检查是否可以创建分卷*/ checkCreateSeparateRoll,/*检查是否可以创建分卷*/
@ -136,6 +164,7 @@ export default {
supplierName: '', supplierName: '',
rollQty: 0, rollQty: 0,
rollNums: 1, rollNums: 1,
bomItemNo: 0,
splitType: 'S' splitType: 'S'
}, },
operatorData: { operatorData: {
@ -147,14 +176,89 @@ export default {
seqNo: '', seqNo: '',
showFlag: false showFlag: false
}, },
orderPartList: [],
columnPartArray: [
{
userId: this.$store.state.user.name,
functionId: 5303,
serialNumber: '5309PartBomItemNo',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "bomItemNo",
headerAlign: "center",
align: "center",
columnLabel: "行号",
columnWidth: '',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5305,
serialNumber: '5309PartPartNo',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "partNo",
headerAlign: "center",
align: "center",
columnLabel: "物料编码",
columnWidth: '',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5305,
serialNumber: '5309PartPartDesc',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "partDesc",
headerAlign: "center",
align: "center",
columnLabel: "物料描述",
columnWidth: '',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5305,
serialNumber: '5309PartOrderQty',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "orderQty",
headerAlign: "center",
align: "center",
columnLabel: "数量",
columnWidth: '',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
],
sfdcMaterialList: [], sfdcMaterialList: [],
columnMaterialArray: [ columnMaterialArray: [
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5303, functionId: 5303,
serialNumber: '5303MaterialRollNo',
tableId: "5303Material",
tableName: "材料",
serialNumber: '5309PartRollNo',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "rollNo", columnProp: "rollNo",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
@ -170,9 +274,9 @@ export default {
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5305, functionId: 5305,
serialNumber: '5305MaterialRollQty',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartRollQty',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "rollQty", columnProp: "rollQty",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
@ -188,9 +292,9 @@ export default {
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5305, functionId: 5305,
serialNumber: '5305MaterialSuppDeliveryNote',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartSuppDeliveryNote',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "suppDeliveryNote", columnProp: "suppDeliveryNote",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
@ -206,9 +310,9 @@ export default {
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5305, functionId: 5305,
serialNumber: '5305MaterialRollDate',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartRollDate',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "rollDate", columnProp: "rollDate",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
@ -224,9 +328,9 @@ export default {
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5305, functionId: 5305,
serialNumber: '5305MaterialCreatedDate',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartCreatedDate',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "createdDate", columnProp: "createdDate",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
@ -242,9 +346,9 @@ export default {
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5305, functionId: 5305,
serialNumber: '5305MaterialCreatedBy',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartCreatedBy',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "createdBy", columnProp: "createdBy",
headerAlign: "center", headerAlign: "center",
align: "right", align: "right",
@ -260,9 +364,9 @@ export default {
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5305, functionId: 5305,
serialNumber: '5305MaterialSuppRollNoFlag',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartSuppRollNoFlag',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "suppRollNoFlag", columnProp: "suppRollNoFlag",
headerAlign: "center", headerAlign: "center",
align: "right", align: "right",
@ -278,9 +382,9 @@ export default {
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5305, functionId: 5305,
serialNumber: '5305MaterialSuppRollNo',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartSuppRollNo',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "suppRollNo", columnProp: "suppRollNo",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
@ -303,105 +407,116 @@ export default {
}, },
methods: { methods: {
/*初始化页面参数*/ /*初始化页面参数*/
init(scheduleData, operatorData) {
init (scheduleData, operatorData) {
// //
this.pageData.partNo = scheduleData.partNo;
this.pageData.partDesc = scheduleData.partDesc;
this.pageData.orderNo = scheduleData.orderNo;
this.pageData.itemNo = scheduleData.itemNo;
this.pageData.seqNo = scheduleData.seqNo;
this.pageData.rollNo = scheduleData.rollNo;
this.pageData.operatorId = operatorData.operatorId;
this.pageData.customerId = '无';
this.pageData.customerName = '';
this.pageData.fgPartNo = '无';
this.pageData.fgPartDesc = '';
this.pageData.supplierId = '*';
this.pageData.supplierName = '';
this.pageData.partNo = ''
this.pageData.partDesc = ''
this.pageData.orderNo = scheduleData.orderNo
this.pageData.itemNo = scheduleData.itemNo
this.pageData.seqNo = scheduleData.seqNo
this.pageData.rollNo = scheduleData.rollNo
this.pageData.operatorId = operatorData.operatorId
this.pageData.customerId = '无'
this.pageData.customerName = ''
this.pageData.fgPartNo = '无'
this.pageData.fgPartDesc = ''
this.pageData.supplierId = '*'
this.pageData.supplierName = ''
// //
this.sfdcMaterialList = [];
this.sfdcMaterialList = []
// //
this.operatorData = JSON.parse(JSON.stringify(operatorData));
this.operatorData = JSON.parse(JSON.stringify(operatorData))
// //
this.titleCon = '创建分卷';
this.titleCon = '创建分卷'
//
this.refreshSplitOrderParts();
// //
this.refreshPageData();
this.refreshPageData()
}, },
/*关闭modal*/ /*关闭modal*/
closeDialog(){
this.$emit('update:visible', false);
closeDialog () {
this.$emit('update:visible', false)
},
/*刷新分期工单的*/
refreshSplitOrderParts () {
getSplitOrderParts(this.pageData).then(({data}) => {
this.orderPartList = data.rows;
setTimeout(() => {
this.$refs.orderPartTable.setCurrentRow(this.orderPartList[0]);
}, 300)
});
}, },
/*刷新当前的页面参数*/ /*刷新当前的页面参数*/
refreshPageData(){
refreshPageData () {
// //
this.getCurrentPageData();
this.getCurrentPageData()
//table //table
this.getCurrentPageTable();
this.getCurrentPageTable()
}, },
// //
getCurrentPageData(){
getCurrentPageData () {
refreshCurrentPageData(this.pageData).then(({data}) => { refreshCurrentPageData(this.pageData).then(({data}) => {
// //
this.pageData.customerId = data.pageMap.customerId;
this.pageData.customerName = data.pageMap.customerName;
this.pageData.fgPartNo = data.pageMap.fgPartNo;
this.pageData.fgPartDesc = data.pageMap.fgPartDesc;
this.pageData.referName = data.pageMap.referName;
this.pageData.supplierId = data.pageMap.supplierId;
this.pageData.supplierName = data.pageMap.supplierDesc;
});
this.pageData.customerId = data.pageMap.customerId
this.pageData.customerName = data.pageMap.customerName
this.pageData.fgPartNo = data.pageMap.fgPartNo
this.pageData.fgPartDesc = data.pageMap.fgPartDesc
this.pageData.referName = data.pageMap.referName
this.pageData.supplierId = data.pageMap.supplierId
this.pageData.supplierName = data.pageMap.supplierDesc
})
}, },
// //
getCurrentPageTable(){
getCurrentPageTable () {
refreshCurrentPageTable(this.pageData).then(({data}) => { refreshCurrentPageTable(this.pageData).then(({data}) => {
this.sfdcMaterialList = data.rows;
});
this.sfdcMaterialList = data.rows
})
}, },
/*列表方法的回调*/ /*列表方法的回调*/
getBaseData(val){
if (this.tagNo === 92){
this.pageData.customerId = val.ConfigurationTemplateID;
this.pageData.customerName = val.CustDesc;
}else if(this.tagNo == 5){
this.pageData.fgPartNo = val.PartNo;
this.pageData.fgPartDesc = val.PartDescSpec;
getBaseData (val) {
if (this.tagNo === 92) {
this.pageData.customerId = val.ConfigurationTemplateID
this.pageData.customerName = val.CustDesc
} else if (this.tagNo == 5) {
this.pageData.fgPartNo = val.PartNo
this.pageData.fgPartDesc = val.PartDescSpec
} }
// //
this.getCurrentPageData();
this.getCurrentPageData()
}, },
// //
getBaseList(val){
getBaseList (val) {
this.tagNo = val this.tagNo = val
this.$nextTick(() => { this.$nextTick(() => {
let strVal = "";
if (val === 92){
strVal = this.pageData.customerId;
}else if(val === 5){
strVal = this.pageData.fgPartNo;
let strVal = ''
if (val === 92) {
strVal = this.pageData.customerId
} else if (val === 5) {
strVal = this.pageData.fgPartNo
} }
this.$refs.baseList.init(val, strVal) this.$refs.baseList.init(val, strVal)
}) })
}, },
// //
checkCreateSeparateRoll(){
checkCreateSeparateRoll () {
// //
checkCreateSeparateRoll(this.pageData).then(({data}) => { checkCreateSeparateRoll(this.pageData).then(({data}) => {
// //
if(data.code == 500){
this.$message.error(data.msg);
}else{
if (data.code == 500) {
this.$message.error(data.msg)
} else {
// //
this.createSeparateRollBun();
this.createSeparateRollBun()
} }
});
})
}, },
/*处理材料下料的记录*/ /*处理材料下料的记录*/
@ -452,12 +567,23 @@ export default {
}) })
}, },
/*触发修改的时间*/
changePartRow(row, oldRow){
//
if(row){
this.pageData.partNo = row.partNo;
this.pageData.partDesc = row.partDesc;
//
this.refreshPageData();
}
},
}, },
created() { created() {
//
}
//
//this.refreshSplitOrderParts();
},
} }
</script> </script>

Loading…
Cancel
Save