From 13b0215e15c8828dbb5ab72b509a0ca5fbd92b18 Mon Sep 17 00:00:00 2001 From: zhengw <247276359@qq.com> Date: Sun, 8 Feb 2026 11:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A2=E5=8D=95=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5,=20=E5=8F=8A=E7=BB=84=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniprogram/app.json | 1 + .../account-plugin/account-plugin.ts | 8 +- .../account-plugin/account-plugin.wxml | 13 +- .../components/sort-plugin/sort-plugin.wxml | 2 +- miniprogram/pages/my/my.ts | 7 +- .../ordersList/orderDetail/orderDetail.json | 16 +++ .../ordersList/orderDetail/orderDetail.ts | 112 ++++++++++++++++++ .../ordersList/orderDetail/orderDetail.wxml | 85 +++++++++++++ .../ordersList/orderDetail/orderDetail.wxss | 15 +++ .../ordersList/orderPayment/orderPayment.json | 3 +- .../ordersList/orderPayment/orderPayment.ts | 4 +- .../ordersList/orderPayment/orderPayment.wxml | 23 ++-- .../pages/orders/ordersList/ordersList.ts | 8 ++ .../pages/orders/ordersList/ordersList.wxml | 2 + 14 files changed, 269 insertions(+), 30 deletions(-) create mode 100644 miniprogram/pages/orders/ordersList/orderDetail/orderDetail.json create mode 100644 miniprogram/pages/orders/ordersList/orderDetail/orderDetail.ts create mode 100644 miniprogram/pages/orders/ordersList/orderDetail/orderDetail.wxml create mode 100644 miniprogram/pages/orders/ordersList/orderDetail/orderDetail.wxss diff --git a/miniprogram/app.json b/miniprogram/app.json index 648399c..8b0203d 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -10,6 +10,7 @@ "pages/orders/ordersList/ordersList", "pages/orders/orderSort/orderSort", "pages/orders/ordersList/orderPayment/orderPayment", + "pages/orders/ordersList/orderDetail/orderDetail", "pages/purchase/buyOrder/buyOrder", "pages/purchase/buyInOrder/buyInOrder", "pages/finance/outcome/outcome", diff --git a/miniprogram/pages/components/account-plugin/account-plugin.ts b/miniprogram/pages/components/account-plugin/account-plugin.ts index 6dc6116..303b37a 100644 --- a/miniprogram/pages/components/account-plugin/account-plugin.ts +++ b/miniprogram/pages/components/account-plugin/account-plugin.ts @@ -7,13 +7,11 @@ Component({ * 组件的属性列表 */ properties: { - value: { - type: null, - }, + value: null, }, observers: { value: function () { - this.setData({ label: this.data.listToObj[this.data.value]?.label }); + this.setData({ label: this.data.listToObj[this.data.value]?.label || '' }); }, }, @@ -49,7 +47,7 @@ Component({ if (!accountDefaultObj) { accountDefaultObj = list[0] || {}; } - this.setData({ list: list, label: this.data.listToObj[this.data.value]?.label }); + this.setData({ list: list, label: this.data.listToObj[this.data.value]?.label || '' }); this.triggerEvent('default', accountDefaultObj); }); }, diff --git a/miniprogram/pages/components/account-plugin/account-plugin.wxml b/miniprogram/pages/components/account-plugin/account-plugin.wxml index 7fe9bc3..26758d5 100644 --- a/miniprogram/pages/components/account-plugin/account-plugin.wxml +++ b/miniprogram/pages/components/account-plugin/account-plugin.wxml @@ -1,13 +1,10 @@ - - 选择账户 + + 选择账户 + {{label||'选择账户'}} - - - - {{option.tag}} - - + \ No newline at end of file diff --git a/miniprogram/pages/components/sort-plugin/sort-plugin.wxml b/miniprogram/pages/components/sort-plugin/sort-plugin.wxml index f06da58..45ebdbc 100644 --- a/miniprogram/pages/components/sort-plugin/sort-plugin.wxml +++ b/miniprogram/pages/components/sort-plugin/sort-plugin.wxml @@ -10,7 +10,7 @@ variant="{{value != (item.value || '') + ' asc' ? 'outline': 'base'}}" style="margin-right: 24rpx;" bind:tap="select" data-index="{{index}}" data-order="asc">升序 - 降序 diff --git a/miniprogram/pages/my/my.ts b/miniprogram/pages/my/my.ts index 84ed9f7..9cb13fb 100644 --- a/miniprogram/pages/my/my.ts +++ b/miniprogram/pages/my/my.ts @@ -22,9 +22,6 @@ Page({ company_info: companyInfo, }); }, - searchChange(e: any) { - console.log(e); - }, // 腾讯文档 txDoc() { return; @@ -53,10 +50,10 @@ Page({ // content: '', complete: (res: any) => { if (res.confirm) { - post('Applet/loginOut').then((res: any) => { + post('Applet/loginOut').then(() => { this.setData({ isLogin: false }); checkSesskey({ showLoading: false, showError: false }) - .then((res) => {}) + .then(() => {}) .catch((err) => { console.log('checkSesskey', err); }); diff --git a/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.json b/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.json new file mode 100644 index 0000000..ee16963 --- /dev/null +++ b/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.json @@ -0,0 +1,16 @@ +{ + "usingComponents": { + "search-popup": "/pages/components/search-popup/search-popup", + "card-plugin": "/pages/components/card-plugin/card-plugin", + "card-item-plugin": "/pages/components/card-item-plugin/card-item-plugin", + "option-cell-plugin": "/pages/components/option-cell-plugin/option-cell-plugin", + "date-picker-plugin": "/pages/components/date-picker-plugin/date-picker-plugin", + "sort-plugin": "/pages/components/sort-plugin/sort-plugin", + "count-plugin": "/pages/components/count-plugin/count-plugin", + "total-bar-plugin": "/pages/components/total-bar-plugin/total-bar-plugin", + "pagination-plugin": "/pages/components/pagination-plugin/pagination-plugin", + "t-cell": "tdesign-miniprogram/cell/cell", + "search-input": "/pages/components/search-input/search-input" + }, + "navigationBarTitleText": "销售订单" +} \ No newline at end of file diff --git a/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.ts b/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.ts new file mode 100644 index 0000000..d367473 --- /dev/null +++ b/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.ts @@ -0,0 +1,112 @@ +import { OSSBaseUrl } from '@/utils/config'; +import { loginStatusPage, post } from '@/utils/https'; +import { + cloneLite, + formatFileSize, + getAuthInfo, + getDataSet, + getFileType, + mediaPreview, + toArray, + toObject, +} from '@/utils/util'; + +const defaultParams = { curr_page: 1, page_count: 20, process_state: [200] }; + +Page({ + /** + * 页面的初始数据 + */ + data: { + params: cloneLite(defaultParams) as any, + list: [] as any[], + count: 0, + info: {} as any, + files: [] as any, + detail: [] as any, + }, + handleLogin(e: any) { + this.setData({ isLogin: e.detail }); + if (e.detail) { + this.init(); + } + }, + init() { + this.setData({ authInfo: getAuthInfo() }); + this.getList(); + }, + + getList() { + this.setData({ params: this.data.params }); + const temp = cloneLite(this.data.params); + post('Orders/saleDetail', temp).then((res: any) => { + this.setData({ + info: toObject(res.info), + files: toArray(res.files).map((el) => { + el._file_type = getFileType(el.file_name); + el.file_path = `${OSSBaseUrl}${el.file_path}`; + el._file_size = formatFileSize(el.file_size); + return el; + }), + detail: toArray(res.detail), + }); + }); + }, + onPreview(e: any) { + const data = getDataSet(e); + const index = data.index; + const item = this.data.files[index]; + if (item._file_type != 'file') { + mediaPreview([item.file_path], item.file_path); + } + }, + onPreview2() { + const path = `${OSSBaseUrl}${this.data.info.excel_path}`; + // console.log(path); + mediaPreview([path], path); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + const { order_no } = options; + this.data.params.order_no = order_no; + wx.setNavigationBarTitle({ title: `${order_no} 详情` }); + loginStatusPage(this); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() {}, +}); diff --git a/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.wxml b/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.wxml new file mode 100644 index 0000000..bc8b5aa --- /dev/null +++ b/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.wxml @@ -0,0 +1,85 @@ + + + + + 经销商: + {{info.custom_name}} + + + 单据日期: + {{info.document_date}} + + + 自定义单号: + {{info.custom_order_no}} + + + 销售人员: + {{info.sales_name}} + + + 客户名称: + {{info.end_user_name}} + + + 客户手机: + {{info.end_user_phone}} + + + 客户地址: + {{info.end_user_address}} + + + 备注: + {{info.comments}} + + + 优惠率: + {{info.discount_rate}}% + + + 收款优惠: + {{info.discount_money}} + + + 优惠后金额: + {{info.discount_last_money}} + + + + + + + + + + + + + + + + + {{ item.goods_name }} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.wxss b/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.wxss new file mode 100644 index 0000000..ecbf383 --- /dev/null +++ b/miniprogram/pages/orders/ordersList/orderDetail/orderDetail.wxss @@ -0,0 +1,15 @@ +.item { + display: inline-flex; + align-items: center; +} + +.item-label { + width: 6em; + display: inline-flex; + justify-content: flex-end; + flex-shrink: 0; +} + +.item-value { + word-break: break-all; +} diff --git a/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.json b/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.json index 7796d3f..3b73d5a 100644 --- a/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.json +++ b/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.json @@ -4,6 +4,7 @@ "account-plugin": "/pages/components/account-plugin/account-plugin", "t-input": "tdesign-miniprogram/input/input", "t-date-time-picker": "tdesign-miniprogram/date-time-picker/date-time-picker", - "t-cell": "tdesign-miniprogram/cell/cell" + "t-cell": "tdesign-miniprogram/cell/cell", + "t-textarea": "tdesign-miniprogram/textarea/textarea" } } \ No newline at end of file diff --git a/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.ts b/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.ts index 35dc2e3..6aa090c 100644 --- a/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.ts +++ b/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.ts @@ -43,7 +43,7 @@ Page({ eventChannel?.on('saleOrderPay', (res: any) => { const data = toObject(res.data); const { un_payed_amount, order_no } = data; - console.log(data); + // console.log(data); wx.setNavigationBarTitle({ title: `${order_no} 收付款` }); this.data.params.order_no = order_no; this.data.params.bill_date = dayjs().format('YYYY-MM-DD HH:mm:ss'); @@ -87,7 +87,7 @@ Page({ amount: params.amount, operator: params.operator, last_account_id: params.last_account_id, - comments: params.comments, + comments: params.comments || '', }; post('Orders/orderPay', data).then(() => { toastSuccess('保存成功'); diff --git a/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.wxml b/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.wxml index 544f1e1..3296535 100644 --- a/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.wxml +++ b/miniprogram/pages/orders/ordersList/orderPayment/orderPayment.wxml @@ -1,18 +1,25 @@ - - - - - + + + + + 金额 - - + + {{params.bill_date || ''}} + + + + 备注 + + + 确定 @@ -20,6 +27,6 @@ \ No newline at end of file diff --git a/miniprogram/pages/orders/ordersList/ordersList.ts b/miniprogram/pages/orders/ordersList/ordersList.ts index 98cd733..c487fc4 100644 --- a/miniprogram/pages/orders/ordersList/ordersList.ts +++ b/miniprogram/pages/orders/ordersList/ordersList.ts @@ -141,6 +141,14 @@ Page({ }, }); }, + onOrderDetail(e: any) { + const data = getDataSet(e); + const index = data.index; + const item = this.data.list[index]; + wx.navigateTo({ + url: `/pages/orders/ordersList/orderDetail/orderDetail?order_no=${item.order_no}`, + }); + }, onOrderDel(e: any) { const data = getDataSet(e); const index = data.index; diff --git a/miniprogram/pages/orders/ordersList/ordersList.wxml b/miniprogram/pages/orders/ordersList/ordersList.wxml index dea2bc2..a697b09 100644 --- a/miniprogram/pages/orders/ordersList/ordersList.wxml +++ b/miniprogram/pages/orders/ordersList/ordersList.wxml @@ -78,6 +78,8 @@ + 详情 + 收付款