|
|
|
@ -15,61 +15,48 @@
|
|
|
|
|
<div class="line"></div>
|
|
|
|
|
<div class="span">新增计划</div>
|
|
|
|
|
</div>
|
|
|
|
|
<img src="@/assets/images/close.png" alt="" @click="Close" />
|
|
|
|
|
<img src="@/assets/images/close.png" alt="" @click="closeDialog" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<!-- tabs -->
|
|
|
|
|
<div class="module">
|
|
|
|
|
<div
|
|
|
|
|
class="select"
|
|
|
|
|
:class="nextStep ? '' : 'nextStepSelect'"
|
|
|
|
|
@click="selectFirm"
|
|
|
|
|
:class="activeTab == 0 ? 'nextStepSelect' : ''"
|
|
|
|
|
@click="selectTab(0)"
|
|
|
|
|
>
|
|
|
|
|
<span class="span-one">Ⅰ</span>
|
|
|
|
|
<span>选择省重点</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="issue" :class="nextStep ? 'nextStepIssue' : ''">
|
|
|
|
|
<div
|
|
|
|
|
class="issue"
|
|
|
|
|
:class="activeTab == 1 ? 'nextStepIssue' : ''"
|
|
|
|
|
@click="selectTab(1)"
|
|
|
|
|
>
|
|
|
|
|
<span class="span-one">Ⅱ</span>
|
|
|
|
|
<span>选择非省重点</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="issue"
|
|
|
|
|
:class="activeTab == 2 ? 'nextStepIssue' : ''"
|
|
|
|
|
@click="selectTab(2)"
|
|
|
|
|
>
|
|
|
|
|
<span class="span-one">Ⅲ</span>
|
|
|
|
|
<span>草稿箱</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="!nextStep">
|
|
|
|
|
|
|
|
|
|
<!-- tabs-content -->
|
|
|
|
|
<div v-show="activeTab == 0">
|
|
|
|
|
<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>
|
|
|
|
|
<executive
|
|
|
|
|
@quhua="quhua"
|
|
|
|
|
@quhuadizhi="quhuadizhi"
|
|
|
|
|
ref="executive"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="select-input">
|
|
|
|
|
<div class="select-span">企业类型:</div>
|
|
|
|
|
<el-select v-model="form.frimType" placeholder="请选择">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in options"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div> -->
|
|
|
|
|
<!-- <div class="select-input">
|
|
|
|
|
<div class="select-span">企业规模:</div>
|
|
|
|
|
<el-select v-model="form.ecoTypeLarge" placeholder="请选择">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in dict.type.economic_categories"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div> -->
|
|
|
|
|
<div class="select-input">
|
|
|
|
|
<div class="select-span">行业监管大类:</div>
|
|
|
|
|
<el-select v-model="form.supervisionLarge" placeholder="请选择">
|
|
|
|
@ -108,96 +95,11 @@
|
|
|
|
|
></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="btns">
|
|
|
|
|
<div class="select-btn" @click="filtrate">搜索</div>
|
|
|
|
|
<div class="select-btn reset" @click="reset">重置</div>
|
|
|
|
|
<div class="select-btn">搜索</div>
|
|
|
|
|
<div class="select-btn reset">重置</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tables" v-loading="loading">
|
|
|
|
|
<el-table
|
|
|
|
|
:data="tableData"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
:border="false"
|
|
|
|
|
ref="multipleTable"
|
|
|
|
|
tooltip-effect="light"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
row-key="uuitNo"
|
|
|
|
|
:row-class-name="tableRowClassName"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column
|
|
|
|
|
type="selection"
|
|
|
|
|
reserve-selection
|
|
|
|
|
:selectable="checkSelectable"
|
|
|
|
|
width="45"
|
|
|
|
|
header-align="center"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="enterpriseName"
|
|
|
|
|
label="企业名称"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
header-align="center"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="majorHazardLevel"
|
|
|
|
|
label="行政区划"
|
|
|
|
|
width="230"
|
|
|
|
|
header-align="center"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{
|
|
|
|
|
componendDistrict(scope.row.subdistrict) || "/"
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="supervisionLarge"
|
|
|
|
|
label="行业监管大类"
|
|
|
|
|
width="230"
|
|
|
|
|
header-align="center"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div>
|
|
|
|
|
{{ scope.row.supervisionLarge | supervisionLarge }}
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="uuitNo"
|
|
|
|
|
label="统一社会信用代码"
|
|
|
|
|
header-align="center"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="isPoint"
|
|
|
|
|
label="是否重点"
|
|
|
|
|
header-align="center"
|
|
|
|
|
>
|
|
|
|
|
<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 == '2'">否</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</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>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tables" v-loading="loading"></div>
|
|
|
|
|
<div class="pagination">
|
|
|
|
|
<my-pagination
|
|
|
|
|
:total="total"
|
|
|
|
@ -210,72 +112,27 @@
|
|
|
|
|
</div> -->
|
|
|
|
|
</my-pagination>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="next">
|
|
|
|
|
<div class="selected">
|
|
|
|
|
草稿箱<span>{{ 0 }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="btn" ref="next">下一步</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else class="release-planning">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="form"
|
|
|
|
|
:model="form2"
|
|
|
|
|
label-width="100px"
|
|
|
|
|
class="form-inline"
|
|
|
|
|
:rules="rules"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="计划年月:" prop="plannedYear">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="form2.plannedYear"
|
|
|
|
|
type="month"
|
|
|
|
|
format="yyyy-MM"
|
|
|
|
|
:clearable="false"
|
|
|
|
|
value-format="yyyy-MM"
|
|
|
|
|
placeholder="请选择年月"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="计划标题:" prop="planName">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="form2.planName"
|
|
|
|
|
:maxlength="64"
|
|
|
|
|
show-word-limit
|
|
|
|
|
placeholder="请输入计划标题"
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item
|
|
|
|
|
label="计划内容:"
|
|
|
|
|
prop="planContent"
|
|
|
|
|
class="form-textarea"
|
|
|
|
|
>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="form2.planContent"
|
|
|
|
|
type="textarea"
|
|
|
|
|
resize="none"
|
|
|
|
|
:maxlength="2000"
|
|
|
|
|
show-word-limit
|
|
|
|
|
placeholder="请输入计划内容"
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="备注:" class="form-textarea">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="form2.remark"
|
|
|
|
|
type="textarea"
|
|
|
|
|
resize="none"
|
|
|
|
|
:maxlength="2000"
|
|
|
|
|
show-word-limit
|
|
|
|
|
placeholder="请输入备注"
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="next">
|
|
|
|
|
<div class="selected">
|
|
|
|
|
已选择<span>{{ selected }}</span
|
|
|
|
|
>家企业
|
|
|
|
|
<div v-show="activeTab == 1">
|
|
|
|
|
<div class="next">
|
|
|
|
|
<div class="selected">
|
|
|
|
|
草稿箱<span>{{ 0 }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="btn" ref="next">下一步</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="btn"
|
|
|
|
|
:class="nextStep ? 'selectBtn' : ''"
|
|
|
|
|
@click="next"
|
|
|
|
|
ref="next"
|
|
|
|
|
>
|
|
|
|
|
{{ nextText }}
|
|
|
|
|
</div>
|
|
|
|
|
<div v-show="activeTab == 2">
|
|
|
|
|
<div class="next">
|
|
|
|
|
<div class="selected">
|
|
|
|
|
草稿箱<span>{{ 0 }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="btn" ref="next">正式提交</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -287,9 +144,9 @@
|
|
|
|
|
<script>
|
|
|
|
|
import myPagination from "@/views/components/myPagination/index.vue";
|
|
|
|
|
import firmDialog from "@/views/components/firmDialog/index.vue";
|
|
|
|
|
import { Loading } from "element-ui";
|
|
|
|
|
import { mapState } from "vuex";
|
|
|
|
|
import dictzh from "@/utils/dictzh.js";
|
|
|
|
|
import executive from "../../yingji/echarts/executive.vue";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
dicts: [
|
|
|
|
@ -299,20 +156,16 @@ export default {
|
|
|
|
|
"entpr_color",
|
|
|
|
|
"major_hazard_level",
|
|
|
|
|
],
|
|
|
|
|
components: { myPagination, firmDialog },
|
|
|
|
|
components: { myPagination, firmDialog, executive },
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
activeTab: 0,
|
|
|
|
|
dictzh: dictzh,
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
tableData: [],
|
|
|
|
|
listOne: [],
|
|
|
|
|
myDistrict: [],
|
|
|
|
|
// listTwo: [],
|
|
|
|
|
// listThree: [],
|
|
|
|
|
// listFour: [],
|
|
|
|
|
// listFive: [],
|
|
|
|
|
options: [],
|
|
|
|
|
// optionstwo:[],
|
|
|
|
|
props: {
|
|
|
|
|
value: "subdistrict",
|
|
|
|
|
label: "institutionName",
|
|
|
|
@ -320,8 +173,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
multipleSelection: [],
|
|
|
|
|
selected: 0,
|
|
|
|
|
nextStep: false,
|
|
|
|
|
nextText: "下一步",
|
|
|
|
|
activityCode: 0,
|
|
|
|
|
workingArea: "",
|
|
|
|
|
subdistrict: "",
|
|
|
|
|
form: {
|
|
|
|
@ -360,536 +212,48 @@ export default {
|
|
|
|
|
isamend: false,
|
|
|
|
|
amendId: "",
|
|
|
|
|
count: 0,
|
|
|
|
|
// unCount: 0,
|
|
|
|
|
// unselected: 0,
|
|
|
|
|
selectList: [],
|
|
|
|
|
disabled: false,
|
|
|
|
|
county: false,
|
|
|
|
|
district: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
quhua(e) {
|
|
|
|
|
this.form.subdistrict = e;
|
|
|
|
|
},
|
|
|
|
|
// 获取行政区划树
|
|
|
|
|
quhuadizhi(district) {
|
|
|
|
|
this.option = district;
|
|
|
|
|
},
|
|
|
|
|
selectTab(index) {
|
|
|
|
|
console.log(index);
|
|
|
|
|
this.activeTab = index;
|
|
|
|
|
},
|
|
|
|
|
// 打开
|
|
|
|
|
openDialog(item, dept) {
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
},
|
|
|
|
|
// 关闭
|
|
|
|
|
closeDialog(item) {
|
|
|
|
|
this.dialogVisible = false;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
mounted() {},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapState({
|
|
|
|
|
dept: (state) => state.user.dept,
|
|
|
|
|
// district: (state) => state.user.district,
|
|
|
|
|
// mydict: (state) => state.user.mydict,
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
// watch:{
|
|
|
|
|
// tableData:{
|
|
|
|
|
// handler(newData,oldData){
|
|
|
|
|
// newData.map((item)=>{
|
|
|
|
|
// if(item.isPoint == 1) {
|
|
|
|
|
// this.$nextTick(() => {
|
|
|
|
|
// this.$refs.multipleTable.toggleRowSelection(item,false);
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// },
|
|
|
|
|
// deep:true,
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
filters: {
|
|
|
|
|
supervisionLarge: function (value) {
|
|
|
|
|
// console.log(value.split(","));
|
|
|
|
|
let array = value.split(",");
|
|
|
|
|
array.map((item, ind) => {
|
|
|
|
|
array[ind] = dictzh[item];
|
|
|
|
|
});
|
|
|
|
|
// console.log(array.join(","));
|
|
|
|
|
return array.join(",") || "/";
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 返回上一步
|
|
|
|
|
selectFirm() {
|
|
|
|
|
if (this.$refs.next.innerText == "发布计划") {
|
|
|
|
|
this.nextStep = false;
|
|
|
|
|
this.filtrate();
|
|
|
|
|
this.nextText = "下一步";
|
|
|
|
|
this.multipleSelection.map((item) => {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.multipleTable.toggleRowSelection(item);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 匹配行政区划
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// console.log(name)
|
|
|
|
|
return name;
|
|
|
|
|
},
|
|
|
|
|
// 匹配重大危险源等级
|
|
|
|
|
filterTable(a, b) {
|
|
|
|
|
let arr = [];
|
|
|
|
|
if (!b) return;
|
|
|
|
|
if (a == this.optionstwo.major_hazard_level) {
|
|
|
|
|
arr = a.filter((value) => {
|
|
|
|
|
return "0" + value.dictValue == b;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
arr = a.filter((value) => {
|
|
|
|
|
return value.dictValue == b;
|
|
|
|
|
});
|
|
|
|
|
return arr[0].dictLabel;
|
|
|
|
|
},
|
|
|
|
|
// 搜索
|
|
|
|
|
filtrate() {
|
|
|
|
|
// if (this.form.subdistrict) {
|
|
|
|
|
// this.subdistrict = this.trimTrailingZeros(this.form.subdistrict);
|
|
|
|
|
// }
|
|
|
|
|
this.pages.pageNum = 1;
|
|
|
|
|
this.pages.pageSize = 10;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.mypagination.defaultPages();
|
|
|
|
|
});
|
|
|
|
|
let obj;
|
|
|
|
|
// 如果是苏州市或者是某个区
|
|
|
|
|
if (!this.disabled) {
|
|
|
|
|
// console.log('123')
|
|
|
|
|
if (Array.isArray(this.form.subdistrict)) {
|
|
|
|
|
if (this.form.subdistrict.length == 2) {
|
|
|
|
|
this.subdistrict = this.form.subdistrict[1].slice(0, 10);
|
|
|
|
|
obj = {
|
|
|
|
|
...this.pages,
|
|
|
|
|
...this.form,
|
|
|
|
|
subdistrict: this.subdistrict,
|
|
|
|
|
};
|
|
|
|
|
} else if (this.form.subdistrict.length == 1) {
|
|
|
|
|
this.subdistrict = this.form.subdistrict[0].slice(0, 7);
|
|
|
|
|
obj = {
|
|
|
|
|
...this.pages,
|
|
|
|
|
...this.form,
|
|
|
|
|
subdistrict: this.subdistrict,
|
|
|
|
|
};
|
|
|
|
|
} else {
|
|
|
|
|
obj = { ...this.pages, ...this.form };
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (this.county) {
|
|
|
|
|
let subdistrict = this.form.subdistrict.slice(0, 7);
|
|
|
|
|
obj = { ...this.pages, ...this.form, subdistrict };
|
|
|
|
|
} else {
|
|
|
|
|
let subdistrict = this.form.subdistrict.slice(0, 7);
|
|
|
|
|
obj = { ...this.pages, ...this.form, subdistrict };
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} 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){
|
|
|
|
|
this.subdistrict = this.form.subdistrict.slice(0, 10);
|
|
|
|
|
obj = { ...this.pages, ...this.form, subdistrict: this.subdistrict };
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
// console.log(isAncestors)
|
|
|
|
|
// 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: this.workingArea,
|
|
|
|
|
frimType: "",
|
|
|
|
|
indusTypeClass: "",
|
|
|
|
|
isPoint: "",
|
|
|
|
|
majorHazardLevel: "",
|
|
|
|
|
entprColor: "",
|
|
|
|
|
uuitNo: "",
|
|
|
|
|
enterpriseName: "",
|
|
|
|
|
};
|
|
|
|
|
this.pages.pageNum = 1;
|
|
|
|
|
this.pages.pageSize = 10;
|
|
|
|
|
this.$refs.mypagination.defaultPages();
|
|
|
|
|
// let obj = {...this.pages,...this.form}
|
|
|
|
|
if (this.dept.ancestors.split(",").length == 2) {
|
|
|
|
|
this.subdistrict = this.workingArea.slice(0, 7);
|
|
|
|
|
} else if (this.dept.ancestors.split(",").length == 3) {
|
|
|
|
|
this.subdistrict = this.form.subdistrict.slice(0, 10);
|
|
|
|
|
}
|
|
|
|
|
this.getTable({
|
|
|
|
|
...this.pages,
|
|
|
|
|
...this.form,
|
|
|
|
|
SUBDISTRICT: this.subdistrict,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 当前行的checkBox是否可以勾选
|
|
|
|
|
checkSelectable(row) {
|
|
|
|
|
row["unselected"] = true;
|
|
|
|
|
this.selectList.map((item) => {
|
|
|
|
|
if (item.enterpriseId == row.uuitNo || row["multipleTable"] == true) {
|
|
|
|
|
row["unselected"] = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// console.log(row)
|
|
|
|
|
return row.unselected;
|
|
|
|
|
},
|
|
|
|
|
// 选中企业的获取
|
|
|
|
|
async bPlanEnterprise() {
|
|
|
|
|
let count = 0;
|
|
|
|
|
let data = await this.$api.yingji.bPlanEnterpriseList();
|
|
|
|
|
this.selectList = data.data;
|
|
|
|
|
data.data.map((item) => {
|
|
|
|
|
item["uuitNo"] = item.enterpriseId;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.multipleTable.toggleRowSelection(item, false);
|
|
|
|
|
});
|
|
|
|
|
if (item.isPoint == 1 && this.dept.ancestors.split(",").length == 3) {
|
|
|
|
|
if (item.district == this.form.subdistrict) {
|
|
|
|
|
count += 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// console.log(count,'count')
|
|
|
|
|
this.unselected = count;
|
|
|
|
|
},
|
|
|
|
|
// 乡镇获取企业重点总数
|
|
|
|
|
async gettownNumbers() {
|
|
|
|
|
let data = await this.$api.yingji.getBydistrict({
|
|
|
|
|
district: this.form.subdistrict,
|
|
|
|
|
});
|
|
|
|
|
this.count = data.data;
|
|
|
|
|
},
|
|
|
|
|
// 打开
|
|
|
|
|
async open(item, dept) {
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
// let data = await this.$api.yingji.tree();
|
|
|
|
|
// this.district = data.data;
|
|
|
|
|
let treeData = JSON.parse(localStorage.getItem("TREE_DATA"));
|
|
|
|
|
this.district = treeData;
|
|
|
|
|
this.commentData(this.district, dept);
|
|
|
|
|
this.bPlanEnterprise();
|
|
|
|
|
this.filtrate();
|
|
|
|
|
if (item == "newlyIncreased") {
|
|
|
|
|
// 判断如若是镇级即将所有重点企业全选
|
|
|
|
|
if (dept.ancestors.split(",").length == 3) {
|
|
|
|
|
this.gettownNumbers();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.amendId = item.id;
|
|
|
|
|
this.isamend = true;
|
|
|
|
|
this.getList(item);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 关闭
|
|
|
|
|
Close(item) {
|
|
|
|
|
this.pages.pageNum = 1;
|
|
|
|
|
this.pages.pageSize = 10;
|
|
|
|
|
// this.$refs.mypagination.defaultPages();
|
|
|
|
|
this.dialogVisible = false;
|
|
|
|
|
this.tableData = [];
|
|
|
|
|
this.multipleSelection = [];
|
|
|
|
|
this.isamend = false;
|
|
|
|
|
this.nextStep = false;
|
|
|
|
|
this.nextText = "下一步";
|
|
|
|
|
Object.keys(this.form).forEach((key) => (this.form[key] = ""));
|
|
|
|
|
Object.keys(this.form2).forEach((key) => (this.form2[key] = ""));
|
|
|
|
|
// this.unCount = 0;
|
|
|
|
|
this.selected = 0;
|
|
|
|
|
// this.unselected = 0;
|
|
|
|
|
// this.count = 0;
|
|
|
|
|
if (item == "newsuccess") {
|
|
|
|
|
this.$emit("close");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 查看企业详情
|
|
|
|
|
look(row) {
|
|
|
|
|
this.$refs.firmDialog.open(row);
|
|
|
|
|
},
|
|
|
|
|
// 点击修改进入的请求
|
|
|
|
|
async getList(item) {
|
|
|
|
|
let data = await this.$api.yingji.bPlanManageTwo(item.id);
|
|
|
|
|
this.selected = data.data.list.length;
|
|
|
|
|
let { plannedYear, planName, planContent, remark } = data.data;
|
|
|
|
|
this.form2.plannedYear = plannedYear;
|
|
|
|
|
this.form2.planName = planName;
|
|
|
|
|
this.form2.planContent = planContent;
|
|
|
|
|
this.form2.remark = remark;
|
|
|
|
|
let arr = data.data.list;
|
|
|
|
|
this.multipleSelection = data.data.list;
|
|
|
|
|
arr.forEach((list) => {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.multipleTable.toggleRowSelection(list);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 查看/切换页码时的网络请求
|
|
|
|
|
async getTable(pages) {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
let data = await this.$api.yingji.basicList(pages);
|
|
|
|
|
// 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)
|
|
|
|
|
// : this.unselected == 0
|
|
|
|
|
// ? (this.unCount = 0)
|
|
|
|
|
// : (this.unCount = data.data.count - this.unselected);
|
|
|
|
|
// console.log(data);
|
|
|
|
|
this.total = data.total;
|
|
|
|
|
// console.log(this.unselected,'this.unselected')
|
|
|
|
|
if (data.code == 200) {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
this.tableData = data.rows;
|
|
|
|
|
// console.log(isAncestors,'isAncestors')
|
|
|
|
|
if (this.dept.ancestors.split(",").length == 3) {
|
|
|
|
|
this.tableData.forEach((item) => {
|
|
|
|
|
if (item.isPoint == "1") {
|
|
|
|
|
this.$refs.multipleTable.toggleRowSelection(item);
|
|
|
|
|
item["multipleTable"] = true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 页码,当前页切换事件
|
|
|
|
|
pagesChange(pages) {
|
|
|
|
|
this.pages = pages;
|
|
|
|
|
// console.log(this.form)
|
|
|
|
|
if (this.dept.ancestors.split(",").length == 2) {
|
|
|
|
|
if (Array.isArray(this.form.subdistrict)) {
|
|
|
|
|
if (this.form.subdistrict.length == 2) {
|
|
|
|
|
this.subdistrict = this.form.subdistrict[1].slice(0, 10);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.subdistrict = this.form.subdistrict.slice(0, 7);
|
|
|
|
|
}
|
|
|
|
|
} else if (this.dept.ancestors.split(",").length == 3) {
|
|
|
|
|
this.subdistrict = this.form.subdistrict.slice(0, 10);
|
|
|
|
|
}
|
|
|
|
|
// console.log(this.subdistrict,'this.subdistrict')
|
|
|
|
|
// console.log(this.form,'this.form')
|
|
|
|
|
this.getTable({ ...pages, ...this.form, subdistrict: this.subdistrict });
|
|
|
|
|
},
|
|
|
|
|
// 选中的数据
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
|
|
this.multipleSelection = val;
|
|
|
|
|
this.selected = this.multipleSelection.length;
|
|
|
|
|
},
|
|
|
|
|
// 计算当前时间
|
|
|
|
|
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;
|
|
|
|
|
},
|
|
|
|
|
// 下一步
|
|
|
|
|
async next() {
|
|
|
|
|
let arr = [];
|
|
|
|
|
let arr2 = [];
|
|
|
|
|
let arr3 = [];
|
|
|
|
|
let keyCount = 0;
|
|
|
|
|
this.multipleSelection.map((item) => {
|
|
|
|
|
arr.push(item.subdistrict);
|
|
|
|
|
arr2.push(item.uuitNo);
|
|
|
|
|
arr3.push(item.enterpriseName);
|
|
|
|
|
if (item.isPoint == "1") {
|
|
|
|
|
keyCount++;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (this.$refs.next.innerText == "下一步") {
|
|
|
|
|
if (this.multipleSelection.length == 0) {
|
|
|
|
|
this.$message.error("请至少选择一家企业");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// if (this.dept.ancestors.split(',').length == 3) {
|
|
|
|
|
// // console.log(this.unselected,'this.unselected')
|
|
|
|
|
// // console.log(keyCount,'keyCount')
|
|
|
|
|
// if (this.count == this.unselected + keyCount) {
|
|
|
|
|
// this.nextStep = true;
|
|
|
|
|
// this.nextText = "发布计划";
|
|
|
|
|
// } else {
|
|
|
|
|
// this.$message.error("请将重点企业全选");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
else {
|
|
|
|
|
this.nextStep = true;
|
|
|
|
|
this.nextText = "发布计划";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
let downloadLoadingInstance = Loading.service({
|
|
|
|
|
text: this.isamend
|
|
|
|
|
? "正在修改计划,请稍后"
|
|
|
|
|
: "正在发布计划,请稍后",
|
|
|
|
|
spinner: "el-icon-loading",
|
|
|
|
|
background: "rgba(0, 0, 0, 0.7)",
|
|
|
|
|
});
|
|
|
|
|
// console.log(this.form2);
|
|
|
|
|
// console.log(this.multipleSelection);
|
|
|
|
|
|
|
|
|
|
let district = arr.join(",");
|
|
|
|
|
let enterpriseId = arr2.join(",");
|
|
|
|
|
let enterpriseName = arr3.join(",");
|
|
|
|
|
let createTime = this.getData();
|
|
|
|
|
let planNumb = this.multipleSelection.length;
|
|
|
|
|
let obj = {
|
|
|
|
|
...this.form2,
|
|
|
|
|
district,
|
|
|
|
|
enterpriseId,
|
|
|
|
|
enterpriseName,
|
|
|
|
|
createTime,
|
|
|
|
|
planNumb,
|
|
|
|
|
};
|
|
|
|
|
let data;
|
|
|
|
|
|
|
|
|
|
if (this.isamend) {
|
|
|
|
|
obj = { ...obj, id: this.amendId };
|
|
|
|
|
data = await this.$api.yingji.bPlanEnterprise("put", obj);
|
|
|
|
|
if (data.code == 200) {
|
|
|
|
|
downloadLoadingInstance.close();
|
|
|
|
|
this.$message({
|
|
|
|
|
message: "修改成功",
|
|
|
|
|
type: "success",
|
|
|
|
|
});
|
|
|
|
|
this.Close("newsuccess");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = await this.$api.yingji.bPlanEnterprise("post", obj);
|
|
|
|
|
if (data.code == 200) {
|
|
|
|
|
downloadLoadingInstance.close();
|
|
|
|
|
this.$message({
|
|
|
|
|
message: "新增成功",
|
|
|
|
|
type: "success",
|
|
|
|
|
});
|
|
|
|
|
this.Close("newsuccess");
|
|
|
|
|
} else {
|
|
|
|
|
downloadLoadingInstance.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// console.log('error submit!!');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 区划级联选择器选择触发
|
|
|
|
|
handleChange(value) {},
|
|
|
|
|
tableRowClassName({ row, rowIndex }) {
|
|
|
|
|
if (rowIndex % 2 !== 0) {
|
|
|
|
|
return "success-row";
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
},
|
|
|
|
|
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)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
item.map((item) => {
|
|
|
|
|
item.children.map((itemTwo) => {
|
|
|
|
|
if (itemTwo.children.length == 0) {
|
|
|
|
|
delete itemTwo.children;
|
|
|
|
|
}
|
|
|
|
|
itemTwo.county = itemTwo.subdistrict;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
// this.myDistrict = item;
|
|
|
|
|
this.listOne = item;
|
|
|
|
|
if (dept.ancestors.split(",").length == 2) {
|
|
|
|
|
this.listOne = this.listOne.filter((item) => {
|
|
|
|
|
return item.institutionName == dept.deptName;
|
|
|
|
|
});
|
|
|
|
|
this.listOne.map((item) => {
|
|
|
|
|
if (item.institutionName == dept.deptName) {
|
|
|
|
|
// console.log(item.county)
|
|
|
|
|
this.form.subdistrict = item.subdistrict;
|
|
|
|
|
this.workingArea = item.subdistrict;
|
|
|
|
|
this.county = true;
|
|
|
|
|
// delete item.children
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// this.disabled = true;
|
|
|
|
|
} else if (dept.ancestors.split(",").length == 3) {
|
|
|
|
|
this.listOne.map((item) => {
|
|
|
|
|
item.children.map((itemTwo) => {
|
|
|
|
|
if (itemTwo.institutionName == dept.deptName) {
|
|
|
|
|
this.form.subdistrict = itemTwo.subdistrict;
|
|
|
|
|
this.workingArea = itemTwo.subdistrict;
|
|
|
|
|
this.county = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
this.disabled = true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
async mounted() {
|
|
|
|
|
// let listTwo = await this.$api.yingji.dictdata({
|
|
|
|
|
// list: "economic_categories",
|
|
|
|
|
// }); // 企业规模大类
|
|
|
|
|
// let listThree = await this.$api.yingji.dictdata({ list: "category" }); // 行业类型
|
|
|
|
|
// let listFour = await this.$api.yingji.dictdata({
|
|
|
|
|
// list: "major_hazard_level",
|
|
|
|
|
// }); // 重大危险源等级
|
|
|
|
|
// 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"})
|
|
|
|
|
// this.optionstwo = this.mydict;
|
|
|
|
|
// this.listTwo = listTwo.data.economic_categories;
|
|
|
|
|
// this.listThree = listThree.data.category;
|
|
|
|
|
// this.listFour = listFour.data.major_hazard_level;
|
|
|
|
|
// this.listFive = listFive.data.entpr_color;
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|