Browse Source

定制报表开发

master
Rui_Li 4 years ago
parent
commit
1f8e828578
  1. 3
      src/api/yieldReport/com_separate_roll_with_split.js
  2. 270
      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'
// 获取分切工单的物料信息
export const getSplitOrderParts = data => createAPI('schedule/getSplitOrderParts', 'POST', data)
// 获取当前的卷的上机材料的主料
export const refreshCurrentPageData = data => createAPI('scheduling/getSplitScheduleCreateRollPageData', 'POST', data)

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

@ -1,11 +1,38 @@
<template>
<div class="customer-css">
<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;"
label-width="80px">
<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-col :span="4" >
<el-form-item :label="''">
@ -65,7 +92,7 @@
</el-col>
</el-row>
</fieldset>
<el-table height="300"
<el-table height="200"
:data="sfdcMaterialList"
border
v-loading="dataListLoading"
@ -94,7 +121,7 @@
</el-table>
</el-form>
<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>
</el-dialog>
<!--列表的组件-->
@ -107,6 +134,7 @@
import Chooselist from '@/views/modules/common/Chooselist';/*列表组件*/
/*js请求*/
import {
getSplitOrderParts,/*获取分切工单的物料信息*/
refreshCurrentPageData,
refreshCurrentPageTable,
checkCreateSeparateRoll,/*检查是否可以创建分卷*/
@ -136,6 +164,7 @@ export default {
supplierName: '',
rollQty: 0,
rollNums: 1,
bomItemNo: 0,
splitType: 'S'
},
operatorData: {
@ -147,14 +176,89 @@ export default {
seqNo: '',
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: [],
columnMaterialArray: [
{
userId: this.$store.state.user.name,
functionId: 5303,
serialNumber: '5303MaterialRollNo',
tableId: "5303Material",
tableName: "材料",
serialNumber: '5309PartRollNo',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "rollNo",
headerAlign: "center",
align: "center",
@ -170,9 +274,9 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 5305,
serialNumber: '5305MaterialRollQty',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartRollQty',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "rollQty",
headerAlign: "center",
align: "center",
@ -188,9 +292,9 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 5305,
serialNumber: '5305MaterialSuppDeliveryNote',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartSuppDeliveryNote',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "suppDeliveryNote",
headerAlign: "center",
align: "center",
@ -206,9 +310,9 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 5305,
serialNumber: '5305MaterialRollDate',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartRollDate',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "rollDate",
headerAlign: "center",
align: "center",
@ -224,9 +328,9 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 5305,
serialNumber: '5305MaterialCreatedDate',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartCreatedDate',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "createdDate",
headerAlign: "center",
align: "center",
@ -242,9 +346,9 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 5305,
serialNumber: '5305MaterialCreatedBy',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartCreatedBy',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "createdBy",
headerAlign: "center",
align: "right",
@ -260,9 +364,9 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 5305,
serialNumber: '5305MaterialSuppRollNoFlag',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartSuppRollNoFlag',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "suppRollNoFlag",
headerAlign: "center",
align: "right",
@ -278,9 +382,9 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 5305,
serialNumber: '5305MaterialSuppRollNo',
tableId: "5305Material",
tableName: "材料",
serialNumber: '5309PartSuppRollNo',
tableId: "5309Part",
tableName: "分切工单",
columnProp: "suppRollNo",
headerAlign: "center",
align: "center",
@ -305,86 +409,97 @@ export default {
/*初始化页面参数*/
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*/
closeDialog () {
this.$emit('update:visible', false);
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 () {
//
this.getCurrentPageData();
this.getCurrentPageData()
//table
this.getCurrentPageTable();
this.getCurrentPageTable()
},
//
getCurrentPageData () {
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 () {
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;
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.pageData.fgPartNo = val.PartNo
this.pageData.fgPartDesc = val.PartDescSpec
}
//
this.getCurrentPageData();
this.getCurrentPageData()
},
//
getBaseList (val) {
this.tagNo = val
this.$nextTick(() => {
let strVal = "";
let strVal = ''
if (val === 92) {
strVal = this.pageData.customerId;
strVal = this.pageData.customerId
} else if (val === 5) {
strVal = this.pageData.fgPartNo;
strVal = this.pageData.fgPartNo
}
this.$refs.baseList.init(val, strVal)
})
@ -396,12 +511,12 @@ export default {
checkCreateSeparateRoll(this.pageData).then(({data}) => {
//
if (data.code == 500) {
this.$message.error(data.msg);
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() {
//
}
//
//this.refreshSplitOrderParts();
},
}
</script>

Loading…
Cancel
Save