index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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="row.isDistribute == 0? 'el-icon-arrow-down':'el-icon-top-left'"
  165. >{{ row.isDistribute == "0" ? "" : "取消" }}发布</el-button
  166. >
  167. <el-button
  168. size="mini"
  169. @click="editHandler(row)"
  170. type="text"
  171. class="el-icon-edit-outline"
  172. >编辑</el-button
  173. ><el-button
  174. size="mini"
  175. @click="deleteHandler(row)"
  176. type="text"
  177. class="el-icon-delete"
  178. >删除</el-button
  179. >
  180. </template>
  181. </el-table-column>
  182. </el-table>
  183. <pagination
  184. v-show="total > 0"
  185. :total="total"
  186. :page.sync="queryParams.pageNum"
  187. :limit.sync="queryParams.pageSize"
  188. @pagination="getList"
  189. />
  190. </div>
  191. </el-col>
  192. </el-row>
  193. <editEvaluate ref="Evaluate" @success="getList()"></editEvaluate>
  194. </div>
  195. </template>
  196. <script>
  197. import { mapGetters } from "vuex";
  198. import { findAllRole } from "@/api/system/role";
  199. import {
  200. list,
  201. swtichHandler,
  202. delelteEvaluate,
  203. publishEvaluate,
  204. withdraw,
  205. } from "@/api/resumption/outsourcing.js";
  206. import OrgTree from "@/components/orgTree";
  207. import editEvaluate from "./editDialog.vue";
  208. export default {
  209. name: "SocWebIndex",
  210. dicts: ["sys_org_type", "plan_status"],
  211. components: {
  212. OrgTree,
  213. editEvaluate,
  214. },
  215. data() {
  216. const { params, query } = this.$route;
  217. return {
  218. loading: false,
  219. selectedValues: [],
  220. planRoles: [],
  221. queryParams: this.reset(),
  222. queryParams: {
  223. orgId: null,
  224. evaluateName: null,
  225. status: null,
  226. orgType: null,
  227. checkSub: true,
  228. roleId: "",
  229. pageNum: 1,
  230. pageSize: 10,
  231. ...query,
  232. },
  233. // 显示搜索条件
  234. showSearch: true,
  235. total: 0,
  236. dataList: [],
  237. };
  238. },
  239. created() {},
  240. mounted() {},
  241. computed: {
  242. ...mapGetters(["orgId"]),
  243. },
  244. methods: {
  245. //开关启用停用
  246. swtichChangeHandler(row) {
  247. swtichHandler({
  248. id: row.id,
  249. status: row.status,
  250. }).then((res) => {
  251. let { code, msg } = res;
  252. if (code == 200) {
  253. this.$message.success(msg);
  254. this.getList();
  255. } else {
  256. this.$message.error(msg);
  257. }
  258. });
  259. },
  260. //获取列表
  261. getList() {
  262. this.loading = true;
  263. // this.queryParams.orgId=this.orgId
  264. list(this.queryParams).then((res) => {
  265. this.dataList = res?.rows || [];
  266. this.total = res?.total || [];
  267. this.loading = false;
  268. });
  269. },
  270. // 多选框选中数据
  271. handleSelectionChange(selection) {},
  272. /** 新增按钮操作 */
  273. handleAdd() {
  274. this.$refs.Evaluate.show();
  275. },
  276. editHandler(row) {
  277. this.$refs.Evaluate.show(row.id);
  278. },
  279. //发布
  280. publishHandler(row) {
  281. //0未 //1已
  282. if (row.isDistribute == "1") {
  283. this.$modal
  284. .confirm("是否取消发布?")
  285. .then(function () {})
  286. .then(() => {
  287. withdraw(row.id).then((res) => {
  288. let { code, msg } = res;
  289. if (code == 200) {
  290. this.getList();
  291. this.$modal.msgSuccess("取消发布成功");
  292. } else {
  293. this.$modal.msgSuccess(msg);
  294. }
  295. });
  296. });
  297. } else {
  298. this.$modal
  299. .confirm("是否确认发布?")
  300. .then(function () {})
  301. .then(() => {
  302. publishEvaluate(row.id).then((res) => {
  303. let { code, msg } = res;
  304. if (code == 200) {
  305. this.getList();
  306. this.$modal.msgSuccess("发布成功");
  307. } else {
  308. this.$modal.msgSuccess(msg);
  309. }
  310. });
  311. });
  312. }
  313. },
  314. deleteHandler(row) {
  315. this.$modal
  316. .confirm("是否确认删除?")
  317. .then(function () {})
  318. .then(() => {
  319. delelteEvaluate(row.id).then((res) => {
  320. let { code, msg } = res;
  321. if (code == 200) {
  322. this.getList();
  323. this.$modal.msgSuccess("删除成功");
  324. } else {
  325. this.$modal.msgSuccess(msg);
  326. }
  327. });
  328. });
  329. },
  330. //单选框状态改变
  331. checkChange(state) {
  332. this.queryParams.checkSub = state;
  333. this.getList();
  334. },
  335. // 节点单击事件
  336. clickTreeNode(data) {
  337. this.queryParams.orgId = data.id;
  338. this.getList();
  339. },
  340. getRolesByOrg() {
  341. let params = {
  342. orgType: null,
  343. };
  344. findAllRole(params).then((res) => {
  345. this.planRoles = res.data;
  346. });
  347. },
  348. cleanExecOrgList() {
  349. this.execOrgIds = null;
  350. this.queryParams.execOrgList = [];
  351. },
  352. handleRolesChange(val) {
  353. this.selectedValues = val.toString().split(",");
  354. },
  355. getDefaultKey(key) {
  356. this.queryParams.orgId = key;
  357. this.getList();
  358. },
  359. /** 搜索按钮操作 */
  360. handleQuery() {
  361. this.queryParams.pageNum = 1;
  362. this.getList();
  363. },
  364. /** 重置按钮操作 */
  365. resetQuery() {
  366. this.resetForm("queryForm");
  367. this.queryParams.onlyManager = false;
  368. this.handleQuery();
  369. },
  370. reset() {
  371. return {
  372. planName: null,
  373. planType: null,
  374. planCycle: null,
  375. planStatus: null,
  376. orgType: null,
  377. roleNames: null,
  378. count: null,
  379. description: null,
  380. tableData: null,
  381. itemList: null,
  382. planExec: null,
  383. count: 0,
  384. note: null,
  385. planCreateOrgId: null,
  386. planCreateOrgName: null,
  387. roleList: null,
  388. roleId: null,
  389. execOrg: null,
  390. checkOrg: null,
  391. buildTaskNow: false,
  392. checkOrgList: [],
  393. execOrgList: [],
  394. rulePointList: null,
  395. checkOrgIds: null,
  396. execOrgIds: null,
  397. rulePointIds: null,
  398. checkOrgType: null,
  399. checkType: null,
  400. };
  401. },
  402. },
  403. };
  404. </script>
  405. <style lang="scss" scoped></style>