浏览代码

完善opc

whj 1 年之前
父节点
当前提交
bb647ebf9d
共有 2 个文件被更改,包括 12 次插入6 次删除
  1. 2 2
      src/views/sb/info/SbInfoC.vue
  2. 10 4
      src/views/sb/info/modules/AddLogForm.vue

+ 2 - 2
src/views/sb/info/SbInfoC.vue

@@ -265,13 +265,13 @@
               </span>
               <div slot="expandedRowRender" slot-scope="record" style="width:100%;">
 
-                <a-card title="检定记录" :bordered="false" style="width:100%;position: relative; z-inde:9999">
+                <a-card title="设备更改记录" :bordered="false" style="width:100%;position: relative; z-inde:9999">
                   <a slot="extra" @click="addLogBySb(record)">新增</a>
                   <a-table :columns="childColumns1" :data-source="childMap[1]">
                   </a-table>
                 </a-card>
 
-                <a-card title="设备更改记录" :bordered="false" style="width:100%">
+                <a-card title="检定记录" :bordered="false" style="width:100%">
                   <a-table :columns="childColumns2" :data-source="childMap[2]">
                   </a-table>
                 </a-card>

+ 10 - 4
src/views/sb/info/modules/AddLogForm.vue

@@ -8,7 +8,7 @@
   >
     <a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 17 }">
       <a-form-item v-show="false" >
-        <a-input v-decorator="['id']" type="hidden"/>
+        <a-input v-decorator="['sbId']" type="hidden"/>
       </a-form-item>
       <a-form-item label="更改内容">
         <a-textarea
@@ -20,7 +20,6 @@
 </template>
 
 <script>
-import pick from 'lodash.pick'
 import { updateLogBySbId } from '@/api/sb/info'
 
 export default {
@@ -35,8 +34,13 @@ export default {
     base (record) {
       this.visible = true
       const { form: { setFieldsValue } } = this
-      setFieldsValue(Object.assign(pick(record, ['id'])))
-      console.log(record)
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'sbId': record.id
+        }))
+      })
+
+      console.log(record.id)
     },
     handleOk (e) {
       const { form: { validateFieldsAndScroll } } = this
@@ -47,6 +51,7 @@ export default {
           this.confirmLoading = false
           this.$message.error(errors)
         }
+        console.log(values)
         updateLogBySbId(values).then(res => {
           this.visible = false
           this.$message.success('操作成功')
@@ -57,6 +62,7 @@ export default {
       })
     },
     handleCancel (e) {
+      this.confirmLoading = false
       this.visible = false
     }
   }