Browse Source

feat: 修改保存

gemercheung 10 months ago
parent
commit
8e30d8f95e

+ 0 - 1
src/app/criminal/view/example/getGeo.ts

@@ -22,7 +22,6 @@ const tw = {
                 { code: '710111', name: '士林区', province: '71', city: '01', area: '11' },
                 { code: '710112', name: '北投区', province: '71', city: '01', area: '12' }
             ],
-
         },
         {
             code: '710102', name: '高雄市', province: '71', city: '02', children: [],

+ 2 - 1
src/assets/style/public.scss

@@ -569,4 +569,5 @@ html .el-input-group__append button.el-button {
 
 .el-color-predefine__color-selector {
   border: 1px solid #e5e5e5;
-}
+}
+

+ 10 - 8
src/view/case/records/index.vue

@@ -554,6 +554,7 @@ const props = defineProps({ caseId: Number, title: String });
 console.log(props);
 const isDisableExport = ref(false);
 const data = reactive({
+  title: "",
   inquestNum: "", //现场勘验号
   deptName: "", //单位名称
   sendDept: "", //发送单位
@@ -564,7 +565,7 @@ const data = reactive({
   reportDept: "", //报告单位
   times: [], // startTime ,endTime
   address: "", // 勘验地址
-
+  inquestTime: "", //勘验时间
   protector: {
     name: "",
     unit: "",
@@ -582,6 +583,8 @@ const data = reactive({
     windDirection: "",
   }, //天气情况
   light: [], //光线
+  painter: "",
+  photographer: "",
   inquestCommander: {
     name: "",
     unit: "",
@@ -594,10 +597,8 @@ const data = reactive({
   photographySecNum: 0, //摄影数量
   recorderInfo: [...recorderInfoType, recorderInfoType[4]],
   signatureInfo: [], //现场勘验人员
-
   witnessInfo: [],
-
-  remark: '',
+  remark: "",
 });
 const signatureInfoNum = 4;
 const witnessInfoNum = 2;
@@ -614,19 +615,21 @@ const initInfo = async () => {
   for (var k in data) {
     if (res.data && res.data.hasOwnProperty(k)) {
       console.log("Key is " + k);
-      data[k] = res.data[k];
+      if (res.data[k]) {
+        data[k] = res.data[k];
+      }
     }
   }
 };
 const initSignatureAndWitInfo = () => {
-  data.signatureInfo.length === 0 &&
+  (data.signatureInfo.length === 0 || !data.signatureInfo) &&
     Array.from(new Array(signatureInfoNum)).forEach(() => {
       data.signatureInfo.push({
         unit: "",
         job: "",
       });
     });
-  data.witnessInfo.length === 0 &&
+  (data.witnessInfo.length === 0 || !data.witnessInfo) &&
     Array.from(new Array(witnessInfoNum)).forEach(() => {
       data.witnessInfo.push({
         sex: 0,
@@ -688,7 +691,6 @@ const removeWitnessInfo = async (index) => {
 const handleSave = async () => {
   console.log("data", data);
 
-
   const res = await saveCaseInquestInfo(props.caseId, data);
   // if (res.code === 0) {
   //   ElMessage.success("保存成功!");