You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

902 lines
28 KiB

  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList">
  4. <el-form-item :label="'BU'">
  5. <el-select v-model="searchData.bu" placeholder="请选择" clearable style="width: 130px">
  6. <el-option
  7. v-for = "i in userBuList"
  8. :key = "i.buNo"
  9. :label = "i.buDesc"
  10. :value = "i.buNo">
  11. </el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item :label="'审批组编码'">
  15. <el-input v-model="searchData.groupNo" clearable style="width: 120px"></el-input>
  16. </el-form-item>
  17. <el-form-item :label="'审批组名称'">
  18. <el-input v-model="searchData.groupDesc" clearable style="width: 120px"></el-input>
  19. </el-form-item>
  20. <el-form-item :label="'状态'">
  21. <el-select clearable v-model="searchData.active" style="width: 120px">
  22. <el-option label="启用" value="Y"></el-option>
  23. <el-option label="禁用" value="N"></el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item :label="' '">
  27. <el-button @click="getDataList">查询</el-button>
  28. <el-button type="primary" @click="addModal">新增</el-button>
  29. </el-form-item>
  30. </el-form>
  31. <el-table
  32. :height="height"
  33. :data="dataList"
  34. border
  35. style="width: 100%;">
  36. <el-table-column
  37. v-for="(item,index) in columnList" :key="index"
  38. :sortable="item.columnSortable"
  39. :prop="item.columnProp"
  40. :header-align="item.headerAlign"
  41. :show-overflow-tooltip="item.showOverflowTooltip"
  42. :align="item.align"
  43. :fixed="item.fixed==''?false:item.fixed"
  44. :min-width="item.columnWidth"
  45. :label="item.columnLabel">
  46. <template slot-scope="scope">
  47. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  48. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column
  52. fixed="right"
  53. header-align="center"
  54. align="center"
  55. width="160"
  56. label="操作">
  57. <template slot-scope="scope">
  58. <el-link style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
  59. <el-link style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
  60. <el-link style="cursor: pointer" @click="updateGroupBusinessModal(scope.row)">组成员</el-link>
  61. </template>
  62. </el-table-column>
  63. </el-table>
  64. <!-- 分页栏 -->
  65. <el-pagination
  66. @size-change="sizeChangeHandle"
  67. @current-change="currentChangeHandle"
  68. :current-page="pageIndex"
  69. :page-sizes="[20, 50, 100, 200, 500]"
  70. :page-size="pageSize"
  71. :total="totalPage"
  72. layout="total, sizes, prev, pager, next, jumper">
  73. </el-pagination>
  74. <el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="495px">
  75. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  76. <el-form-item label="审批组编码" prop="groupNo" :rules="rules.groupNo">
  77. <el-input v-model="modalData.groupNo" :disabled="modalDisableFlag" style="width: 110px"></el-input>
  78. </el-form-item>
  79. <el-form-item label="审批组名称" prop="groupDesc" :rules="rules.groupDesc">
  80. <el-input v-model="modalData.groupDesc" :disabled="modalDisableFlag" style="width: 210px"></el-input>
  81. </el-form-item>
  82. <el-form-item label="BU" prop="bu" :rules="rules.bu">
  83. <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 110px">
  84. <el-option
  85. v-for = "i in userBuList"
  86. :key = "i.buNo"
  87. :label = "i.buDesc"
  88. :value = "i.buNo">
  89. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  90. <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  91. {{ i.buDesc }}
  92. </span>
  93. </el-option>
  94. </el-select>
  95. </el-form-item>
  96. </el-form>
  97. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  98. <el-form-item label="状态" prop="active" :rules="rules.active">
  99. <el-select v-model="modalData.active" style="width: 110px">
  100. <el-option label="启用" value="Y"></el-option>
  101. <el-option label="禁用" value="N"></el-option>
  102. </el-select>
  103. </el-form-item>
  104. <el-form-item label="邮箱" prop="groupEmailAddress" :rules="rules.groupEmailAddress">
  105. <el-input v-model="modalData.groupEmailAddress" style="width: 210px"></el-input>
  106. </el-form-item>
  107. </el-form>
  108. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  109. <el-form-item label="备注">
  110. <el-input type="textarea" v-model="modalData.remark" style="width: 458px"></el-input>
  111. </el-form-item>
  112. </el-form>
  113. <el-footer style="height:30px;margin-top: 28px;text-align:center">
  114. <el-button type="primary" @click="saveData">保存</el-button>
  115. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  116. </el-footer>
  117. </el-dialog>
  118. <!-- 新增用户角色 -->
  119. <el-dialog title="审批组操作" :close-on-click-modal="false" v-drag :visible.sync="authGroupMemberSaveDialog" width="900px">
  120. <div style="font-size: 12px">
  121. <el-form :inline="true" label-position="top" :model="searchAuthBusinessData">
  122. <el-form-item :label="'用户名'">
  123. <el-input v-model="searchAuthBusinessData.username" clearable style="width: 120px"></el-input>
  124. </el-form-item>
  125. <el-form-item :label="'用户名称'">
  126. <el-input v-model="searchAuthBusinessData.userDisplay" clearable style="width: 200px"></el-input>
  127. </el-form-item>
  128. <el-form-item :label="' '">
  129. <el-button type="primary" @click="authGroupBusinessSearch()">查询</el-button>
  130. </el-form-item>
  131. </el-form>
  132. </div>
  133. <el-container style="margin-top: 0px;">
  134. <el-main style="width: 400px; padding: 1px">
  135. <span style="font-size: 12px" >可选审批人</span>
  136. <el-table
  137. height="400px"
  138. :data="allAuthBusinessList"
  139. border
  140. ref="allAuthBusinessTable"
  141. @row-click="allAuthBusinessClickRow"
  142. @selection-change="selectionAllAuthBusiness"
  143. highlight-current-row
  144. style="width: 100%">
  145. <el-table-column
  146. type="selection"
  147. header-align="center"
  148. align="center"
  149. :selectable="selectFlag"
  150. width="50">
  151. </el-table-column>
  152. <el-table-column
  153. prop="username"
  154. header-align="center"
  155. align="center"
  156. min-width="80"
  157. label="用户名">
  158. </el-table-column>
  159. <el-table-column
  160. prop="userDisplay"
  161. header-align="center"
  162. align="center"
  163. min-width="120"
  164. label="用户名称">
  165. </el-table-column>
  166. </el-table>
  167. </el-main>
  168. <el-main style="width: 111px;padding: 1px">
  169. <div style="margin-top: 182px;margin-left: 18px">
  170. <el-button type="primary" @click="addAuthGroupMemberBusiness()">添加>></el-button>
  171. </div>
  172. <div style="margin-top: 15px;margin-left: 18px">
  173. <el-button type="primary" @click="deleteAuthGroupMemberBusiness()">删除<<</el-button>
  174. </div>
  175. </el-main>
  176. <el-main style="width: 400px;padding: 1px">
  177. <span style="font-size: 12px" >已有审批人</span>
  178. <el-table
  179. height="400px"
  180. :data="isAuthBusinessList"
  181. border
  182. ref="isAuthBusinessTable"
  183. @row-click="isAuthBusinessClickRow"
  184. @selection-change="selectionIsAuthBusiness"
  185. highlight-current-row
  186. style="width: 100%">
  187. <el-table-column
  188. type="selection"
  189. header-align="center"
  190. align="center"
  191. :selectable="selectFlag"
  192. width="50">
  193. </el-table-column>
  194. <el-table-column
  195. prop="username"
  196. header-align="center"
  197. align="center"
  198. min-width="80"
  199. label="用户名">
  200. </el-table-column>
  201. <el-table-column
  202. prop="userDisplay"
  203. header-align="center"
  204. align="center"
  205. min-width="120"
  206. label="用户名称">
  207. </el-table-column>
  208. </el-table>
  209. </el-main>
  210. </el-container>
  211. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  212. <el-button type="primary" @click="authGroupMemberSaveDialog = false">关闭</el-button>
  213. </el-footer>
  214. </el-dialog>
  215. </div>
  216. </template>
  217. <script>
  218. import {
  219. authGroupSearch, // 审批组信息列表查询
  220. authGroupSave, // 审批组信息新增
  221. authGroupEdit, // 审批组信息编辑
  222. authGroupDelete // 审批组信息删除
  223. } from '@/api/auth/auth'
  224. import {getSiteAndBuByUserName} from "@/api/eam/eam.js"
  225. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  226. import Chooselist from '@/views/modules/common/Chooselist_eam'
  227. import TransferTable from "../common/transferTable.vue";
  228. import {
  229. addAuthGroupMemberBusiness,
  230. authBusinessSearch,
  231. authGroupBusinessSearch, deleteAuthGroupMemberBusiness,
  232. getAuthGroupBusinessList
  233. } from "../../../api/auth/auth";
  234. export default {
  235. components: {
  236. TransferTable,
  237. Chooselist
  238. },
  239. watch: {
  240. searchData: {
  241. deep: true,
  242. handler: function (newV, oldV) {
  243. this.searchData.groupNo = this.searchData.groupNo.toUpperCase()
  244. }
  245. },
  246. modalData: {
  247. deep: true,
  248. handler: function (newV, oldV) {
  249. this.modalData.groupNo = this.modalData.groupNo.toUpperCase()
  250. }
  251. }
  252. },
  253. data () {
  254. return {
  255. // 导出
  256. resultList: [],
  257. userBuList: [],
  258. // ======== 行高 ========
  259. height: 200,
  260. // ======== 分页 ========
  261. pageIndex: 1,
  262. pageSize: 50,
  263. totalPage: 0,
  264. authGroupMemberSaveDialog: false,
  265. searchAuthBusinessData:{
  266. site: this.$store.state.user.site,
  267. userName: this.$store.state.user.name,
  268. username:'',
  269. userDisplay:'',
  270. },
  271. authBusinessList:[],
  272. isAuthBusinessList:[],
  273. allAuthBusinessList:[],
  274. allAuthBusinessSelections:[],
  275. isAuthBusinessSelections:[],
  276. rowData:{},
  277. // 条件查询
  278. searchData: {
  279. site: this.$store.state.user.site,
  280. userName: this.$store.state.user.name,
  281. bu: '',
  282. buNo: '',
  283. groupNo: '',
  284. groupDesc: '',
  285. active: '',
  286. page: 1,
  287. limit: 10
  288. },
  289. modalData: {
  290. flag: '',
  291. title: '',
  292. bu: '',
  293. site: this.$store.state.user.site,
  294. userName: this.$store.state.user.name,
  295. buNo: '',
  296. recordType: '',
  297. authGroupId: '',
  298. groupNo: '',
  299. groupDesc: '',
  300. groupEmailAddress: '',
  301. remark: '',
  302. active: '',
  303. createBy: '',
  304. updateBy: '',
  305. createDate: '',
  306. updateDate: ''
  307. },
  308. // ======== 数据列表 ========
  309. dataList: [],
  310. // 展示列集
  311. columnList: [
  312. {
  313. userId: this.$store.state.user.name,
  314. functionId: 601005,
  315. serialNumber: '601005Table1BU',
  316. tableId: "601005Table1",
  317. tableName: "审批组信息表",
  318. columnProp: 'buDesc',
  319. headerAlign: "center",
  320. align: "left",
  321. columnLabel: 'BU',
  322. columnHidden: false,
  323. columnImage: false,
  324. columnSortable: false,
  325. sortLv: 0,
  326. status: true,
  327. fixed: '',
  328. columnWidth: 120
  329. },
  330. {
  331. userId: this.$store.state.user.name,
  332. functionId: 601005,
  333. serialNumber: '601005Table1GroupNo',
  334. tableId: "601005Table1",
  335. tableName: "审批组信息表",
  336. columnProp: 'groupNo',
  337. headerAlign: "center",
  338. align: "center",
  339. columnLabel: '审批组编码',
  340. columnHidden: false,
  341. columnImage: false,
  342. columnSortable: false,
  343. sortLv: 0,
  344. status: true,
  345. fixed: '',
  346. columnWidth: 120
  347. },
  348. {
  349. userId: this.$store.state.user.name,
  350. functionId: 601005,
  351. serialNumber: '601005Table1GroupDesc',
  352. tableId: "601005Table1",
  353. tableName: "审批组表",
  354. columnProp: 'groupDesc',
  355. headerAlign: "center",
  356. align: "left",
  357. columnLabel: '审批组名称',
  358. columnHidden: false,
  359. columnImage: false,
  360. columnSortable: false,
  361. sortLv: 0,
  362. status: true,
  363. fixed: '',
  364. columnWidth: 300
  365. },
  366. {
  367. userId: this.$store.state.user.name,
  368. functionId: 601005,
  369. serialNumber: '601005Table1GroupEmailAddress',
  370. tableId: "601005Table1",
  371. tableName: "审批组表",
  372. columnProp: 'groupEmailAddress',
  373. headerAlign: "center",
  374. align: "left",
  375. columnLabel: '邮箱',
  376. columnHidden: false,
  377. columnImage: false,
  378. columnSortable: false,
  379. sortLv: 0,
  380. status: true,
  381. fixed: '',
  382. columnWidth: 300
  383. },
  384. {
  385. functionId: 601005,
  386. serialNumber: '601005Table1Active',
  387. tableId: '601005Table1',
  388. tableName: '审批组信息表',
  389. columnProp: 'active',
  390. headerAlign: 'center',
  391. align: 'center',
  392. columnLabel: '状态',
  393. columnHidden: false,
  394. columnImage: false,
  395. columnSortable: false,
  396. sortLv: 0,
  397. status: true,
  398. fixed: '',
  399. columnWidth: 100
  400. },
  401. {
  402. userId: this.$store.state.user.name,
  403. functionId: 601005,
  404. serialNumber: '601005Table1Remark',
  405. tableId: "601005Table1",
  406. tableName: "审批组表",
  407. columnProp: 'remark',
  408. headerAlign: "center",
  409. align: "left",
  410. columnLabel: '备注',
  411. columnHidden: false,
  412. columnImage: false,
  413. columnSortable: false,
  414. sortLv: 0,
  415. status: true,
  416. fixed: '',
  417. columnWidth: 300
  418. },
  419. {
  420. userId: this.$store.state.user.name,
  421. functionId: 601005,
  422. serialNumber: '601005Table1CreateDate',
  423. tableId: '601005Table1',
  424. tableName: '审批组表',
  425. columnProp: 'createDate',
  426. headerAlign: 'center',
  427. align: 'center',
  428. columnLabel: '创建时间',
  429. columnHidden: false,
  430. columnImage: false,
  431. columnSortable: false,
  432. sortLv: 0,
  433. status: true,
  434. fixed: '',
  435. columnWidth: 170
  436. },
  437. {
  438. userId: this.$store.state.user.name,
  439. functionId: 601005,
  440. serialNumber: '601005Table1CreateBy',
  441. tableId: "601005Table1",
  442. tableName: "审批组表",
  443. columnProp: 'createBy',
  444. headerAlign: "center",
  445. align: "center",
  446. columnLabel: '创建人',
  447. columnHidden: false,
  448. columnImage: false,
  449. columnSortable: false,
  450. sortLv: 0,
  451. status: true,
  452. fixed: '',
  453. columnWidth: 100
  454. },
  455. {
  456. userId: this.$store.state.user.name,
  457. functionId: 601005,
  458. serialNumber: '601005Table1UpdateDate',
  459. tableId: "601005Table1",
  460. tableName: "审批组表",
  461. columnProp: 'updateDate',
  462. headerAlign: "center",
  463. align: "center",
  464. columnLabel: '更新时间',
  465. columnHidden: false,
  466. columnImage: false,
  467. columnSortable: false,
  468. sortLv: 0,
  469. status: true,
  470. fixed: '',
  471. columnWidth: 170
  472. },
  473. {
  474. userId: this.$store.state.user.name,
  475. functionId: 601005,
  476. serialNumber: '601005Table1UpdateBy',
  477. tableId: "601005Table1",
  478. tableName: "审批组表",
  479. columnProp: 'updateBy',
  480. headerAlign: "center",
  481. align: "center",
  482. columnLabel: '更新人',
  483. columnHidden: false,
  484. columnImage: false,
  485. columnSortable: false,
  486. sortLv: 0,
  487. status: true,
  488. fixed: '',
  489. columnWidth: 100
  490. },
  491. ],
  492. rules: {
  493. bu: [
  494. {
  495. required: true,
  496. message: ' ',
  497. trigger: ['blur','change']
  498. }
  499. ],
  500. groupNo:[
  501. {
  502. required: true,
  503. message: ' ',
  504. trigger: 'change'
  505. }
  506. ],
  507. groupDesc:[
  508. {
  509. required: true,
  510. message: ' ',
  511. trigger: 'change'
  512. }
  513. ],
  514. active:[
  515. {
  516. required: true,
  517. message: ' ',
  518. trigger: 'change'
  519. }
  520. ],
  521. groupEmailAddress:[
  522. {
  523. required: true,
  524. message: ' ',
  525. trigger: 'change'
  526. }
  527. ]
  528. },
  529. // ======== 模态框开关控制 ========
  530. authSearch: false,
  531. authSave: false,
  532. authUpdate: false,
  533. authDelete: false,
  534. modalFlag: false,
  535. modalDisableFlag: false,
  536. menuId: this.$route.meta.menuId,
  537. }
  538. },
  539. mounted () {
  540. this.$nextTick(() => {
  541. this.height = window.innerHeight - 180
  542. })
  543. },
  544. created () {
  545. // 按钮控制
  546. this.getButtonAuthData()
  547. // 获取用户的 site 和 bu
  548. this.getSiteAndBuByUserName()
  549. // 校验用户是否收藏
  550. // this.favoriteIsOk()
  551. // 动态列
  552. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  553. // 获取数据列表
  554. this.getDataList()
  555. },
  556. methods: {
  557. // 获取用户的bu
  558. getSiteAndBuByUserName () {
  559. let tempData = {
  560. username: this.$store.state.user.name,
  561. }
  562. getSiteAndBuByUserName(tempData).then(({data}) => {
  563. if (data.code === 0) {
  564. this.userBuList = data.rows
  565. }
  566. })
  567. },
  568. // 每页数
  569. sizeChangeHandle (val) {
  570. this.pageSize = val
  571. this.pageIndex = 1
  572. this.getDataList()
  573. },
  574. // 当前页
  575. currentChangeHandle (val) {
  576. this.pageIndex = val
  577. this.getDataList()
  578. },
  579. // 获取数据列表
  580. getDataList () {
  581. if (this.searchData.bu != null && this.searchData.bu !== '') {
  582. this.searchData.buNo = this.searchData.bu.split('_')[1]
  583. }
  584. this.searchData.limit = this.pageSize
  585. this.searchData.page = this.pageIndex
  586. authGroupSearch(this.searchData).then(({data}) => {
  587. if (data.code === 0) {
  588. this.dataList = data.page.list
  589. this.pageIndex = data.page.currPage
  590. this.pageSize = data.page.pageSize
  591. this.totalPage = data.page.totalCount
  592. }
  593. })
  594. },
  595. addModal () {
  596. this.modalData = {
  597. flag: '1',
  598. title: '审批组新增',
  599. bu: this.userBuList[0].buNo,
  600. buNo: '',
  601. groupNo: '',
  602. groupDesc: '',
  603. active: 'Y',
  604. createBy: this.$store.state.user.name,
  605. }
  606. this.modalDisableFlag = false
  607. this.modalFlag = true
  608. },
  609. /**
  610. * 审批组信息编辑模态框
  611. * @param row
  612. */
  613. updateModal (row) {
  614. this.modalData = {
  615. flag: '2',
  616. title: '审批组编辑',
  617. site: row.site,
  618. authGroupId: row.authGroupId,
  619. recordType: row.recordType,
  620. bu: row.site + '_' + row.buNo,
  621. buNo: row.buNo,
  622. groupNo: row.groupNo,
  623. groupDesc: row.groupDesc,
  624. groupEmailAddress: row.groupEmailAddress,
  625. remark: row.remark,
  626. active: row.active,
  627. createBy: row.createBy,
  628. createDate: row.createDate,
  629. updateBy: this.$store.state.user.name,
  630. updateDate: ''
  631. }
  632. this.modalDisableFlag = true
  633. this.modalFlag = true
  634. },
  635. // ======== 新增/编辑/删除方法 ========
  636. /**
  637. * 审批组信息新增/编辑
  638. */
  639. saveData () {
  640. if (this.modalData.bu === '' || this.modalData.bu == null) {
  641. this.$message.warning('请选择BU!')
  642. return
  643. }
  644. if (this.modalData.groupNo === '' || this.modalData.groupNo == null) {
  645. this.$message.warning('请填写审批组编码!')
  646. return
  647. }
  648. if (this.modalData.groupDesc === '' || this.modalData.groupDesc == null) {
  649. this.$message.warning('请填写审批组名称!')
  650. return
  651. }
  652. if (this.modalData.active === '' || this.modalData.active == null) {
  653. this.$message.warning('请选择状态!')
  654. return
  655. }
  656. if (this.modalData.groupEmailAddress === '' || this.modalData.groupEmailAddress == null) {
  657. this.$message.warning('请填写邮箱!')
  658. return
  659. }
  660. if (this.modalData.flag === '1') {
  661. this.modalData.buNo = this.modalData.bu.split('_')[1]
  662. this.modalData.site = this.$store.state.user.site
  663. authGroupSave(this.modalData).then(({data}) => {
  664. if (data && data.code === 0) {
  665. this.getDataList()
  666. this.modalFlag = false
  667. this.$message({
  668. message: '操作成功',
  669. type: 'success',
  670. duration: 1500,
  671. onClose: () => {}
  672. })
  673. } else {
  674. this.$alert(data.msg, '错误', {
  675. confirmButtonText: '确定'
  676. })
  677. }
  678. })
  679. } else {
  680. let inData = {
  681. authGroupId: this.modalData.authGroupId,
  682. recordType: this.modalData.recordType,
  683. bu: this.modalData.bu,
  684. groupNo: this.modalData.groupNo,
  685. groupDesc: this.modalData.groupDesc,
  686. groupEmailAddress: this.modalData.groupEmailAddress,
  687. remark: this.modalData.remark,
  688. active: this.modalData.active,
  689. createBy: this.modalData.createBy,
  690. updateBy: this.$store.state.user.name,
  691. }
  692. authGroupEdit(this.modalData).then(({data}) => {
  693. if (data && data.code === 0) {
  694. this.getDataList()
  695. this.modalFlag = false
  696. this.$message({
  697. message: '操作成功',
  698. type: 'success',
  699. duration: 1500,
  700. onClose: () => {}
  701. })
  702. } else {
  703. this.$alert(data.msg, '错误', {
  704. confirmButtonText: '确定'
  705. })
  706. }
  707. })
  708. }
  709. },
  710. /**
  711. * 审批组信息删除
  712. */
  713. delModal (row) {
  714. this.$confirm(`是否删除这条审批组信息?`, '提示', {
  715. confirmButtonText: '确定',
  716. cancelButtonText: '取消',
  717. type: 'warning'
  718. }).then(() => {
  719. authGroupDelete(row).then(({data}) => {
  720. if (data && data.code === 0) {
  721. this.getDataList()
  722. this.partSelections = []
  723. this.$message({
  724. message: '操作成功',
  725. type: 'success',
  726. duration: 1500,
  727. onClose: () => {}
  728. })
  729. } else {
  730. this.$alert(data.msg, '错误', {
  731. confirmButtonText: '确定'
  732. })
  733. }
  734. })
  735. }).catch(() => {
  736. })
  737. },
  738. updateGroupBusinessModal (row) {
  739. this.rowData = JSON.parse(JSON.stringify(row))
  740. this.searchAuthBusinessData = {
  741. site: '',
  742. userDisplay: '',
  743. active: '',
  744. username: ''
  745. }
  746. this.allAuthBusinessSelections = null
  747. this.isAuthBusinessSelections = null
  748. getAuthGroupBusinessList(row).then(({data}) => {
  749. this.allAuthBusinessList = data.row1
  750. this.isAuthBusinessList = data.row2
  751. })
  752. this.authGroupMemberSaveDialog = true
  753. },
  754. /**
  755. * 查询可用角色
  756. */
  757. authGroupBusinessSearch () {
  758. authGroupBusinessSearch(this.rowData).then(({data}) => {
  759. if (data.code === 0) {
  760. this.allAuthBusinessList = data.rows
  761. }
  762. })
  763. },
  764. //可选角色
  765. allAuthBusinessClickRow (row) {
  766. this.$refs.allAuthBusinessTable.toggleRowSelection(row)
  767. },
  768. //已有角色
  769. isAuthBusinessClickRow (row) {
  770. this.$refs.isAuthBusinessTable.toggleRowSelection(row)
  771. },
  772. selectionAllAuthBusiness (val) {
  773. this.allAuthBusinessSelections = val
  774. },
  775. selectionIsAuthBusiness (val) {
  776. this.isAuthBusinessSelections = val
  777. },
  778. //添加角色
  779. addAuthGroupMemberBusiness () {
  780. if (this.allAuthBusinessSelections == null || this.allAuthBusinessSelections.length === 0) {
  781. this.$message.warning('请选择可选角色!')
  782. return
  783. }
  784. this.rowData.authBusinessList = this.allAuthBusinessSelections
  785. this.rowData.createBy = this.$store.state.user.name
  786. addAuthGroupMemberBusiness(this.rowData).then(({data}) => {
  787. if (data && data.code === 0) {
  788. getAuthGroupBusinessList(this.rowData).then(({data}) => {
  789. this.allAuthBusinessList = data.row1
  790. this.isAuthBusinessList = data.row2
  791. })
  792. this.allAuthBusinessSelections = []
  793. } else {
  794. this.$alert(data.msg, '错误', {
  795. confirmButtonText: '确定'
  796. })
  797. }
  798. })
  799. },
  800. //删除角色
  801. deleteAuthGroupMemberBusiness () {
  802. if (this.isAuthBusinessSelections == null || this.isAuthBusinessSelections.length === 0) {
  803. this.$message.warning('请选择已有角色!')
  804. return
  805. }
  806. this.rowData.authBusinessList = this.isAuthBusinessSelections
  807. deleteAuthGroupMemberBusiness(this.rowData).then(({data}) => {
  808. if (data && data.code === 0) {
  809. getAuthGroupBusinessList(this.rowData).then(({data}) => {
  810. this.allAuthBusinessList = data.row1
  811. this.isAuthBusinessList = data.row2
  812. })
  813. this.isAuthBusinessSelections = []
  814. } else {
  815. this.$alert(data.msg, '错误', {
  816. confirmButtonText: '确定'
  817. })
  818. }
  819. })
  820. },
  821. selectFlag () {
  822. return true
  823. },
  824. // 动态列开始 获取 用户保存的 格式列
  825. async getTableUserColumn(tableId, columnId) {
  826. let queryTableUser = {
  827. userId: this.$store.state.user.name,
  828. functionId: this.$route.meta.menuId,
  829. tableId: tableId,
  830. status: true,
  831. languageCode: this.$i18n.locale
  832. }
  833. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  834. if (data.rows.length > 0) {
  835. switch (columnId) {
  836. case 1:
  837. this.columnList = data.rows
  838. break;
  839. }
  840. } else {
  841. this.getColumnList(tableId, columnId)
  842. }
  843. })
  844. },
  845. // 获取 tableDefault 列
  846. async getColumnList (tableId, columnId) {
  847. let queryTable= {
  848. functionId: this.$route.meta.menuId,
  849. tableId: tableId,
  850. languageCode: this.$i18n.locale
  851. }
  852. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  853. if (!data.rows.length === 0) {
  854. switch (columnId) {
  855. case 1:
  856. this.columnList = data.rows
  857. break;
  858. }
  859. }
  860. })
  861. },
  862. //获取按钮的权限数据
  863. getButtonAuthData () {
  864. let searchFlag = this.isAuth(this.menuId+":search")
  865. let saveFlag = this.isAuth(this.menuId+":save")
  866. let updateFlag = this.isAuth(this.menuId+":update")
  867. let deleteFlag = this.isAuth(this.menuId+":delete")
  868. //处理页面的权限数据
  869. this.authSearch = !searchFlag
  870. this.authSave = !saveFlag
  871. this.authUpdate = !updateFlag
  872. this.authDelete = !deleteFlag
  873. },
  874. }
  875. }
  876. </script>
  877. <style scoped lang="scss">
  878. /deep/ .customer-tab .el-tabs__content {
  879. padding: 0px !important;
  880. height: 459px;
  881. }
  882. </style>