From 870d0af21c83777dbbf092458659bafa24c62cf0 Mon Sep 17 00:00:00 2001 From: TiaStars Date: Wed, 13 Sep 2023 16:15:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E7=AE=A1=E7=90=86=E5=A2=9E?= =?UTF-8?q?=E5=88=A0=E6=94=B9=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 6 +- .env.production | 2 +- src/api/index.js | 5 + src/api/yingji/index.js | 52 +++ src/main.js | 3 +- src/views/components/dialog/index.vue | 335 +++++++++++++++----- src/views/components/dialogTwo/index.vue | 286 +++++++++++++++++ src/views/components/myPagination/index.vue | 22 +- src/views/yingji/enforcing.vue | 68 +++- src/views/yingji/focusEnter.vue | 14 +- src/views/yingji/home.vue | 12 +- src/views/yingji/planManage.vue | 228 ++++++++----- vue.config.js | 2 +- 13 files changed, 852 insertions(+), 183 deletions(-) create mode 100644 src/api/index.js create mode 100644 src/api/yingji/index.js create mode 100644 src/views/components/dialogTwo/index.vue diff --git a/.env.development b/.env.development index 540d8b0..bf6b280 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ ### # @Author: 张涛 # @Date: 2023-07-18 13:04:50 - # @LastEditors: 张涛 - # @LastEditTime: 2023-08-02 14:15:36 + # @LastEditors: JC9527 + # @LastEditTime: 2023-09-11 15:36:50 # @FilePath: \Mudu2PC\.env.development ### # 页面标题 @@ -13,7 +13,7 @@ ENV = 'development' # 苏州应急执法计划管理系统/开发环境 # VUE_APP_BASE_API = 'http://localhost:9028' -VUE_APP_BASE_API = 'http://221.229.220.83:9028' +VUE_APP_BASE_API = 'http://192.168.0.105:9033' # 路由懒加载 diff --git a/.env.production b/.env.production index 367f6c6..cfc4212 100644 --- a/.env.production +++ b/.env.production @@ -5,4 +5,4 @@ VUE_APP_TITLE = 苏州应急执法计划管理系统 ENV = 'production' # 苏州应急执法计划管理系统/生产环境 -VUE_APP_BASE_API = 'http://221.229.220.83:9028' +VUE_APP_BASE_API = 'http://192.168.0.105:9033' diff --git a/src/api/index.js b/src/api/index.js new file mode 100644 index 0000000..b915a55 --- /dev/null +++ b/src/api/index.js @@ -0,0 +1,5 @@ +import yingji from "./yingji/index"; + +export default { + yingji +} \ No newline at end of file diff --git a/src/api/yingji/index.js b/src/api/yingji/index.js new file mode 100644 index 0000000..5af859f --- /dev/null +++ b/src/api/yingji/index.js @@ -0,0 +1,52 @@ +/* + * @Descripttion: + * @version: + * @Author: JC9527 + * @Date: 2023-09-11 15:38:21 + * @LastEditors: JC9527 + * @LastEditTime: 2023-09-13 15:04:17 + */ +import request from '@/utils/request' + +export default { + // 行政区划 + tree(params) { + return request({ + url: "/pharmaceuticals/administrative/tree", + method: "get", + params, + }); + }, + // 导入excel + importExcel(data) { + return request({ + url: "/pharmaceuticals/bKeyEnterprise/common/importExcel", + method: "post", + data, + }); + }, + // 企业基本信息 + basicList(params) { + return request({ + url: "/pharmaceuticals/info/list", + method: "get", + params, + }) + }, + // 查看,新增,修改,删除计划管理表 get\delete 传参是params put\post 传参是data + bPlanManage(method,data = null, params = null, id){ + console.log(id) + return request({ + url: `/pharmaceuticals/bPlanManage${id ? `/${id}` : ''}`, + method, + data, + params + }); + }, + bPlanManageTwo(id){ + return request({ + url: `/pharmaceuticals/bPlanManage/${id}`, + method:'get', + }); + }, +}; \ No newline at end of file diff --git a/src/main.js b/src/main.js index c5f61e9..dde837d 100644 --- a/src/main.js +++ b/src/main.js @@ -5,7 +5,7 @@ import Cookies from "js-cookie"; import Element from "element-ui"; import "./assets/styles/element-variables.scss"; import "./assets/styles/font.css"; - +import API from "@/api/index.js"; Element.Dialog.props.closeOnClickModal.default = false; //模态框单击空白处不允许关闭 // 带有斑马纹 @@ -79,6 +79,7 @@ Vue.prototype.selectDictLabels = selectDictLabels; Vue.prototype.download = download; Vue.prototype.handleTree = handleTree; Vue.prototype.$model = modal; +Vue.prototype.$api = API; // 全局组件挂载 Vue.component("DictTag", DictTag); diff --git a/src/views/components/dialog/index.vue b/src/views/components/dialog/index.vue index e3470c7..cbf8d88 100644 --- a/src/views/components/dialog/index.vue +++ b/src/views/components/dialog/index.vue @@ -29,17 +29,16 @@
-
+ + + +
+
行业类型:
+ + + +
重大危险源等级:
- +
企业分色:
- +
-
- +
+
+ +
+
+
搜索
+
导入
+
-
搜索
-
导入
-
+
- - + --> - + - +
@@ -180,7 +197,7 @@
计划年份:
- + + + +
计划标题:
@@ -204,7 +230,7 @@
计划内容:
this.form[key]='') + Object.keys(this.form2).forEach(key=>this.form2[key]='') + this.pages.pageNum = 1; + this.pages.pageSize = 10; + this.selected = 0; + // this.getTable(this.pages); + if(item == 'newsuccess') { + this.$emit('close') + } + }, + // 点击修改进入的请求 + async getList(item){ + let data = await this.$api.yingji.bPlanManageTwo(item.id) + this.selected = data.data.list.length; + let { plannedYear, planName, planContent, remark } = data.data; + this.form2.plannedYear = plannedYear; + this.form2.planName = planName; + this.form2.planContent = planContent; + this.form2.remark = remark; + let arr = data.data.list + this.multipleSelection = data.data.list; + arr.forEach((list)=>{ + this.$nextTick(()=>{ + this.$refs.multipleTable.toggleRowSelection(list) + }) + }) + }, + // 查看/切换页码时的网络请求 + async getTable(pages){ + this.loading = true; + let data = await this.$api.yingji.basicList(pages); + + this.total = data.data.total; + if(data.code == 200) { + this.loading = false; + } + this.tableData = data.data.list; }, // 页码,当前页切换事件 pagesChange(pages) { - console.log(pages); + this.getTable(pages); + this.pages = pages; }, // 选中的数据 handleSelectionChange(val) { this.multipleSelection = val; this.selected = this.multipleSelection.length; + // console.log(val) + console.log(this.multipleSelection) + }, + // 计算当前时间 + getData(){ + var myDate = new Date; + var year = myDate.getFullYear(); //获取当前年var mon = myDate.getMonth() + 1; //获取当前月 + var mon = myDate.getMonth() + 1 < 10 ? '0' + (myDate.getMonth() + 1) : myDate.getMonth() + 1 == 0 ? '00' : myDate.getMonth() + 1; + var date = myDate.getDate() < 10 ? '0' + myDate.getDate() : myDate.getDate(); //获取当前日 + var hours = myDate.getHours() < 10 ? '0' + myDate.getHours() : myDate.getHours(); //获取当前小时 + var minutes = myDate.getMinutes() < 10 ? '0' + myDate.getMinutes() : myDate.getMinutes(); //获取当前分钟 + var seconds = myDate.getSeconds() < 10 ? '0' + myDate.getSeconds() : myDate.getSeconds(); //获取当前秒var now = year + "_" + mon + "_" + date + " "+ hours + ":" + minutes + ":" + seconds; + var now = year + "-" + mon + "-" + date + " "+ hours + ":" + minutes + ":" + seconds; + return now; }, // 下一步 - next() { + async next() { if (this.$refs.next.innerText == "下一步") { this.nextStep = true; this.nextText = "发布计划"; } else { - console.log(form2); - // console.log('该发布计划了') + // console.log(this.form2); + console.log(this.multipleSelection); + let arr = []; + let arr2 = []; + let keyCount = 0; + this.multipleSelection.map((item)=>{ + arr.push(item.subdistrict); + arr2.push(item.uscCode); + if(item.isPoint == '1') { + keyCount++; + } + }) + let district = arr.join(','); + let enterpriseId = arr2.join(','); + let createTime = this.getData(); + let planNumb = this.multipleSelection.length + let obj = {...this.form2,district,enterpriseId,createTime,keyCount,planNumb} + let data + if(this.isamend) { + data = await this.$api.yingji.bPlanManage('put',obj) + if(data.code == 200){ + this.$message({ + message: '修改成功', + type: 'success' + }); + this.Close('newsuccess'); + } + } else { + data = await this.$api.yingji.bPlanManage('post',obj) + if(data.code == 200){ + this.$message({ + message: '新增成功', + type: 'success' + }); + this.Close('newsuccess'); + } + } } }, + // 区划级联选择器选择触发 + handleChange(value){ + console.log(value) + }, tableRowClassName({ row, rowIndex }) { if (rowIndex % 2 !== 0) { return "success-row"; } return ""; }, + commentData(item){ + if(item instanceof Array) { + item.map((item)=>{ + if(item.children instanceof Array && item.children.length == 0){ + delete item.children; + } else { + this.commentData(item.children) + } + }) + } + this.optionstwo = item + } }, + async mounted(){ + let data = await this.$api.yingji.tree(); + this.commentData(data.data) + } }; diff --git a/src/views/components/myPagination/index.vue b/src/views/components/myPagination/index.vue index a8cba02..9bfe050 100644 --- a/src/views/components/myPagination/index.vue +++ b/src/views/components/myPagination/index.vue @@ -12,9 +12,9 @@ >共{{ total }}条,显示{{ total == 0 ? "0" - : current == 1 + : pageNum == 1 ? "1" - : size * (current - 1) + 1 + : pageSize * (pageNum - 1) + 1 }}-{{ numberMap() }}条
@@ -35,8 +35,8 @@ export default { data() { return { - current:1, - size:10, + pageNum:1, + pageSize:10, } }, props:{ @@ -47,14 +47,14 @@ export default { }, methods:{ currentChange(e) { - this.current = e; - this.$emit('pagesChange',{size:this.size,current:e}) + this.pageNum = e; + this.$emit('pagesChange',{pageSize:this.pageSize,pageNum:e}) }, // 每页显示数改变 sizeChange(e) { - this.size = e; - this.current = 1; - this.$emit('pagesChange',{size:e,current:this.current}) + this.pageSize = e; + this.pageNum = 1; + this.$emit('pagesChange',{pageSize:e,pageNum:this.pageNum}) }, //算数 numberMap() { diff --git a/src/views/yingji/enforcing.vue b/src/views/yingji/enforcing.vue index 7671e90..fe39708 100644 --- a/src/views/yingji/enforcing.vue +++ b/src/views/yingji/enforcing.vue @@ -4,7 +4,7 @@ * @Author: JC9527 * @Date: 2023-09-04 10:20:06 * @LastEditors: JC9527 - * @LastEditTime: 2023-09-06 11:07:37 + * @LastEditTime: 2023-09-11 16:42:05 -->