Browse Source

安全责任书

luojun 1 year ago
parent
commit
9e9a0b950d
2 changed files with 17 additions and 4 deletions
  1. 7 1
      src/views/safetyBook/dialog.edit.vue
  2. 10 3
      src/views/safetyBook/dialog.sign.vue

+ 7 - 1
src/views/safetyBook/dialog.edit.vue

@@ -83,6 +83,7 @@
 
           <el-table-column prop="names" label="操作">
             <template v-slot="{ row }">
+              <el-button type="text" @click="editII(row)">编辑</el-button>
               <el-button type="text" @click="removeRow(row)">删除</el-button>
             </template>
           </el-table-column>
@@ -141,6 +142,11 @@ export default {
       this.tableData.push(data);
       // console.log(data, "ddd");
     },
+    editII(row) {
+      
+      this.$refs.DialogSelect.show(row);
+      this.tableData = this.tableData.filter((item) => item !== row);
+    },
     //新增签署
     openSelect() {
       this.$refs.DialogSelect.show();
@@ -197,7 +203,7 @@ export default {
       this.$refs.form.resetFields();
     },
     onSubmit() {
-      console.log(this.formData,"this.formData")
+      // console.log(this.formData,"this.formData")
       this.$refs.form.validate(async (isValidate) => {
         if (!isValidate) return;
         this.formData.bookUsers=this.tableData;

+ 10 - 3
src/views/safetyBook/dialog.sign.vue

@@ -113,9 +113,16 @@ export default {
         names: [],
       };
     },
-    async show(id) {
-      this.formData= this.reset(),
-      this.id = id;
+    async show(row) {
+      console.log(row);
+      if(row!=undefined&&row!=null){
+        this.id = row.id;
+        this.formData=row;
+      }else{
+        this.formData= this.reset()
+      }
+      
+      // this.id = id;
       this.isShow = true;
     },