bfb9bb37c99fc5501e07317004a4762673cf5757.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <!-- 弹出窗 -->
  3. <el-dialog title="添加督查对象" :visible.sync="dialogFormVisible" width="80%" modal-append-to-body append-to-body>
  4. <el-container>
  5. <el-aside width="200px" style="border:1px solid #d5d5ff">
  6. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">
  7. <i class="el-icon-share"></i>所属机构
  8. </p>
  9. <provTreeListQy
  10. ref="provTreeListQyRef"
  11. v-show="showLeftTree"
  12. :ddczId='dczId'
  13. rootCode="000000"
  14. :adCodes="adCodes"
  15. rootType="1"
  16. style="max-height:485px;"
  17. @treeDataEmit="treeDataEmit"
  18. @provTreeSelectChange="provTreeSelectChangeHandler_qy">
  19. </provTreeListQy>
  20. <provTreeList
  21. v-show="!showLeftTree"
  22. rootCode="000000"
  23. rootType="1"
  24. style="max-height:485px;"
  25. @provTreeSelectChange="provTreeSelectChangeHandler"
  26. ></provTreeList>
  27. </el-aside>
  28. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;">
  29. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">督查对象</p>
  30. <el-form style="padding:10px">
  31. <div>
  32. <el-form size="mini" :inline="true" class="demo-form-inline">
  33. <el-form-item label="交办编号">
  34. <el-input
  35. style="width:140px;"
  36. v-model="searchNameOfSzName"
  37. clearable
  38. placeholder="请输入交办编号"
  39. ></el-input>
  40. </el-form-item>
  41. <el-form-item>
  42. <el-button type="primary" @click="refreshCurrentShow">查询</el-button>
  43. </el-form-item>
  44. </el-form>
  45. <el-table
  46. border
  47. v-loading="loading"
  48. :data="currentShowList"
  49. tooltip-effect="dark"
  50. style="width: 100%"
  51. @selection-change="handleSelectionChange"
  52. >
  53. <el-table-column align="center" type="selection" width="60"></el-table-column>
  54. <el-table-column align="center" prop="index" label="序号" min-width="40"></el-table-column>
  55. <el-table-column
  56. align="center"
  57. show-overflow-tooltip
  58. prop="nm"
  59. label="交办编号"
  60. min-width="100"
  61. ></el-table-column>
  62. <el-table-column
  63. align="center"
  64. show-overflow-tooltip
  65. prop="type"
  66. label="举报内容"
  67. :formatter="problemType"
  68. min-width="100"
  69. ></el-table-column>
  70. <!-- <el-table-column
  71. align="center"
  72. show-overflow-tooltip
  73. prop="locationCun"
  74. label="问题描述"
  75. min-width="100"
  76. ></el-table-column> -->
  77. <!-- <el-table-column
  78. align="center"
  79. show-overflow-tooltip
  80. prop="gateAdmDep"
  81. label="是否销号"
  82. min-width="100"
  83. ></el-table-column> -->
  84. <el-table-column
  85. align="center"
  86. show-overflow-tooltip
  87. prop="location"
  88. label="所在位置"
  89. min-width="100"
  90. ></el-table-column>
  91. </el-table>
  92. <div
  93. class="block"
  94. style="display:flex;flex-direction:row;justify-content:center;align-items:center;padding-top: 5px;background-color: #fff;"
  95. >
  96. <el-pagination
  97. small
  98. @current-change="handleCurrentChange"
  99. :pager-count="5"
  100. :current-page.sync="pageIndex"
  101. :page-size="pageSize"
  102. layout="total, prev, pager, next"
  103. :total="total"
  104. ></el-pagination>
  105. </div>
  106. </div>
  107. </el-form>
  108. </el-main>
  109. </el-container>
  110. <div slot="footer" class="dialog-footer">
  111. <el-button @click="dialogFormVisible = false">取 消</el-button>
  112. <el-button type="primary" :loading="addOnce" :disabled="addOnce" @click="saveChange">确 定</el-button>
  113. </div>
  114. </el-dialog>
  115. </template>
  116. <script>
  117. import request from '@util/gw_ajax_request.js';
  118. import provTreeList from "@widget/provTreeList.vue";
  119. import {
  120. getObjListNotInspGroupId,
  121. addDcAndObjRel
  122. } from "@api/duChaDuiXiang_xsk_API.js";
  123. import {getSupObjListNotInspGroupId} from '@api/duChaPlan.js'
  124. export default {
  125. components: {
  126. provTreeList: provTreeList,
  127. provTreeListQy:resolve => {require(['@widget/provTreeList_quyu.vue'],resolve)},
  128. },
  129. props: ["dczId", "dczName", "plnaId", "objType","adCodes","isNewPlan"],
  130. computed: {},
  131. data() {
  132. return {
  133. addOnce:false,
  134. searchNameOfSzName: "",
  135. rsAdmDep: "",
  136. pageIndex: 1,
  137. pageSize: 10,
  138. total: 0,
  139. currentShowList: [],
  140. dialogFormVisible: false,
  141. formLabelWidth: "120",
  142. addArr: "",
  143. addName:"",
  144. addLttd:"",
  145. addLgtd:"",
  146. multipleSelection: [],
  147. searchProvTreeListCode: "",
  148. qyDataList:[],
  149. loading:false,
  150. showLeftTree:true,
  151. addRsvrVisible: false,
  152. props: {
  153. value: 'id',
  154. label: 'label',
  155. children: 'cities'
  156. },
  157. provList: [],
  158. cityList: [],
  159. countryList: [],
  160. }
  161. },
  162. watch: {
  163. dczId: function(n, o) {
  164. this.searchProvTreeListCode = "";
  165. },
  166. objType: function(n, o) {
  167. this.searchProvTreeListCode = "";
  168. this.objType = n;
  169. },
  170. qyDataList(n,o){
  171. if(this.qyDataList.length == 0){
  172. this.showLeftTree = false;
  173. }else{
  174. this.showLeftTree = true;
  175. }
  176. console.log("区域树"+n.length+this.showLeftTree+this.objType);
  177. this.getTableData_sz();
  178. }
  179. },
  180. mounted() {
  181. this.getTableData_sz();
  182. },
  183. computed:{
  184. userId:function(){
  185. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  186. },
  187. },
  188. methods: {
  189. problemType(row,column){
  190. return row.type == '1'? "乱占":
  191. row.type == '2'? "乱采":
  192. row.type == '3'? "乱堆":
  193. row.type == '4'? "乱建":
  194. row.type == '5'? "其他": row.type;
  195. },
  196. showDialog() {
  197. this.dialogFormVisible = true;
  198. if(this.$refs['provTreeListQyRef']){
  199. this.$refs['provTreeListQyRef'].getQyList();
  200. }
  201. this.getTableData_sz();
  202. },
  203. saveChange() {
  204. this.addObjectChange();
  205. },
  206. treeDataEmit(item){
  207. this.qyDataList = item;
  208. if(this.qyDataList.length == 0){
  209. this.showLeftTree = false;
  210. }else{
  211. this.showLeftTree = true;
  212. }
  213. },
  214. getTableData_sz(){
  215. var _self = this;
  216. if(_self.qyDataList.length == 0){
  217. _self.showLeftTree = false;
  218. }else{
  219. _self.showLeftTree = true;
  220. }
  221. _self.loading = true;
  222. var str = '';
  223. for(var i=0;i<_self.qyDataList.length;i++){
  224. str+= _self.qyDataList[i].adCode+',';
  225. }
  226. str = str.substring(0,str.length-1);
  227. getSupObjListNotInspGroupId(str,_self.dczId,'',_self.pageSize,_self.pageIndex,_self.objType,_self.searchNameOfSzName,'').then((res)=>{
  228. _self.loading = false;
  229. _self.currentShowList = res.data.list;
  230. _self.currentShowList.forEach((element, index) => {
  231. element["index"] = _self.pageSize * (_self.pageIndex - 1) + index + 1;
  232. });
  233. _self.total = res.data.total;
  234. })
  235. },
  236. getTableData_sz1(){
  237. var _self = this;
  238. getSupObjListNotInspGroupId(_self.searchProvTreeListCode,_self.dczId,'',_self.pageSize,_self.pageIndex,_self.objType,_self.searchNameOfSzName,'').then((res)=>{
  239. _self.loading = false;
  240. _self.currentShowList = res.data.list;
  241. _self.currentShowList.forEach((element, index) => {
  242. element["index"] = _self.pageSize * (_self.pageIndex - 1) + index + 1;
  243. });
  244. _self.total = res.data.total;
  245. })
  246. },
  247. handleSelectionChange(val) {
  248. this.multipleSelection = val;
  249. },
  250. handleCurrentChange(val) {
  251. console.log(`当前页: ${val}`);
  252. this.refreshCurrentShow();
  253. },
  254. refreshCurrentShow: function() {
  255. if(this.searchProvTreeListCode){
  256. this.getTableData_sz1();
  257. }else{
  258. this.getTableData_sz();
  259. }
  260. },
  261. addObjectChange: function() {
  262. //提交当前选中对象
  263. var _self = this;
  264. var names = [];
  265. if(_self.addOnce){
  266. _self.addOnce = false;
  267. return;
  268. }
  269. _self.addOnce = true
  270. var objArr = [];
  271. const length = _self.multipleSelection.length;
  272. for (let i = 0; i < length; i++) {
  273. var obj = {};
  274. obj['code'] = _self.multipleSelection[i].id;
  275. obj['name'] = _self.multipleSelection[i].nm;
  276. obj['objId'] = _self.multipleSelection[i].objId;
  277. obj['ptype'] = _self.objType;
  278. objArr.push(obj);
  279. names.push(_self.multipleSelection[i].nm);
  280. }
  281. if(this.isNewPlan){
  282. var obj = {
  283. persid :this.userId,
  284. nm: this.dczName,
  285. id: this.dczId,
  286. persAllAreaDtoList: [],
  287. persAllDtoList: [],
  288. persAllObjDtoList: objArr
  289. };
  290. this.addOnce = false;
  291. this.dialogFormVisible = false;
  292. this.$message.success("选择成功");
  293. this.$emit("addSuccess",{obj:obj,names:names.join(",")});
  294. return;
  295. }
  296. try {
  297. request.post("/supervision/plan/insertSupervisionObj", {
  298. persid :this.userId,
  299. nm: this.dczName,
  300. id: this.dczId,
  301. persAllAreaDtoList: [],
  302. persAllDtoList: [],
  303. persAllObjDtoList: objArr
  304. }).then(response => {
  305. if (response.success == true) {
  306. _self.addOnce = false;
  307. _self.dialogFormVisible = false;
  308. _self.$message.success("添加成功");
  309. _self.$emit("addSuccess");
  310. }
  311. });
  312. } catch (e) {
  313. alert("暂无数据");
  314. }
  315. },
  316. provTreeSelectChangeHandler: function(params) {
  317. this.searchProvTreeListCode = params.code;
  318. this.getTableData_sz1();
  319. },
  320. provTreeSelectChangeHandler_qy(params){
  321. this.searchProvTreeListCode = params.code;
  322. this.getTableData_sz1();
  323. },
  324. }
  325. };
  326. </script>
  327. <style>
  328. </style>