修复物料管理

This commit is contained in:
严妍 2023-03-28 15:31:18 +08:00
parent 959afef0e8
commit 1c21113ebc
4 changed files with 204 additions and 153 deletions

View File

@ -47,7 +47,7 @@
:total="Number(total)" :total="Number(total)"
></el-pagination> ></el-pagination>
</vue-scroll> </vue-scroll>
<el-dialog title="新增" :visible.sync="dialogVisibleAdd" width="30%" :before-close="handleClose"> <el-dialog title="新增" :modal-append-to-body="false" :visible.sync="dialogVisibleAdd" width="30%" :before-close="handleClose">
<el-form ref="form" :model="form" label-width="150px" :rules="addEditRules"> <el-form ref="form" :model="form" label-width="150px" :rules="addEditRules">
<el-form-item label="发货单位:" prop="unitName"> <el-form-item label="发货单位:" prop="unitName">
<el-input v-model="form.unitName" style="width:350px" placeholder="请输入"></el-input> <el-input v-model="form.unitName" style="width:350px" placeholder="请输入"></el-input>
@ -70,8 +70,8 @@
<el-button type="primary" @click="okAdd"> </el-button> <el-button type="primary" @click="okAdd"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="编辑" :visible.sync="dialogVisibleEdit" width="30%" :before-close="handleClose"> <el-dialog :modal-append-to-body="false" title="编辑" :visible.sync="dialogVisibleEdit" width="30%" :before-close="handleClose">
<el-form ref="form" :model="form" label-width="150px"> <el-form ref="editForm" :model="editForm" label-width="150px">
<el-form-item label="发货单位:" prop="unitName"> <el-form-item label="发货单位:" prop="unitName">
<el-input v-model="editForm.unitName" style="width:350px" placeholder="请输入"></el-input> <el-input v-model="editForm.unitName" style="width:350px" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
@ -164,52 +164,65 @@ export default {
}) })
}, },
okAdd() { okAdd() {
let data = { this.$refs.form.validate(valid => {
projectSn: this.projectSn, if (valid) {
unitName: this.form.unitName, let data = {
unitChargeName: this.form.unitChargeName, projectSn: this.projectSn,
chargePhone: this.form.chargePhone, unitName: this.form.unitName,
unitAddress: this.form.unitAddress, unitChargeName: this.form.unitChargeName,
socialCode: this.form.socialCode, chargePhone: this.form.chargePhone,
type: 1 unitAddress: this.form.unitAddress,
} socialCode: this.form.socialCode,
addReceiptAndShipmentItem(data).then(res => { type: 1
if (res.code == 200) { }
this.$message.success('新增成功!') addReceiptAndShipmentItem(data).then(res => {
this.getListData() if (res.code == 200) {
this.dialogVisibleAdd = false this.$message.success('新增成功!')
console.log("11111",this.form); this.getListData()
Object.keys(this.form).forEach(item => { this.dialogVisibleAdd = false
this.form[item] = '' 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 { } else {
this.$message.success('新增失败!') console.log('error submit!!')
return false
} }
}) })
}, },
okEdit() { okEdit() {
this.dialogVisibleEdit = false this.$refs.editForm.validate(valid => {
this.EquipmentList if (valid) {
let data = { let data = {
unitName: this.editForm.unitName, unitName: this.editForm.unitName,
unitChargeName: this.editForm.unitChargeName, unitChargeName: this.editForm.unitChargeName,
chargePhone: this.editForm.chargePhone, chargePhone: this.editForm.chargePhone,
unitAddress: this.editForm.unitAddress, unitAddress: this.editForm.unitAddress,
socialCode: this.editForm.socialCode, socialCode: this.editForm.socialCode,
projectSn: this.projectSn, projectSn: this.projectSn,
type: 1, type: 1,
id: this.editId id: this.editId
} }
editReceiptAndShipmentItem(data).then(res => { editReceiptAndShipmentItem(data).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success('编辑成功!') this.$message.success('编辑成功!')
this.dialogVisibleEdit = false
this.getListData()
} else {
this.$message.success('编辑失败!')
}
})
this.getListData() this.getListData()
} else { } else {
this.$message.success('编辑失败!') console.log('error submit!!')
return false
} }
}) })
this.getListData()
}, },
handleClose(done) { handleClose(done) {
done() done()
@ -252,7 +265,7 @@ export default {
}, },
// //
deleteBtn(val) { deleteBtn(val) {
console.log(val,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); console.log(val, '~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
this.$confirm('确定删除吗?', '提示', { this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',

View File

@ -61,7 +61,7 @@
></el-pagination> ></el-pagination>
</vue-scroll> </vue-scroll>
</div> </div>
<el-dialog title="新增" :visible.sync="dialogVisibleAdd" width="30%" :before-close="handleClose"> <el-dialog :modal-append-to-body="false" title="新增" :visible.sync="dialogVisibleAdd" width="30%" :before-close="handleClose">
<el-form ref="form" :model="form" label-width="150px" :rules="addEditRules"> <el-form ref="form" :model="form" label-width="150px" :rules="addEditRules">
<el-form-item label="车牌号码:" prop="licensePlate"> <el-form-item label="车牌号码:" prop="licensePlate">
<el-input v-model="form.licensePlate" style="width:350px" placeholder="请输入"></el-input> <el-input v-model="form.licensePlate" style="width:350px" placeholder="请输入"></el-input>
@ -98,8 +98,8 @@
<el-button type="primary" @click="okAdd"> </el-button> <el-button type="primary" @click="okAdd"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="编辑" :visible.sync="dialogVisibleEdit" width="30%" :before-close="handleClose"> <el-dialog :modal-append-to-body="false" title="编辑" :visible.sync="dialogVisibleEdit" width="30%" :before-close="handleClose">
<el-form ref="form" :model="form" label-width="150px"> <el-form ref="editForm" :model="editForm" label-width="150px">
<el-form-item label="车牌号码:" prop="licensePlate"> <el-form-item label="车牌号码:" prop="licensePlate">
<el-input v-model="editForm.licensePlate" style="width:350px" placeholder="请输入"></el-input> <el-input v-model="editForm.licensePlate" style="width:350px" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
@ -289,52 +289,65 @@ export default {
}) })
}, },
okAdd() { okAdd() {
let data = { this.$refs.form.validate(valid => {
licensePlate: this.form.licensePlate, if (valid) {
forwardingUnit: this.form.forwardingUnit, let data = {
receivingUnit: this.form.receivingUnit, licensePlate: this.form.licensePlate,
goodsName: this.form.goodsName, forwardingUnit: this.form.forwardingUnit,
specifications: this.form.specifications, receivingUnit: this.form.receivingUnit,
reserve: this.form.reserve, goodsName: this.form.goodsName,
weighingType: this.form.weighingType, specifications: this.form.specifications,
projectSn: this.projectSn reserve: this.form.reserve,
} weighingType: this.form.weighingType,
addMakeAnAppointmentItem(data).then(res => { projectSn: this.projectSn
if (res.code == 200) { }
this.$message.success('新增成功!') addMakeAnAppointmentItem(data).then(res => {
this.getListData() if (res.code == 200) {
this.dialogVisibleAdd = false this.$message.success('新增成功!')
Object.keys(this.form).forEach(item => { this.getListData()
this.form[item] = '' this.dialogVisibleAdd = false
Object.keys(this.form).forEach(item => {
this.form[item] = ''
})
} else {
this.$message.success('新增失败!')
}
}) })
} else { } else {
this.$message.success('新增失败!') console.log('error submit!!')
return false
} }
}) })
}, },
okEdit() { okEdit() {
this.dialogVisibleEdit = false this.$refs.editForm.validate(valid => {
this.EquipmentList if (valid) {
let data = { let data = {
licensePlate: this.editForm.licensePlate, licensePlate: this.editForm.licensePlate,
forwardingUnit: this.editForm.forwardingUnit, forwardingUnit: this.editForm.forwardingUnit,
receivingUnit: this.editForm.receivingUnit, receivingUnit: this.editForm.receivingUnit,
goodsName: this.editForm.goodsName, goodsName: this.editForm.goodsName,
specifications: this.editForm.specifications, specifications: this.editForm.specifications,
reserve: this.editForm.reserve, reserve: this.editForm.reserve,
weighingType: this.editForm.weighingType, weighingType: this.editForm.weighingType,
projectSn: this.projectSn, projectSn: this.projectSn,
id: this.editId id: this.editId
} }
editMakeAnAppointmentItem(data).then(res => { editMakeAnAppointmentItem(data).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success('编辑成功!') this.$message.success('编辑成功!')
this.getListData()
this.dialogVisibleEdit = false
} else {
this.$message.success('编辑失败!')
}
})
this.getListData() this.getListData()
} else { } else {
this.$message.success('编辑失败!') console.log('error submit!!')
return false
} }
}) })
this.getListData()
}, },
// //
editBtn(val) { editBtn(val) {

View File

@ -47,7 +47,7 @@
:total="Number(total)" :total="Number(total)"
></el-pagination> ></el-pagination>
</vue-scroll> </vue-scroll>
<el-dialog title="新增" :visible.sync="dialogVisibleAdd" width="30%" :before-close="handleClose"> <el-dialog :modal-append-to-body="false" title="新增" :visible.sync="dialogVisibleAdd" width="30%" :before-close="handleClose">
<el-form ref="form" :model="form" label-width="150px" :rules="addEditRules"> <el-form ref="form" :model="form" label-width="150px" :rules="addEditRules">
<el-form-item label="收货单位:" prop="unitName"> <el-form-item label="收货单位:" prop="unitName">
<el-input v-model="form.unitName" style="width:350px" placeholder="请输入"></el-input> <el-input v-model="form.unitName" style="width:350px" placeholder="请输入"></el-input>
@ -70,8 +70,8 @@
<el-button type="primary" @click="okAdd"> </el-button> <el-button type="primary" @click="okAdd"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="编辑" :visible.sync="dialogVisibleEdit" width="30%" :before-close="handleClose"> <el-dialog :modal-append-to-body="false" title="编辑" :visible.sync="dialogVisibleEdit" width="30%" :before-close="handleClose">
<el-form ref="form" :model="form" label-width="150px"> <el-form ref="editForm" :model="editForm" label-width="150px" :rules="addEditRules">
<el-form-item label="收货单位:" prop="unitName"> <el-form-item label="收货单位:" prop="unitName">
<el-input v-model="editForm.unitName" style="width:350px" placeholder="请输入"></el-input> <el-input v-model="editForm.unitName" style="width:350px" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
@ -144,7 +144,6 @@ export default {
}, },
equipmentId: '', equipmentId: '',
editId: '', editId: '',
EquipmentList: [],
devId: '', devId: '',
fuel: '' fuel: ''
} }
@ -164,50 +163,63 @@ export default {
}) })
}, },
okAdd() { okAdd() {
let data = { this.$refs.form.validate(valid => {
projectSn: this.projectSn, if (valid) {
unitName: this.form.unitName, let data = {
unitChargeName: this.form.unitChargeName, projectSn: this.projectSn,
chargePhone: this.form.chargePhone, unitName: this.form.unitName,
unitAddress: this.form.unitAddress, unitChargeName: this.form.unitChargeName,
socialCode: this.form.socialCode, chargePhone: this.form.chargePhone,
type: 2 unitAddress: this.form.unitAddress,
} socialCode: this.form.socialCode,
addReceiptAndShipmentItem(data).then(res => { type: 2
if (res.code == 200) { }
this.$message.success('新增成功!') addReceiptAndShipmentItem(data).then(res => {
this.getListData() if (res.code == 200) {
this.dialogVisibleAdd = false this.$message.success('新增成功!')
this.Object.keys(this.form).forEach(item => { this.getListData()
form[item] = '' this.dialogVisibleAdd = false
Object.keys(this.form).forEach(item => {
this.form[item] = ''
})
} else {
this.$message.success('新增失败!')
}
}) })
} else { } else {
this.$message.success('新增失败!') console.log('error submit!!')
return false
} }
}) })
}, },
okEdit() { okEdit() {
this.dialogVisibleEdit = false this.$refs.editForm.validate(valid => {
this.EquipmentList if (valid) {
let data = { let data = {
unitName: this.editForm.unitName, unitName: this.editForm.unitName,
unitChargeName: this.editForm.unitChargeName, unitChargeName: this.editForm.unitChargeName,
chargePhone: this.editForm.chargePhone, chargePhone: this.editForm.chargePhone,
unitAddress: this.editForm.unitAddress, unitAddress: this.editForm.unitAddress,
socialCode: this.editForm.socialCode, socialCode: this.editForm.socialCode,
projectSn: this.projectSn, projectSn: this.projectSn,
type: 2, type: 2,
id: this.editId id: this.editId
} }
editReceiptAndShipmentItem(data).then(res => { editReceiptAndShipmentItem(data).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success('编辑成功!') this.$message.success('编辑成功!')
this.getListData()
this.dialogVisibleEdit = false
} else {
this.$message.success('编辑失败!')
}
})
this.getListData() this.getListData()
} else { } else {
this.$message.success('编辑失败!') console.log('error submit!!')
return false
} }
}) })
this.getListData()
}, },
handleClose(done) { handleClose(done) {
done() done()
@ -250,7 +262,7 @@ export default {
}, },
// //
deleteBtn(val) { deleteBtn(val) {
console.log(val,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); console.log(val, '~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
this.$confirm('确定删除吗?', '提示', { this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',

View File

@ -47,7 +47,7 @@
:total="Number(total)" :total="Number(total)"
></el-pagination> ></el-pagination>
</vue-scroll> </vue-scroll>
<el-dialog title="新增" :visible.sync="dialogVisibleAdd" width="30%" :before-close="handleClose"> <el-dialog :modal-append-to-body="false" title="新增" :visible.sync="dialogVisibleAdd" width="30%" :before-close="handleClose">
<el-form ref="form" :model="form" label-width="150px" :rules="addEditRules"> <el-form ref="form" :model="form" label-width="150px" :rules="addEditRules">
<el-form-item label="货名:" prop="goodsName"> <el-form-item label="货名:" prop="goodsName">
<el-input v-model="form.goodsName" style="width:350px" placeholder="请输入"></el-input> <el-input v-model="form.goodsName" style="width:350px" placeholder="请输入"></el-input>
@ -70,8 +70,8 @@
<el-button type="primary" @click="okAdd"> </el-button> <el-button type="primary" @click="okAdd"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="编辑" :visible.sync="dialogVisibleEdit" width="30%" :before-close="handleClose"> <el-dialog :modal-append-to-body="false" title="编辑" :visible.sync="dialogVisibleEdit" width="30%" :before-close="handleClose">
<el-form ref="form" :model="form" label-width="150px"> <el-form ref="editForm" :model="editForm" label-width="150px">
<el-form-item label="货名:" prop="goodsName"> <el-form-item label="货名:" prop="goodsName">
<el-input v-model="editForm.goodsName" style="width:350px" placeholder="请输入"></el-input> <el-input v-model="editForm.goodsName" style="width:350px" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
@ -158,48 +158,61 @@ export default {
}) })
}, },
okAdd() { okAdd() {
let data = { this.$refs.form.validate(valid => {
projectSn: this.projectSn, if (valid) {
goodsName: this.form.goodsName, let data = {
unitPrice: this.form.unitPrice, projectSn: this.projectSn,
foldSquare: this.form.foldSquare, goodsName: this.form.goodsName,
goodsBuckledHeavily: this.form.goodsBuckledHeavily, unitPrice: this.form.unitPrice,
goodsInventory: this.form.goodsInventory foldSquare: this.form.foldSquare,
} goodsBuckledHeavily: this.form.goodsBuckledHeavily,
addTradeNameItem(data).then(res => { goodsInventory: this.form.goodsInventory
if (res.code == 200) { }
this.$message.success('新增成功!') addTradeNameItem(data).then(res => {
this.getListData() if (res.code == 200) {
this.dialogVisibleAdd = false this.$message.success('新增成功!')
Object.keys(this.form).forEach(item => { this.getListData()
this.form[item] = '' this.dialogVisibleAdd = false
Object.keys(this.form).forEach(item => {
this.form[item] = ''
})
} else {
this.$message.success('新增失败!')
}
}) })
} else { } else {
this.$message.success('新增失败!') console.log('error submit!!')
return false
} }
}) })
}, },
okEdit() { okEdit() {
this.dialogVisibleEdit = false this.$refs.editForm.validate(valid => {
this.EquipmentList if (valid) {
let data = { this.dialogVisibleEdit = false
goodsName: this.editForm.goodsName, let data = {
unitPrice: this.editForm.unitPrice, goodsName: this.editForm.goodsName,
foldSquare: this.editForm.foldSquare, unitPrice: this.editForm.unitPrice,
goodsBuckledHeavily: this.editForm.goodsBuckledHeavily, foldSquare: this.editForm.foldSquare,
goodsInventory: this.editForm.goodsInventory, goodsBuckledHeavily: this.editForm.goodsBuckledHeavily,
projectSn: this.projectSn, goodsInventory: this.editForm.goodsInventory,
id: this.editId projectSn: this.projectSn,
} id: this.editId
editTradeNameItem(data).then(res => { }
if (res.code == 200) { editTradeNameItem(data).then(res => {
this.$message.success('编辑成功!') if (res.code == 200) {
this.$message.success('编辑成功!')
this.getListData()
} else {
this.$message.success('编辑失败!')
}
})
this.getListData() this.getListData()
} else { } else {
this.$message.success('编辑失败!') console.log('error submit!!')
return false
} }
}) })
this.getListData()
}, },
handleClose(done) { handleClose(done) {
done() done()