瀏覽代碼

修改bug

chenrui 2 年之前
父節點
當前提交
e32e9e9f8d

+ 0 - 1
src/views/productManagement/productInfo/list.vue

@@ -319,7 +319,6 @@ export default {
     },
     // 批量导入产品
     hanldeOk (obj) {
-      debugger
       this.spinning = true
       if (obj && obj.type && obj.type == 'offline') { // 下线导入
         importSaveBatch(obj).then(res => {

+ 10 - 8
src/views/productManagement/productInfo/offlineImportModal.vue

@@ -125,8 +125,10 @@ export default {
       ],
       loadData: [],
       form: {
+        type: 'offline',
         offlineReasonType: undefined,
-        offlineRemark: ''
+        offlineRemark: '',
+        offlineProductList: []
       },
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
@@ -190,16 +192,14 @@ export default {
     },
     isHandleOk () {
       const _this = this
-      if (_this.form.offlineReasonType == '通用') {
+      if (_this.form.offlineReasonType === '通用') {
         const flag = _this.loadData.some(item => !item.commonSn)
         if (flag) {
           _this.$message.warning('通用编码不能为空!')
-          return
         }
       }
-      _this.form.type = 'offline'
-      _this.form.offlineProductList = _this.loadData
-      _this.$emit('ok', _this.form)
+      _this.$set(_this.form, 'offlineProductList', _this.loadData)
+      _this.$emit('ok', JSON.parse(JSON.stringify(_this.form)))
       _this.isShow = false
     },
     // 导出
@@ -227,8 +227,10 @@ export default {
         this.loadData = []
         this.unLoadData = []
         this.form = {
-          offlineReasonType: '',
-          offlineRemark: ''
+          type: 'offline',
+          offlineReasonType: undefined,
+          offlineRemark: '',
+          offlineProductList: []
         }
         this.$refs.ruleForm.resetFields()
       } else {