diff --git a/src/views/projectFront/quality/material/forwardingUnit.vue b/src/views/projectFront/quality/material/forwardingUnit.vue index 3585bb9a..f8c1d36d 100644 --- a/src/views/projectFront/quality/material/forwardingUnit.vue +++ b/src/views/projectFront/quality/material/forwardingUnit.vue @@ -47,7 +47,7 @@ :total="Number(total)" > - + @@ -70,8 +70,8 @@ 确 定 - - + + @@ -164,52 +164,65 @@ export default { }) }, okAdd() { - let data = { - projectSn: this.projectSn, - unitName: this.form.unitName, - unitChargeName: this.form.unitChargeName, - chargePhone: this.form.chargePhone, - unitAddress: this.form.unitAddress, - socialCode: this.form.socialCode, - type: 1 - } - addReceiptAndShipmentItem(data).then(res => { - if (res.code == 200) { - this.$message.success('新增成功!') - this.getListData() - this.dialogVisibleAdd = false - console.log("11111",this.form); - Object.keys(this.form).forEach(item => { - this.form[item] = '' + this.$refs.form.validate(valid => { + if (valid) { + let data = { + projectSn: this.projectSn, + unitName: this.form.unitName, + unitChargeName: this.form.unitChargeName, + chargePhone: this.form.chargePhone, + unitAddress: this.form.unitAddress, + socialCode: this.form.socialCode, + type: 1 + } + addReceiptAndShipmentItem(data).then(res => { + if (res.code == 200) { + this.$message.success('新增成功!') + this.getListData() + this.dialogVisibleAdd = false + console.log('11111', this.form) + Object.keys(this.form).forEach(item => { + this.form[item] = '' + }) + console.log('222222', this.form) + } else { + this.$message.success('新增失败!') + } }) - console.log("222222",this.form); } else { - this.$message.success('新增失败!') + console.log('error submit!!') + return false } }) }, okEdit() { - this.dialogVisibleEdit = false - this.EquipmentList - let data = { - unitName: this.editForm.unitName, - unitChargeName: this.editForm.unitChargeName, - chargePhone: this.editForm.chargePhone, - unitAddress: this.editForm.unitAddress, - socialCode: this.editForm.socialCode, - projectSn: this.projectSn, - type: 1, - id: this.editId - } - editReceiptAndShipmentItem(data).then(res => { - if (res.code == 200) { - this.$message.success('编辑成功!') + this.$refs.editForm.validate(valid => { + if (valid) { + let data = { + unitName: this.editForm.unitName, + unitChargeName: this.editForm.unitChargeName, + chargePhone: this.editForm.chargePhone, + unitAddress: this.editForm.unitAddress, + socialCode: this.editForm.socialCode, + projectSn: this.projectSn, + type: 1, + id: this.editId + } + editReceiptAndShipmentItem(data).then(res => { + if (res.code == 200) { + this.$message.success('编辑成功!') + this.dialogVisibleEdit = false + this.getListData() + } else { + this.$message.success('编辑失败!') + } + }) this.getListData() } else { - this.$message.success('编辑失败!') + console.log('error submit!!') + return false } }) - this.getListData() }, handleClose(done) { done() @@ -252,7 +265,7 @@ export default { }, //删除按钮 deleteBtn(val) { - console.log(val,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + console.log(val, '~~~~~~~~~~~~~~~~~~~~~~~~~~~~') this.$confirm('确定删除吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', diff --git a/src/views/projectFront/quality/material/makeAnAppointment.vue b/src/views/projectFront/quality/material/makeAnAppointment.vue index 1da060b5..5edbc9d3 100644 --- a/src/views/projectFront/quality/material/makeAnAppointment.vue +++ b/src/views/projectFront/quality/material/makeAnAppointment.vue @@ -61,7 +61,7 @@ > - + @@ -98,8 +98,8 @@ 确 定 - - + + @@ -289,52 +289,65 @@ export default { }) }, okAdd() { - let data = { - licensePlate: this.form.licensePlate, - forwardingUnit: this.form.forwardingUnit, - receivingUnit: this.form.receivingUnit, - goodsName: this.form.goodsName, - specifications: this.form.specifications, - reserve: this.form.reserve, - weighingType: this.form.weighingType, - projectSn: this.projectSn - } - addMakeAnAppointmentItem(data).then(res => { - if (res.code == 200) { - this.$message.success('新增成功!') - this.getListData() - this.dialogVisibleAdd = false - Object.keys(this.form).forEach(item => { - this.form[item] = '' + this.$refs.form.validate(valid => { + if (valid) { + let data = { + licensePlate: this.form.licensePlate, + forwardingUnit: this.form.forwardingUnit, + receivingUnit: this.form.receivingUnit, + goodsName: this.form.goodsName, + specifications: this.form.specifications, + reserve: this.form.reserve, + weighingType: this.form.weighingType, + projectSn: this.projectSn + } + addMakeAnAppointmentItem(data).then(res => { + if (res.code == 200) { + this.$message.success('新增成功!') + this.getListData() + this.dialogVisibleAdd = false + Object.keys(this.form).forEach(item => { + this.form[item] = '' + }) + } else { + this.$message.success('新增失败!') + } }) } else { - this.$message.success('新增失败!') + console.log('error submit!!') + return false } }) }, okEdit() { - this.dialogVisibleEdit = false - this.EquipmentList - let data = { - licensePlate: this.editForm.licensePlate, - forwardingUnit: this.editForm.forwardingUnit, - receivingUnit: this.editForm.receivingUnit, - goodsName: this.editForm.goodsName, - specifications: this.editForm.specifications, - reserve: this.editForm.reserve, - weighingType: this.editForm.weighingType, - projectSn: this.projectSn, - id: this.editId - } - editMakeAnAppointmentItem(data).then(res => { - if (res.code == 200) { - this.$message.success('编辑成功!') + this.$refs.editForm.validate(valid => { + if (valid) { + let data = { + licensePlate: this.editForm.licensePlate, + forwardingUnit: this.editForm.forwardingUnit, + receivingUnit: this.editForm.receivingUnit, + goodsName: this.editForm.goodsName, + specifications: this.editForm.specifications, + reserve: this.editForm.reserve, + weighingType: this.editForm.weighingType, + projectSn: this.projectSn, + id: this.editId + } + editMakeAnAppointmentItem(data).then(res => { + if (res.code == 200) { + this.$message.success('编辑成功!') + this.getListData() + this.dialogVisibleEdit = false + } else { + this.$message.success('编辑失败!') + } + }) this.getListData() } else { - this.$message.success('编辑失败!') + console.log('error submit!!') + return false } }) - this.getListData() }, //编辑按钮 editBtn(val) { diff --git a/src/views/projectFront/quality/material/receivingUnit.vue b/src/views/projectFront/quality/material/receivingUnit.vue index 9e7f0e49..ff0e13b3 100644 --- a/src/views/projectFront/quality/material/receivingUnit.vue +++ b/src/views/projectFront/quality/material/receivingUnit.vue @@ -47,7 +47,7 @@ :total="Number(total)" > - + @@ -70,8 +70,8 @@ 确 定 - - + + @@ -144,7 +144,6 @@ export default { }, equipmentId: '', editId: '', - EquipmentList: [], devId: '', fuel: '' } @@ -164,50 +163,63 @@ export default { }) }, okAdd() { - let data = { - projectSn: this.projectSn, - unitName: this.form.unitName, - unitChargeName: this.form.unitChargeName, - chargePhone: this.form.chargePhone, - unitAddress: this.form.unitAddress, - socialCode: this.form.socialCode, - type: 2 - } - addReceiptAndShipmentItem(data).then(res => { - if (res.code == 200) { - this.$message.success('新增成功!') - this.getListData() - this.dialogVisibleAdd = false - this.Object.keys(this.form).forEach(item => { - form[item] = '' + this.$refs.form.validate(valid => { + if (valid) { + let data = { + projectSn: this.projectSn, + unitName: this.form.unitName, + unitChargeName: this.form.unitChargeName, + chargePhone: this.form.chargePhone, + unitAddress: this.form.unitAddress, + socialCode: this.form.socialCode, + type: 2 + } + addReceiptAndShipmentItem(data).then(res => { + if (res.code == 200) { + this.$message.success('新增成功!') + this.getListData() + this.dialogVisibleAdd = false + Object.keys(this.form).forEach(item => { + this.form[item] = '' + }) + } else { + this.$message.success('新增失败!') + } }) } else { - this.$message.success('新增失败!') + console.log('error submit!!') + return false } }) }, okEdit() { - this.dialogVisibleEdit = false - this.EquipmentList - let data = { - unitName: this.editForm.unitName, - unitChargeName: this.editForm.unitChargeName, - chargePhone: this.editForm.chargePhone, - unitAddress: this.editForm.unitAddress, - socialCode: this.editForm.socialCode, - projectSn: this.projectSn, - type: 2, - id: this.editId - } - editReceiptAndShipmentItem(data).then(res => { - if (res.code == 200) { - this.$message.success('编辑成功!') + this.$refs.editForm.validate(valid => { + if (valid) { + let data = { + unitName: this.editForm.unitName, + unitChargeName: this.editForm.unitChargeName, + chargePhone: this.editForm.chargePhone, + unitAddress: this.editForm.unitAddress, + socialCode: this.editForm.socialCode, + projectSn: this.projectSn, + type: 2, + id: this.editId + } + editReceiptAndShipmentItem(data).then(res => { + if (res.code == 200) { + this.$message.success('编辑成功!') + this.getListData() + this.dialogVisibleEdit = false + } else { + this.$message.success('编辑失败!') + } + }) this.getListData() } else { - this.$message.success('编辑失败!') + console.log('error submit!!') + return false } }) - this.getListData() }, handleClose(done) { done() @@ -250,7 +262,7 @@ export default { }, //删除按钮 deleteBtn(val) { - console.log(val,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + console.log(val, '~~~~~~~~~~~~~~~~~~~~~~~~~~~~') this.$confirm('确定删除吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', diff --git a/src/views/projectFront/quality/material/tradeName.vue b/src/views/projectFront/quality/material/tradeName.vue index bd76f111..4428d123 100644 --- a/src/views/projectFront/quality/material/tradeName.vue +++ b/src/views/projectFront/quality/material/tradeName.vue @@ -47,7 +47,7 @@ :total="Number(total)" > - + @@ -70,8 +70,8 @@ 确 定 - - + + @@ -158,48 +158,61 @@ export default { }) }, okAdd() { - let data = { - projectSn: this.projectSn, - goodsName: this.form.goodsName, - unitPrice: this.form.unitPrice, - foldSquare: this.form.foldSquare, - goodsBuckledHeavily: this.form.goodsBuckledHeavily, - goodsInventory: this.form.goodsInventory - } - addTradeNameItem(data).then(res => { - if (res.code == 200) { - this.$message.success('新增成功!') - this.getListData() - this.dialogVisibleAdd = false - Object.keys(this.form).forEach(item => { - this.form[item] = '' + this.$refs.form.validate(valid => { + if (valid) { + let data = { + projectSn: this.projectSn, + goodsName: this.form.goodsName, + unitPrice: this.form.unitPrice, + foldSquare: this.form.foldSquare, + goodsBuckledHeavily: this.form.goodsBuckledHeavily, + goodsInventory: this.form.goodsInventory + } + addTradeNameItem(data).then(res => { + if (res.code == 200) { + this.$message.success('新增成功!') + this.getListData() + this.dialogVisibleAdd = false + Object.keys(this.form).forEach(item => { + this.form[item] = '' + }) + } else { + this.$message.success('新增失败!') + } }) } else { - this.$message.success('新增失败!') + console.log('error submit!!') + return false } }) }, okEdit() { - this.dialogVisibleEdit = false - this.EquipmentList - let data = { - goodsName: this.editForm.goodsName, - unitPrice: this.editForm.unitPrice, - foldSquare: this.editForm.foldSquare, - goodsBuckledHeavily: this.editForm.goodsBuckledHeavily, - goodsInventory: this.editForm.goodsInventory, - projectSn: this.projectSn, - id: this.editId - } - editTradeNameItem(data).then(res => { - if (res.code == 200) { - this.$message.success('编辑成功!') + this.$refs.editForm.validate(valid => { + if (valid) { + this.dialogVisibleEdit = false + let data = { + goodsName: this.editForm.goodsName, + unitPrice: this.editForm.unitPrice, + foldSquare: this.editForm.foldSquare, + goodsBuckledHeavily: this.editForm.goodsBuckledHeavily, + goodsInventory: this.editForm.goodsInventory, + projectSn: this.projectSn, + id: this.editId + } + editTradeNameItem(data).then(res => { + if (res.code == 200) { + this.$message.success('编辑成功!') + this.getListData() + } else { + this.$message.success('编辑失败!') + } + }) this.getListData() } else { - this.$message.success('编辑失败!') + console.log('error submit!!') + return false } }) - this.getListData() }, handleClose(done) { done()