Przeglądaj źródła

Merge branch 'xj' of http://192.168.0.115:3000/bill/public-fuse into xj

tangning 1 rok temu
rodzic
commit
87f5355d90

+ 4 - 0
src/app/fire/view/dispatch/index.vue

@@ -13,6 +13,7 @@
         </el-button>
       </template>
       <template v-else>
+        <el-button type="primary" @click="openMap"> 查看地图案件分配 </el-button>
         <el-button type="primary" @click="addHandler" v-pdpath="'add'">
           新增火调项目
         </el-button>
@@ -132,4 +133,7 @@ const editHandler = async (row: Fire) => {
 const addHandler = async () => {
   (await addFire({})) && pagging.refresh();
 };
+const openMap = () => {
+  location.href = "./map.html";
+};
 </script>

+ 3 - 2
src/request/index.ts

@@ -26,7 +26,7 @@ export type AuthHook = () => {
   clear: () => void;
 };
 export const setAuthHook = (hook: AuthHook) => (getAuth = hook);
-let getAuth: AuthHook = () => ({ token: "", userId: "0", clear: () => {} });
+let getAuth: AuthHook = () => ({ token: "", userId: "0", clear: () => { } });
 
 axios.defaults.baseURL = baseURL;
 
@@ -83,7 +83,8 @@ axios.interceptors.request.use(async (config) => {
 
 const responseInterceptor = (res: AxiosResponse<any, any>) => {
   closeLoading();
-  if (!successCode.includes(res.data.code)) {
+  const hasIgnore = res.config.params ? 'ingoreRes' in res.config.params : false
+  if (!successCode.includes(res.data.code) && !hasIgnore) {
     let errMsg = res.data.msg || res.data.message;
     openErrorMsg(errMsg);
 

+ 5 - 5
src/store/case.ts

@@ -29,9 +29,9 @@ export type Case = {
 export type CaseImg = {
   id: number;
   caseId: number;
-  imgInfo: string| null;
-  imgUrl: string| null;
-  status: number| null;
+  imgInfo: string | null;
+  imgUrl: string | null;
+  status: number | null;
   sort: number | null;
 };
 
@@ -89,7 +89,7 @@ export const caseImgList = (caseId: number, orderBy: string) =>
   axios.post(caseApiList, { orderBy: orderBy || 'desc', caseId });
 
 export const saveOrUpdate = (params: CaseImg) =>
-  axios.post(saveApiOrUpdate, { ...params});
+  axios.post(saveApiOrUpdate, { ...params });
 
 export const caseDel = (id: number) =>
   axios.post(caseApiDel, { id });
@@ -102,4 +102,4 @@ export const saveCaseInquestInfo = (caseId: number, data) =>
   axios.post(caseInquestOpt, { caseId, ...data });
 
 export const exportCaseInquestInfo = (caseId: number) =>
-  axios.post(caseInquestExport, { caseId });
+  axios.get(caseInquestExport, { params: { caseId, ingoreRes: true }, responseType: 'blob' });

+ 1 - 1
src/view/case/caseFile.vue

@@ -130,7 +130,7 @@ const refresh = async () => {
 watchEffect(() => caseId.value && currentTypeId.value && refresh());
 
 const query = (file: CaseFile) => {
-  const ext = file.filesUrl.substring(file.filesUrl.lastIndexOf("."));
+  const ext = file.filesUrl.substring(file.filesUrl.lastIndexOf(".")).toLocaleLowerCase();
   if (ext === ".raw") {
     window.open(`/xfile-viewer/index.html?file=${file.filesUrl}&time=` + Date.now());
   } else {

+ 14 - 12
src/view/case/records/index.vue

@@ -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>

+ 7 - 0
vite.config.ts

@@ -16,6 +16,13 @@ export default defineConfig({
   },
   base: "./",
   build: {
+    rollupOptions: {
+      input: {
+        index: resolve(__dirname, "index.html"),
+        map: resolve(__dirname, "map.html"),
+        // 在这里继续添加更多页面
+      },
+    },
     outDir: `dist/${app}`,
   },
   resolve: {