index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <div>
  3. <ListPage :column="listPageData.tableColumn" :tableApi="listPageData.tableApi" :isSelect="listPageData.isSelect"
  4. :scopeBtns="listPageData.scopeBtns" :searchBtns="listPageData.searchBtns" ref="userTableRef"
  5. v-if="options && options.length > 0" />
  6. <DialogForm ref="dialogFormRef" :title="title" :column="dialogData.column" @submit="submitForm" />
  7. </div>
  8. </template>
  9. <script setup>
  10. import { ref } from 'vue';
  11. import ListPage from '@/views/components/ListPage/index.vue';
  12. import { list } from "@/api/order/manage.js";
  13. import { getTreeList } from "@/api/staff/price.js";
  14. import DialogForm from '@/views/components/DialogForm/index.vue';
  15. const { proxy } = getCurrentInstance();
  16. const { lrr_service_status } = proxy.useDict("lrr_service_status");
  17. const router = useRouter();
  18. const options = ref([]);
  19. const userTableRef = ref();
  20. const dialogFormRef = ref(null);
  21. const listPageData = reactive({
  22. tableColumn: [
  23. {
  24. label: '订单ID',
  25. prop: 'mainOrderId',
  26. width: '180px'
  27. },
  28. {
  29. label: '时间',
  30. prop: 'createTime',
  31. type: 'date',
  32. isSearch: false,
  33. width: '180px'
  34. },
  35. {
  36. label: '志愿者姓名',
  37. prop: 'name',
  38. type: 'input',
  39. isSearch: true,
  40. },
  41. {
  42. label: '志愿者手机号',
  43. prop: 'phonenumber',
  44. type: 'input',
  45. isSearch: true
  46. },
  47. {
  48. label: '用户手机号',
  49. prop: 'clientTelephone',
  50. type: 'input',
  51. isSearch: true
  52. },
  53. // {
  54. // label: '服务项目',
  55. // prop: 'businessManagementId',
  56. // type: 'cascader',
  57. // isSearch: true,
  58. // tableProp: 'projectName',
  59. // options: options,
  60. // props: { label: 'businessName', value: 'id', checkStrictly:true },
  61. // },
  62. {
  63. label: '项目类别',
  64. prop: 'businessTierName',
  65. },
  66. // {
  67. // label: '科目',
  68. // prop: 'projectTypeName',
  69. // },
  70. {
  71. label: '评分',
  72. prop: 'address',
  73. },
  74. {
  75. label: '订单状态',
  76. prop: 'orderStatus',
  77. type: 'dict',
  78. dict: lrr_service_status
  79. },
  80. {
  81. label: '订单单价',
  82. prop: 'serviceOnePrice',
  83. },
  84. {
  85. label: '订单金额',
  86. prop: 'serviceTotalPrice',
  87. },
  88. {
  89. label: '平台提成',
  90. prop: 'skillDescribe',
  91. },
  92. ],
  93. searchBtns: [],
  94. tableApi: list,//接口地址
  95. isSelect: false,//是否勾选
  96. scopeBtns: [
  97. // {
  98. // label: '审核',
  99. // type: 'primary',
  100. // hasPermi: ['manage:examine'],
  101. // key: 'examine',
  102. // func: (row) => {
  103. // console.log(row)
  104. // openDialog(row, 'examine')
  105. // },
  106. // show: (row) => {
  107. // return row.appStatus == 1
  108. // }
  109. // },
  110. {
  111. label: '查看',
  112. type: 'primary',
  113. hasPermi: ['manage:details'],
  114. key: 'details',
  115. func: (row) => {
  116. console.log(row)
  117. router.push("/order/order-details/index/" + row.mainOrderId);
  118. // openDialog(row)
  119. }
  120. },
  121. // {
  122. // label: '删除',
  123. // type: 'danger',
  124. // hasPermi: ['manage:delete'],
  125. // key: 'delete',
  126. // func: (row) => {
  127. // console.log(row)
  128. // handleDelete([row.id])
  129. // }
  130. // }
  131. ]
  132. })
  133. const dialogData = reactive({
  134. title: '',
  135. column: [
  136. {
  137. label: '姓名',
  138. prop: 'name',
  139. type: 'input',
  140. },
  141. {
  142. label: '年龄',
  143. prop: 'age',
  144. type: 'input',
  145. },
  146. {
  147. label: '电话',
  148. prop: 'phonenumber',
  149. type: 'input',
  150. },
  151. {
  152. label: '家庭地址',
  153. prop: 'address',
  154. type: 'input',
  155. },
  156. {
  157. label: '服务项目/类别',
  158. prop: 'businessManagementId',
  159. type: 'cascader',
  160. isSearch: true,
  161. options: options,
  162. props: { label: 'businessName', value: 'id', checkStrictly:true },
  163. },
  164. {
  165. label: '身份证件',
  166. prop: 'idCardPicture',
  167. type: 'img',
  168. },
  169. {
  170. label: '职业证书',
  171. prop: 'certificationPicture',
  172. type: 'img',
  173. },
  174. {
  175. label: '技能简介',
  176. prop: 'skillDescribe',
  177. type: 'textarea',
  178. },
  179. {
  180. label: '审核状态',
  181. prop: 'appStatus',
  182. type: 'radio',
  183. rules: [
  184. { required: true, message: '请选择审核状态', trigger: 'blur' }
  185. ],
  186. options: [
  187. {
  188. label: '通过',
  189. value: '2'
  190. },
  191. {
  192. label: '不通过',
  193. value: '3'
  194. }
  195. ]
  196. },
  197. ]
  198. })
  199. const { title } = toRefs(dialogData);
  200. const parentId = ref(0);
  201. const openDialog = (row, type) => {
  202. console.log('row', row);
  203. try {
  204. const disabledData = {
  205. name: true,
  206. age: true,
  207. phonenumber: true,
  208. address: true,
  209. skillDescribe: true,
  210. businessManagementId: true,
  211. }
  212. if (type) {
  213. //审核
  214. title.value = '审核'
  215. } else {
  216. disabledData['appStatus'] = true;
  217. //查看详情
  218. title.value = '查看详情'
  219. }
  220. dialogFormRef.value.initForm(row, disabledData)
  221. } catch (error) {
  222. console.log('error', error);
  223. } finally {
  224. console.log('dialogFormRef.value', dialogFormRef.value);
  225. dialogFormRef.value.handleDialog(true);
  226. }
  227. }
  228. const handleDelete = (ids) => {
  229. proxy.$modal.confirm('是否确认删除角色编号为"' + ids + '"的数据项?').then(function () {
  230. return true
  231. }).then(() => {
  232. userTableRef.value.resetForm();
  233. proxy.$modal.msgSuccess("删除成功");
  234. }).catch(() => { });
  235. }
  236. const submitForm = async (parmas) => {
  237. try {
  238. console.log('submit', parmas);
  239. // if (title.value === '审核') {
  240. // const res = await approval({
  241. // volunteerInfoId: parmas.volunteerInfoId,
  242. // appStatus: parmas.appStatus,
  243. // rejectReason: parmas.rejectReason
  244. // })
  245. // if (up_res.code === 200) {
  246. // proxy.$modal.msgSuccess("审核成功");
  247. // return;
  248. // }
  249. // proxy.$modal.msgSuccess(res.msg);
  250. // }
  251. } catch (error) {
  252. console.log('error', error);
  253. } finally {
  254. userTableRef.value.resetForm();
  255. dialogFormRef.value.handleDialog(false);
  256. }
  257. }
  258. const getTreeListData = async () => {
  259. try {
  260. const res = await getTreeList({ parentId: parentId.value });
  261. console.log('res', res);
  262. options.value = res.data;
  263. } catch (error) {
  264. }
  265. }
  266. getTreeListData();
  267. </script>
  268. <style lang='scss' scoped></style>