zhangtao
laozt 1 year ago
parent c786ba0a10
commit f6ca223ce0

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询计划企业列表
export function listEnterprise(query) {
return request({
url: '/pharmaceuticals/bPlanEnterprise/list',
method: 'get',
params: query
})
}
// 查询计划企业详细
export function getEnterprise(id) {
return request({
url: '/system/enterprise/' + id,
method: 'get'
})
}
// 新增计划企业
export function addEnterprise(data) {
return request({
url: '/system/enterprise',
method: 'post',
data: data
})
}
// 修改计划企业
export function updateEnterprise(data) {
return request({
url: '/system/enterprise',
method: 'put',
data: data
})
}
// 删除计划企业
export function delEnterprise(id) {
return request({
url: '/system/enterprise/' + id,
method: 'delete'
})
}

@ -59,17 +59,20 @@
label="企业名称"
align="center"
prop="enterpriseName"
width="200"
show-overflow-tooltip
/>
<el-table-column
prop="enterpriseId"
label="统一社会信用代码"
width="200"
header-align="center"
>
</el-table-column>
<el-table-column
prop="district"
label="行政区划"
width="230"
width="130"
header-align="center"
show-overflow-tooltip
>
@ -371,6 +374,7 @@ export default {
font-size: 15px;
font-family: Alibaba PuHuiTi;
border-radius: 2px;
border: none;
}
.btn-reset {
@ -379,6 +383,7 @@ export default {
font-size: 15px;
font-family: Alibaba PuHuiTi;
border-radius: 2px;
border: none;
}
}
.tables {

@ -3,109 +3,147 @@
* @version:
* @Author: JC9527
* @Date: 2023-09-04 10:20:06
* @LastEditors: 张涛
* @LastEditTime: 2023-10-20 09:25:30
* @LastEditors: laozt 2721205210@qq.com
* @LastEditTime: 2023-12-15 09:41:44
-->
<template>
<div class="plan-management">
<div class="plan-topBox">
<div class="drup-downs">
<div class="year">
<div class="year-span">年月:</div>
<el-date-picker
v-model="form.plannedYear"
type="month"
format="yyyy-MM"
:clearable="false"
value-format="yyyy-MM"
placeholder="请选择年月"
<div class="search-box">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
>
</el-date-picker>
</div>
<div class="area">
<div class="area-span" style="width: 85px">企业名称:</div>
<el-form-item label="年份" prop="plannedYear">
<el-input
v-model="form.enterpriseName"
size="small"
v-model="queryParams.plannedYear"
placeholder="请选择年份"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="月份" prop="plannedMonth">
<el-input
v-model="queryParams.plannedMonth"
placeholder="请选择月份"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="企业名称" prop="enterpriseName">
<el-input
v-model="queryParams.enterpriseName"
placeholder="请输入企业名称"
></el-input>
</div>
<div class="area">
<div class="area-span">行政区划:</div>
<executive @quhua="quhua" @quhuadizhi="quhuadizhi" ref="executive" />
</div>
<div class="select-btn reset" @click="reset"></div>
</div>
<div class="btns">
<div class="export" @click="exportFile">
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="行政区划" prop="district">
<el-input
v-model="queryParams.district"
placeholder="请选择行政区划"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="执法层级" prop="lawHierarchy">
<el-input
v-model="queryParams.lawHierarchy"
placeholder="请输入执法层级"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否省重点" prop="isPoint">
<el-radio-group v-model="queryParams.isPoint">
<el-radio label="">全部</el-radio>
<el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="queryParams.status">
<el-radio :label="1">正式</el-radio>
<el-radio :label="0">草稿</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button class="btn-search" size="mini" @click="handleQuery"
>搜索</el-button
>
<el-button class="btn-reset" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<div class="btn-group">
<div class="export" @click="handleExport">
<img src="@/assets/images/export.png" alt="" />
<span>导出excel</span>
</div>
<div class="newProject" @click="newProject">
<div class="newProject" @click="handleAdd">
<img src="@/assets/images/newProject.png" alt="" />
<span>新增计划</span>
</div>
</div>
</div>
<div class="plan-bottomBox">
<div class="tables">
<div class="plan-tables">
<el-table
:data="tableData"
:border="false"
:height="484"
v-loading="loading"
:data="enterpriseList"
:border="false"
tooltip-effect="light"
@selection-change="handleSelectionChange"
row-key="id"
:row-class-name="tableRowClassName"
>
<el-table-column
prop="plannedYear"
label="计划年月"
width="180"
header-align="center"
/>
<el-table-column
prop="district"
label="行政区划"
show-overflow-tooltip
width="180"
header-align="center"
>
<el-table-column label="计划年份" align="center" prop="plannedYear">
<template slot-scope="scope">
<span>
{{ scope.row.plannedYear }}-{{ scope.row.plannedMonth }}
</span>
</template>
</el-table-column>
<el-table-column label="行政区划" align="center" prop="district">
<template slot-scope="scope">
<span>{{ componendDistrict(scope.row.district) || "/" }}</span>
</template>
</el-table-column>
<el-table-column
prop="enterpriseName"
label="企业名称"
header-align="center"
align="center"
prop="enterpriseName"
/>
<el-table-column
prop="createTime"
label="创建时间"
header-align="center"
>
<el-table-column label="是否省重点" align="center" prop="isPoint">
<template slot-scope="scope">
<span>{{ scope.row.isPoint == 1 ? "是" : "否" }}</span>
</template>
</el-table-column>
<el-table-column label="执法地区" align="center" prop="lawAreas" />
<el-table-column label="执法级别" align="center" prop="lawLevel" />
<el-table-column label="执法层级" align="center" prop="lawHierarchy" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<span>{{
scope.row.createTime
? scope.row.createTime.split(" ")[0]
: scope.row.createTime
}}</span>
<span>{{ scope.row.isPoint == 1 ? "正式" : "草稿" }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="250" header-align="center">
<template slot-scope="scope">
<div class="tabs-btns">
<div class="look" @click="look(scope.row)">
<div class="look" @click="handleInfo(scope.row)">
<img src="@/assets/images/look.png" alt="" />
<span>查看</span>
</div>
<div class="change" @click="change(scope.row)">
<div class="change" @click="handleUpdate(scope.row)">
<img src="@/assets/images/change.png" alt="" />
<span>修改</span>
</div>
<div class="delete" @click="deleteItem(scope.row)">
<div class="delete" @click="handleDelete(scope.row)">
<img src="@/assets/images/delete.png" alt="" />
<span>删除</span>
</div>
@ -113,112 +151,186 @@
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination">
<my-pagination
<pagination
v-show="total > 0"
:total="total"
@pagesChange="pagesChange"
ref="mypagination"
></my-pagination>
</div>
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<my-dialog ref="myDialog" v-on:close="padlockOne"></my-dialog>
<my-dialogtwo ref="myDialogTwo"></my-dialogtwo>
<temp-dialog ref="tempDialog" v-on:close="padlock"></temp-dialog>
<!-- 发布计划 -->
<add-dialog ref="addDialog" v-on:close="padlockOne" />
</div>
</template>
<script>
import myPagination from "@/views/components/myPagination/index.vue";
import myDialog from "@/views/components/dialog/index.vue";
import myDialogtwo from "@/views/components/dialogTwo/index.vue";
import tempDialog from "@/views/components/tempDialog/index.vue";
import { Loading } from "element-ui";
import {
listEnterprise,
getEnterprise,
delEnterprise,
addEnterprise,
updateEnterprise,
} from "@/api/yingji/enterprise";
import AddDialog from "@/views/components/dialog/index.vue";
import { mapState } from "vuex";
import executive from "./echarts/executive.vue";
export default {
components: { myPagination, myDialog, myDialogtwo, tempDialog, executive },
components: { AddDialog },
data() {
return {
optionsyear: [],
options: [],
myDistrict: [],
form: {
district: [],
plannedYear: "",
enterpriseName: "",
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
enterpriseList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
enterpriseId: null,
createId: null,
updateId: null,
userId: null,
deptId: null,
district: null,
plannedYear: null,
isPoint: "",
enterpriseName: null,
lawSort: null,
lawAreas: null,
lawLevel: null,
lawHierarchy: null,
plannedMonth: null,
status: 1,
checkStatus: null,
checkId: null,
checkAgeing: null,
},
district: [],
mydistrict: "",
props: {
value: "subdistrict",
label: "institutionName",
checkStrictly: true,
//
form: {},
//
rules: {},
};
},
tableData: [],
pages: {
pageSize: 10,
pageNum: 1,
methods: {
/** 查询计划企业列表 */
getList() {
this.loading = true;
listEnterprise(this.queryParams).then((response) => {
this.enterpriseList = response.data;
this.total = response.data.length;
this.loading = false;
});
},
total: 0,
loading: false,
disabled: false,
//
isExpandAll: true,
//
refreshTable: true,
county: false,
multipleSelection: [],
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
enterpriseId: null,
createId: null,
createBy: null,
createTime: null,
updateId: null,
updateBy: null,
updateTime: null,
remark: null,
userId: null,
deptId: null,
district: null,
plannedYear: null,
isPoint: null,
enterpriseName: null,
lawSort: null,
lawAreas: null,
lawLevel: null,
lawHierarchy: null,
plannedMonth: null,
status: null,
checkStatus: null,
checkId: null,
checkAgeing: null,
};
this.resetForm("form");
},
computed: {
...mapState({
dept: (state) => state.user.dept,
}),
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
watch: {
form: {
handler(newForm) {
this.pages.pageNum = 1;
this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages();
let obj;
// console.log(newForm, "newForm");
//
if (!this.disabled) {
if (Array.isArray(newForm.district)) {
if (newForm.district.length == 2) {
this.district = this.form.district[1].slice(0, 10);
obj = { ...this.pages, ...this.form, district: this.district };
} else if (newForm.district.length == 1) {
this.district = this.form.district[0].slice(0, 7);
obj = { ...this.pages, ...this.form, district: this.district };
} else {
obj = { ...this.pages, ...this.form };
}
//
} else {
//
if (this.county) {
this.district = this.form.district.slice(0, 7);
obj = { ...this.pages, ...this.form, district: this.district };
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.$refs.addDialog.openDialog("newlyIncreased", this.dept);
},
/** 详情按钮操作 */ handleInfo() {},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getEnterprise(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改计划企业";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateEnterprise(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.district = this.form.district.slice(0, 10);
obj = { ...this.pages, ...this.form, district: this.district };
}
addEnterprise(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
} else {
//
this.district = this.form.district;
obj = { ...this.pages, ...this.form, district: this.district };
}
// console.log(obj,'obj')
this.getList(obj);
},
deep: true,
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除计划企业编号为"' + ids + '"的数据项?')
.then(function () {
return delEnterprise(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
methods: {
quhua(e) {
this.form.district = e;
},
@ -228,36 +340,23 @@ export default {
},
//
componendDistrict(district) {
// console.log(district)
// console.log(this.myDistrict)
let name;
this.myDistrict.map((item) => {
if (item.county == district) {
name = item.institutionName;
let fullName;
let treeData = JSON.parse(localStorage.getItem("TREE_DATA"));
treeData.map((item) => {
if (item.districtCode == district) {
fullName = item.district;
} else {
item.children.map((itemTwo) => {
if (itemTwo.subdistrict == district) {
name = item.institutionName + "-" + itemTwo.institutionName;
if (itemTwo.countyCode == district) {
fullName = item.district + "-" + itemTwo.county;
}
});
}
});
return name;
},
//
pagesChange(pages) {
// console.log('123123')
this.pages = pages;
let district;
this.getList({ ...pages, ...this.form, district: this.district });
},
//
handleSelectionChange(val) {
//
this.multipleSelection = val;
return fullName;
},
//
exportFile() {
handleExport() {
// this.multipleSelection.length > 0 ? `` :
this.$confirm(`确认根据您的搜索条件导出搜索之后的数据吗?`, "警告", {
confirmButtonText: "确定",
@ -276,247 +375,23 @@ export default {
})
.catch(() => {});
},
//
newProject() {
this.$refs.myDialog.openDialog("newlyIncreased", this.dept);
},
//
reset() {
// let obj
this.district = [];
if (this.dept.ancestors.split(",").length == 1) {
this.form = {
plannedYear: "",
district: "",
enterpriseName: "",
};
// obj = this.pages
} else {
let { district } = this.form;
this.form.plannedYear = "";
this.form.enterpriseName = "";
this.form.district = this.mydistrict;
// obj = {...this.pages,district}
}
// this.getList(obj)
},
// dialog
padlock() {
// let { district} = this.form;
this.pages.pageNum = 1;
this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages();
let obj;
if (!this.disabled) {
if (Array.isArray(this.form.district)) {
if (this.form.district.length == 2) {
let district = this.form.district[1].slice(0, 10);
obj = { ...this.pages, ...this.form, district };
} else if (this.form.district.length == 1) {
let district = this.form.district[0].slice(0, 7);
obj = { ...this.pages, ...this.form, district };
} else {
obj = { ...this.pages, ...this.form };
}
//
} else {
//
if (this.county) {
let district = this.form.district.slice(0, 7);
obj = { ...this.pages, ...this.form, district };
} else {
let district = this.form.district.slice(0, 10);
obj = { ...this.pages, ...this.form, district };
}
}
} else {
//
let district = this.form.district;
obj = { ...this.pages, ...this.form, district };
}
// console.log('obj',obj)
this.getList(obj);
},
// dialog
padlockOne() {
this.pages.pageNum = 1;
this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages();
let obj;
if (!this.disabled) {
if (Array.isArray(this.form.district)) {
if (this.form.district.length == 2) {
let district = this.form.district[1].slice(0, 10);
obj = { ...this.pages, ...this.form, district };
} else if (this.form.district.length == 1) {
let district = this.form.district[0].slice(0, 7);
obj = { ...this.pages, ...this.form, district };
} else {
obj = { ...this.pages, ...this.form };
}
//
} else {
//
if (this.county) {
let district = this.form.district.slice(0, 7);
obj = { ...this.pages, ...this.form, district };
} else {
let district = this.form.district.slice(0, 10);
obj = { ...this.pages, ...this.form, district };
}
}
} else {
//
let district = this.form.district;
obj = { ...this.pages, ...this.form, district };
}
// console.log('obj',obj)
this.getList(obj);
// if (this.dept.ancestors.split(",").length == 1) {
// if (this.form.district.length == 0 || this.form.plannedYear == "") {
// this.getList(this.pages);
// } else {
// this.form.district = [];
// this.form.plannedYear = "";
// }
// } else {
// if (
// this.form.district == this.mydistrict ||
// this.form.plannedYear == ""
// ) {
// this.getList(this.pages);
// } else {
// this.form.district = this.mydistrict;
// this.form.plannedYear = "";
// }
// }
},
//
handleChange(value) {},
//
look(row) {
this.$refs.tempDialog.open(row, 2);
},
//
change(row) {
this.$refs.tempDialog.open(row, 1);
},
//
deleteItem(row) {
let idList = [];
idList.push(row.id);
this.$modal
.confirm("你确认要删除该条数据吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
this.loading = true;
try {
let downloadLoadingInstance = Loading.service({
text: "正在删除计划,请稍候",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
let data = await this.$api.yingji.bPlanEnterprise("delete", _, {
idList: idList.join(","),
});
if (data.code == 200) {
this.loading = false;
downloadLoadingInstance.close();
this.$message({
message: "删除成功",
type: "success",
});
// let { district} = this.form;
let district;
if (this.dept.ancestors.split(",").length == 2) {
district = this.form.district.slice(0, 7);
} else if (this.dept.ancestors.split(",").length == 3) {
district = this.form.district;
} else {
if (this.form.district.length == 1) {
district = this.form.district.slice(0, 7);
} else {
district = this.form.district;
}
}
let obj = { ...this.pages, district };
this.getList(obj);
}
} catch (error) {
downloadLoadingInstance.close();
console.log(error);
}
})
.catch(() => {
console.log("取消删除");
});
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
return "success-row";
}
return "";
},
// list
async getList(pages) {
this.loading = true;
let res = await this.$api.yingji.planmx(pages);
if (res.code == 200) {
this.loading = false;
this.tableData = res.data.list;
this.total = res.data.total;
}
},
// commentData(item, dept) {
// item.map((item) => {
// item.children.map((itemTwo) => {
// if (itemTwo.children.length == 0) {
// delete itemTwo.children;
// }
// itemTwo.county = itemTwo.subdistrict;
// });
// });
// // }
// this.options = item;
// if (dept.ancestors.split(",").length == 2) {
// this.options = this.options.filter((item) => {
// return item.institutionName == dept.deptName;
// });
// this.options.map((item) => {
// if (item.institutionName == dept.deptName) {
// this.form.district = item.subdistrict;
// this.mydistrict = item.subdistrict;
// this.county = true;
// }
// });
// } else if (dept.ancestors.split(",").length == 3) {
// this.options.map((item) => {
// item.children.map((itemTwo) => {
// if (itemTwo.institutionName == dept.deptName) {
// this.form.district = itemTwo.subdistrict;
// this.mydistrict = itemTwo.subdistrict;
// this.county = false;
// }
// });
// });
// this.disabled = true;
// }
// },
computed: {
...mapState({
dept: (state) => state.user.dept,
}),
},
async created() {
// let data = await this.$api.yingji.tree();
// this.myDistrict = data.data;
created() {
let treeData = JSON.parse(localStorage.getItem("TREE_DATA"));
this.myDistrict = treeData;
// this.commentData(treeData, this.dept);
// if (this.dept.ancestors.split(",").length == 1) {
// this.getList(this.pages);
// }
this.getList();
},
};
</script>
@ -525,142 +400,17 @@ export default {
padding: 0 20px;
background-color: #fff;
height: 100%;
.plan-topBox {
.search-box {
display: flex;
justify-content: space-between;
padding: 31px 0 12px 0;
// background-color: yellow;
.drup-downs {
display: flex;
align-items: center;
flex: 1;
.year {
display: flex;
align-items: center;
// margin-right: 200px;
.year-span {
font-size: 14px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #525966;
line-height: 40px;
margin-right: 10px;
}
}
.area {
display: flex;
align-items: center;
// justify-content: center;
// flex: 1;
.area-span {
margin-left: 10px;
font-size: 14px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #525966;
line-height: 40px;
margin-right: 10px;
}
::v-deep .el-cascader {
background-color: transparent;
width: 180px;
.el-input__inner {
height: 33px;
}
.el-input
.el-input__suffix
.el-input__suffix-inner
.el-icon-arrow-down::before {
content: "";
background: url(../../assets/images/down2.png) center center
no-repeat;
background-size: cover;
position: absolute;
width: 10px;
height: 7px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
position: relative;
}
}
}
::v-deep .el-select {
background-color: transparent;
width: 276px;
.el-input__inner {
height: 33px;
}
.el-input .el-input__suffix .el-input__suffix-inner .el-icon-arrow-up {
display: flex;
align-items: center;
justify-content: center;
}
// border-radius: 2px;
.el-input
.el-input__suffix
.el-input__suffix-inner
.el-icon-arrow-up::before {
content: "";
background: url(../../assets/images/down2.png) center center no-repeat;
background-size: cover;
position: absolute;
width: 10px;
height: 7px;
// top: 50%;
// left: 50%;
// transform: translate(-50%, -50%);
transform: rotate(180deg);
}
}
.select-btn {
width: 120px;
height: 34px;
border-radius: 2px;
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
font-family: "Alibaba PuHuiTi";
font-weight: 500;
color: #ffffff;
cursor: pointer;
background: #fdab5b;
margin-left: 20px;
}
}
.btns {
display: flex;
align-items: center;
.export,
.newProject {
display: flex;
align-items: center;
justify-content: center;
padding: 6px 19px;
cursor: pointer;
img {
width: 22px;
margin-right: 10px;
}
span {
color: #ffffff;
font-size: 14px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
}
}
.export {
background-color: #2378ec;
margin-right: 30px;
}
.newProject {
background-color: #28b384;
}
}
}
.plan-bottomBox {
.plan-tables {
margin-top: 10px;
.tables {
::v-deep .el-table {
.success-row {
background-color: rgba(234, 242, 253, 0.25);
@ -719,9 +469,56 @@ export default {
}
}
}
.pagination {
margin-top: 40px;
.btn-group {
display: flex;
align-items: center;
position: absolute;
bottom: 30px;
right: 0;
.export,
.newProject {
display: flex;
align-items: center;
justify-content: center;
padding: 6px 19px;
cursor: pointer;
img {
width: 22px;
margin-right: 10px;
}
span {
color: #ffffff;
font-size: 14px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
}
}
.export {
background-color: #2378ec;
margin-right: 30px;
}
.newProject {
background-color: #28b384;
}
}
.btn-search {
background: #2378ec;
color: #ffffff;
font-size: 15px;
font-family: Alibaba PuHuiTi;
border-radius: 2px;
border: none;
}
.btn-reset {
background: #fdab5b;
color: #ffffff;
font-size: 15px;
font-family: Alibaba PuHuiTi;
border-radius: 2px;
border: none;
}
}
</style>

Loading…
Cancel
Save