精简搜索函数, 添加页面

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

@@ -1,5 +1,12 @@
import { loginStatus, post } from '@/utils/https';
import { cloneLite, getAuthInfo, getDataSet, toArray, toNumber } from '@/utils/util';
import {
cloneLite,
getAuthInfo,
getDataSet,
searchValueFormat,
toArray,
toNumber,
} from '@/utils/util';
const defaultParams = { curr_page: 1, page_count: 20 };
@@ -30,12 +37,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 {
@@ -43,16 +45,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,23 +4,23 @@
bind:reset="searchReset" value="{{params.batch_no}}" data-key="batch_no">
<view slot="content">
<search-input label="自定义批号" value="{{params.batch_custom_no}}" data-key="batch_custom_no"
bind:change="searchChange2" />
<!-- <option-cell-plugin title="订单阶段" value="{{params.order_step}}" bind:change="onOptionChange"
bind:change="searchChange" />
<!-- <option-cell-plugin title="订单阶段" value="{{params.order_step}}" bind:change="searchChange"
mode="checkbox" options="{{orderStep}}" data-key="order_step" /> -->
<select-plugin title="仓库" options="{{depots}}" value="{{params.depot_id}}"
bind:change="onOptionChange" data-key="depot_id" />
bind:change="searchChange" data-key="depot_id" />
<select-plugin title="供应商" options="{{crms}}" value="{{params.supplier_id}}"
bind:change="onOptionChange" data-key="supplier_id" />
bind:change="searchChange" data-key="supplier_id" />
<date-picker-plugin title="保质期开始日期" value="{{params.expire_dateL}}" data-key="expire_dateL"
bind:confirm="datePickerConfirm" />
bind:confirm="searchChange" />
<date-picker-plugin title="保质期结束日期" value="{{params.expire_dateU}}" data-key="expire_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>

View File

@@ -1,5 +1,12 @@
import { loginStatus, post } from '@/utils/https';
import { cloneLite, getAuthInfo, getDataSet, toArray, toNumber } from '@/utils/util';
import {
cloneLite,
getAuthInfo,
getDataSet,
searchValueFormat,
toArray,
toNumber,
} from '@/utils/util';
const defaultParams = { curr_page: 1, page_count: 20, batch_id: '' };
@@ -28,12 +35,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 {
@@ -41,16 +43,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

@@ -1,5 +1,12 @@
import { loginStatus, post } from '@/utils/https';
import { cloneLite, getAuthInfo, getDataSet, toArray, toNumber } from '@/utils/util';
import {
cloneLite,
getAuthInfo,
getDataSet,
searchValueFormat,
toArray,
toNumber,
} from '@/utils/util';
const defaultParams = { curr_page: 1, page_count: 20 };
@@ -28,12 +35,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 {
@@ -41,16 +43,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,20 +4,20 @@
bind:reset="searchReset" value="{{params.goods_name}}" data-key="goods_name">
<view slot="content">
<search-input label="商品编码" value="{{params.goods_code}}" data-key="goods_code"
bind:change="searchChange2" />
bind:change="searchChange" />
<search-input label="助记码" value="{{params.sku_alias}}" data-key="sku_alias"
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" /> -->
<select-plugin title="仓库" options="{{depots}}" value="{{params.depot_id}}"
bind:change="onOptionChange" data-key="depot_id" />
bind:change="searchChange" data-key="depot_id" />
<select-plugin title="商品分类" options="{{goodsClass}}" value="{{params.goods_class}}"
bind:change="onOptionChange" data-key="goods_class" />
bind:change="searchChange" data-key="goods_class" />
<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>

View File

@@ -3,6 +3,7 @@ import {
cloneLite,
getAuthInfo,
getDataSet,
searchValueFormat,
showModal,
sleep,
toArray,
@@ -31,17 +32,11 @@ Page({
},
init() {
this.setData({ authInfo: getAuthInfo() });
this.getGoodsAttr();
},
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 {
@@ -49,16 +44,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();
},

View File

@@ -4,15 +4,15 @@
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" />
<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" />
<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" />
</view>
</search-popup> -->

View File

@@ -4,6 +4,7 @@ import {
getAuthInfo,
getDataSet,
getDay,
searchValueFormat,
showModal,
sleep,
toArray,
@@ -40,12 +41,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 {
@@ -53,16 +49,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,19 +4,19 @@
bind:reset="searchReset" value="{{params.bill_no}}" data-key="bill_no">
<view slot="content">
<search-input label="销售单号" value="{{params.rel_bill_no}}" data-key="rel_bill_no"
bind:change="searchChange2" />
bind:change="searchChange" />
<option-cell-plugin title="单据状态" value="{{params.state || ''}}" bind:change="onOptionChange"
<option-cell-plugin title="单据状态" value="{{params.state || ''}}" bind:change="searchChange"
mode="radio" options="{{states}}" data-key="state" />
<date-picker-plugin title="单据开始日期" value="{{params.bill_dateL}}" data-key="bill_dateL"
bind:confirm="datePickerConfirm" />
bind:confirm="searchChange" />
<date-picker-plugin title="单据结束日期" value="{{params.bill_dateU}}" data-key="bill_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>

View File

@@ -3,6 +3,7 @@ import {
cloneLite,
getAuthInfo,
getDataSet,
searchValueFormat,
showModal,
sleep,
toArray,
@@ -39,12 +40,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 {
@@ -52,16 +48,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,18 +4,18 @@
bind:reset="searchReset" value="{{params.bill_no}}" data-key="bill_no">
<view slot="content">
<!-- <search-input label="销售单号" value="{{params.rel_bill_no}}" data-key="rel_bill_no"
bind:change="searchChange2" />
<option-cell-plugin title="单据状态" value="{{params.state || ''}}" bind:change="onOptionChange"
bind:change="searchChange" />
<option-cell-plugin title="单据状态" value="{{params.state || ''}}" bind:change="searchChange"
mode="radio" options="{{states}}" data-key="state" /> -->
<date-picker-plugin title="单据开始日期" value="{{params.bill_dateL}}" data-key="bill_dateL"
bind:confirm="datePickerConfirm" />
bind:confirm="searchChange" />
<date-picker-plugin title="单据结束日期" value="{{params.bill_dateU}}" data-key="bill_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>