计划管理增删改查

lijinlong^2
吕天方 1 year ago
parent da99fe292a
commit 31901b139a

@ -4,7 +4,7 @@
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-09-11 15:38:21 * @Date: 2023-09-11 15:38:21
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2023-09-27 12:39:14 * @LastEditTime: 2023-09-28 13:22:58
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@ -86,4 +86,5 @@ export default {
params params
}); });
}, },
}; };

@ -1,3 +1,11 @@
/*
* @Descripttion:
* @version:
* @Author: JC9527
* @Date: 2023-09-26 13:45:06
* @LastEditors: JC9527
* @LastEditTime: 2023-09-28 16:55:12
*/
import router from './router' import router from './router'
import store from './store' import store from './store'
import { Message } from 'element-ui' import { Message } from 'element-ui'
@ -19,6 +27,7 @@ router.beforeEach((to, from, next) => {
next({ path: '/' }) next({ path: '/' })
NProgress.done() NProgress.done()
} else { } else {
store.dispatch("Getdistrict");
if (store.getters.roles.length === 0) { if (store.getters.roles.length === 0) {
isRelogin.show = true isRelogin.show = true
// 判断当前用户是否已拉取完user_info信息 // 判断当前用户是否已拉取完user_info信息

@ -1,4 +1,5 @@
import { login, login2, logout, getInfo } from "@/api/login"; import { login, login2, logout, getInfo } from "@/api/login";
import { xzTree, listDist } from "@/api/yingji/keyEnterprise";
import { getToken, setToken, removeToken } from "@/utils/auth"; import { getToken, setToken, removeToken } from "@/utils/auth";
const user = { const user = {
@ -14,13 +15,17 @@ const user = {
oldRouter: [], oldRouter: [],
newRouter: [], newRouter: [],
old1: [], old1: [],
new1: [] new1: [],
district:[],
}, },
mutations: { mutations: {
setOld: (state, route) => { setOld: (state, route) => {
state.old1 = route state.old1 = route
}, },
SET_DISTRICT: (state,data) => {
state.district = data
},
setNew: (state, route) => { setNew: (state, route) => {
state.new1 = route state.new1 = route
}, },
@ -69,6 +74,19 @@ const user = {
}); });
}); });
}, },
// 获取行政区划
Getdistrict({ commit }){
return new Promise((resolve, reject) => {
xzTree()
.then((res) => {
commit("SET_DISTRICT", res.data);
resolve();
})
.catch((error) => {
reject(error);
});
});
},
// 匿名 // 匿名
login2({ commit }, userInfo) { login2({ commit }, userInfo) {
const username = userInfo.username.trim(); const username = userInfo.username.trim();

@ -1,4 +1,5 @@
<template> <template>
<div>
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:show-close="false" :show-close="false"
@ -6,7 +7,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
append-to-body append-to-body
custom-class="dialog-boxed" custom-class="dialog-boxed"
width="80%" width="85%"
> >
<div class="dialog-slot"> <div class="dialog-slot">
<div class="closeClick"> <div class="closeClick">
@ -57,10 +58,10 @@
<div class="select-span">经济类型:</div> <div class="select-span">经济类型:</div>
<el-select v-model="form.economicsType" placeholder="请选择"> <el-select v-model="form.economicsType" placeholder="请选择">
<el-option <el-option
v-for="item in optionstwo.economic_categories" v-for="item in dict.type.economic_categories"
:key="item.dictValue" :key="item.value"
:label="item.dictLabel" :label="item.label"
:value="item.dictValue" :value="item.value"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -69,10 +70,10 @@
<div class="select-span">行业类型:</div> <div class="select-span">行业类型:</div>
<el-select v-model="form.indusTypeClass" placeholder="请选择"> <el-select v-model="form.indusTypeClass" placeholder="请选择">
<el-option <el-option
v-for="(item,index) in optionstwo.category" v-for="item in dict.type.category"
:key="index" :key="item.value"
:label="item.dictLabel" :label="item.label"
:value="item.dictValue" :value="item.value"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -80,18 +81,23 @@
<div class="select-input"> <div class="select-input">
<div class="select-span">是否重点:</div> <div class="select-span">是否重点:</div>
<el-select v-model="form.isPoint" placeholder="请选择"> <el-select v-model="form.isPoint" placeholder="请选择">
<el-option label="是" value="1"></el-option> <el-option
<el-option label="否" value="2"></el-option> v-for="item in dict.type.is_point"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select> </el-select>
</div> </div>
<div class="select-input"> <div class="select-input">
<div class="select-span">重大危险源等级:</div> <div class="select-span">重大危险源等级:</div>
<el-select v-model="form.majorHazardLevel" placeholder="请选择"> <el-select v-model="form.majorHazardLevel" placeholder="请选择">
<el-option <el-option
v-for="item in optionstwo.major_hazard_level" v-for="item in dict.type.major_hazard_level"
:key="item.dictValue" :key="item.value"
:label="item.dictLabel" :label="item.label"
:value="item.dictValue" :value="item.value"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -100,10 +106,10 @@
<div class="select-span">企业分色:</div> <div class="select-span">企业分色:</div>
<el-select v-model="form.entprColor" placeholder="请选择"> <el-select v-model="form.entprColor" placeholder="请选择">
<el-option <el-option
v-for="item in optionstwo.entpr_color" v-for="item in dict.type.entpr_color"
:key="item.dictValue" :key="item.value"
:label="item.dictLabel" :label="item.label"
:value="item.dictValue" :value="item.value"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -165,22 +171,27 @@
header-align="center" header-align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div> <dict-tag
{{ :options="dict.type.category"
scope.row.indusTypeClass != "null" :value="scope.row.indusTypeClass"
? filterTable(optionstwo.category, scope.row.indusTypeClass) >
: "" </dict-tag>
}}
</div>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column <el-table-column
prop="indusTypeClass" prop="ecoTypeLarge"
label="企业类型" label="经济类型"
show-overflow-tooltip show-overflow-tooltip
header-align="center" header-align="center"
> >
</el-table-column> --> <template slot-scope="scope">
<dict-tag
:options="dict.type.economic_categories"
:value="scope.row.ecoTypeLarge"
>
</dict-tag>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="majorHazardLevel" prop="majorHazardLevel"
label="重大危险源等级" label="重大危险源等级"
@ -188,14 +199,11 @@
header-align="center" header-align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div> <dict-tag
{{ :options="dict.type.major_hazard_level"
filterTable( :value="scope.row.majorHazardLevel"
optionstwo.major_hazard_level, >
scope.row.majorHazardLevel </dict-tag>
)
}}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -205,13 +213,11 @@
header-align="center" header-align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div> <dict-tag
{{ :options="dict.type.entpr_color"
scope.row.enterColorChart != "null" :value="scope.row.enterColorChart ? scope.row.enterColorChart : '未知'"
? filterTable(optionstwo.entpr_color, scope.row.enterColorChart) >
: "" </dict-tag>
}}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -237,6 +243,16 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" header-align="center">
<template slot-scope="scope">
<div class="tabs-btns">
<div class="look" @click="look(scope.row)">
<img src="@/assets/images/lookInfo.png" alt="" />
<span>查看详情</span>
</div>
</div>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
<div class="pagination"> <div class="pagination">
@ -303,24 +319,29 @@
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
<firm-dialog ref="firmDialog"></firm-dialog>
</div>
</template> </template>
<script> <script>
import myPagination from "@/views/components/myPagination/index.vue"; import myPagination from "@/views/components/myPagination/index.vue";
import firmDialog from "@/views/components/firmDialog/index.vue";
import { Loading } from "element-ui"; import { Loading } from "element-ui";
import { mapState } from "vuex"; import { mapState } from "vuex";
export default { export default {
components: { myPagination }, dicts:['category','economic_categories','is_point','entpr_color','major_hazard_level'],
components: { myPagination,firmDialog },
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
tableData: [], tableData: [],
listOne: [], listOne: [],
myDistrict:[],
// listTwo: [], // listTwo: [],
// listThree: [], // listThree: [],
// listFour: [], // listFour: [],
// listFive: [], // listFive: [],
options:[], options:[],
optionstwo:[], // optionstwo:[],
props: { props: {
value: "county", value: "county",
label: "institutionName", label: "institutionName",
@ -376,6 +397,8 @@ export default {
computed: { computed: {
...mapState({ ...mapState({
dept: (state) => state.user.dept, dept: (state) => state.user.dept,
district: (state) => state.user.district,
// mydict: (state) => state.user.mydict,
}), }),
}, },
watch:{ watch:{
@ -398,12 +421,17 @@ export default {
if(this.$refs.next.innerText == "发布计划"){ if(this.$refs.next.innerText == "发布计划"){
this.nextStep = false; this.nextStep = false;
this.nextText = "下一步"; this.nextText = "下一步";
this.multipleSelection.map((item)=>{
this.$nextTick(() => {
this.$refs.multipleTable.toggleRowSelection(item);
});
})
} }
}, },
// //
componendDistrict(district){ componendDistrict(district){
let name let name
this.listOne.map((item)=>{ this.myDistrict.map((item)=>{
if(item.subdistrict == district) { if(item.subdistrict == district) {
name = item.institutionName name = item.institutionName
} else { } else {
@ -437,10 +465,11 @@ export default {
// } // }
this.pages.pageNum = 1; this.pages.pageNum = 1;
this.pages.pageSize = 10; this.pages.pageSize = 10;
this.$nextTick(()=>{
this.$refs.mypagination.defaultPages(); this.$refs.mypagination.defaultPages();
})
let obj let obj
// console.log(this.form.subdistrict) //
//
if(!this.disabled) { if(!this.disabled) {
if(this.form.subdistrict.length > 0){ if(this.form.subdistrict.length > 0){
if(this.form.subdistrict.length == 2) { if(this.form.subdistrict.length == 2) {
@ -456,14 +485,14 @@ export default {
obj = this.pages obj = this.pages
} }
} else { } else {
// //
if(this.dept.ancestors.split(',').length == 2) { // if(this.dept.ancestors.split(',').length == 2) {
this.subdistrict = this.form.subdistrict.slice(1, 8); // this.subdistrict = this.form.subdistrict.slice(1, 8);
obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; // obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
} else if(this.dept.ancestors.split(',').length == 3){ // } else if(this.dept.ancestors.split(',').length == 3){
this.subdistrict = this.form.subdistrict.slice(1, 11); this.subdistrict = this.form.subdistrict.slice(1, 11);
obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
} // }
} }
// obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; // obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
this.getTable(obj); this.getTable(obj);
@ -535,8 +564,7 @@ export default {
async open(item,dept) { async open(item,dept) {
this.dialogVisible = true; this.dialogVisible = true;
// this.dept = dept // this.dept = dept
let data = await this.$api.yingji.tree(); // this.commentData(this.district,dept);
this.commentData(data.data,dept);
this.bPlanEnterprise(); this.bPlanEnterprise();
this.filtrate() this.filtrate()
if (item == "newlyIncreased") { if (item == "newlyIncreased") {
@ -573,6 +601,10 @@ export default {
this.$emit("close"); this.$emit("close");
} }
}, },
//
look(row){
this.$refs.firmDialog.open(row)
},
// //
async getList(item) { async getList(item) {
let data = await this.$api.yingji.bPlanManageTwo(item.id); let data = await this.$api.yingji.bPlanManageTwo(item.id);
@ -743,19 +775,20 @@ export default {
this.commentData(item.children,dept) this.commentData(item.children,dept)
} }
}) })
this.myDistrict = item;
this.listOne = item this.listOne = item
if(dept.ancestors.split(',').length == 2) { if(dept.ancestors.split(',').length == 2) {
this.listOne = this.listOne.filter((item)=>{ this.listOne = this.listOne.filter((item)=>{
return item.institutionName == dept.deptName return item.institutionName == dept.deptName
}) })
this.listOne.map((item)=>{ // this.listOne.map((item)=>{
if(item.institutionName == dept.deptName) { // if(item.institutionName == dept.deptName) {
this.form.subdistrict = item.county // this.form.subdistrict = item.county
this.workingArea = item.county // this.workingArea = item.county
delete item.children // delete item.children
} // }
}) // })
this.disabled = true; // this.disabled = true;
} else if(dept.ancestors.split(',').length == 3) { } else if(dept.ancestors.split(',').length == 3) {
this.listOne.map((item)=>{ this.listOne.map((item)=>{
if(item.institutionName == dept.deptName) { if(item.institutionName == dept.deptName) {
@ -765,7 +798,6 @@ export default {
}) })
this.disabled = true; this.disabled = true;
} }
this.listOne = item;
}, },
}, },
async mounted() { async mounted() {
@ -777,8 +809,8 @@ export default {
// list: "major_hazard_level", // list: "major_hazard_level",
// }); // // }); //
// let listFive = await this.$api.yingji.dictdata({ list: "entpr_color" }); // // let listFive = await this.$api.yingji.dictdata({ list: "entpr_color" }); //
let dictdata = await this.$api.yingji.dictdata({ list: "economic_categories,category,major_hazard_level,entpr_color"}) // let dictdata = await this.$api.yingji.dictdata({ list: "economic_categories,category,major_hazard_level,entpr_color"})
this.optionstwo = dictdata.data; // this.optionstwo = this.mydict;
// this.listTwo = listTwo.data.economic_categories; // this.listTwo = listTwo.data.economic_categories;
// this.listThree = listThree.data.category; // this.listThree = listThree.data.category;
// this.listFour = listFour.data.major_hazard_level; // this.listFour = listFour.data.major_hazard_level;
@ -880,7 +912,7 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
padding-bottom: 10px; padding-bottom: 10px;
.select-input { .select-input {
// margin-right: 10px; margin-right: 10px;
margin-top: 20px; margin-top: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
@ -993,6 +1025,26 @@ export default {
} }
.tables { .tables {
// background-color: #eaf2fd; // background-color: #eaf2fd;
.tabs-btns {
display: flex;
align-items: center;
justify-content: center;
.look {
display: flex;
align-items: center;
cursor: pointer;
img {
width: 20px;
margin-right: 5px;
}
span {
font-size: 15px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #045ffd;
}
}
}
::v-deep .el-table { ::v-deep .el-table {
.success-row { .success-row {
background-color: rgba(234, 242, 253, 0.25); background-color: rgba(234, 242, 253, 0.25);

@ -0,0 +1,467 @@
<template>
<el-dialog
:visible.sync="addShow"
:show-close="false"
:destroy-on-close="true"
:close-on-click-modal="false"
append-to-body
custom-class="dialog-boxed"
width="60%"
>
<div class="dialog-slot">
<div class="closeClick">
<div class="newplan">
<div class="line"></div>
<div class="span">企业详情</div>
</div>
<img src="@/assets/images/close.png" alt="" @click="Close" />
</div>
<div class="content">
<div class="filtrate">
<el-descriptions :column="2" border>
<el-descriptions-item
:label="item.label"
v-for="(item, index) in listDes"
:key="index"
>
{{
item.value == "null"
? ""
: item.value == "false"
? "暂无"
: item.value
}}
</el-descriptions-item>
</el-descriptions>
</div>
</div>
</div>
</el-dialog>
</template>
<script>
export default {
data() {
return {
addShow: false,
listDes: [
{
eng: "bizAddr",
label: "生产经营地址",
value: "",
},
{
eng: "bossEmail",
label: "主要负责人电子邮箱",
value: "",
},
{
eng: "bossMobtel",
label: "主要负责人移动电话",
value: "",
},
{
eng: "bossTel",
label: "主要负责人固定电话",
value: "",
},
{
eng: "businessScope",
label: "经营范围",
value: "",
},
{
eng: "contactEmail",
label: "电子邮箱",
value: "",
},
{
eng: "contactQq",
label: "联系QQ号码",
value: "",
},
{
eng: "contactTel",
label: "企业固定电话",
value: "",
},
{
eng: "cseNum",
label: "注册安全工程师人员数量",
value: "",
},
{
eng: "doublePreven",
label: "是否开展双重预防机制",
value: "",
},
{
eng: "employeeNum",
label: "从业人员数量",
value: "",
},
{
eng: "enterColorChart",
label: "企业分色图",
value: "",
},
{
eng: "entprName",
label: "企业名称",
value: "",
},
{
eng: "entprPlaneGragh",
label: "企业平面图",
value: "",
},
{
eng: "floorArea",
label: "占地面积(㎡)",
value: "",
},
{
eng: "fullEmegNum",
label: "专职应急管理人员数量",
value: "",
},
{
eng: "fullSafety",
label: "是否有专职安全人员",
value: "",
},
{
eng: "fullSafetyNum",
label: "专职安全生产管理人员数量",
value: "",
},
{
eng: "gridCode",
label: "网格编码",
value: "",
},
{
eng: "gridEntprStatus",
label: "网格对企业的关停和恢复",
value: "",
},
{
eng: "groupCompName",
label: "集团公司名称",
value: "",
},
{
eng: "indusTypeClass",
label: "行业类别门类",
value: "",
},
{
eng: "industryRefer",
label: "工贸涉及(专项治理类别)",
value: "",
},
{
eng: "infoYear",
label: "数据年份",
value: "",
},
{
eng: "isPoint",
label: "是否重点",
value: "",
},
{
eng: "latitudeGps",
label: "纬度(度) 84",
value: "",
},
{
eng: "legalPerson",
label: "法定代表人",
value: "",
},
{
eng: "localSafetyAdmin",
label: "属地安监机构",
value: "",
},
{
eng: "longitudeGps",
label: "经度(度) 84",
value: "",
},
{
eng: "mainProduct",
label: "主要产品",
value: "",
},
{
eng: "majorHazardInstallations",
label: "是否存在重大危险源",
value: "",
},
{
eng: "majorHazardLevel",
label: "重大危险源等级",
value: "",
},
{
eng: "operatingStatus",
label: "经营状态",
value: "",
},
{
eng: "parentCompName",
label: "母公司名称",
value: "",
},
{
eng: "partSafetyNum",
label: "兼职安全生产管理人员数量",
value: "",
},
{
eng: "regAddr",
label: "注册地址",
value: "",
},
{
eng: "regCapi",
label: "注册资金(万元)",
value: "",
},
{
eng: "safetyDepart",
label: "是否有专门安全机构",
value: "",
},
{
eng: "safetyDepartDuty",
label: "安全管理机构职责",
value: "",
},
{
eng: "safetyDepartName",
label: "安全管理机构名称",
value: "",
},
{
eng: "safetyDepartNum",
label: "安全管理机构成员数量",
value: "",
},
{
eng: "safetyEmail",
label: "安全负责人电子邮箱",
value: "",
},
{
eng: "safetyManager",
label: "安全负责人",
value: "",
},
{
eng: "safetyMobtel",
label: "安全负责人移动电话",
value: "",
},
{
eng: "safetySupervisionLevel",
label: "安全监管等级",
value: "",
},
{
eng: "safetyTel",
label: "安全负责人固定电话",
value: "",
},
{
eng: "setupDate",
label: "成立日期",
value: "",
},
{
eng: "sourceData",
label: "数据来源",
value: "",
},
{
eng: "specialGovernance",
label: "专项治理类别",
value: "",
},
{
eng: "speclalOperationNum",
label: "特种作业人员数量",
value: "",
},
{
eng: "standLevel",
label: "标准化等级",
value: "",
},
{
eng: "stateOwed",
label: "是否为国有企业",
value: "",
},
{
eng: "supervisionLarge",
label: "行业监管大类",
value: "",
},
{
eng: "supervisionSmall",
label: "行业监管小类",
value: "",
},
{
eng: "uscCode",
label: "统一社会信用代码",
value: "",
},
],
}
},
methods:{
async open(option) {
this.addShow = true;
const { bizAddr,
bossEmail,
bossMobtel,
bossTel,
businessScope,
contactEmail,
contactQq,
contactTel,
cseNum,
doublePreven,
employeeNum,
enterColorChart,
entprName,
entprPlaneGragh,
floorArea,
fullEmegNum,
fullSafety,
fullSafetyNum,
gridCode,
gridEntprStatus,
groupCompName,
indusTypeClass,
industryRefer,
infoYear,
isPoint,
latitudeGps,
legalPerson,
localSafetyAdmin,
longitudeGps,
mainProduct,
majorHazardInstallations,
majorHazardLevel,
operatingStatus,
parentCompName,
partSafetyNum,
regAddr,
regCapi,
safetyDepart,
safetyDepartDuty,
safetyDepartName,
safetyDepartNum,
safetyEmail,
safetyManager,
safetyMobtel,
safetySupervisionLevel,
safetyTel,
setupDate,
sourceData,
specialGovernance,
speclalOperationNum,
standLevel,
stateOwed,
supervisionLarge,
supervisionSmall,
uscCode } = option
this.changeDescriptions(this.listDes,option)
},
Close(item) {
this.addShow = false;
},
changeDescriptions(arr,arr2){
for (let key in arr2) {
if (arr2.hasOwnProperty(key)) {
arr.map((item)=>{
if(key == item.eng){
item.value = arr2[key] || '空'
if(item.eng == 'isPoint'){
item.value = arr2[key] == '1' ? '是':arr2[key] == '2' ? '否':''
}
}
})
}
}
}
},
}
</script>
<style lang="scss" scoped>
::v-deep .el-descriptions-row th {
width: 20% !important;
font-size: 14px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
}
::v-deep .el-descriptions-row td {
width: 30% !important;
font-size: 14px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
}
.dialog-slot {
.closeClick {
position: absolute;
top: 0;
right: 0;
padding: 10px 20px;
width: 100%;
z-index: 1000;
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
background: #f8f9fa;
box-shadow: 0px 1px 0px 0px #dbe0e8;
background-color: #e0eaf8;
img {
width: 18px;
height: 18px;
cursor: pointer;
}
.newplan {
display: flex;
align-items: center;
.line {
margin-right: 10px;
width: 5px;
height: 16px;
background-color: #1e70de;
}
.span {
font-size: 16px;
font-family: "Alibaba PuHuiTi";
font-weight: bold;
color: #1e70de;
}
}
}
.content {
// padding: 15px 10px;
.filtrate {
padding-bottom: 10px;
}
}
}
::v-deep .el-dialog__body {
padding: 30px 15px;
}
</style>

@ -0,0 +1,259 @@
<!--
* @Descripttion:
* @version:
* @Author: JC9527
* @Date: 2023-09-28 11:25:48
* @LastEditors: JC9527
* @LastEditTime: 2023-09-28 16:41:42
-->
<template>
<el-dialog
:visible.sync="dialogVisible"
:show-close="false"
:destroy-on-close="true"
:close-on-click-modal="false"
append-to-body
custom-class="dialog-boxed"
width="50%"
>
<div class="dialog-slot">
<div class="closeClick">
<div class="newplan">
<div class="line"></div>
<div class="span">详情</div>
</div>
<img src="@/assets/images/close.png" alt="" @click="Close" />
</div>
<el-form ref="form" label-width="80px">
<el-form-item label="企业名称:" class="form-input">
<el-input v-model="form.name" :readonly="true"></el-input>
</el-form-item>
<el-form-item label="行政区划:" class="form-input">
<el-input v-model="form.district" :readonly="true"></el-input>
</el-form-item>
<el-form-item label="发布时间:" class="form-input">
<el-input v-model="form.createTime" :readonly="true"></el-input>
</el-form-item>
<el-form-item label="年月:" class="form-input">
<el-input v-model="form.plannedYear" :readonly="true"></el-input>
</el-form-item>
<el-form-item label="计划标题:">
<el-input v-model="form.planName" :readonly="readonly"></el-input>
</el-form-item>
<el-form-item label="计划内容:" class="form-textarea">
<el-input
v-model="form.planContent"
type="textarea"
resize="none"
:readonly="readonly"
placeholder="请输入计划内容"
></el-input>
</el-form-item>
<el-form-item label="备注:" class="form-textarea">
<el-input
v-model="form.remark"
type="textarea"
resize="none"
:readonly="readonly"
placeholder="请输入备注"
></el-input>
</el-form-item>
<el-form-item class="btns">
<el-button type="primary" @click="onSubmit" v-if="!readonly"></el-button>
<el-button @click="Close"></el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
</template>
<script>
import { mapState } from "vuex";
import { Loading } from "element-ui";
export default {
data() {
return {
dialogVisible:false,
mydistrict:'',
form:{
name:'测试活动名称',
district:'',
createTime:'',
plannedYear:'',
planName:'',
planContent:'',
remark:''
},
id:'',
readonly:false,
}
},
computed: {
...mapState({
district: (state) => state.user.district,
}),
},
methods:{
open(item,id) {
console.log(item)
this.id = item.id
this.getMyData(item.id)
if(id == 0) {
this.readonly = true;
} else {
this.readonly = false;
}
this.dialogVisible = true;
},
async getMyData(id){
// console.log(id)
// console.log(data)
let data = await this.$api.yingji.bPlanManageTwo(id)
if(data.code == 200){
let { district,createTime,plannedYear,planName,planContent,remark } = data.data
this.mydistrict = district
let myDistrict = this.componendDistrict(district)
let mycreateTime = createTime.split(' ')[0]
this.form = { district:myDistrict,createTime:mycreateTime,plannedYear,planName,planContent,remark }
}
},
Close(item) {
this.dialogVisible = false;
Object.keys(this.form).forEach((key) => (this.form[key] = ""));
if (item == "newsuccess") {
this.$emit("close");
}
},
//
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;
},
onSubmit(){
if(this.form.planContent && this.form.planName){
this.$modal.confirm("你确认修改吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async() => {
try {
let downloadLoadingInstance = Loading.service({
text: "正在删除计划,请稍候",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
// console.log(this.form)
const { planName,remark,planContent } = this.form;
let obj = {updateTime:this.getData(),planContent:planContent,planName:planName,remark:remark,id:this.id}
// console.log(obj)
let data = await this.$api.yingji.bPlanEnterprise('put',obj)
console.log(data)
if(data.code == 200){
downloadLoadingInstance.close();
this.Close("newsuccess")
}
} catch (error) {
}
})
}
},
//
componendDistrict(district){
let name
this.district.map((item)=>{
if(item.subdistrict == district) {
name = item.institutionName
} else {
item.children.map((itemTwo)=>{
if(itemTwo.subdistrict == district) {
name = item.institutionName + '-' + itemTwo.institutionName
}
})
}
})
return name
},
},
}
</script>
<style lang="scss" scoped>
.dialog-slot {
.closeClick {
position: absolute;
top: 0;
right: 0;
padding: 10px 20px;
width: 100%;
z-index: 1000;
display: flex;
justify-content: space-between;
align-items: center;
text-align: center;
background: #f8f9fa;
box-shadow: 0px 1px 0px 0px #dbe0e8;
background-color: #e0eaf8;
img {
width: 18px;
height: 18px;
cursor: pointer;
}
.newplan {
display: flex;
align-items: center;
.line {
margin-right: 10px;
width: 5px;
height: 16px;
background-color: #1e70de;
}
.span {
font-size: 16px;
font-family: "Alibaba PuHuiTi";
font-weight: bold;
color: #1e70de;
}
}
}
.form-input {
display: inline-block;
width: 50%;
}
::v-deep .el-input {
.el-input__inner {
font-size: 15px;
font-family: 'Alibaba PuHuiTi';
font-weight: 400;
color: #525966;
}
}
.form-textarea {
::v-deep .el-textarea {
height: 180px;
.el-textarea__inner {
height: 100%;
font-size: 15px;
font-family: 'Alibaba PuHuiTi';
font-weight: 400;
color: #525966;
}
}
}
.btns {
text-align: right;
::v-deep .el-button {
border-radius: 4px;
}
}
}
::v-deep .el-dialog__body {
padding: 30px 15px;
}
</style>

@ -185,6 +185,7 @@ export default {
this.getCode(); this.getCode();
} }
}); });
} }
}); });
}, },

@ -2,8 +2,8 @@
<div class="mainBox"> <div class="mainBox">
<div class="select-nav"> <div class="select-nav">
<div class="left-nav" v-if="activeIndex == 1"> <div class="left-nav" v-if="activeIndex == 1">
<div class="navText">:</div> <div class="navText">:</div>
<el-select v-model="ruleForm.date" placeholder="请选择年" size="mini"> <el-select v-model="ruleForm.date" placeholder="请选择年" size="mini">
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
@ -97,7 +97,7 @@
{{ scope.row.deptName.slice(scope.row.deptName.length - 1) }} {{ scope.row.deptName.slice(scope.row.deptName.length - 1) }}
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column <!-- <el-table-column
prop="enterpriseCount" prop="enterpriseCount"
label="省重点计划数" label="省重点计划数"
header-align="center" header-align="center"
@ -138,7 +138,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.a ||0}}% {{ scope.row.a ||0}}%
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
prop="totalPlanCount" prop="totalPlanCount"
label="合计计划数" label="合计计划数"
@ -167,12 +167,12 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="pagination"> <!-- <div class="pagination">
<my-pagination <my-pagination
:total="total" :total="total"
@pagesChange="pagesChange" @pagesChange="pagesChange"
></my-pagination> ></my-pagination>
</div> </div> -->
</div> </div>
</div> </div>
</template> </template>

@ -4,7 +4,7 @@
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-09-04 10:20:06 * @Date: 2023-09-04 10:20:06
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2023-09-27 16:45:07 * @LastEditTime: 2023-09-28 13:44:14
--> -->
<template> <template>
<div class="plan-management"> <div class="plan-management">
@ -168,24 +168,28 @@
</div> </div>
<my-dialog ref="myDialog" v-on:close="padlock"></my-dialog> <my-dialog ref="myDialog" v-on:close="padlock"></my-dialog>
<my-dialogtwo ref="myDialogTwo"></my-dialogtwo> <my-dialogtwo ref="myDialogTwo"></my-dialogtwo>
<temp-dialog ref="tempDialog" v-on:close="padlock"></temp-dialog>
</div> </div>
</template> </template>
<script> <script>
import myPagination from "@/views/components/myPagination/index.vue" import myPagination from "@/views/components/myPagination/index.vue"
import myDialog from "@/views/components/dialog/index.vue" import myDialog from "@/views/components/dialog/index.vue"
import myDialogtwo from "@/views/components/dialogTwo/index.vue" import myDialogtwo from "@/views/components/dialogTwo/index.vue"
import tempDialog from "@/views/components/tempDialog/index.vue"
import { Loading } from "element-ui"; import { Loading } from "element-ui";
import { mapState } from "vuex"; import { mapState } from "vuex";
export default { export default {
components:{myPagination,myDialog,myDialogtwo}, components:{myPagination,myDialog,myDialogtwo,tempDialog},
data() { data() {
return { return {
optionsyear:[], optionsyear:[],
options:[], options:[],
myDistrict:[],
form:{ form:{
district:[], district:[],
plannedYear:'' plannedYear:''
}, },
mydistrict:'',
props:{ props:{
value:'county', value:'county',
label:'institutionName', label:'institutionName',
@ -247,25 +251,48 @@
computed: { computed: {
...mapState({ ...mapState({
dept: (state) => state.user.dept, dept: (state) => state.user.dept,
district: (state) => state.user.district,
}), }),
}, },
watch:{ watch:{
form:{ form:{
handler(newForm) { handler(newForm) {
// console.log(newForm)
// let districtTwo,obj
// if(this.dept.ancestors.split(',').length == 2) {
// districtTwo = district.split(1,8)
// obj = { ...this.pages, ...newForm,district:districtTwo };
// } else if(this.dept.ancestors.split(',').length == 3){
// districtTwo = district.split(1,11)
// obj = { ...this.pages, ...newForm,district:districtTwo };
// }
this.pages.pageNum = 1; this.pages.pageNum = 1;
this.pages.pageSize = 10; this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages(); this.$refs.mypagination.defaultPages();
let obj = obj = { ...this.pages, ...newForm }; let obj
// district = district[1] // console.log(newForm,'newForm')
//
if(!this.disabled) {
if(Array.isArray(newForm.district)){
if(newForm.district.length == 2) {
let district = this.form.district[1].slice(1, 11);
obj = { ...this.pages, ...this.form,district };
} else if(newForm.district.length == 1) {
let district = this.form.district.slice[0](1, 8);
obj = { ...this.pages, ...this.form,district };
}
//
} else {
//
if(this.mydistrict){
let district = this.form.district.slice(1, 11);
obj = { ...this.pages, ...this.form,district };
} else {
obj = this.pages
}
}
} else {
//
// if(this.dept.ancestors.split(',').length == 2) {
// this.subdistrict = this.form.subdistrict.slice(1, 8);
// obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
// } else if(this.dept.ancestors.split(',').length == 3){
let district = this.form.district.slice(1, 11);
obj = { ...this.pages, ...this.form,district };
// }
}
// console.log(obj,'obj')
this.getList(obj) this.getList(obj)
}, },
deep:true, deep:true,
@ -275,7 +302,7 @@
// //
componendDistrict(district){ componendDistrict(district){
let name let name
this.options.map((item)=>{ this.myDistrict.map((item)=>{
if(item.subdistrict == district) { if(item.subdistrict == district) {
name = item.institutionName name = item.institutionName
} else { } else {
@ -290,7 +317,9 @@
}, },
// //
pagesChange(pages){ pagesChange(pages){
console.log('123123页码发生变化')
this.getList(pages) this.getList(pages)
this.pages = pages
}, },
// //
handleSelectionChange(val) { handleSelectionChange(val) {
@ -321,22 +350,23 @@
}, },
// //
reset(){ reset(){
this.pages.pageNum = 1; // this.pages.pageNum = 1;
this.pages.pageSize = 10; // this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages(); // this.$refs.mypagination.defaultPages();
let obj // let obj
if(this.dept.parentId !== 0) { if(this.dept.ancestors.split(',').length == 1) {
let { district} = this.form;
this.form.plannedYear='';
obj = {...this.pages,district}
} else {
this.form = { this.form = {
plannedYear:'', plannedYear:'',
district:'' district:''
} }
obj = this.pages // obj = this.pages
} else {
let { district} = this.form;
this.form.plannedYear='';
this.form.district=this.mydistrict;
// obj = {...this.pages,district}
} }
this.getList(obj) // this.getList(obj)
}, },
// dialog // dialog
padlock(){ padlock(){
@ -349,20 +379,20 @@
}, },
// //
handleChange(value){ handleChange(value){
console.log(value) // console.log(value)
if(value.length == 2) { // if(value.length == 2) {
this.form.district = value[1] // this.form.district = value[1]
} else { // } else {
this.form.district = value[0] // this.form.district = value[0]
} // }
}, },
// //
look(row){ look(row){
this.$refs.myDialogTwo.open(row,this.dept); this.$refs.tempDialog.open(row,0);
}, },
// //
change(row){ change(row){
this.$refs.myDialog.open(row,this.dept) this.$refs.tempDialog.open(row,1)
}, },
// //
deleteItem(row){ deleteItem(row){
@ -416,9 +446,6 @@
this.loading = false; this.loading = false;
} }
this.tableData = res.data.list; this.tableData = res.data.list;
this.tableData.map((item)=>{
item['planNumb'] = 1
})
this.total = res.data.total this.total = res.data.total
}, },
commentData(item,dept){ commentData(item,dept){
@ -430,31 +457,36 @@
this.commentData(item.children,this.dept) this.commentData(item.children,this.dept)
} }
}) })
this.options = item this.myDistrict = item;
this.options = item;
if(dept.ancestors.split(',').length == 2) { if(dept.ancestors.split(',').length == 2) {
this.options = this.options.filter((item)=>{ this.options = this.options.filter((item)=>{
return item.institutionName == dept.deptName return item.institutionName == dept.deptName
}) })
this.options.map((item)=>{ this.options.map((item)=>{
if(item.institutionName == dept.deptName) { if(item.institutionName == dept.deptName) {
console.log(item.county)
this.form.district = item.county this.form.district = item.county
delete item.children this.mydistrict = item.county
// delete item.children
} }
}) })
this.disabled = true; // this.disabled = true;
} else if(dept.ancestors.split(',').length == 3) { } else if(dept.ancestors.split(',').length == 3) {
this.options.map((item)=>{ this.options.map((item)=>{
if(item.institutionName == dept.deptName) { if(item.institutionName == dept.deptName) {
console.log(item.institutionName)
this.form.district = item.subdistrict this.form.district = item.subdistrict
this.mydistrict = item.subdistrict
} }
}) })
this.disabled = true; this.disabled = true;
} }
// console.log(this.options)
} }
}, },
async created() { async created() {
console.log(this.dept) console.log(this.dept)
// console.log(this.district)
this.checkListTwo = this.checkList; this.checkListTwo = this.checkList;
// this.$nextTick(()=>{ // this.$nextTick(()=>{
// let dom = document.getElementsByClassName('tables'); // let dom = document.getElementsByClassName('tables');
@ -464,9 +496,11 @@
// this.main.height = relativeHeight - 80 // this.main.height = relativeHeight - 80
// console.log(this.main.height) // console.log(this.main.height)
// }) // })
let data = await this.$api.yingji.tree(); // let data = await this.$api.yingji.tree();
this.commentData(data.data,this.dept) this.commentData(this.district,this.dept)
if(this.dept.ancestors.split(',').length == 1) {
this.getList(this.pages); this.getList(this.pages);
}
}, },
} }
</script> </script>

Loading…
Cancel
Save