|
@@ -123,23 +123,23 @@
|
|
|
|
|
|
<div class="gap"></div>
|
|
|
<!-- 证人 -->
|
|
|
- <template v-for="index of witnessInfoes">
|
|
|
+ <template v-for="item of data.witnessInfo">
|
|
|
<div class="witnessInfo">
|
|
|
<span class="sub-tit">证人信息:</span>
|
|
|
<div class="line">
|
|
|
<span>证人或当事人:</span>
|
|
|
- <el-input class="input" v-model="data.witnessInfo[index - 1].name" placeholder="" style="width: 180px;" />
|
|
|
+ <el-input class="input" v-model="item.name" placeholder="" style="width: 180px;" />
|
|
|
<div>
|
|
|
- <el-input class="input" v-model="data.witnessInfo[index - 1].year" placeholder="" style="width: 80px;" />
|
|
|
+ <el-input class="input" v-model="item.year" placeholder="" style="width: 80px;" />
|
|
|
<span>年</span>
|
|
|
- <el-input class="input" v-model="data.witnessInfo[index - 1].month" placeholder="" style="width: 80px;" />
|
|
|
+ <el-input class="input" v-model="item.month" placeholder="" style="width: 80px;" />
|
|
|
<span>月</span>
|
|
|
- <el-input class="input" v-model="data.witnessInfo[index - 1].day" placeholder="" style="width: 80px;" />
|
|
|
+ <el-input class="input" v-model="item.day" placeholder="" style="width: 80px;" />
|
|
|
<span>日</span>
|
|
|
</div>
|
|
|
|
|
|
<span style="margin-left:50px">身份证件号码:</span>
|
|
|
- <el-input class="input" v-model="data.witnessInfo[index - 1].id" placeholder="" style="width: 280px;" />
|
|
|
+ <el-input class="input" v-model="item.id" placeholder="" style="width: 280px;" />
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -164,6 +164,7 @@ import {
|
|
|
exportCaseInquestInfo
|
|
|
} from "@/store/case";
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
+import saveAs from "@/util/file-serve";
|
|
|
const props = defineProps({ caseId: Number })
|
|
|
|
|
|
console.log(props)
|
|
@@ -252,21 +253,20 @@ watch(data, newValue => {
|
|
|
deep: true
|
|
|
})
|
|
|
|
|
|
-const witnessInfoes = ref(2)
|
|
|
-
|
|
|
onMounted(async () => {
|
|
|
const res = await getCaseInquestInfo(props.caseId);
|
|
|
console.log('res', res)
|
|
|
for (var k in data) {
|
|
|
- if (res.data.hasOwnProperty(k)) {
|
|
|
- // console.log("Key is " + k + ", value is " + res.data[k])
|
|
|
+ if (res.data && res.data.hasOwnProperty(k)) {
|
|
|
+ console.log("Key is " + k)
|
|
|
data[k] = res.data[k]
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
})
|
|
|
|
|
|
const addwitnessInfo = () => {
|
|
|
- witnessInfoes.value += 1
|
|
|
+ // witnessInfoes.value += 1
|
|
|
data.witnessInfo.push({
|
|
|
name: "",
|
|
|
year: "",
|
|
@@ -284,7 +284,9 @@ const handleSave = async () => {
|
|
|
}
|
|
|
}
|
|
|
const handleExport = async () => {
|
|
|
- const res = exportCaseInquestInfo(props.caseId);
|
|
|
+ const res = await exportCaseInquestInfo(props.caseId);
|
|
|
+ console.log('res', res)
|
|
|
+ saveAs(res, `勘验笔录-${props.caseId}.docx`)
|
|
|
}
|
|
|
|
|
|
</script>
|