瀏覽代碼

添加救灾物资维护保养统计表和防汛抗旱物资维护保养统计表页面

zhuqingsong 1 年之前
父節點
當前提交
bea7a47e9d

+ 2 - 2
.env.development

@@ -1,8 +1,8 @@
1 1
 # 若依管理系统/开发环境
2 2
 # VUE_APP_BASE_URL = 'http://192.168.50.205:9999'
3
-#VUE_APP_BASE_URL = 'http://192.168.1.113:9999'
3
+VUE_APP_BASE_URL = 'http://192.168.1.113:9999'
4 4
 # 测试环境外网
5
-VUE_APP_BASE_URL = 'http://121.36.17.6:9098'
5
+#VUE_APP_BASE_URL = 'http://121.36.17.6:9098'
6 6
 # 正式环境外网
7 7
 # VUE_APP_BASE_URL = 'http://121.36.17.6:9099'
8 8
 

+ 16 - 0
src/router/index.ts

@@ -123,6 +123,22 @@ const routes: Array<RouteRecordRaw> = [
123 123
         }
124 124
       }
125 125
     ]
126
+  },
127
+  {
128
+    path: "/dataStatistics",
129
+    name: "dataStatistics",
130
+    redirect: "/dataStatistics/components",
131
+    component: layout,
132
+    children: [
133
+      {
134
+        path: "DataStatisticsDetail",
135
+        name: "维护保养详情",
136
+        component: () => import("@/views/dataStatistics/components/detail.vue"),
137
+        props(route) {
138
+          return route.query;
139
+        }
140
+      }
141
+    ]
126 142
   }
127 143
 ];
128 144
 

+ 212 - 0
src/views/dataStatistics/components/detail.vue

@@ -0,0 +1,212 @@
1
+<!-- 应急物资分类表 -->
2
+<template>
3
+  <basic-container class="container">
4
+    <el-table :data="tableData" border>
5
+      <el-table-column prop="warehouse" label="库点简称" align="center" />
6
+      <el-table-column prop="materialGroupVo" label="物资大类" align="center" />
7
+      <el-table-column prop="materialTypeVo" label="物资类别" align="center" />
8
+      <el-table-column prop="materialNameVo" label="物资名称" align="center" />
9
+      <el-table-column prop="entryDate" label="入库日期" align="center" />
10
+      <el-table-column prop="unitPrice" label="单价(元)" align="center" />
11
+      <el-table-column prop="maintenanceUnit" label="维护保养单位" align="center" width="200" />
12
+      <el-table-column prop="maintenancePerson" label="维护保养人" align="center" width="114" />
13
+      <el-table-column prop="maintenanceTime" label="维护保养时间" align="center" width="140" />
14
+      <el-table-column prop="fileName" label="附件上传" align="center" width="114">
15
+        <template #default="scope">
16
+          <!-- <el-form-item v-if="props.type != 'look'" :prop="'materialMaintenanceStatuses.' + scope.$index + '.fileName'">
17
+            <el-upload
18
+              :disabled="props.type == 'look'"
19
+              v-model:file-list="scope.row.filePartList"
20
+              class="upload-demo"
21
+              style="width: 100%"
22
+              :action="fileUrl"
23
+              :data="paramsData"
24
+              :headers="myHeader"
25
+              multiple
26
+              :on-remove="handleRemove"
27
+              :before-remove="beforeRemove"
28
+              :on-success="(response, file, index) => getFileInfo(response, file, scope.$index)"
29
+              :on-error="errorUpload"
30
+              :before-upload="beforeUpload"
31
+              :limit="1"
32
+              :on-exceed="handleExceed"
33
+            >
34
+              <el-button v-if="props.type != 'look'" size="small" type="primary">选择文件</el-button>
35
+            </el-upload>
36
+          </el-form-item> -->
37
+          <p @click="handlePreview(scope.row.filePart)" style="cursor: pointer; color: #409eff">
38
+            {{ scope.row.fileName }}
39
+          </p>
40
+        </template>
41
+      </el-table-column>
42
+    </el-table>
43
+    <div class="operationbox">
44
+      <el-button @click="returnPage" v-if="props.type === 'look'">返回</el-button>
45
+    </div>
46
+  </basic-container>
47
+</template>
48
+
49
+<script setup lang="ts">
50
+import { ref, reactive, onMounted } from "vue";
51
+import { Delete, Plus } from "@element-plus/icons-vue";
52
+import { ElMessage, ElMessageBox } from "element-plus";
53
+import type { UploadProps } from "element-plus";
54
+import router from "@/router";
55
+import { lookInData, Auditing } from "@/api/upkeep/in";
56
+import { useDict } from "@/hooks/dict";
57
+// import { closeTagAndOpenLastTag } from '@/router/Routermethods';
58
+import store from "@/store";
59
+import { getQuery } from "@/hooks/detailQuery/index";
60
+import { useGetters } from "@/hooks/storeHooks";
61
+const { access_token } = useGetters(["access_token"]);
62
+import { decimalMul, decimalDev } from "@/global/decimalCompute";
63
+import { dictTree, sysFile } from "@/api/inAndOut/formationFilling/in";
64
+
65
+const { maintenance_auditing_status } = useDict("maintenance_auditing_status");
66
+
67
+// const props = defineProps(['id','type'])
68
+const props = getQuery("/dataStatistics/DataStatisticsDetail");
69
+// 价值计算带万
70
+const wanJson = ["118", "122", "124", "132", "182", "184"];
71
+let materialMaintenanceStatuses = ref([]);
72
+const tableData: any = ref();
73
+const queryForms = ref();
74
+const formData = reactive({
75
+  opinion: "",
76
+  filePart: "",
77
+  fileName: "",
78
+  file: [],
79
+  filePartList: [{ url: "", name: "" }]
80
+});
81
+const formRules = reactive({
82
+  opinion: [
83
+    {
84
+      required: true,
85
+      message: "请填写审核意见",
86
+      trigger: "blur"
87
+    }
88
+  ]
89
+});
90
+// 根据码回显中文
91
+const showCh = (value, option) => {
92
+  const filterItem = option.filter((item) => item.value == value);
93
+  return filterItem.length ? filterItem[0].label : "-";
94
+};
95
+// 详情获取数据
96
+const lookData = () => {
97
+  lookInData(props.id).then((res: any) => {
98
+    if (res.code === 0) {
99
+      let getData = res.data.materialMaintenanceDetails;
100
+      tableData.value = getData.map((item: any) => ({
101
+        ...item,
102
+        filePartList: [{ url: item.filePart, name: item.fileName }],
103
+        warehouse: res.data.warehouse,
104
+        materialGroupVo: res.data.materialGroupVo,
105
+        materialTypeVo: res.data.materialTypeVo,
106
+        materialNameVo: res.data.materialNameVo,
107
+        entryDate: res.data.entryDate,
108
+        unitPrice: res.data.unitPrice
109
+      }));
110
+    }
111
+  });
112
+};
113
+/** 返回 */
114
+const returnPage = () => {
115
+  router.push({
116
+    path: "/dataStatistics/floodDroughtPrecautionUpkeep"
117
+  });
118
+};
119
+
120
+//附件部分
121
+const fileUrl = "/admin/sysFile/uploadVoucher";
122
+let paramsData = reactive({
123
+  bucket: "bound"
124
+});
125
+const myHeader = { Authorization: "Bearer " + access_token.value };
126
+// 附件相关
127
+const getFileInfo = (res: any, file: any) => {
128
+  formData.filePart = res.data.fileName;
129
+  formData.fileName = file.name;
130
+};
131
+const handleRemove = (file: any, uploadFiles: any) => {
132
+  console.log(file, uploadFiles);
133
+};
134
+const handlePreview = (url: string) => {
135
+  sysFile(url).then((res: any) => {
136
+    const blob = new Blob([res], { type: "application/pdf;charset=UTF-8" });
137
+    const bFile = URL.createObjectURL(blob);
138
+    window.open(bFile);
139
+  });
140
+};
141
+
142
+const handlePreview1 = (file: any) => {
143
+  if (file.url) {
144
+    sysFile(file.url).then((res: any) => {
145
+      const blob = new Blob([res], { type: "application/pdf;charset=UTF-8" });
146
+      const bFile = URL.createObjectURL(blob);
147
+      window.open(bFile);
148
+    });
149
+  }
150
+};
151
+
152
+const handleExceed = (files: any, uploadFiles: any) => {
153
+  ElMessage.warning(`限制上传一个文件`);
154
+};
155
+const beforeRemove = (uploadFile: any, uploadFiles: any) => {
156
+  // return ElMessageBox.confirm(`确定移除 ${uploadFile.name} ?`).then(
157
+  //   () => true,
158
+  //   () => false
159
+  // );
160
+};
161
+const errorUpload = (err: any, file: any, fileList: any) => {
162
+  ElMessage.error("文件上传失败,UploadAjaxError:" + JSON.parse(JSON.stringify(err)).status);
163
+};
164
+// 上传前对附件进行的操作
165
+const beforeUpload: UploadProps["beforeUpload"] = (file) => {
166
+  // const typeList = ".pdf.jpg.png.gif.jpeg.PDF.JPG.PNG.GIF.JPEG";
167
+  const typeList = ".pdf"; //限制为pdf格式
168
+  const { name, type } = fileNameDispose(file.name);
169
+  if (!typeList.includes(type)) {
170
+    ElMessage.error("仅支持pdf类型文件,请重新上传。");
171
+    return false;
172
+  }
173
+  if (name.length > 30) {
174
+    ElMessage.error("文件名不可超30字,请重新命名后再上传。");
175
+    return false;
176
+  }
177
+  const isLt20M = file.size / 1024 / 1024 < 100;
178
+  if (!isLt20M) {
179
+    ElMessage.error("文件大小不可超过 100MB。");
180
+    return false;
181
+  }
182
+  return true;
183
+};
184
+// 获取上传附件的名字和类型
185
+const fileNameDispose = (name: string) => {
186
+  const arr = name.split(".");
187
+  if (arr.length === 2) {
188
+    return { name: arr[0], type: arr[1] };
189
+  } else {
190
+    const type = arr.splice(arr.length - 1, 1)[0];
191
+    const name = arr.join(".");
192
+    return { name, type };
193
+  }
194
+};
195
+/** -----------------附件结束--------------- */
196
+/** 初始化 **/
197
+onMounted(() => {
198
+  console.log(props.id, "id");
199
+  if (props.type) {
200
+    lookData();
201
+  } else {
202
+    tableData.value = [{}];
203
+  }
204
+});
205
+</script>
206
+
207
+<style lang="scss" scoped>
208
+.operationbox {
209
+  text-align: center;
210
+  margin-top: 30px;
211
+}
212
+</style>

+ 1 - 0
src/views/dataStatistics/components/detailedTable.vue

@@ -133,6 +133,7 @@
133 133
         </template>
134 134
       </el-table-column>
135 135
       <el-table-column prop="remarks" label="备注" :class-name="Bgcolor" header-align="center" align="center" />
136
+      <el-table-column prop="remarks" label="已维护次数" :class-name="Bgcolor" header-align="center" align="center" />
136 137
     </el-table>
137 138
   </basic-container>
138 139
 </template>

+ 530 - 0
src/views/dataStatistics/components/detailedTable1.vue

@@ -0,0 +1,530 @@
1
+<template>
2
+  <basic-container>
3
+    <el-form class="whole_form">
4
+      <el-row :gutter="20">
5
+        <el-col :span="6" v-if="userInfo.deptType === '1'">
6
+          <el-form-item label="垂管局">
7
+            <el-select v-model="searchList.gameDeptId" multiple filterable clearable @change="getSupplies">
8
+              <el-option v-for="item in cityList" :key="item.deptId" :label="item.name" :value="item.deptId" />
9
+            </el-select>
10
+          </el-form-item>
11
+        </el-col>
12
+        <el-col :span="6" v-if="userInfo.deptType === '1'">
13
+          <el-form-item label="省份">
14
+            <el-select v-model="searchList.provinceSiteIdList" filterable clearable multiple>
15
+              <el-option v-for="item in provinceList" :key="item.id" :label="item.name" :value="item.code" />
16
+            </el-select>
17
+          </el-form-item>
18
+        </el-col>
19
+        <el-col :span="6" v-if="userInfo.deptType === '1'">
20
+          <el-form-item label="储备仓库">
21
+            <el-select
22
+              multiple
23
+              filterable
24
+              clearable
25
+              v-model="searchList.warehouseDeptId"
26
+              :disabled="!searchList.gameDeptId"
27
+              :placeholder="!searchList.gameDeptId ? '请先选择垂管局' : '请选择储备仓库'"
28
+            >
29
+              <el-option
30
+                v-for="item in warehouseList"
31
+                :key="item.deptId"
32
+                :label="item.abbreviationName"
33
+                :value="item.deptId"
34
+              />
35
+            </el-select>
36
+          </el-form-item>
37
+        </el-col>
38
+        <el-col :span="6" v-if="userInfo.deptType === '2'">
39
+          <el-form-item label="储备仓库">
40
+            <el-select v-model="searchList.warehouseDeptId" multiple clearable placeholder="请选择储备仓库">
41
+              <el-option
42
+                v-for="item in warehouseList"
43
+                :key="item.deptId"
44
+                :label="item.abbreviationName"
45
+                :value="item.deptId"
46
+              />
47
+            </el-select>
48
+          </el-form-item>
49
+        </el-col>
50
+        <el-col :span="6">
51
+          <el-form-item label="物资类别">
52
+            <el-select v-model="searchList.dmUpcode1List" clearable multiple>
53
+              <el-option v-for="item in suppliesList" :key="item.id" :label="item.name" :value="item.code" />
54
+            </el-select>
55
+          </el-form-item>
56
+        </el-col>
57
+        <el-col :span="6">
58
+          <el-form-item label="物资名称">
59
+            <el-input v-model="searchList.dmUpname2" clearable />
60
+          </el-form-item>
61
+        </el-col>
62
+        <el-col :span="6">
63
+          <el-form-item label="储存状态">
64
+            <el-select v-model="searchList.storageState" @change="handlerChange" clearable>
65
+              <el-option v-for="item in Storage_state" :key="item.value" :label="item.label" :value="item.value" />
66
+            </el-select>
67
+          </el-form-item>
68
+        </el-col>
69
+        <el-col :span="6">
70
+          <el-form-item label="已维护次数">
71
+            <el-input v-model="searchList.maintenanceCount" placeholder="请输入已维护次数" clearable />
72
+          </el-form-item>
73
+        </el-col>
74
+        <el-col :span="6" class="btn_center">
75
+          <el-button :icon="Search" type="primary" @click="getList">查询</el-button>
76
+          <el-button :icon="RefreshRight" @click="clearSearch">清空</el-button>
77
+          <!-- <el-button type="primary" :disable="!tableLoading" :icon="Download" @click="downloadExcel">导出</el-button> -->
78
+          <el-button type="primary" :icon="Download" @click="exportTemplate" v-if="hasBtn('tj:export')">导出</el-button>
79
+        </el-col>
80
+        <!-- <el-col :span="6" class="btn_center">
81
+          <el-button class="color1" @click="handlerColor('success', '1')">超期</el-button>
82
+          <el-button class="color2" @click="handlerColor('danger', '4')">临期</el-button>
83
+          <el-button class="color3" @click="handlerColor('warning', '2')">存储过半</el-button>
84
+        </el-col> -->
85
+      </el-row>
86
+    </el-form>
87
+    <el-table
88
+      :data="tableData"
89
+      stripe
90
+      border
91
+      style="height: 80%"
92
+      :span-method="arraySpanMethod"
93
+      v-loading="tableLoading"
94
+      :row-style="cellStyle"
95
+    >
96
+      <!-- <el-table :data="tableData" stripe border> -->
97
+      <el-table-column fixed type="index" label="序号" header-align="center" align="center" width="60">
98
+        <template #default="scope">
99
+          <span v-if="scope.$index !== 0 && scope.$index !== 1">
100
+            {{ scope.$index - 1 }}
101
+          </span>
102
+          <span v-else></span>
103
+        </template>
104
+      </el-table-column>
105
+      <el-table-column
106
+        v-if="userInfo.deptType === '1' || userInfo.deptType === '2'"
107
+        fixed
108
+        prop="gameName"
109
+        label="垂管局"
110
+        header-align="center"
111
+        align="center"
112
+      />
113
+      <el-table-column
114
+        v-if="userInfo.deptType === '1' || userInfo.deptType === '2'"
115
+        fixed
116
+        prop="province"
117
+        label="省份"
118
+        header-align="center"
119
+        align="center"
120
+      />
121
+      <el-table-column fixed prop="warehouseName" label="储备仓库" header-align="center" align="center" />
122
+      <el-table-column fixed prop="materials1" label="物资大类" header-align="center" align="center" />
123
+      <el-table-column prop="materials2" label="物资类别" :class-name="Bgcolor" header-align="center" align="center" />
124
+      <el-table-column prop="materials3" label="物资名称" :class-name="Bgcolor" header-align="center" align="center" />
125
+      <el-table-column prop="materials4" label="物资单位" :class-name="Bgcolor" header-align="center" align="center" />
126
+      <el-table-column prop="specs" label="规格" header-align="center" :class-name="Bgcolor" align="center" />
127
+      <el-table-column prop="inboundTime" label="入库时间" :class-name="Bgcolor" header-align="center" align="center">
128
+        <template #default="{ row }">
129
+          {{ row.inboundTime ? row.inboundTime.slice(0, 7) : "" }}
130
+        </template>
131
+      </el-table-column>
132
+      <el-table-column prop="years" label="建议年限" :class-name="Bgcolor" header-align="center" align="center" />
133
+      <el-table-column prop="quantity" label="数量" :class-name="Bgcolor" header-align="center" align="center" />
134
+      <el-table-column prop="unitPrice" label="单价(元)" :class-name="Bgcolor" header-align="center" align="center" />
135
+      <el-table-column prop="totalPrice" label="总价(万元)" :class-name="Bgcolor" header-align="center" align="center">
136
+        <template #default="{ row }">
137
+          {{ row.totalPrice ?? row.warehouseTotalPrice }}
138
+        </template>
139
+      </el-table-column>
140
+      <el-table-column prop="remarks" label="备注" :class-name="Bgcolor" header-align="center" align="center" />
141
+      <el-table-column
142
+        prop="maintenanceCount"
143
+        label="已维护次数"
144
+        :class-name="Bgcolor"
145
+        header-align="center"
146
+        align="center"
147
+      >
148
+        <template #default="{ row }">
149
+          <p class="font-style" @click="openDetail(row, 'look')">{{ row.maintenanceCount }}</p>
150
+        </template>
151
+      </el-table-column>
152
+    </el-table>
153
+  </basic-container>
154
+</template>
155
+
156
+<script setup lang="ts">
157
+import { ref, onMounted } from "vue";
158
+import { useGetters } from "@/hooks/storeHooks";
159
+import { getDetailList, getCityList, getSysTreeDict, exportjzwzmxtjb } from "@/api/dataStatistics/index";
160
+import { Search, RefreshRight, Download } from "@element-plus/icons-vue";
161
+import { exportExcel } from "@/utils/exprot";
162
+import { da } from "element-plus/es/locale";
163
+import { deepClone, handleTree } from "@/utils/util";
164
+import exportBlob from "@/global/exportBlob";
165
+import hasBtn from "@/global/hasBtn";
166
+import { setQuery } from "@/hooks/detailQuery/index";
167
+
168
+import { useDict } from "@/hooks/dict";
169
+
170
+const { Storage_state } = useDict("Storage_state");
171
+
172
+const tableData: any = ref([]);
173
+const tableLoading = ref(false);
174
+const searchList: any = ref({
175
+  gameDeptId: [],
176
+  warehouseDeptId: [],
177
+  dmUpcode1List: [],
178
+  dmUpname2: "",
179
+  provinceSiteIdList: [],
180
+  storageState: "",
181
+  maintenanceCount: null
182
+});
183
+const mergeObj: any = ref({});
184
+const cityList: any = ref([]);
185
+const warehouseList: any = ref([]);
186
+const suppliesList: any = ref([]);
187
+const provinceList: any = ref([]);
188
+
189
+const { userInfo } = useGetters(["userInfo"]);
190
+const props = defineProps({
191
+  payload: {
192
+    type: Array,
193
+    default: () => []
194
+  },
195
+  fileName: {
196
+    type: String,
197
+    default: ""
198
+  }
199
+});
200
+
201
+if (userInfo.value.deptType === "1") {
202
+  // 获取垂管局列表
203
+  getCityList({ deptType: 2 }).then((res: any) => {
204
+    if (res.code === 0) {
205
+      cityList.value = res.data;
206
+      // searchList.value.gameDeptId = [cityList.value[0].deptId];
207
+      getSupplies(searchList.value.gameDeptId);
208
+      getList();
209
+    }
210
+  });
211
+} else {
212
+  // 获取储备仓库
213
+  let postData = {
214
+    parentIdList: [userInfo.value.deptId],
215
+    warehouseType: props.fileName.substr(0, 2) == "救灾" ? 200 : 100
216
+  };
217
+  getCityList(postData).then((res: any) => {
218
+    if (res.code === 0) {
219
+      warehouseList.value = res.data;
220
+      searchList.value.warehouseDeptId =
221
+        warehouseList.value && warehouseList.value.length > 0 ? [warehouseList.value[0].deptId] : [];
222
+      getList();
223
+    }
224
+  });
225
+}
226
+
227
+// 根据省份列表获取储备仓库
228
+const getSupplies = (value: string) => {
229
+  let postData = {
230
+    parentIdList: value,
231
+    warehouseType: props.fileName.substr(0, 2) == "救灾" ? 200 : 100
232
+  };
233
+  getCityList(postData).then((res: any) => {
234
+    if (res.code === 0) {
235
+      warehouseList.value = res.data;
236
+    }
237
+  });
238
+};
239
+let Bgcolor = ref("");
240
+const handlerColor = (type: string, State: string) => {
241
+  Bgcolor.value = type;
242
+  searchList.value.storageState = State;
243
+  getList();
244
+};
245
+
246
+// 获取物资类别
247
+getSysTreeDict({ type: 1, difference: 2, parentCodeList: props.payload }).then((res: any) => {
248
+  if (res.code === 0) {
249
+    suppliesList.value = res.data;
250
+  }
251
+});
252
+// 获取省份
253
+getSysTreeDict({ type: 2, difference: 1 }).then((res: any) => {
254
+  if (res.code === 0) {
255
+    provinceList.value = res.data;
256
+  }
257
+});
258
+
259
+const clearSearch = () => {
260
+  searchList.value = {
261
+    gameDeptId: [],
262
+    warehouseDeptId: [],
263
+    dmUpcode1List: [],
264
+    dmUpname2: "",
265
+    provinceSiteIdList: [],
266
+    storageState: ""
267
+  };
268
+  Bgcolor.value = "";
269
+  getList();
270
+};
271
+
272
+// 获取表格数据
273
+const getList = () => {
274
+  const data = {
275
+    dmUpcode0List: props.payload,
276
+    ...searchList.value,
277
+    isMaintenance: true
278
+  };
279
+  tableLoading.value = true;
280
+  getDetailList(data).then((res: any) => {
281
+    if (res.code === 0) {
282
+      tableData.value = res.data.filter((item: any) => {
283
+        if (item.gameName === null && item.totalPrice === null) {
284
+          item.unitPrice = "总价值";
285
+          return item;
286
+        } else if (item.totalPrice === null) {
287
+          item.unitPrice = "合计";
288
+          return item;
289
+        } else {
290
+          return item;
291
+        }
292
+      });
293
+      getSpanArr(tableData.value);
294
+    }
295
+  });
296
+};
297
+
298
+const arraySpanMethod = ({ row, column, rowIndex, columnIndex }: any) => {
299
+  if (userInfo.value.deptType === "3") {
300
+    const firstHidden = [2, 3, 4, 5, 6, 7, 8];
301
+    const secondHidden = [3, 4, 5, 6, 7, 8];
302
+    if (rowIndex === 0) {
303
+      if (columnIndex === 1) {
304
+        return [1, 8];
305
+      } else if (firstHidden.includes(columnIndex)) {
306
+        return [0, 0];
307
+      }
308
+    } else if (row.unitPrice === "合计") {
309
+      if (columnIndex === 2) {
310
+        return [1, 7];
311
+      } else if (secondHidden.includes(columnIndex)) {
312
+        return [0, 0];
313
+      }
314
+    }
315
+  } else {
316
+    const firstHidden = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
317
+    const secondHidden = [5, 6, 7, 8, 9, 10, 11];
318
+    if (rowIndex === 0) {
319
+      if (columnIndex === 1) {
320
+        return [1, 11];
321
+      } else if (firstHidden.includes(columnIndex)) {
322
+        return [0, 0];
323
+      }
324
+    } else if (row.unitPrice === "合计") {
325
+      if (columnIndex === 4) {
326
+        return [1, 8];
327
+      } else if (secondHidden.includes(columnIndex)) {
328
+        return [0, 0];
329
+      }
330
+    }
331
+  }
332
+
333
+  const mergeCol = ["gameName", "province", "warehouseName", "materials1", "materials2"];
334
+  // 判断列的属性
335
+  if (mergeCol.indexOf(column.property) !== -1) {
336
+    // 判断其值是不是为0
337
+    if (mergeObj.value[column.property][rowIndex]) {
338
+      return [mergeObj.value[column.property][rowIndex], 1];
339
+    } else {
340
+      // 如果为0则为需要合并的行
341
+      return [0, 0];
342
+    }
343
+  }
344
+};
345
+const shunxu = [
346
+  "gameName",
347
+  "province",
348
+  "warehouseName",
349
+  "materials1",
350
+  "materials2",
351
+  "materials3",
352
+  "materials4",
353
+  "specs",
354
+  "quantity",
355
+  "inboundTime",
356
+  "years",
357
+  "unitPrice",
358
+  "totalPrice",
359
+  "remarks"
360
+];
361
+const headerName = [
362
+  "垂管局",
363
+  "省份",
364
+  "储备仓库",
365
+  "物资大类",
366
+  "物资类别",
367
+  "物资名称",
368
+  "物资单位",
369
+  "规格",
370
+  "数量",
371
+  "入库时间",
372
+  "建议年限",
373
+  "单价(元)",
374
+  "总价(万元)",
375
+  "备注"
376
+];
377
+// const downloadExcel = () => {
378
+//   let data: any = []
379
+//   tableData.value.forEach((item, index) => {
380
+//     let temp: any = [];
381
+//     shunxu.forEach((item2, index2) => {
382
+//       if (item[item2] == null){
383
+//         temp.push('');
384
+//       }else{
385
+//         temp.push(item[item2]);
386
+//       }
387
+
388
+//     })
389
+//     data.push(temp);
390
+//   })
391
+//   const exportPayload = {
392
+//     data: data,
393
+//     tableheader: [headerName],
394
+//     fileName: 'kk',
395
+//     merges: { header: [1, 4], content: [0, 4] },
396
+//     fixedCol:1
397
+//   };
398
+//   console.log(exportPayload);
399
+//   exportExcel(exportPayload);
400
+
401
+// };
402
+const downloadExcel = () => {
403
+  console.log(tableData.value);
404
+  tableData.value.forEach((item) => {
405
+    if (item.unitPrice == "合计") {
406
+      item.totalPrice = item.warehouseTotalPrice;
407
+    }
408
+  });
409
+  tableData.value[0].totalPrice = tableData.value[0].warehouseTotalPrice;
410
+  tableData.value[1].totalPrice = tableData.value[1].warehouseTotalPrice;
411
+  let data: any = [];
412
+  tableData.value.forEach((item, index) => {
413
+    let temp: any = [];
414
+    shunxu.forEach((item2, index2) => {
415
+      if (item[item2] == null || undefined) {
416
+        temp.push("");
417
+      } else {
418
+        temp.push(item[item2]);
419
+      }
420
+    });
421
+    data.push(temp);
422
+  });
423
+
424
+  const exportPayload = {
425
+    data: data,
426
+    tableheader: [headerName],
427
+    fileName: props.fileName || "*",
428
+    merges: { header: [1, 2], content: [0, 3] },
429
+    fixedCol: 1
430
+  };
431
+  exportExcel(exportPayload);
432
+};
433
+
434
+// getSpanArr方法
435
+const getSpanArr = (data: any) => {
436
+  const mergeCol = ["gameName", "province", "warehouseName", "materials1", "materials2"];
437
+  mergeCol.forEach((key: any) => {
438
+    let count = 0; // 用来记录需要合并行的起始位置
439
+    mergeObj.value[key] = []; // 记录每一列的合并信息
440
+    data.forEach((item: any, index: number) => {
441
+      // index == 0表示数据为第一行,直接 push 一个 1
442
+      if (index === 0) {
443
+        mergeObj.value[key].push(1);
444
+      } else {
445
+        // 判断当前行是否与上一行其值相等 如果相等 在 count 记录的位置其值 +1 表示当前行需要合并 并push 一个 0 作为占位
446
+        if (item[key] === data[index - 1][key]) {
447
+          mergeObj.value[key][count] += 1;
448
+          mergeObj.value[key].push(0);
449
+        } else {
450
+          // 如果当前行和上一行其值不相等
451
+          count = index; // 记录当前位置
452
+          mergeObj.value[key].push(1); // 重新push 一个 1
453
+        }
454
+      }
455
+    });
456
+  });
457
+  tableLoading.value = false;
458
+};
459
+
460
+//导出
461
+const exportTemplate = async () => {
462
+  try {
463
+    const data = {
464
+      dmUpcode0List: props.payload,
465
+      ...searchList.value,
466
+      isMaintenance: true
467
+    };
468
+    const response = await exportjzwzmxtjb(data);
469
+    exportBlob(response, props.fileName);
470
+  } catch (error) {
471
+    console.error("Error exporting Excel:", error);
472
+  }
473
+};
474
+
475
+const openDetail = (row: any, type: any) => {
476
+  console.log(row);
477
+  setQuery("/dataStatistics/DataStatisticsDetail", { id: row.maintenanceId, type: type });
478
+};
479
+
480
+const handlerChange = (value: any) => {
481
+  Bgcolor.value = "color" + value;
482
+  getList();
483
+};
484
+
485
+const cellStyle = () => {
486
+  // return "background-color: yellow !important;";
487
+};
488
+</script>
489
+<style lang="scss" scoped>
490
+::v-deep .success {
491
+  background: #fc7e6d !important;
492
+}
493
+
494
+::v-deep .danger {
495
+  background: #f7bb48 !important;
496
+}
497
+
498
+::v-deep .warning {
499
+  background: #f3f44e !important;
500
+}
501
+
502
+::v-deep .color1 {
503
+  background: rgba(201, 90, 79, 0.8) !important;
504
+}
505
+
506
+::v-deep .color2 {
507
+  background: rgba(251, 248, 156, 0.8) !important;
508
+}
509
+
510
+::v-deep .color3 {
511
+  background: rgba(215, 131, 124, 0.8) !important;
512
+}
513
+
514
+::v-deep .color4 {
515
+  background: rgba(233, 157, 66, 0.8) !important;
516
+}
517
+
518
+::v-deep .color5 {
519
+  background: rgba(247, 207, 172, 0.8) !important;
520
+}
521
+
522
+::v-deep .color6 {
523
+  background: rgba(255, 227, 187, 0.8) !important;
524
+}
525
+
526
+.font-style {
527
+  color: blue;
528
+  cursor: pointer;
529
+}
530
+</style>

+ 10 - 0
src/views/dataStatistics/floodDroughtPrecautionUpkeep/index.vue

@@ -0,0 +1,10 @@
1
+<!-- 防汛抗旱明细统计表 -->
2
+<template>
3
+  <detailedTable fileName="防汛抗旱物资维护保养统计表" :payload="['100', '200']" />
4
+</template>
5
+
6
+<script setup lang="ts">
7
+import detailedTable from "@/views/dataStatistics/components/detailedTable1.vue";
8
+</script>
9
+
10
+<style lang="scss" scoped></style>

+ 10 - 0
src/views/dataStatistics/reliefMaterialsDetailedUpkeep/index.vue

@@ -0,0 +1,10 @@
1
+<!-- 救灾物资明细统计表 -->
2
+<template>
3
+  <detailedTable fileName="救灾物资维护保养统计表" :payload="['300']" />
4
+</template>
5
+
6
+<script setup lang="ts">
7
+import detailedTable from "@/views/dataStatistics/components/detailedTable1.vue";
8
+</script>
9
+
10
+<style lang="scss" scoped></style>