b332e73462e8aa2aeeaadcf01478ef371732d35e.svn-base 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  1. <template>
  2. <div class="edit_baseInfo">
  3. <p><span style="width:120px;padding-left: 10px;">水闸督查 > 督查分工</span><span class="hrs"></span></p>
  4. <div class="info_content" :style="{'height':contentHeight+'px'}" style="display:flex;flex-direction:row;justify-contnet:space-around;align-items:center;">
  5. <el-row style="height:100%;width:100%;" :gutter="20" id="contentRow">
  6. <el-col :span="9" style="height:100%;">
  7. <div class="grid-content bg-purple" style="height:100%;">
  8. <el-card class="box-card" style="height:100%;">
  9. <div slot="header" class="clearfix">
  10. <span>分工节点</span>
  11. </div>
  12. <!-- 左侧树 -->
  13. <div>
  14. <el-tree
  15. :highlight-current="true"
  16. style="height:100%;"
  17. :data="treeData"
  18. node-key="id"
  19. :expand-on-click-node="false"
  20. @node-click = 'treeNodeClickHandler'
  21. @node-expand = 'treeOpened'
  22. ref="jigou_tree"
  23. >
  24. <div class="custom-tree-node" slot-scope="{ node, data }">
  25. <span style="float:left:">{{ data.pnm}}
  26. <el-button v-if="data.id.length > 6 && userInThisGroup(data) && hasPriv1('manage')"
  27. type="text danger"
  28. icon="el-icon-circle-close"
  29. size="mini"
  30. style='color:red'
  31. @click="() => deletePICI(node, data)">
  32. </el-button>
  33. </span>
  34. <div style="float:right;display: flex;justify-content: flex-end;align-items: center;width:50%;">
  35. <span style="color:blue;width:80px;">
  36. <el-button v-if="data.id.length < 10 && hasPriv1('manage')"
  37. type="text"
  38. icon="el-icon-circle-plus"
  39. size="mini"
  40. @click="() => addPICI(node,data,'批次')">
  41. 新建
  42. </el-button>
  43. </span>
  44. </div>
  45. </div>
  46. </el-tree>
  47. </div>
  48. </el-card>
  49. </div>
  50. </el-col>
  51. <el-col :span="15" style="height:100%;">
  52. <div class="grid-content bg-purple" style="height:100%;">
  53. <el-card class="box-card" style="height:100%;">
  54. <!-- 右侧组件 -->
  55. <el-tabs v-model="activeContent" type="card" style="height:100%;width: 100%;">
  56. <el-tab-pane label="督查人员" name="first" style="overflow:auto" :style="{'height':(tabContentHeight-120)+'px'}" >
  57. <duChaRenYuanList v-if="showRightComponent" ref="renYuanList" :objType="duChaType" :dczId="currentSelectTreeNodeId" :dczName="currentSelectTreeNodeName" @showEditDialog="showEditDialog" ></duChaRenYuanList>
  58. </el-tab-pane>
  59. <el-tab-pane label="督查对象" name="second" style="overflow:auto" :style="{'height':(tabContentHeight-120)+'px'}" >
  60. <duChaDuiXiangList v-if="showRightComponent" ref="duiXiangList" :objType="duChaType" :plnaId ="plnaTreeCode" :dczId="currentSelectTreeNodeId" :dczName="currentSelectTreeNodeName"
  61. @showEditDialog_dx="showEditDialog_dx" @selectObjChange="selectObjChange" @emitCurrentObjSelectName="emitCurrentObjSelectName"></duChaDuiXiangList>
  62. </el-tab-pane>
  63. <el-tab-pane label="督查区域" name="third" style="overflow:auto" :style="{'height':(tabContentHeight-120)+'px'}" >
  64. <duChaQuYuList v-if="showRightComponent && duChaType=='6'" ref="qyList" :objType="duChaType" :dczId="currentSelectTreeNodeId" :dczName="currentSelectTreeNodeName"
  65. @showEditDialog="showEditDialog_qy" @selectObjChange="selectObjChange" @emitCurrentObjSelectName="emitCurrentObjSelectName"></duChaQuYuList>
  66. </el-tab-pane>
  67. </el-tabs>
  68. </el-card>
  69. </div>
  70. </el-col>
  71. </el-row>
  72. </div>
  73. <!-- 新建督查计划话框 -->
  74. <el-dialog title="新建督查计划" :visible.sync="addPlanDialogVisible">
  75. <el-form :model="duchaForm" :label-width="formLabelWidth" class="ducha_form">
  76. <el-form-item label="公文号">
  77. <el-input v-model="duchaForm.wenhao" placeholder="请输入内容"></el-input>
  78. </el-form-item>
  79. <el-form-item label="时间范围">
  80. <el-date-picker
  81. v-model="duchaForm.startDate"
  82. type="daterange"
  83. range-separator="至"
  84. start-placeholder="开始日期"
  85. end-placeholder="结束日期"
  86. value-format="yyyy-MM-dd"
  87. @blur="formInfo.date == '' ? showTipsTime = 1 : showTipsTime = 0">
  88. </el-date-picker>
  89. </el-form-item>
  90. <el-form-item label="计划名称">
  91. <el-input v-model="duchaForm.name" placeholder="请输入内容"></el-input>
  92. </el-form-item>
  93. <el-form-item label="类型">
  94. <el-select v-model="duchaForm.type" placeholder="请选择">
  95. <el-option
  96. v-for="item in options"
  97. :key="item.value"
  98. :label="item.label"
  99. :value="item.value">
  100. </el-option>
  101. </el-select>
  102. </el-form-item>
  103. <el-form-item label="发文单位">
  104. <span style="font-size: 12px;color: #888"> 监督司</span>
  105. </el-form-item>
  106. <el-form-item label="接收单位">
  107. <!-- <el-tree :data="treeDataForNewPlan" :props="defaultProps" @node-click="handleNodeClick"></el-tree> -->
  108. <el-checkbox-group v-model="duchaForm.receiveUnit">
  109. <el-checkbox v-for="item in lyjgList" :key="item.orgCode" :label="item.orgName"></el-checkbox>
  110. </el-checkbox-group>
  111. </el-form-item>
  112. <el-form-item label="抄送单位">
  113. <el-checkbox-group v-model="duchaForm.copyUnit">
  114. <el-checkbox v-for="item in lyjgList" :key="item.orgCode" :label="item.orgName"></el-checkbox>
  115. </el-checkbox-group>
  116. </el-form-item>
  117. <el-form-item label="附件">
  118. <el-upload
  119. class="upload-demo"
  120. action="/pdcApi/file/insert"
  121. :data="formData"
  122. :on-remove="handleRemove"
  123. :file-list="fileList"
  124. :on-error="fileUpErr"
  125. :on-success="fileSuccess">
  126. <el-button size="small" type="primary">点击上传</el-button>
  127. <div slot="tip" class="el-upload__tip">只能上传doc/pdf文件,且不超过500kb</div>
  128. </el-upload>
  129. </el-form-item>
  130. </el-form>
  131. <div slot="footer" class="dialog-footer">
  132. <el-button @click="addPlanDialogVisible = false">取 消</el-button>
  133. <el-button type="primary" @click="appendPlan" >确 定</el-button>
  134. </div>
  135. </el-dialog>
  136. <!-- 新建批次对话框 -->
  137. <el-dialog :title="'新建' + addTypeText" :visible.sync="addPICIDialogVisible">
  138. <el-form :model="piciForm" :label-width="formLabelWidth">
  139. <el-form-item :label="addTypeText + '名称'">
  140. <el-input v-model="piciForm.name" placeholder="请输入内容"></el-input>
  141. </el-form-item>
  142. <el-form-item label="时间范围" v-if="currentSelectTreeNodeId.length > 3">
  143. <el-date-picker
  144. v-model="piciForm.startDate"
  145. type="daterange"
  146. range-separator="至"
  147. start-placeholder="开始日期"
  148. end-placeholder="结束日期"
  149. value-format="yyyy-MM-dd"
  150. @blur="formInfo.date == '' ? showTipsTime = 1 : showTipsTime = 0">
  151. </el-date-picker>
  152. </el-form-item>
  153. </el-form>
  154. <div slot="footer" class="dialog-footer">
  155. <el-button @click="addPICIDialogVisible = false">取 消</el-button>
  156. <el-button type="primary" @click="appendPICI" >确 定</el-button>
  157. </div>
  158. </el-dialog>
  159. <editDczInfo ref="editDczInfoRef" :dczId="currentSelectTreeNodeId" :jiGouId="orgId" @addSuccess="RenYuanaAddSuccessHandler"></editDczInfo>
  160. <editDcdxInfosz ref="editDcdxInfoRef" :objType="duChaType" :plnaId ="currentSelectTreeNodeId" :dczId="currentSelectTreeNodeId" @addSuccess="DuiXiangAddSuccessHandler"></editDcdxInfosz>
  161. <!-- <editDcdxInfo ref="editDcdxInfoRef" :objType="duChaType" :plnaId ="currentSelectTreeNodeId" :dczId="currentSelectTreeNodeId" @addSuccess="DuiXiangAddSuccessHandler"></editDcdxInfo> -->
  162. <editDcqyInfo ref="editDcqyInfoRef" :objType="duChaType" :plnaId ="currentSelectTreeNodeId" :dczId="currentSelectTreeNodeId" @addSuccess="quYuAddSuccessHandler"></editDcqyInfo>
  163. <!-- 新建督查组对话框 -->
  164. <el-dialog title="新建督查组" :visible.sync="addZuDialogVisible">
  165. <el-form :model="zuForm" class="duchazu_form">
  166. <el-form-item label="督查组名称" :label-width="formLabelWidth">
  167. <el-input v-model="zuForm.name" placeholder="请输入内容"></el-input>
  168. </el-form-item>
  169. <!-- <el-form-item label="组长" :label-width="formLabelWidth">
  170. <el-select v-model="zuForm.leaderCode" placeholder="请选择督查组组长" @change="zuLeaderChange">
  171. <el-option v-for="person in jigourenyuan" :label="person.personName" :key="person.personCode" :value="person.personCode"></el-option>
  172. </el-select>
  173. </el-form-item> -->
  174. <el-form-item label="督查组员" :label-width="formLabelWidth">
  175. <el-input placeholder="请输入姓名" v-model="member_search" style="width: 200px;padding-bottom: 10px;" class="input-with-select">
  176. <el-button slot="append" icon="el-icon-search" @click="search"></el-button>
  177. </el-input>
  178. </el-form-item>
  179. <el-form-item label="" :label-width="formLabelWidth">
  180. <!-- <el-transfer
  181. style="text-align: left; display: inline-block"
  182. v-model="zuForm.member"
  183. :props="{
  184. key: 'personCode',
  185. label: 'personName'
  186. }"
  187. :titles="['机构人员', '组员']"
  188. @change="zuMemberChange"
  189. :data="jigourenyuan">
  190. </el-transfer> -->
  191. <el-table border :data="currentShowList" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange"
  192. ref="multipleTable" :row-class-name="tableRowClassName">
  193. <el-table-column type="selection" width="40"></el-table-column>
  194. <el-table-column prop="persName" width="100" label="姓名"></el-table-column>
  195. <el-table-column prop="sex" label="性别" width="50">
  196. <template slot-scope="scope">
  197. <span>{{scope.row.sex == '1' ? '女' : '男'}}</span>
  198. </template>
  199. </el-table-column>
  200. <el-table-column prop="telnumb" label="电话"></el-table-column>
  201. <el-table-column prop="status" label="在职状态">
  202. <template slot-scope="scope">
  203. <span>{{scope.row.status == '1' ? '在岗' : '离岗'}}</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column prop="bornPlac" label="户籍"></el-table-column>
  207. <el-table-column label="操作">
  208. <template slot-scope="scope">
  209. <!-- <el-radio v-model="radio" label="scope.persCode" @change="addGroupLeader(scope.row,$event)"></el-radio> -->
  210. <span :class="{'blue': isGroupLeader === scope.$index}" @click="addGroupLeader(scope,$event)" style="cursor:pointer">设置组长</span>
  211. </template>
  212. </el-table-column>
  213. </el-table>
  214. <div class="block" style="display:flex;flex-direction:row;justify-content:center;align-items:center;padding-top: 5px;background-color: #fff;">
  215. <el-pagination
  216. small
  217. @current-change="handleCurrentChange"
  218. :pager-count="5"
  219. :current-page.sync="pageIndex"
  220. :page-size="pageSize"
  221. layout="total, prev, pager, next"
  222. :total="total">
  223. </el-pagination>
  224. </div>
  225. </el-form-item>
  226. </el-form>
  227. <div slot="footer" class="dialog-footer">
  228. <el-button @click="addZuDialogVisible = false">取 消</el-button>
  229. <el-button type="primary" @click='appendZU' >确 定</el-button>
  230. </div>
  231. </el-dialog>
  232. <!-- 管理人员框 -->
  233. <transition name="fade">
  234. <draggable v-if="showDetailpdfGzfa" initWidth=1000 initHeight=650 title="" style="z-index: 50000;top: 60px;left: 165px;background-color:white;" @closeDraggable="hiddenDetailGzfa">
  235. <div class="" style="height:100%;background-color:rgba(249,249,249,0.7);border-radius:0px 0px 10px 10px;padding-bottom: 10px;">
  236. <iframe id="gzfaPdf" width="100%" height="100%" :src="pdfTitle" color="white" background-color="white" currentScaleValue="page-width"></iframe>
  237. </div>
  238. </draggable>
  239. </transition>
  240. </div>
  241. </template>
  242. <script>
  243. import request from '../../utils/gw_ajax_request.js';
  244. import index from '../../router';
  245. import duChaDuiXiangList from '../duChaGuanLi/duChaDuiXiangList_xsk.vue';
  246. import duChaQuYuList from '../duChaGuanLi/duChaQuYuList.vue';
  247. import draggable from '../../widgets/draggable.vue'
  248. import {dateFormat} from '../../utils/gw_date.js'
  249. import {createNewDcPlan,findFileByBiz,getProvincialOrgList} from '../../api/duChaPlan.js'
  250. export default {
  251. props: [],
  252. components: {
  253. draggable,
  254. 'duChaDuiXiangList':duChaDuiXiangList,
  255. 'duChaQuYuList':duChaQuYuList,
  256. duChaRenYuanList:resolve => {require(['../duChaGuanLi/duChaRenYuanList.vue'],resolve)},
  257. editDczInfo:resolve => {require(['./editDczInfo.vue'],resolve)},
  258. editDcdxInfosz:resolve => {require(['./editDcdxInfo_sz.vue'],resolve)},
  259. editDcdxInfo:resolve => {require(['./editDcdxInfo.vue'],resolve)},
  260. editDcqyInfo:resolve => {require(['./editDcqyInfo.vue'],resolve)},
  261. },
  262. data() {
  263. return {
  264. showRightComponent:false,
  265. contentHeight:window.innerHeight - 165,
  266. options: [
  267. {
  268. value: '1',
  269. label: '小水库督查计划'
  270. }, {
  271. value: '2',
  272. label: '农村饮用水工程督查计划'
  273. }, {
  274. value: '3',
  275. label: '水毁工程督查计划'
  276. }],
  277. lyjgList:[
  278. ],
  279. checkList:[],
  280. checkList1:[],
  281. pageIndex:1,
  282. pageSize:10,
  283. total:0,
  284. currentShowList:[],
  285. input5:'',
  286. formData:'',
  287. fileList:[],
  288. activeContent:'first',
  289. defaultPlan:'',
  290. dczInfo:{},
  291. dcdxInfo:{},
  292. // showEditDczInfo:false,
  293. duChaType:6,
  294. duChaCode:'',
  295. duChaName:'',
  296. planList: [],//督查列表
  297. fileUpData:[],//文件上传之后返回的文件信息
  298. tabContentHeight:0,
  299. deleteFlag:false,
  300. //业务用
  301. addPlanDialogVisible: false,
  302. addZuDialogVisible:false,
  303. addPICIDialogVisible:false,
  304. currentDuChaInformation:{
  305. "guid": "",
  306. "schmId": "",
  307. "schmNum": "",
  308. "schmTitle": "",
  309. "schmMkps": "",
  310. "schmType": "",
  311. "schmCdpcode": "",
  312. "schmSttm": "",
  313. "schmEnttm": "",
  314. "schmIntm": "",
  315. "schmUptm": '',
  316. "schmNote": "",
  317. "receiveDept": null,
  318. "copyDept": null,
  319. "fileList": null
  320. },
  321. //督查计划信息
  322. duchaForm:{
  323. wenhao: '',
  324. name:'',
  325. type:'',
  326. startDate:'',
  327. sendUnit: '监督司',
  328. receiveUnit: [],
  329. copyUnit: []
  330. },
  331. formLabelWidth:'120px',
  332. treeParams: {
  333. 'guid': '',
  334. 'userId': '',
  335. 'type': '',
  336. 'code': ''
  337. },
  338. treeData:[],
  339. organizationTree: [],
  340. addPICITreeNode:'',
  341. addZUTreeNode:'',
  342. //test
  343. addZuDialogVisible:false,
  344. zuForm: {
  345. name:'',
  346. leaderCode:'',
  347. leaderName:'',
  348. member:[],
  349. dist:'',
  350. target:[],
  351. },
  352. piciForm:{
  353. name:'',
  354. startDate:'',
  355. endDate:'',
  356. },
  357. jigourenyuan:[
  358. ],
  359. defaultProps: {
  360. children: 'children',
  361. label: 'label'
  362. },
  363. currentSelectTreeNodeName:'',
  364. currentSelectTreeNodeCode:'',
  365. currentSelectTreeNodeType:'',
  366. currentSelectTreeNodeId:'',
  367. plnaTreeCode:'',
  368. plnaTreeName:'',
  369. plnaTreeType:'',
  370. currentShowList:[
  371. // {
  372. // name: '张三',
  373. // tel: '110',
  374. // position: '处长',
  375. // jobTitle: '大师',
  376. // office: '黄河流域委员会'
  377. // },
  378. // {
  379. // name: '李四',
  380. // tel: '110',
  381. // position: '处长',
  382. // jobTitle: '大师',
  383. // office: '黄河流域委员会'
  384. // }
  385. ],
  386. isGroupLeader: '',
  387. groupLeaderId: '',
  388. memberId: '',
  389. memberIds: [],
  390. member_search: '',
  391. defaultDC: '',
  392. showDetailpdfGzfa:false,
  393. pdfTitle:'',
  394. fileName:'',
  395. fileObj:{},//存储文件相关对象
  396. firstMakeTree:true,
  397. staticJIGOUData:{
  398. '100':'水利部',
  399. '101':' 长江水利委员会',
  400. '102':'黄河水利委员会',
  401. '103':'淮河水利委员会',
  402. '104':'海河水利委员会',
  403. '105':'珠江水利委员会',
  404. '106':'松辽水利委员会',
  405. '107':'太湖流域管理局',
  406. '108':'中国水利水电科学研究院',
  407. '109':'中国灌溉排水发展中心',
  408. '110':'部督查办',
  409. },
  410. addType: '',
  411. addTypeText: '',
  412. }
  413. },
  414. computed:{
  415. userId:function(){
  416. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  417. },
  418. userInAllNode:function(){//当前登录用户所在的所有组信息
  419. return JSON.parse(localStorage.getItem("allNode"))? JSON.parse(localStorage.getItem("allNode")): []
  420. },
  421. orgId() {
  422. return localStorage.getItem("guid") ? localStorage.getItem("guid") : "";
  423. },
  424. orgName(){
  425. return localStorage.getItem("orgName")? localStorage.getItem("orgName"): ''
  426. },
  427. userType(){
  428. return localStorage.getItem("userType")? localStorage.getItem("userType"): '1'
  429. },
  430. currentShowLists:function(){
  431. return this.currentShowList.filter(item => item.persName.indexOf(this.member_search) > -1)
  432. },
  433. isAdmin:function(){
  434. return localStorage.getItem("isAdmin")? localStorage.getItem("isAdmin"): ''
  435. }
  436. },
  437. watch:{
  438. },
  439. mounted(){
  440. this.getPlanlist()
  441. this.getLeftTreeData();
  442. // this.getProvince()
  443. this.tabContentHeight = document.getElementById('contentRow').offsetHeight;
  444. this.showRightComponent = true;
  445. },
  446. methods:{
  447. hasPriv1(item){
  448. return this.ownPriv(item)
  449. },
  450. //判断当前用户 是否在该节点下 在 则没有删除权限
  451. userInThisGroup(item){
  452. var _self = this;
  453. if(_self.userInAllNode && _self.userInAllNode.length>0){
  454. for(var i=0;i<_self.userInAllNode.length;i++){
  455. if(_self.userInAllNode[i].id.substring(0,3)=='001'){
  456. if(item.id.length>_self.userInAllNode[i].id.length){
  457. return true;
  458. }else{
  459. return false;
  460. }
  461. }else{
  462. return true;
  463. }
  464. }
  465. }else{
  466. return true;
  467. }
  468. },
  469. tableRowClassName({row, rowIndex}) {
  470. if (rowIndex === this.isGroupLeader) {
  471. return 'zuzhang';
  472. }
  473. return '';
  474. },
  475. hiddenDetailGzfa:function(){
  476. this.showDetailpdfGzfa = false;
  477. },
  478. showPdfGzfa:function(){
  479. var pdfUrl = this.fileObj;
  480. if(pdfUrl.filePath.substring(pdfUrl.filePath.length-3) == 'doc' ||pdfUrl.filePath.substring(pdfUrl.filePath.length-4) == 'docx'){
  481. window.open('/pdcApi/'+pdfUrl.filePath);
  482. this.showDetailpdfGzfa = false;
  483. }else if(pdfUrl.filePath.substring(pdfUrl.filePath.length-3) == 'pdf'){
  484. this.showDetailpdfGzfa = true;
  485. this.pdfTitle = '/pdcApi/'+pdfUrl.filePath;
  486. };
  487. },
  488. createNewPlan(){
  489. this.addPlanDialogVisible = true;
  490. this.fileName = "";
  491. this.fileList = [];
  492. this.fileUpData = [];
  493. this.duchaForm = {
  494. wenhao: '',
  495. name:'',
  496. type:'',
  497. startDate:'',
  498. sendUnit: '监督司',
  499. receiveUnit: [],
  500. copyUnit: []
  501. };
  502. this.getTreeForNewPlan();
  503. },
  504. getTreeForNewPlan(){
  505. var _self = this;
  506. var obj = {};
  507. obj.guid = this.orgId;
  508. obj.type = '1';
  509. obj.code = this.orgId;
  510. // request.get('/dc/organization/base/getOrganizationTreeByGuidAndOthers',{params:obj}).then((res)=>{
  511. // _self.lyjgList = res.data;
  512. // })
  513. getProvincialOrgList().then(res=>{
  514. _self.lyjgList = res.data;
  515. })
  516. },
  517. zuMemberChange(){
  518. },
  519. zuLeaderChange(){
  520. },
  521. addGroupLeader(scope,event){
  522. this.isGroupLeader = scope.$index
  523. this.groupLeaderId = scope.row.guid
  524. this.memberIds.forEach((ele)=>{
  525. if(this.groupLeaderId == ele){
  526. console.log('选择组长')
  527. this.$refs.multipleTable.toggleRowSelection(scope.row,false)
  528. }
  529. })
  530. },
  531. handleSelectionChange(selection){
  532. // if(selection[selection.length - 1].guid == this.groupLeaderId){
  533. // selection.splice[selection.length - 1,1]
  534. // }
  535. this.memberIds = []
  536. console.log(selection)
  537. selection.forEach(element => {
  538. this.memberIds.push(element.guid)
  539. });
  540. this.memberId = this.memberIds.join(',')
  541. },
  542. //根据机构ID获取计划列表
  543. changePlan(data){
  544. this.planList.forEach((ele)=>{
  545. if(ele.schmId == data){
  546. this.defaultDC = ele
  547. }
  548. })
  549. },
  550. getPlanlist(){
  551. var _self = this;
  552. request.get('/dc/insp/scheme/getDCFAListByOrgId',{params:{'id': _self.orgId}}).then((res)=>{
  553. let objName = _self.staticJIGOUData[_self.orgId] ;
  554. let objCode = _self.orgId;
  555. let objtype = 2;
  556. _self.treeData.push({
  557. 'guid' : objCode,
  558. 'userId' : _self.orgId,
  559. 'type' : '1',
  560. 'code' : objCode,
  561. 'name' : objName
  562. });
  563. });
  564. },
  565. appendPlan(){
  566. var _self = this;
  567. var obj = {};
  568. var str_recieve = '';
  569. var str_copy = '';
  570. for(var i=0;i<this.lyjgList.length;i++){
  571. for(var j=0;j<this.duchaForm.receiveUnit.length;j++){
  572. if(this.lyjgList[i].orgName == this.duchaForm.receiveUnit[j]){
  573. str_recieve+=this.duchaForm.receiveUnit[j]+',';
  574. }
  575. }
  576. }
  577. for(var m=0;m<this.lyjgList.length;m++){
  578. for(var n=0;n<this.duchaForm.copyUnit.length;n++){
  579. if(this.lyjgList[m].orgName == this.duchaForm.copyUnit[n]){
  580. str_copy+=this.duchaForm.copyUnit[n]+',';
  581. }
  582. }
  583. }
  584. obj.schmNum = this.duchaForm.wenhao;//公文号
  585. obj.schmTitle = this.duchaForm.name;//计划名称
  586. obj.schmType = this.duchaForm.type;//类型
  587. obj.schmCdpcode = this.orgId;//发文单位代码
  588. obj.guid = this.orgId;//机构ID
  589. obj.schmSttm = this.duchaForm.startDate[0];
  590. obj.schmEnttm = this.duchaForm.startDate[1];
  591. obj.receiveDept = str_recieve;
  592. obj.copyDept = str_copy;
  593. obj.fileList = this.fileUpData;
  594. var params = {
  595. 'bisInspScheme':obj
  596. };
  597. request.post('/dc/insp/scheme',obj).then((res)=>{
  598. _self.getPlanlist()
  599. })
  600. // createNewDcPlan({'bisInspScheme':obj});
  601. this.addPlanDialogVisible = false
  602. },
  603. //根据用户id获取左侧树
  604. getLeftTreeData(){
  605. var _self = this;
  606. request.get('/dc/organization/base/getAllNode',{params:{'userId':this.userId,'orgType':'006'}}).then((res)=>{
  607. let data = res.data
  608. data.forEach(ele => {
  609. if(ele.pid == null || ele.pid == ''){
  610. ele.pid = '001'
  611. }if(ele.sttm==null || ele.sttm == ''){
  612. ele.sttm = ''
  613. }else{
  614. ele.sttm = dateFormat(ele.sttm,'yy-MM-dd');
  615. }if(ele.entm==null || ele.entm == ''){
  616. ele.entm = ''
  617. }else{
  618. ele.entm = dateFormat(ele.entm,'yy-MM-dd');
  619. }
  620. });
  621. data = _self.getTrees(data)
  622. _self.treeData = data;
  623. _self.currentSelectTreeNodeId = _self.treeData[0].id;
  624. // _self.duChaType = _self.treeData[0].id.substring(2,3);
  625. })
  626. },
  627. //格式化树形数据
  628. getTrees(list) {
  629. //@wxcwater重写方法 适应多个树
  630. let highLevelLength = 99;//预设最大节点id长度,目前最大应该为12,所以设置为99保证正常
  631. let _self =this;
  632. list.forEach((item,index)=>{
  633. item['pidLength'] = item.pid&&item.pid!=''?item.pid.length:0;
  634. if(highLevelLength>item.pidLength){
  635. highLevelLength = item.pidLength;
  636. }
  637. });
  638. console.log(highLevelLength);
  639. let heightLevelNode = [];
  640. list.forEach((item,index)=>{
  641. if(highLevelLength>=item.pidLength){
  642. heightLevelNode.push(item);
  643. }
  644. });
  645. list.forEach((item,index)=>{
  646. heightLevelNode.forEach((pItem)=>{
  647. _self.addTreeNode(pItem,item);
  648. });
  649. });
  650. console.log(heightLevelNode);
  651. return heightLevelNode;
  652. },
  653. addTreeNode:function(treeNode,leafNode){
  654. let _self = this;
  655. if(!treeNode.hasOwnProperty('children')){
  656. treeNode['children'] = [];
  657. }
  658. if(leafNode.pid == treeNode.id){
  659. treeNode.children.push(leafNode);
  660. return;
  661. }
  662. treeNode.children.forEach((item) => {
  663. _self.addTreeNode(item,leafNode);
  664. });
  665. },
  666. loadNode(node, resolve) {
  667. if (node.level === 0) {
  668. return resolve(this.treeData);
  669. }
  670. Object.assign(this.dczInfo,node)
  671. if (node.level > 4) return resolve([]);
  672. if(node.level == 2){
  673. // this.duChaType = node.data.code
  674. }
  675. this.treeParams.type = node.data.type
  676. this.treeParams.code = node.data.code
  677. request.get('/dc/organization/base/getOrganizationTreeByParams',{params:this.treeParams}).then((res)=>{
  678. let data = res.data
  679. if(!node.data.hasOwnProperty('children')){
  680. node.data['children'] = [];
  681. }
  682. node.data['children'] = data;
  683. resolve(data)
  684. })
  685. },
  686. treeNodeClickHandler:function(data,node,tree){
  687. if(this.deleteFlag){//如果点击删除节点 则不更新节点id
  688. this.deleteFlag = false;
  689. return;
  690. }
  691. // this.duChaType = data.id.substring(2,3);
  692. this.currentSelectTreeNodeName = data.name;
  693. this.currentSelectTreeNodeCode = data.code;
  694. this.currentSelectTreeNodeType = data.type;
  695. this.currentSelectTreeNodeId = data.id;
  696. if(data.type=='3'){
  697. this.plnaTreeCode = data.code;
  698. this.plnaTreeName = data.name;
  699. this.plnaTreeType = data.type;
  700. }
  701. },
  702. treeOpened(data,node,tree){
  703. this.currentSelectTreeNodeName = data.name;
  704. this.currentSelectTreeNodeCode = data.code;
  705. this.currentSelectTreeNodeType = data.type;
  706. this.currentSelectTreeNodeId = data.id;
  707. if(data.type=='3'){
  708. this.plnaTreeCode = data.code;
  709. this.plnaTreeName = data.name;
  710. this.plnaTreeType = data.type;
  711. }
  712. },
  713. handleNodeClick(){},
  714. getOrganizationTree(){
  715. this.treeParams.userId = this.userId
  716. this.treeParams.guid = this.orgId
  717. request.get('/dc/organization/base/getOrganizationTreeByParams',{params:this.treeParams}).then((res)=>{
  718. this.organizationTree = res.data
  719. this.treeData = this.organizationTree
  720. })
  721. },
  722. appendPICI() {
  723. console.log(this.addPICITreeNode)
  724. var _self = this;
  725. // let params = {
  726. // 'guid': this.addPICITreeNode.code,
  727. // 'prsnTitle': this.piciForm.name,
  728. // 'prsnId': this.userId,
  729. // 'palnSttm': this.piciForm.startDate[0],
  730. // 'palnEntm': this.piciForm.startDate[1]
  731. // }
  732. let params = {
  733. 'prsnTitle': this.piciForm.name,
  734. 'guid': this.addPICITreeNode.id,
  735. 'palnSttm': this.piciForm.startDate[0],
  736. 'palnEntm': this.piciForm.startDate[1]
  737. }
  738. request.post('/dc/insp/plan/addBisInspPlan',params).then((res)=>{
  739. const newChild = { id:res.data.code , pid:_self.addPICITreeNode.id,pnm:_self.piciForm.name,sttm:'',entm:'', children: [] };
  740. //to-do wxcwater 改这里。
  741. _self.$refs['jigou_tree'].append(newChild,_self.addPICITreeNode.id);
  742. _self.addPICIDialogVisible = false;
  743. })
  744. },
  745. appendZU() {
  746. let params = {
  747. 'guid': this.orgId,
  748. 'headmanId': this.groupLeaderId,
  749. 'inspGroupName': this.zuForm.name,
  750. 'memberId': this.memberId,
  751. 'plnaId': this.addZUTreeNode.code,
  752. "downStat": 2,
  753. "note": "备注"
  754. }
  755. request.post('/dc/insp/group/insertGroup',params).then((res)=>{
  756. const newChild = { code:res.data.code , type:res.data.type,name:res.data.name };
  757. //to-do 改这里
  758. this.$refs['jigou_tree'].append(newChild,this.addZUTreeNode.code);
  759. this.addZuDialogVisible = false;
  760. this.isGroupLeader = ''
  761. this.zuForm.name = ''
  762. })
  763. },
  764. deletePICI:function(node,data){
  765. this.deleteFlag = true;
  766. this.$confirm('是否删除批次:'+data.pnm+'及关联督查组?', '提示', {
  767. confirmButtonText: '确定',
  768. cancelButtonText: '取消',
  769. type: 'warning'
  770. }).then(() => {
  771. request.post(`/dc/insp/plan/${node.data.id}`).then((res)=>{
  772. if(res.success){
  773. if(res.message=="请先删除人员或对象"){
  774. this.$message({
  775. type: 'warning',
  776. message: '请先删除组内人员、对象及区域!'
  777. });
  778. }else{
  779. this.$refs.jigou_tree.remove(node)
  780. this.$message({
  781. type: 'success',
  782. message: '删除成功!'
  783. });
  784. }
  785. }
  786. })
  787. }).catch(() => {
  788. this.$message({
  789. type: 'info',
  790. message: '已取消删除'
  791. });
  792. });
  793. },
  794. deleteZU:function(node,data){
  795. this.$confirm('是否删除督查组:'+data.name+'?', '提示', {
  796. confirmButtonText: '确定',
  797. cancelButtonText: '取消',
  798. type: 'warning'
  799. }).then(() => {
  800. request.post(`/dc/insp/group/delete?id=${node.data.code}`).then((res)=>{
  801. this.$refs.jigou_tree.remove(node)
  802. this.$message({
  803. type: 'success',
  804. message: '删除成功!'
  805. });
  806. })
  807. }).catch(() => {
  808. this.$message({
  809. type: 'info',
  810. message: '已取消删除'
  811. });
  812. });
  813. },
  814. afterRemove(node, data) {
  815. const parent = node.parent;
  816. const children = parent.data.children || parent.data;
  817. const index = children.findIndex(d => d.id === data.id);
  818. children.splice(index, 1);
  819. },
  820. addPICI:function(node,nodeData,addType){
  821. this.addPICITreeNode = node.data;
  822. this.addPICIDialogVisible = true;
  823. if(addType == '计划'){
  824. this.addType = 2
  825. // this.addTypeText = '计划'
  826. }else{
  827. this.addType = 3
  828. // this.addTypeText = '批次'
  829. }
  830. },
  831. addZU:function(node,nodeData){
  832. console.log(node.data)
  833. this.addZUTreeNode = node.data;
  834. this.addZuDialogVisible = true;
  835. let params = {
  836. 'orgGuid': this.orgId,
  837. 'pageSize' : this.pageSize,
  838. 'pageNum' : this.pageIndex
  839. }
  840. request.get('/dc/pers/base/findList', {params:params}).then((res)=>{
  841. this.currentShowList = res.data.list
  842. this.total = res.data.total
  843. })
  844. },
  845. zuLeaderChange(){},
  846. zuMemberChange(){},
  847. showEditDialog(item){
  848. // this.dczInfo = item;
  849. // this.showEditDczInfo = true;
  850. this.$refs['editDczInfoRef'].showDialog();
  851. },
  852. showEditDialog_dx(item){
  853. this.$refs['editDcdxInfoRef'].showDialog(this.duChaType);
  854. },
  855. showEditDialog_qy(item){
  856. this.$refs['editDcqyInfoRef'].showDialog();
  857. },
  858. emitCurrentObjSelectName(item){
  859. this.$refs['editDcdxInfoRef'].changeCurrentObjSelectName(item);
  860. },
  861. selectObjChange(item){
  862. // this.duChaType = item;
  863. },
  864. handleRemove(){
  865. },
  866. fileChange(){
  867. },
  868. fileSuccess(item){
  869. this.fileUpData.push(item.data);
  870. console.log('上传成功',item);
  871. },
  872. fileUpErr(item){
  873. console.log(item+"wenjian");
  874. if(item.status == 413){
  875. this.$message({
  876. message: '文件大小超出500K!',
  877. type: 'warning'
  878. });
  879. }
  880. },
  881. search(){
  882. var _self = this;
  883. let params = {
  884. 'orgGuid': this.orgId,
  885. 'pageSize' : this.pageSize,
  886. 'pageNum' : this.pageIndex,
  887. 'persName':_self.member_search
  888. }
  889. request.get('/dc/pers/base/findList', {params:params}).then((res)=>{
  890. this.currentShowList = res.data.list
  891. this.total = res.data.total
  892. })
  893. },
  894. handleCurrentChange(){
  895. let params = {
  896. 'orgGuid': this.orgId,
  897. 'pageSize' : this.pageSize,
  898. 'pageNum' : this.pageIndex
  899. }
  900. request.get('/dc/pers/base/findList', {params:params}).then((res)=>{
  901. this.currentShowList = res.data.list
  902. this.total = res.data.total
  903. })
  904. },
  905. RenYuanaAddSuccessHandler:function(){
  906. this.$refs['renYuanList'].getDcryResult();
  907. },
  908. DuiXiangAddSuccessHandler:function(){
  909. this.$refs['duiXiangList'].getDcdxList1();
  910. },
  911. quYuAddSuccessHandler:function(){
  912. this.$refs['qyList'].getDcqyResult();
  913. },
  914. },
  915. }
  916. </script>
  917. <style>
  918. .el-table .zuzhang {
  919. background:#f0f9eb;
  920. }
  921. .edit_baseInfo{
  922. width: 100%;
  923. height:100%;
  924. padding: 20px;
  925. box-sizing: border-box;
  926. }
  927. .edit_baseInfo h3{
  928. line-height: 30px;
  929. font-size: 16px;
  930. color: #333;
  931. font-weight: normal;
  932. }
  933. .edit_baseInfo .info_content{
  934. padding: 10px 10px 10px 10px;
  935. font-size: 14px;
  936. overflow: hidden;
  937. }
  938. .edit_baseInfo .el-col {
  939. border-radius: 4px;
  940. /* margin-right: 20px; */
  941. }
  942. .edit_baseInfo .bg-purple-dark {
  943. background: #99a9bf;
  944. }
  945. .edit_baseInfo .bg-purple {
  946. background: #d3dce6;
  947. }
  948. .edit_baseInfo .el-card__header{
  949. padding: 8px 20px;
  950. }
  951. .edit_baseInfo .text {
  952. font-size: 14px;
  953. cursor: pointer;
  954. }
  955. .edit_baseInfo .text:hover{
  956. background-color: #eee;
  957. }
  958. .edit_baseInfo .item {
  959. padding: 5px;
  960. }
  961. .edit_baseInfo .clearfix:before,
  962. .edit_baseInfo .clearfix:after {
  963. display: table;
  964. content: "";
  965. }
  966. .edit_baseInfo .clearfix:after {
  967. clear: both
  968. }
  969. .plan_container .plan_content{
  970. /* height: 200px; */
  971. padding: 10px 20px;
  972. font-size: 14px;
  973. }
  974. .plan_container .plan_content .el-card.is-always-shadow{
  975. box-shadow: 0 2px 6px 0 rgba(0,0,0,.1)
  976. }
  977. .plan_container h2{
  978. margin-bottom: 10px;
  979. font-size: 22px;
  980. color: #333;
  981. }
  982. .plan_container h2 .el-icon-arrow-down{
  983. font-size: 20px;
  984. cursor: pointer;
  985. }
  986. .plan_container h2 span{
  987. margin-left: 20px;
  988. font-size: 14px;
  989. color: #666;
  990. font-weight: normal;
  991. }
  992. .plan_container .el-icon-time{
  993. position: relative;
  994. top: 2px;
  995. margin-right: 6px;
  996. font-size: 20px;
  997. }
  998. .plan_container ul{
  999. width: 220px;
  1000. /* border: solid 1px #ccc; */
  1001. list-style: none;
  1002. border-radius: 3px;
  1003. box-shadow: 0 2px 6px #ccc;
  1004. position: absolute;
  1005. z-index: 9;
  1006. }
  1007. .plan_container ul li{
  1008. padding: 5px 10px;
  1009. color: #888;
  1010. }
  1011. .plan_container ul li:hover{
  1012. background-color: #eee;
  1013. cursor: pointer;
  1014. }
  1015. .title_container{
  1016. position: relative;
  1017. display:flex;
  1018. flex-direction:row;
  1019. justify-content:space-between;
  1020. align-items:center;
  1021. }
  1022. .title_container p{
  1023. display: inline-block;
  1024. font-size: 14px;
  1025. margin-left: 20px;
  1026. color: #666;
  1027. }
  1028. .hrall{
  1029. display: inline-block;
  1030. width: calc(100%);
  1031. height: 1px;
  1032. vertical-align: middle;
  1033. background-color: #ddd;
  1034. }
  1035. p .hrs{
  1036. display: inline-block;
  1037. width: calc(100% - 40px);
  1038. margin-left:10px;
  1039. height: 1px;
  1040. vertical-align: middle;
  1041. background-color: #ddd;
  1042. }
  1043. .activeListItem{
  1044. background-color:#409EFF !important;
  1045. color:white !important;
  1046. }
  1047. .listitem{
  1048. color:black;
  1049. background-color:white;
  1050. padding:3px;
  1051. transition:all .5s;
  1052. cursor:pointer;
  1053. }
  1054. .listitem:hover{
  1055. border:1px solid #409EFF;
  1056. cursor:pointer;
  1057. }
  1058. .info_content .el-card__body {
  1059. padding: 16px;
  1060. height: 88%;
  1061. overflow-y: auto;
  1062. /* display: flex; */
  1063. }
  1064. .custom-tree-node {
  1065. flex: 1;
  1066. display: flex;
  1067. align-items: center;
  1068. justify-content: space-between;
  1069. font-size: 15px;
  1070. padding-right: 8px;
  1071. }
  1072. .new_plan{
  1073. float: right;
  1074. }
  1075. .plan_content .el-card__body{
  1076. padding: 10px;
  1077. }
  1078. .file_info{
  1079. display: flex;
  1080. justify-content: space-between;
  1081. width: 80%;
  1082. color: #666;
  1083. }
  1084. .ducha_form .el-input{
  1085. width: 350px;
  1086. }
  1087. .duchazu_form .el-form-item__content{
  1088. padding: 3px 2px;
  1089. }
  1090. .blue{
  1091. color: blue;
  1092. }
  1093. body .el-table th.gutter{display: table-cell!important;}
  1094. .edit_baseInfo .el-checkbox{
  1095. margin-left:30px;
  1096. }
  1097. .duchazu_form .el-checkbox{
  1098. margin-left: 0;
  1099. }
  1100. </style>