index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. <!--
  2. * @Description:
  3. * @Date: 2021-05-08 08:41:26
  4. * @LastEditTime: 2022-09-26 18:22:44
  5. * @FilePath: \WEB\maintenanceManagement\src\views\performanceManage\performanceEvaluation\performanceEvaluation.vue
  6. -->
  7. <template>
  8. <div style="padding-right: 20px">
  9. <div class="handle-box">
  10. <el-input
  11. class="servertype-serch"
  12. v-model.trim="mixins_query.userName"
  13. placeholder="请输入用户名"
  14. ></el-input>
  15. <select-tree
  16. class="new-select-tree"
  17. selectTreeTitle="所属公司"
  18. placeholder="请选择所属公司"
  19. :options="organListCompany"
  20. :props="defaultProps"
  21. v-model="mixins_query.companyOrgId"
  22. @selected="selectedcompanyOrgId"
  23. >
  24. </select-tree>
  25. <select-tree
  26. class="new-select-tree"
  27. selectTreeTitle="所属部门"
  28. placeholder="请选择所属部门"
  29. :options="organListdepartment"
  30. :props="defaultProps"
  31. v-model="mixins_query.deptOrgId"
  32. >
  33. </select-tree>
  34. <el-select
  35. clearable
  36. class="servertype-serch"
  37. v-model="mixins_query.state"
  38. placeholder="请选择考评状态"
  39. >
  40. <el-option
  41. v-for="(item, index) in allServiceStatu"
  42. :key="index"
  43. :label="item.label"
  44. :value="item.id"
  45. >{{
  46. item.label
  47. }}</el-option>
  48. </el-select>
  49. <el-date-picker
  50. v-show="mixins_query.cycle == 0"
  51. :clearable="false"
  52. class="servertype-serch"
  53. v-model="days"
  54. type="month"
  55. placeholder="请选择月"
  56. format="yyyy年MM月"
  57. ></el-date-picker>
  58. <datepicker-quarter
  59. v-show="mixins_query.cycle == 1"
  60. :clearable="false"
  61. class="servertype-serch"
  62. type="quarter"
  63. placeholder="请选择季"
  64. value-format="yyyy年MM季度"
  65. @change-quarter="changeQuarter"
  66. ></datepicker-quarter>
  67. <el-date-picker
  68. v-show="mixins_query.cycle == 2"
  69. :clearable="false"
  70. class="servertype-serch"
  71. v-model="days"
  72. type="year"
  73. placeholder="请选择年"
  74. format="yyyy年"
  75. ></el-date-picker>
  76. <el-radio-group
  77. v-model="mixins_query.cycle"
  78. class="mr20 self-el-radio-group-box"
  79. >
  80. <el-radio :label="0">月度</el-radio>
  81. <el-radio :label="1">季度</el-radio>
  82. <el-radio :label="2">年度</el-radio>
  83. </el-radio-group>
  84. <el-button
  85. type="primary"
  86. class="search-btn"
  87. @click="getlistpage"
  88. icon="el-icon-search"
  89. >查询 </el-button>
  90. <!-- <i class="fr fr-fs-fc fr-add iconfont" @click="openEvaluationHandle" v-left-txt-tip data-txt="新增">&#xe641;</i>
  91. <i class="fr fr-fs-fc fr-del iconfont" @click="delusergroup" v-txt-tip data-txt="删除">&#xe63b;</i> -->
  92. </div>
  93. <!-- 表格 -->
  94. <div class="device-manage-table">
  95. <zz-table
  96. :cols="cols"
  97. :settings="{ showCheckbox: false, showIndex: true, stripe: true }"
  98. :loading="mixins_onQuery"
  99. :data="mixins_list"
  100. :pageset="mixins_pageset"
  101. @page-change="pageChange"
  102. @selection-change="selectionChange"
  103. >
  104. <template
  105. slot-scope="scope"
  106. slot="statecolor"
  107. >
  108. <span
  109. v-if="scope.row.state === '未考评'"
  110. style="color: #fd3a68"
  111. >{{ scope.row.state }}</span>
  112. <span
  113. v-else
  114. style="color: #21d4dc"
  115. >{{ scope.row.state }}</span>
  116. </template>
  117. <template
  118. slot-scope="scope"
  119. slot="opt"
  120. >
  121. <div class="opt">
  122. <el-tooltip
  123. effect="light"
  124. placement="bottom"
  125. content="考评"
  126. >
  127. <i
  128. class="iconfont"
  129. @click="openEvaluationHandle(scope.row)"
  130. >&#xe645;</i>
  131. </el-tooltip>
  132. <el-tooltip
  133. effect="light"
  134. placement="bottom"
  135. content="详情"
  136. >
  137. <i
  138. class="zoniot_font zoniot-icon-xiangqing"
  139. @click="openEvaluationDetile(scope.row)"
  140. ></i>
  141. </el-tooltip>
  142. </div>
  143. </template>
  144. </zz-table>
  145. </div>
  146. </div>
  147. </template>
  148. <script>
  149. import list from '@utils/list.js';
  150. export default {
  151. mixins: [list],
  152. data () {
  153. return {
  154. mixins_query: {
  155. userName: '',
  156. companyOrgId: '',
  157. deptOrgId: '',
  158. state: '',
  159. cycle: 0,
  160. year: '',
  161. month: '',
  162. sort: 1
  163. },
  164. days: new Date(),
  165. lastQuarter: '',
  166. scenetypeList: [],
  167. organListCompany: '',
  168. organListdepartment: '',
  169. allServiceStatu: [
  170. {
  171. id: 1,
  172. label: '已考评'
  173. },
  174. {
  175. id: 0,
  176. label: '未考评'
  177. }
  178. ],
  179. defaultProps: {
  180. value: 'id', // 唯一标识
  181. label: 'orgName', // 标签显示
  182. children: 'orgs' // 子级
  183. },
  184. selectRow: '',
  185. allSelectRow: [],
  186. cols: [
  187. {
  188. label: '用户名',
  189. prop: 'evaluationBe'
  190. },
  191. {
  192. label: '所属公司',
  193. prop: 'companyOrgName'
  194. },
  195. {
  196. label: '所属部门',
  197. prop: 'deptOrgName'
  198. },
  199. {
  200. label: '考评状态',
  201. prop: 'state',
  202. slot: 'statecolor'
  203. },
  204. {
  205. label: '考评周期',
  206. prop: 'cycle'
  207. },
  208. {
  209. label: '操作',
  210. prop: 'opt',
  211. slot: 'opt'
  212. }
  213. ]
  214. };
  215. },
  216. created () {
  217. this.getorgTree();
  218. this.getlistpage();
  219. },
  220. methods: {
  221. getlistpage () {
  222. switch (this.mixins_query.cycle) {
  223. case 0:
  224. this.mixins_query.month = this.days.getMonth() + 1;
  225. this.mixins_query.year = this.days.getFullYear();
  226. break;
  227. case 1:
  228. this.mixins_query.month = this.lastQuarter.season;
  229. this.mixins_query.year = this.lastQuarter.year;
  230. break;
  231. case 2:
  232. this.mixins_query.month = '';
  233. this.mixins_query.year = this.days.getFullYear();
  234. break;
  235. default:
  236. break;
  237. }
  238. this.mixins_dataUrl = '/sc-community/evaluation/result/find/page';
  239. this.mixins_pageset = {
  240. pageNum: this.mixins_pageset.pageNum,
  241. pageSize: this.mixins_pageset.pageSize
  242. };
  243. this.mixins_post = 'post';
  244. this.mixins_search();
  245. },
  246. changeQuarter (val) {
  247. this.lastQuarter = val;
  248. },
  249. openEvaluationHandle (item) {
  250. let row = {};
  251. new Promise((resolve) => {
  252. this.$http.postForm('/sc-community/evaluation/task/find', { evaluationResultId: item.id }).then(({ status, data, msg }) => {
  253. if (status === 0) {
  254. row = data;
  255. resolve();
  256. } else {
  257. this.$message.error(msg);
  258. }
  259. });
  260. }).then(() => {
  261. new Promise((resolve) => {
  262. this.$store.dispatch('openModal', {
  263. url: '/performanceManagement/performanceEvaluation/popups/evaluationEdit.vue',
  264. width: '1200px',
  265. height: '510px',
  266. props: {
  267. rowInfo: item,
  268. data: row,
  269. year: this.mixins_query.year,
  270. month: this.mixins_query.month,
  271. callback: resolve
  272. },
  273. title: '考评',
  274. notip: true,
  275. confirmButtonText: '确定',
  276. showCancelButton: item.state === '未考评' ? false : true,
  277. showConfirmButton: item.state === '未考评' ? false : true
  278. });
  279. }).then(() => {
  280. this.mixins_search();
  281. });
  282. });
  283. },
  284. openEvaluationDetile (item) {
  285. let row = {};
  286. new Promise((resolve) => {
  287. this.$http.postForm('/sc-community/evaluation/task/find', { evaluationResultId: item.id }).then(({ status, data, msg }) => {
  288. if (status === 0) {
  289. row = data;
  290. resolve();
  291. } else {
  292. this.$message.error(msg);
  293. }
  294. });
  295. }).then(() => {
  296. new Promise((resolve) => {
  297. this.$store.dispatch('openModal', {
  298. url: '/performanceManagement/performanceEvaluation/popups/evaluationDetail.vue',
  299. width: '1200px',
  300. height: '510px',
  301. props: {
  302. rowInfo: item,
  303. data: row,
  304. cycle: this.mixins_query.cycle,
  305. year: this.mixins_query.year,
  306. month: this.mixins_query.month,
  307. callback: resolve
  308. },
  309. title: '考评详情',
  310. notip: true,
  311. showCancelButton: true,
  312. showConfirmButton: true
  313. });
  314. }).then(() => {
  315. // this.mixins_search();
  316. });
  317. });
  318. },
  319. selectionChange (val) {
  320. this.selectRow = val;
  321. },
  322. getorgTree () {
  323. // 获取公司树
  324. this.$http.postForm('/sc-user-center/org/getOrgUserTree', { orgType: 'company', id: '000' }).then(({ status, data, msg }) => {
  325. if (status === 0 && data) {
  326. this.organListCompany = data;
  327. } else {
  328. this.$message.error(msg);
  329. }
  330. });
  331. },
  332. selectedcompanyOrgId (e) {
  333. if (!e) return;
  334. // 获取 部门树e
  335. this.$http.postForm('/sc-user-center/org/getOrgUserTree', { orgType: 'department', id: e }).then(({ status, data, msg }) => {
  336. if (status === 0) {
  337. this.organListdepartment = data ? data : [];
  338. } else {
  339. this.$message.error(msg);
  340. }
  341. });
  342. }
  343. }
  344. };
  345. </script>
  346. <style lang="scss" scoped>
  347. .handle-box {
  348. height: 60px;
  349. background: #ffffff;
  350. opacity: 1;
  351. border-radius: 6px;
  352. box-sizing: border-box;
  353. padding: 15px 20px;
  354. margin-bottom: 20px;
  355. }
  356. .fr {
  357. float: right;
  358. }
  359. .fr:last-child {
  360. margin-right: 20px;
  361. }
  362. .fr-fs-fc {
  363. color: #2787f1;
  364. font-size: 30px;
  365. }
  366. .servertype-serch {
  367. width: 200px;
  368. height: 30px;
  369. margin-right: 20px;
  370. vertical-align: top;
  371. }
  372. .new-select-tree {
  373. vertical-align: top;
  374. display: inline-block;
  375. margin-right: 25px;
  376. width: 200px;
  377. }
  378. .servertype-serch-btn {
  379. width: 60px;
  380. height: 30px;
  381. background: #2787f1;
  382. opacity: 1;
  383. border-radius: 4px;
  384. padding: 0;
  385. }
  386. .mr20 {
  387. margin-right: 20px;
  388. }
  389. .self-el-radio-group-box {
  390. vertical-align: sub;
  391. }
  392. </style>