99bc31dbbeec8183ccc9a82a8d25ef2d4dbf8208.svn-base 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <!-- 弹出窗 -->
  3. <draggable initWidth=1200 initHeight=585 title="督查人员" style="z-index: 500;top: 60px;left: 65px;background-color:white;" @closeDraggable="closeHandler">
  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. <provTreeList
  10. rootCode="000000"
  11. rootType="1"
  12. :style="{'max-height':tableHeight+'px'}"
  13. @provTreeSelectChange="provTreeSelectChangeHandler"
  14. ></provTreeList>
  15. </el-aside>
  16. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;">
  17. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">督查区域</p>
  18. <el-form :label-position="labelPosition" label-width="80px">
  19. <el-form-item style="margin-bottom: 0px;" label="" :label-width="formLabelWidth"></el-form-item>
  20. <div style="padding: 5px;">
  21. <!-- <div style="display:flex;height: 30px;padding: 10px;">
  22. <el-form-item label="行政区名称" style="display:flex;">
  23. <el-input style="width:140px;padding-left: 10px;" v-model="searchText" clearable placeholder="请输入名称"></el-input>
  24. </el-form-item>
  25. <el-select v-model="value" placeholder="请选择" style="width:100px;padding-left: 30px;padding-top: 3px;">
  26. <el-option
  27. v-for="item in options"
  28. :key="item.value"
  29. :label="item.label"
  30. :value="item.value">
  31. </el-option>
  32. </el-select>
  33. <el-button type="primary" style="margin-left:20px;" @click="getTableData">查询</el-button>
  34. </div> -->
  35. <el-table
  36. ref="menTable"
  37. border
  38. :data="currentShowList"
  39. tooltip-effect="dark"
  40. style="width: 100%;overflow:auto;"
  41. :style="{'height':tableHeight+'px'}"
  42. @selection-change="handleSelectionChange"
  43. >
  44. <el-table-column align="center" type="selection" width="70"></el-table-column>
  45. <el-table-column align="center" show-overflow-tooltip prop="index" label="序号" min-width="70"></el-table-column>
  46. <el-table-column align="center" show-overflow-tooltip prop="AD_NAME" label="名称" min-width="80"></el-table-column>
  47. <el-table-column align="center" show-overflow-tooltip prop="AD_CODE" label="编码" min-width="100"></el-table-column>
  48. </el-table>
  49. <!-- <div
  50. class="block"
  51. style="display:flex;flex-direction:row;justify-content:center;align-items:center;padding-top: 5px;background-color: #fff;"
  52. >
  53. <el-pagination
  54. small
  55. @current-change="handleCurrentChange"
  56. :current-page.sync="pageIndex"
  57. :page-size="pageSize"
  58. layout="total, prev, pager, next"
  59. :total="total"
  60. ></el-pagination>
  61. </div> -->
  62. <div slot="footer" class="dialog-footer" style="float: right;padding: 10px;">
  63. <el-button @click="closeHandler">取 消</el-button>
  64. <el-button type="primary" @click="addMens">确 定</el-button>
  65. </div>
  66. </div>
  67. <!-- </el-form-item> -->
  68. </el-form>
  69. </el-main>
  70. </el-container>
  71. </draggable>
  72. </template>
  73. <script>
  74. import request from '../../utils/gw_ajax_request.js';
  75. import provTreeList from '../../widgets/provTreeListAndChina.vue'
  76. import { getOptionalArea, addDcqyOthers } from "../../api/duChaPlan.js";
  77. import {dateFormat} from '../../utils/gw_date.js'
  78. import draggable from '../../widgets/draggable.vue'
  79. export default {
  80. components: {
  81. draggable,
  82. 'provTreeList':provTreeList,
  83. },
  84. props: ['dczId','dczName','jiGouId'],
  85. computed: {
  86. userId:function(){
  87. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  88. },
  89. },
  90. data() {
  91. return {
  92. addOnce:false,
  93. value:'2',
  94. options: [{
  95. value: '2',
  96. label: '省级'
  97. }, {
  98. value: '3',
  99. label: '市级'
  100. }, {
  101. value: '4',
  102. label: '县级'
  103. }],
  104. jgName:'',
  105. total: 0,
  106. addArr: "",
  107. labelPosition: "top",
  108. searchText: "",
  109. pageSize: 10,
  110. pageIndex: 1,
  111. currentShowList: [],
  112. dialogFormVisible: false,
  113. formLabelWidth: "120",
  114. checkList: [],
  115. personList: [],
  116. jigourenyuan: [],
  117. multipleSelection: [],
  118. searchProvTreeListCode :'',
  119. tableHeight:0,
  120. };
  121. },
  122. mounted() {
  123. this.searchProvTreeListCode = '';
  124. this.tableHeight = document.getElementById('contentRow').offsetHeight - 160;
  125. this.getTableData();
  126. this.addArr = '';
  127. },
  128. methods: {
  129. closeHandler(){
  130. this.$emit('close1','editDuChaqy')
  131. },
  132. showDialog() {
  133. this.dialogFormVisible = true;
  134. this.getTableData();
  135. this.addArr = '';
  136. },
  137. handleSelectionChange(val) {
  138. this.multipleSelection = val;
  139. console.log(val)
  140. },
  141. handleCurrentChange(val) {
  142. this.refreshCurrentShow();
  143. },
  144. getTableData() {
  145. //获取非当前督查需区域列表
  146. var _self = this;
  147. console.log(_self.dczInfo);
  148. getOptionalArea(this.dczId,this.searchProvTreeListCode).then(response => {
  149. var arr = response.data;
  150. arr.forEach((arrItem,index) =>{
  151. arrItem['index'] = (_self.pageSize * (_self.pageIndex-1)) + index + 1;
  152. });
  153. _self.currentShowList = arr;
  154. });
  155. },
  156. addMens: function() {
  157. //提交当前选中区域
  158. var _self = this;
  159. if(_self.addOnce){
  160. _self.addOnce = false;
  161. return;
  162. }
  163. _self.addOnce = true
  164. _self.multipleSelection.forEach((item,index)=>{
  165. item.id = _self.dczId;
  166. item['adCode'] = item.AD_CODE;
  167. item['adName'] = item.AD_NAME;
  168. })
  169. _self.addOnce = false;
  170. try {
  171. request.post('/dc/insp/selarea/muli/insert',_self.multipleSelection).then((res)=>{
  172. if (res.success) {
  173. _self.$message.success("添加成功");
  174. _self.$emit("addSuccess");
  175. this.dialogFormVisible = false;
  176. }
  177. });
  178. } catch (e) {
  179. this.$message.success("添加失败");
  180. }
  181. },
  182. refreshCurrentShow: function() {
  183. this.getTableData();
  184. },
  185. search() {},
  186. provTreeSelectChangeHandler:function(params){
  187. this.searchProvTreeListCode = params.code;
  188. this.getTableData();
  189. }
  190. }
  191. };
  192. </script>
  193. <style>
  194. #dialog .el-dialog__body {
  195. padding: 20px 20px;
  196. }
  197. </style>