diff --git a/.env.prod b/.env.prod index 4b5b164..521930e 100644 --- a/.env.prod +++ b/.env.prod @@ -28,6 +28,7 @@ VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab # 大屏设计器服务 VUE_APP_BIG_SCREEN_SERVER = 'http://127.0.0.1:3000' +VUE_APP_IMAGE_URL = 'http://122.51.230.86:9000/' #小程序推广码前缀 VUE_APP_REPAIR_PREX = 'https://www.lighting-it.cn/share?inviteId=' 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 @@