Browse Source

feat: save

gemercheung 10 months ago
parent
commit
5e6e0e8e4a
1 changed files with 58 additions and 4 deletions
  1. 58 4
      src/view/case/records/index.vue

+ 58 - 4
src/view/case/records/index.vue

@@ -393,9 +393,40 @@
         </div>
       </template>
 
-      <div class="line">现场勘验人员:</div>
-
       <div class="line">
+        现场勘验人员:
+        <el-button link @click="addSignatureInfo"
+          ><el-icon :size="18"><CirclePlus /> </el-icon>
+        </el-button>
+      </div>
+      <template v-for="(sign, index) of data.signatureInfo">
+        <div class="line info">
+          <span>本人签名: &nbsp;&nbsp; </span>
+          <span>_______________ &nbsp;&nbsp;</span>
+
+          <span>单位</span>
+          <el-input
+            class="input"
+            type="text"
+            v-model="sign.unit"
+            placeholder=""
+            style="width: 200px"
+          />
+          <span>职务</span>
+          <el-input
+            class="input"
+            type="text"
+            v-model="sign.job"
+            placeholder=""
+            style="width: 200px"
+          />
+          <el-button link type="danger" @click="removeSignatureInfo(index)"
+            ><el-icon :size="18"><CircleClose /> </el-icon>
+          </el-button>
+        </div>
+      </template>
+
+      <!-- <div class="line">
         <span>本人签名: &nbsp;&nbsp; </span>
         <span>_______________ &nbsp;&nbsp;</span>
 
@@ -478,7 +509,7 @@
           placeholder=""
           style="width: 200px"
         />
-      </div>
+      </div> -->
 
       <div class="line">现场勘验见证人:</div>
 
@@ -642,7 +673,8 @@ const data = reactive({
   photographyMinNum: 0, //摄影数量
   photographySecNum: 0, //摄影数量
   recorderInfo: [...recorderInfoType, recorderInfoType[4]],
-  signatureInfo: [],
+  signatureInfo: [], //现场勘验人员
+  signatureInfoNum: 4,
   witnessInfo: [],
   remark: [],
 });
@@ -664,9 +696,18 @@ const initInfo = async () => {
     }
   }
 };
+const initSignatureInfo = () => {
+  Array.from(new Array(data.signatureInfoNum)).forEach(() => {
+    data.signatureInfo.push({
+      unit: "",
+      job: "",
+    });
+  });
+};
 
 onMounted(() => {
   initInfo();
+  initSignatureInfo();
 });
 
 const addRecorderInfo = () => {
@@ -684,6 +725,19 @@ const removeRecorderInfo = async (index) => {
     data.recorderInfo.splice(index, 1);
   }
 };
+const addSignatureInfo = async () => {
+  if (await confirm("确定要添加新的现场勘验人员?")) {
+    data.signatureInfo.push({
+      unit: "",
+      job: "",
+    });
+  }
+};
+const removeSignatureInfo = async (index) => {
+  if (await confirm("确定要删除此数据?")) {
+    data.signatureInfo.splice(index, 1);
+  }
+};
 
 const handleSave = async () => {
   console.log("data", data);