useData.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. import { ref,computed } from "vue";
  2. import { auditorOrderSettlement } from "@/api/finance/settlement.js";
  3. //功能
  4. export default ({proxy,jlzj_area_type}) => {
  5. const router = useRouter();
  6. const dialogFormRef = ref(null);
  7. const userTableRef = ref(null);
  8. const {
  9. lrr_service_status,
  10. settlement_application_auditor_status,
  11. area_settlement_status,
  12. service_centre_settlement_stauts
  13. } = proxy.useDict("lrr_service_status","settlement_application_auditor_status","area_settlement_status","service_centre_settlement_stauts");
  14. const tabList =computed(() => {
  15. let data = []
  16. data = settlement_application_auditor_status.value.map(item => {
  17. return {
  18. title: item.label,
  19. name: item.value
  20. }
  21. })
  22. return [{
  23. title: '全部',
  24. name: ''
  25. },...data] || [];
  26. })
  27. //打开弹窗
  28. const openDialog = (ids) => {
  29. console.log('ids', ids);
  30. try {
  31. dialogFormRef.value.initForm({ids:ids}, {})
  32. } catch (error) {
  33. console.log('error', error);
  34. } finally {
  35. console.log('dialogFormRef.value', dialogFormRef.value);
  36. dialogFormRef.value.handleDialog(true);
  37. }
  38. }
  39. //导出
  40. const exportFile = async(parmas) => {
  41. console.log("TCL: exportFile -> parmas", parmas)
  42. // try {
  43. // proxy.download("core/orderSettlementApplication/export",{
  44. // ...queryParams.value,
  45. // }, `订单费用结算_${new Date().getTime()}.xlsx`);
  46. // } catch (error) {
  47. // }
  48. }
  49. //申请提交
  50. const submitForm = async (data) => {
  51. try {
  52. console.log('submit', data);
  53. const parmas = {
  54. ids: data.ids,
  55. auditorStatus: data.auditorStatus,
  56. auditorRemark: data.auditorRemark
  57. }
  58. const res = await auditorOrderSettlement(parmas);
  59. if (res.code === 200) {
  60. proxy.$modal.msgSuccess("审核成功");
  61. userTableRef.value.resetForm();
  62. dialogFormRef.value.handleDialog(false);
  63. return;
  64. }
  65. proxy.$modal.msgSuccess(res.msg);
  66. } catch (error) {
  67. console.log('error', error);
  68. }
  69. }
  70. const list_quyu = ref([
  71. {
  72. label: jlzj_area_type.value === '0'?'区域中心':'服务中心',
  73. prop: 'areaName',
  74. type: 'input',
  75. isSearch: true,
  76. width:'150px'
  77. },
  78. {
  79. label: '提交人',
  80. prop: 'applyUserName',
  81. type: 'input',
  82. width:'150px',
  83. isSearch: false
  84. },
  85. {
  86. label: '订单编号',
  87. prop: 'outTradeNo',
  88. type: 'input',
  89. isSearch: true,
  90. width:'200px',
  91. },
  92. {
  93. label: '订单开始时间',
  94. queryLabel: '订单时间',
  95. prop: 'orderTime',
  96. width: '160px',
  97. isSearch: true,
  98. type: 'date',
  99. keys: ['startTime', 'endTime'],
  100. },
  101. {
  102. label: '订单完成时间',
  103. prop: 'serviceEndTime',
  104. width:'160px',
  105. },
  106. {
  107. label: '用户名称',
  108. prop: 'userNickName',
  109. width:'140px',
  110. type: 'input',
  111. isSearch: false
  112. },
  113. {
  114. label: '用户联系方式',
  115. prop: 'userPhone',
  116. width: '140px',
  117. type: 'input',
  118. isSearch: true
  119. },
  120. {
  121. label: '志愿者',
  122. prop: 'volunteerName',
  123. width:'140px',
  124. type: 'input',
  125. isSearch: false
  126. },
  127. {
  128. label: '志愿者联系方式',
  129. prop: 'volunteerPhone',
  130. width: '140px',
  131. type: 'input',
  132. isSearch: true
  133. },
  134. {
  135. label: '服务项目',
  136. prop: 'businessTierName',
  137. width:'170px'
  138. },
  139. {
  140. label: '订单总金额',
  141. prop: 'orderTotalPrice',
  142. width:'140px'
  143. },
  144. {
  145. label: '订单状态',
  146. prop: 'orderStatus',
  147. type: 'dict',
  148. dict: lrr_service_status,
  149. isSearch: false,
  150. width:'150px'
  151. },
  152. {
  153. label: '区域公司抽成比例',
  154. prop: 'areaDistributionRatio',
  155. width:'150px'
  156. },
  157. {
  158. label: '区域公司抽成金额',
  159. prop: 'areaDistributionAmount',
  160. width:'150px'
  161. },
  162. {
  163. label: '区域公司结算状态',
  164. prop: 'areaSettlementStatus',
  165. type: 'dict',
  166. dict: area_settlement_status,
  167. width:'150px',
  168. },
  169. {
  170. label: '区域公司结算时间',
  171. prop: 'areaSettlementTime',
  172. width:'150px',
  173. },
  174. {
  175. label: '开户行',
  176. prop: 'areaPayeeBankName',
  177. width:'150px'
  178. },
  179. {
  180. label: '收款账户',
  181. prop: 'areaPayeeAccount',
  182. width:'180px',
  183. type: 'input',
  184. isSearch: true
  185. },
  186. {
  187. label: '收款人',
  188. prop: 'areaPayeeName',
  189. width:'150px'
  190. },
  191. {
  192. label: '审核原因说明',
  193. prop: 'auditorRemark',
  194. width:'150px'
  195. },
  196. {
  197. label: '审核状态',
  198. prop: 'auditorStatus',
  199. type: 'dict',
  200. dict: settlement_application_auditor_status,
  201. width:'150px',
  202. },
  203. ])
  204. const list_fuwu = ref([
  205. {
  206. label: jlzj_area_type.value === '0'?'区域中心':'服务中心',
  207. prop: jlzj_area_type.value === '0'?'areaName':'serviceCentreName',
  208. type: 'input',
  209. isSearch: true,
  210. width:'150px'
  211. },
  212. {
  213. label: '提交人',
  214. prop: 'applyUserName',
  215. type: 'input',
  216. width:'150px',
  217. isSearch: false
  218. },
  219. {
  220. label: '订单编号',
  221. prop: 'outTradeNo',
  222. type: 'input',
  223. isSearch: true,
  224. width:'200px',
  225. },
  226. {
  227. label: '订单开始时间',
  228. queryLabel: '订单时间',
  229. prop: 'orderTime',
  230. width: '160px',
  231. isSearch: true,
  232. type: 'date',
  233. keys: ['startTime', 'endTime'],
  234. },
  235. {
  236. label: '订单完成时间',
  237. prop: 'serviceEndTime',
  238. width:'160px',
  239. },
  240. {
  241. label: '用户名称',
  242. prop: 'userNickName',
  243. width:'140px',
  244. type: 'input',
  245. isSearch: false
  246. },
  247. {
  248. label: '用户联系方式',
  249. prop: 'userPhone',
  250. width: '140px',
  251. type: 'input',
  252. isSearch: true
  253. },
  254. {
  255. label: '志愿者',
  256. prop: 'volunteerName',
  257. width:'140px',
  258. type: 'input',
  259. isSearch: false
  260. },
  261. {
  262. label: '志愿者联系方式',
  263. prop: 'volunteerPhone',
  264. width: '140px',
  265. type: 'input',
  266. isSearch: true
  267. },
  268. {
  269. label: '服务项目',
  270. prop: 'businessTierName',
  271. width:'170px'
  272. },
  273. {
  274. label: '订单总金额',
  275. prop: 'orderTotalPrice',
  276. width:'140px'
  277. },
  278. {
  279. label: '订单状态',
  280. prop: 'orderStatus',
  281. type: 'dict',
  282. dict: lrr_service_status,
  283. isSearch: false,
  284. width:'150px'
  285. },
  286. {
  287. label: '区域公司抽成比例',
  288. prop: 'areaDistributionRatio',
  289. width:'150px'
  290. },
  291. {
  292. label: '区域公司抽成金额',
  293. prop: 'areaDistributionAmount',
  294. width:'150px'
  295. },
  296. {
  297. label: '区域公司结算状态',
  298. prop: 'areaSettlementStatus',
  299. type: 'dict',
  300. dict: area_settlement_status,
  301. width:'150px',
  302. },
  303. {
  304. label: '区域公司结算时间',
  305. prop: 'areaSettlementTime',
  306. width:'150px',
  307. },
  308. {
  309. label: '服务中心抽成比例',
  310. prop: 'serviceCentreDistributionRatio',
  311. width:'150px'
  312. },
  313. {
  314. label: '服务中心抽成金额',
  315. prop: 'serviceCentreDistributionAmount',
  316. width:'150px'
  317. },
  318. {
  319. label: '服务中心结算状态',
  320. prop: 'serviceCentreSettlementStatus',
  321. type: 'dict',
  322. dict: service_centre_settlement_stauts,
  323. width:'150px',
  324. },
  325. {
  326. label: '服务中心结算时间',
  327. prop: 'serviceCentreSettlementTime',
  328. width:'150px',
  329. },
  330. {
  331. label: '审核原因说明',
  332. prop: 'auditorRemark',
  333. width:'150px'
  334. },
  335. {
  336. label: '审核状态',
  337. prop: 'auditorStatus',
  338. type: 'dict',
  339. dict: settlement_application_auditor_status,
  340. width:'150px',
  341. },
  342. ])
  343. return {
  344. dialogFormRef,
  345. userTableRef,
  346. tabList,
  347. openDialog,
  348. exportFile,
  349. submitForm,
  350. tableColumn:
  351. jlzj_area_type.value === '0'? list_quyu:list_fuwu,
  352. dialogData: {
  353. title: '审核',
  354. column: [
  355. {
  356. label: '审核状态',
  357. prop: 'auditorStatus',
  358. type: 'radio',
  359. rules: [
  360. { required: true, message: '请选择审核状态', trigger: 'blur' }
  361. ],
  362. options: [
  363. {
  364. label: '通过',
  365. value: '20'
  366. },
  367. {
  368. label: '不通过',
  369. value: '30'
  370. }
  371. ]
  372. },
  373. {
  374. label: '驳回原因',
  375. prop: 'auditorRemark',
  376. type: 'textarea',
  377. show:(form)=>{
  378. console.log('驳回原因',form);
  379. return form.auditorStatus === '30'
  380. }
  381. },
  382. ]
  383. },
  384. searchBtns:[
  385. {
  386. label: '批量审核',
  387. func: () => {
  388. const ids = userTableRef.value.ids;
  389. console.log('批量删除', ids)
  390. ids.length > 0 && openDialog(ids)
  391. },
  392. key: 'applicant',
  393. type: 'primary',
  394. show: (tabsValue) => {
  395. return tabsValue === '10'
  396. }
  397. },
  398. {
  399. label: '导出',
  400. func: (parmas) => {
  401. try {
  402. proxy.download("core/orderSettlementApplication/export",{
  403. ...parmas,
  404. auditorStatus: parmas.tabsValue
  405. }, `订单费用结算申请表_${new Date().getTime()}.xlsx`);
  406. } catch (error) {
  407. }
  408. },
  409. key: 'export',
  410. type: 'primary'
  411. },
  412. ],
  413. scopeBtns:[
  414. {
  415. label: '审核',
  416. type: 'primary',
  417. key: 'examine',
  418. func: (row) => {
  419. console.log(row)
  420. openDialog([row.id])
  421. },
  422. show:(row)=>{
  423. return row.auditorStatus === '10'
  424. }
  425. },
  426. // {
  427. // label: '查看详情',
  428. // type: 'primary',
  429. // key: 'details',
  430. // func: (row) => {
  431. // console.log(row)
  432. // router.push({
  433. // path: "/order-details",
  434. // query: { id: row.mainOrderId }
  435. // });
  436. // }
  437. // },
  438. ]
  439. }
  440. }