linwenxin 1 рік тому
батько
коміт
9252eb696e

+ 1 - 1
src/views/salesPurchasing/goodsPurchasedStored/index.vue

@@ -152,7 +152,7 @@ export default {
     tishicuowu:(new delayPerform(500)).refactor(function( /**可接收参数**/ ){
       if(this.logs){
         var logs = Array.from(new Set(JSON.parse(JSON.stringify(this.logs)).map(item=>{
-          return `第${item.index+1}行:${item.errMsg}`
+          return `${item.index!==undefined ? "第" + (item.index+1) +"行:" : ""}${item.errMsg}`
         })))
         this.logs = []
         this.$message({

+ 17 - 1
src/views/salesPurchasing/merchandisePurchaseReturn/index.vue

@@ -61,6 +61,7 @@ import out_storage_table from '../mixins/out_storage_table'
 import out_storage_goods from '../mixins/out_storage_goods'
 import out_storage_codes from '../mixins/out_storage_codes'
 import common from '../mixins/common_code'
+import { delayPerform, firstPerform, intervalPerform, passivePerform, queuePerform } from "js-perform-lock";
 export default {
   components: { TemplatePage },
   mixins: [import_mixin, operation_mixin, form_ty, out_storage_table, out_storage_goods, out_storage_codes, common],
@@ -104,7 +105,8 @@ export default {
       },
       activeName: 'goodsInfo',
       goods_material_id: '',
-      joinCode: false
+      joinCode: false,
+      logs:[]
     }
   },
   computed: {
@@ -144,6 +146,20 @@ export default {
     }
   },
   methods: {
+    tishicuowu:(new delayPerform(500)).refactor(function( /**可接收参数**/ ){
+      if(this.logs){
+        var logs = Array.from(new Set(JSON.parse(JSON.stringify(this.logs)).map(item=>{
+          return `${item.index!==undefined ? "第" + (item.index+1) +"行:" : ""}${item.errMsg}`
+        })))
+        this.logs = []
+        this.$message({
+          dangerouslyUseHTMLString: true,
+          type: 'warning',
+          message: logs.join("<div/>"),
+          duration: 5000,
+        });
+      }
+    }),
     changePageType() {
       this.goods_material_id = ''
     },

+ 15 - 3
src/views/salesPurchasing/mixins/common_form.js

@@ -1,4 +1,4 @@
-import { required } from '@/components/template/rules_verify.js'
+import { required, diyRequired } from '@/components/template/rules_verify.js'
 import { listPageV2 } from '@/api/auxiliaryFittings/supplier'
 import { goodsPurchaseList, goodsPurchaseDetail } from '@/api/goodsPurchasedStored.js'
 import ImageUpload from '@/components/file-upload'
@@ -52,7 +52,13 @@ export default {
                 >
                   <el-descriptions-item label="*供应商名称">
                     <div class="redbordererr">
-                      <el-form-item label="" lebel-width="0px" prop={`venderId`} rules={required}>
+                      <el-form-item label="" lebel-width="0px" prop={`venderId`} rules={[diyRequired.bind(this)((rule, value)=>{
+                        if(this.logs){
+                          this.logs.push({errMsg:`*供应商名称不能为空`})
+                        }
+                        this?.tishicuowu?.()
+                        return new Error('必须填写')
+                      })]}>
                         <el-select
                           style="width:100%"
                           value={this.formData.venderId}
@@ -85,7 +91,13 @@ export default {
                   {!!~['merchandisePurchaseReturn'].indexOf(this?.$route?.name) ? (
                     <el-descriptions-item label="*采购入库单">
                       <div class="redbordererr">
-                        <el-form-item label="" lebel-width="0px" prop={`goodsPurchaseId`} rules={required}>
+                        <el-form-item label="" lebel-width="0px" prop={`goodsPurchaseId`} rules={[diyRequired.bind(this)((rule, value)=>{
+                          if(this.logs){
+                            this.logs.push({errMsg:`*采购入库单不能为空`})
+                          }
+                          this?.tishicuowu?.()
+                          return new Error('必须填写')
+                        })]}>
                           <el-select
                             style="width:100%"
                             value={this.formData.goodsPurchaseId}