精简搜索函数, 添加页面

This commit is contained in:
zhengw
2026-02-06 14:49:13 +08:00
parent 3513a19880
commit 9ce21008a3
64 changed files with 519 additions and 559 deletions

View File

@@ -22,10 +22,9 @@ Page({
post('Orders/getLiteOrders')
.then((res: any) => {
const list = toArray(res.data);
wx.stopPullDownRefresh();
this.setData({ list: list });
this.setData({ list });
})
.catch(() => {
.finally(() => {
wx.stopPullDownRefresh();
});
},
@@ -45,7 +44,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
onLoad(_options) {},
/**
* 生命周期函数--监听页面初次渲染完成

View File

@@ -9,6 +9,7 @@ import {
getAuthInfo,
getDataSet,
getDay,
searchValueFormat,
showModal,
sleep,
toArray,
@@ -67,12 +68,7 @@ Page({
},
searchChange(e: any) {
const key = getDataSet(e).key;
this.data.params[key] = e.detail.value;
this.setData({ params: this.data.params });
},
searchChange2(e: any) {
const key = getDataSet(e).key;
const val = `${e.detail.value || ''}`.trim();
const val = searchValueFormat(e.detail.value);
if (val) {
this.data.params[key] = val;
} else {
@@ -80,16 +76,6 @@ Page({
}
this.setData({ params: this.data.params });
},
onOptionChange(e: any) {
const key = getDataSet(e).key;
this.data.params[key] = e.detail.value;
this.setData({ params: this.data.params });
},
datePickerConfirm(e: any) {
const data = getDataSet(e);
this.data.params[data.key] = e.detail.value;
this.setData({ params: this.data.params });
},
searchOk() {
this.getList(1);
},

View File

@@ -4,36 +4,36 @@
bind:reset="searchReset" value="{{params.order_no}}" data-key="order_no">
<view slot="content">
<search-input label="自定义单号" value="{{params.custom_order_no}}" data-key="custom_order_no"
bind:change="searchChange2" />
bind:change="searchChange" />
<search-input label="经销商名称" value="{{params.custom_name}}" data-key="custom_name"
bind:change="searchChange2" />
bind:change="searchChange" />
<search-input label="经销商手机" value="{{params.custom_phone}}" data-key="custom_phone"
bind:change="searchChange2" />
bind:change="searchChange" />
<search-input label="客户名称" value="{{params.end_user_name}}" data-key="end_user_name"
bind:change="searchChange2" />
bind:change="searchChange" />
<search-input label="客户手机" value="{{params.end_user_phone}}" data-key="end_user_phone"
bind:change="searchChange2" />
bind:change="searchChange" />
<search-input label="客户地址" value="{{params.end_user_address}}" data-key="end_user_address"
bind:change="searchChange2" />
bind:change="searchChange" />
<option-cell-plugin title="订单阶段" value="{{params.order_step}}" bind:change="onOptionChange"
<option-cell-plugin title="订单阶段" value="{{params.order_step}}" bind:change="searchChange"
mode="checkbox" options="{{orderStep}}" data-key="order_step" />
<option-cell-plugin title="生产状态" value="{{params.process_state}}" bind:change="onOptionChange"
mode="checkbox" data-key="process_state" options="{{saleOrderProcessStateOption}}" />
<option-cell-plugin title="生产状态" value="{{params.process_state}}" bind:change="searchChange"
mode="checkbox" options="{{saleOrderProcessStateOption}}" data-key="process_state" />
<option-cell-plugin title="收款状态" value="{{params.payed_state || ''}}"
bind:change="onOptionChange" mode="radio" options="{{payedStateOption}}"
bind:change="searchChange" mode="radio" options="{{payedStateOption}}"
data-key="payed_state" />
<date-picker-plugin title="单据开始日期" value="{{params.document_dateL}}" data-key="document_dateL"
bind:confirm="datePickerConfirm" />
bind:confirm="searchChange" />
<date-picker-plugin title="单据结束日期" value="{{params.document_dateU}}" data-key="document_dateU"
bind:confirm="datePickerConfirm" />
bind:confirm="searchChange" />
<date-picker-plugin title="创建开始日期" value="{{params.create_dateL}}" data-key="create_dateL"
bind:confirm="datePickerConfirm" />
bind:confirm="searchChange" />
<date-picker-plugin title="创建结束日期" value="{{params.create_dateU}}" data-key="create_dateU"
bind:confirm="datePickerConfirm" />
bind:confirm="searchChange" />
</view>
</search-popup>