From 8f6567e57e9d047f48eb93a22352cd9d714e8daf Mon Sep 17 00:00:00 2001 From: "geng.tang@qq.com" Date: Fri, 26 Jan 2024 15:33:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=80=E6=AC=BE=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E3=80=81=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E7=AD=89?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/apps/equipment/model/index.ts | 1 + src/api/index.ts | 1 + src/api/merchant/index.ts | 2 +- src/api/order/index.ts | 11 ++ src/api/order/model/index.ts | 7 + src/api/profit/model/index.ts | 1 + src/components/MerchantSelect/index.vue | 2 +- src/config/setting.ts | 4 +- src/views/love/merchant/index.vue | 1 + src/views/order/all/components/search.vue | 33 ++-- .../components/dict/user-advanced-search.vue | 36 +++++ .../appstore/components/dict/user-select.vue | 145 ++++++++++-------- .../system/appstore/components/types/index.ts | 7 + .../yunxinwei/index/components/search.vue | 21 ++- .../order/components/battery-change.vue | 132 ++++++++++++++++ .../yunxinwei/order/components/delivery.vue | 2 +- .../order/components/equipment-records.vue | 90 +++++++++++ .../yunxinwei/order/components/order-info.vue | 113 +++++++++++--- .../yunxinwei/order/components/search.vue | 110 ++++++++----- src/views/yunxinwei/order/index.vue | 83 +++++++--- src/views/yunxinwei/profit/index.vue | 38 ++++- src/views/yunxinwei/profit/search.vue | 6 +- .../yunxinwei/refund/components/edit.vue | 4 + src/views/yunxinwei/refund/index.vue | 5 + 24 files changed, 677 insertions(+), 178 deletions(-) create mode 100644 src/views/system/appstore/components/dict/user-advanced-search.vue create mode 100644 src/views/system/appstore/components/types/index.ts create mode 100644 src/views/yunxinwei/order/components/battery-change.vue create mode 100644 src/views/yunxinwei/order/components/equipment-records.vue diff --git a/src/api/apps/equipment/model/index.ts b/src/api/apps/equipment/model/index.ts index a1aaa41..28ce39f 100644 --- a/src/api/apps/equipment/model/index.ts +++ b/src/api/apps/equipment/model/index.ts @@ -70,4 +70,5 @@ export interface EquipmentParam extends PageParam { stockTotal?: number; merchantCode?: string; userId?: number; + isBind?: number; } diff --git a/src/api/index.ts b/src/api/index.ts index 6dc8b69..526a8c7 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -18,6 +18,7 @@ export interface PageResult { list: T[]; // 总数量 count: number; + otherData?: object; } /** diff --git a/src/api/merchant/index.ts b/src/api/merchant/index.ts index d04a036..e5519f0 100644 --- a/src/api/merchant/index.ts +++ b/src/api/merchant/index.ts @@ -7,7 +7,7 @@ import type { Merchant, MerchantParam } from './model'; */ export async function pageMerchant(params: MerchantParam) { const res = await request.get>>( - '/shop/merchant/page', + '/open/merchant/page', { params } diff --git a/src/api/order/index.ts b/src/api/order/index.ts index 4aa0ebd..ef043c4 100644 --- a/src/api/order/index.ts +++ b/src/api/order/index.ts @@ -119,3 +119,14 @@ export async function checkExistence( } return Promise.reject(new Error(res.data.message)); } + +/** + * 更改电池 + */ +export async function batteryChange(data){ + const res = await request.post>('/open/equipment/change', data); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/order/model/index.ts b/src/api/order/model/index.ts index 59f51a4..ae17ad0 100644 --- a/src/api/order/model/index.ts +++ b/src/api/order/model/index.ts @@ -65,6 +65,11 @@ export interface Order { // 用户ID userId?: any; nickname?: string; + equipmentCode: string; + receiptPhone: string; + emergentUser: string; + officeAddress: string; + homeAddress: string; } /** @@ -93,4 +98,6 @@ export interface OrderParam extends PageParam { isRenew?: number; // 商户编号 merchantCode?: string; + expireDay?: number; + isExpire?: number; } diff --git a/src/api/profit/model/index.ts b/src/api/profit/model/index.ts index 22c5005..f5a22c5 100644 --- a/src/api/profit/model/index.ts +++ b/src/api/profit/model/index.ts @@ -32,6 +32,7 @@ export interface ProfitParam extends PageParam { orderNo?: string; orderUserName?: string; merchantName?: string; + merchantCode?: string; beginDate?: string; endDate?: string; scene?: number; diff --git a/src/components/MerchantSelect/index.vue b/src/components/MerchantSelect/index.vue index 629ffcb..06fd550 100644 --- a/src/components/MerchantSelect/index.vue +++ b/src/components/MerchantSelect/index.vue @@ -35,7 +35,7 @@ // 字典数据 const data = ref([]); - pageMerchant({}).then((res) => { + pageMerchant({limit:100}).then((res) => { res?.list.map((d) => { data.value?.push({ comments: d.merchantName, diff --git a/src/config/setting.ts b/src/config/setting.ts index 9bf8554..641083c 100644 --- a/src/config/setting.ts +++ b/src/config/setting.ts @@ -50,8 +50,8 @@ export const MAP_CODE = '7225174a116c1c44e1bd7a177d1787d5'; export const LICENSE_CODE = 'dk9mcwJyetRWQlxWRiojIzJCLi8mcQ5Wa4ojI0NWZqJWd6ICZpJCL0kjNwl1NnhENahnIvl2cyVmdiwiIiATMuEjI6IibQf0NW=='; // 文件服务器地址 -// export const FILE_SERVER = 'https://file.wsdns.cn'; -export const FILE_SERVER = 'https://yxw.wsdns.cn'; +export const FILE_SERVER = 'https://file.wsdns.cn'; +// export const FILE_SERVER = 'https://yxw.wsdns.cn'; // 缩略图前缀 export const FILE_THUMBNAIL = FILE_SERVER + '/thumbnail'; // 文件下载前缀 diff --git a/src/views/love/merchant/index.vue b/src/views/love/merchant/index.vue index 7ecd1c3..83942d0 100644 --- a/src/views/love/merchant/index.vue +++ b/src/views/love/merchant/index.vue @@ -258,6 +258,7 @@ } // 只查门店类型 where.sceneType = 'SHOP_USER'; + where.limit = 100; return pageMerchant({ ...where, ...orders, page, limit }); }; diff --git a/src/views/order/all/components/search.vue b/src/views/order/all/components/search.vue index ddb4d30..8f06940 100644 --- a/src/views/order/all/components/search.vue +++ b/src/views/order/all/components/search.vue @@ -3,11 +3,13 @@ 全部订单 - 待发货 + 待收货 待付款 - 已完成 - 已取消 + + 进行中 + + 已退租 +
+ + + +
+ + + diff --git a/src/views/system/appstore/components/dict/user-select.vue b/src/views/system/appstore/components/dict/user-select.vue index a55353f..e2df4b8 100644 --- a/src/views/system/appstore/components/dict/user-select.vue +++ b/src/views/system/appstore/components/dict/user-select.vue @@ -1,76 +1,91 @@ - diff --git a/src/views/system/appstore/components/types/index.ts b/src/views/system/appstore/components/types/index.ts new file mode 100644 index 0000000..cbdff04 --- /dev/null +++ b/src/views/system/appstore/components/types/index.ts @@ -0,0 +1,7 @@ +/** + * 搜索表单类型 + */ +export interface WhereType { + keywords?: string; + nickname?: string; +} diff --git a/src/views/yunxinwei/index/components/search.vue b/src/views/yunxinwei/index/components/search.vue index c2452d5..d113464 100644 --- a/src/views/yunxinwei/index/components/search.vue +++ b/src/views/yunxinwei/index/components/search.vue @@ -26,6 +26,11 @@ + + 全部 + 未绑定 + 已绑定 + + + + diff --git a/src/views/yunxinwei/order/components/delivery.vue b/src/views/yunxinwei/order/components/delivery.vue index 57fe820..e0b7684 100644 --- a/src/views/yunxinwei/order/components/delivery.vue +++ b/src/views/yunxinwei/order/components/delivery.vue @@ -94,7 +94,7 @@ import { Order } from "@/api/order/model"; // 是否显示最大化切换按钮 const maxable = ref(true); - // 用户信息 + // 表单数据 const form = reactive({ equipmentCode: '', orderId: undefined diff --git a/src/views/yunxinwei/order/components/equipment-records.vue b/src/views/yunxinwei/order/components/equipment-records.vue new file mode 100644 index 0000000..bd46c95 --- /dev/null +++ b/src/views/yunxinwei/order/components/equipment-records.vue @@ -0,0 +1,90 @@ + + + diff --git a/src/views/yunxinwei/order/components/order-info.vue b/src/views/yunxinwei/order/components/order-info.vue index db933e5..36c191f 100644 --- a/src/views/yunxinwei/order/components/order-info.vue +++ b/src/views/yunxinwei/order/components/order-info.vue @@ -254,15 +254,17 @@ - - + @@ -283,7 +285,7 @@ > + + + + 批量删除 +
@@ -77,6 +86,7 @@ const type = ref('keywords'); // 搜索内容 const searchText = ref(''); + const expire = ref('0'); // 日期范围选择 const dateRange = ref<[string, string]>(['', '']); const listType = ref(0); @@ -84,20 +94,35 @@ /* 搜索 */ const search = () => { const [d1, d2] = dateRange.value ?? []; - if (type.value == 'orderNo') { - where.orderNo = searchText.value; - where.userId = undefined; - } - if (type.value == 'userId') { - where.userId = searchText.value; - where.orderNo = undefined; - } - if (type.value == 'merchantCode') { - where.merchantCode = searchText.value; - where.orderNo = undefined; - } - if (type.value == 'keywords') { - where.keywords = searchText.value; + + if(expire.value == '1'){ + where.expireDay = 7 + where.isExpire = -1 + } else if(expire.value == '2'){ + where.expireDay = 3 + where.isExpire = -1 + } else if(expire.value == '3'){ + where.isExpire = 1 + where.expireDay = 0 + } else { + where.isExpire = -1 + where.expireDay = 0 + + if (type.value == 'orderNo') { + where.orderNo = searchText.value; + where.userId = undefined; + } + if (type.value == 'userId') { + where.userId = searchText.value; + where.orderNo = undefined; + } + if (type.value == 'merchantCode') { + where.merchantCode = searchText.value; + where.orderNo = undefined; + } + if (type.value == 'keywords') { + where.keywords = searchText.value; + } } emit('search', { ...where, @@ -116,36 +141,39 @@ const listType = Number(e.target.value); // 全部订单 if (listType == 0) { - console.log('全部订单'); + // console.log('全部订单'); + } else { + where.isExpire = -1 + where.expireDay = 0 } // 待发货 - if (listType == 1) { - console.log('待发货'); - where.payStatus = 20; - where.deliveryStatus = 10; - } + // if (listType == 1) { + // console.log('待发货'); + // where.payStatus = 20; + // where.deliveryStatus = 10; + // } // 待收货 if (listType == 2) { - console.log('待发货'); + // console.log('待发货'); where.payStatus = 20; - where.deliveryStatus = 20; + where.deliveryStatus <= 20; where.receiptStatus = 10; } // 待付款 if (listType == 3) { - console.log('待付款'); + // console.log('待付款'); where.payStatus = 10; } // 已完成 if (listType == 4) { - console.log('已完成'); + // console.log('已完成'); where.payStatus = 20; where.orderStatus = 30; } // 已取消 if (listType == 5) { - console.log('已取消'); - where.orderStatus = 20; + // console.log('已取消'); + where.receiptStatus = 30; } emit('search', { ...where diff --git a/src/views/yunxinwei/order/index.vue b/src/views/yunxinwei/order/index.vue index 242b73c..74c3c52 100644 --- a/src/views/yunxinwei/order/index.vue +++ b/src/views/yunxinwei/order/index.vue @@ -23,6 +23,11 @@ /> + { + current.value = row ?? null; + showChange.value = true; + }; + /* 打开高级搜索 */ const openAdvanced = () => { showAdvancedSearch.value = !showAdvancedSearch.value; diff --git a/src/views/yunxinwei/profit/index.vue b/src/views/yunxinwei/profit/index.vue index 0a63100..9a7fa85 100644 --- a/src/views/yunxinwei/profit/index.vue +++ b/src/views/yunxinwei/profit/index.vue @@ -8,11 +8,13 @@ row-key="profitId" :columns="columns" :datasource="datasource" + :parse-data="otherData" v-model:selection="selection" tool-class="ele-toolbar-form" :scroll="{ x: 1200 }" class="sys-org-table" :striped="true" + @done="onTableDone" > + @@ -79,7 +91,8 @@ import type { EleProTable } from 'ele-admin-pro'; import type { DatasourceFunction, - ColumnItem + ColumnItem, + EleProTableDone } from 'ele-admin-pro/es/ele-pro-table/types'; import { toDateString } from 'ele-admin-pro'; import Search from './search.vue'; @@ -172,6 +185,12 @@ // 是否显示高级搜索 const showAdvancedSearch = ref(false); + // 合计 + const amountSummary = ref(0); + + // 案卷数据 + // const data = ref([]); + // 表格数据源 const datasource: DatasourceFunction = ({ page, @@ -193,6 +212,23 @@ }); }; + /* 表格数据加载完成事件 */ + const onTableDone: EleProTableDone = (res) => { + console.log(res); + // data.value = res.data; + /* amountSummary.value = res.data + .map((item) => Number(item.amount)) + .reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); */ + amountSummary.value = res.response.otherData.total; + }; + /* 搜索 */ const reload = (where?: ProfitParam) => { selection.value = []; diff --git a/src/views/yunxinwei/profit/search.vue b/src/views/yunxinwei/profit/search.vue index 4042ab2..9b2fde9 100644 --- a/src/views/yunxinwei/profit/search.vue +++ b/src/views/yunxinwei/profit/search.vue @@ -25,7 +25,7 @@ 模糊搜索 订单号 - 门店名称 + 门店编号 用户名 @@ -74,8 +74,8 @@ if (type.value == 'orderUserName') { where.orderUserName = searchText.value; } - if (type.value == 'merchantName') { - where.merchantName = searchText.value; + if (type.value == 'merchantCode') { + where.merchantCode = searchText.value; } if (type.value == 'keywords') { where.keywords = searchText.value; diff --git a/src/views/yunxinwei/refund/components/edit.vue b/src/views/yunxinwei/refund/components/edit.vue index 839ba29..d7f18b7 100644 --- a/src/views/yunxinwei/refund/components/edit.vue +++ b/src/views/yunxinwei/refund/components/edit.vue @@ -20,6 +20,10 @@ 驳回 + + + +