Browse Source

fix:调整订单字段

master
tanzs 1 month ago
parent
commit
f5c83a2011
2 changed files with 177 additions and 203 deletions
  1. +44
    -67
      src/views/miniapp/order/AppOrder.data.ts
  2. +133
    -136
      src/views/miniapp/order/AppOrderList.vue

+ 44
- 67
src/views/miniapp/order/AppOrder.data.ts View File

@ -21,16 +21,6 @@ export const columns: BasicColumn[] = [
align: 'center',
dataIndex: 'productServiceYear',
},
{
title: '产品销售金额',
align: 'center',
dataIndex: 'productMoney',
},
{
title: '产品合同模板',
align: 'center',
dataIndex: 'productContractTemp',
},
{
title: '经销商',
align: 'center',
@ -171,9 +161,7 @@ export const searchFormSchema: FormSchema[] = [
label: '销售端口',
field: 'salePort',
component: 'JSelectMultiple',
componentProps: {
dictCode: 'order_sale_port',
},
componentProps: {},
//colProps: {span: 6},
},
{
@ -188,6 +176,7 @@ export const searchFormSchema: FormSchema[] = [
component: 'JSelectMultiple',
componentProps: {
dictCode: 'customer_type',
stringToNumber: true,
},
//colProps: {span: 6},
},
@ -229,23 +218,6 @@ export const formSchema: FormSchema[] = [
return [{ required: true, message: '请输入产品服务年限!' }];
},
},
{
label: '产品销售金额',
field: 'productMoney',
component: 'InputNumber',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入产品销售金额!' }];
},
},
{
label: '产品合同模板',
field: 'productContractTemp',
component: 'JUpload',
componentProps: {},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入产品合同模板!' }];
},
},
{
label: '经销商',
field: 'storeName',
@ -289,9 +261,9 @@ export const formSchema: FormSchema[] = [
{
label: '销售端口',
field: 'salePort',
component: 'JDictSelectTag',
component: 'Input',
componentProps: {
dictCode: 'order_sale_port',
dictCode: '',
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入销售端口!' }];
@ -332,6 +304,9 @@ export const formSchema: FormSchema[] = [
componentProps: {
fileMax: 0,
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入身份证正面照!' }];
},
},
{
label: '身份证反面照',
@ -340,6 +315,9 @@ export const formSchema: FormSchema[] = [
componentProps: {
fileMax: 0,
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入身份证反面照!' }];
},
},
{
label: '车辆合格证',
@ -348,6 +326,9 @@ export const formSchema: FormSchema[] = [
componentProps: {
fileMax: 0,
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入车辆合格证!' }];
},
},
{
label: '营业执照',
@ -387,9 +368,6 @@ export const formSchema: FormSchema[] = [
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入收款时间!' }];
},
},
{
label: '支付凭证',
@ -447,7 +425,11 @@ export const appOrderCarFormSchema: FormSchema[] = [
{
label: '是否新车',
field: 'newCar',
component: 'InputNumber',
component: 'JDictSelectTag',
componentProps: {
dictCode: 'yn',
stringToNumber: true,
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入是否新车!' }];
},
@ -464,9 +446,6 @@ export const appOrderCarFormSchema: FormSchema[] = [
label: '车牌号',
field: 'carNo',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入车牌号!' }];
},
},
{
label: '发动机号',
@ -554,6 +533,9 @@ export const appOrderVoucherFormSchema: FormSchema[] = [
componentProps: {
valueFormat: 'YYYY-MM-DD',
},
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入失效时间!' }];
},
},
{
label: '服务年限',
@ -567,17 +549,11 @@ export const appOrderVoucherFormSchema: FormSchema[] = [
label: '权益套餐',
field: 'equityPackage',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入权益套餐!' }];
},
},
{
label: '套餐价',
field: 'packageMoney',
component: 'InputNumber',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入套餐价!' }];
},
},
{
label: '商业险编号',
@ -621,6 +597,9 @@ export const appOrderVoucherFormSchema: FormSchema[] = [
label: '经销商地址',
field: 'dealerAddress',
component: 'Input',
dynamicRules: ({ model, schema }) => {
return [{ required: true, message: '请输入经销商地址!' }];
},
},
{
label: '',
@ -659,27 +638,25 @@ export const superQuerySchema = {
orderNum: { title: '订单编号', order: 0, view: 'text', type: 'string' },
productName: { title: '产品服务名称', order: 1, view: 'text', type: 'string' },
productServiceYear: { title: '产品服务年限', order: 2, view: 'text', type: 'string' },
productMoney: { title: '产品销售金额', order: 3, view: 'number', type: 'number' },
productContractTemp: { title: '产品合同模板', order: 4, view: 'file', type: 'string' },
storeName: { title: '经销商', order: 5, view: 'text', type: 'string' },
custName: { title: '客户姓名', order: 6, view: 'text', type: 'string' },
custAddress: { title: '客户地址', order: 7, view: 'text', type: 'string' },
custCardNo: { title: '客户证件号', order: 8, view: 'text', type: 'string' },
custPhone: { title: '客户联系电话', order: 9, view: 'text', type: 'string' },
salePort: { title: '销售端口', order: 10, view: 'list', type: 'string', dictCode: 'order_sale_port' },
saleName: { title: '销售顾问', order: 11, view: 'text', type: 'string' },
payType: { title: '付款方式', order: 12, view: 'text', type: 'string' },
custType: { title: '客户类型', order: 13, view: 'number', type: 'number', dictCode: 'customer_type' },
certFront: { title: '身份证正面照', order: 14, view: 'image', type: 'string' },
certBack: { title: '身份证反面照', order: 15, view: 'image', type: 'string' },
carPic: { title: '车辆合格证', order: 16, view: 'image', type: 'string' },
busLicense: { title: '营业执照', order: 17, view: 'image', type: 'string' },
createTime: { title: '创建日期', order: 18, view: 'datetime', type: 'string' },
status: { title: '订单状态', order: 19, view: 'number', type: 'number', dictCode: 'order_status' },
contractUrl: { title: '订单合同', order: 20, view: 'file', type: 'string' },
payee: { title: '收款方', order: 21, view: 'text', type: 'string' },
payeeTime: { title: '收款时间', order: 22, view: 'datetime', type: 'string' },
payVoucherUrl: { title: '支付凭证', order: 23, view: 'image', type: 'string' },
storeName: { title: '经销商', order: 3, view: 'text', type: 'string' },
custName: { title: '客户姓名', order: 4, view: 'text', type: 'string' },
custAddress: { title: '客户地址', order: 5, view: 'text', type: 'string' },
custCardNo: { title: '客户证件号', order: 6, view: 'text', type: 'string' },
custPhone: { title: '客户联系电话', order: 7, view: 'text', type: 'string' },
salePort: { title: '销售端口', order: 8, view: 'list', type: 'string', dictCode: '' },
saleName: { title: '销售顾问', order: 9, view: 'text', type: 'string' },
payType: { title: '付款方式', order: 10, view: 'text', type: 'string' },
custType: { title: '客户类型', order: 11, view: 'number', type: 'number', dictCode: 'customer_type' },
certFront: { title: '身份证正面照', order: 12, view: 'image', type: 'string' },
certBack: { title: '身份证反面照', order: 13, view: 'image', type: 'string' },
carPic: { title: '车辆合格证', order: 14, view: 'image', type: 'string' },
busLicense: { title: '营业执照', order: 15, view: 'image', type: 'string' },
createTime: { title: '创建日期', order: 16, view: 'datetime', type: 'string' },
status: { title: '订单状态', order: 17, view: 'number', type: 'number', dictCode: 'order_status' },
contractUrl: { title: '订单合同', order: 18, view: 'file', type: 'string' },
payee: { title: '收款方', order: 19, view: 'text', type: 'string' },
payeeTime: { title: '收款时间', order: 20, view: 'datetime', type: 'string' },
payVoucherUrl: { title: '支付凭证', order: 21, view: 'image', type: 'string' },
//子表高级查询
appOrderCar: {
title: '订单车辆信息',
@ -689,7 +666,7 @@ export const superQuerySchema = {
vin: { title: '车架号', order: 1, view: 'text', type: 'string' },
carType: { title: '车辆类型', order: 2, view: 'text', type: 'string' },
useType: { title: '使用性质', order: 3, view: 'text', type: 'string' },
newCar: { title: '是否新车', order: 4, view: 'number', type: 'number' },
newCar: { title: '是否新车', order: 4, view: 'number', type: 'number', dictCode: '' },
carModel: { title: '车辆型号', order: 5, view: 'text', type: 'string' },
carNo: { title: '车牌号', order: 6, view: 'text', type: 'string' },
engineNo: { title: '发动机号', order: 7, view: 'text', type: 'string' },


+ 133
- 136
src/views/miniapp/order/AppOrderList.vue View File

@ -1,104 +1,101 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'order:app_order:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'order:app_order:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'order:app_order:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'order:app_order:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
<a-button type="primary" v-auth="'order:app_order:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'order:app_order:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'order:app_order:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls"
>导入</j-upload-button
>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined" />
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'order:app_order:deleteBatch'"
>批量操作
<Icon icon="mdi:chevron-down" />
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
<template v-if="column.dataIndex==='productContractTemp'">
<template #bodyCell="{ column, record, index, text }">
<template v-if="column.dataIndex === 'contractUrl'">
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
<template v-if="column.dataIndex==='contractUrl'">
<!--文件字段回显插槽-->
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)"
>下载</a-button
>
</template>
</template>
</BasicTable>
<!-- 表单区域 -->
<AppOrderModal @register="registerModal" @success="handleSuccess"></AppOrderModal>
<AppOrderModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="order-appOrder" setup>
import {ref, reactive, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'
import {useModal} from '/@/components/Modal';
import AppOrderModal from './components/AppOrderModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppOrder.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppOrder.api';
import {downloadFile} from '/@/utils/common/renderUtils';
import { ref, reactive, computed, unref } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { useModal } from '/@/components/Modal';
import AppOrderModal from './components/AppOrderModal.vue';
import { columns, searchFormSchema, superQuerySchema } from './AppOrder.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './AppOrder.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '合同订单表',
api: list,
columns,
canResize:false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
['createTime', ['createTime_begin', 'createTime_end'], 'YYYY-MM-DD HH:mm:ss'],
],
},
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name:"合同订单表",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerModal, { openModal }] = useModal();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '合同订单表',
api: list,
columns,
canResize: false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
fieldMapToNumber: [],
fieldMapToTime: [['createTime', ['createTime_begin', 'createTime_end'], 'YYYY-MM-DD HH:mm:ss']],
},
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: '合同订单表',
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
});
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
//
const superQueryConfig = reactive(superQuerySchema);
@ -113,91 +110,91 @@
reload();
}
/**
* 新增事件
*/
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value},handleSuccess);
}
/**
* 成功回调
*/
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'order:app_order:edit'
}
]
}
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'order:app_order:edit',
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft'
placement: 'topLeft',
},
auth: 'order:app_order:delete'
}
]
auth: 'order:app_order:delete',
},
];
}
</script>
<style lang="less" scoped>
:deep(.ant-picker),:deep(.ant-input-number){
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
</style>
</style>

Loading…
Cancel
Save