浏览代码

Merge branch 'sxw-skeleton' of http://101.36.160.140:21044/emergency-report/report-vue into sxw-skeleton

sunxuewei 1 年之前
父节点
当前提交
6c40654504

+ 2 - 42
src/api/basicInfo/index.ts

@@ -23,51 +23,11 @@ export function deptDetail(deptId: string) {
23 23
   });
24 24
 }
25 25
 
26
-
27
-// 添加数据
28
-export function addInData(data: any) {
29
-  return request({
30
-    url: `/admin/in`,
31
-    method: "post",
32
-    data
33
-  });
34
-}
35
-
36 26
 // 修改数据
37
-export function updateInData(data: any) {
27
+export function updateDept(data: any) {
38 28
   return request({
39
-    url: `/admin/in`,
29
+    url: `/admin/dept`,
40 30
     method: "put",
41 31
     data
42 32
   });
43 33
 }
44
-// 删除数据
45
-export function deleteInData(id: string) {
46
-  return request({
47
-    url: `/admin/in/${id}`,
48
-    method: "delete"
49
-  });
50
-}
51
-// 查看数据
52
-export function lookInData(id: string) {
53
-  return request({
54
-    url: `/admin/in/indound/${id}`,
55
-    method: "get"
56
-  });
57
-}
58
-
59
-// 物资类别
60
-export function dictTree(data: any) {
61
-  return request({
62
-    url: `/admin/sys/dict/tree/1`,
63
-    method: "get",
64
-    params: data
65
-  });
66
-}
67
-// 预览
68
-export function sysFile(filePart: string) {
69
-  return request({
70
-    url: `/admin/sysFile/${filePart}`,
71
-    method: "get"
72
-  });
73
-}

+ 19 - 0
src/api/home/index.ts

@@ -0,0 +1,19 @@
1
+import request from "@/api";
2
+
3
+// 库区列表
4
+export function kuList(data: any) {
5
+  return request({
6
+    url: "/admin/out/material/page",
7
+    params: { size: data.size, current: data.current },
8
+    method: "GET"
9
+  });
10
+}
11
+
12
+// 统计数据
13
+export function statistics() {
14
+  return request({
15
+    url: "/admin/out/aduicount",
16
+    method: "GET"
17
+  });
18
+}
19
+

+ 2 - 1
src/api/inAndOut/formationFilling/in.ts

@@ -53,6 +53,7 @@ export function dictTree(data: any) {
53 53
 export function sysFile(filePart: string) {
54 54
   return request({
55 55
     url: `/admin/sysFile/${filePart}`,
56
-    method: "get"
56
+    method: "get",
57
+    responseType: 'blob'
57 58
   });
58 59
 }

+ 5 - 5
src/views/InformationAudit/enterWarehouseAudit/index.vue

@@ -70,8 +70,8 @@
70 70
           >
71 71
           <el-button
72 72
             v-if="
73
-              (deptId == '9' && scope.row.status == '3') ||
74
-              (deptId == '10' && (scope.row.status == '2' || scope.row.status == '6'))
73
+              (deptType == '1' && scope.row.status == '3') ||
74
+              (deptType == '2' && (scope.row.status == '2' || scope.row.status == '6'))
75 75
             "
76 76
             link
77 77
             type="primary"
@@ -106,7 +106,7 @@ const { indound_type, auditing_status } = useDict("indound_type", "auditing_stat
106 106
 const router = useRouter();
107 107
 const data = reactive({
108 108
   tableData: [],
109
-  deptId: ""
109
+  deptType: ""
110 110
 });
111 111
 let page = reactive({
112 112
   currentPage: 1,
@@ -120,7 +120,7 @@ let formData = reactive({
120 120
   status: ""
121 121
 });
122 122
 
123
-let { tableData, deptId } = toRefs(data);
123
+let { tableData, deptType } = toRefs(data);
124 124
 
125 125
 // 获取列表
126 126
 const getList = () => {
@@ -182,7 +182,7 @@ const handleShow = (row: any) => {
182 182
 onMounted(() => {
183 183
   getList();
184 184
   let deptObj: any = sessionStorage.getItem("userInfo");
185
-  deptId = deptObj ? JSON.parse(deptObj).deptId : "";
185
+  deptType = deptObj ? JSON.parse(deptObj).deptType : "";
186 186
 });
187 187
 </script>
188 188
 

+ 5 - 5
src/views/InformationAudit/outWarehouseAudit/index.vue

@@ -66,8 +66,8 @@
66 66
           <el-button link type="success" size="small" style="margin-left:30px" @click="handleShow(scope.row)">查看</el-button>
67 67
           <el-button
68 68
             v-if="
69
-              (deptId == '9' && scope.row.status == '3') ||
70
-              (deptId == '10' && (scope.row.status == '2' || scope.row.status == '6'))
69
+              (deptType == '1' && scope.row.status == '3') ||
70
+              (deptType == '2' && (scope.row.status == '2' || scope.row.status == '6'))
71 71
             "
72 72
             link
73 73
             type="primary"
@@ -107,7 +107,7 @@ const { outdound_type, is_available, province_ch, auditing_status } = useDict(
107 107
 const router = useRouter();
108 108
 const data = reactive({
109 109
   tableData: [],
110
-  deptId: ""
110
+  deptType: ""
111 111
 });
112 112
 let page = reactive({
113 113
   currentPage: 1,
@@ -120,7 +120,7 @@ let formData = reactive({
120 120
   status: ""
121 121
 });
122 122
 
123
-let { tableData, deptId } = toRefs(data);
123
+let { tableData, deptType } = toRefs(data);
124 124
 
125 125
 // 获取列表
126 126
 const getList = () => {
@@ -182,7 +182,7 @@ const handleShow = (row: any) => {
182 182
 onMounted(() => {
183 183
   getList();
184 184
   let deptObj: any = sessionStorage.getItem("userInfo");
185
-  deptId = deptObj ? JSON.parse(deptObj).deptId : "";
185
+  deptType = deptObj ? JSON.parse(deptObj).deptType : "";
186 186
 });
187 187
 </script>
188 188
 

+ 6 - 10
src/views/InformationFilling/enterWarehouseInfo/detail.vue

@@ -122,10 +122,11 @@ import { addInData, updateInData, lookInData, dictTree, sysFile } from "@/api/in
122 122
 import { useDict } from '@/hooks/dict';
123 123
 // import { closeTagAndOpenLastTag } from '@/router/Routermethods';
124 124
 import store from "@/store";
125
-
125
+import { getQuery } from '@/hooks/detailQuery/index';
126 126
 const { indound_type, is_available, province_ch } = useDict('indound_type', 'is_available', 'province_ch');
127 127
 
128
-const props = defineProps(['id','type'])
128
+// const props = defineProps(['id','type'])
129
+const props = getQuery("/InformationFilling/enterWarehouseInfoDetail")
129 130
 // 价值计算带万
130 131
 const wanJson = ['118', '122', '124', '132', '182', '184']
131 132
 
@@ -249,15 +250,10 @@ const handleRemove = (file: any, uploadFiles: any) => {
249 250
   console.log(file, uploadFiles);
250 251
 };
251 252
 const handlePreview = (uploadFile: any) => {
252
-  console.log(uploadFile);
253 253
   sysFile(uploadFile.filePart).then((res: any) => {
254
-    if (res.code === 0) {
255
-      returnPage()
256
-      ElMessage({
257
-        message: "修改成功!",
258
-        type: "success"
259
-      });
260
-    }
254
+      const blob = new Blob([res], { type: "application/pdf;charset=UTF-8" });
255
+      const bFile = URL.createObjectURL(blob);
256
+      window.open(bFile);
261 257
   });
262 258
 };
263 259
 const handleExceed = (files: any, uploadFiles: any) => {

+ 6 - 4
src/views/InformationFilling/enterWarehouseInfo/index.vue

@@ -74,6 +74,7 @@ import { getInPage, deleteInData } from "@/api/inAndOut/formationFilling/in";
74 74
 import router from "@/router";
75 75
 import { ElMessage } from "element-plus";
76 76
 import { useDict } from '@/hooks/dict';
77
+import { setQuery } from '@/hooks/detailQuery/index';
77 78
 
78 79
 const { indound_type, is_available, auditing_status } = useDict('indound_type', 'is_available', 'auditing_status');
79 80
 
@@ -105,10 +106,11 @@ const clearSearch = () => {
105 106
 };
106 107
 /** 添加/修改/查看进入详情操作 */
107 108
 const openDetail = (row: any, type) => {
108
-  router.push({
109
-    path: "/InformationFilling/enterWarehouseInfoDetail",
110
-    query: {id: row.inboundId, type: type}
111
-  });
109
+  setQuery("/InformationFilling/enterWarehouseInfoDetail", {id: row.inboundId, type: type})
110
+  // router.push({
111
+  //   path: "/InformationFilling/enterWarehouseInfoDetail",
112
+  //   query: {id: row.inboundId, type: type}
113
+  // });
112 114
 };
113 115
 /** 列表数据获取 */
114 116
 const getList = () => {

+ 6 - 8
src/views/InformationFilling/outIssue/detail.vue

@@ -135,12 +135,14 @@ import router from "@/router";
135 135
 import { addOutData, updateOutData, lookOutData, dictTree, getDeptTypeList } from "@/api/inAndOut/formationFilling/out";
136 136
 import { sysFile } from "@/api/inAndOut/formationFilling/in";
137 137
 import { useDict } from '@/hooks/dict';
138
+import { getQuery } from '@/hooks/detailQuery/index';
138 139
 // import { closeTagAndOpenLastTag } from '@/router/Routermethods';
139 140
 import store from "@/store";
140 141
 
141 142
 const { outdound_type, is_available, province_ch } = useDict('outdound_type', 'is_available', 'province_ch');
142 143
 
143
-const props = defineProps(['id','type'])
144
+// const props = defineProps(['id','type'])
145
+const props = getQuery("/InformationFilling/outIssueDetail")
144 146
 // 价值计算带万
145 147
 const wanJson = ['118', '122', '124', '132', '182', '184']
146 148
 
@@ -287,13 +289,9 @@ const handleRemove = (file: any, uploadFiles: any) => {
287 289
 const handlePreview = (uploadFile: any) => {
288 290
   console.log(uploadFile);
289 291
   sysFile(uploadFile.filePart).then((res: any) => {
290
-    if (res.code === 0) {
291
-      returnPage()
292
-      ElMessage({
293
-        message: "修改成功!",
294
-        type: "success"
295
-      });
296
-    }
292
+    const blob = new Blob([res], { type: "application/pdf;charset=UTF-8" });
293
+    const bFile = URL.createObjectURL(blob);
294
+    window.open(bFile);
297 295
   });
298 296
 };
299 297
 const handleExceed = (files: any, uploadFiles: any) => {

+ 7 - 5
src/views/InformationFilling/outIssue/index.vue

@@ -42,8 +42,8 @@
42 42
           {{scope.row.calledProvince ? showCh(scope.row.calledProvince, province_ch) : scope.row.calledProvince}}
43 43
         </template>
44 44
       </el-table-column>
45
+      <el-table-column prop="submitTime" label="出库日期" align="center" width="115" />
45 46
       <el-table-column prop="outboundTime" label="填写时间" align="center" width="115" />
46
-      <el-table-column prop="submitTime" label="提交时间" align="center" width="115" />
47 47
       <el-table-column fixed="right" label="操作" width="150" align="center">
48 48
         <template #default="{ row }">
49 49
           <el-button link type="success" size="small" @click="openDetail(row, 'look')">查看</el-button>
@@ -69,6 +69,7 @@ import { getOutPage, deleteOutData } from "@/api/inAndOut/formationFilling/out";
69 69
 import router from "@/router";
70 70
 import { ElMessage } from "element-plus";
71 71
 import { useDict } from '@/hooks/dict';
72
+import { setQuery } from '@/hooks/detailQuery/index';
72 73
 
73 74
 const { outdound_type, is_available, province_ch, auditing_status } = useDict('outdound_type', 'is_available', 'province_ch', 'auditing_status');
74 75
 
@@ -101,10 +102,11 @@ const clearSearch = () => {
101 102
 };
102 103
 /** 添加/修改/查看进入详情操作 */
103 104
 const openDetail = (row: any, type) => {
104
-  router.push({
105
-    path: "/InformationFilling/outIssueDetail",
106
-    query: {id: row.outboundId, type: type}
107
-  });
105
+  setQuery("/InformationFilling/outIssueDetail", {id: row.outboundId, type: type})
106
+  // router.push({
107
+  //   path: "/InformationFilling/outIssueDetail",
108
+  //   query: {id: row.outboundId, type: type}
109
+  // });
108 110
 };
109 111
 /** 列表数据获取 */
110 112
 const getList = () => {

+ 6 - 8
src/views/InformationFilling/outWarehouseInfo/detail.vue

@@ -129,12 +129,14 @@ import router from "@/router";
129 129
 import { addOutData, updateOutData, lookOutData, dictTree } from "@/api/inAndOut/formationFilling/out";
130 130
 import { sysFile } from "@/api/inAndOut/formationFilling/in";
131 131
 import { useDict } from '@/hooks/dict';
132
+import { getQuery } from '@/hooks/detailQuery/index';
132 133
 // import { closeTagAndOpenLastTag } from '@/router/Routermethods';
133 134
 import store from "@/store";
134 135
 
135 136
 const { outdound_type, is_available, province_ch } = useDict('outdound_type', 'is_available', 'province_ch');
136 137
 
137
-const props = defineProps(['id','type'])
138
+// const props = defineProps(['id','type'])
139
+const props = getQuery("/InformationFilling/outWarehouseInfoDetail")
138 140
 // 价值计算带万
139 141
 const wanJson = ['118', '122', '124', '132', '182', '184']
140 142
 
@@ -264,13 +266,9 @@ const handleRemove = (file: any, uploadFiles: any) => {
264 266
 const handlePreview = (uploadFile: any) => {
265 267
   console.log(uploadFile);
266 268
   sysFile(uploadFile.filePart).then((res: any) => {
267
-    if (res.code === 0) {
268
-      returnPage()
269
-      ElMessage({
270
-        message: "修改成功!",
271
-        type: "success"
272
-      });
273
-    }
269
+    const blob = new Blob([res], { type: "application/pdf;charset=UTF-8" });
270
+    const bFile = URL.createObjectURL(blob);
271
+    window.open(bFile);
274 272
   });
275 273
 };
276 274
 const handleExceed = (files: any, uploadFiles: any) => {

+ 6 - 4
src/views/InformationFilling/outWarehouseInfo/index.vue

@@ -79,6 +79,7 @@ import { getOutPage, deleteOutData } from "@/api/inAndOut/formationFilling/out";
79 79
 import router from "@/router";
80 80
 import { ElMessage } from "element-plus";
81 81
 import { useDict } from '@/hooks/dict';
82
+import { setQuery } from '@/hooks/detailQuery/index';
82 83
 
83 84
 const { outdound_type, is_available, province_ch, auditing_status } = useDict('outdound_type', 'is_available', 'province_ch', 'auditing_status');
84 85
 
@@ -111,10 +112,11 @@ const clearSearch = () => {
111 112
 };
112 113
 /** 添加/修改/查看进入详情操作 */
113 114
 const openDetail = (row: any, type) => {
114
-  router.push({
115
-    path: "/InformationFilling/outWarehouseInfoDetail",
116
-    query: {id: row.outboundId, type: type}
117
-  });
115
+  setQuery("/InformationFilling/outWarehouseInfoDetail", {id: row.outboundId, type: type})
116
+  // router.push({
117
+  //   path: "/InformationFilling/outWarehouseInfoDetail",
118
+  //   query: {id: row.outboundId, type: type}
119
+  // });
118 120
 };
119 121
 /** 列表数据获取 */
120 122
 const getList = () => {

+ 1 - 1
src/views/admin/dict/index.vue

@@ -23,7 +23,7 @@
23 23
     </el-form>
24 24
     <div>
25 25
       <el-row style="margin-bottom: 10px">
26
-        <el-button type="primary" :icon="Plus" @click="addOrUpdateHandle(false)">增</el-button>
26
+        <el-button type="primary" :icon="Plus" @click="addOrUpdateHandle(false)">增</el-button>
27 27
         <!-- <el-button type="primary" :icon="RefreshLeft" @click="addOrUpdateHandle(0)">缓存</el-button> -->
28 28
       </el-row>
29 29
       <el-table v-loading="tableLoading" border :data="tableData" row-key="id">

+ 1 - 1
src/views/admin/role/index.vue

@@ -28,7 +28,7 @@
28 28
     </el-form>
29 29
     <div>
30 30
       <el-row style="margin-bottom: 10px">
31
-        <el-button type="primary" :icon="EditPen" @click="addOrUpdateHandle(0)">添加</el-button>
31
+        <el-button type="primary" :icon="Plus" @click="addOrUpdateHandle(0)">新增</el-button>
32 32
         <!-- <el-button type="primary" :icon="UploadFilled">导入</el-button>
33 33
         <el-button type="primary" :icon="Download">导出</el-button> -->
34 34
       </el-row>

+ 105 - 38
src/views/basic/basicIndex/index.vue

@@ -30,26 +30,24 @@
30 30
         </el-col>
31 31
         <el-col :span="12">
32 32
           <el-form-item label="管理机构" prop="gljg">
33
-            <el-input v-model="ruleForm.gljg" />
33
+            <el-input v-model="gljg" disabled />
34 34
           </el-form-item>
35 35
         </el-col>
36
-        <el-col :span="24">
37
-          <el-form-item label="地址" prop="name">
38
-            <el-col :span="12">
36
+        <el-col :span="12">
37
+          <el-form-item label="地址" prop="deptMergeAddress">
39 38
               <el-cascader
40 39
                 clearable
41
-                size="small"
42
-                v-model="ruleForm.name"
40
+                v-model="ruleForm.deptMergeAddress"
43 41
                 placeholder="请选择"
44 42
                 :options="addressOption"
45
-                :props="{ value: 'code', label: 'name' }"
43
+                :props="{ value: 'code',label: 'name' }"
46 44
                 style="width: 100%"
47
-                @change="handleChange"
48
-              ></el-cascader>
49
-            </el-col>
50
-            <el-col :span="12">
51
-              <el-input v-model="ruleForm.deptAddress" />
52
-            </el-col>
45
+                @change="handleChange"></el-cascader>
46
+          </el-form-item>
47
+        </el-col>
48
+        <el-col :span="12">
49
+          <el-form-item label=" " prop="deptAddress" label-width="1">
50
+            <el-input v-model="ruleForm.deptAddress" />
53 51
           </el-form-item>
54 52
         </el-col>
55 53
         <el-col :span="12">
@@ -73,7 +71,7 @@
73 71
               :on-success="handleAvatarSuccess"
74 72
               :before-upload="beforeAvatarUpload"
75 73
             >
76
-              <img v-if="imageUrl" :src="imageUrl" class="avatar" />
74
+              <img v-if="ruleForm.reservoirImg" :src="ruleForm.reservoirImg" class="avatar" />
77 75
               <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
78 76
             </el-upload>
79 77
           </el-form-item>
@@ -91,25 +89,78 @@
91 89
 import { reactive, ref } from "vue";
92 90
 import type { FormInstance, FormRules } from "element-plus";
93 91
 import { Plus } from "@element-plus/icons-vue";
94
-import { getAddress, deptDetail } from "@/api/basicInfo/index";
92
+import { getAddress, deptDetail, updateDept } from "@/api/basicInfo/index";
95 93
 import type { UploadProps } from "element-plus";
96 94
 import { useDict } from "@/hooks/dict";
97 95
 const { warehouse_type } = useDict("warehouse_type");
96
+import { ElMessage } from "element-plus";
97
+import { sysFile } from "@/api/inAndOut/formationFilling/in";
98 98
 
99
-//附件部分
100
-const myHeader = { Authorization: "Bearer " + sessionStorage.getItem("access_token") };
101
-const fileUrl = "/admin/sysFile/uploadVoucher";
102
-let paramsData = reactive({
103
-  bucket: "bound"
104
-});
105 99
 const formSize = ref("default");
106 100
 const ruleFormRef = ref<FormInstance>();
107
-const ruleForm = ref({});
108
-
101
+const ruleForm = ref({
102
+  name: '',
103
+  abbreviationName: '',
104
+  warehouseType: '',
105
+  deptMergeAddress: [],
106
+  deptAddress: '',
107
+  legalPerson: '',
108
+  deptPhone: '',
109
+  reservoirImg: '',
110
+});
111
+const fileName = ref("")
112
+const gljg = ref("")
113
+const rules = reactive({
114
+  name: [
115
+    { required: true, message: '请填写,不能为空', trigger: 'blur' }
116
+  ],
117
+  warehouseType: [
118
+    {
119
+      required: true,
120
+      message: '请选择,不能为空',
121
+      trigger: 'change',
122
+    },
123
+  ],
124
+  deptMergeAddress: [
125
+    {
126
+      required: true,
127
+      message: '请选择,不能为空',
128
+      trigger: 'change',
129
+    },
130
+  ],
131
+  legalPerson: [
132
+    { required: true, message: '请填写,不能为空', trigger: 'blur' }
133
+  ],
134
+  deptPhone: [
135
+    { required: true, message: '请填写,不能为空', trigger: 'blur' }
136
+  ],
137
+  reservoirImg: [
138
+    { required: true, message: '请填写,不能为空', trigger: 'blur' }
139
+  ]
140
+})
141
+//提交方法
109 142
 const submitForm = async (formEl: FormInstance | undefined) => {
110 143
   if (!formEl) return;
111 144
   await formEl.validate((valid, fields) => {
112 145
     if (valid) {
146
+      let postData = {
147
+        ...ruleForm.value,
148
+        deptProvince : ruleForm.value.deptMergeAddress[0],
149
+        deptCity : ruleForm.value.deptMergeAddress[1],
150
+        deptArea : ruleForm.value.deptMergeAddress[2],
151
+        deptMergeAddress : JSON.stringify(ruleForm.value.deptMergeAddress),
152
+        warehouseType: JSON.stringify(ruleForm.value.warehouseType),
153
+        reservoirImg: fileName.value
154
+      }
155
+      console.log(postData)
156
+      updateDept(postData).then((res: any) => {
157
+        if (res.code === 0) {
158
+          ElMessage({
159
+            message: "修改成功!",
160
+            type: "success"
161
+          });
162
+        }
163
+      });
113 164
       console.log("submit!");
114 165
     } else {
115 166
       console.log("error submit!", fields);
@@ -117,49 +168,65 @@ const submitForm = async (formEl: FormInstance | undefined) => {
117 168
   });
118 169
 };
119 170
 const addressOption = ref([]);
120
-const createdMth = async () => {
171
+const getOption = () => {
121 172
   getAddress().then((res: any) => {
122 173
     if (res.code === 0) {
123 174
       addressOption.value = res.data;
124 175
     }
125 176
   });
177
+}
178
+const createdMth = async () => {
126 179
   const deptId = JSON.parse(sessionStorage.getItem("userInfo")).deptId;
127 180
   let deptData = await deptDetail(deptId);
128 181
   ruleForm.value = deptData.data;
182
+  handlePreview(ruleForm.value.reservoirImg)
129 183
   if (deptData.data.parentId != "0") {
130 184
     let parentDept = await deptDetail(deptData.data.parentId);
131
-    ruleForm.value.gljg = parentDept.data.abbreviationName;
185
+    ruleForm.value.warehouseType = JSON.parse(deptData.data.warehouseType)
186
+    ruleForm.value.deptMergeAddress = JSON.parse(deptData.data.deptMergeAddress)
187
+    gljg.value = parentDept.data.abbreviationName;
132 188
   }
133 189
 };
190
+getOption();
134 191
 createdMth();
192
+const handlePreview = (filePart) => {
193
+  sysFile(filePart).then((res: any) => {
194
+    const blob = new Blob([res], { type: 'image/png' });
195
+    const bFile = URL.createObjectURL(blob);
196
+    fileName.value = filePart
197
+    ruleForm.value.reservoirImg = bFile;
198
+  });
199
+};
135 200
 const handleChange = (value) => {
136 201
   console.log(JSON.stringify(value));
137 202
 };
138 203
 const resetForm = (formEl: FormInstance | undefined) => {
139 204
   if (!formEl) return;
140 205
   formEl.resetFields();
206
+  createdMth();
141 207
 };
142 208
 
143
-const options = Array.from({ length: 10000 }).map((_, idx) => ({
144
-  value: `${idx + 1}`,
145
-  label: `${idx + 1}`
146
-}));
147 209
 
148 210
 /*----------------------库区图-----------------*/
149
-const imageUrl = ref("");
211
+//附件部分
212
+const myHeader = { Authorization: "Bearer " + sessionStorage.getItem("access_token") };
213
+const fileUrl = "/admin/sysFile/uploadVoucher";
214
+let paramsData = reactive({
215
+  bucket: "bound"
216
+});
150 217
 
151 218
 const handleAvatarSuccess: UploadProps["onSuccess"] = (response, uploadFile) => {
152
-  imageUrl.value = URL.createObjectURL(uploadFile.raw!);
219
+  handlePreview(response.data.fileName)
153 220
 };
154 221
 
155 222
 const beforeAvatarUpload: UploadProps["beforeUpload"] = (rawFile) => {
156
-  if (rawFile.type !== "image/jpeg") {
157
-    ElMessage.error("Avatar picture must be JPG format!");
158
-    return false;
159
-  } else if (rawFile.size / 1024 / 1024 > 2) {
160
-    ElMessage.error("Avatar picture size can not exceed 2MB!");
161
-    return false;
162
-  }
223
+  // if (rawFile.type !== "image/jpeg") {
224
+  //   ElMessage.error("Avatar picture must be JPG format!");
225
+  //   return false;
226
+  // } else if (rawFile.size / 1024 / 1024 > 2) {
227
+  //   ElMessage.error("Avatar picture size can not exceed 2MB!");
228
+  //   return false;
229
+  // }
163 230
   return true;
164 231
 };
165 232
 </script>

+ 202 - 0
src/views/home/components/gjj.vue

@@ -0,0 +1,202 @@
1
+<template>
2
+  <div class="container">
3
+    <el-card>
4
+      <!-- <template #header>
5
+        <div class="card-header">
6
+          <span>首页-国家局</span>
7
+        </div>
8
+      </template> -->
9
+      <div class="card_home">
10
+        <div class="card_title">
11
+          <div class="card_icon">
12
+            <el-icon size="30px" color="white">
13
+              <Stamp />
14
+            </el-icon>
15
+            <span>出入库审核</span>
16
+          </div>
17
+        </div>
18
+        <div class="card_content">
19
+          <div class="card_content_item">
20
+            <div class="content_left">
21
+              <div class="num">{{ formData.outaudi }}</div>
22
+              <div class="title">出库信息审核</div>
23
+            </div>
24
+            <div class="content_right"></div>
25
+          </div>
26
+          <div class="card_content_item card_content_right">
27
+            <div class="content_left">
28
+              <div class="num">{{ formData.inaudi }}</div>
29
+              <div class="title">入库信息审核</div>
30
+            </div>
31
+            <div class="content_right"></div>
32
+          </div>
33
+        </div>
34
+      </div>
35
+      <div class="card_home">
36
+        <div class="card_title">
37
+          <div class="card_icon">
38
+            <el-icon size="30px" color="white">
39
+              <TrendCharts />
40
+            </el-icon>
41
+            <span>统计</span>
42
+          </div>
43
+        </div>
44
+        <div class="card_content">
45
+          <div class="card_content_item">
46
+            <div class="content_left">
47
+              <div class="num">{{ formData.warecount }}</div>
48
+              <div class="title">库点总数</div>
49
+            </div>
50
+            <div class="content_right"></div>
51
+          </div>
52
+          <div class="card_content_item card_content_right" v-if="0"></div>
53
+        </div>
54
+      </div>
55
+    </el-card>
56
+  </div>
57
+</template>
58
+
59
+<script setup lang="ts">
60
+import { statistics } from "@/api/home/index";
61
+import { reactive, toRefs, onMounted } from "vue";
62
+import { Stamp, TrendCharts } from "@element-plus/icons-vue";
63
+
64
+const data = reactive({
65
+  deptId: ""
66
+});
67
+const formData = reactive({
68
+  inaudi: "",
69
+  outaudi: "",
70
+  warecount: ""
71
+});
72
+
73
+let { deptId } = toRefs(data);
74
+
75
+// 获取统计数据
76
+const getStatistics = () => {
77
+  statistics().then((res: any) => {
78
+    if (res.code === 0) {
79
+      formData.inaudi = res.data.inaudi;
80
+      formData.outaudi = res.data.outaudi;
81
+      formData.warecount = res.data.warecount;
82
+    }
83
+  });
84
+};
85
+
86
+onMounted(() => {
87
+  getStatistics();
88
+});
89
+</script>
90
+
91
+<style lang="scss" scoped>
92
+.container{
93
+  width: 100%;
94
+  height: 100%;
95
+}
96
+:deep(.el-card) {
97
+  width: 100%;
98
+  height: 100%;
99
+  .card-header {
100
+    height: 60px;
101
+    font-size: 30px;
102
+    line-height: 60px;
103
+    font-weight: bolder;
104
+  }
105
+  .el-card__body {
106
+    height: 100%;
107
+  }
108
+}
109
+.card_home {
110
+  width: 100%;
111
+  height: 40%;
112
+  // background: pink;
113
+  padding-bottom: 40px;
114
+  .card_title {
115
+    width: 100%;
116
+    height: 50px;
117
+    margin-bottom: 20px;
118
+    .card_icon {
119
+      width: 200px;
120
+      height: 50px;
121
+      // line-height: 50px;
122
+      // border-radius: 15px;
123
+      // background: #53acfe;
124
+      margin: auto;
125
+      background-image: linear-gradient(to right, #4a6efd, #55beff);
126
+      color: #ffffff;
127
+      font-weight: 900;
128
+      text-align: center;
129
+      position: relative;
130
+      display: flex;
131
+      justify-content: space-around;
132
+      align-items: center;
133
+      box-sizing: border-box;
134
+      padding: 0 20px;
135
+      span{
136
+        font-size: 19px;
137
+        display: inline-block;
138
+        width: 95px;
139
+      }
140
+    }
141
+    .card_icon::before {
142
+      content: "";
143
+      display: inline-block;
144
+      width: 30px;
145
+      height: 30px;
146
+      background: #4a6efd;
147
+      position: absolute;
148
+      left: -15px;
149
+      top: 10px;
150
+      transform: rotate(45deg) skew(10deg, 10deg);
151
+    }
152
+    .card_icon::after {
153
+      content: "";
154
+      display: inline-block;
155
+      width: 30px;
156
+      height: 30px;
157
+      background: #55beff;
158
+      position: absolute;
159
+      right: -15px;
160
+      top: 10px;
161
+      transform: rotate(45deg) skew(10deg, 10deg);
162
+    }
163
+  }
164
+  .card_content {
165
+    width: 100%;
166
+    display: flex;
167
+    justify-content: space-between;
168
+    box-sizing: border-box;
169
+    padding: 0 8%;
170
+    .card_content_item {
171
+      width: 40%;
172
+      height: 160px;
173
+      background: #e9f6fe;
174
+      border-radius: 20px;
175
+      display: flex;
176
+      justify-content: space-between;
177
+      .content_left {
178
+        width: 30%;
179
+        height: 100%;
180
+        display: flex;
181
+        flex-direction: column;
182
+        justify-content: center;
183
+        align-items: center;
184
+        .num {
185
+          font-size: 46px;
186
+          font-weight: 900;
187
+          font-family: "黑体";
188
+          margin-bottom: 10px;
189
+        }
190
+        .title {
191
+          font-weight: 700;
192
+          font-size: 20px;
193
+          color: #666666;
194
+        }
195
+      }
196
+    }
197
+    .card_content_right {
198
+      background: #e9feea;
199
+    }
200
+  }
201
+}
202
+</style>

+ 151 - 0
src/views/home/components/kq.vue

@@ -0,0 +1,151 @@
1
+<template>
2
+  <div class="container">
3
+    <el-card>
4
+      <template #header>
5
+        <div class="card-header">
6
+          <span>消息通知</span>
7
+        </div>
8
+      </template>
9
+      <div class="content_item">
10
+        <el-scrollbar height="65vh">
11
+          <el-table :data="tableData" style="width: 100%">
12
+            <el-table-column prop="outboundType" label="出库类型" min-width="200" header-align="center" align="center">
13
+              <template #default="scope">
14
+                {{ scope.row.outboundType ? showCh(scope.row.outboundType, outdound_type) : scope.row.outboundType }}
15
+              </template>
16
+            </el-table-column>
17
+            <el-table-column prop="materialGroup" label="物资名称" min-width="300" header-align="center" align="center">
18
+              <template #default="scope">
19
+                {{
20
+                  (scope.row.materialGroup ? scope.row.materialGroup : "") +
21
+                  " / " +
22
+                  (scope.row.materialType ? scope.row.materialType : "") +
23
+                  " / " +
24
+                  (scope.row.materialName ? scope.row.materialName : "") +
25
+                  " / " +
26
+                  (scope.row.unit ? scope.row.unit : "")
27
+                }}
28
+              </template>
29
+            </el-table-column>
30
+            <el-table-column prop="specs" label="规格" min-width="200" header-align="center" align="center" />
31
+            <el-table-column prop="quantity" label="数量" min-width="200" header-align="center" align="center" />
32
+            <el-table-column prop="province" label="调用省份" min-width="200" header-align="center" align="center">
33
+              <template #default="scope">
34
+                {{ scope.row.province ? showCh(scope.row.province, province_ch) : scope.row.province }}
35
+              </template>
36
+            </el-table-column>
37
+            <el-table-column
38
+              prop="outboundTime"
39
+              label="出库日期"
40
+              min-width="200"
41
+              header-align="center"
42
+              align="center"
43
+            />
44
+          </el-table>
45
+          <pagination
46
+            v-show="page.total > 0"
47
+            v-model:page="page.currentPage"
48
+            v-model:limit="page.pageSize"
49
+            :total="page.total"
50
+            layout="->,total, sizes, prev, pager, next, jumper"
51
+            @pagination="getList"
52
+          />
53
+        </el-scrollbar>
54
+      </div>
55
+    </el-card>
56
+  </div>
57
+</template>
58
+
59
+<script setup lang="ts">
60
+import { kuList } from "@/api/home/index";
61
+import { ref, reactive, toRefs, onMounted } from "vue";
62
+import { useDict } from "@/hooks/dict";
63
+
64
+const { outdound_type, province_ch } = useDict("outdound_type", "province_ch");
65
+
66
+const data = reactive({
67
+  tableData: []
68
+});
69
+let page = reactive({
70
+  currentPage: 1,
71
+  pageSize: 10,
72
+  total: 0
73
+});
74
+
75
+let { tableData } = toRefs(data);
76
+
77
+// const list = ref([
78
+//   {
79
+//     content: "信息",
80
+//     overTime: "时间"
81
+//   },
82
+//   {
83
+//     content: "关于调拨出库的通知....",
84
+//     overTime: "2024-03-11"
85
+//   },
86
+//   {
87
+//     content: "关于调拨出库的通知....",
88
+//     overTime: "2024-03-11"
89
+//   },
90
+//   {
91
+//     content: "关于调拨出库的通知....",
92
+//     overTime: "2024-03-11"
93
+//   },
94
+//   {
95
+//     content: "关于调拨出库的通知....",
96
+//     overTime: "2024-03-11"
97
+//   }
98
+// ]);
99
+
100
+// 获取统计数据
101
+const getList = () => {
102
+  const data = reactive({
103
+    size: page.pageSize,
104
+    current: page.currentPage
105
+  });
106
+  kuList(data).then((res: any) => {
107
+    if (res.code === 0) {
108
+      tableData.value = res.data.records;
109
+      page.total = res.data.total;
110
+    }
111
+  });
112
+};
113
+
114
+// 根据码回显中文
115
+const showCh = (value: any, option: any) => {
116
+  const filterItem = option.filter((item: any) => item.value == value);
117
+  return filterItem.length ? filterItem[0].label : "-";
118
+};
119
+onMounted(() => {
120
+  getList();
121
+});
122
+</script>
123
+
124
+<style lang="scss" scoped>
125
+.container {
126
+  width: 100%;
127
+  height: 100%;
128
+}
129
+:deep(.el-card) {
130
+  width: 100%;
131
+  height: 100%;
132
+  .card-header {
133
+    height: 20px;
134
+    font-size: 18px;
135
+    line-height: 20px;
136
+    // font-weight: bolder;
137
+  }
138
+  .el-card__body {
139
+    height: 100%;
140
+    // display: flex;
141
+    // flex-direction: column;
142
+    // align-items: center;
143
+    // padding-top: 100px;
144
+    // font-size: 20px;
145
+    .content_item {
146
+      width: 100%;
147
+      height: 100%;
148
+    }
149
+  }
150
+}
151
+</style>

+ 17 - 67
src/views/home/index.vue

@@ -1,78 +1,28 @@
1 1
 <template>
2 2
   <basic-container>
3
-    <el-card>
4
-      <template #header>
5
-        <div class="card-header">
6
-          <span>首页</span>
7
-        </div>
8
-      </template>
9
-      <template v-for="item in list" :key="item">
10
-        <div class="content_item">
11
-          <div>{{ item.content }}</div>
12
-          <div>{{ item.overTime }}</div>
13
-        </div>
14
-      </template>
15
-    </el-card>
3
+    <Kq v-if="deptType =='3'"></Kq>
4
+    <Gjj v-if="deptType =='1' || deptType =='2'"></Gjj>
16 5
   </basic-container>
17 6
 </template>
18 7
 
19 8
 <script setup lang="ts">
20
-import { ref } from "vue";
9
+import { ref, reactive, toRefs, onMounted } from "vue";
10
+import Kq from '@/views/home/components/kq.vue';
11
+import Gjj from '@/views/home/components/gjj.vue';
21 12
 
22
-const list = ref([
23
-  {
24
-    content: "信息",
25
-    overTime: "时间"
26
-  },
27
-  {
28
-    content: "关于调拨出库的通知....",
29
-    overTime: "2024-03-11"
30
-  },
31
-  {
32
-    content: "关于调拨出库的通知....",
33
-    overTime: "2024-03-11"
34
-  },
35
-  {
36
-    content: "关于调拨出库的通知....",
37
-    overTime: "2024-03-11"
38
-  },
39
-  {
40
-    content: "关于调拨出库的通知....",
41
-    overTime: "2024-03-11"
42
-  }
43
-]);
13
+const data = reactive({
14
+  deptType: ""
15
+});
16
+
17
+let { deptType } = toRefs(data);
18
+
19
+
20
+  let deptObj: any = sessionStorage.getItem("userInfo");
21
+  deptType = deptObj ? JSON.parse(deptObj).deptType : "";
22
+onMounted(() => {
23
+});
44 24
 </script>
45 25
 
46 26
 <style lang="scss" scoped>
47
-:deep(.el-card) {
48
-  width: 100%;
49
-  height: 100%;
50
-  .card-header {
51
-    height: 60px;
52
-    font-size: 30px;
53
-    line-height: 60px;
54
-    font-weight: bolder;
55
-  }
56
-  .el-card__body {
57
-    height: 100%;
58
-    display: flex;
59
-    flex-direction: column;
60
-    align-items: center;
61
-    padding-top: 100px;
62
-    font-size: 20px;
63
-    .content_item {
64
-      width: 50%;
65
-      height: 80px;
66
-      display: flex;
67
-      justify-content: space-between;
68
-      &:nth-child(1) {
69
-        font-weight: bolder;
70
-      }
71
-      & > div {
72
-        min-width: 200px;
73
-        text-align: center;
74
-      }
75
-    }
76
-  }
77
-}
27
+
78 28
 </style>