index.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <template>
  2. <div class="account pagePadding">
  3. <div
  4. v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
  5. >
  6. <ex-table
  7. v-loading="loading"
  8. v-if="
  9. powers && powers.length > 0 && powers.some((item) => item == '001')
  10. "
  11. :table="table"
  12. :data="tableData"
  13. :columns="columns"
  14. :page="pageInfo"
  15. :size="size"
  16. @page-curr-change="handlePageChange"
  17. @page-size-change="handleSizeChange"
  18. @screen-reset="
  19. pageInfo.curr = 1;
  20. parmValue.page = 1;
  21. searchList();
  22. "
  23. @screen-submit="
  24. pageInfo.curr = 1;
  25. parmValue.page = 1;
  26. searchList();
  27. "
  28. >
  29. <template #table-header="{}">
  30. <div style="width: 100%">
  31. <el-row style="padding: 0 0 0 80px">
  32. <el-col :span="24">
  33. <el-col :span="4" style="width: 140px; padding-left: 10px">
  34. <search-account
  35. :size="searchSize"
  36. :placeholder="'离职人姓名'"
  37. @searchChange="handleResignName"
  38. />
  39. </el-col>
  40. <el-col :span="4" style="width: 140px; padding: 0 0 0 10px">
  41. <search-account
  42. :size="searchSize"
  43. :placeholder="'接受人姓名'"
  44. @searchChange="handleHandoverName"
  45. />
  46. </el-col>
  47. <!-- style="width: 125px; padding: 0 0 0 10px" -->
  48. <el-col :span="4" class="auditStatus">
  49. <el-select
  50. v-model="type"
  51. filterable
  52. placeholder="审核状态"
  53. :size="searchSize"
  54. >
  55. <el-option
  56. v-for="item in status_options"
  57. :key="item.value"
  58. :label="item.label"
  59. :value="item.value"
  60. >
  61. </el-option>
  62. </el-select>
  63. </el-col>
  64. <el-col :span="3" style="width: 66px; float: right">
  65. <el-button
  66. :size="searchSize"
  67. type="primary"
  68. style="float: right"
  69. @click="searchList"
  70. >
  71. 刷新
  72. </el-button>
  73. </el-col>
  74. <el-col
  75. :span="3"
  76. style="width: 66px; float: right"
  77. v-if="powers.some((item) => item == '003')"
  78. >
  79. <el-button
  80. :size="searchSize"
  81. type="success"
  82. style="float: right"
  83. @click="openModal('add', false)"
  84. >
  85. 新建
  86. </el-button>
  87. </el-col>
  88. <el-col :span="5" style="width: 305px" class="pt10">
  89. <period-date-picker
  90. :width="'135px'"
  91. :size="searchSize"
  92. @timeReturned="handleTime"
  93. />
  94. </el-col>
  95. <el-col :span="4" style="width: 54px" class="pt10">
  96. <el-button
  97. :size="searchSize"
  98. type="primary"
  99. class="fr"
  100. icon="el-icon-search"
  101. @click="searchList"
  102. /></el-col>
  103. <el-col :span="4" style="width: 66px" class="pt10">
  104. <el-button
  105. type="warning"
  106. class="fr"
  107. :size="searchSize"
  108. @click="restSearch"
  109. >
  110. 重置
  111. </el-button>
  112. </el-col>
  113. </el-col>
  114. </el-row>
  115. </div>
  116. </template>
  117. <template #status="{ scope }">
  118. <el-tag
  119. :size="tablebtnSize"
  120. :type="scope.row.status == '0' ? 'warning' : ''"
  121. v-text="
  122. (statusOptions.find((item) => item.id == scope.row.status) || {})
  123. .label || '--'
  124. "
  125. ></el-tag>
  126. </template>
  127. <template #operation="{ scope }">
  128. <el-tooltip
  129. v-if="powers.some((item) => item == '007')"
  130. effect="dark"
  131. content="详情"
  132. placement="top"
  133. >
  134. <i
  135. class="el-icon-view tb-icon"
  136. @click="gotoDetail(scope.row.id)"
  137. ></i>
  138. </el-tooltip>
  139. </template>
  140. </ex-table>
  141. <add-edit
  142. :id="modelId"
  143. :show-model="showModel"
  144. :is-detail="isDetail"
  145. @refresh="searchList"
  146. @cancel="showModel = false"
  147. />
  148. </div>
  149. <div v-else>
  150. <no-auth></no-auth>
  151. </div>
  152. </div>
  153. </template>
  154. <script>
  155. import mixinPage from "@/mixins/elPaginationHandle";
  156. import asyncRequest from "@/apis/service/interest/handover";
  157. // import addEdit from "./addEdit";
  158. import addEdit from "./components/addEdit.vue";
  159. import statusList from "@/assets/js/statusList";
  160. import { mapGetters } from "vuex";
  161. import resToken from "@/mixins/resToken";
  162. export default {
  163. name: "handover",
  164. components: {
  165. addEdit,
  166. },
  167. mixins: [mixinPage, resToken],
  168. computed: {
  169. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  170. powers() {
  171. let tran =
  172. this.$store.getters.btnList.find(
  173. (item) => item.menu_route == "handover"
  174. ) || {};
  175. if (tran && tran.action && tran.action.length > 0) {
  176. return tran.action;
  177. } else {
  178. return [];
  179. }
  180. },
  181. },
  182. data() {
  183. return {
  184. // 状态
  185. statusOptions: [
  186. { id: "0", label: "禁用" },
  187. { id: "1", label: "启用" },
  188. ],
  189. type: "",
  190. status_options: [
  191. {
  192. value: "1",
  193. label: "状态1",
  194. },
  195. {
  196. value: "2",
  197. label: "状态2",
  198. },
  199. ],
  200. statusList: statusList,
  201. loading: true,
  202. showModel: false,
  203. isDetail: false,
  204. modelId: 0,
  205. parmValue: {
  206. start: "",
  207. end: "",
  208. type: "", //审核状态
  209. resign_name: "", //离职人姓名
  210. handover_name: "", //接受人姓名
  211. status: "", //
  212. page: 1, // 页码
  213. size: 15, // 每页显示条数
  214. resign_uid: "",
  215. hand_uid: "",
  216. },
  217. tableData: [],
  218. passwordModel: false,
  219. passwordModelId: 0,
  220. isPasswordDetail: false,
  221. // 表格 - 数据
  222. tableData: [],
  223. // 表格 - 参数
  224. table: {
  225. stripe: true,
  226. border: true,
  227. _defaultHeader_: ["setcol"],
  228. },
  229. // 表格 - 分页
  230. pageInfo: {
  231. size: 15,
  232. curr: 1,
  233. total: 0,
  234. },
  235. // 表格 - 列参数
  236. columns: [
  237. {
  238. prop: "resign_name",
  239. label: "离职人",
  240. },
  241. {
  242. prop: "hand_name",
  243. label: "接收人",
  244. },
  245. {
  246. prop: "status",
  247. label: "状态",
  248. _slot_: "status",
  249. },
  250. {
  251. prop: "addtime",
  252. label: "创建时间",
  253. sortable: true,
  254. },
  255. {
  256. prop: "",
  257. label: "操作",
  258. fixed: "right",
  259. _noset_: true,
  260. _slot_: "operation",
  261. },
  262. ],
  263. };
  264. },
  265. mounted() {
  266. this.searchList();
  267. },
  268. methods: {
  269. gotoDetail(id) {
  270. window.vm.$router.push({
  271. path: "newProcess",
  272. query: {
  273. id: id,
  274. },
  275. });
  276. },
  277. restSearch() {
  278. this.parmValue = {
  279. start: "", //开始 end结束时间
  280. end: "",
  281. // type: "", //审核状态
  282. // resign_name: "", //离职人姓名
  283. // handover_name: "", //接受人姓名
  284. status: "", //
  285. // page: 1, // 页码
  286. // size: 10, // 每页显示条数
  287. resign_uid: "",
  288. hand_uid: "",
  289. };
  290. this.searchList();
  291. },
  292. openModal(id, detail) {
  293. this.showModel = true;
  294. this.modelId = id;
  295. this.isDetail = detail;
  296. },
  297. // 获取离职交接列表
  298. async searchList() {
  299. console.log(this.parmValue);
  300. this.loading = true;
  301. const res = await asyncRequest.list(this.parmValue);
  302. if (res && res.code === 0 && res.data) {
  303. this.tableData = res.data.list;
  304. this.pageInfo.total = Number(res.data.count);
  305. } else if (res && res.code >= 100 && res.code <= 104) {
  306. await this.logout();
  307. } else {
  308. this.tableData = [];
  309. this.pageInfo.total = 0;
  310. }
  311. this.loading = false;
  312. },
  313. // 离职人部门
  314. handleResignPart(e) {
  315. console.log(e);
  316. this.parmValue.resign_part = e;
  317. },
  318. // 离职人姓名
  319. handleResignName(e) {
  320. console.log(e);
  321. this.parmValue.resign_uid = e.id;
  322. },
  323. // 接收人部门
  324. handleHandoverPart(e) {
  325. console.log(e);
  326. this.parmValue.handover_part = e;
  327. },
  328. // 接收人姓名
  329. handleHandoverName(e) {
  330. console.log(e);
  331. this.parmValue.hand_uid = e.id;
  332. },
  333. // 时间
  334. handleTime(e) {
  335. console.log(e);
  336. this.parmValue.start = e.startTime;
  337. this.parmValue.end = e.endTime;
  338. },
  339. },
  340. };
  341. </script>
  342. <style lang="scss" scoped>
  343. .auditStatus {
  344. width: 125px;
  345. padding: 0 0 0 10px;
  346. }
  347. .pt10 {
  348. padding: 0 0 0 10px;
  349. }
  350. @media screen and (max-width: 1300px) {
  351. .auditStatus {
  352. width: 450px;
  353. }
  354. .pt10 {
  355. padding-top: 10px;
  356. }
  357. }
  358. </style>