index.vue 12 KB

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