Browse Source

首次提交111

master
常熟吴彦祖 5 months ago
parent
commit
e5c6c19a3b
  1. 6
      src/api/wms/wms.js
  2. 890
      src/views/modules/print/PoPartPrint.vue

6
src/api/wms/wms.js

@ -0,0 +1,6 @@
import { createAPI } from "@/utils/httpRequest.js";
//获取检验合格的单据
export const getInboundQcResultData = data => createAPI(`wmsPrint/getInboundQcResultData`,'POST',data)
export const getPoOrderRollNoOutData = data => createAPI(`wmsPrint/getPoOrderRollNoOutData`,'POST',data)
export const getInboundQcResultOtherData = data => createAPI(`wmsPrint/getInboundQcResultOtherData`,'POST',data)
export const submitPoOrderRollNo = data => createAPI(`wmsPrint/submitPoOrderRollNo`,'POST',data)

890
src/views/modules/print/PoPartPrint.vue

@ -0,0 +1,890 @@
<template>
<div class="mod-config" >
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;" >
<el-row>
<el-col :span="24" style="">
<el-form-item :label="'Supplier Name:'">
<el-input v-model="searchData.supplierName" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'Status:'">
<el-select v-model="searchData.supplierGroup" style="width: 130px">
<el-option label="All" value=""></el-option>
<el-option label="战略" value="战略"></el-option>
<el-option label="重要" value="重要"></el-option>
<el-option label="普通" value="普通"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="' '" >
<el-button class="customer-bun-min" type="primary" @click="getMainData" style="">Query</el-button>
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
:height="height"
:data="mainDataList"
border
ref="mainTable"
highlight-current-row
@row-click="changeData"
v-loading="dataListLoading"
style="margin-top: 0px; width: 100%;">
<el-table-column
header-align="center"
align="center"
width="100"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="addOrUpdateHandle(scope.row)">生成标签</a>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnArray1" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{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-pagination style="margin-top: 0px"
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-table
:height="height"
:data="table2List"
border
ref="table3"
highlight-current-row
v-loading="dataListLoading"
style="margin-top: 0px; width: 100%;">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
v-for="(item,index) in columnArray2" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{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-dialog title="标签发行" :close-on-click-modal="false" v-drag :visible.sync="addModelFlag" width="800px">
<el-form :model="addModelData" label-position="top" style="margin-top: -5px;">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="物料编码" >
<el-input v-model="addModelData.partNo" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="物料名称" >
<el-input v-model="addModelData.partDesc" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="采购订单" >
<el-input v-model="addModelData.poOrderNo" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="采购订单行号">
<el-input v-model="addModelData.poItemNo" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="通知单">
<el-input v-model="addModelData.orderNo" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="本次到货数量">
<el-input v-model="addModelData.orderQty" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="本次到货卷数">
<el-input v-model="addModelData.orderRollCount" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="检验合格数量">
<el-input v-model="addModelData.batchQualifiedQty" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="剩余可发行数量">
<el-input v-model="addModelData.remainingIssuableQty" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="超入比例" >
<el-input v-model="addModelData.exceedInRatio" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有效期管理">
<el-input v-model="addModelData.expirationFlag" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="本次发行数量" >
<el-input v-model="addModelData.nowRollQty" disabled style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="生产日期" required>
<el-date-picker
v-model="addModelData.productionDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="批次号">
<el-input v-model="addModelData.batchNo" style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发行张数" required>
<el-input v-model="addModelData.rollCount" @blur="getNowRollQty()" @input="handleInput" type="number" style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="每张数量" required>
<el-input v-model="addModelData.rollQty" @blur="getNowRollQty()" type="number" style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="尾卷数量">
<el-input v-model="addModelData.tailRollQty" @blur="getNowRollQty()" type="number" style="width: 100%"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center;">
<el-button type="success" @click="submitData()">确定</el-button>
<el-button type="primary" @click="addModelFlag=false">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
/*组件*/
import excel from "@/utils/excel-util.js";
import {
getInboundQcResultData,
getInboundQcResultOtherData,
getPoOrderRollNoOutData,
submitPoOrderRollNo
} from '../../../api/wms/wms'
export default {
data() {
return {
functionId: this.$route.meta.menuId,
height: 200,
currentRow: {},
searchData:{
site:this.$store.state.user.site,
page: 1,
limit: 10,
},
pageIndex: 1,
pageSize: 50,
totalPage: 0,
mainDataList:[],
table2List:[],
dataListLoading: false,
addModelFlag:false,
addModelData:{
expirationWarningDay:'',
site:'',
buNo:'',
partNo: '',
partDesc: '',
poOrderNo: '',
poItemNo: '',
orderNo: '',
orderQty: '',
supplierId: '',
supplierName: '',
orderRollCount: '',
batchQualifiedQty: '',
remainingIssuableQty: '',
exceedInRatio: '',
expirationFlag: '',
expirationDay: '',
nowRollQty: '',
productionDate: '',
batchNo: '',
rollCount: '1',
rollQty: '',
tailRollQty: '0'
},
columnArray1: [
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1BuNo',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "buNo",
headerAlign: "center",
align: "center",
columnLabel: "BU",
columnWidth: '70',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1OrderNo',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "orderNo",
headerAlign: "center",
align: "left",
columnLabel: "通知单号",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 1,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1OrderStatus',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "orderStatus",
headerAlign: "center",
align: "center",
columnLabel: "单据状态",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 2,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1PartNo',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "partNo",
headerAlign: "center",
align: "left",
columnLabel: "物料编码",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 3,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1PartDesc',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "partDesc",
headerAlign: "center",
align: "left",
columnLabel: "物料名称",
columnWidth: '200',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 4,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1PoOrderNo',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "poOrderNo",
headerAlign: "center",
align: "left",
columnLabel: "采购订单号",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 5,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1PoItemNo',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "poItemNo",
headerAlign: "center",
align: "center",
columnLabel: "行号",
columnWidth: '80',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 6,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1SupplierName',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "supplierName",
headerAlign: "center",
align: "left",
columnLabel: "供应商",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 7,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1InspectorDate',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "inspectorDate",
headerAlign: "center",
align: "center",
columnLabel: "检验日期",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 8,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1InspectorNo',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "inspectorNo",
headerAlign: "center",
align: "left",
columnLabel: "检验员",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 9,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1OrderQty',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "orderQty",
headerAlign: "center",
align: "right",
columnLabel: "到货数量",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 10,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1RollCount',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "rollCount",
headerAlign: "center",
align: "right",
columnLabel: "到货卷数",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 11,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1InspectionResult',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "inspectionResult",
headerAlign: "center",
align: "center",
columnLabel: "检验结论",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 12,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1DisposalMeasures',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "disposalMeasures",
headerAlign: "center",
align: "left",
columnLabel: "处置措施",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 13,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table1BatchQualifiedQty',
tableId: "670Table1",
tableName: "采购检验合格单",
columnProp: "batchQualifiedQty",
headerAlign: "center",
align: "right",
columnLabel: "允许入库数",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 14,
status: true,
fixed: false
}
],
columnArray2: [
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table2OrderId',
tableId: "670Table2",
tableName: "采购物料标签清单",
columnProp: "orderId",
headerAlign: "center",
align: "right",
columnLabel: "No .",
columnWidth: '50',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table2RollNo',
tableId: "670Table2",
tableName: "采购物料标签清单",
columnProp: "rollNo",
headerAlign: "center",
align: "left",
columnLabel: "标签条码",
columnWidth: '150',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 1,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table2RollQty',
tableId: "670Table2",
tableName: "采购物料标签清单",
columnProp: "rollQty",
headerAlign: "center",
align: "right",
columnLabel: "标签数量",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 2,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table2HardtagInFlag',
tableId: "670Table2",
tableName: "采购物料标签清单",
columnProp: "hardtagInFlag",
headerAlign: "center",
align: "center",
columnLabel: "标签状态",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 3,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table2PrintFla',
tableId: "670Table2",
tableName: "采购物料标签清单",
columnProp: "printFlag",
headerAlign: "center",
align: "right",
columnLabel: "打印次数",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 4,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table2ProductionDate',
tableId: "670Table2",
tableName: "采购物料标签清单",
columnProp: "productionDate",
headerAlign: "center",
align: "center",
columnLabel: "入库日期",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 6,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '670Table2OCreatedBy',
tableId: "670Table2",
tableName: "采购物料标签清单",
columnProp: "createdBy",
headerAlign: "center",
align: "left",
columnLabel: "操作员",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 7,
status: true,
fixed: false
}
],
exportName: '采购检验合格单'+this.dayjs().format('YYYYMMDDHHmmss'),
exportName2: '采购物料标签清单'+this.dayjs().format('YYYYMMDDHHmmss'),
}
},
/*组件*/
components: {
excel,
},
mounted() {
this.$nextTick(() => {
this.height = ( window.innerHeight - 220)/2;
})
},
methods: {
getMainData(){
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
getInboundQcResultData(this.searchData).then(({data}) => {
if (data.code === 0) {
this.mainDataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
//
if (this.totalPage > 0) {
//
this.$refs.mainTable.setCurrentRow(this.mainDataList[0])
this.changeData(this.mainDataList[0])
}else {
this.changeData(null)
}
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getMainData()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getMainData()
},
async exportExcel() {
this.searchData.limit = -1
this.searchData.page = 1
excel.exportTable({
url: "/wmsPrint/getInboundQcResultData",
columnMapping: this.columnArray1,//table
mergeSetting: [],//
params: this.searchData,
fileName: this.exportName+".xlsx",
rowFetcher: res => res.data,
columnFormatter: [],
dropColumns: [],//dropColumns: ["netWeight"]
});
},
changeData(row){
this.currentRow=JSON.parse(JSON.stringify(row))
let inData={
site:this.currentRow.site,
buNo:this.currentRow.buNo,
inspectionNo:this.currentRow.orderNo,
}
getPoOrderRollNoOutData(inData).then(({data}) => {
//
if (data && data.code == 0) {
this.table2List = data.rows
} else {
this.table2List = [];
}
});
},
addOrUpdateHandle(row) {
console.log(row);
getInboundQcResultOtherData(row).then(({data}) => {
//
if (data && data.code=== 0) {
let outData = data.row
console.log(data.row);
this.addModelData={
site:row.site,
buNo:row.buNo,
partNo: row.partNo,
partDesc: row.partDesc,
poOrderNo: row.poOrderNo,
poItemNo: row.poItemNo,
orderNo: row.orderNo,
orderQty: row.orderQty,
supplierId: row.supplierId,
supplierName: row.supplierName,
orderRollCount: row.rollCount,
batchQualifiedQty: row.batchQualifiedQty,
remainingIssuableQty: outData.remainingIssuableQty,
exceedInRatio: outData.exceedInRatio,
expirationFlag: outData.expirationFlag? outData.expirationFlag:'N',
expirationDay:outData.expirationDay?Number(outData.expirationDay):0,
nowRollQty: row.rollQty,
productionDate: '',
batchNo: '',
rollCount: '1',
rollQty: row.rollQty,
expirationWarningDay: row.expirationWarningDay,
tailRollQty: '0'
}
if(this.addModelData.exceedInRatio==""||this.addModelData.exceedInRatio==null){
this.addModelData.exceedInRatio=0
}
console.log( this.addModelData);
}
});
this.addModelFlag = true;
},
submitData() {
//
if (!this.addModelData.productionDate||this.addModelData.productionDate==='') {
this.$message.error('请选择生产日期');
return;
}
if (!this.addModelData.rollCount||this.addModelData.rollCount==='') {
this.$message.error('请输入发行张数');
return;
}
if (!this.addModelData.rollQty||this.addModelData.rollQty==='') {
this.$message.error('请输入每张数量');
return;
}
if ( this.addModelData.nowRollQty>Number(this.addModelData.remainingIssuableQty)+((Number(this.addModelData.exceedInRatio)*Number(this.addModelData.orderQty))/100)) {
this.$message.error('本次发行数量大于剩余可发行数量和超入数量');
return;
}
//
console.log('提交数据:', this.addModelData);
submitPoOrderRollNo(this.addModelData).then(({data}) => {
if (data && data.code === 0) {
this.$message.success( '操作成功')
this.changeData(this.currentRow);
this.addModelFlag = false;
}else {
this.$message.error(data.msg);
}
})
this.addModelFlag = false;
},
getNowRollQty(){
if(this.addModelData.tailRollQty==''||this.addModelData.tailRollQty==null||this.addModelData.tailRollQty<0){
this.addModelData.tailRollQty=0
}
if(this.addModelData.tailRollQty==0){
this.addModelData.nowRollQty=Number(this.addModelData.rollQty)*Number(this.addModelData.rollCount)
}else {
this.addModelData.nowRollQty=Number(this.addModelData.rollQty)*(Number(this.addModelData.rollCount)-1)+Number(this.addModelData.tailRollQty)
}
},
handleInput(value) {
// 1.
value = value.replace(/\D/g, '')
// 2. 0, 00, 0123 123
value = value.replace(/^0+/, '')
// 3. Vue
this.addModelData.rollCount = value
},
},
created() {
//
this.getMainData();
},
}
</script>
<!--当前页面的标签样式-->
<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
padding: 5px !important;
}
/deep/ .el-form-item__label {
font-weight: 500;
}
/deep/ .el-form-item.is-required .el-form-item__label:before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
/deep/ .dialog-footer {
padding: 20px 0 0 0;
text-align: center;
}
/deep/ .el-dialog__body {
padding: 20px;
}
/deep/ .el-input.is-disabled .el-input__inner {
background-color: #f5f7fa;
border-color: #e4e7ed;
color: #c0c4cc;
}
</style>
Loading…
Cancel
Save