|
@@ -0,0 +1,509 @@
|
|
|
+<template>
|
|
|
+ <a-card :bordered="false" style="margin-bottom: 10px" class="mb-2">
|
|
|
+ <a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
|
|
|
+ <a-row :gutter="24">
|
|
|
+
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="车牌号" name="licenseNumber">
|
|
|
+ <a-input v-model:value="searchFormState.licenseNumber" placeholder="车牌号码查询" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="司机电话" name="driverMobile">
|
|
|
+ <a-input v-model:value="searchFormState.driverMobile" placeholder="司机电话查询" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="预约分类" name="appointmentClassify">
|
|
|
+ <a-select v-model:value="searchFormState.appointmentClassify" placeholder="预约分类查询"
|
|
|
+ :options="appointmentClassifyList"
|
|
|
+ > </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <template v-if="advanced">
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </template>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-button type="primary" @click="tableRef.refresh()">查询</a-button>
|
|
|
+ <a-button style="margin: 0 8px" @click="reset">重置</a-button>
|
|
|
+<!-- <a @click="toggleAdvanced" style="margin-left: 8px">
|
|
|
+ {{ advanced ? '收起' : '展开' }}
|
|
|
+ <component :is="advanced ? 'up-outlined' : 'down-outlined'" />
|
|
|
+ </a>-->
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </a-card>
|
|
|
+ <a-card :bordered="false">
|
|
|
+ <s-table
|
|
|
+ ref="tableRef"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ bordered
|
|
|
+ :row-key="(record) => record.id"
|
|
|
+ >
|
|
|
+ <template #operator class="table-operator">
|
|
|
+ <a-space>
|
|
|
+ <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizAppointmentTempAdd')">
|
|
|
+ <template #icon><plus-outlined /></template>
|
|
|
+ 新增
|
|
|
+ </a-button>
|
|
|
+ <a-button @click="exportTotal" v-if="hasPerm('bizAppointmentExport')">
|
|
|
+ <template #icon>
|
|
|
+ <export-outlined/>
|
|
|
+ </template>
|
|
|
+ 导出
|
|
|
+ </a-button>
|
|
|
+ </a-space>
|
|
|
+ </template>
|
|
|
+ <template #bodyCell="{ column, record }">
|
|
|
+ <template v-if="column.dataIndex === 'appointmentClassify'">
|
|
|
+ {{$TOOL.dictTypeData('appointment_classify', record.appointmentClassify)}}
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'status'">
|
|
|
+ <a-tag
|
|
|
+ :color="
|
|
|
+ record.status === '1'
|
|
|
+ ? 'volcano'
|
|
|
+ : record.status === '2'
|
|
|
+ ? 'red'
|
|
|
+ : record.status === '3'
|
|
|
+ ? 'processing'
|
|
|
+ : record.status === '4'
|
|
|
+ ? 'warning'
|
|
|
+ : record.status === '5'
|
|
|
+ ? 'magenta'
|
|
|
+ : record.status === '6'
|
|
|
+ ? 'orange'
|
|
|
+ : record.status === '7'
|
|
|
+ ? 'gold'
|
|
|
+ : record.status === '8'
|
|
|
+ ? 'lime'
|
|
|
+ : record.status === '9'
|
|
|
+ ? 'green'
|
|
|
+ : record.status === '10'
|
|
|
+ ? 'cyan'
|
|
|
+ : record.status === '11'
|
|
|
+ ? 'success'
|
|
|
+ : record.status === '12'
|
|
|
+ ? 'blue'
|
|
|
+ : record.status === '13'
|
|
|
+ ? 'geekblue'
|
|
|
+ : 'error'
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ $TOOL.dictTypeData('appointment_status', record.status) }}
|
|
|
+ </a-tag>
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'action'">
|
|
|
+ <a @click="showModal(record)" v-if="record.status!='1'&& record.status!='2' && record.status!='10' && record.status!='11'&&
|
|
|
+ record.status!='12' && record.status!='13' && record.status!='14' && record.status!='15'">二维码</a>
|
|
|
+
|
|
|
+ <a-divider type="vertical" v-if="record.status!='1'&& record.status!='2' && record.status!='10' && record.status!='11'&&
|
|
|
+ record.status!='12' && record.status!='13' && record.status!='14' && record.status!='15'"/>
|
|
|
+
|
|
|
+ <a-space>
|
|
|
+ <a-dropdown>
|
|
|
+ <a class="ant-dropdown-link">
|
|
|
+ 更多
|
|
|
+ <DownOutlined />
|
|
|
+ </a>
|
|
|
+
|
|
|
+ <template #overlay>
|
|
|
+ <a-menu>
|
|
|
+ <a-menu-item>
|
|
|
+ <a @click="detailRef.onOpen(record)">详情</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item v-if="hasPerm('bizAppointmentAuditTemp') && (record.status == '1')">
|
|
|
+ <a style="color: #ffaa00" @click="reviewRef.showModal(record.id)">审核</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item v-if="hasPerm('bizAppointmentTempEdit') && (record.status == '2')">
|
|
|
+ <a style="color:blue" @click="formRef.onOpen(record)" >编辑</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item v-if="hasPerm('bizAppointmentTempDelete') && (record.status == '2' || record.status=='4')">
|
|
|
+ <a style="color:red" type="link" danger size="small" @click="deleteConfig(record)">删除</a>
|
|
|
+ </a-menu-item>
|
|
|
+
|
|
|
+
|
|
|
+ </a-menu>
|
|
|
+ </template>
|
|
|
+ </a-dropdown>
|
|
|
+ </a-space>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-card>
|
|
|
+ <Form ref="formRef" @successful="tableRef.refresh()" />
|
|
|
+ <Review ref="reviewRef" @successful="tableRef.refresh(true)" />
|
|
|
+ <Detail ref="detailRef" @successful="tableRef.refresh()" />
|
|
|
+ <Sign ref="signRef" @successful="tableRef.refresh(true)" />
|
|
|
+
|
|
|
+ <XnSignName ref="XnSignNameRef" :image="searchFormState.driverSign" @successful="signSuccess" />
|
|
|
+ <a-modal v-model:visible="open" title="二维码" width="600px" style="height: 700px">
|
|
|
+ <div id="qrcode" style="text-align: center; margin: 15px 5px 15px 5px">
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="13" id="colFlag">
|
|
|
+ <div style="margin-top:10px;font-size:16px;">
|
|
|
+ <p id="projectNameFlag">车牌号:{{nowRecord.licenseNumber}}</p>
|
|
|
+ <p id="projectCodeFlag">司机姓名:{{ nowRecord.driverName }}</p>
|
|
|
+ <p id="projectCodeFlag">司机电话:{{ nowRecord.driverMobile }}</p>
|
|
|
+ <p id="projectCodeFlag">预约分类:{{ $TOOL.dictTypeData('appointment_classify', nowRecord.appointmentClassify) }}</p>
|
|
|
+ <p id="projectCodeFlag">预约状态:{{ $TOOL.dictTypeData('appointment_status', nowRecord.status) }}</p>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="11">
|
|
|
+ <a-image width="250" height="100%" :src="qrCodeUrl.codeUrl"></a-image>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <a-button @click="closeQrCode">关闭</a-button>
|
|
|
+ <a-button type="primary" @click="downloadFile">下载</a-button>
|
|
|
+ </template>
|
|
|
+ </a-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup name="bizappointmentrecord">
|
|
|
+ import { cloneDeep } from 'lodash-es'
|
|
|
+ import Form from './form.vue'
|
|
|
+ import Detail from './detail.vue'
|
|
|
+ import bizAppointmentRecordApi from '@/api/biz/bizAppointmentRecordApi'
|
|
|
+ import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
|
|
|
+ import {Modal} from 'ant-design-vue';
|
|
|
+ import {createVNode} from 'vue';
|
|
|
+ import tool from '@/utils/tool'
|
|
|
+ import QRCode from 'qrcode'
|
|
|
+ import html2canvas from 'html2canvas'
|
|
|
+ import downloadUtil from '@/utils/downloadUtil'
|
|
|
+ import bizRecordApi from '@/api/biz/bizRecordApi'
|
|
|
+ import bizOrderApi from "@/api/biz/bizOrderApi";
|
|
|
+ import Review from './review.vue'
|
|
|
+
|
|
|
+ const submitLoading = ref(false)
|
|
|
+ const tableRef = ref()
|
|
|
+ const signRef = ref()
|
|
|
+ const formRef = ref()
|
|
|
+ const reviewRef = ref()
|
|
|
+ const detailRef = ref()
|
|
|
+ const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
|
|
+
|
|
|
+ const nowRecord = ref()
|
|
|
+ const XnSignNameRef = ref()
|
|
|
+
|
|
|
+ const appointmentClassifyList = tool.dictList('appointment_classify')
|
|
|
+
|
|
|
+ //查询数据
|
|
|
+ const searchFormState = ref({})
|
|
|
+ const searchFormRef = ref()
|
|
|
+ const statusList = tool.dictList('appointment_status')
|
|
|
+
|
|
|
+ // 查询区域显示更多控制
|
|
|
+ const advanced = ref(false)
|
|
|
+ const toggleAdvanced = () => {
|
|
|
+ advanced.value = !advanced.value
|
|
|
+ }
|
|
|
+
|
|
|
+ const columns = [
|
|
|
+ /*{
|
|
|
+ title: '订单信息',
|
|
|
+ dataIndex: 'orderInfo',
|
|
|
+ width:200
|
|
|
+ },*/
|
|
|
+ /*{
|
|
|
+ title: '订单编号',
|
|
|
+ dataIndex: 'orderNumber',
|
|
|
+ align:'center',
|
|
|
+ width:150
|
|
|
+ },*/
|
|
|
+ {
|
|
|
+ title: '车牌号',
|
|
|
+ dataIndex: 'licenseNumber',
|
|
|
+ width:150,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ /*{
|
|
|
+ title: '提货时间',
|
|
|
+ dataIndex: 'timeInfo',
|
|
|
+ align:'center',
|
|
|
+ width:200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '客户名称',
|
|
|
+ dataIndex: 'customerInfo',
|
|
|
+ align:'center',
|
|
|
+ width:180
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '货品信息',
|
|
|
+ dataIndex: 'goodsInfo',
|
|
|
+ width:160
|
|
|
+ },*/
|
|
|
+ {
|
|
|
+ title: '司机姓名',
|
|
|
+ dataIndex: 'driverName',
|
|
|
+ width: 160,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '司机电话',
|
|
|
+ dataIndex: 'driverMobile',
|
|
|
+ width: 160,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '预约分类',
|
|
|
+ dataIndex: 'appointmentClassify',
|
|
|
+ width: 110,
|
|
|
+ align:'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '状态',
|
|
|
+ dataIndex: 'status',
|
|
|
+ align: 'center',
|
|
|
+ width:130
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ // 操作栏通过权限判断是否显示
|
|
|
+ columns.push({
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'action',
|
|
|
+ align: 'center',
|
|
|
+ width: 150,
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ const selectedRowKeys = ref([])
|
|
|
+ // 列表选择配置
|
|
|
+ const options = {
|
|
|
+ // columns数字类型字段加入 needTotal: true 可以勾选自动算账
|
|
|
+ alert: {
|
|
|
+ show: true,
|
|
|
+ clear: () => {
|
|
|
+ selectedRowKeys.value = ref([])
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rowSelection: {
|
|
|
+ onChange: (selectedRowKey, selectedRows) => {
|
|
|
+ selectedRowKeys.value = selectedRowKey
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const loadData = (parameter) => {
|
|
|
+ const searchFormParam = cloneDeep(searchFormState.value)
|
|
|
+ searchFormParam.type = '2'
|
|
|
+ return bizAppointmentRecordApi.bizAppointmentRecordPage(Object.assign(parameter, searchFormParam)).then((data) => {
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 重置
|
|
|
+ const reset = () => {
|
|
|
+ searchFormRef.value.resetFields()
|
|
|
+ tableRef.value.refresh(true)
|
|
|
+ }
|
|
|
+ // 删除
|
|
|
+ const deleteBizAppointmentRecord = (record) => {
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ id: record.id
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ bizAppointmentRecordApi.bizAppointmentRecordDelete(params).then(() => {
|
|
|
+ tableRef.value.refresh(true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 删除
|
|
|
+ const deleteConfig = (record) => {
|
|
|
+
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确定删除该数据吗?',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ content: '',
|
|
|
+ onOk() {
|
|
|
+ submitLoading.value = true
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ id: record.id
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ bizAppointmentRecordApi
|
|
|
+ .bizAppointmentRecordDelete(params)
|
|
|
+ .then(() => {
|
|
|
+ tableRef.value.refresh(true)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ submitLoading.value = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCancel() {}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 批量删除
|
|
|
+ const deleteBatchBizAppointmentRecord = (params) => {
|
|
|
+ bizAppointmentRecordApi.bizAppointmentRecordDelete(params).then(() => {
|
|
|
+ tableRef.value.clearRefreshSelected()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ //二维码
|
|
|
+ const open = ref(false);
|
|
|
+ const qrCodeUrl = ref({})
|
|
|
+ const showModal = (record) => {
|
|
|
+ nowRecord.value = record
|
|
|
+ open.value = true;
|
|
|
+ getQrCode(record)
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ const getQrCode = (record) => {
|
|
|
+ //QRCode.toDataURL("id:"+record.id+"saleCode:"+record.saleCode, {
|
|
|
+ let param = {
|
|
|
+ id:record.id,
|
|
|
+ licenseNumber:record.licenseNumber
|
|
|
+ }
|
|
|
+ QRCode.toDataURL(JSON.stringify(param), {
|
|
|
+ errorCorrectionLevel: 'H',
|
|
|
+ margin: 1,
|
|
|
+ height: 206,
|
|
|
+ width: 206,
|
|
|
+ type: '10',
|
|
|
+ scal: 177,
|
|
|
+ color: {
|
|
|
+ dark: '#000' // 二维码背景颜色
|
|
|
+ },
|
|
|
+ rendererOpts: {
|
|
|
+ quality: 0.9
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((url) => {
|
|
|
+ qrCodeUrl.value.codeUrl = url
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const closeQrCode = () => {
|
|
|
+ open.value = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 下载二维码
|
|
|
+ const downloadFile = () => {
|
|
|
+ const qrcodeDiv = document.getElementById('qrcode');
|
|
|
+ html2canvas(qrcodeDiv, {
|
|
|
+ logging: false,
|
|
|
+ allowTaint: true,
|
|
|
+ scale: window.devicePixelRatio,
|
|
|
+ scrollY: 0,
|
|
|
+ scrollX: 0,
|
|
|
+ useCORS: true,
|
|
|
+ backgroundColor: '#ffffff'
|
|
|
+ })
|
|
|
+ .then(function (canvas) {
|
|
|
+ const a = window.document.createElement('a')
|
|
|
+ a.href = canvas.toDataURL('image/png')
|
|
|
+ a.download = '二维码'
|
|
|
+ a.click()
|
|
|
+ this.$message.success('正在进行下载保存')
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //导出
|
|
|
+ const exportTotal = () => {
|
|
|
+ /*const searchFormParam = cloneDeep(searchFormState.value)
|
|
|
+ bizAppointmentRecordApi.exportRecord(Object.assign(searchFormParam)).then((res)=>{
|
|
|
+ downloadUtil.resultDownload(res)
|
|
|
+ })*/
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确定要导出记录吗?',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ content: '',
|
|
|
+ onOk() {
|
|
|
+ submitLoading.value = true
|
|
|
+ const searchFormParam = cloneDeep(searchFormState.value)
|
|
|
+
|
|
|
+ bizAppointmentRecordApi
|
|
|
+ .exportRecord(Object.assign(searchFormParam))
|
|
|
+ .then((res) => {
|
|
|
+ downloadUtil.resultDownload(res)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ submitLoading.value = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCancel() {}
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // 签名板组件回调
|
|
|
+ const signSuccess = (value) => {
|
|
|
+ const param = {
|
|
|
+ id:value.id,
|
|
|
+ driverSign: value.value
|
|
|
+ }
|
|
|
+ bizRecordApi.updateDriverSign(param).then(() => {
|
|
|
+ tableRef.value.refresh(true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+/** 表头居中 */
|
|
|
+:deep .ant-table-thead > tr > th {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+
|
|
|
+.time-list {
|
|
|
+ -webkit-text-size-adjust: none;
|
|
|
+ font-size: 13px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ p {
|
|
|
+ white-space: nowrap;
|
|
|
+ span {
|
|
|
+ display: inline-block;
|
|
|
+ font-weight: 600;
|
|
|
+ height: 16px;
|
|
|
+ line-height: 16px;
|
|
|
+ border-radius: 5px;
|
|
|
+ text-align: center;
|
|
|
+ margin-right: 2px;
|
|
|
+ padding: 0 5px;
|
|
|
+ }
|
|
|
+ .blueTag {
|
|
|
+ color: #1890ff;
|
|
|
+ background: rgba(24, 144, 255, 0.1);
|
|
|
+ }
|
|
|
+ .orangeTag {
|
|
|
+ color: #ff7c18;
|
|
|
+ background: rgba(24, 144, 255, 0.1);
|
|
|
+ }
|
|
|
+ .greenTag {
|
|
|
+ color: rgb(82, 196, 26);
|
|
|
+ background: rgba(82, 196, 26, 0.1);
|
|
|
+ }
|
|
|
+ .purpleTag {
|
|
|
+ color: rgb(77, 26, 196);
|
|
|
+ background: rgba(82, 196, 26, 0.1);
|
|
|
+ }
|
|
|
+ .showNum {
|
|
|
+ display: inline-block;
|
|
|
+ height: 16px;
|
|
|
+ line-height: 16px;
|
|
|
+ width: 45px;
|
|
|
+ border-radius: 5px;
|
|
|
+ text-align: center;
|
|
|
+ margin-right: 2px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|