Commit 96fb5eef authored by zhengyi's avatar zhengyi

“发货人”、“收货人”、“商品”搜索内容只需去除前后空格,中间有空格无需处理

parent 019d4da1
......@@ -10,10 +10,10 @@
</el-input>
</el-form-item>
<el-form-item :label="$t('发货人')" prop="consignorKey">
<el-input v-model.trim="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery" @input="replaceSpace(queryParams, 'consignorKey')" />
<el-input v-model.trim="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('收货人')" prop="consigneeKey">
<el-input v-model.trim="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery" @input="replaceSpace(queryParams, 'consigneeKey')" />
<el-input v-model.trim="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('控货状态')" prop="isCargoControl">
<dict-selector v-model="queryParams.cargoControlStatusList" multiple :type="DICT_TYPE.CONTROL_GOODS_STATUS" clearable @change="handleQuery" />
......@@ -53,7 +53,7 @@
<el-input v-model="queryParams.orderNo" :placeholder="$t('订单编号')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/\s+/g, '')" />
</el-form-item>-->
<el-form-item :label="$t('商品') + ':'" v-show="showSearch">
<el-input v-model.trim="prodParam.value" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery" @input="replaceSpace(prodParam, 'value')">
<el-input v-model.trim="prodParam.value" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery">
<template slot="prepend">
<dict-selector :type="DICT_TYPE.ORDER_QUERY_PROD_FIELD" defaultable v-model="prodParam.key" class="w-50" />
</template>
......
......@@ -31,7 +31,6 @@
:placeholder="$t('发货人')"
clearable
@keyup.enter.native="handleQuery"
@input="replaceSpace(queryParams, 'consignorText')"
/>
</el-form-item>
<el-form-item :label="$t('收货人')" prop="consigneeText">
......@@ -40,7 +39,6 @@
:placeholder="$t('收货人')"
clearable
@keyup.enter.native="handleQuery"
@input="replaceSpace(queryParams, 'consigneeText')"
/>
</el-form-item>
<el-form-item :label="$t('运输方式') + ':'" v-show="showSearch">
......@@ -211,7 +209,7 @@
v-model="queryParams.goodsNameKey"
/>
<product-selector
v-model="queryParams.goodsName"
v-model.trim="queryParams.goodsName"
style="flex: 1"
:clearable="true"
@keyup.enter.native="handleQuery"
......
......@@ -13,10 +13,10 @@
</el-form-item> -->
<el-form-item :label="$t('发货人')" prop="consignorKey">
<el-input v-model.trim="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery" @input="replaceSpace(queryParams, 'consignorKey')" />
<el-input v-model.trim="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('收货人')" prop="consigneeKey">
<el-input v-model.trim="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery" @input="replaceSpace(queryParams, 'consigneeKey')" />
<el-input v-model.trim="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('控货')" prop="isCargoControl" v-show="showSearch">
......@@ -63,7 +63,7 @@
</el-form-item> -->
<el-form-item :label="$t('商品')" prop="tidanNo" v-show="showSearch">
<el-input v-model.trim="prodParam.value" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery" @input="replaceSpace(prodParam, 'value')">
<el-input v-model.trim="prodParam.value" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery">
<template slot="prepend">
<dict-selector :type="DICT_TYPE.ORDER_QUERY_PROD_FIELD" defaultable v-model="prodParam.key" class="w-50" />
</template>
......
......@@ -4,14 +4,14 @@
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('编号')" prop="orderNo">
<el-input v-model="queryParams.numberKey" :placeholder="$t('请输入订单号、唛头、提单号')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/\s+/g, '')" />
<el-input v-model="queryParams.numberKey" :placeholder="$t('请输入订单号、唛头、提单号')" clearable @keyup.enter.native="handleQuery" @input="replaceSpace(queryParams, 'numberKey')" />
</el-form-item>
<el-form-item :label="$t('发货人')" prop="consignorKey">
<el-input v-model="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
<el-input v-model.trim="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('收货人')" prop="consigneeKey">
<el-input v-model="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
<el-input v-model.trim="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('客户经理')" >
<user-selector manage v-model="queryParams.salesmanIds" multiple clearable @change="handleQuery"
......@@ -89,7 +89,7 @@
</el-form-item>
<el-form-item :label="$t('商品')" prop="tidanNo" v-show="showSearch">
<el-input v-model.trim="queryParams.prodKey" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery" />
<el-input v-model.trim="queryParams.prodKey" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<!--根据需求文档 lanbm 2024-06-23 隐藏-->
......@@ -685,6 +685,10 @@ export default {
this.AddressTown = data;
})
}
},
// 自动去除空格
replaceSpace(obj, field) {
obj[field] = obj[field].replace(/\s+/g, "")
}
}
};
......
......@@ -19,7 +19,6 @@
:placeholder="$t('发货人')"
clearable
@keyup.enter.native="handleQuery"
@input="replaceSpace(queryParams, 'consignorKey')"
/>
</el-form-item>
<el-form-item :label="$t('收货人')" prop="consigneeKey">
......@@ -28,7 +27,6 @@
:placeholder="$t('收货人')"
clearable
@keyup.enter.native="handleQuery"
@input="replaceSpace(queryParams, 'consigneeKey')"
/>
</el-form-item>
<el-form-item :label="$t('客户经理')">
......@@ -115,7 +113,6 @@
:placeholder="$t('请输入商品类型、品名或品牌')"
clearable
@keyup.enter.native="handleQuery"
@input="replaceSpace(queryParams, 'prodKey')"
/>
</el-form-item>
......
......@@ -3,14 +3,14 @@
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item :label="$t('订单编号')" prop="orderNo">
<el-input v-model="queryParams.orderNo" :placeholder="$t('订单编号')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/\s+/g, '')" />
<el-input v-model.trim="queryParams.orderNo" :placeholder="$t('订单编号')" clearable @keyup.enter.native="handleQuery" @input="replaceSpace(queryParams, 'orderNo')" />
</el-form-item>
<el-form-item :label="$t('发货人')" prop="consignorKey">
<el-input v-model="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
<el-input v-model.trim="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('收货人')" prop="consigneeKey">
<el-input v-model="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
<el-input v-model.trim="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('控货状态')" prop="isCargoControl">
<dict-selector v-model="queryParams.cargoControlStatusList" multiple :type="DICT_TYPE.CONTROL_GOODS_STATUS" clearable @change="handleQuery" />
......@@ -46,7 +46,7 @@
</el-form-item>
<el-form-item :label="$t('商品')" prop="prodId" v-show="showSearch">
<product-selector v-model="queryParams.prodId" @keyup.enter.native="handleQuery" clearable @change="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" />
<product-selector v-model.trim="queryParams.prodId" @keyup.enter.native="handleQuery" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('订单状态')" prop="statusList" v-show="showSearch">
......@@ -351,7 +351,10 @@ export default {
this.loading = false
})
},
// 自动去除空格
replaceSpace(obj, field) {
obj[field] = obj[field].replace(/\s+/g, "")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment