chenrui 2 tahun lalu
induk
melakukan
069c436e49

+ 13 - 1
src/views/productManagement/productInfo/offlineImportModal.vue

@@ -159,7 +159,7 @@ export default {
           if (res.data.rightList && res.data.rightList.length > 0) {
             res.data.rightList.map((item, index) => {
               item.no = index + 1
-              item.commonSn = []
+              item.commonSn = ''
             })
           }
           if (res.data.errorList && res.data.errorList.length > 0) {
@@ -181,6 +181,8 @@ export default {
         this.$refs.ruleForm.validate(valid => {
           if (valid) {
             _this.form.type = 'offline'
+            // 通用必填时判断
+           _this.isHandleOk();
             _this.form.offlineProductList = _this.loadData
             _this.$emit('ok', _this.form)
             _this.isShow = false
@@ -190,6 +192,16 @@ export default {
         })
       }
     },
+    isHandleOk(){
+      let _this=this
+      let flag=_this.loadData.includes()
+      _this.loadData.forEach(item=>{
+        if(!item.commonSn){
+          _this.$message.warning('通用编码不能为空!')
+          return
+        }
+      })
+    },
     // 导出
     handleError () {
       const _this = this