index.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175
  1. <template>
  2. <div class="app-container">
  3. <div class="jeuhg">
  4. <h3 style="text-align: center; font-size: 30px; color: red; margin-bottom: 20px;">潜山市教育局{{titlet}}稿纸</h3>
  5. <el-form :model="querjtgoe" ref="querjtgoe" :rules="rules" v-show="showSearch" :inline="true">
  6. <el-row :gutter="10" class="mb8">
  7. <el-col :span="12" style="border: 1px solid red; border-bottom: 0; padding: 15px 0 15px 10px;" >
  8. <el-form-item :label="titlet + '字号:'" prop="message_code">
  9. <el-input placeholder="请输入内容" v-model="querjtgoe.message_code">
  10. <el-button slot="append" @click="ziao">历史字号</el-button>
  11. </el-input>
  12. </el-form-item>
  13. </el-col>
  14. <el-col :span="12" style="border: 1px solid red; border-bottom: 0; border-left: 0; padding: 15px 0 15px 10px;">
  15. <el-form-item :label="titlet + '日期:'" prop="message_time">
  16. <el-date-picker :disabled="false" @change="iChange" v-model="querjtgoe.message_time" value-format="yyyy-MM-dd" style="width: 100%" type="date" :placeholder="'请输入'">
  17. </el-date-picker>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="24" style="border: 1px solid red; border-bottom: 0; padding: 15px 0 15px 10px;">
  21. <el-form-item class="renhdy" label="正文上传:" prop="roleName">
  22. <el-upload :disabled="false" class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}"
  23. :action="process + '/boman-file/upload'" :on-change="handleChangert"
  24. :on-success="upImageFn" :on-error="err" :on-remove="reseImage" :file-list="config">
  25. <el-button size="small" type="primary">点击上传</el-button>
  26. </el-upload>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="24" style="border: 1px solid red; border-bottom: 0; padding: 15px 0 15px 10px;">
  30. <el-form-item class="renhdy" label="附件上传:" prop="roleName">
  31. <el-upload :disabled="false" class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}"
  32. :action="process + '/boman-file/upload'" :on-change="handleChangert"
  33. :on-preview="handlePictureCardPreview" :on-success="upImageFntwo" :on-error="err" :on-remove="reseImagetwo" :file-list="configtwo">
  34. <el-button size="small" type="primary">点击上传</el-button>
  35. </el-upload>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="24" style="border: 1px solid red; border-bottom: 0; padding: 15px 0 15px 10px;">
  39. <el-form-item class="renhdy" style="width: 100%;" label="分发人员:" prop="roleName">
  40. <el-input v-model="messageReun" :disabled="true" >
  41. <el-button slot="prepend" @click="changeren">选择人员</el-button>
  42. </el-input>
  43. <!-- <p style="display: flex; justify-content: space-between;">
  44. <span style="width: 80%;">23</span>
  45. <el-button size="small" type="primary">点击上传</el-button>
  46. </p> -->
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="24" style="border: 1px solid red; border-bottom: 0; padding: 15px 0 15px 10px;">
  50. <el-form-item class="renhdy" label="分发单位:" prop="ompany">
  51. <!-- <el-input
  52. type="textarea"
  53. autosize
  54. :disabled="true"
  55. placeholder="请输入内容"
  56. v-model="mpany.ompany">
  57. </el-input> infinite-list infinite-listty-->
  58. <ul class="infinite-listopma " v-infinite-scroll="load" style="overflow:auto">
  59. <li v-for="item in mpany.ompany" :key = 'item'>{{item}}</li>
  60. </ul>
  61. <!-- <p><span>34</span></p> -->
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="24" style="border: 1px solid red; border-bottom: 0; padding: 15px 0 15px 10px;">
  65. <el-form-item class="renhdy" label="角色名称:" prop="name">
  66. <ul class="infinite-listopma " v-infinite-scroll="load" style="overflow:auto">
  67. <li v-for="item in mpany.name" :key = 'item'>{{item}}</li>
  68. </ul>
  69. </el-form-item>
  70. </el-col>
  71. <el-col :span="24" style="border: 1px solid red; border-bottom: 0; padding: 15px 0 15px 10px;">
  72. <el-form-item label="文件标题:" prop="message_title">
  73. <el-input
  74. v-model="querjtgoe.message_title"
  75. placeholder="请输入文件标题"
  76. clearable
  77. size="small"
  78. style="width: 100%"
  79. @keyup.enter.native="handleQuery"
  80. />
  81. </el-form-item>
  82. </el-col>
  83. <el-col :span="24" style="border: 1px solid red; padding: 20px 0 20px 10px;">
  84. <el-form-item class="renhdy" label="备注:" prop="message_remark">
  85. <el-input
  86. type="textarea"
  87. autosize
  88. placeholder="请输入内容"
  89. v-model="querjtgoe.message_remark">
  90. </el-input>
  91. </el-form-item>
  92. </el-col>
  93. <el-col :span="24" style="text-align: right; padding-top: 20px;">
  94. <el-button type="danger" :disabled="taegshouw" @click="submitForm">提交</el-button>
  95. </el-col>
  96. </el-row>
  97. </el-form>
  98. </div>
  99. <!-- 添加或修改角色配置对话框 -->
  100. <el-dialog :close-on-click-modal="false" title="选择字号" :visible.sync="shouew" width="980px" append-to-body>
  101. <el-table @cell-click= 'cellClick' v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
  102. <el-table-column label="日志编号" align="center" prop="message_code" />
  103. </el-table>
  104. <pagination
  105. v-show="total>0"
  106. :total="total"
  107. :page.sync="queryParams.pageNum"
  108. :limit.sync="queryParams.pageSize"
  109. @pagination="getList"
  110. />
  111. </el-dialog>
  112. <!-- 分配角色数据权限对话框 -->
  113. <el-dialog :close-on-click-modal="false" title="选择人员" :visible.sync="modalShow" width="980px" append-to-body>
  114. <!-- <Flowshoe :instanceId="instanceId"></Flowshoe> -->
  115. <div class="tab_bott">
  116. <div class="tabBot_oje">
  117. <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
  118. <!-- :setCheckedKeys='setCheckedKeys' :getCheckedKeys = "getCheckedKeys" -->
  119. <el-tab-pane label="按部门" name="first">
  120. <div class="head-container">
  121. <el-input
  122. v-model="deptName"
  123. placeholder="请输入部门名称"
  124. clearable
  125. size="small"
  126. prefix-icon="el-icon-search"
  127. style="margin-bottom: 20px"
  128. />
  129. </div>
  130. <div class="head-container">
  131. <el-tree
  132. :data="deptOptions"
  133. :props="defaultProps"
  134. :expand-on-click-node="false"
  135. :filter-node-method="filterNode"
  136. ref="tree"
  137. default-expand-all
  138. @node-click="handleNodeClick"
  139. />
  140. </div>
  141. </el-tab-pane>
  142. <el-tab-pane label="按角色" name="second" style="height: 400px;">
  143. <treeselect v-model="form.parentId" :options="deptOptionstwo" :normalizer="normalizer" :flat="true" :maxHeight="150" @select="djieskle" placeholder="点击选择角色" />
  144. </el-tab-pane>
  145. <el-tab-pane label="按组" name="third" style="height: 400px;">
  146. <treeselect v-model="form.parentIdty" :options="deptOptionsthre" :normalizer="normalizerty" :flat="true" @select="djieskletwo" :maxHeight="350" placeholder="点击选择组" />
  147. </el-tab-pane>
  148. </el-tabs>
  149. </div>
  150. <div class="tabBot_two">
  151. <el-card class="box-card box-cardtt" shadow="always">
  152. <div slot="header" class="clearfix">
  153. <span>人员</span>
  154. <el-button style=" float: right; padding: 3px 10px;" type="danger" plain @click="eledelte">删除</el-button>
  155. <el-button style=" float: right; padding: 3px 10px;margin-right: 20px;" type="primary" plain @click="quande">全选</el-button>
  156. </div>
  157. <ul class="infinite-list infinite-listty" v-infinite-scroll="load" style="overflow:auto">
  158. <li
  159. v-for="(item, index) in liseh"
  160. :class="[ quandet==true? 'infinite-list-itemty infinite-list-itemss' : item.id == idneese.id ? 'infinite-list-itemty infinite-list-itemss' : 'infinite-list-itemty']"
  161. :key="index"
  162. @click="reyantt(item)"
  163. >
  164. {{ item.userName }}
  165. </li>
  166. </ul>
  167. </el-card>
  168. <el-card class="box-card box-cardtt" shadow="always">
  169. <div slot="header" class="clearfix">
  170. <span>已选择</span>
  171. <el-button style="float: right; padding: 3px 0" type="text" @click = 'determine'>确定</el-button>
  172. </div>
  173. <ul class="infinite-list infinite-listty" v-infinite-scroll="load" style="overflow:auto">
  174. <li v-for="item in lisehtwo" @click="lidele(item)" :key="item.id" class="infinite-list-item">
  175. {{ item.userName }}
  176. <img src="../../../assets/images/dele.png" alt="" class="index_navTimeimg" />
  177. </li>
  178. </ul>
  179. </el-card>
  180. </div>
  181. </div>
  182. </el-dialog>
  183. </div>
  184. </template>
  185. <script>
  186. import { listRoles,listIndex, delRole, addRole,addbjectSave, updateRole, exportRole, dataScope, changeRoleStatus, buent,issdanelist,issdaneid } from "@/api/system/isses";
  187. import {
  188. getToken
  189. } from "@/utils/auth";
  190. import {getUserProfile} from "@/api/system/config";
  191. import {tabsubm} from "@/api/system/table";
  192. import { group , getRole, getPersonnel, getMembers,delRoleses } from '@/api/system/election';
  193. import { listDept } from "@/api/system/dept";
  194. import { listRole } from "@/api/system/role";
  195. import { treeselect } from "@/api/system/dept";
  196. import Treeselect from "@riophae/vue-treeselect";
  197. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  198. export default {
  199. name: "Role",
  200. components: { Treeselect },
  201. data() {
  202. return {
  203. // 遮罩层
  204. loading: true,
  205. // 选中数组
  206. ids: [],
  207. // 非单个禁用
  208. single: true,
  209. // 无限滚动
  210. count: 0,
  211. // 非多个禁用
  212. multiple: true,
  213. // 显示搜索条件
  214. showSearch: true,
  215. // 总条数
  216. total: 0,
  217. // 部门名称
  218. deptName: undefined,
  219. // 角色表格数据
  220. roleList: [],
  221. // 弹出层标题
  222. title: "",
  223. // 是否显示弹出层
  224. open: false,
  225. // 是否显示弹出层(数据权限)
  226. openDataScope: false,
  227. menuExpand: false,
  228. menuNodeAll: false,
  229. deptExpand: true,
  230. deptNodeAll: false,
  231. // 日期范围
  232. dateRange: [],
  233. // 状态数据字典
  234. statusOptions: [],
  235. // 数据范围选项
  236. dataScopeOptions: [
  237. {
  238. value: "1",
  239. label: "全部数据权限"
  240. },
  241. {
  242. value: "2",
  243. label: "自定数据权限"
  244. },
  245. {
  246. value: "3",
  247. label: "本部门数据权限"
  248. },
  249. {
  250. value: "4",
  251. label: "本部门及以下数据权限"
  252. },
  253. {
  254. value: "5",
  255. label: "仅本人数据权限"
  256. }
  257. ],
  258. // 菜单列表
  259. menuOptions: [],
  260. // 部门列表
  261. deptOptions: [],
  262. // 角色
  263. deptOptionstwo:[],
  264. deptOptionsthre:[],
  265. // 查询参数
  266. queryParams: {
  267. },
  268. // 表单参数
  269. form: {},
  270. // 单位 名称
  271. mpany:{
  272. ompany:[],
  273. name:[]
  274. },
  275. defaultProps: {
  276. children: "children",
  277. label: "label"
  278. },
  279. // 表单校验
  280. rules: {
  281. message_code: [
  282. { required: true, message: "发文字号不能为空", trigger: "blur" }
  283. ],
  284. message_time: [
  285. { required: true, message: "发文日期不能为空", trigger: "blur" }
  286. ],
  287. message_title: [
  288. { required: true, message: "文件标题不能为空", trigger: "blur" }
  289. ]
  290. },
  291. dialogImageUrl: '',
  292. process: process.env.VUE_APP_BASE_API,
  293. dialogVisible: false,
  294. disabled: false,
  295. filterList: [],
  296. config: [],
  297. configtwo: [],
  298. shouew:false,
  299. modalShow:false,
  300. forew:{
  301. table:'',
  302. fixedData:{
  303. id:-1
  304. }
  305. },
  306. list:[],
  307. activeName:'first',
  308. querjtgoe:{
  309. message_code:'',
  310. message_title:'',
  311. message_remark:'',
  312. send_time:''
  313. },
  314. liseh: [
  315. ],
  316. queryParamsser:{
  317. table:'',
  318. orderBy:'create_time desc',
  319. pageSize:10,
  320. pageNo:1,
  321. showData:['message_code']
  322. },
  323. tabData:[],
  324. postList:[],
  325. faerform:{
  326. table: '',
  327. objId: -1,
  328. fixedData: {},
  329. children:[{
  330. table: '',
  331. objId: -1,
  332. fixedData:{}
  333. }]
  334. },
  335. lisehtwo:[
  336. ],
  337. data: [],
  338. deptList: [],
  339. rtuer: false,
  340. showtabc: 0,
  341. showche: false,
  342. idneese: {},
  343. quandet:false,
  344. dhiuw:[],
  345. // 组id
  346. elezu:0,
  347. fileList: [],
  348. titlet:'',
  349. tabled:'',
  350. objeuisd:-1,
  351. messageReun:'',
  352. frowtse:{
  353. },
  354. taegshouw:false,
  355. };
  356. },
  357. created() {
  358. this.forew.table = this.$route.query.tables;
  359. this.queryParamsser.table = this.$route.query.tables;
  360. this.tabled = this.$route.query.tables;
  361. this.objeuisd = this.$route.query.id - 0;
  362. this.forew.fixedData.id = this.$route.query.id - 0;
  363. this.faerform.objId = this.$route.query.id - 0;
  364. this.faerform.table = this.$route.query.tables;
  365. this.frowtse.businessTypeName = this.$route.query.tables;
  366. this.frowtse.dbname = this.$route.query.tables;
  367. this.querjtgoe.message_situation = this.$route.query.tabname - 0;
  368. if(this.$route.query.tabname == 'shouwen'){
  369. this.titlet = '收文'
  370. }else if(this.$route.query.tabname == 1){
  371. this.titlet = '发文'
  372. }
  373. if(this.objeuisd !== -1){
  374. this.frowtse.businessType = this.$route.query.id - 0;
  375. this.issdane()
  376. }
  377. this.getUser()
  378. this.gerdw()
  379. this.getList();
  380. this.getTreeselect()
  381. this.getDicts("sys_normal_disable").then(response => {
  382. this.statusOptions = response.data;
  383. });
  384. },
  385. methods: {
  386. /** 查询角色列表 */
  387. getList() {
  388. this.loading = true;
  389. console.log(this.forew)
  390. listRoles(this.forew).then(
  391. res => {
  392. console.log(res)
  393. if(res.data !== undefined){
  394. this.querjtgoe = res.data
  395. if(res.data.message_upload !== undefined && res.data.message_upload !== null ){
  396. this.config = JSON.parse(res.data.message_upload)
  397. // this.configtwo = res.data.message_enclosure
  398. }
  399. if(res.data.message_enclosure !== undefined && res.data.message_enclosure !== null ){
  400. // this.config = res.data.message_upload
  401. this.configtwo = JSON.parse(res.data.message_enclosure)
  402. }
  403. if(res.data.status == '未提交'){
  404. this.taegshouw = false
  405. }else{
  406. this.taegshouw = true
  407. }
  408. }
  409. }
  410. );
  411. },
  412. // 分发单位 人员名称查询
  413. issdane(){
  414. console.log(346)
  415. this.loading = false;
  416. let jueg = []
  417. let nese = []
  418. issdanelist(this.objeuisd).then(response => {
  419. if(response.code == 200){
  420. this.lisehtwo = response.data
  421. this.messageReun = '已选择' + response.data.length +'人'
  422. this.lisehtwo.filter(route=>{
  423. jueg.push(route.receive_dept_name)
  424. nese.push(route.receive_user_name)
  425. })
  426. this.mpany.ompany = jueg
  427. this.mpany.name = nese
  428. }
  429. // this.total = response.data.total;
  430. // this.tabData = response.data.tableHeadList;
  431. // this.postList = response.data.rows;
  432. // for(var i = 0 ; i < this.postList.length; i++){
  433. // console.log(this.postList[i].leavefrom_photo == '[]')
  434. // }
  435. this.loading = false;
  436. });
  437. },
  438. // 历史字号数据查询
  439. lishiList(){
  440. console.log(346)
  441. this.loading = false;
  442. listIndex(this.queryParamsser).then(response => {
  443. this.total = response.data.total;
  444. this.tabData = response.data.tableHeadList;
  445. this.postList = response.data.rows;
  446. for(var i = 0 ; i < this.postList.length; i++){
  447. console.log(this.postList[i].leavefrom_photo == '[]')
  448. }
  449. this.loading = false;
  450. });
  451. },
  452. // 取消按钮
  453. cancel() {
  454. this.open = false;
  455. this.reset();
  456. },
  457. // 取消按钮(数据权限)
  458. cancelDataScope() {
  459. this.openDataScope = false;
  460. this.reset();
  461. },
  462. // 表单重置
  463. reset() {
  464. if (this.$refs.menu != undefined) {
  465. this.$refs.menu.setCheckedKeys([]);
  466. }
  467. this.menuExpand = false,
  468. this.menuNodeAll = false,
  469. this.deptExpand = true,
  470. this.deptNodeAll = false,
  471. this.form = {
  472. roleId: undefined,
  473. roleName: undefined,
  474. roleKey: undefined,
  475. roleSort: 0,
  476. status: "0",
  477. menuIds: [],
  478. deptIds: [],
  479. menuCheckStrictly: true,
  480. deptCheckStrictly: true,
  481. remark: undefined
  482. };
  483. this.resetForm("form");
  484. },
  485. /** 搜索按钮操作 */
  486. handleQuery() {
  487. this.queryParams.pageNum = 1;
  488. this.getList();
  489. },
  490. /** 重置按钮操作 */
  491. resetQuery() {
  492. this.dateRange = [];
  493. this.resetForm("queryForm");
  494. this.handleQuery();
  495. },
  496. // 多选框选中数据
  497. handleSelectionChange(selection) {
  498. this.ids = selection.map(item => item.id)
  499. this.single = selection.length!=1
  500. this.multiple = !selection.length
  501. },
  502. // 树权限(展开/折叠)
  503. handleCheckedTreeExpand(value, type) {
  504. if (type == 'menu') {
  505. let treeList = this.menuOptions;
  506. for (let i = 0; i < treeList.length; i++) {
  507. this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
  508. }
  509. } else if (type == 'dept') {
  510. let treeList = this.deptOptions;
  511. for (let i = 0; i < treeList.length; i++) {
  512. this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
  513. }
  514. }
  515. },
  516. /** 提交按钮 */
  517. submitForm: function() {
  518. // 获取当前时间戳
  519. var date1 =new Date();
  520. // let tmie = Date.parse(date1) / 1000
  521. let tmie = this.dateFormat()
  522. console.log(tmie)
  523. if(this.lisehtwo.length == 0){
  524. this.msgSuccess("请选择分发人员");
  525. return false
  526. }
  527. for(var i = 0 ; i < this.lisehtwo.length; i++){
  528. this.faerform.children[i] = {table:'',objId:'',fixedData:{}}
  529. this.faerform.children[i].table = 'boman_message_receive'
  530. if(this.objeuisd == -1){
  531. this.faerform.children[i].objId = this.objeuisd
  532. }else{
  533. this.faerform.children[i].objId = this.lisehtwo[i].id
  534. }
  535. // this.faerform.children[i].fixedData.receive_user_id = this.lisehtwo[i]
  536. this.faerform.children[i].fixedData.message_id = 'fk.boman_message'
  537. this.faerform.children[i].fixedData.send_message_time = tmie
  538. if(this.objeuisd == -1){
  539. this.faerform.children[i].fixedData.receive_user_id = this.lisehtwo[i].id
  540. }else{
  541. this.faerform.children[i].fixedData.receive_user_id = this.lisehtwo[i].receive_user_id
  542. }
  543. this.faerform.children[i].fixedData.receive_user_name = this.lisehtwo[i].userName
  544. if(this.lisehtwo[i].dept !== undefined && this.lisehtwo[i].dept !==null){
  545. this.faerform.children[i].fixedData.receive_dept_name = this.lisehtwo[i].dept.deptName
  546. }else{
  547. this.faerform.children[i].fixedData.receive_dept_name = this.lisehtwo[i].deptName
  548. }
  549. }
  550. console.log(this.faerform.children[i])
  551. // this.faerform.children
  552. // this.querjtgoe.message_upload = JSON.stringify(this.querjtgoe.message_upload)
  553. // this.querjtgoe.message_enclosure = JSON.stringify(this.querjtgoe.message_enclosure)
  554. this.querjtgoe.message_id = 'fk.boman_message'
  555. this.querjtgoe.send_time = tmie
  556. this.faerform.fixedData = this.querjtgoe
  557. console.log(this.faerform)
  558. this.$refs["querjtgoe"].validate(valid => {
  559. // if (valid) {
  560. // if (this.form.roleId != undefined) {
  561. // this.form.menuIds = this.getMenuAllCheckedKeys();
  562. // updateRole(this.form).then(response => {
  563. // this.msgSuccess("修改成功");
  564. // this.open = false;
  565. // this.getList();
  566. // });
  567. // } else {
  568. // this.form.menuIds = this.getMenuAllCheckedKeys();
  569. addbjectSave(this.faerform).then(response => {
  570. // this.msgSuccess("操作成功");
  571. this.frowtse.businessCodes = response.data[0].data
  572. this.sbreulw()
  573. // this.$router.go(-1);
  574. // this.open = false;
  575. // this.getList();
  576. });
  577. // }
  578. // }
  579. });
  580. },
  581. /** 提交按钮(数据权限) */
  582. submitDataScope: function() {
  583. if (this.form.roleId != undefined) {
  584. this.form.deptIds = this.getDeptAllCheckedKeys();
  585. dataScope(this.form).then(response => {
  586. this.msgSuccess("修改成功");
  587. this.openDataScope = false;
  588. this.getList();
  589. });
  590. }
  591. },
  592. handleClick(index){
  593. if(index.index == 0){
  594. this.getTreeselect()
  595. }else if(index.index == 1){
  596. this.getTreeselectjue()
  597. }else if(index.index == 2){
  598. this.getTreeselecu()
  599. }
  600. },
  601. ziao(){
  602. console.log(23)
  603. this.shouew = true
  604. this.lishiList()
  605. },
  606. // 人员选择
  607. changeren(){
  608. this.modalShow = true
  609. },
  610. // 上传文件
  611. handleChangert(file, fileList) {
  612. this.fileList = fileList.slice(-3);
  613. },
  614. getToken() {
  615. return getToken()
  616. },
  617. reseImage(file, fileList) {
  618. let urls = ""
  619. if (file.response) {
  620. urls = file.response.url
  621. } else {
  622. urls = file.url
  623. }
  624. for (let i = this.config.length - 1; i >= 0; i--) {
  625. if (this.config[i].url == urls) {
  626. this.config.splice(i, 1);
  627. }
  628. }
  629. this.querjtgoe.message_upload = this.config
  630. },
  631. reseImagetwo(file, fileList) {
  632. let urls = ""
  633. if (file.response) {
  634. urls = file.response.url
  635. } else {
  636. urls = file.url
  637. }
  638. for (let i = this.configtwo.length - 1; i >= 0; i--) {
  639. if (this.configtwo[i].url == urls) {
  640. this.configtwo.splice(i, 1);
  641. }
  642. }
  643. console.log(this.configtwo)
  644. this.querjtgoe.message_enclosure = this.configtwo
  645. },
  646. handlePictureCardPreview(file) {
  647. console.log(file)
  648. this.dialogImageUrl = file.url;
  649. this.dialogVisible = true;
  650. },
  651. upImageFn(res, file) {
  652. if(res.code !== 200){
  653. this.msgSuccess('上传失败');
  654. return false
  655. }else{
  656. this.msgSuccess('上传成功');
  657. this.config.push(res.data);
  658. this.querjtgoe.message_upload = this.config
  659. this.querjtgoe.message_upload = JSON.stringify(this.querjtgoe.message_upload)
  660. }
  661. console.log(res)
  662. },
  663. upImageFntwo(res, file) {
  664. if(res.code == 200){
  665. this.msgSuccess('上传成功');
  666. this.configtwo.push(res.data);
  667. this.querjtgoe.message_enclosure = this.configtwo
  668. this.querjtgoe.message_enclosure = JSON.stringify(this.querjtgoe.message_enclosure)
  669. }else{
  670. this.msgSuccess('上传失败');
  671. return false
  672. }
  673. console.log(this.configtwo)
  674. },
  675. // 时间控件
  676. iChange(){
  677. },
  678. err(){
  679. this.msgSuccess("上传失败");
  680. console.log(35)
  681. },
  682. load(){
  683. },
  684. // 点击单元格
  685. cellClick(row){
  686. console.log(row)
  687. this.shouew = false
  688. this.querjtgoe.message_code = row.message_code
  689. },
  690. // 树形结构
  691. // 节点单击事件
  692. handleNodeClick(data) {
  693. console.log(data);
  694. // this.queryParams.deptId = data.id;
  695. this.staff(data.id);
  696. this.quandet = false
  697. // this.getList();
  698. },
  699. /** 查询部门下拉树结构 */
  700. getTreeselect() {
  701. treeselect().then(response => {
  702. this.deptOptions = response.data;
  703. });
  704. },
  705. // 查询角色
  706. getTreeselectjue() {
  707. this.loading = true;
  708. listRole(this.queryParams).then(response => {
  709. this.deptOptionstwo = this.handleTree(response.rows, "id");
  710. this.loading = false;
  711. });
  712. },
  713. // 查询组
  714. getTreeselecu() {
  715. this.loading = true;
  716. group(this.queryParams).then(response => {
  717. this.deptOptionsthre = this.handleTree(response.data, "id");
  718. this.loading = false;
  719. });
  720. },
  721. /** 转换角色数据结构 */
  722. normalizer(node) {
  723. // if (node.children && !node.children.length) {
  724. // delete node.children;
  725. // }
  726. return {
  727. id: node.id,
  728. label: node.roleName,
  729. };
  730. },
  731. /** 转换组数据结构 */
  732. normalizerty(node) {
  733. return {
  734. id: node.id,
  735. label: node.groupName,
  736. };
  737. },
  738. // 点击组/角色
  739. djieskle(node, instanceId) {
  740. this.personnel(node.id);
  741. console.log(node, instanceId);
  742. },
  743. djieskletwo(node, instanceId) {
  744. this.members(node.id);
  745. this.elezu = node.id
  746. console.log(node, instanceId);
  747. },
  748. check(data, value) {
  749. console.log(this.$refs.tree.getCheckedKeys());
  750. // 获取选中的子节点
  751. // let checkedKeys = this.$refs.tree.getCheckedKeys();
  752. // 获取选中的父节点
  753. let hafCheckedKeys = this.$refs.tree.getHalfCheckedKeys();
  754. console.log(this.$refs.tree.getHalfCheckedKeys());
  755. console.log(data, value);
  756. },
  757. // 点击全选
  758. quande(){
  759. var dueg = []
  760. dueg = (this.dhiuw)
  761. this.quandet = true
  762. var that = this
  763. // dueg.push(index)
  764. // this.lisehtwo = dueg
  765. // this.lisehtwo.push(index);
  766. // this.lisehtwo = [...new Set(this.lisehtwo)];
  767. // that.positions.map(train => {
  768. // that.new_Positions.push(train.trainId);
  769. // });
  770. // that.resultArr = []; //去重后的数组
  771. var flag;
  772. for (var i in dueg) {
  773. flag = true;
  774. for (var j in that.lisehtwo) {
  775. if (that.lisehtwo[j].id == dueg[i].id) {
  776. flag = false;
  777. break;
  778. }
  779. }
  780. if (flag) {
  781. that.lisehtwo.push(dueg[i]);
  782. }
  783. }
  784. },
  785. // 点击全部删除
  786. eledelte(){
  787. this.lisehtwo = []
  788. },
  789. // 点击删除
  790. lidele(index) {
  791. for (let i = this.lisehtwo.length - 1; i >= 0; i--) {
  792. if (this.lisehtwo[i].id == index.id) {
  793. this.lisehtwo.splice(i, 1)
  794. }
  795. }
  796. },
  797. // 点击添加
  798. reyantt(index) {
  799. var dueg = [];
  800. this.idneese = index;
  801. var that = this
  802. dueg.push(index)
  803. // this.lisehtwo = dueg
  804. // this.lisehtwo.push(index);
  805. // this.lisehtwo = [...new Set(this.lisehtwo)];
  806. // that.positions.map(train => {
  807. // that.new_Positions.push(train.trainId);
  808. // });
  809. // that.resultArr = []; //去重后的数组
  810. var flag;
  811. for (var i in dueg) {
  812. flag = true;
  813. for (var j in that.lisehtwo) {
  814. if (that.lisehtwo[j].id == dueg[i].id) {
  815. flag = false;
  816. break;
  817. }
  818. }
  819. if (flag) {
  820. that.lisehtwo.push(dueg[i]);
  821. }
  822. }
  823. // for(var i = 0 ; i <this.lisehtwo.length; i++ ){
  824. // if(this.lisehtwo[i].id == index.id){
  825. // this.lisehtwo.splice(i,1)
  826. // }
  827. // }
  828. // })
  829. },
  830. // 点击确定
  831. determine(){
  832. var eledete = []
  833. this.lisehtwo.filter(route=>{
  834. eledete.push(route.id)
  835. })
  836. eledete = eledete.join(',')
  837. console.log(this.lisehtwo)
  838. this.messageReun = '已选择' + this.lisehtwo.length +'人'
  839. // this.elezu
  840. this.loading = true;
  841. buent(this.lisehtwo).then(response => {
  842. // this.lisehtwo = response.data;
  843. // this.dhiuw = response.data
  844. this.mpany.ompany = response.deptNameList
  845. this.mpany.name = response.roleNameList
  846. console.log( this.mpany.ompany)
  847. if(response.code == 200){
  848. this.msgSuccess('操作成功');
  849. this.modalShow = false
  850. }
  851. this.loading = false;
  852. });
  853. },
  854. checkItem(val, index) {
  855. console.log(val);
  856. this.showche = !this.showche;
  857. console.log(this.showche);
  858. var that = this;
  859. let jueg = [];
  860. let checkedCount = val.length;
  861. this.liseh[index].isCheck = checkedCount === this.liseh[index].children.length;
  862. this.liseh[index].isIndeterminate = checkedCount > 0 && checkedCount < this.liseh[index].children.length;
  863. this.liseh[index].children.filter(router => {
  864. // console.log(123)
  865. for (var i = 0; i < val.length; i++) {
  866. if (this.showche == true) {
  867. //选中
  868. console.log('选中');
  869. if (router.id == val[i]) {
  870. jueg.push(router);
  871. this.lisehtwo.push(router);
  872. // console.log(router)
  873. console.log(this.lisehtwo);
  874. for (var j = 0; j < that.lisehtwo.length; j++) {
  875. if (that.lisehtwo[i].id !== val[i]) {
  876. this.lisehtwo.push(router);
  877. }
  878. }
  879. // that.lisehtwo.filter(routers=>{
  880. // console.log(this.lisehtwo)
  881. // console.log(routers,val[i])
  882. // if(routers.id !== val[i]){
  883. // this.lisehtwo.push(router)
  884. // }
  885. // })
  886. }
  887. } else {
  888. // 取消选中
  889. }
  890. }
  891. });
  892. // this.lisehtwo.push(jueg)
  893. console.log(this.lisehtwo);
  894. // console.log(this.liseh[index].isIndeterminate)
  895. },
  896. checkTitle(val, index) {
  897. console.log(val, index);
  898. let arr = [];
  899. let jueg = [];
  900. const re = this.liseh[index].children;
  901. //全选
  902. if (val) {
  903. for (let i = 0; i < re.length; i++) {
  904. arr[i] = re[i]['id'];
  905. jueg[i] = re[i];
  906. this.lisehtwo.push(re[i]);
  907. }
  908. // this.lisehtwo.push(jueg)
  909. } else {
  910. this.lisehtwo = [];
  911. }
  912. console.log(this.lisehtwo);
  913. this.liseh[index].checkedData = arr;
  914. this.liseh[index].isIndeterminate = false;
  915. },
  916. // 筛选节点
  917. filterNode(value, data) {
  918. if (!value) return true;
  919. return data.label.indexOf(value) !== -1;
  920. },
  921. // 按照部门查询人员
  922. staff(index) {
  923. this.loading = true;
  924. var that = this;
  925. getRole(index).then(response => {
  926. // this.deptOptionsthre = this.handleTree(response.data, "id");
  927. // this.rtuer = true
  928. this.liseh = []
  929. this.liseh = response.data;
  930. this.dhiuw = response.data
  931. this.loading = false;
  932. });
  933. },
  934. // 按照角色查询人员
  935. personnel(index) {
  936. this.loading = true;
  937. getPersonnel(index).then(response => {
  938. // this.deptOptionsthre = this.handleTree(response.data, "id"); this.liseh = response.data;
  939. this.liseh = []
  940. this.liseh = response.data;
  941. this.dhiuw = response.data
  942. this.loading = false;
  943. });
  944. },
  945. // 按照组查询人员
  946. members(index) {
  947. this.loading = true;
  948. getMembers(index).then(response => {
  949. // this.deptOptionsthre = this.handleTree(response.data, "id");
  950. // this.liseh = response.data;
  951. // response.data
  952. // this.lisehtwo.push(response.data)
  953. this.liseh = []
  954. this.liseh = response.data;
  955. // this.dhiuw = response.data
  956. // this.dhiuw.filter(route=>{
  957. // this.lisehtwo.push(route)
  958. // })
  959. this.loading = false;
  960. });
  961. },
  962. // 提交
  963. sbreulw(){
  964. tabsubm(this.frowtse).then(response => {
  965. if (response.resultCode == 0) {
  966. this.msgSuccess('提交成功');
  967. }
  968. this.$store.dispatch('tagsView/delView', this.$route);
  969. // this.reload();
  970. this.$router.go(-1)
  971. // this.formeanti.commitData = []
  972. // this.formy.status = 1
  973. // this.formeanti.commitData.push(this.formy)
  974. // this.antiSubmission();
  975. });
  976. },
  977. // 获取表单id
  978. gerdw(){
  979. issdaneid(this.faerform.table).then(res=>{
  980. console.log(res)
  981. this.frowtse.businessType = res.data.id
  982. })
  983. },
  984. // 用户信息
  985. getUser() {
  986. getUserProfile().then(response => {
  987. this.querjtgoe.send_user_id = response.data.id
  988. this.querjtgoe.send_user_name = response.data.userName
  989. this.querjtgoe.create_dept_nam = response.data.dept.deptName
  990. this.faerform.fixedData.send_user_id = response.data.id
  991. this.frowtse.initiator = response.data.id
  992. this.frowtse.userName = response.data.userName
  993. // this.user = response.data;
  994. // this.getLisalendar()
  995. // this.getLismemorandum()
  996. this.init();
  997. this.getList();
  998. });
  999. },
  1000. // 时间转换
  1001. dateFormat() {
  1002. var date = new Date();
  1003. var month = date.getMonth() + 1;
  1004. var strDate = date.getDate();
  1005. var hours = date.getHours()
  1006. var minus = date.getMinutes()
  1007. var secong = date.getSeconds()
  1008. if (month >= 1 && month <= 9) {
  1009. month = "0" + month;
  1010. }
  1011. if (strDate >= 0 && strDate <= 9) {
  1012. strDate = "0" + strDate;
  1013. }
  1014. if (hours >= 0 && hours <= 9) {
  1015. hours = "0" + hours;
  1016. }
  1017. if (minus >= 0 && minus <= 9) {
  1018. minus = "0" + minus;
  1019. }
  1020. if (secong >= 0 && secong <= 9) {
  1021. secong = "0" + secong;
  1022. }
  1023. var currentDate = date.getFullYear() + "-" + month + "-" + strDate
  1024. + " " + hours + ":" + minus + ":" + secong;
  1025. return currentDate;
  1026. },
  1027. }
  1028. // }
  1029. // }
  1030. };
  1031. </script>
  1032. <style lang="scss">
  1033. .jeuhg{
  1034. .el-form-item{
  1035. margin-bottom: 0;
  1036. width: 100%;
  1037. }
  1038. .el-form-item__content{
  1039. width: 80%;
  1040. }
  1041. .el-form-item__label{
  1042. color: red;
  1043. }
  1044. input{
  1045. background: none;
  1046. outline: none;
  1047. border: none;
  1048. }
  1049. .el-input-group__prepend{
  1050. background-color: #1890ff !important;
  1051. color: #fff !important;
  1052. }
  1053. .el-input-group__append{
  1054. background-color: #1890ff !important;
  1055. color: #fff !important;
  1056. }
  1057. .renhdy{
  1058. .el-form-item__content{
  1059. width: 85%;
  1060. }
  1061. }
  1062. .upload-demo{
  1063. text-align: right;
  1064. display: flex;
  1065. // ul{
  1066. // display: flex;
  1067. // }
  1068. }
  1069. .el-textarea__inner{
  1070. background-color: #fff !important;
  1071. border: 0 !important;
  1072. }
  1073. .el-input__inner{
  1074. background-color: #fff !important;
  1075. border: 0 !important;
  1076. }
  1077. .el-input.is-disabled .el-input__inner{
  1078. color: #333;
  1079. }
  1080. }
  1081. </style>
  1082. <style scoped lang="scss">
  1083. .app-container{
  1084. padding: 0 80px !important;
  1085. padding-top: 20px !important;
  1086. }
  1087. .infinite-list {
  1088. height: 150px;
  1089. margin-bottom: 20px;
  1090. .infinite-list-item {
  1091. width: 20% !important;
  1092. display: flex;
  1093. // justify-content: space-between;
  1094. align-items: center;
  1095. text-align: center;
  1096. list-style: none;
  1097. height: 30px;
  1098. // line-height: 30px;
  1099. }
  1100. .infinite-list-itemss {
  1101. color: #1890ff;
  1102. }
  1103. }
  1104. .infinite-listty {
  1105. display: flex;
  1106. flex-wrap: wrap;
  1107. .infinite-list-itemty {
  1108. width: 20%;
  1109. display: flex;
  1110. // justify-content: space-between;
  1111. height: 40px;
  1112. line-height: 40px;
  1113. // text-align: center;
  1114. list-style: none;
  1115. // border-radius: 40px;
  1116. // border: 1px solid #eee;
  1117. // border-bottom: 1px solid #eee;
  1118. }
  1119. }
  1120. // 分发人员
  1121. .infinite-listopma{
  1122. width: 100%;
  1123. display: flex;
  1124. flex-wrap: wrap;
  1125. justify-content: flex-start;
  1126. li{
  1127. list-style: none;
  1128. width: 20%;
  1129. }
  1130. }
  1131. .tab_bott {
  1132. display: flex;
  1133. }
  1134. .tabBot_oje {
  1135. width: 40%;
  1136. }
  1137. .tabBot_two {
  1138. width: 50%;
  1139. margin-left: 30px;
  1140. }
  1141. .box-cardtt{
  1142. margin-top: 30px;
  1143. }
  1144. .index_navTimeimg {
  1145. width: 10px;
  1146. height: 10px;
  1147. margin-left: 5px;
  1148. }
  1149. </style>