index.vue 9.8 KB

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