杜函宇 1 year ago
commit e2de15ee00

@ -4,7 +4,7 @@
* @Author: JC9527
* @Date: 2023-09-11 15:38:21
* @LastEditors: JC9527
* @LastEditTime: 2023-09-19 15:27:12
* @LastEditTime: 2023-09-25 13:17:19
*/
import request from '@/utils/request'
@ -55,10 +55,12 @@ export default {
params
});
},
bPlanEnterprise(){
bPlanEnterprise(method,data = null, params = null, id){
return request({
url: `/pharmaceuticals/bPlanEnterprise`,
method:'get',
url: `/pharmaceuticals/bPlanEnterprise${id ? `/${id}` : ''}`,
method,
data,
params
});
},
};

@ -31,12 +31,12 @@
<div class="filtrate">
<div class="select-input">
<div class="select-span">行政区划:</div>
<el-cascader
v-model="form.subdistrict"
placeholder="请选择"
:options="listOne"
:props="props"
:disabled="disabled"
@change="handleChange"
>
</el-cascader>
@ -136,7 +136,7 @@
type="selection"
reserve-selection
:selectable="checkSelectable"
width="55"
width="45"
header-align="center"
>
</el-table-column>
@ -147,17 +147,38 @@
header-align="center"
>
</el-table-column>
<!-- <el-table-column
<el-table-column
prop="subdistrict"
label="行政区划"
show-overflow-tooltip
width="180"
width="150"
header-align="center"
>
</el-table-column>
<!-- <el-table-column
prop="ecoTypeLarge"
label="经济类型"
show-overflow-tooltip
header-align="center"
>
</el-table-column> -->
<el-table-column
prop="indusTypeClass"
label="行业类型"
show-overflow-tooltip
header-align="center"
>
</el-table-column>
<!-- <el-table-column
prop="address"
label="企业类型"
prop="majorHazardLevel"
label="重大危险源等级"
show-overflow-tooltip
header-align="center"
>
</el-table-column>
<el-table-column
prop="entprColor"
label="企业分色"
show-overflow-tooltip
header-align="center"
>
@ -166,6 +187,7 @@
prop="uscCode"
label="统一社会信用代码"
show-overflow-tooltip
width="150"
header-align="center"
>
</el-table-column>
@ -188,27 +210,23 @@
</div>
<div class="pagination">
<my-pagination :total="total" @pagesChange="pagesChange">
<div>
重点企业数<span
:class="
count == unCount ? 'selectedNumber' : 'unselectedNumber'
"
>{{ unCount }}</span
>/<span class="sum">{{ count }}</span>
<div>重点企业数
<span :class=" count == unCount ? 'selectedNumber' : 'unselectedNumber'">{{ unCount }}</span>/
<span class="sum">{{ count }}</span>
</div>
</my-pagination>
</div>
</div>
<div v-else class="release-planning">
<div class="inputs centered">
<div class="inputs-span">计划年:</div>
<div class="inputs-span">计划年:</div>
<el-date-picker
v-model="form2.plannedYear"
type="month"
format="yyyy-MM"
:clearable="false"
value-format="yyyy-MM"
placeholder="请选择年"
placeholder="请选择年"
>
</el-date-picker>
</div>
@ -281,11 +299,14 @@ export default {
props: {
value: "county",
label: "institutionName",
checkStrictly: true
},
multipleSelection: [],
selected: 0,
nextStep: false,
nextText: "下一步",
workingArea:'',
subdistrict:'',
form: {
subdistrict: [],
frimType: "",
@ -313,6 +334,7 @@ export default {
unCount: 0,
unselected: 0,
selectList: [],
disabled:false,
};
},
computed: {
@ -323,16 +345,53 @@ export default {
methods: {
//
filtrate() {
if (this.form.subdistrict) {
this.form.subdistrict = this.form.subdistrict[1];
// if (this.form.subdistrict) {
// this.subdistrict = this.trimTrailingZeros(this.form.subdistrict);
// }
let obj
// console.log(this.form.subdistrict)
//
if(!this.disabled) {
if(this.form.subdistrict.length > 0){
if(this.form.subdistrict.length == 2) {
this.form.subdistrict = this.form.subdistrict[1]
this.subdistrict = this.form.subdistrict.slice(0, 10);
obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
} else if(this.form.subdistrict.length == 1) {
this.form.subdistrict = this.form.subdistrict[0]
this.subdistrict = this.form.subdistrict.slice(0, 7);
obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
}
} else {
obj = this.pages
}
} else {
//
if(this.dept.parentId == 100) {
this.subdistrict = this.form.subdistrict.slice(0, 7);
obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
} else if(this.dept.parentId == 101){
this.subdistrict = this.form.subdistrict.slice(0, 10);
obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
}
}
let obj = { ...this.pages, ...this.form };
// obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
this.getTable(obj);
},
//
trimTrailingZeros(str) {
for (let i = str.length - 1; i >= 0; i--) {
if (str.charAt(i) !== '0') {
return str.slice(0, i + 1);
}
}
//
return str;
},
//
reset() {
this.form= {
subdistrict: [],
subdistrict: this.workingArea,
frimType: "",
indusTypeClass: "",
isPoint: "",
@ -356,35 +415,40 @@ export default {
return row.unselected;
},
//
async bPlanEnterprise() {
let count = 0;
let data = await this.$api.yingji.bPlanEnterprise();
this.selectList = data.data;
data.data.map((item) => {
item["uscCode"] = item.enterpriseId;
this.$nextTick(() => {
this.$refs.multipleTable.toggleRowSelection(item, false);
});
if (item.isPoint == 1) {
count += 1;
}
});
// console.log(count,'count')
this.unselected = count;
},
// async bPlanEnterprise() {
// let count = 0;
// let data = await this.$api.yingji.bPlanEnterprise();
// this.selectList = data.data;
// console.log(data)
// data.data.map((item) => {
// item["uscCode"] = item.enterpriseId;
// this.$nextTick(() => {
// this.$refs.multipleTable.toggleRowSelection(item, false);
// });
// if (item.isPoint == 1) {
// count += 1;
// }
// });
// console.log(count,'count')
// this.unselected = count;
// },
//
async open(item) {
async open(item,dept) {
this.dialogVisible = true;
// this.dept = dept
let data = await this.$api.yingji.tree(); //
this.commentData(data.data,dept);
this.filtrate()
if (item == "newlyIncreased") {
if (this.dept.deptName !== "市局") {
this.bPlanEnterprise();
}
this.getTable(this.pages);
// if (this.dept.deptName !== "") {
// this.bPlanEnterprise();
// }
// this.getTable(this.pages);
} else {
this.amendId = item.id;
this.isamend = true;
this.getList(item);
this.getTable(this.pages);
// this.getTable(this.pages);
}
},
//
@ -429,6 +493,7 @@ export default {
this.loading = true;
let data = await this.$api.yingji.basicList(pages);
// console.log(data.data.count, '');
// console.log(this.unCount,'this.unCount')
this.count = data.data.count;
data.data.count == this.unselected
? (this.unCount = data.data.count)
@ -436,6 +501,7 @@ export default {
? (this.unCount = 0)
: (this.unCount = data.data.count - this.unselected);
this.total = data.data.total;
// console.log(this.unselected,'this.unselected')
if (data.code == 200) {
this.loading = false;
}
@ -455,36 +521,12 @@ export default {
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;
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;
},
//
@ -504,7 +546,7 @@ export default {
this.$message.error("请至少选择一家企业");
return;
}
if (this.dept.deptName == "乡镇") {
if (this.dept.parentId == 101) {
if (this.count == this.unselected + keyCount) {
this.nextStep = true;
this.nextText = "发布计划";
@ -533,7 +575,6 @@ export default {
district,
enterpriseId,
createTime,
keyCount,
planNumb,
};
let data;
@ -566,7 +607,7 @@ export default {
this.form2.planName != "" &&
this.form2.planContent != ""
) {
data = await this.$api.yingji.bPlanManage("post", obj);
data = await this.$api.yingji.bPlanEnterprise("post", obj);
if (data.code == 200) {
downloadLoadingInstance.close();
this.$message({
@ -587,7 +628,7 @@ export default {
},
//
handleChange(value) {
console.log(value);
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
@ -595,23 +636,42 @@ export default {
}
return "";
},
commentData(item) {
if (item instanceof Array) {
item.map((item) => {
if (item.children instanceof Array && item.children.length == 0) {
delete item.children;
} else {
this.props.value = "subdistrict";
this.commentData(item.children);
commentData(item,dept) {
item.map((item)=>{
if(item.children instanceof Array && item.children.length == 0){
item.county = item.subdistrict
delete item.children;
} else {
// this.props.value = 'subdistrict'
this.commentData(item.children,dept)
}
})
this.listOne = item
if(dept.parentId == 100) {
this.listOne = this.listOne.filter((item)=>{
return item.institutionName == dept.deptName
})
this.listOne.map((item)=>{
if(item.institutionName == dept.deptName) {
this.form.subdistrict = item.county
this.workingArea = item.county
delete item.children
}
});
})
this.disabled = true;
} else if(dept.parentId == 101) {
this.listOne.map((item)=>{
if(item.institutionName == dept.deptName) {
this.form.subdistrict = item.subdistrict
this.workingArea = item.county
}
})
this.disabled = true;
}
this.listOne = item;
},
},
async mounted() {
let data = await this.$api.yingji.tree(); //
this.commentData(data.data);
let listTwo = await this.$api.yingji.dictdata({
list: "economic_categories",
}); //

@ -19,26 +19,45 @@
<div class="planInfo">
<div class="plan-title">
<div class="item">
<div>计划标题</div>
<div class="content">{{ title }}</div>
<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="请选择年份">
</el-date-picker>
</div>
<div class="area">
<div class="area-span">区划:</div>
<el-cascader
v-model="form.district"
:disabled="disabled"
placeholder="请选择"
:options="options"
:props="props"
@change="handleChange"></el-cascader>
</div>
</div>
<div class="item">
<div>计划月份</div>
<div class="content">{{ year }}</div>
<div class="export" @click="exportFile">
<img src="@/assets/images/export.png" alt="">
<span>导出excel</span>
</div>
</div>
</div>
<div class="plan-content">
<!-- <div class="plan-content">
<div class="item-two">
<div>计划内容</div>
<div class="content">{{ content }}</div>
</div>
</div>
<div class="plan-content">
<div class="item-two">
<div>备注</div>
<div class="content">{{ remark ?remark:'暂无备注'}}</div>
</div>
</div>
</div> -->
</div>
<div class="tables" v-loading="loading">
<el-table
@ -51,19 +70,25 @@
>
<el-table-column
prop="entprName"
label="企业名称"
label="计划年月"
show-overflow-tooltip
header-align="center"
>
</el-table-column>
<!-- <el-table-column
<el-table-column
prop="subdistrict"
label="行政区划"
show-overflow-tooltip
width="180"
header-align="center"
>
</el-table-column> -->
</el-table-column>
<el-table-column
prop="entprName"
label="企业名称"
show-overflow-tooltip
header-align="center"
>
</el-table-column>
<!-- <el-table-column
prop="address"
label="企业类型"
@ -73,23 +98,26 @@
</el-table-column> -->
<el-table-column
prop="uscCode"
label="统一社会信用代码"
label="创建时间"
show-overflow-tooltip
header-align="center"
>
</el-table-column>
<el-table-column
prop="isPoint"
label="是否重点"
header-align="center"
>
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
<template slot-scope="scope">
<div
style="font-family: 'Alibaba PuHuiTi'"
:class="scope.row.isPoint == '1' ? 'isStyle' : ''"
>
<span v-if="scope.row.isPoint == '1'"></span>
<span v-if="scope.row.isPoint == '0'"></span>
<div class="tabs-btns">
<div class="look" @click="look(scope.row)">
<img src="@/assets/images/look.png" alt="">
<span>查看</span>
</div>
<div class="change" @click="change(scope.row)">
<img src="@/assets/images/change.png" alt="">
<span>修改</span>
</div>
<div class="delete" @click="deleteItem(scope.row)">
<img src="@/assets/images/delete.png" alt="">
<span>删除</span>
</div>
</div>
</template>
</el-table-column>
@ -111,6 +139,13 @@ export default {
data() {
return {
dialogVisible: false,
options:[],
props:{
value:'county',
label:'institutionName',
checkStrictly: true
},
disabled:false,
tableData: [],
total: 0,
pages: {
@ -118,32 +153,61 @@ export default {
pageSize: 10,
},
loading: false,
year: "",
title: "",
content: "",
remark: "",
form:{
district:[],
plannedYear:''
},
dept:null,
};
},
methods: {
async open(item) {
async open(item,dept) {
console.log(dept)
this.dept = dept
this.dialogVisible = true;
this.getList(item);
let data = await this.$api.yingji.tree();
this.commentData(data.data,dept)
// this.getList(item);
},
Close() {
this.dialogVisible = false;
this.pages.pageNum = 1;
this.pages.pageSize = 10;
},
//
exportFile(){
this.$confirm(`确认根据您的搜索条件导出搜索之后的数据吗?`, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.download(
"/pharmaceuticals/bPlanManage/export",
{
...this.form,
},
`计划管理.xlsx`
);
})
.catch(() => {});
},
//
handleChange(value){
console.log(value)
if(value.length == 2) {
this.form.district = value[1]
} else {
this.form.district = value[0]
}
},
//
async getList(item) {
this.loading = true;
let data = await this.$api.yingji.bPlanManageTwo(item.id);
if (data.code == 200) {
this.loading = false;
}
this.year = data.data.plannedYear;
this.title = data.data.planName;
this.content = data.data.planContent;
this.remark = data.data.remark;
this.tableData = data.data.list;
},
//
@ -151,6 +215,85 @@ export default {
this.getList(pages);
this.pages = pages;
},
//
look(row){
},
//
change(row){
// this.$refs.myDialog.open(row,this.dept)
},
//
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.bPlanManage('delete',_,{idList:idList.join(',')})
// if(data.code == 200) {
// this.loading = false;
// downloadLoadingInstance.close();
// this.$message({
// message: '',
// type: 'success'
// });
// let { district} = this.form;
// let obj = {...this.pages,district}
// this.getList(obj);
// }
} catch (error) {
downloadLoadingInstance.close();
console.log(error)
}
})
.catch(() => {
console.log('取消删除')
});
},
//
commentData(item,dept){
item.map((item)=>{
if(item.children instanceof Array && item.children.length == 0){
item.county = item.subdistrict
delete item.children;
} else {
// this.props.value = 'subdistrict'
this.commentData(item.children,this.dept)
}
})
this.options = item
if(dept.parentId == 100) {
this.options = this.options.filter((item)=>{
return item.institutionName == dept.deptName
})
this.options.map((item)=>{
if(item.institutionName == dept.deptName) {
this.form.district = item.county
delete item.children
}
})
this.disabled = true;
} else if(dept.parentId == 101) {
this.options.map((item)=>{
if(item.institutionName == dept.deptName) {
this.form.district = item.subdistrict
}
})
this.disabled = true;
}
// console.log(this.options)
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
return "success-row";
@ -209,25 +352,88 @@ export default {
justify-content: space-between;
.item {
display: flex;
flex: 1;
align-items: center;
div {
font-size: 15px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #525966;
&:nth-child(1) {
width: 80px;
text-align: right;
font-size: 16px;
font-family: "Alibaba PuHuiTi";
.year {
display: flex;
align-items: center;
margin-right: 81px;
.year-span {
font-size: 14px;
font-family: 'Alibaba PuHuiTi';
font-weight: 400;
color: #525966;
line-height: 40px;
margin-right: 10px;
}
}
.content {
flex: 1;
.area {
display: flex;
align-items: center;
.area-span {
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: 276px;
.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%);
}
}
}
::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;
}
.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;
transform: rotate(180deg);
}
}
}
.export {
display: flex;
align-items: center;
justify-content: center;
background-color: #2378EC;
padding: 6px 19px;
cursor: pointer;
img {
width: 22px;
margin-right: 10px;
}
span {
color: #ffffff;
font-size: 14px;
font-family: 'Alibaba PuHuiTi';
font-weight: 400;
}
}
}
@ -289,6 +495,33 @@ export default {
height: 448px !important;
overflow-y: auto;
}
.tabs-btns {
display: flex;
align-items: center;
justify-content: center;
.look,.change,.delete {
display: flex;
align-items: center;
// margin-right: 30px;
cursor: pointer;
img {
width: 20px;
margin-right: 5px;
}
span {
font-size: 15px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #045FFD;
}
}
.delete {
margin-right: 0;
span {
color: #F71052;
}
}
}
}
::v-deep .el-table::before {
height: 0;

@ -4,7 +4,7 @@
* @Author: JC9527
* @Date: 2023-09-04 10:20:06
* @LastEditors: JC9527
* @LastEditTime: 2023-09-20 11:25:04
* @LastEditTime: 2023-09-26 13:14:38
-->
<template>
<div class="plan-management">
@ -30,24 +30,14 @@
</el-date-picker>
</div>
<div class="area">
<div class="area-span">区划:</div>
<!-- <el-select v-model="value2" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> -->
<!-- <div class="block">
<span class="demonstration">默认 click 触发子菜单</span> -->
<el-cascader
<div class="area-span">执法计划情况统计表</div>
<!-- <el-cascader
v-model="form.district"
:disabled="disabled"
placeholder="请选择"
:options="options"
:props="props"
@change="handleChange"></el-cascader>
<!-- </div> -->
@change="handleChange"></el-cascader> -->
</div>
</div>
<div class="btns">
@ -64,7 +54,7 @@
</div>
<div class="plan-bottomBox">
<div class="tables">
<el-table
<!-- <el-table
:data="tableData"
:border="false"
:height="484"
@ -139,6 +129,41 @@
</div>
</template>
</el-table-column>
</el-table> -->
<el-table
v-if="refreshTable"
v-loading="loading"
:data="tableData"
:height="484"
:border="false"
tooltip-effect="light"
row-key="id"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column prop="district" label="行政区划" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="plannedYear" label="企业总数" header-align="center"></el-table-column>
<el-table-column prop="planNumb" label="已计划数" header-align="center"></el-table-column>
<el-table-column prop="keyCount" label="已计划省重点数" header-align="center"></el-table-column>
<el-table-column prop="keyCount" label="剩余重点数" header-align="center"></el-table-column>
<el-table-column label="查看计划明细" align="center" width="200" class-name="small-padding fixed-width">
<template slot-scope="scope">
<div class="tabs-btns">
<div class="look" @click="look(scope.row)">
<img src="@/assets/images/look.png" alt="">
<span>查看</span>
</div>
<!-- <div class="change" @click="change(scope.row)">
<img src="@/assets/images/change.png" alt="">
<span>修改</span>
</div>
<div class="delete" @click="deleteItem(scope.row)">
<img src="@/assets/images/delete.png" alt="">
<span>删除</span>
</div> -->
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination">
@ -154,43 +179,83 @@
import myDialog from "@/views/components/dialog/index.vue"
import myDialogtwo from "@/views/components/dialogTwo/index.vue"
import { Loading } from "element-ui";
import { mapState } from "vuex";
export default {
components:{myPagination,myDialog,myDialogtwo},
data() {
return {
optionsyear:[],
options:[
],
options:[],
form:{
district:[],
plannedYear:''
},
props:{
value:'county',
label:'institutionName'
label:'institutionName',
checkStrictly: true
},
value:'2022',
value2:'苏州',
tableData: [],
multipleSelection: [],
tableData: [{
id: 1,
plannedYear: '2016-05-02',
district: '王小虎',
planNumb: '上海市普陀区金沙江路 1518 弄'
}, {
id: 2,
plannedYear: '2016-05-04',
district: '王小虎',
planNumb: '上海市普陀区金沙江路 1517 弄'
}, {
id: 3,
plannedYear: '2016-05-01',
district: '王小虎',
planNumb: '上海市普陀区金沙江路 1519 弄',
children: [{
id: 31,
plannedYear: '2016-05-01',
district: '王小虎',
planNumb: '上海市普陀区金沙江路 1519 弄'
}, {
id: 32,
plannedYear: '2016-05-01',
district: '王小虎',
planNumb: '上海市普陀区金沙江路 1519 弄'
}]
}, {
id: 4,
plannedYear: '2016-05-03',
district: '王小虎',
planNumb: '上海市普陀区金沙江路 1516 弄'
}],
// multipleSelection: [],
pages:{
pageSize:10,
pageNum:1
},
total:0,
loading:true,
loading:false,
disabled:false,
//
isExpandAll: true,
//
refreshTable: true,
}
},
computed: {
...mapState({
dept: (state) => state.user.dept,
}),
},
watch:{
form:{
handler(newForm) {
let { district, plannedYear} = newForm
district = district[1]
// console.log(newForm)
// district = district[1]
let obj = {...this.pages,district,plannedYear}
this.getList(obj)
// this.getList(obj)
},
deep:true
deep:true,
}
},
methods:{
@ -224,31 +289,46 @@
},
//
newProject(){
this.$refs.myDialog.open('newlyIncreased')
this.$refs.myDialog.open('newlyIncreased',this.dept)
},
//
reset(){
this.form={
district:[],
plannedYear:''
},
this.getList(this.pages)
let obj
if(this.dept.parentId !== 0) {
let { district} = this.form;
this.form.plannedYear='';
obj = {...this.pages,district}
} else {
this.form = {
plannedYear:'',
district:''
}
obj = this.pages
}
this.getList(obj)
},
// dialog
padlock(){
this.getList(this.pages);
let { district} = this.form;
let obj = {...this.pages,district}
this.getList(obj);
},
//
handleChange(value){
console.log(value)
if(value.length == 2) {
this.form.district = value[1]
} else {
this.form.district = value[0]
}
},
//
look(row){
this.$refs.myDialogTwo.open(row);
this.$refs.myDialogTwo.open(row,this.dept);
},
//
change(row){
this.$refs.myDialog.open(row)
this.$refs.myDialog.open(row,this.dept)
},
//
deleteItem(row){
@ -275,7 +355,9 @@
message: '删除成功',
type: 'success'
});
this.getList();
let { district} = this.form;
let obj = {...this.pages,district}
this.getList(obj);
}
} catch (error) {
downloadLoadingInstance.close();
@ -303,21 +385,41 @@
this.tableData = res.data.list;
this.total = res.data.total
},
commentData(item){
if(item instanceof Array) {
item.map((item)=>{
if(item.children instanceof Array && item.children.length == 0){
delete item.children;
} else {
this.props.value = 'subdistrict'
this.commentData(item.children)
commentData(item,dept){
item.map((item)=>{
if(item.children instanceof Array && item.children.length == 0){
item.county = item.subdistrict
delete item.children;
} else {
// this.props.value = 'subdistrict'
this.commentData(item.children,this.dept)
}
})
this.options = item
if(dept.parentId == 100) {
this.options = this.options.filter((item)=>{
return item.institutionName == dept.deptName
})
this.options.map((item)=>{
if(item.institutionName == dept.deptName) {
this.form.district = item.county
delete item.children
}
})
this.disabled = true;
} else if(dept.parentId == 101) {
this.options.map((item)=>{
if(item.institutionName == dept.deptName) {
this.form.district = item.subdistrict
}
})
this.disabled = true;
}
this.options = item
// console.log(this.options)
}
},
async created() {
console.log(this.dept)
this.checkListTwo = this.checkList;
// this.$nextTick(()=>{
// let dom = document.getElementsByClassName('tables');
@ -327,9 +429,9 @@
// this.main.height = relativeHeight - 80
// console.log(this.main.height)
// })
let data = await this.$api.yingji.tree();
this.commentData(data.data)
this.getList(this.pages);
// let data = await this.$api.yingji.tree();
// this.commentData(data.data,this.dept)
// this.getList(this.pages);
},
}
</script>
@ -346,10 +448,11 @@
.drup-downs {
display: flex;
align-items: center;
flex: 1;
.year {
display: flex;
align-items: center;
margin-right: 81px;
// margin-right: 200px;
.year-span {
font-size: 14px;
font-family: 'Alibaba PuHuiTi';
@ -362,13 +465,15 @@
.area {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
.area-span {
font-size: 14px;
font-size: 20px;
font-family: 'Alibaba PuHuiTi';
font-weight: 400;
font-weight: bold;
color: #525966;
line-height: 40px;
margin-right: 10px;
// margin-right: 10px;
}
::v-deep .el-cascader {
background-color: transparent;
@ -497,7 +602,7 @@
.look,.change,.delete {
display: flex;
align-items: center;
margin-right: 30px;
// margin-right: 30px;
cursor: pointer;
img {
width: 20px;

Loading…
Cancel
Save