index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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. plain
  101. icon="el-icon-plus"
  102. size="mini"
  103. @click="handleAdd"
  104. v-hasPermi="['system:user:add']"
  105. >新增</el-button
  106. >
  107. </el-col>
  108. </el-row>
  109. <el-table
  110. border
  111. height="650"
  112. size="small"
  113. v-loading="loading"
  114. :data="dataList"
  115. align="center"
  116. fixed
  117. @selection-change="handleSelectionChange"
  118. >
  119. <el-table-column
  120. label="序号"
  121. type="index"
  122. width="50"
  123. ></el-table-column>
  124. <el-table-column label="创建机构" prop="orgName" />
  125. <el-table-column label="外包评价名称" prop="evaluateName" />
  126. <el-table-column label="评价机构类型" prop="orgType" />
  127. <el-table-column label="评价角色" prop="roleName" />
  128. <el-table-column label="评价周期" prop="evaluateCycle" />
  129. <el-table-column label="创建人" prop="createBy" />
  130. <el-table-column label="创建时间" prop="createTime" />
  131. <el-table-column label="状态" width="150">
  132. <template slot-scope="{ row }">
  133. <el-switch
  134. v-model="row.status"
  135. active-text="启用"
  136. active-value="0"
  137. inactive-text="禁用"
  138. inactive-value="1"
  139. @change="swtichChangeHandler(row)"
  140. >
  141. </el-switch>
  142. </template>
  143. </el-table-column>
  144. <el-table-column
  145. label="操作"
  146. width="180"
  147. fixed="right"
  148. class-name="small-padding fixed-width"
  149. >
  150. <template slot-scope="{ row }">
  151. <!-- publishEvaluate -->
  152. <el-button
  153. size="mini"
  154. @click="publishHandler(row)"
  155. type="text"
  156. icon="el-icon-plus"
  157. >发布</el-button
  158. >
  159. <el-button
  160. size="mini"
  161. @click="editHandler(row)"
  162. type="text"
  163. icon="el-icon-plus"
  164. >编辑</el-button
  165. ><el-button
  166. size="mini"
  167. @click="deleteHandler(row)"
  168. type="text"
  169. icon="el-icon-plus"
  170. >删除</el-button
  171. >
  172. </template>
  173. </el-table-column>
  174. </el-table>
  175. <pagination
  176. v-show="total > 0"
  177. :total="total"
  178. :page.sync="queryParams.pageNum"
  179. :limit.sync="queryParams.pageSize"
  180. @pagination="getList"
  181. />
  182. </el-col>
  183. </el-row>
  184. </layoutCom>
  185. <editEvaluate ref="Evaluate" @success="getList()"></editEvaluate>
  186. </div>
  187. </template>
  188. <script>
  189. import { mapGetters } from "vuex";
  190. import { findAllRole } from "@/api/system/role";
  191. import {
  192. list,
  193. swtichHandler,
  194. delelteEvaluate,
  195. publishEvaluate,
  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. // publishEvaluate
  273. this.$modal
  274. .confirm("是否确认发布?")
  275. .then(function () {})
  276. .then(() => {
  277. publishEvaluate(row.id).then((res) => {
  278. let { code, msg } = res;
  279. if (code == 200) {
  280. this.getList();
  281. this.$modal.msgSuccess("发布成功");
  282. } else {
  283. this.$modal.msgSuccess(msg);
  284. }
  285. });
  286. });
  287. },
  288. deleteHandler(row) {
  289. this.$modal
  290. .confirm("是否确认删除?")
  291. .then(function () {})
  292. .then(() => {
  293. delelteEvaluate(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. checkChange(state) {
  306. this.queryParams.checkSub = state;
  307. this.getList();
  308. },
  309. // 节点单击事件
  310. clickTreeNode(data) {
  311. this.queryParams.orgId = data.id;
  312. this.getList();
  313. },
  314. getRolesByOrg() {
  315. let params = {
  316. orgType: null,
  317. };
  318. findAllRole(params).then((res) => {
  319. this.planRoles = res.data;
  320. });
  321. },
  322. cleanExecOrgList() {
  323. this.execOrgIds = null;
  324. this.queryParams.execOrgList = [];
  325. },
  326. handleRolesChange(val) {
  327. this.selectedValues = val.toString().split(",");
  328. },
  329. getDefaultKey(key) {
  330. this.queryParams.orgId = key;
  331. this.getList();
  332. },
  333. /** 搜索按钮操作 */
  334. handleQuery() {
  335. this.queryParams.pageNum = 1;
  336. this.getList();
  337. },
  338. /** 重置按钮操作 */
  339. resetQuery() {
  340. this.resetForm("queryForm");
  341. this.queryParams.onlyManager = false;
  342. this.handleQuery();
  343. },
  344. reset() {
  345. return {
  346. planName: null,
  347. planType: null,
  348. planCycle: null,
  349. planStatus: null,
  350. orgType: null,
  351. roleNames: null,
  352. count: null,
  353. description: null,
  354. tableData: null,
  355. itemList: null,
  356. planExec: null,
  357. count: 0,
  358. note: null,
  359. planCreateOrgId: null,
  360. planCreateOrgName: null,
  361. roleList: null,
  362. roleId: null,
  363. execOrg: null,
  364. checkOrg: null,
  365. buildTaskNow: false,
  366. checkOrgList: [],
  367. execOrgList: [],
  368. rulePointList: null,
  369. checkOrgIds: null,
  370. execOrgIds: null,
  371. rulePointIds: null,
  372. checkOrgType: null,
  373. checkType: null,
  374. };
  375. },
  376. },
  377. };
  378. </script>
  379. <style lang="scss" scoped></style>