diff --git a/src/views/modules/supplier/purHeaderList.vue b/src/views/modules/supplier/purHeaderList.vue
index 9545ed2..f0df037 100644
--- a/src/views/modules/supplier/purHeaderList.vue
+++ b/src/views/modules/supplier/purHeaderList.vue
@@ -73,7 +73,7 @@
物料明细列表
- 新增物料
+ 新增物料
- 编辑 |
- 删除 |
+ 编辑 |
+ 删除 |
附件
@@ -944,15 +944,29 @@ export default {
},
// 物料操作
+ isMaterialEditable(row) {
+ return row && (row.status === '待提交' || row.status === '待报价')
+ },
+ canAddMaterial() {
+ return this.currentInquiry && (this.currentInquiry.status === '待提交' || this.currentInquiry.status === '待报价')
+ },
openMaterialDialog(row) {
if (!this.currentInquiry) {
this.$message.warning('请先选择一个询价单')
return
}
if (row) {
+ if (!this.isMaterialEditable(row)) {
+ this.$message.warning('只有待提交或待报价状态的明细可以编辑')
+ return
+ }
this.materialDialogTitle = '编辑物料'
this.materialForm = { ...row }
} else {
+ if (!this.canAddMaterial()) {
+ this.$message.warning('当前询价单状态不允许新增物料')
+ return
+ }
this.materialDialogTitle = '新增物料'
this.materialForm = {
id: null,
@@ -963,7 +977,7 @@ export default {
spec: '',
qty: 0,
remark2: '',
- status: '待提交'
+ status: this.currentInquiry.status === '待报价' ? '待报价' : '待提交'
}
}
this.materialDialogVisible = true
@@ -1043,6 +1057,10 @@ export default {
})
},
deleteMaterial(row) {
+ if (!this.isMaterialEditable(row)) {
+ this.$message.warning('只有待提交或待报价状态的明细可以删除')
+ return
+ }
this.$confirm('确定删除物料: ' + row.partNo + ' ?', '提示', { type: 'warning' }).then(() => {
deleteMaterial({ id: row.id }).then(({data}) => {
if (data && data.code === 0) {
diff --git a/src/views/modules/supplier/quoPurDetailList.vue b/src/views/modules/supplier/quoPurDetailList.vue
index a914031..2c0cc7d 100644
--- a/src/views/modules/supplier/quoPurDetailList.vue
+++ b/src/views/modules/supplier/quoPurDetailList.vue
@@ -382,7 +382,19 @@ export default {
createdBy: this.$store.state.user.name
},
quoteRules: {
- price: [{ required: true, message: '请输入未税单价', trigger: 'blur' }],
+ price: [
+ { required: true, message: '请输入未税单价', trigger: 'blur' },
+ {
+ validator: (rule, value, callback) => {
+ if (value == null || Number(value) <= 0) {
+ callback(new Error('未税单价必须大于0'))
+ } else {
+ callback()
+ }
+ },
+ trigger: 'blur'
+ }
+ ],
taxRate: [{ required: true, message: '请输入税率', trigger: 'blur' }]
},
// 上次填写的报价信息(用于残留功能)
@@ -567,8 +579,13 @@ export default {
// 提交报价
submitQuote() {
+ this.calculatePrice()
this.$refs.quoteForm.validate((valid) => {
if (valid) {
+ if (!this.quoteForm.price || Number(this.quoteForm.price) <= 0) {
+ this.$message.error('未税单价必须大于0')
+ return
+ }
// 计算总成本(可选)
const totalCost = this.quoteForm.materialCost + this.quoteForm.produceFee +
this.quoteForm.surfaceFee + this.quoteForm.profit +
diff --git a/src/views/modules/supplier/supPurReplyHistList.vue b/src/views/modules/supplier/supPurReplyHistList.vue
index 2bf9f1c..f4eec00 100644
--- a/src/views/modules/supplier/supPurReplyHistList.vue
+++ b/src/views/modules/supplier/supPurReplyHistList.vue
@@ -11,6 +11,13 @@
+
+
+
+
+
+
+