index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <template>
  2. <div class="app-container">
  3. <el-table v-loading="loading" :data="authorityList" @selection-change="handleSelectionChange">
  4. <el-table-column type="selection" width="55" align="center"/>
  5. <el-table-column label="项目岗位" align="center" prop="postName" />
  6. <el-table-column label="商机-下一步" align="center" prop="boNext">
  7. <template slot-scope="scope">
  8. {{scope.row.boNext ? '√' : '×'}}
  9. </template>
  10. </el-table-column>
  11. <el-table-column label="商机-修改" align="center" prop="boEdit">
  12. <template slot-scope="scope">
  13. {{scope.row.boEdit ? '√' : '×'}}
  14. </template>
  15. </el-table-column>
  16. <el-table-column label="商机-关闭" align="center" prop="boClose">
  17. <template slot-scope="scope">
  18. {{scope.row.boClose ? '√' : '×'}}
  19. </template>
  20. </el-table-column>
  21. <el-table-column label="商机-赢单" align="center" prop="boWin">
  22. <template slot-scope="scope">
  23. {{scope.row.boWin ? '√' : '×'}}
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="商机-丢单" align="center" prop="boLose">
  27. <template slot-scope="scope">
  28. {{scope.row.boLose ? '√' : '×'}}
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="项目成员-新增" align="center" prop="pojpsnAdd" >
  32. <template slot-scope="scope">
  33. {{scope.row.pojpsnAdd ? '√' : '×'}}
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="项目成员-删除" align="center" prop="pojpsnDel">
  37. <template slot-scope="scope">
  38. {{scope.row.pojpsnDel ? '√' : '×'}}
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="项目成员-编辑" align="center" prop="pojpsnEdit">
  42. <template slot-scope="scope">
  43. {{scope.row.pojpsnEdit ? '√' : '×'}}
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="项目成员-查看" align="center" prop="pojpsnView">
  47. <template slot-scope="scope">
  48. {{scope.row.pojpsnView ? '√' : '×'}}
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="任务-新增" align="center" prop="taskAdd" >
  52. <template slot-scope="scope">
  53. {{scope.row.taskAdd ? '√' : '×'}}
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="任务-删除" align="center" prop="taskDel">
  57. <template slot-scope="scope">
  58. {{scope.row.taskDel ? '√' : '×'}}
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="任务-编辑" align="center" prop="taskEdit">
  62. <template slot-scope="scope">
  63. {{scope.row.taskEdit ? '√' : '×'}}
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="任务-查看" align="center" prop="taskView">
  67. <template slot-scope="scope">
  68. {{scope.row.taskView ? '√' : '×'}}
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="行动-新增" align="center" prop="behaviorAdd">
  72. <template slot-scope="scope">
  73. {{scope.row.behaviorAdd ? '√' : '×'}}
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="行动-删除" align="center" prop="behaviorDel">
  77. <template slot-scope="scope">
  78. {{scope.row.behaviorDel ? '√' : '×'}}
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="行动-编辑" align="center" prop="behaviorEdit">
  82. <template slot-scope="scope">
  83. {{scope.row.behaviorEdit ? '√' : '×'}}
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="行动-查看" align="center" prop="behaviorView">
  87. <template slot-scope="scope">
  88. {{scope.row.behaviorView ? '√' : '×'}}
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="联系人-新增" align="center" prop="contactAdd">
  92. <template slot-scope="scope">
  93. {{scope.row.contactAdd ? '√' : '×'}}
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="联系人-删除" align="center" prop="contactDel">
  97. <template slot-scope="scope">
  98. {{scope.row.contactDel ? '√' : '×'}}
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="联系人-编辑" align="center" prop="contactEdit">
  102. <template slot-scope="scope">
  103. {{scope.row.contactEdit ? '√' : '×'}}
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="联系人-查看" align="center" prop="contactView">
  107. <template slot-scope="scope">
  108. {{scope.row.contactView ? '√' : '×'}}
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
  112. <template slot-scope="scope">
  113. <el-button
  114. size="mini"
  115. type="text"
  116. icon="el-icon-edit"
  117. @click="handleUpdate(scope.row)"
  118. v-hasPermi="['material:authority:edit']"
  119. >修改</el-button>
  120. </template>
  121. </el-table-column>
  122. </el-table>
  123. <pagination
  124. v-show="total>0"
  125. :total="total"
  126. :page.sync="queryParams.pageNum"
  127. :limit.sync="queryParams.pageSize"
  128. @pagination="getList"
  129. />
  130. <!-- 添加或修改商机角色权限对话框 -->
  131. <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
  132. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  133. <el-form-item label="项目岗位" prop="postName">
  134. {{form.postName}}
  135. <!-- <el-input v-model="form.postName"/> -->
  136. </el-form-item>
  137. <el-divider content-position="left">
  138. <dev style="width: 50px; height: 40px; font-size: 18px">商机</dev>
  139. </el-divider>
  140. <el-row>
  141. <el-col :span="8">
  142. <el-form-item prop="boNext">
  143. <el-checkbox v-model="form.boNext">下一步</el-checkbox>
  144. </el-form-item>
  145. </el-col>
  146. <el-col :span="8">
  147. <el-form-item prop="boEdit">
  148. <el-checkbox v-model="form.boEdit">修改</el-checkbox>
  149. </el-form-item>
  150. </el-col>
  151. <el-col :span="8">
  152. <el-form-item prop="boClose">
  153. <el-checkbox v-model="form.boClose">关闭</el-checkbox>
  154. </el-form-item>
  155. </el-col>
  156. </el-row>
  157. <el-row>
  158. <el-col :span="8">
  159. <el-form-item prop="boWin">
  160. <el-checkbox v-model="form.boWin">赢单</el-checkbox>
  161. </el-form-item>
  162. </el-col>
  163. <el-col :span="8">
  164. <el-form-item prop="boLose">
  165. <el-checkbox v-model="form.boLose">丢单</el-checkbox>
  166. </el-form-item>
  167. </el-col>
  168. <el-col :span="8">
  169. </el-col>
  170. </el-row>
  171. <el-divider content-position="left">
  172. <dev style="width: 50px; height: 40px; font-size: 18px">项目成员</dev>
  173. </el-divider>
  174. <el-row>
  175. <el-col :span="8">
  176. <el-form-item prop="taskAdd">
  177. <el-checkbox v-model="form.pojpsnAdd">新增</el-checkbox>
  178. </el-form-item>
  179. </el-col>
  180. <el-col :span="8">
  181. <el-form-item prop="pojpsnDel">
  182. <el-checkbox v-model="form.pojpsnDel">删除</el-checkbox>
  183. </el-form-item>
  184. </el-col>
  185. <el-col :span="8">
  186. <el-form-item prop="pojpsnEdit">
  187. <el-checkbox v-model="form.pojpsnEdit">编辑</el-checkbox>
  188. </el-form-item>
  189. </el-col>
  190. </el-row>
  191. <el-row>
  192. <el-col :span="8">
  193. <el-form-item prop="pojpsnView">
  194. <el-checkbox v-model="form.pojpsnView">查看</el-checkbox>
  195. </el-form-item>
  196. </el-col>
  197. <el-col :span="8">
  198. </el-col>
  199. <el-col :span="8">
  200. </el-col>
  201. </el-row>
  202. <el-divider content-position="left">
  203. <dev style="width: 50px; height: 40px; font-size: 18px">任务</dev>
  204. </el-divider>
  205. <el-row>
  206. <el-col :span="8">
  207. <el-form-item prop="taskAdd">
  208. <el-checkbox v-model="form.taskAdd">新增</el-checkbox>
  209. </el-form-item>
  210. </el-col>
  211. <el-col :span="8">
  212. <el-form-item prop="taskDel">
  213. <el-checkbox v-model="form.taskDel">删除</el-checkbox>
  214. </el-form-item>
  215. </el-col>
  216. <el-col :span="8">
  217. <el-form-item prop="taskEdit">
  218. <el-checkbox v-model="form.taskEdit">编辑</el-checkbox>
  219. </el-form-item>
  220. </el-col>
  221. </el-row>
  222. <el-row>
  223. <el-col :span="8">
  224. <el-form-item prop="taskView">
  225. <el-checkbox v-model="form.taskView">查看</el-checkbox>
  226. </el-form-item>
  227. </el-col>
  228. <el-col :span="8">
  229. </el-col>
  230. <el-col :span="8">
  231. </el-col>
  232. </el-row>
  233. <el-divider content-position="left">
  234. <dev style="width: 50px; height: 40px; font-size: 18px">行动</dev>
  235. </el-divider>
  236. <el-row>
  237. <el-col :span="8">
  238. <el-form-item prop="behaviorAdd">
  239. <el-checkbox v-model="form.behaviorAdd">新增</el-checkbox>
  240. </el-form-item>
  241. </el-col>
  242. <el-col :span="8">
  243. <el-form-item prop="behaviorDel">
  244. <el-checkbox v-model="form.behaviorDel">删除</el-checkbox>
  245. </el-form-item>
  246. </el-col>
  247. <el-col :span="8">
  248. <el-form-item prop="behaviorEdit">
  249. <el-checkbox v-model="form.behaviorEdit">编辑</el-checkbox>
  250. </el-form-item>
  251. </el-col>
  252. </el-row>
  253. <el-row>
  254. <el-col :span="8">
  255. <el-form-item prop="behaviorView">
  256. <el-checkbox v-model="form.behaviorView">查看</el-checkbox>
  257. </el-form-item>
  258. </el-col>
  259. <el-col :span="8">
  260. </el-col>
  261. <el-col :span="8">
  262. </el-col>
  263. </el-row>
  264. <el-divider content-position="left">
  265. <dev style="width: 50px; height: 40px; font-size: 18px">联系人</dev>
  266. </el-divider>
  267. <el-row>
  268. <el-col :span="8">
  269. <el-form-item prop="contactAdd">
  270. <el-checkbox v-model="form.contactAdd">新增</el-checkbox>
  271. </el-form-item>
  272. </el-col>
  273. <el-col :span="8">
  274. <el-form-item prop="contactDel">
  275. <el-checkbox v-model="form.contactDel">删除</el-checkbox>
  276. </el-form-item>
  277. </el-col>
  278. <el-col :span="8">
  279. <el-form-item prop="contactEdit">
  280. <el-checkbox v-model="form.contactEdit">编辑</el-checkbox>
  281. </el-form-item>
  282. </el-col>
  283. </el-row>
  284. <el-row>
  285. <el-col :span="8">
  286. <el-form-item prop="contactView">
  287. <el-checkbox v-model="form.contactView">查看</el-checkbox>
  288. </el-form-item>
  289. </el-col>
  290. <el-col :span="8">
  291. </el-col>
  292. <el-col :span="8">
  293. </el-col>
  294. </el-row>
  295. </el-form>
  296. <div slot="footer" class="dialog-footer">
  297. <el-button type="primary" @click="submitForm">确 定</el-button>
  298. <el-button @click="cancel">取 消</el-button>
  299. </div>
  300. </el-dialog>
  301. </div>
  302. </template>
  303. <script>
  304. import { listAuthority, getAuthority, delAuthority, addAuthority, updateAuthority } from "@/api/business/spd/bo/authority";
  305. export default {
  306. name: "Authority",
  307. data() {
  308. return {
  309. // 遮罩层
  310. loading: true,
  311. // 选中数组
  312. ids: [],
  313. // 非单个禁用
  314. single: true,
  315. // 非多个禁用
  316. multiple: true,
  317. // 显示搜索条件
  318. showSearch: true,
  319. // 总条数
  320. total: 0,
  321. // 商机角色权限表格数据
  322. authorityList: [],
  323. // 弹出层标题
  324. title: "",
  325. // 是否显示弹出层
  326. open: false,
  327. // 查询参数
  328. queryParams: {
  329. pageNum: 1,
  330. pageSize: 10,
  331. post: null,
  332. boNext: null,
  333. boEdit: null,
  334. boClose: null,
  335. boWin: null,
  336. boLose: null,
  337. taskAdd: null,
  338. taskDel: null,
  339. taskEdit: null,
  340. taskView: null,
  341. behaviorAdd: null,
  342. behaviorDel: null,
  343. behaviorEdit: null,
  344. behaviorView: null,
  345. contactAdd: null,
  346. contactDel: null,
  347. contactEdit: null,
  348. contactView: null
  349. },
  350. // 表单参数
  351. form: {},
  352. // 表单校验
  353. rules: {
  354. }
  355. };
  356. },
  357. created() {
  358. this.getList();
  359. },
  360. methods: {
  361. /** 查询商机角色权限列表 */
  362. getList() {
  363. this.loading = true;
  364. listAuthority(this.queryParams).then(response => {
  365. this.authorityList = response.rows;
  366. console.log('this.authorityList',this.authorityList);
  367. this.total = response.total;
  368. this.loading = false;
  369. });
  370. },
  371. // 取消按钮
  372. cancel() {
  373. this.open = false;
  374. this.reset();
  375. },
  376. // 表单重置
  377. reset() {
  378. this.form = {
  379. id: null,
  380. post: null,
  381. boNext: null,
  382. boEdit: null,
  383. boClose: null,
  384. boWin: null,
  385. boLose: null,
  386. taskAdd: null,
  387. taskDel: null,
  388. taskEdit: null,
  389. taskView: null,
  390. behaviorAdd: null,
  391. behaviorDel: null,
  392. behaviorEdit: null,
  393. behaviorView: null,
  394. contactAdd: null,
  395. contactDel: null,
  396. contactEdit: null,
  397. contactView: null
  398. };
  399. this.resetForm("form");
  400. },
  401. /** 搜索按钮操作 */
  402. handleQuery() {
  403. this.queryParams.pageNum = 1;
  404. this.getList();
  405. },
  406. /** 重置按钮操作 */
  407. resetQuery() {
  408. this.resetForm("queryForm");
  409. this.handleQuery();
  410. },
  411. // 多选框选中数据
  412. handleSelectionChange(selection) {
  413. this.ids = selection.map(item => item.id)
  414. this.single = selection.length!==1
  415. this.multiple = !selection.length
  416. },
  417. /** 新增按钮操作 */
  418. handleAdd() {
  419. this.reset();
  420. this.open = true;
  421. this.title = "添加商机角色权限";
  422. },
  423. /** 修改按钮操作 */
  424. handleUpdate(row) {
  425. this.reset();
  426. const id = row.id || this.ids
  427. getAuthority(id).then(response => {
  428. this.form = response.data;
  429. this.open = true;
  430. this.title = "修改商机角色权限";
  431. });
  432. },
  433. /** 提交按钮 */
  434. submitForm() {
  435. this.$refs["form"].validate(valid => {
  436. if (valid) {
  437. if (this.form.id != null) {
  438. updateAuthority(this.form).then(response => {
  439. this.$modal.msgSuccess("修改成功");
  440. this.open = false;
  441. this.getList();
  442. });
  443. } else {
  444. addAuthority(this.form).then(response => {
  445. this.$modal.msgSuccess("新增成功");
  446. this.open = false;
  447. this.getList();
  448. });
  449. }
  450. }
  451. });
  452. },
  453. /** 删除按钮操作 */
  454. handleDelete(row) {
  455. const ids = row.id || this.ids;
  456. this.$modal.confirm('是否确认删除商机角色权限编号为"' + ids + '"的数据项?').then(function() {
  457. return delAuthority(ids);
  458. }).then(() => {
  459. this.getList();
  460. this.$modal.msgSuccess("删除成功");
  461. }).catch(() => {});
  462. },
  463. /** 导出按钮操作 */
  464. handleExport() {
  465. this.download('material/authority/export', {
  466. ...this.queryParams
  467. }, `authority_${new Date().getTime()}.xlsx`)
  468. }
  469. }
  470. };
  471. </script>