update: 真机input clear失效

This commit is contained in:
admin 2024-04-26 14:13:57 +08:00
parent efd1325723
commit 11ae6ea0aa
30 changed files with 254 additions and 150 deletions

View File

@ -1,19 +1,19 @@
<template>
<view class="layout-box">
<view class="filter">
<u-input
<up-input
v-model="state.startTime"
disabled
disabledColor=""
placeholder="请选择开始时间"
></u-input>
></up-input>
<text>-</text>
<u-input
<up-input
v-model="state.endTime"
disabled
disabledColor=""
placeholder="请选择结束时间"
></u-input>
></up-input>
<u-icon
name="arrow-down"
@click="handleDialog('showTime', true)"
@ -192,7 +192,7 @@ onMounted(() => {
font-weight: 500;
font-size: 28rpx;
color: #000000;
::v-deep .u-input {
::v-deep .up-input {
padding: 0rpx 16rpx !important;
input {
font-family: Source Han Sans CN;

View File

@ -1,19 +1,19 @@
<template>
<view class="layout-box">
<view class="filter">
<u-input
<up-input
v-model="state.startTime"
disabled
disabledColor=""
placeholder="请选择开始时间"
></u-input>
></up-input>
<text>-</text>
<u-input
<up-input
v-model="state.endTime"
disabled
disabledColor=""
placeholder="请选择结束时间"
></u-input>
></up-input>
<u-icon
name="arrow-down"
@click="handleDialog('showTime', true)"
@ -269,7 +269,7 @@ onMounted(() => {
font-family: Source Han Sans CN;
font-size: 28rpx;
color: #000000;
::v-deep .u-input {
::v-deep .up-input {
padding: 0rpx 16.03rpx !important;
input {
font-family: Source Han Sans CN;

View File

@ -1,19 +1,19 @@
<template>
<view class="layout-box">
<view class="filter">
<u-input
<up-input
v-model="state.startTime"
disabled
disabledColor=""
placeholder="请选择开始时间"
></u-input>
></up-input>
<text>-</text>
<u-input
<up-input
v-model="state.endTime"
disabled
disabledColor=""
placeholder="请选择结束时间"
></u-input>
></up-input>
<u-icon
name="arrow-down"
@click="handleDialog('showTime', true)"
@ -266,7 +266,7 @@ onMounted(() => {
font-family: Source Han Sans CN;
font-size: 28rpx;
color: #000000;
::v-deep .u-input {
::v-deep .up-input {
padding: 0rpx 16.03rpx !important;
input {
font-family: Source Han Sans CN;

View File

@ -1,19 +1,19 @@
<template>
<view class="layout-box">
<view class="filter">
<u-input
<up-input
v-model="state.startTime"
disabled
disabledColor=""
placeholder="请选择开始时间"
></u-input>
></up-input>
<text>-</text>
<u-input
<up-input
v-model="state.endTime"
disabled
disabledColor=""
placeholder="请选择结束时间"
></u-input>
></up-input>
<u-icon
name="arrow-down"
@click="handleDialog('showTime', true)"
@ -190,7 +190,7 @@ onMounted(() => {
font-weight: 500;
font-size: 28rpx;
color: #000000;
::v-deep .u-input {
::v-deep .up-input {
padding: 0rpx 16.03rpx !important;
input {
font-family: Source Han Sans CN;

View File

@ -10,7 +10,7 @@
v-model="keyword"
:focus="true"
bgColor="#fff"
:clearabled="true"
clearable
:showAction="false"
placeholderColor="#C1C1C1"
@search="handleSearch()"

View File

@ -44,7 +44,7 @@
<view class="title">收货单价区间</view>
<view class="range">
<view>
<u-input
<up-input
shape="circle"
:fontSize="12"
:placeholderStyle="{ fontSize: '12px' }"
@ -53,11 +53,11 @@
size="small"
v-model="state.minPrice"
@change="(e:any) => {handleInput(e, {key: 'minPrice', name: '最低价'})}"
></u-input
></up-input
></view>
-
<view>
<u-input
<up-input
shape="circle"
:fontSize="12"
:placeholderStyle="{ fontSize: '12px' }"
@ -66,7 +66,7 @@
size="small"
v-model="state.maxPrice"
@change="(e:any) => {handleInput(e, {key: 'maxPrice', name: '最高价'})}"
></u-input
></up-input
></view>
</view>
</view>
@ -222,7 +222,7 @@ const handleInput = (e: any, item: any) => {
setTimeout(() => {
(state as any)[item.key] = temp;
}, 100);
}, 10);
}
};

View File

@ -22,24 +22,25 @@
v-model="(model1.formData as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.formData as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:disabled="item.type === 'select'"
:disabledColor="['卡号'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
</template>
@ -67,7 +68,11 @@ import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.formData as any)[item.key] = '';
}, 100);
}
const model1 = reactive<any>({
formData: {},
});

View File

@ -22,25 +22,26 @@
v-model="(model1.order as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.order as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="['客户','结算时间', '结算方式'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<!-- @afterRead="afterRead"
@delete="deletePic" -->
<uni-file-picker
@ -107,6 +108,11 @@ import { ImagesType, OrderType } from "@/utils/enum";
import _ from "underscore";
import SupplierDialog from "./SupplierDialog.vue";
import valid from "@/utils/validate";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.order as any)[item.key] = '';
}, 100);
}
//
const showDialog = <
{
@ -141,7 +147,7 @@ const handleInput = (e: any, item: any) => {
setTimeout(() => {
model1.order[item.key] = temp;
}, 100);
}, 10);
}
};

View File

@ -24,25 +24,26 @@
v-model="(model1.order as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.order as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="['供应商','客户','结算时间', '结算方式'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<!-- @afterRead="afterRead"
@delete="deletePic" -->
<uni-file-picker
@ -115,6 +116,11 @@ import { ImagesType, OrderType } from "@/utils/enum";
import _ from "underscore";
import SupplierDialog from "./SupplierDialog.vue";
import valid from "@/utils/validate";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.order as any)[item.key] = '';
}, 100);
}
//
const showDialog = <
{
@ -149,7 +155,7 @@ const handleInput = (e: any, item: any) => {
setTimeout(() => {
model1.order[item.key] = temp;
}, 100);
}, 10);
}
};

View File

@ -22,25 +22,26 @@
v-model="(model1.formData as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.formData as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:disabled="item.type === 'select'"
:disabledColor="['收货分类'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
</template>
@ -69,6 +70,11 @@ import { countDots } from "@/utils";
import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.formData as any)[item.key] = '';
}, 100);
}
//
const handleInput = (e: any, item: any) => {
if (["minPrice", "maxPrice", "commonPrice"].indexOf(item.key) > -1) {
@ -105,7 +111,7 @@ const handleInput = (e: any, item: any) => {
setTimeout(() => {
model1.formData[item.key] = temp;
}, 100);
}, 10);
}
if (item.key === "subtractNum") {
const temp = e?.replace(valid.valid_decimal.pattern, "");
@ -120,7 +126,7 @@ const handleInput = (e: any, item: any) => {
}
setTimeout(() => {
model1.order[item.key] = temp;
}, 100);
}, 10);
}
};
const model1 = reactive<any>({

View File

@ -22,22 +22,23 @@
v-model="(model1.formData as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.formData as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
</template>
@ -65,7 +66,11 @@ import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.formData as any)[item.key] = '';
}, 100);
}
const model1 = reactive<any>({
formData: {},
});

View File

@ -22,23 +22,24 @@
v-model="(model1.formData as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
:password="item.name === 'password'"
v-model="(model1.formData as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
</template>
@ -92,7 +93,11 @@ import { deleteBaseKey, formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.formData as any)[item.key] = '';
}, 100);
}
const model1 = reactive<any>({
formData: {},
});

View File

@ -22,7 +22,7 @@
v-model="(model1.formData as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="
item.type === 'select' ||
item.type === 'input' ||
@ -32,18 +32,19 @@
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:disabled="item.type === 'cascader'"
:disabledColor="['出货分类'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<template
#right
v-if="item.type === 'select' || item.type === 'cascader'"
@ -84,6 +85,11 @@ import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.formData as any)[item.key] = '';
}, 100);
}
const { proxy }: any = getCurrentInstance();
const model1 = reactive<any>({
formData: {},

View File

@ -22,24 +22,25 @@
v-model="(model1.formData as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.formData as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:disabled="item.type === 'select'"
:disabledColor="['上级菜单'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
</template>
@ -65,7 +66,11 @@
import { GoodsApi } from "@/services";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.formData as any)[item.key] = '';
}, 100);
}
const model1 = reactive<any>({
formData: {},
});

View File

@ -22,24 +22,25 @@
v-model="(model1.formData as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input' || item.type === 'selectCustom'"
v-model="(model1.formData as any)[item.key]"
:placeholder="`${item.type.indexOf('select') > -1 ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:disabled="item.type === 'selectCustom'"
:disabledColor="['类型'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<template #right v-if="item.type === 'select' || item.type === 'selectCustom'">
<u-icon name="arrow-right"></u-icon>
</template>
@ -67,7 +68,11 @@ import { deleteBaseKey, formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.formData as any)[item.key] = '';
}, 100);
}
const model1 = reactive<any>({
formData: {},
});

View File

@ -22,25 +22,26 @@
v-model="(model1.formData as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.formData as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
@change="(e:any) => {handleInput(e, item)}"
:disabled="item.type === 'select'"
:disabledColor="['卡号', '供应商分类'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
</template>
@ -69,12 +70,17 @@ import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.formData as any)[item.key] = '';
}, 100);
}
const handleInput = (e: any, item: any) => {
if (item.key === "phone" || item.key === 'bankNumber') {
const temp = e?.replace(valid.valid_number, "");
setTimeout(() => {
model1.formData[item.key] = temp;
}, 100);
}, 10);
}
};
const model1 = reactive<any>({

View File

@ -22,22 +22,23 @@
v-model="(model1.formData as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.formData as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
</template>
@ -63,7 +64,11 @@
import { SupplierApi } from "@/services";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.formData as any)[item.key] = '';
}, 100);
}
const model1 = reactive<any>({
formData: {},
});

View File

@ -22,27 +22,28 @@
v-model="(model1.formData as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
:password="item.key === 'password'"
v-model="(model1.formData as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:maxlength="item.key === 'password' ? 6 : -1"
@change="(e:any) => {handleInput(e, item)}"
:disabled="item.type === 'select'"
:disabledColor="['性别', '用户角色'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@clear="handleClear(item)"
>
<template #suffix>
<text>
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
</template>
@ -71,12 +72,17 @@ import { DeviceType, ImagesType, OrderType, StockCardType } from "@/utils/enum";
import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.formData as any)[item.key] = '';
}, 100);
}
const handleInput = (e: any, item: any) => {
if (item.key === "phone") {
const temp = e?.replace(valid.valid_number, "");
setTimeout(() => {
model1.formData[item.key] = temp;
}, 100);
}, 10);
}
};
const model1 = reactive<any>({
@ -87,7 +93,7 @@ const rules = ref({
"formData.userName": {
type: "string",
required: true,
message: "请输入用户名",
message: "请输入账号",
trigger: ["blur", "change"],
},
"formData.password": {
@ -146,7 +152,7 @@ const formAttrList = reactive<any>([
},
},
{
name: "用户名",
name: "账号",
key: "userName",
type: "input",
required: true,

View File

@ -22,18 +22,19 @@
v-model="(model1.order as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.order as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="['补单时间','站点磅秤','供应商','收货产品'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)"
>
<template #suffix>
<text v-if="item.key === 'subtractNum'">
@ -43,7 +44,7 @@
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<!-- @afterRead="afterRead"
@delete="deletePic" -->
<uni-file-picker
@ -129,6 +130,12 @@ import _ from "underscore";
import SupplierDialog from "./components/SupplierDialog.vue";
import ProductDialog from "./components/ProductDialog.vue";
import valid from "@/utils/validate";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.order as any)[item.key] = '';
}, 100);
}
//
const showDialog = <
{
@ -195,7 +202,7 @@ const handleInput = (e: any, item: any) => {
setTimeout(() => {
model1.order[item.key] = temp;
}, 100);
}, 10);
}
if (item.key === "subtractNum") {
const temp = e?.replace(valid.valid_decimal.pattern, "");
@ -210,7 +217,7 @@ const handleInput = (e: any, item: any) => {
}
setTimeout(() => {
model1.order[item.key] = temp;
}, 100);
}, 10);
}
};

View File

@ -22,18 +22,19 @@
v-model="(model1.order as any)[item.key]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.order as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="['补单时间','过磅设备','客户','出货产品'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)"
>
<template #suffix>
<text v-if="item.key === 'subtractNum'">
@ -43,7 +44,7 @@
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<!-- @afterRead="afterRead"
@delete="deletePic" -->
<uni-file-picker
@ -128,6 +129,11 @@ import _ from "underscore";
import SupplierDialog from "./components/SupplierDialog.vue";
import ProductDialog from "./components/ProductDialog.vue";
import valid from "@/utils/validate";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.order as any)[item.key] = '';
}, 100);
}
//
const showDialog = <
{
@ -166,7 +172,7 @@ const handleInput = (e: any, item: any) => {
}
setTimeout(() => {
model1.order[item.key] = temp;
}, 100);
}, 10);
}
if (item.key === "number" ) {
@ -180,7 +186,7 @@ const handleInput = (e: any, item: any) => {
}
setTimeout(() => {
model1.order[item.key] = temp;
}, 100);
}, 10);
}
};

View File

@ -14,11 +14,11 @@
:prop="`userInfo.${item.modelName}`"
>
<view v-if="item.type === 'text'">
<u-input
<up-input
v-model="model1.userInfo[`${item.modelName}`]"
:placeholder="item.placeholder"
:shape="'circle'"
:clearable="true"
clearable
:customStyle="{
'border-color':
currentFocus === item.modelName ? '#00dcee !important' : '',
@ -26,6 +26,7 @@
@focus="handleFocus(item.modelName)"
@blur="handleFocus('')"
@change="(e:any) => {handleInput(e, item.modelName)}"
@clear="handleClear(item)"
>
<template #suffix>
<text v-if="item.modelName === 'code'" class="code-btn">
@ -40,14 +41,14 @@
>
</text>
</template>
</u-input>
</up-input>
</view>
<view v-if="item.type === 'password'">
<u-input
<up-input
v-model="model1.userInfo[`${item.modelName}`]"
:placeholder="item.placeholder"
:shape="'circle'"
:clearable="true"
clearable
:password="!item.isShowPwd"
:customStyle="{
'border-color':
@ -56,6 +57,7 @@
@focus="handleFocus(item.modelName)"
@blur="handleFocus('')"
@change="(e:any) => {handleInput(e, item.modelName)}"
@clear="handleClear(item)"
>
<template #suffix>
<image
@ -71,7 +73,7 @@
@click="item.isShowPwd = false"
></image>
</template>
</u-input>
</up-input>
</view>
</u-form-item>
</u-form>
@ -94,7 +96,11 @@
import { ProfileApi } from "@/services/index";
import LoginLayout from "./components/loginLayout.vue";
import valid from "@/utils/validate";
import { validateRegex } from "@/utils";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.userInfo as any)[item.modelName] = '';
}, 100);
}
const loginForm = ref(null);
const model1 = <any>reactive({
userInfo: {
@ -138,21 +144,21 @@ const handleInput = (e: any, key: string) => {
const temp = e?.replace(valid.valid_number, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 100);
}, 10);
}
if (key === "code") {
const temp = e?.replace(valid.valid_number, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 100);
}, 10);
}
if (key === "newPassword" || key === "passwordConfirm") {
const temp = e?.replace(valid.valid_no_cn, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 100);
}, 10);
}
};
@ -204,7 +210,7 @@ const rules = ref({
type: "string",
required: true,
trigger: ["blur", "change"],
message: "请输入新密码"
message: "请输入新密码",
},
"userInfo.passwordConfirm": {
type: "string",
@ -227,14 +233,8 @@ const submit = () => {
}
if (model1.userInfo.newPassword || model1.userInfo.passwordConfirm) {
if (
!validateRegex(
valid.valid_password1.pattern,
model1.userInfo.newPassword
) ||
!validateRegex(
valid.valid_password1.pattern,
model1.userInfo.passwordConfirm
)
!valid.valid_password.pattern.test(model1.userInfo.newPassword) ||
!valid.valid_password.pattern.test(model1.userInfo.passwordConfirm)
) {
uni.showToast({
icon: "none",

View File

@ -9,24 +9,24 @@
:labelWidth="0"
>
<u-form-item prop="userInfo.userName">
<u-input
<up-input
v-model="model1.userInfo.userName"
placeholder="请输入手机号"
:shape="'circle'"
:clearable="true"
clearable
:customStyle="{
'border-color':
currentFocus === 'userName' ? '#00dcee !important' : '',
}"
type="number"
@focus="handleFocus('userName')"
@blur="handleFocus('')"
@change="(e:any) => {handleInput(e, 'userName')}"
@clear="handleClear({key: 'userName'})"
>
</u-input>
</up-input>
</u-form-item>
<u-form-item prop="userInfo.password">
<u-input
<up-input
v-model="model1.userInfo.password"
placeholder="请输入密码"
:shape="'circle'"
@ -37,9 +37,9 @@
currentFocus === 'password' ? '#00dcee !important' : '',
}"
@focus="handleFocus('password')"
@blur="handleFocus('')"
:clearable="true"
clearable
@change="(e:any) => {handleInput(e, 'password')}"
@clear="handleClear({key: 'password'})"
>
<template #suffix>
<image
@ -55,7 +55,7 @@
@click="isShowPwd = false"
></image>
</template>
</u-input>
</up-input>
</u-form-item>
</u-form>
<view class="remember-box">
@ -115,7 +115,12 @@ import { ProfileApi } from "@/services/index";
import LoginLayout from "./components/loginLayout.vue";
import { useMemberStore } from "@/store/index";
import valid from "@/utils/validate";
import { validateRegex } from "@/utils";
const handleClear = (item: any) => {
setTimeout(() => {
(model1.userInfo as any)[item.key] = "";
}, 100);
};
const store = useMemberStore();
const loginForm = ref(null);
const model1 = reactive({
@ -154,14 +159,14 @@ const handleInput = (e: any, key: string) => {
const temp = e?.replace(valid.valid_number, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 100);
}, 10);
}
if (key === "password") {
const temp = e?.replace(valid.valid_no_cn, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 100);
}, 10);
}
};
@ -177,10 +182,7 @@ const submit = () => {
}
if (model1.userInfo.password) {
if (!validateRegex(
valid.valid_password1.pattern,
model1.userInfo.password
)) {
if (!valid.valid_password.pattern.test(model1.userInfo.password)) {
uni.showToast({
icon: "none",
title: valid.valid_password.message,

View File

@ -19,12 +19,13 @@
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
:border="index === 2 ? 'none' : 'bottom'"
:value="(model1.userInfo as any)[item.key]"
:password="!item.isShowPwd"
@change="(e:any) => {handleInput(e, item.key)}"
@clear="handleClear(item)"
>
<template #suffix>
<image
@ -59,16 +60,21 @@
</template>
<script setup lang="ts">
import { ProfileApi } from "@/services";
import { validateRegex } from "@/utils";
import valid from "@/utils/validate";
const handleInput = (e: any, key: string) => {
const temp = e?.replace(valid.valid_no_cn, "");
setTimeout(() => {
(model1.userInfo as any)[key] = temp;
}, 100);
}, 10);
};
const handleClear = (item:any) => {
setTimeout(() => {
(model1.userInfo as any)[item.key] = '';
}, 100);
}
//
const formAttrList = ref([
{
@ -158,14 +164,8 @@ const startSave = () => {
const submit = () => {
if (model1.userInfo.newPassword || model1.userInfo.passwordConfirm) {
if (
!validateRegex(
valid.valid_password1.pattern,
model1.userInfo.newPassword
) ||
!validateRegex(
valid.valid_password1.pattern,
model1.userInfo.passwordConfirm
)
!valid.valid_password.pattern.test(model1.userInfo.newPassword) ||
!valid.valid_password.pattern.test(model1.userInfo.passwordConfirm)
) {
uni.showToast({
icon: "none",

View File

@ -30,13 +30,14 @@
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:value="(model1.order as any)[item.key]"
@change="(e:any) => {handleInput(e, item)}"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="item.name === '收货产品' ? '#ffffff' : '#f5f7fa'"
@clear="handleClear(item)"
>
<template #suffix>
<text v-if="item.key === 'subtractNum'">
@ -131,7 +132,11 @@ import SupplierDialog from "../components/SupplierDialog.vue";
import ProductDialog from "../components/ProductDialog.vue";
import valid from "@/utils/validate";
import { countDots } from "@/utils";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.order as any)[item.key] = '';
}, 100);
}
//
const showDialog = <
{
@ -183,7 +188,7 @@ const handleInput = (e: any, item: any) => {
setTimeout(() => {
model1.order[item.key] = temp;
}, 100);
}, 10);
}
if (item.key === "subtractNum") {
const temp = e?.replace(valid.valid_decimal.pattern, "");
@ -198,7 +203,7 @@ const handleInput = (e: any, item: any) => {
}
setTimeout(() => {
model1.order[item.key] = temp;
}, 100);
}, 10);
}
};

View File

@ -10,7 +10,7 @@
v-model="keyword"
:focus="true"
bgColor="#fff"
:clearabled="true"
clearable
:showAction="false"
placeholderColor="#C1C1C1"
@search="handleSearch()"

View File

@ -24,18 +24,19 @@
v-model="(model1.order as any)[(item.key as any)]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.order as any)[(item.key as any)]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="item.name === '结算方式' ? '#ffffff' : '#f5f7fa'"
@change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)"
>
<template #suffix>
<text v-if="item.key === 'subtractNum'">
@ -45,7 +46,7 @@
{{ item.unit }}
</text>
</template>
</u-input>
</up-input>
<uni-file-picker
v-if="item.type === 'upload'"
v-model="model1.order.fileLists"
@ -107,6 +108,11 @@ import {
} from "@/utils/enum";
import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.order as any)[item.key] = '';
}, 100);
}
const isShowFormItem = (item: any) => {
if (model1.scaleStatusBtnType === ScaleStatusBtnType.ShipmentPay) {
return true;
@ -150,7 +156,7 @@ const handleInput = (e: any, item: any) => {
}
setTimeout(() => {
model1.order[item.key] = temp;
}, 100);
}, 10);
}
};
const model1 = reactive<{

View File

@ -23,23 +23,24 @@
v-model="(model1.order as any)[(item.key as any)]"
:placeholder="`请输入${item.name}`"
></u-textarea>
<u-input
<up-input
v-if="item.type === 'select' || item.type === 'input'"
v-model="(model1.order as any)[(item.key as any)]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
clearable
:customStyle="{}"
border="none"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="item.name === '出货产品'?'#ffffff':'#f5f7fa'"
@change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)"
>
<template #suffix>
{{ item.unit }}
</template>
</u-input>
</up-input>
<!-- @afterRead="afterRead"
@delete="deletePic" -->
<!-- <u-upload
@ -110,6 +111,11 @@ import { onLoad } from "@dcloudio/uni-app";
import _ from "underscore";
import ProductDialog from "../components/ProductDialog.vue";
import valid from "@/utils/validate";
const handleClear = (item:any) => {
setTimeout(() => {
(model1.order as any)[item.key] = '';
}, 100);
}
//
const showDialog = <
{
@ -135,7 +141,7 @@ const handleInput = (e: any, item: any) => {
const tempPrice = e?.replace(valid.valid_number, "");
setTimeout(() => {
model1.order[item.key] = tempPrice;
}, 100);
}, 10);
}
};
const model1 = reactive<any>({

View File

@ -9,7 +9,7 @@
v-model="keyword"
:focus="true"
bgColor="#fff"
:clearabled="true"
clearable
:showAction="false"
placeholderColor="#C1C1C1"
@search="handleSearch()"
@ -157,6 +157,7 @@ const tabList = reactive([
const currentTab = ref(2);
const handleTab = (item: any) => {
currentTab.value = item.key;
resetPageList();
getList();
};
const handleReview = (id: string, scaleStatus: number) => {
@ -237,9 +238,14 @@ const getList = (v?: boolean) => {
}).then((res) => {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = (res.data.list as any).map((item: any) => {
return { ...item, isChecked: false };
});
// (pageList as any).list = (res.data.list as any).map((item: any) => {
// return { ...item, isChecked: false };
// });
(pageList as any).list = (pageList as any).list.concat(
(res.data.list as any).map((item: any) => {
return { ...item, isChecked: false };
})
);
pageList.total = (res.data as any).total;
}
});

View File

@ -124,7 +124,7 @@ const getList = (v?: boolean) => {
}).then((res) => {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = (pageList as any).list = (
(pageList as any).list = (
pageList as any
).list.concat(res.data.list);
pageList.total = (res.data as any).total;

View File

@ -52,7 +52,7 @@ const valid = {
message: "密码由字母、数字组成,且至少8位",
},
valid_password1: {
pattern: /^(?=.*[a-z])(?=.*\d)[a-zA-Z\d]{8,}$/,
pattern: "^(?=.*[a-z])(?=.*\d)[a-zA-Z\d]{8,}$",
message: "密码必须由字母、数字组成, 且至少8位",
},
};