index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <!--机构数据-->
  5. <el-col :span="4" :xs="24">
  6. <org-tree
  7. v-model="queryParams.orgId"
  8. @defaultKey="getDefaultKey"
  9. @checkChange="checkChange"
  10. @click="clickTreeNode"
  11. ></org-tree>
  12. </el-col>
  13. <el-col :span="20" :xs="24">
  14. <!-- 搜索条件 -->
  15. <el-form
  16. :model="queryParams"
  17. ref="search"
  18. size="small"
  19. :inline="true"
  20. v-show="showSearch"
  21. label-width="100px"
  22. >
  23. <el-form-item prop="planType" label="计划类型">
  24. <el-select
  25. prop="planType"
  26. label="计划类型"
  27. v-model="queryParams.planType"
  28. placeholder="请选择计划类型"
  29. clearable
  30. >
  31. <el-option
  32. v-for="dict in dict.type.resumption_plan_type"
  33. :key="dict.value"
  34. :label="dict.label"
  35. :value="dict.value"
  36. />
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item prop="resumptionRole" label="履职角色">
  40. <el-select
  41. @visible-change="getRolesByOrg"
  42. prop="resumptionRole"
  43. label="履职角色"
  44. v-model="queryParams.resumptionRole"
  45. placeholder="请选择履职角色"
  46. clearable
  47. >
  48. <el-option
  49. v-for="dict in resumptionRoles"
  50. :key="dict.index"
  51. :label="dict.roleName"
  52. :value="dict.id"
  53. />
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item prop="planCycle" label="履职周期">
  57. <el-select
  58. prop="planCycle"
  59. label="履职周期"
  60. v-model="queryParams.planCycle"
  61. placeholder="请选择履职周期"
  62. clearable
  63. >
  64. <el-option
  65. v-for="item in dict.type.resumption_plan_cycle"
  66. :key="item.value"
  67. :label="item.label"
  68. :value="item.value"
  69. >
  70. </el-option>
  71. </el-select>
  72. </el-form-item>
  73. <el-form-item prop="planStatus" label="计划状态">
  74. <el-select
  75. prop="planStatus"
  76. label="任务状态"
  77. v-model="queryParams.planStatus"
  78. placeholder="请选择任务状态"
  79. clearable
  80. >
  81. <el-option
  82. v-for="item in dict.type.resumption_plan_status"
  83. :key="item.value"
  84. :label="item.label"
  85. :value="item.value"
  86. >
  87. </el-option>
  88. </el-select>
  89. </el-form-item>
  90. <el-form-item prop="planName" label="计划名称">
  91. <el-input
  92. v-model="queryParams.planName"
  93. :maxlength="50"
  94. name="planName"
  95. placeholder="请输入"
  96. clearable
  97. />
  98. </el-form-item>
  99. <el-form-item>
  100. <el-button
  101. type="primary"
  102. icon="el-icon-search"
  103. size="mini"
  104. @click="getList"
  105. >搜索</el-button
  106. >
  107. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  108. >重置</el-button
  109. >
  110. </el-form-item>
  111. </el-form>
  112. <!-- 按纽 -->
  113. <el-row :gutter="10" class="mb8">
  114. <el-col :span="1.5">
  115. <el-button
  116. type="primary"
  117. plain
  118. icon="el-icon-plus"
  119. size="mini"
  120. @click="handleAdd()"
  121. v-hasPermi="['system:user:add']"
  122. >新增</el-button
  123. >
  124. </el-col>
  125. <!-- <el-col :span="1.5">
  126. <el-button
  127. type="success"
  128. plain
  129. icon="el-icon-edit"
  130. size="mini"
  131. :disabled="single"
  132. @click="handleUpdate"
  133. v-hasPermi="['system:user:edit']"
  134. >修改</el-button
  135. >
  136. </el-col>
  137. <el-col :span="1.5">
  138. <el-button
  139. type="danger"
  140. plain
  141. icon="el-icon-delete"
  142. size="mini"
  143. :disabled="multiple"
  144. @click="handleDelete"
  145. v-hasPermi="['system:user:remove']"
  146. >删除</el-button
  147. >
  148. </el-col>-->
  149. <right-toolbar
  150. :showSearch.sync="showSearch"
  151. @queryTable="getList"
  152. :columns="columns"
  153. ></right-toolbar>
  154. </el-row>
  155. <el-table
  156. v-loading="loading"
  157. :data="pageData"
  158. @selection-change="handleSelectionChange"
  159. >
  160. <el-table-column
  161. type="index"
  162. label="序号"
  163. v-if="columns[0].visible"
  164. :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
  165. ></el-table-column>
  166. <el-table-column
  167. prop="planName"
  168. label="计划名称"
  169. v-if="columns[1].visible"
  170. ></el-table-column>
  171. <el-table-column
  172. prop="planType"
  173. label="计划类型"
  174. v-if="columns[2].visible"
  175. >
  176. <template slot-scope="r"
  177. >{{
  178. getLabel(dict.type.resumption_plan_type, `${r.row.planType}`)
  179. }}
  180. </template>
  181. </el-table-column>
  182. <el-table-column
  183. prop="planCreateOrgName"
  184. label="计划创建机构"
  185. v-if="columns[3].visible"
  186. >
  187. <!-- <template slot-scope="r"
  188. >{{ getLabel(dict.type.sys_org_type, r.row.execOrgType) }}
  189. </template> -->
  190. </el-table-column>
  191. <el-table-column
  192. prop="planOfOrgName"
  193. label="计划所属机构"
  194. v-if="columns[4].visible"
  195. ></el-table-column>
  196. <el-table-column
  197. prop="execOrgType"
  198. label="履职机构类型"
  199. v-if="columns[6].visible"
  200. >
  201. <template slot-scope="r"
  202. >{{ getLabel(dict.type.sys_org_type, `${r.row.execOrgType}`) }}
  203. </template>
  204. </el-table-column>
  205. <el-table-column
  206. prop="roleNames"
  207. label="履职角色"
  208. v-if="columns[6].visible"
  209. ></el-table-column>
  210. <el-table-column
  211. prop="planCycle"
  212. label="履职周期"
  213. v-if="columns[6].visible"
  214. >
  215. <template slot-scope="r"
  216. >{{
  217. getLabel(dict.type.resumption_plan_cycle, `${r.row.planCycle}`)
  218. }}
  219. </template>
  220. </el-table-column>
  221. <el-table-column
  222. prop="count"
  223. label="履职次数"
  224. v-if="columns[6].visible"
  225. ></el-table-column>
  226. <el-table-column
  227. prop="planExec"
  228. label="履职时间"
  229. v-if="columns[6].visible"
  230. >
  231. <template slot-scope="r"
  232. >{{
  233. getLabel(dict.type.resumption_plan_exec, `${r.row.planExec}`)
  234. }}
  235. </template>
  236. </el-table-column>
  237. <el-table-column
  238. prop="modifiedName"
  239. label="修改人"
  240. v-if="columns[6].visible"
  241. ></el-table-column>
  242. <el-table-column
  243. prop="planStatus"
  244. label="计划状态"
  245. v-if="columns[6].visible"
  246. >
  247. <template slot-scope="r"
  248. >{{
  249. getLabel(
  250. dict.type.resumption_plan_status,
  251. `${r.row.planStatus}`
  252. )
  253. }}
  254. </template>
  255. </el-table-column>
  256. <el-table-column label="操作">
  257. <template slot-scope="r">
  258. <el-button
  259. size="mini"
  260. type="text"
  261. icon="el-icon-edit"
  262. @click="onEdit(r.row.id)"
  263. v-hasPermi="['system:user:edit']"
  264. >修改</el-button
  265. >
  266. <el-button
  267. size="mini"
  268. type="text"
  269. icon="el-icon-delete"
  270. @click="onDel(r.row.id, r.row.planName)"
  271. v-hasPermi="['system:user:remove']"
  272. >删除</el-button
  273. >
  274. <el-button
  275. size="mini"
  276. type="text"
  277. icon="el-icon-delete"
  278. @click="showDialogDistribute(r.row)"
  279. v-hasPermi="['system:user:remove']"
  280. >下发</el-button>
  281. </template>
  282. </el-table-column>
  283. </el-table>
  284. <pagination
  285. v-show="total > 0"
  286. :total="total"
  287. :page.sync="queryParams.pageNum"
  288. :limit.sync="queryParams.pageSize"
  289. @pagination="getList"
  290. />
  291. </el-col>
  292. </el-row>
  293. <dialog-edit
  294. ref="editDialog"
  295. @success="getList()"
  296. :orgTypeOptions="dict.type.sys_org_type"
  297. :ruleTypeOptions="dict.type.rule_type"
  298. ></dialog-edit>
  299. <DialogDistribute ref="dialogDistribute"></DialogDistribute>
  300. </div>
  301. </template>
  302. <script>
  303. import DialogDistribute from "@/views/resumption/plan/distribute.vue";
  304. import OrgTree from "@/components/orgTree";
  305. import { mapState, mapMutations } from "vuex";
  306. import DialogEdit from "./dialog.edit";
  307. import * as api from "@/api/resumption/plan";
  308. import { statusOptions, getLabel } from "./../../commonOption";
  309. import { listRole } from "@/api/system/role";
  310. export default {
  311. name: "resumptionplan",
  312. dicts: [
  313. "sys_org_type",
  314. "rule_type",
  315. "resumption_plan_type",
  316. "resumption_plan_cycle",
  317. "resumption_plan_status",
  318. "resumption_plan_exec",
  319. ],
  320. components: {
  321. DialogEdit,
  322. OrgTree,
  323. DialogDistribute,
  324. },
  325. data() {
  326. const { params, query } = this.$route;
  327. return {
  328. isShow: false,
  329. loading: false,
  330. ids: [],
  331. // 非单个禁用
  332. single: true,
  333. // 非多个禁用
  334. multiple: true,
  335. // 显示搜索条件
  336. showSearch: true,
  337. resumptionRoles: [],
  338. total: 0,
  339. queryParams: {
  340. orgId: null,
  341. planType: null,
  342. resumptionRole: null,
  343. planCycle: null,
  344. planStatus: null,
  345. planName: null,
  346. pageNum: 1,
  347. pageSize: 10,
  348. ...query,
  349. },
  350. pageData: [],
  351. // 列信息
  352. columns: [
  353. { key: 0, label: `序号`, visible: true },
  354. { key: 1, label: `计划名称`, visible: true },
  355. { key: 2, label: `计划类型`, visible: true },
  356. { key: 3, label: `计划创建机构`, visible: true },
  357. { key: 4, label: `计划所属机构`, visible: true },
  358. { key: 5, label: `履职机构类型`, visible: true },
  359. { key: 6, label: `履职角色`, visible: true },
  360. { key: 7, label: `履职周期`, visible: true },
  361. { key: 8, label: `履职次数`, visible: true },
  362. { key: 9, label: `履职时间`, visible: true },
  363. { key: 10, label: `修改人`, visible: true },
  364. { key: 11, label: `计划状态`, visible: true },
  365. ],
  366. };
  367. },
  368. props: {},
  369. watch: {},
  370. computed: {
  371. ...mapState([]),
  372. },
  373. methods: {
  374. ...mapMutations([]),
  375. getRolesByOrg() {
  376. let params = {
  377. // orgId:this.queryParams.orgId
  378. };
  379. listRole(params).then((res) => {
  380. // console.info(res);
  381. this.resumptionRoles = res.rows;
  382. });
  383. },
  384. getList() {
  385. this.loading = true;
  386. console.info(this.dict.type);
  387. api
  388. .list(this.queryParams)
  389. .then((response) => {
  390. this.pageData = response.data.records;
  391. this.total = response.data.total;
  392. this.loading = false;
  393. })
  394. .catch(() => {
  395. this.loading = false;
  396. });
  397. },
  398. getDefaultKey(key) {
  399. this.queryParams.orgId = key;
  400. this.getList();
  401. },
  402. handleAdd(id, other = {}) {
  403. this.$refs.editDialog.show(id, other);
  404. },
  405. onEdit(id, other = {}) {
  406. this.$refs.editDialog.show(id, other);
  407. },
  408. showDialogDistribute(row){
  409. this.$refs.dialogDistribute.show(row);
  410. },
  411. async onDel(id, name) {
  412. this.$modal
  413. .confirm('是否确认删除名称为"' + name + '"的数据项?')
  414. .then(function () {
  415. return api.delelte(id);
  416. })
  417. .then(() => {
  418. this.getList();
  419. this.$modal.msgSuccess("删除成功");
  420. })
  421. .catch(() => {});
  422. // await api.delelte(id);
  423. // this.getList();
  424. },
  425. // 多选框选中数据
  426. handleSelectionChange(selection) {
  427. this.ids = selection.map((item) => item.userId);
  428. this.single = selection.length != 1;
  429. this.multiple = !selection.length;
  430. },
  431. /** 重置按钮操作 */
  432. resetQuery() {
  433. this.resetForm("queryForm");
  434. this.queryParams.orgId = undefined;
  435. this.$refs.tree.setCurrentKey(null);
  436. this.getList();
  437. },
  438. //单选框状态改变
  439. checkChange(state) {
  440. this.queryParams.checkSub = state;
  441. this.getList();
  442. },
  443. // 节点单击事件
  444. clickTreeNode(data) {
  445. this.queryParams.orgId = data.id;
  446. this.getList();
  447. },
  448. getStatusLabel(value) {
  449. return getLabel(statusOptions, value);
  450. },
  451. getLabel(options, value) {
  452. return getLabel(options, value);
  453. },
  454. //apimark//
  455. },
  456. mounted() {},
  457. };
  458. </script>
  459. <style lang="scss" scoped>
  460. .brand {
  461. }
  462. </style>