3254194295 2 gadi atpakaļ
vecāks
revīzija
f7654e89ff

+ 6 - 7
src/views/sb/modelbom/modules/BaseForm.vue

@@ -159,7 +159,7 @@ export default {
       sbTypeTreeData: [],
       typeMap: {},
       periodTypeMap: {},
-      oldSpareId:null
+      oldSpareId: null
     }
   },
   components: {
@@ -178,19 +178,17 @@ export default {
   },
   methods: {
     base (record) {
-      console.log(record)
       this.visible = true
-      this.oldSpareId=record.spareId
+      this.oldSpareId = record.spareId
+      this.sbId = record.sbId
       if (this.BaseTool.Object.isBlank(record.modelId)) {
-        this.sbId = record.id
-        console.log(this.sbId)
         this.modalTitle = '添加'
         const { form: { setFieldsValue } } = this
         // 日期处理
         this.$nextTick(() => {
           setFieldsValue(Object.assign({
             'modelId': record.modelId,
-            'sbId': record.id
+            'sbId': record.sbId
           }))
         })
         return
@@ -212,7 +210,8 @@ export default {
           'period',
           'periodType',
           'num',
-          'oldSpareId'
+          'oldSpareId',
+          'sbId'
         ])))
       })
     },

+ 2 - 1
src/views/sb/modelbom/modules/Detail.vue

@@ -208,9 +208,10 @@ export default {
     },
     handleAdd () {
       const modal = this.$refs.baseModal
-      modal.base({ modelId: null, id: this.model.id })
+      modal.base({ modelId: null, sbId: this.model.id })
     },
     handleEdit (record) {
+      console.log(record)
       const modal = this.$refs.baseModal
       record.modelId = this.model.id
       modal.base(record)