4 changed files with 628 additions and 20 deletions
-
1src/api/base/normalSearch.js
-
4src/api/material/poReceive.js
-
581src/views/modules/material/com_poReceiving_add_or_update.vue
-
62src/views/modules/material/poReceiving.vue
@ -0,0 +1 @@ |
|||||
|
import { createAPI } from "@/utils/httpRequest.js"; |
||||
@ -0,0 +1,581 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<el-dialog |
||||
|
width="40%" |
||||
|
title="入库单明细" |
||||
|
:close-on-click-modal="false" |
||||
|
:visible.sync="visible" |
||||
|
@close="closeSaveDialog"> |
||||
|
<el-form ref="saveForm" :model="dataForm" label-position="top" label-width="100px" > |
||||
|
<el-row :gutter="25"> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="入库单号"> |
||||
|
<el-input v-model="dataForm.transNo" disabled ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="供应商编码"> |
||||
|
<el-input v-model="dataForm.partnerID" disabled ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="供应商名称"> |
||||
|
<el-input v-model="dataForm.partnerName" disabled ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" @click="visible = false">关闭</el-button> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="25"> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="仓库"> |
||||
|
<el-input v-model="dataForm.warehouseID" disabled ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="入库日期"> |
||||
|
<el-date-picker |
||||
|
style="width: 120px" |
||||
|
v-model="dataForm.transDate" |
||||
|
type="date" |
||||
|
disabled |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="经手人"> |
||||
|
<el-input v-model="dataForm.receiveName" disabled ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="采购单号"> |
||||
|
<el-input v-model="dataForm.orderRef1" disabled ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="25"> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="物料编码"> |
||||
|
<el-input v-model="dataForm.partNo" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="物料描述"> |
||||
|
<el-input v-model="dataForm.partDesc" disabled ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="库位"> |
||||
|
<el-input v-model="dataForm.locationId" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" @click="dataFormSubmit()">{{'扫描条码入库'}}</el-button> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="25"> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="批号"> |
||||
|
<el-input v-model="dataForm.batchNo" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="W/D/R"> |
||||
|
<el-input v-model="dataForm.wdrNo" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="生产日期"> |
||||
|
<el-date-picker |
||||
|
style="width: 120px" |
||||
|
v-model="dataForm.manufactureDate" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="失效日期"> |
||||
|
<el-date-picker |
||||
|
style="width: 120px" |
||||
|
v-model="dataForm.expiredDate" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="25"> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="每卷数量"> |
||||
|
<el-input v-model="rollData.perQty" type="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="卷数"> |
||||
|
<el-input v-model="rollData.rollNumber" type="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" @click="createNewRoll()">{{'创建分卷'}}</el-button> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" @click="dataFormSubmit()">{{'最终保存'}}</el-button> |
||||
|
<el-button type="primary" @click="visible = false">{{'关闭'}}</el-button> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<el-table |
||||
|
:data="dataList" |
||||
|
height="300" |
||||
|
border |
||||
|
v-loading="false" |
||||
|
style="width: 100%; "> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columnList" :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> |
||||
|
|
||||
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
searchTransDetailAndSubCach |
||||
|
,createNewCachRoll |
||||
|
,finalSaveTransHeaderDetail |
||||
|
} from "@/api/material/poReceive.js" |
||||
|
import Chooselist from '@/views/modules/common/Chooselist' |
||||
|
import {searchTransDetail} from "../../../api/material/poReceive"; |
||||
|
export default { |
||||
|
model:{ |
||||
|
prop:'value', |
||||
|
event:'change', |
||||
|
}, |
||||
|
props:{ |
||||
|
value:{ |
||||
|
required:true, |
||||
|
type:String, |
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
Chooselist |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
tagNo:'', |
||||
|
tagNo1:'', |
||||
|
visible: false, |
||||
|
dataForm: { |
||||
|
site:this.$store.state.user.site, |
||||
|
warehouseID:'', |
||||
|
transNo:'', |
||||
|
partnerID:'', |
||||
|
partnerName:'', |
||||
|
transDate:'', |
||||
|
receiveName:'', |
||||
|
orderRef1:'', |
||||
|
partNo:'', |
||||
|
partDesc:'', |
||||
|
locationId:'', |
||||
|
batchNo:'', |
||||
|
wdrNo:'', |
||||
|
manufactureDate:'', |
||||
|
expiredDate:'', |
||||
|
}, |
||||
|
rollData:{ |
||||
|
perQty:'', |
||||
|
rollNumber:'', |
||||
|
}, |
||||
|
dataList:[], |
||||
|
columnList:[ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200001, |
||||
|
serialNumber: '200001Table4PartNo', |
||||
|
tableId: "200001Table4", |
||||
|
tableName: "入库单已扫卷", |
||||
|
columnProp: "partNo", |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: "物料编码", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80 |
||||
|
},{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200001, |
||||
|
serialNumber: '200001Table4PartDesc', |
||||
|
tableId: "200001Table4", |
||||
|
tableName: "入库单已扫卷", |
||||
|
columnProp: "partDesc", |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: "物料名", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120 |
||||
|
},{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200001, |
||||
|
serialNumber: '200001Table4RollNo', |
||||
|
tableId: "200001Table4", |
||||
|
tableName: "入库单已扫卷", |
||||
|
columnProp: "rollNo", |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: "卷号", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80 |
||||
|
},{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200001, |
||||
|
serialNumber: '200001Table4RollQty', |
||||
|
tableId: "200001Table4", |
||||
|
tableName: "入库单已扫卷", |
||||
|
columnProp: "rollQty", |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: "数量", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 60 |
||||
|
},{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200001, |
||||
|
serialNumber: '200001Table4BatchNo', |
||||
|
tableId: "200001Table4", |
||||
|
tableName: "入库单已扫卷", |
||||
|
columnProp: "batchNo", |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: "批号", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80 |
||||
|
},{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200001, |
||||
|
serialNumber: '200001Table4WdrNo', |
||||
|
tableId: "200001Table4", |
||||
|
tableName: "入库单已扫卷", |
||||
|
columnProp: "wdrNo", |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: "W/D/R", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80 |
||||
|
},{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200001, |
||||
|
serialNumber: '200001Table4ManufactureDate', |
||||
|
tableId: "200001Table4", |
||||
|
tableName: "入库单已扫卷", |
||||
|
columnProp: "manufactureDate", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "生产日期", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100 |
||||
|
},{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200001, |
||||
|
serialNumber: '200001Table4ExpiredDate', |
||||
|
tableId: "200001Table4", |
||||
|
tableName: "入库单已扫卷", |
||||
|
columnProp: "expiredDate", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "失效日期", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100 |
||||
|
},{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200001, |
||||
|
serialNumber: '200001Table4LocationID', |
||||
|
tableId: "200001Table4", |
||||
|
tableName: "入库单已扫卷", |
||||
|
columnProp: "locationID", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "库位", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 70 |
||||
|
},{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200001, |
||||
|
serialNumber: '200001Table4EnterByName', |
||||
|
tableId: "200001Table4", |
||||
|
tableName: "入库单已扫卷", |
||||
|
columnProp: "enterByName", |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: "Created", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80 |
||||
|
},{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 200001, |
||||
|
serialNumber: '200001Table4EnterDate', |
||||
|
tableId: "200001Table4", |
||||
|
tableName: "入库单已扫卷", |
||||
|
columnProp: "enterDate", |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: "Created Time", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 130 |
||||
|
}, |
||||
|
], |
||||
|
} |
||||
|
}, |
||||
|
created () { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取基础数据列表S |
||||
|
getBaseList (val, type) { |
||||
|
this.tagNo = val |
||||
|
this.tagNo1 = type |
||||
|
this.$nextTick(() => { |
||||
|
let strVal = '' |
||||
|
// if (val === 1010) { |
||||
|
// if(type==1) { |
||||
|
// strVal = this.dataForm.projectTypeDb |
||||
|
// } |
||||
|
// } |
||||
|
|
||||
|
this.$refs.baseList.init(val, strVal) |
||||
|
}) |
||||
|
}, |
||||
|
/* 列表方法的回调 */ |
||||
|
getBaseData (val) { |
||||
|
if (this.tagNo === 1010) { |
||||
|
// if(this.tagNo1==1) { |
||||
|
// this.dataForm.projectTypeDb = val.Base_id |
||||
|
// this.dataForm.projectType = val.Base_desc |
||||
|
// } |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
init (row) { |
||||
|
this.rollData={ |
||||
|
perQty:'', |
||||
|
rollNumber:'', |
||||
|
} |
||||
|
this.cleanData() |
||||
|
searchTransDetailAndSubCach(row).then(({data})=>{ |
||||
|
//区分请求成功和失败的状况 |
||||
|
if (data && data.code == 0) { |
||||
|
let row= data.row |
||||
|
this.dataList = data.rows |
||||
|
this.dataForm={ |
||||
|
site:row.site, |
||||
|
warehouseID:row.warehouseID, |
||||
|
transNo:row.transNo, |
||||
|
partnerID:row.partnerID, |
||||
|
partnerName:row.partnerName, |
||||
|
transDate:row.transDate, |
||||
|
receiveName:row.receiverName, |
||||
|
orderRef1:row.orderRef1, |
||||
|
partNo:'', |
||||
|
partDesc:'', |
||||
|
locationId:'', |
||||
|
batchNo:'', |
||||
|
wdrNo:'', |
||||
|
manufactureDate:'', |
||||
|
expiredDate:'', |
||||
|
} |
||||
|
} else { |
||||
|
this.$message.error(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
this.visible = true |
||||
|
}, |
||||
|
createNewRoll(){ |
||||
|
if(this.dataForm.partNo===''){ |
||||
|
this.$alert('请输入物料!', '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
if(this.dataForm.locationId===''){ |
||||
|
this.$alert('请选择库位!', '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
if(this.dataForm.batchNo===''){ |
||||
|
this.$alert('请输入批号!', '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
if(this.dataForm.manufactureDate===''){ |
||||
|
this.$alert('请选择生产日期!', '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
if(this.dataForm.expiredDate===''){ |
||||
|
this.$alert('请选择失效日期!', '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
if(this.rollData.perQty===''){ |
||||
|
this.$alert('请输入每卷数量!', '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
if(this.rollData.rollNumber===''){ |
||||
|
this.$alert('请输入卷数量!', '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
if(this.rollData.rollNumber>10000){ |
||||
|
this.$alert('卷数量超过一万!', '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
let inData={ |
||||
|
site:this.dataForm.site, |
||||
|
transNo:this.dataForm.transNo, |
||||
|
partNo:this.dataForm.partNo, |
||||
|
rollNo:'', |
||||
|
rollQty:this.rollData.perQty, |
||||
|
batchNo:this.dataForm.batchNo, |
||||
|
wdrNo:this.dataForm.wdrNo, |
||||
|
locationID:this.dataForm.locationId, |
||||
|
manufactureDate:this.dataForm.manufactureDate, |
||||
|
expiredDate:this.dataForm.expiredDate, |
||||
|
rollNumber:this.rollData.rollNumber, |
||||
|
|
||||
|
} |
||||
|
createNewCachRoll(inData).then(({data})=>{ |
||||
|
//区分请求成功和失败的状况 |
||||
|
if (data && data.code == 0) { |
||||
|
this.$message.success( '操作成功') |
||||
|
searchTransDetailAndSubCach(this.dataForm).then(({data})=>{ |
||||
|
this.dataList = data.rows |
||||
|
}) |
||||
|
} else { |
||||
|
this.$message.error(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 表单提交 |
||||
|
dataFormSubmit () { |
||||
|
finalSaveTransHeaderDetail(this.dataForm).then(({data})=>{ |
||||
|
//区分请求成功和失败的状况 |
||||
|
if (data && data.code == 0) { |
||||
|
this.$message.success( '操作成功') |
||||
|
this.visible = false |
||||
|
this.$emit('refreshDataList') |
||||
|
|
||||
|
} else { |
||||
|
this.$message.error(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
closeSaveDialog(){ |
||||
|
this.cleanData() |
||||
|
}, |
||||
|
cleanData(){ |
||||
|
for (var prop in this.dataForm) { |
||||
|
if (this.dataForm.hasOwnProperty(prop)) { |
||||
|
this.dataForm[prop] = ''; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style > |
||||
|
|
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue