index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. <template>
  2. <a-card :bordered="false" style="margin-bottom: 10px" class="mb-2">
  3. <a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
  4. <a-row :gutter="24">
  5. <a-col :span="6">
  6. <a-form-item label="订单编号" name="orderNumber">
  7. <a-input v-model:value="searchFormState.orderNumber" placeholder="订单编号查询" />
  8. </a-form-item>
  9. </a-col>
  10. <!-- <a-col :span="6">
  11. <a-form-item label="订单名称" name="orderName">
  12. <a-input v-model:value="searchFormState.orderName" placeholder="订单名称查询" />
  13. </a-form-item>
  14. </a-col>-->
  15. <a-col :span="6">
  16. <a-form-item label="车牌号" name="licenseNumber">
  17. <a-input v-model:value="searchFormState.licenseNumber" placeholder="车牌号码查询" />
  18. </a-form-item>
  19. </a-col>
  20. <a-col :span="6">
  21. <a-form-item label="客户名称" name="customerName">
  22. <a-input v-model:value="searchFormState.customerName" placeholder="客户名称查询" />
  23. </a-form-item>
  24. </a-col>
  25. <template v-if="advanced">
  26. <a-col :span="6">
  27. <a-form-item label="货品名称" name="goodsName">
  28. <a-input v-model:value="searchFormState.goodsName" placeholder="货品名称查询" />
  29. </a-form-item>
  30. </a-col>
  31. <a-col :span="6">
  32. <a-form-item label="司机名称" name="driverName">
  33. <a-input v-model:value="searchFormState.driverName" placeholder="司机名称查询" />
  34. </a-form-item>
  35. </a-col>
  36. <a-col :span="6">
  37. <a-form-item label="司机电话" name="driverMobile">
  38. <a-input v-model:value="searchFormState.driverMobile" placeholder="司机电话查询" />
  39. </a-form-item>
  40. </a-col>
  41. <a-col :span="6">
  42. <a-form-item label="预约状态" name="status">
  43. <a-select v-model:value="searchFormState.status" placeholder="预约状态查询"
  44. :options="statusList"
  45. > </a-select>
  46. </a-form-item>
  47. </a-col>
  48. </template>
  49. <a-col :span="6">
  50. <a-button type="primary" @click="tableRef.refresh()">查询</a-button>
  51. <a-button style="margin: 0 8px" @click="reset">重置</a-button>
  52. <a @click="toggleAdvanced" style="margin-left: 8px">
  53. {{ advanced ? '收起' : '展开' }}
  54. <component :is="advanced ? 'up-outlined' : 'down-outlined'" />
  55. </a>
  56. </a-col>
  57. </a-row>
  58. </a-form>
  59. </a-card>
  60. <a-card :bordered="false">
  61. <s-table
  62. ref="tableRef"
  63. :columns="columns"
  64. :data="loadData"
  65. bordered
  66. :row-key="(record) => record.id"
  67. >
  68. <template #operator class="table-operator">
  69. <a-space>
  70. <!-- <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizAppointmentRecordAdd')">
  71. <template #icon><plus-outlined /></template>
  72. 新增
  73. </a-button>-->
  74. <!-- <a-button @click="exportTotal" v-if="hasPerm('bizAppointmentExport')">
  75. <template #icon>
  76. <export-outlined/>
  77. </template>
  78. 导出
  79. </a-button>-->
  80. </a-space>
  81. </template>
  82. <template #bodyCell="{ column, record }">
  83. <template v-if="column.dataIndex === 'orderInfo'">
  84. <div class="time-list">
  85. <p>名称:{{ record.orderName }}</p>
  86. <p style="margin-bottom: 0">编号:{{ record.orderNumber }}</p>
  87. </div>
  88. </template>
  89. <template v-if="column.dataIndex === 'timeInfo'">
  90. <div class="time-list">
  91. <p>开始时间:{{ record.beginTime }}</p>
  92. <p style="margin-bottom: 0">结束时间:{{ record.endTime }}</p>
  93. </div>
  94. </template>
  95. <template v-if="column.dataIndex === 'customerInfo'">
  96. <span>{{record.customerName}}</span>
  97. </template>
  98. <template v-if="column.dataIndex === 'driverInfo'">
  99. <div class="time-list">
  100. <p>姓名:{{ record.driverName }}</p>
  101. <p style="margin-bottom: 0">电话:{{ record.driverMobile }}</p>
  102. </div>
  103. </template>
  104. <template v-if="column.dataIndex === 'goodsInfo'">
  105. <div class="time-list">
  106. <p>名称:{{ record.goodsName }}</p>
  107. <p style="margin-bottom: 0">规格:{{ record.goodsCode }}</p>
  108. </div>
  109. </template>
  110. <template v-if="column.dataIndex === 'status'">
  111. <a-tag
  112. :color="
  113. record.status === '1'
  114. ? 'volcano'
  115. : record.status === '2'
  116. ? 'red'
  117. : record.status === '3'
  118. ? 'processing'
  119. : record.status === '4'
  120. ? 'warning'
  121. : record.status === '5'
  122. ? 'magenta'
  123. : record.status === '6'
  124. ? 'orange'
  125. : record.status === '7'
  126. ? 'gold'
  127. : record.status === '8'
  128. ? 'lime'
  129. : record.status === '9'
  130. ? 'green'
  131. : record.status === '10'
  132. ? 'cyan'
  133. : record.status === '11'
  134. ? 'success'
  135. : record.status === '12'
  136. ? 'blue'
  137. : record.status === '13'
  138. ? 'geekblue'
  139. : 'error'
  140. "
  141. >
  142. {{ $TOOL.dictTypeData('appointment_status', record.status) }}
  143. </a-tag>
  144. </template>
  145. <template v-if="column.dataIndex === 'action'">
  146. <a style="color: #ffaa00" @click="orderRef.onOpen(record)" v-if="hasPerm('bizAppointmentRecordOrder') && (record.status == '3' || record.status == '4' || record.status == '5' || record.status == '6')">车辆调度</a>
  147. <!-- <a-divider type="vertical" v-if="(hasPerm('bizAppointmentRecordOrder') && (record.status == '3' || record.status == '4' || record.status == '5' || record.status == '6'|| record.status == '7'|| record.status == '8'|| record.status == '9')) && (hasPerm('bizAppointmentRecordTime') && (record.status == '3' || record.status == '4'))" />
  148. <a style="color:blue" @click="formRef.onOpen(record)" v-if="hasPerm('bizAppointmentRecordTime') && (record.status == '3' || record.status == '4')">调整时段</a>-->
  149. <a-divider type="vertical" v-if="(hasPerm('bizAppointmentRecordOrder') && (record.status == '3' || record.status == '4' || record.status == '5' || record.status == '6')) && (hasPerm('bizAppointmentRecordCancel') && (record.status == '3' || record.status == '4'))" />
  150. <a style="color:red" type="link" danger size="small" @click="cancelConfig(record)" v-if="hasPerm('bizAppointmentRecordCancel') && (record.status == '3' || record.status == '4')">取消排队</a>
  151. </template>
  152. </template>
  153. </s-table>
  154. </a-card>
  155. <Form ref="formRef" @successful="tableRef.refresh()" />
  156. <Order ref="orderRef" @successful="tableRef.refresh()" />
  157. <Review ref="reviewRef" @successful="tableRef.refresh(true)" />
  158. <Detail ref="detailRef" @successful="tableRef.refresh()" />
  159. </template>
  160. <script setup name="bizappointmentrecord">
  161. import { cloneDeep } from 'lodash-es'
  162. import bizAppointmentRecordApi from '@/api/biz/bizAppointmentRecordApi'
  163. import tool from '@/utils/tool'
  164. import downloadUtil from '@/utils/downloadUtil'
  165. import Detail from './detail.vue'
  166. import Order from './editOrder.vue'
  167. import Form from './form.vue'
  168. import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
  169. import {Modal} from 'ant-design-vue';
  170. import {createVNode} from 'vue';
  171. const submitLoading = ref(false)
  172. const tableRef = ref()
  173. const formRef = ref()
  174. const orderRef = ref()
  175. const reviewRef = ref()
  176. const detailRef = ref()
  177. const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
  178. const nowRecord = ref()
  179. //查询数据
  180. const searchFormState = ref({appointmentFlag:'1'})
  181. const searchFormRef = ref()
  182. const statusList = tool.dictList('queue_status')
  183. // 查询区域显示更多控制
  184. const advanced = ref(false)
  185. const toggleAdvanced = () => {
  186. advanced.value = !advanced.value
  187. }
  188. const columns = [
  189. /*{
  190. title: '订单信息',
  191. dataIndex: 'orderInfo',
  192. width:200
  193. },*/
  194. {
  195. title: '订单编号',
  196. dataIndex: 'orderNumber',
  197. align:'center',
  198. width:150
  199. },
  200. {
  201. title: '车牌号',
  202. dataIndex: 'licenseNumber',
  203. width:150,
  204. align: 'center'
  205. },
  206. {
  207. title: '提货时间',
  208. dataIndex: 'timeInfo',
  209. align:'center',
  210. width:200
  211. },
  212. {
  213. title: '客户名称',
  214. dataIndex: 'customerInfo',
  215. align:'center',
  216. width:180
  217. },
  218. {
  219. title: '货品信息',
  220. dataIndex: 'goodsInfo',
  221. width:160
  222. },
  223. {
  224. title: '司机信息',
  225. dataIndex: 'driverInfo',
  226. width: 160
  227. },
  228. {
  229. title: '排队号',
  230. dataIndex: 'queueNumber',
  231. width: 110,
  232. align:'center'
  233. },
  234. {
  235. title: '状态',
  236. dataIndex: 'status',
  237. align: 'center',
  238. width:120
  239. },
  240. ]
  241. // 操作栏通过权限判断是否显示
  242. columns.push({
  243. title: '操作',
  244. dataIndex: 'action',
  245. align: 'center',
  246. fixed: 'right',
  247. width: 240
  248. })
  249. const selectedRowKeys = ref([])
  250. // 列表选择配置
  251. const options = {
  252. // columns数字类型字段加入 needTotal: true 可以勾选自动算账
  253. alert: {
  254. show: true,
  255. clear: () => {
  256. selectedRowKeys.value = ref([])
  257. }
  258. },
  259. rowSelection: {
  260. onChange: (selectedRowKey, selectedRows) => {
  261. selectedRowKeys.value = selectedRowKey
  262. }
  263. }
  264. }
  265. const loadData = (parameter) => {
  266. const searchFormParam = cloneDeep(searchFormState.value)
  267. searchFormParam.type = '1'
  268. return bizAppointmentRecordApi.bizAppointmentRecordPage(Object.assign(parameter, searchFormParam)).then((data) => {
  269. return data
  270. })
  271. }
  272. // 重置
  273. const reset = () => {
  274. searchFormRef.value.resetFields()
  275. tableRef.value.refresh(true)
  276. }
  277. // 删除
  278. const deleteBizAppointmentRecord = (record) => {
  279. let params = [
  280. {
  281. id: record.id
  282. }
  283. ]
  284. bizAppointmentRecordApi.bizAppointmentRecordDelete(params).then(() => {
  285. tableRef.value.refresh(true)
  286. })
  287. }
  288. // 删除
  289. const deleteConfig = (record) => {
  290. Modal.confirm({
  291. title: '确定删除该数据吗?',
  292. icon: createVNode(ExclamationCircleOutlined),
  293. content: '',
  294. onOk() {
  295. submitLoading.value = true
  296. let params = [
  297. {
  298. id: record.id
  299. }
  300. ]
  301. bizAppointmentRecordApi
  302. .bizAppointmentRecordDelete(params)
  303. .then(() => {
  304. tableRef.value.refresh(true)
  305. })
  306. .finally(() => {
  307. submitLoading.value = false
  308. })
  309. },
  310. onCancel() {}
  311. })
  312. }
  313. //取消排队
  314. const cancelConfig = (record)=>{
  315. Modal.confirm({
  316. title: '确定要取消排队吗?',
  317. icon: createVNode(ExclamationCircleOutlined),
  318. content: '',
  319. onOk() {
  320. submitLoading.value = true
  321. let params =
  322. {
  323. id: record.id
  324. }
  325. bizAppointmentRecordApi
  326. .cancelAppointmentRecord(params)
  327. .then(() => {
  328. tableRef.value.refresh(true)
  329. })
  330. .finally(() => {
  331. submitLoading.value = false
  332. })
  333. },
  334. onCancel() {}
  335. })
  336. }
  337. // 批量删除
  338. const deleteBatchBizAppointmentRecord = (params) => {
  339. bizAppointmentRecordApi.bizAppointmentRecordDelete(params).then(() => {
  340. tableRef.value.clearRefreshSelected()
  341. })
  342. }
  343. //导出
  344. const exportTotal = () => {
  345. const searchFormParam = cloneDeep(searchFormState.value)
  346. bizAppointmentRecordApi.exportRecord(Object.assign(searchFormParam)).then((res)=>{
  347. downloadUtil.resultDownload(res)
  348. })
  349. }
  350. </script>
  351. <style lang="less" scoped>
  352. /** 表头居中 */
  353. :deep .ant-table-thead > tr > th {
  354. text-align: center;
  355. }
  356. .time-list {
  357. -webkit-text-size-adjust: none;
  358. font-size: 13px;
  359. display: flex;
  360. flex-direction: column;
  361. p {
  362. white-space: nowrap;
  363. span {
  364. display: inline-block;
  365. font-weight: 600;
  366. height: 16px;
  367. line-height: 16px;
  368. border-radius: 5px;
  369. text-align: center;
  370. margin-right: 2px;
  371. padding: 0 5px;
  372. }
  373. .blueTag {
  374. color: #1890ff;
  375. background: rgba(24, 144, 255, 0.1);
  376. }
  377. .orangeTag {
  378. color: #ff7c18;
  379. background: rgba(24, 144, 255, 0.1);
  380. }
  381. .greenTag {
  382. color: rgb(82, 196, 26);
  383. background: rgba(82, 196, 26, 0.1);
  384. }
  385. .purpleTag {
  386. color: rgb(77, 26, 196);
  387. background: rgba(82, 196, 26, 0.1);
  388. }
  389. .showNum {
  390. display: inline-block;
  391. height: 16px;
  392. line-height: 16px;
  393. width: 45px;
  394. border-radius: 5px;
  395. text-align: center;
  396. margin-right: 2px;
  397. text-align: right;
  398. }
  399. }
  400. }
  401. </style>