| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- <template>
- <!-- 弹出窗 -->
- <el-dialog title="添加督查对象" :visible.sync="dialogFormVisible" width="80%" modal-append-to-body append-to-body>
- <el-container>
- <el-aside width="200px" style="border:1px solid #d5d5ff">
- <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">
- <i class="el-icon-share"></i>所属机构
- </p>
- <provTreeListQy
- ref="provTreeListQyRef"
- v-show="showLeftTree"
- :ddczId='dczId'
- rootCode="000000"
- :adCodes="adCodes"
- rootType="1"
- style="max-height:485px;"
- @treeDataEmit="treeDataEmit"
- @provTreeSelectChange="provTreeSelectChangeHandler_qy">
- </provTreeListQy>
- <provTreeList
- v-show="!showLeftTree"
- rootCode="000000"
- rootType="1"
- style="max-height:485px;"
- @provTreeSelectChange="provTreeSelectChangeHandler"
- ></provTreeList>
- </el-aside>
- <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;">
- <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">督查对象</p>
- <el-form style="padding:10px">
- <div>
- <el-form size="mini" :inline="true" class="demo-form-inline">
- <el-form-item label="交办编号">
- <el-input
- style="width:140px;"
- v-model="searchNameOfSzName"
- clearable
- placeholder="请输入交办编号"
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="refreshCurrentShow">查询</el-button>
- </el-form-item>
- </el-form>
- <el-table
- border
- v-loading="loading"
- :data="currentShowList"
- tooltip-effect="dark"
- style="width: 100%"
- @selection-change="handleSelectionChange"
- >
- <el-table-column align="center" type="selection" width="60"></el-table-column>
- <el-table-column align="center" prop="index" label="序号" min-width="40"></el-table-column>
- <el-table-column
- align="center"
- show-overflow-tooltip
- prop="nm"
- label="交办编号"
- min-width="100"
- ></el-table-column>
- <el-table-column
- align="center"
- show-overflow-tooltip
- prop="type"
- label="举报内容"
- :formatter="problemType"
- min-width="100"
- ></el-table-column>
- <!-- <el-table-column
- align="center"
- show-overflow-tooltip
- prop="locationCun"
- label="问题描述"
- min-width="100"
- ></el-table-column> -->
- <!-- <el-table-column
- align="center"
- show-overflow-tooltip
- prop="gateAdmDep"
- label="是否销号"
- min-width="100"
- ></el-table-column> -->
- <el-table-column
- align="center"
- show-overflow-tooltip
- prop="location"
- label="所在位置"
- min-width="100"
- ></el-table-column>
- </el-table>
- <div
- class="block"
- style="display:flex;flex-direction:row;justify-content:center;align-items:center;padding-top: 5px;background-color: #fff;"
- >
- <el-pagination
- small
- @current-change="handleCurrentChange"
- :pager-count="5"
- :current-page.sync="pageIndex"
- :page-size="pageSize"
- layout="total, prev, pager, next"
- :total="total"
- ></el-pagination>
- </div>
- </div>
- </el-form>
- </el-main>
- </el-container>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false">取 消</el-button>
- <el-button type="primary" :loading="addOnce" :disabled="addOnce" @click="saveChange">确 定</el-button>
- </div>
- </el-dialog>
- </template>
- <script>
- import request from '@util/gw_ajax_request.js';
- import provTreeList from "@widget/provTreeList.vue";
- import {
- getObjListNotInspGroupId,
- addDcAndObjRel
- } from "@api/duChaDuiXiang_xsk_API.js";
- import {getSupObjListNotInspGroupId} from '@api/duChaPlan.js'
- export default {
- components: {
- provTreeList: provTreeList,
- provTreeListQy:resolve => {require(['@widget/provTreeList_quyu.vue'],resolve)},
- },
- props: ["dczId", "dczName", "plnaId", "objType","adCodes","isNewPlan"],
- computed: {},
- data() {
- return {
- addOnce:false,
- searchNameOfSzName: "",
- rsAdmDep: "",
- pageIndex: 1,
- pageSize: 10,
- total: 0,
- currentShowList: [],
- dialogFormVisible: false,
- formLabelWidth: "120",
- addArr: "",
- addName:"",
- addLttd:"",
- addLgtd:"",
- multipleSelection: [],
- searchProvTreeListCode: "",
- qyDataList:[],
- loading:false,
- showLeftTree:true,
- addRsvrVisible: false,
- props: {
- value: 'id',
- label: 'label',
- children: 'cities'
- },
- provList: [],
- cityList: [],
- countryList: [],
- }
- },
- watch: {
- dczId: function(n, o) {
- this.searchProvTreeListCode = "";
- },
- objType: function(n, o) {
- this.searchProvTreeListCode = "";
- this.objType = n;
- },
- qyDataList(n,o){
- if(this.qyDataList.length == 0){
- this.showLeftTree = false;
- }else{
- this.showLeftTree = true;
- }
- console.log("区域树"+n.length+this.showLeftTree+this.objType);
- this.getTableData_sz();
- }
- },
- mounted() {
- this.getTableData_sz();
- },
- computed:{
- userId:function(){
- return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
- },
- },
- methods: {
- problemType(row,column){
- return row.type == '1'? "乱占":
- row.type == '2'? "乱采":
- row.type == '3'? "乱堆":
- row.type == '4'? "乱建":
- row.type == '5'? "其他": row.type;
- },
- showDialog() {
- this.dialogFormVisible = true;
- if(this.$refs['provTreeListQyRef']){
- this.$refs['provTreeListQyRef'].getQyList();
- }
- this.getTableData_sz();
- },
- saveChange() {
- this.addObjectChange();
- },
- treeDataEmit(item){
- this.qyDataList = item;
- if(this.qyDataList.length == 0){
- this.showLeftTree = false;
- }else{
- this.showLeftTree = true;
- }
- },
- getTableData_sz(){
- var _self = this;
- if(_self.qyDataList.length == 0){
- _self.showLeftTree = false;
- }else{
- _self.showLeftTree = true;
- }
- _self.loading = true;
- var str = '';
- for(var i=0;i<_self.qyDataList.length;i++){
- str+= _self.qyDataList[i].adCode+',';
- }
- str = str.substring(0,str.length-1);
- getSupObjListNotInspGroupId(str,_self.dczId,'',_self.pageSize,_self.pageIndex,_self.objType,_self.searchNameOfSzName,'').then((res)=>{
- _self.loading = false;
- _self.currentShowList = res.data.list;
- _self.currentShowList.forEach((element, index) => {
- element["index"] = _self.pageSize * (_self.pageIndex - 1) + index + 1;
- });
- _self.total = res.data.total;
- })
- },
- getTableData_sz1(){
- var _self = this;
- getSupObjListNotInspGroupId(_self.searchProvTreeListCode,_self.dczId,'',_self.pageSize,_self.pageIndex,_self.objType,_self.searchNameOfSzName,'').then((res)=>{
- _self.loading = false;
- _self.currentShowList = res.data.list;
- _self.currentShowList.forEach((element, index) => {
- element["index"] = _self.pageSize * (_self.pageIndex - 1) + index + 1;
- });
- _self.total = res.data.total;
- })
- },
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- handleCurrentChange(val) {
- console.log(`当前页: ${val}`);
- this.refreshCurrentShow();
- },
- refreshCurrentShow: function() {
- if(this.searchProvTreeListCode){
- this.getTableData_sz1();
- }else{
- this.getTableData_sz();
- }
- },
- addObjectChange: function() {
- //提交当前选中对象
- var _self = this;
- var names = [];
- if(_self.addOnce){
- _self.addOnce = false;
- return;
- }
- _self.addOnce = true
- var objArr = [];
- const length = _self.multipleSelection.length;
- for (let i = 0; i < length; i++) {
- var obj = {};
- obj['code'] = _self.multipleSelection[i].id;
- obj['name'] = _self.multipleSelection[i].nm;
- obj['objId'] = _self.multipleSelection[i].objId;
- obj['ptype'] = _self.objType;
- objArr.push(obj);
- names.push(_self.multipleSelection[i].nm);
- }
- if(this.isNewPlan){
- var obj = {
- persid :this.userId,
- nm: this.dczName,
- id: this.dczId,
- persAllAreaDtoList: [],
- persAllDtoList: [],
- persAllObjDtoList: objArr
- };
- this.addOnce = false;
- this.dialogFormVisible = false;
- this.$message.success("选择成功");
- this.$emit("addSuccess",{obj:obj,names:names.join(",")});
- return;
- }
- try {
- request.post("/supervision/plan/insertSupervisionObj", {
- persid :this.userId,
- nm: this.dczName,
- id: this.dczId,
- persAllAreaDtoList: [],
- persAllDtoList: [],
- persAllObjDtoList: objArr
- }).then(response => {
- if (response.success == true) {
- _self.addOnce = false;
- _self.dialogFormVisible = false;
- _self.$message.success("添加成功");
- _self.$emit("addSuccess");
- }
- });
- } catch (e) {
- alert("暂无数据");
- }
- },
- provTreeSelectChangeHandler: function(params) {
- this.searchProvTreeListCode = params.code;
- this.getTableData_sz1();
- },
- provTreeSelectChangeHandler_qy(params){
- this.searchProvTreeListCode = params.code;
- this.getTableData_sz1();
- },
- }
- };
- </script>
- <style>
- </style>
|