|
@@ -1,37 +1,59 @@
|
|
|
<template>
|
|
|
-
|
|
|
<div class="records">
|
|
|
<div class="header">
|
|
|
<el-button type="primary" @click="handleSave">保存</el-button>
|
|
|
- <el-button :disabled="isDisableExport" @click="handleExport">导出</el-button>
|
|
|
+ <el-button :disabled="isDisableExport" @click="handleExport"
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
|
|
|
<div class="content">
|
|
|
<div class="line">
|
|
|
<span>起火单位/地址:</span>
|
|
|
- <el-input class="input" v-model="data.address" placeholder="" style="width: 100%;" />
|
|
|
-
|
|
|
+ <el-input
|
|
|
+ class="input"
|
|
|
+ v-model="data.address"
|
|
|
+ placeholder=""
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
</div>
|
|
|
|
|
|
<div class="line">
|
|
|
<span>提取日期:</span>
|
|
|
<div>
|
|
|
- <el-input class="input" :maxlength="4" type="text" v-model="data.time.year" placeholder=""
|
|
|
- style="width: 80px;" />
|
|
|
+ <el-input
|
|
|
+ class="input"
|
|
|
+ :maxlength="4"
|
|
|
+ type="text"
|
|
|
+ v-model="data.time.year"
|
|
|
+ placeholder=""
|
|
|
+ style="width: 80px"
|
|
|
+ />
|
|
|
<span>年</span>
|
|
|
- <el-input class="input" :maxlength="2" type="text" v-model="data.time.month" placeholder=""
|
|
|
- style="width: 80px;" />
|
|
|
+ <el-input
|
|
|
+ class="input"
|
|
|
+ :maxlength="2"
|
|
|
+ type="text"
|
|
|
+ v-model="data.time.month"
|
|
|
+ placeholder=""
|
|
|
+ style="width: 80px"
|
|
|
+ />
|
|
|
<span>月</span>
|
|
|
- <el-input class="input" :maxlength="2" type="text" v-model="data.time.day" placeholder=""
|
|
|
- style="width: 80px;" />
|
|
|
+ <el-input
|
|
|
+ class="input"
|
|
|
+ :maxlength="2"
|
|
|
+ type="text"
|
|
|
+ v-model="data.time.day"
|
|
|
+ placeholder=""
|
|
|
+ style="width: 80px"
|
|
|
+ />
|
|
|
<span>日</span>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
|
|
|
<div class="detail">
|
|
|
<span class="sub-tit">提取清单:</span>
|
|
|
- <template v-for=" (item, index) in data.detail">
|
|
|
+ <template v-for="(item, index) in data.detail">
|
|
|
<div class="con">
|
|
|
<span class="sub-tit">编号 {{ index + 1 }}: </span>
|
|
|
<div class="info">
|
|
@@ -56,23 +78,16 @@
|
|
|
<span>提取部位: </span>
|
|
|
<el-input class="input" v-model="item.part" placeholder="" />
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
</div>
|
|
|
<div class="inner">
|
|
|
<div class="sec">
|
|
|
<span>特征: </span>
|
|
|
<el-input class="input" v-model="item.desc" placeholder="" />
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
-
|
|
|
</template>
|
|
|
-
|
|
|
-
|
|
|
</div>
|
|
|
<div class="btn-container">
|
|
|
<el-button class="btn" @click="addItem">+新增</el-button>
|
|
@@ -84,11 +99,20 @@
|
|
|
<template v-for="extractUser in data.extractUser">
|
|
|
<div class="line">
|
|
|
<span>姓名:</span>
|
|
|
- <el-input class="input" v-model="extractUser.name" placeholder="" style="width: 20%" />
|
|
|
+ <el-input
|
|
|
+ class="input"
|
|
|
+ v-model="extractUser.name"
|
|
|
+ placeholder=""
|
|
|
+ style="width: 20%"
|
|
|
+ />
|
|
|
<span>工作单位:</span>
|
|
|
- <el-input class="input" v-model="extractUser.address" placeholder="" style="width: 70%" />
|
|
|
+ <el-input
|
|
|
+ class="input"
|
|
|
+ v-model="extractUser.address"
|
|
|
+ placeholder=""
|
|
|
+ style="width: 70%"
|
|
|
+ />
|
|
|
</div>
|
|
|
-
|
|
|
</template>
|
|
|
</div>
|
|
|
<div class="btn-container">
|
|
@@ -102,126 +126,147 @@
|
|
|
<!-- <span class="sub-tit">证人信息:</span> -->
|
|
|
<div class="line">
|
|
|
<span>姓名:</span>
|
|
|
- <el-input class="input" v-model="wit.name" placeholder="" style="width: 180px;" />
|
|
|
- <span style="margin-left:50px">身份证件号码:</span>
|
|
|
- <el-input class="input" v-model="wit.id" placeholder="" style="width: 280px;" />
|
|
|
- <span style="margin-left:50px">联系电话:</span>
|
|
|
- <el-input class="input" v-model="wit.phone" placeholder="" style="width: 280px;" />
|
|
|
+ <el-input
|
|
|
+ class="input"
|
|
|
+ v-model="wit.name"
|
|
|
+ placeholder=""
|
|
|
+ style="width: 180px"
|
|
|
+ />
|
|
|
+ <span style="margin-left: 50px">身份证件号码:</span>
|
|
|
+ <el-input
|
|
|
+ class="input"
|
|
|
+ v-model="wit.id"
|
|
|
+ placeholder=""
|
|
|
+ style="width: 280px"
|
|
|
+ />
|
|
|
+ <span style="margin-left: 50px">联系电话:</span>
|
|
|
+ <el-input
|
|
|
+ class="input"
|
|
|
+ v-model="wit.phone"
|
|
|
+ placeholder=""
|
|
|
+ style="width: 280px"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="line">
|
|
|
<span>单位或住址:</span>
|
|
|
- <el-input class="input" v-model="wit.address" placeholder="" style="width: 100%;" />
|
|
|
+ <el-input
|
|
|
+ class="input"
|
|
|
+ v-model="wit.address"
|
|
|
+ placeholder=""
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
</template>
|
|
|
</div>
|
|
|
<div class="btn-container">
|
|
|
<el-button class="btn" @click="addwitnessInfo">+新增</el-button>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- </div>
|
|
|
+ <div></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { onMounted, ref, watch } from 'vue';
|
|
|
-import { reactive } from 'vue'
|
|
|
+import { onMounted, ref, watch } from "vue";
|
|
|
+import { reactive } from "vue";
|
|
|
import {
|
|
|
getCaseDetailInfo,
|
|
|
saveCaseDetailInfo,
|
|
|
- exportCaseDetailInfo
|
|
|
+ exportCaseDetailInfo,
|
|
|
} from "@/store/case";
|
|
|
import saveAs from "@/util/file-serve";
|
|
|
-import { ElMessage } from 'element-plus';
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
|
|
|
-const props = defineProps({ caseId: Number })
|
|
|
+const props = defineProps({ caseId: Number, title: String });
|
|
|
|
|
|
-const isDisableExport = ref(false)
|
|
|
+const isDisableExport = ref(false);
|
|
|
|
|
|
-console.log(props)
|
|
|
+console.log(props);
|
|
|
|
|
|
const data = reactive({
|
|
|
address: "",
|
|
|
time: {
|
|
|
year: "",
|
|
|
month: "",
|
|
|
- day: ""
|
|
|
+ day: "",
|
|
|
},
|
|
|
|
|
|
- location: '',
|
|
|
- detail: [{
|
|
|
- // id: "1",
|
|
|
- name: "",
|
|
|
- spec: "",
|
|
|
- num: "",
|
|
|
- part: "",
|
|
|
- desc: "",
|
|
|
- },
|
|
|
- {
|
|
|
- // id: "2",
|
|
|
- name: "",
|
|
|
- spec: "",
|
|
|
- num: "",
|
|
|
- part: "",
|
|
|
- desc: "",
|
|
|
- }],
|
|
|
+ location: "",
|
|
|
+ detail: [
|
|
|
+ {
|
|
|
+ // id: "1",
|
|
|
+ name: "",
|
|
|
+ spec: "",
|
|
|
+ num: "",
|
|
|
+ part: "",
|
|
|
+ desc: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // id: "2",
|
|
|
+ name: "",
|
|
|
+ spec: "",
|
|
|
+ num: "",
|
|
|
+ part: "",
|
|
|
+ desc: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
extractUser: [
|
|
|
{
|
|
|
name: "",
|
|
|
workplace: "",
|
|
|
- id: ""
|
|
|
+ id: "",
|
|
|
},
|
|
|
|
|
|
{
|
|
|
name: "",
|
|
|
address: "",
|
|
|
- id: ""
|
|
|
+ id: "",
|
|
|
},
|
|
|
],
|
|
|
|
|
|
- witnessInfo: [{
|
|
|
- name: "",
|
|
|
- address: "",
|
|
|
- phone: '',
|
|
|
- id: "",
|
|
|
-
|
|
|
- }, {
|
|
|
- name: "",
|
|
|
- address: "",
|
|
|
- phone: '',
|
|
|
- id: ""
|
|
|
- }]
|
|
|
-})
|
|
|
-
|
|
|
-watch(data, newValue => {
|
|
|
- // data.userName = newValue.userName.replace(/[^0-9]/g, '');
|
|
|
- const sMonth = newValue.time.month.replace(/[^0-9]/g, '');
|
|
|
- const sDay = newValue.time.day.replace(/[^0-9]/g, '');
|
|
|
-
|
|
|
- data.time.year = newValue.time.year.replace(/[^0-9]/g, '');
|
|
|
- data.time.month = Number(sMonth) > 12 ? '12' : sMonth;
|
|
|
- data.time.day = Number(sDay) > 31 ? '31' : sDay;
|
|
|
-
|
|
|
-
|
|
|
-}, {
|
|
|
- immediate: true,
|
|
|
- deep: true
|
|
|
-})
|
|
|
-
|
|
|
+ witnessInfo: [
|
|
|
+ {
|
|
|
+ name: "",
|
|
|
+ address: "",
|
|
|
+ phone: "",
|
|
|
+ id: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "",
|
|
|
+ address: "",
|
|
|
+ phone: "",
|
|
|
+ id: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+});
|
|
|
+
|
|
|
+watch(
|
|
|
+ data,
|
|
|
+ (newValue) => {
|
|
|
+ // data.userName = newValue.userName.replace(/[^0-9]/g, '');
|
|
|
+ const sMonth = newValue.time.month.replace(/[^0-9]/g, "");
|
|
|
+ const sDay = newValue.time.day.replace(/[^0-9]/g, "");
|
|
|
+
|
|
|
+ data.time.year = newValue.time.year.replace(/[^0-9]/g, "");
|
|
|
+ data.time.month = Number(sMonth) > 12 ? "12" : sMonth;
|
|
|
+ data.time.day = Number(sDay) > 31 ? "31" : sDay;
|
|
|
+ },
|
|
|
+ {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ }
|
|
|
+);
|
|
|
|
|
|
-onMounted(() => {
|
|
|
-})
|
|
|
+onMounted(() => {});
|
|
|
|
|
|
const addwitnessInfo = () => {
|
|
|
data.witnessInfo.push({
|
|
|
name: "",
|
|
|
address: "",
|
|
|
- phone: '',
|
|
|
- id: ""
|
|
|
- })
|
|
|
-}
|
|
|
+ phone: "",
|
|
|
+ id: "",
|
|
|
+ });
|
|
|
+};
|
|
|
const addItem = () => {
|
|
|
data.detail.push({
|
|
|
// id: "1",
|
|
@@ -230,43 +275,41 @@ const addItem = () => {
|
|
|
num: "",
|
|
|
part: "",
|
|
|
desc: "",
|
|
|
- })
|
|
|
-}
|
|
|
+ });
|
|
|
+};
|
|
|
const addextractUser = () => {
|
|
|
data.extractUser.push({
|
|
|
name: "",
|
|
|
address: "",
|
|
|
- id: ""
|
|
|
- })
|
|
|
-}
|
|
|
+ id: "",
|
|
|
+ });
|
|
|
+};
|
|
|
const handleSave = async () => {
|
|
|
- console.log('data', data)
|
|
|
+ console.log("data", data);
|
|
|
const res = await saveCaseDetailInfo(props.caseId, data);
|
|
|
if (res.code === 0) {
|
|
|
- ElMessage.success('保存成功!')
|
|
|
+ ElMessage.success("保存成功!");
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
const handleExport = async () => {
|
|
|
const res = await exportCaseDetailInfo(props.caseId);
|
|
|
- console.log('res', res)
|
|
|
- saveAs(res, `提取清单-${props.caseId}.docx`)
|
|
|
-}
|
|
|
+ console.log("res", res);
|
|
|
+ saveAs(res, `${props.title}_提取清单.docx`);
|
|
|
+};
|
|
|
onMounted(async () => {
|
|
|
const res = await getCaseDetailInfo(props.caseId);
|
|
|
|
|
|
- console.log('res', res)
|
|
|
+ console.log("res", res);
|
|
|
for (var k in data) {
|
|
|
if (!res.data) {
|
|
|
- isDisableExport.value = true
|
|
|
+ isDisableExport.value = true;
|
|
|
}
|
|
|
if (res.data && res.data.hasOwnProperty(k)) {
|
|
|
// console.log("Key is " + k)
|
|
|
- data[k] = res.data[k]
|
|
|
+ data[k] = res.data[k];
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-})
|
|
|
-
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
@@ -340,15 +383,11 @@ onMounted(async () => {
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
.witnessInfo {
|
|
|
- background: #F5F5F5;
|
|
|
+ background: #f5f5f5;
|
|
|
padding: 15px;
|
|
|
margin-top: 20px;
|
|
|
// margin-right: 8px;
|
|
@@ -362,22 +401,20 @@ onMounted(async () => {
|
|
|
padding: 20px 0;
|
|
|
|
|
|
.btn {
|
|
|
- color: #26559B;
|
|
|
+ color: #26559b;
|
|
|
width: 100%;
|
|
|
|
|
|
&:hover {
|
|
|
- background: #F5F5F5;
|
|
|
+ background: #f5f5f5;
|
|
|
border-color: #dcdfe6;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.detail {
|
|
|
-
|
|
|
-
|
|
|
.con {
|
|
|
padding: 20px;
|
|
|
- background-color: #F5F5F5;
|
|
|
+ background-color: #f5f5f5;
|
|
|
}
|
|
|
|
|
|
.info {
|
|
@@ -385,18 +422,17 @@ onMounted(async () => {
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
.extractUser {
|
|
|
margin-right: 0px;
|
|
|
|
|
|
.line {
|
|
|
- background-color: #F5F5F5;
|
|
|
+ background-color: #f5f5f5;
|
|
|
padding: 15px;
|
|
|
width: calc(100% - 30px);
|
|
|
display: inline-flex;
|
|
|
margin-bottom: 15px;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|