|
@@ -145,7 +145,6 @@
|
|
this.$emit('onChose')
|
|
this.$emit('onChose')
|
|
},
|
|
},
|
|
async init (id, display, dataForm) {
|
|
async init (id, display, dataForm) {
|
|
- // console.log(dataForm)
|
|
|
|
this.display = display
|
|
this.display = display
|
|
this.id = id || 0
|
|
this.id = id || 0
|
|
this.visible = true
|
|
this.visible = true
|
|
@@ -176,32 +175,9 @@
|
|
addOne (item) {
|
|
addOne (item) {
|
|
this.dataList.push({...item,
|
|
this.dataList.push({...item,
|
|
buttonType: item ? (item.buttonType ? '1' : '0') : '0',
|
|
buttonType: item ? (item.buttonType ? '1' : '0') : '0',
|
|
- // id: item ? item.id : '',
|
|
|
|
amount: item ? item.amount : 0,
|
|
amount: item ? item.amount : 0,
|
|
- // applicant: item ? item.applicant : '',
|
|
|
|
- // approver: item ? item.approver : '',
|
|
|
|
- // unitName: item ? item.unitName : '',
|
|
|
|
- // specifications: item ? item.specifications : '',
|
|
|
|
- // batchNumber: item ? item.batchNumber : '',
|
|
|
|
- // cnt: item ? item.cnt : '',
|
|
|
|
- // categoryName: item ? item.categoryName : '',
|
|
|
|
- // materialId: item ? item.materialId : '',
|
|
|
|
- // materialName: item ? item.materialName : '',
|
|
|
|
- // notes: item ? item.notes : '',
|
|
|
|
- // orgId: item ? item.orgId : '',
|
|
|
|
- // price: item ? item.price : '',
|
|
|
|
- // recordType: item ? item.recordType : '',
|
|
|
|
- // source: item ? item.source : '',
|
|
|
|
state: item ? item.state : 0,
|
|
state: item ? item.state : 0,
|
|
- // templateItemPlanId: item ? item.templateItemPlanId : '',
|
|
|
|
- // usage: item ? item.usage : '',
|
|
|
|
- // userId: item ? item.userId : '',
|
|
|
|
- // orgName: item ? item.orgName : '',
|
|
|
|
- // unitNeedChange: item ? item.unitNeedChange : '',
|
|
|
|
- // conversionName: item ? item.conversionName : '',
|
|
|
|
sourceCategory: item ? item.sourceCategory : '2'
|
|
sourceCategory: item ? item.sourceCategory : '2'
|
|
- // materialTypeId: item ? item.materialTypeId : '',
|
|
|
|
- // tableId: item ? item.tableId : null
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
removeOne (index) {
|
|
removeOne (index) {
|
|
@@ -215,27 +191,21 @@
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
let postData = []
|
|
let postData = []
|
|
|
|
+ for (let i = 0; i < this.dataList.length; i++) {
|
|
|
|
+ if (!this.dataList[i].batchNumber) {
|
|
|
|
+ this.$message.warning('批次号不能为空')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.dataList.forEach((item) => {
|
|
this.dataList.forEach((item) => {
|
|
postData.push({...item,
|
|
postData.push({...item,
|
|
- // amount: item.amount,
|
|
|
|
applicant: this.dataForm.userId,
|
|
applicant: this.dataForm.userId,
|
|
- // approver: item.approver,
|
|
|
|
- // batchNumber: item.batchNumber,
|
|
|
|
- // cnt: item.cnt,
|
|
|
|
- // materialId: item.materialId,
|
|
|
|
materialName: item.materialName ? item.materialName : item.materialId,
|
|
materialName: item.materialName ? item.materialName : item.materialId,
|
|
materialTypeId: item.materialTypeId ? item.materialTypeId : item.cateId,
|
|
materialTypeId: item.materialTypeId ? item.materialTypeId : item.cateId,
|
|
- // notes: item.notes,
|
|
|
|
orgId: this.$store.state.user.orgId,
|
|
orgId: this.$store.state.user.orgId,
|
|
- // price: item.price,
|
|
|
|
recordCode: this.dataForm.recordCode,
|
|
recordCode: this.dataForm.recordCode,
|
|
recordType: this.dataForm.recordType,
|
|
recordType: this.dataForm.recordType,
|
|
- // source: item.source,
|
|
|
|
- // specifications: item.specifications,
|
|
|
|
- // unitName: item.unitName,
|
|
|
|
- // unitNeedChange: item.unitNeedChange,
|
|
|
|
userId: this.$store.state.user.id
|
|
userId: this.$store.state.user.id
|
|
- // sourceCategory: item.sourceCategory
|
|
|
|
})
|
|
})
|
|
})
|
|
})
|
|
inboundBatch(postData).then(({data}) => {
|
|
inboundBatch(postData).then(({data}) => {
|