修改计划管理

lijinlong^2
吕天方 1 year ago
parent cc4af5720a
commit 638e4d774d

@ -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,25 +147,47 @@
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="majorHazardLevel"
label="重大危险源等级"
show-overflow-tooltip
header-align="center"
>
</el-table-column> -->
<!-- <el-table-column
prop="address"
label="企业类型"
</el-table-column>
<el-table-column
prop="entprColor"
label="企业分色"
show-overflow-tooltip
header-align="center"
>
</el-table-column> -->
</el-table-column>
<el-table-column
prop="uscCode"
label="统一社会信用代码"
show-overflow-tooltip
width="150"
header-align="center"
>
</el-table-column>
@ -188,13 +210,9 @@
</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>
@ -286,6 +304,8 @@ export default {
selected: 0,
nextStep: false,
nextText: "下一步",
workingArea:'',
subdistrict:'',
form: {
subdistrict: [],
frimType: "",
@ -313,6 +333,7 @@ export default {
unCount: 0,
unselected: 0,
selectList: [],
disabled:false,
};
},
computed: {
@ -324,15 +345,26 @@ export default {
//
filtrate() {
if (this.form.subdistrict) {
this.form.subdistrict = this.form.subdistrict[1];
this.subdistrict = this.trimTrailingZeros(this.form.subdistrict);
}
// let obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
let obj = { ...this.pages, ...this.form };
this.getTable(obj);
this.getTable(this.pages);
},
//
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 +388,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 +466,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 +474,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 +494,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 +519,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 +548,6 @@ export default {
district,
enterpriseId,
createTime,
keyCount,
planNumb,
};
let data;
@ -566,7 +580,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 +601,11 @@ export default {
},
//
handleChange(value) {
console.log(value);
if(value.length == 2) {
this.form.subdistrict = value[1]
} else {
this.form.subdistrict = value[0]
}
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
@ -595,23 +613,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",
}); //

@ -32,13 +32,14 @@
<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 class="plan-content">
</div> -->
</div>
<div class="tables" v-loading="loading">
<el-table
@ -93,6 +94,24 @@
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" 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">
@ -150,6 +169,10 @@ export default {
pagesChange(pages) {
this.getList(pages);
this.pages = pages;
},
//
look(row){
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 !== 0) {
@ -289,6 +312,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-25 15:19:55
-->
<template>
<div class="plan-management">
@ -43,6 +43,7 @@
<span class="demonstration">默认 click 触发子菜单</span> -->
<el-cascader
v-model="form.district"
:disabled="disabled"
placeholder="请选择"
:options="options"
:props="props"
@ -64,7 +65,7 @@
</div>
<div class="plan-bottomBox">
<div class="tables">
<el-table
<!-- <el-table
:data="tableData"
:border="false"
:height="484"
@ -139,6 +140,46 @@
</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="plannedYear" label="计划年份" width="200" header-align="center"></el-table-column>
<el-table-column prop="district" label="行政区划" width="250" header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="planNumb" label="计划企业数量" width="150" header-align="center"></el-table-column>
<el-table-column prop="keyCount" label="省重点数" width="100" header-align="center"></el-table-column>
<el-table-column prop="keyCount" label="剩余重点数" width="100" header-align="center"></el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="250" header-align="center">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" 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 +195,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,23 +305,38 @@
},
//
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){
@ -248,7 +344,7 @@
},
//
change(row){
this.$refs.myDialog.open(row)
this.$refs.myDialog.open(row,this.dept)
},
//
deleteItem(row){
@ -275,7 +371,9 @@
message: '删除成功',
type: 'success'
});
this.getList();
let { district} = this.form;
let obj = {...this.pages,district}
this.getList(obj);
}
} catch (error) {
downloadLoadingInstance.close();
@ -303,21 +401,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');
@ -328,8 +446,8 @@
// console.log(this.main.height)
// })
let data = await this.$api.yingji.tree();
this.commentData(data.data)
this.getList(this.pages);
this.commentData(data.data,this.dept)
// this.getList(this.pages);
},
}
</script>
@ -497,7 +615,7 @@
.look,.change,.delete {
display: flex;
align-items: center;
margin-right: 30px;
// margin-right: 30px;
cursor: pointer;
img {
width: 20px;

@ -49,8 +49,8 @@ module.exports = {
// },
// },
'/api': {
// target: `http://39.101.188.84:9033`,
target: `http://192.168.0.119:9033`,
target: `http://39.101.188.84:9033`,
// target: `http://192.168.0.119:9033`,
changeOrigin: true,
pathRewrite: {
'^/api': ''

Loading…
Cancel
Save