index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10">
  4. <el-col :span="4" :xs="24">
  5. <org-tree
  6. v-model="queryParams.orgId"
  7. @defaultKey="getDefaultKey"
  8. @checkChange="checkChange"
  9. @click="clickTreeNode"
  10. ></org-tree>
  11. </el-col>
  12. <el-col :span="20" :xs="24">
  13. <!--用户数据-->
  14. <div class="main-right-box">
  15. <!-- 搜索条件 -->
  16. <div class="main-search-box">
  17. <!-- 搜索条件 -->
  18. <el-form
  19. :model="queryParams"
  20. ref="queryForm"
  21. size="small"
  22. :inline="true"
  23. v-show="showSearch"
  24. >
  25. <el-form-item label="外包评价名称" prop="evaluateName">
  26. <el-input
  27. :maxlength="20"
  28. v-model="queryParams.evaluateName"
  29. placeholder="请输入外包评价名称"
  30. clearable
  31. @keyup.enter.native="handleQuery"
  32. />
  33. </el-form-item>
  34. <el-form-item label="状态" prop="status">
  35. <el-select
  36. v-model="queryParams.status"
  37. placeholder="请选择状态"
  38. clearable
  39. >
  40. <el-option
  41. v-for="dict in dict.type.plan_status"
  42. :key="dict.value"
  43. :label="dict.label"
  44. :value="dict.value"
  45. />
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="评价机构类型">
  49. <el-select
  50. @change="cleanExecOrgList"
  51. prop="orgType"
  52. label="评价机构类型"
  53. v-model="queryParams.orgType"
  54. placeholder="请选择评价机构类型"
  55. clearable
  56. >
  57. <el-option
  58. v-for="item in dict.type.sys_org_type"
  59. :key="item.value"
  60. :label="item.label"
  61. :value="item.value"
  62. >
  63. </el-option>
  64. </el-select>
  65. </el-form-item>
  66. <el-form-item>
  67. <el-form-item prop="roleId" label="评价角色">
  68. <el-select
  69. @visible-change="getRolesByOrg"
  70. label="评价角色"
  71. v-model="queryParams.roleId"
  72. placeholder="请选择评价角色"
  73. filterable
  74. @change="handleRolesChange"
  75. >
  76. <el-option
  77. v-for="item in planRoles"
  78. :key="item.id"
  79. :label="item.name"
  80. :value="item.id"
  81. >
  82. </el-option>
  83. </el-select>
  84. </el-form-item>
  85. </el-form-item>
  86. </el-form>
  87. <!-- 按纽 -->
  88. <el-row :gutter="10" class="mb8">
  89. <el-col :span="1.5">
  90. <el-button
  91. type="primary"
  92. icon="el-icon-search"
  93. size="mini"
  94. @click="handleQuery"
  95. >搜索</el-button
  96. >
  97. <el-button
  98. type="primary"
  99. icon="el-icon-refresh"
  100. size="mini"
  101. @click="resetQuery"
  102. >重置</el-button
  103. >
  104. <el-button
  105. type="primary"
  106. icon="el-icon-plus"
  107. size="mini"
  108. @click="handleAdd"
  109. v-hasPermi="['system:user:add']"
  110. >新增</el-button
  111. >
  112. </el-col>
  113. </el-row>
  114. </div>
  115. <el-table
  116. border
  117. height="650"
  118. size="small"
  119. v-loading="loading"
  120. :data="dataList"
  121. align="center"
  122. fixed
  123. @selection-change="handleSelectionChange"
  124. >
  125. <el-table-column
  126. label="序号"
  127. type="index"
  128. width="100"
  129. ></el-table-column>
  130. <el-table-column label="创建机构" prop="orgName" />
  131. <el-table-column label="外包评价名称" prop="evaluateName" />
  132. <el-table-column label="评价机构类型" prop="orgType" />
  133. <el-table-column label="评价角色" prop="roleName" />
  134. <el-table-column label="评价周期" prop="evaluateCycle" />
  135. <el-table-column label="创建人" prop="createBy" />
  136. <el-table-column label="创建时间" prop="createTime" />
  137. <el-table-column label="状态" width="150">
  138. <template slot-scope="{ row }">
  139. <el-switch
  140. v-model="row.status"
  141. active-text="启用"
  142. active-value="0"
  143. inactive-text="停用"
  144. inactive-value="1"
  145. active-color="#3bbca9"
  146. inactive-color="#d7000f"
  147. @change="swtichChangeHandler(row)"
  148. >
  149. </el-switch>
  150. </template>
  151. </el-table-column>
  152. <el-table-column
  153. label="操作"
  154. width="200"
  155. fixed="right"
  156. class-name="small-padding fixed-width"
  157. >
  158. <template slot-scope="{ row }">
  159. <!-- publishEvaluate -->
  160. <el-button
  161. size="mini"
  162. @click="publishHandler(row)"
  163. type="text"
  164. :class="
  165. row.isDistribute == 0
  166. ? 'el-icon-arrow-down'
  167. : 'el-icon-top-left'
  168. "
  169. >{{ row.isDistribute == "0" ? "" : "取消" }}发布</el-button
  170. >
  171. <el-button
  172. size="mini"
  173. @click="editHandler(row)"
  174. type="text"
  175. class="el-icon-edit-outline"
  176. >编辑</el-button
  177. ><el-button
  178. size="mini"
  179. @click="deleteHandler(row)"
  180. type="text"
  181. class="el-icon-delete"
  182. >删除</el-button
  183. >
  184. </template>
  185. </el-table-column>
  186. </el-table>
  187. <pagination
  188. v-show="total > 0"
  189. :total="total"
  190. :page.sync="queryParams.pageNum"
  191. :limit.sync="queryParams.pageSize"
  192. @pagination="getList"
  193. />
  194. </div>
  195. </el-col>
  196. </el-row>
  197. <editEvaluate ref="Evaluate" @success="getList()"></editEvaluate>
  198. </div>
  199. </template>
  200. <script>
  201. import { mapGetters } from "vuex";
  202. import { findAllRole } from "@/api/system/role";
  203. import {
  204. list,
  205. swtichHandler,
  206. delelteEvaluate,
  207. publishEvaluate,
  208. withdraw,
  209. } from "@/api/resumption/outsourcing.js";
  210. import OrgTree from "@/components/orgTree";
  211. import editEvaluate from "./editDialog.vue";
  212. export default {
  213. name: "SocWebIndex",
  214. dicts: ["sys_org_type", "plan_status"],
  215. components: {
  216. OrgTree,
  217. editEvaluate,
  218. },
  219. data() {
  220. const { params, query } = this.$route;
  221. return {
  222. loading: false,
  223. selectedValues: [],
  224. planRoles: [],
  225. queryParams: this.reset(),
  226. queryParams: {
  227. orgId: null,
  228. evaluateName: null,
  229. status: null,
  230. orgType: null,
  231. checkSub: true,
  232. roleId: "",
  233. pageNum: 1,
  234. pageSize: 10,
  235. ...query,
  236. },
  237. // 显示搜索条件
  238. showSearch: true,
  239. total: 0,
  240. dataList: [],
  241. };
  242. },
  243. created() {},
  244. mounted() {},
  245. computed: {
  246. ...mapGetters(["orgId"]),
  247. },
  248. methods: {
  249. //开关启用停用
  250. swtichChangeHandler(row) {
  251. swtichHandler({
  252. id: row.id,
  253. status: row.status,
  254. }).then((res) => {
  255. let { code, msg } = res;
  256. if (code == 200) {
  257. this.$message.success(msg);
  258. this.getList();
  259. } else {
  260. this.$message.error(msg);
  261. }
  262. });
  263. },
  264. //获取列表
  265. getList() {
  266. this.loading = true;
  267. // this.queryParams.orgId=this.orgId
  268. list(this.queryParams).then((res) => {
  269. this.dataList = res?.rows || [];
  270. this.total = res?.total || [];
  271. this.loading = false;
  272. });
  273. },
  274. // 多选框选中数据
  275. handleSelectionChange(selection) {},
  276. /** 新增按钮操作 */
  277. handleAdd() {
  278. this.$refs.Evaluate.show();
  279. },
  280. editHandler(row) {
  281. this.$refs.Evaluate.show(row.id);
  282. },
  283. //发布
  284. publishHandler(row) {
  285. //0未 //1已
  286. if (row.isDistribute == "1") {
  287. this.$modal
  288. .confirm("是否取消发布?")
  289. .then(function () {})
  290. .then(() => {
  291. withdraw(row.id).then((res) => {
  292. let { code, msg } = res;
  293. if (code == 200) {
  294. this.getList();
  295. this.$modal.msgSuccess("取消发布成功");
  296. } else {
  297. this.$modal.msgSuccess(msg);
  298. }
  299. });
  300. });
  301. } else {
  302. this.$modal
  303. .confirm("是否确认发布?")
  304. .then(function () {})
  305. .then(() => {
  306. publishEvaluate(row.id).then((res) => {
  307. let { code, msg } = res;
  308. if (code == 200) {
  309. this.getList();
  310. this.$modal.msgSuccess("发布成功");
  311. } else {
  312. this.$modal.msgSuccess(msg);
  313. }
  314. });
  315. });
  316. }
  317. },
  318. deleteHandler(row) {
  319. this.$modal
  320. .confirm("是否确认删除?")
  321. .then(function () {})
  322. .then(() => {
  323. delelteEvaluate(row.id).then((res) => {
  324. let { code, msg } = res;
  325. if (code == 200) {
  326. this.getList();
  327. this.$modal.msgSuccess("删除成功");
  328. } else {
  329. this.$modal.msgSuccess(msg);
  330. }
  331. });
  332. });
  333. },
  334. //单选框状态改变
  335. checkChange(state) {
  336. this.queryParams.checkSub = state;
  337. this.getList();
  338. },
  339. // 节点单击事件
  340. clickTreeNode(data) {
  341. this.queryParams.orgId = data.id;
  342. this.getList();
  343. },
  344. getRolesByOrg() {
  345. if(!this.queryParams.orgType){
  346. this.planRoles=[]
  347. this.queryParams.roleId=[]
  348. }
  349. let params = {
  350. orgType:this.queryParams.orgType|| null,
  351. };
  352. findAllRole(params).then((res) => {
  353. this.planRoles = res.data;
  354. });
  355. },
  356. cleanExecOrgList() {
  357. this.execOrgIds = null;
  358. this.queryParams.execOrgList = [];
  359. this.getRolesByOrg();
  360. },
  361. handleRolesChange(val) {
  362. this.selectedValues = val.toString().split(",");
  363. },
  364. getDefaultKey(key) {
  365. this.queryParams.orgId = key;
  366. this.getList();
  367. },
  368. /** 搜索按钮操作 */
  369. handleQuery() {
  370. this.queryParams.pageNum = 1;
  371. this.getList();
  372. },
  373. /** 重置按钮操作 */
  374. resetQuery() {
  375. this.resetForm("queryForm");
  376. this.queryParams.onlyManager = false;
  377. this.queryParams.orgType = null;
  378. this.handleQuery();
  379. },
  380. reset() {
  381. return {
  382. planName: null,
  383. planType: null,
  384. planCycle: null,
  385. planStatus: null,
  386. orgType: null,
  387. roleNames: null,
  388. count: null,
  389. description: null,
  390. tableData: null,
  391. itemList: null,
  392. planExec: null,
  393. count: 0,
  394. note: null,
  395. planCreateOrgId: null,
  396. planCreateOrgName: null,
  397. roleList: null,
  398. roleId: null,
  399. execOrg: null,
  400. checkOrg: null,
  401. buildTaskNow: false,
  402. checkOrgList: [],
  403. execOrgList: [],
  404. rulePointList: null,
  405. checkOrgIds: null,
  406. execOrgIds: null,
  407. rulePointIds: null,
  408. checkOrgType: null,
  409. checkType: null,
  410. };
  411. },
  412. },
  413. };
  414. </script>
  415. <style lang="scss" scoped></style>