index.vue 11 KB

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