diff --git a/src/views/repair/stockOperate/Components/WaresItem.vue b/src/views/repair/stockOperate/Components/WaresItem.vue index 5008948..5e77f93 100644 --- a/src/views/repair/stockOperate/Components/WaresItem.vue +++ b/src/views/repair/stockOperate/Components/WaresItem.vue @@ -419,6 +419,12 @@ export default { // 提交 async handleSubmit() { try { + const isNull = this.validateNull(); + if (!isNull) return; + const names = this.validateZero() + if (names){ + await this.$modal.confirm("确认配件:" + names + "的采购价格为0吗?") + } await this.createInit() await createRepairSo(this.formData) this.inStockDialog = false @@ -457,6 +463,35 @@ export default { } })] }, + validateNull(){ + const flag = this.partList.map(item => { + const price = item.newPrice + if (price === null || price === ""){ + this.$modal.msgError("配件:" + item.name + "采购价格为空") + return false + }else { + return true + } + }) + let count = 0 + flag.forEach(item => { + if (!item){ + count++ + } + }) + return count === 0 + }, + validateZero(){ + const flag = this.partList.map(item => { + const price = parseFloat(item.newPrice) + if (price === 0){ + return item.name + }else { + return "" + } + }) + return flag.filter(item => item !== "").join(",") + } } } diff --git a/src/views/repair/tickets/Components/TicketWaresShow.vue b/src/views/repair/tickets/Components/TicketWaresShow.vue index a65565d..02ad1d8 100644 --- a/src/views/repair/tickets/Components/TicketWaresShow.vue +++ b/src/views/repair/tickets/Components/TicketWaresShow.vue @@ -123,13 +123,16 @@
- + - + - + @@ -151,42 +154,53 @@ {{ scope.$index + 1 }} - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - + +
+ + {{ scope.row.wares.price }} +
+
+ {{ scope.row.wares.price }} +
+
+ + + + + +
{{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}
- +
-