Compare commits
10 Commits
b6838f3f8d
...
88a7428ed6
Author | SHA1 | Date |
---|---|---|
admin | 88a7428ed6 | |
admin | b23ad4b28a | |
admin | 58e2cb435b | |
admin | 37e2c5a641 | |
admin | 07097b173d | |
admin | 1e6937966b | |
admin | 98c4ab41ba | |
admin | a3a260341b | |
admin | 36faef2150 | |
admin | a0c55d0be1 |
|
@ -2,12 +2,12 @@
|
||||||
<up-row customStyle="flex-wrap: wrap" :gutter="8">
|
<up-row customStyle="flex-wrap: wrap" :gutter="8">
|
||||||
<up-col span="6" v-for="(item, index) in list" :key="index">
|
<up-col span="6" v-for="(item, index) in list" :key="index">
|
||||||
<view class="grid-item">
|
<view class="grid-item">
|
||||||
<up-image
|
<image
|
||||||
:src="item.url"
|
:src="item.url || `${url}/static/110/error.jpg`"
|
||||||
:mode="'widthFix'"
|
:mode="'widthFix'"
|
||||||
:width="'100%'"
|
:width="'100%'"
|
||||||
@click="showImage(index)"
|
@click="showImage(index)"
|
||||||
></up-image>
|
></image>
|
||||||
</view>
|
</view>
|
||||||
</up-col>
|
</up-col>
|
||||||
</up-row>
|
</up-row>
|
||||||
|
@ -20,13 +20,14 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PictureApi } from "@/services";
|
import { PictureApi } from "@/services";
|
||||||
|
import { url } from "@/utils/data";
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
params: Object;
|
params: Object;
|
||||||
}>();
|
}>();
|
||||||
let list: any = ref([]);
|
let list: any = ref([]);
|
||||||
const showImage = (index: number) => {
|
const showImage = (index: number) => {
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls: list.value.map((item: any) => item.url), // 图片列表
|
urls: list.value.map((item: any) => item.url || `${url}/static/110/error.jpg`), // 图片列表
|
||||||
current: index, // 当前显示图片的索引
|
current: index, // 当前显示图片的索引
|
||||||
indicator: "default", // 图片指示器样式,默认为圆点
|
indicator: "default", // 图片指示器样式,默认为圆点
|
||||||
loop: true,
|
loop: true,
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
v-else
|
v-else
|
||||||
:placeholder="`请输入${name}`"
|
:placeholder="`请输入${name}`"
|
||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
:focus="true"
|
|
||||||
bgColor="#fff"
|
bgColor="#fff"
|
||||||
clearable
|
clearable
|
||||||
:showAction="false"
|
:showAction="false"
|
||||||
|
|
|
@ -76,12 +76,12 @@ const state = reactive({
|
||||||
// path: "/pagesConfig/index",
|
// path: "/pagesConfig/index",
|
||||||
path: "/pagesHome/config",
|
path: "/pagesHome/config",
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
text: "配置旧",
|
// text: "配置旧",
|
||||||
icon: "config.png",
|
// icon: "config.png",
|
||||||
activeIcon: "config_active.png",
|
// activeIcon: "config_active.png",
|
||||||
path: "/pagesHome/index1",
|
// path: "/pagesHome/index1",
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
text: "我的",
|
text: "我的",
|
||||||
icon: "profile.png",
|
icon: "profile.png",
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
{
|
{
|
||||||
"path": "profile/baseinfo",
|
"path": "profile/baseinfo",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "基础信息",
|
"navigationBarTitleText": "个人信息",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#FFFFFF"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,16 +210,6 @@ const handleInput = (e: any, item: any) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.key === "maxPrice" || item.key === "minPrice") {
|
|
||||||
if (state.minPrice && state.maxPrice && state.minPrice > state.maxPrice) {
|
|
||||||
uni.showToast({
|
|
||||||
title: `最大值应小于最小值`,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
(state as any)[item.key] = temp;
|
(state as any)[item.key] = temp;
|
||||||
}, 10);
|
}, 10);
|
||||||
|
@ -424,13 +414,6 @@ const resetState = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getFilter = () => {
|
const getFilter = () => {
|
||||||
if (state.minPrice && state.maxPrice && state.minPrice > state.maxPrice) {
|
|
||||||
uni.showToast({
|
|
||||||
title: `最大值应小于最小值`,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
emit("handleOk", {
|
emit("handleOk", {
|
||||||
...state,
|
...state,
|
||||||
repairFlag: currentSpl.value,
|
repairFlag: currentSpl.value,
|
||||||
|
|
|
@ -32,7 +32,9 @@
|
||||||
:customStyle="{}"
|
:customStyle="{}"
|
||||||
border="none"
|
border="none"
|
||||||
:disabled="item.type === 'select'"
|
:disabled="item.type === 'select'"
|
||||||
:disabledColor="['收货分类'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
|
:disabledColor="
|
||||||
|
['收货分类'].indexOf(item.name) > -1 ? '#ffffff' : '#f5f7fa'
|
||||||
|
"
|
||||||
@change="(e:any) => {handleInput(e, item)}"
|
@change="(e:any) => {handleInput(e, item)}"
|
||||||
@clear="handleClear(item)"
|
@clear="handleClear(item)"
|
||||||
>
|
>
|
||||||
|
@ -66,49 +68,29 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { GoodsApi } from "@/services";
|
import { GoodsApi } from "@/services";
|
||||||
import { countDots } from "@/utils";
|
import { countDots, isTwoDecimalPlaces } from "@/utils";
|
||||||
import valid from "@/utils/validate";
|
import valid from "@/utils/validate";
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import _ from "underscore";
|
import _ from "underscore";
|
||||||
const handleClear = (item:any) => {
|
const handleClear = (item: any) => {
|
||||||
(model1.formData as any)[item.key] = '';
|
(model1.formData as any)[item.key] = "";
|
||||||
}
|
};
|
||||||
// 最低价 最高价 常用价格
|
// 最低价 最高价 常用价格
|
||||||
const handleInput = (e: any, item: any) => {
|
const handleInput = (e: any, item: any) => {
|
||||||
if (["minPrice", "maxPrice", "commonPrice"].indexOf(item.key) > -1) {
|
if (["minPrice", "maxPrice", "commonPrice"].indexOf(item.key) > -1) {
|
||||||
const temp = e?.replace(valid.valid_decimal.pattern, "");
|
const temp = e?.replace(valid.valid_decimal.pattern, "");
|
||||||
if (countDots(temp).length > 1) {
|
if (countDots(temp) > 1) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请输入正确的" + item.name,
|
title: "请输入正确的" + item.name,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
} else if(countDots(temp) === 1 && (isTwoDecimalPlaces(temp))) {
|
||||||
const minPrice = parseFloat(model1.formData.minPrice)
|
|
||||||
const maxPrice = parseFloat(model1.formData.maxPrice)
|
|
||||||
if (item.key === "maxPrice") {
|
|
||||||
if (minPrice > maxPrice) {
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `${item.name}应小于${model1.formData.maxPrice}`,
|
title: item.name + "最多只能输入2位小数",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (item.key === "commonPrice") {
|
|
||||||
if (minPrice > -1 && maxPrice > -1) {
|
|
||||||
if (
|
|
||||||
!(temp >= minPrice &&
|
|
||||||
temp <= maxPrice)
|
|
||||||
) {
|
|
||||||
uni.showToast({
|
|
||||||
title: `${item.name}应在${model1.formData.minPrice}-${model1.formData.maxPrice}之间`,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
model1.formData[item.key] = temp;
|
model1.formData[item.key] = temp;
|
||||||
}, 10);
|
}, 10);
|
||||||
|
@ -151,24 +133,6 @@ const rules = ref({
|
||||||
// message: "请输入所属分站",
|
// message: "请输入所属分站",
|
||||||
// trigger: ["blur", "change"],
|
// trigger: ["blur", "change"],
|
||||||
// },
|
// },
|
||||||
"formData.minPrice": {
|
|
||||||
type: "number",
|
|
||||||
required: true,
|
|
||||||
message: "最低价为空或输入错误",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
"formData.maxPrice": {
|
|
||||||
type: "number",
|
|
||||||
required: true,
|
|
||||||
message: "最高价为空或输入错误",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
"formData.commonPrice": {
|
|
||||||
type: "number",
|
|
||||||
required: true,
|
|
||||||
message: "常用价格为空或输入错误",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
const contrlModalParams = reactive<any>({
|
const contrlModalParams = reactive<any>({
|
||||||
reCategory: {
|
reCategory: {
|
||||||
|
@ -198,32 +162,25 @@ const formAttrList = reactive<any>([
|
||||||
contrlModalParams.reCategory.title = "收货分类";
|
contrlModalParams.reCategory.title = "收货分类";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// name: "所属分站",
|
|
||||||
// key: "substationName",
|
|
||||||
// type: "input",
|
|
||||||
// required: true,
|
|
||||||
// unit: "",
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
name: "最低价",
|
name: "最低价",
|
||||||
key: "minPrice",
|
key: "minPrice",
|
||||||
type: "input",
|
type: "input",
|
||||||
required: true,
|
required: false,
|
||||||
unit: "",
|
unit: "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "最高价",
|
name: "最高价",
|
||||||
key: "maxPrice",
|
key: "maxPrice",
|
||||||
type: "input",
|
type: "input",
|
||||||
required: true,
|
required: false,
|
||||||
unit: "",
|
unit: "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "常用价格",
|
name: "常用价格",
|
||||||
key: "commonPrice",
|
key: "commonPrice",
|
||||||
type: "input",
|
type: "input",
|
||||||
required: true,
|
required: false,
|
||||||
unit: "",
|
unit: "",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
@ -255,27 +212,7 @@ const check = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const save = () => {
|
const save = () => {
|
||||||
const minPrice = parseFloat(model1.formData.minPrice)
|
|
||||||
const maxPrice = parseFloat(model1.formData.maxPrice)
|
|
||||||
if (minPrice > maxPrice) {
|
|
||||||
uni.showToast({
|
|
||||||
title: `最低价应小于${model1.formData.maxPrice}`,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (minPrice > -1 &&maxPrice > -1) {
|
|
||||||
|
|
||||||
const temp = model1.formData.commonPrice;
|
|
||||||
if (!(temp >= minPrice && temp <= maxPrice)) {
|
|
||||||
uni.showToast({
|
|
||||||
title: `常用价格应在${model1.formData.minPrice}-${model1.formData.maxPrice}之间`,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
check().then((res) => {
|
check().then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
startSave();
|
startSave();
|
||||||
|
@ -286,13 +223,13 @@ const startSave = () => {
|
||||||
if (model1.formData.id) {
|
if (model1.formData.id) {
|
||||||
GoodsApi.EditReceiveProduct(model1.formData).then((res) => {
|
GoodsApi.EditReceiveProduct(model1.formData).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.navigateBack()
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
GoodsApi.addReProducts(model1.formData).then((res) => {
|
GoodsApi.addReProducts(model1.formData).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.navigateBack()
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -324,7 +261,7 @@ onLoad((option) => {
|
||||||
|
|
||||||
// 设置页面标题
|
// 设置页面标题
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: title || '新增收货产品',
|
title: title || "新增收货产品",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -350,7 +287,7 @@ onLoad((option) => {
|
||||||
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
border-radius: 13rpx 13rpx 0rpx 0rpx;
|
||||||
padding: 25rpx 50rpx;
|
padding: 25rpx 50rpx;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: calc(100vw - 100rpx);
|
width: calc(100vw - 100rpx);
|
||||||
bottom: 0rpx;
|
bottom: 0rpx;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
::v-deep button {
|
::v-deep button {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="c-card">
|
<view class="c-card app-container">
|
||||||
<u-form
|
<u-form
|
||||||
labelPosition="left"
|
labelPosition="left"
|
||||||
:model="model1"
|
:model="model1"
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
border="none"
|
border="none"
|
||||||
:maxlength="item.key === 'password' ? 8 : -1"
|
:maxlength="item.key === 'password' ? 8 : -1"
|
||||||
@change="(e:any) => {handleInput(e, item)}"
|
@change="(e:any) => {handleInput(e, item)}"
|
||||||
:disabled="item.type === 'select'"
|
:disabled="item.type === 'select' || isEditPhone(item)"
|
||||||
:disabledColor="
|
:disabledColor="
|
||||||
['性别', '用户角色'].indexOf(item.name) > -1 ? '#ffffff' : '#f5f7fa'
|
['性别', '用户角色'].indexOf(item.name) > -1 ? '#ffffff' : '#f5f7fa'
|
||||||
"
|
"
|
||||||
|
@ -100,6 +100,12 @@ const handleInput = (e: any, item: any) => {
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isEditPhone = (item:any) => {
|
||||||
|
if (model1.formData.id && item.key === 'phone') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
const model1 = reactive<any>({
|
const model1 = reactive<any>({
|
||||||
formData: {
|
formData: {
|
||||||
gender: 1
|
gender: 1
|
||||||
|
@ -272,7 +278,6 @@ onLoad((option: any) => {
|
||||||
if (option.item) {
|
if (option.item) {
|
||||||
const obj = JSON.parse(option.item);
|
const obj = JSON.parse(option.item);
|
||||||
model1.formData = { ...obj, genderName: ["未知", "男", "女"][obj.gender] };
|
model1.formData = { ...obj, genderName: ["未知", "男", "女"][obj.gender] };
|
||||||
debugger
|
|
||||||
if (obj.roleVos.length > 0) {
|
if (obj.roleVos.length > 0) {
|
||||||
model1.formData.roleIds = [obj.roleVos[0].id];
|
model1.formData.roleIds = [obj.roleVos[0].id];
|
||||||
model1.formData.roleName = obj.roleVos[0].roleName;
|
model1.formData.roleName = obj.roleVos[0].roleName;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="c-card">
|
<view class="c-card app-container">
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入客户名称"
|
placeholder="请输入客户名称"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="c-card">
|
<view class="c-card app-container">
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入收货产品名称"
|
placeholder="请输入收货产品名称"
|
||||||
|
@ -28,7 +28,6 @@
|
||||||
<view>
|
<view>
|
||||||
<view>
|
<view>
|
||||||
<view>{{ item.reProductsName }}</view>
|
<view>{{ item.reProductsName }}</view>
|
||||||
<view>{{ item.minPrice }} ~ {{ item.maxPrice }} 元</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="op-box">
|
<view class="op-box">
|
||||||
<view class="btn" @click="edit(item)"> 编辑 </view>
|
<view class="btn" @click="edit(item)"> 编辑 </view>
|
||||||
|
|
|
@ -183,17 +183,6 @@ const handleInput = (e: any, item: any) => {
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (item.key === "price") {
|
|
||||||
if (model1.order.minPrice && model1.order.maxPrice) {
|
|
||||||
if (temp < model1.order.minPrice || temp > model1.order.maxPrice) {
|
|
||||||
uni.showToast({
|
|
||||||
title: `${item.name}应在${model1.order.minPrice}-${model1.order.maxPrice}之间`,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.key === "tare") {
|
if (item.key === "tare") {
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="c-card">
|
<view class="c-card app-container">
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入收货分类"
|
placeholder="请输入收货分类"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="c-card">
|
<view class="c-card app-container">
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入出货产品名称"
|
placeholder="请输入出货产品名称"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="c-card">
|
<view class="c-card app-container">
|
||||||
<view class="collapse-box box">
|
<view class="collapse-box box">
|
||||||
<view v-for="(item, index) in pageList.list" :key="index">
|
<view v-for="(item, index) in pageList.list" :key="index">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="c-card">
|
<view class="c-card app-container">
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入库存卡号"
|
placeholder="请输入库存卡号"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="c-card">
|
<view class="c-card app-container">
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<view class="type" @click="state.isShowType = true"
|
<view class="type" @click="state.isShowType = true"
|
||||||
>全部分类<u-icon name="arrow-down"></u-icon>
|
>全部分类<u-icon name="arrow-down"></u-icon>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="c-card">
|
<view class="c-card app-container">
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入供应商分类"
|
placeholder="请输入供应商分类"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="c-card">
|
<view class="c-card app-container">
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入人员名称"
|
placeholder="请输入人员名称"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<up-icon
|
<up-icon
|
||||||
name="minus"
|
name="minus"
|
||||||
@click="decrease"
|
@click="decrease"
|
||||||
:size="14"
|
:size="22"
|
||||||
color="rgba(0,0,0,0.25)"
|
color="rgba(0,0,0,0.25)"
|
||||||
></up-icon>
|
></up-icon>
|
||||||
<input
|
<input
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
<up-icon
|
<up-icon
|
||||||
name="plus"
|
name="plus"
|
||||||
@click="increase"
|
@click="increase"
|
||||||
:size="14"
|
:size="22"
|
||||||
color="rgba(0,0,0,0.25)"
|
color="rgba(0,0,0,0.25)"
|
||||||
></up-icon>
|
></up-icon>
|
||||||
</view>
|
</view>
|
||||||
|
@ -31,7 +31,7 @@ const props = defineProps<{
|
||||||
}>();
|
}>();
|
||||||
const emit = defineEmits(["changeValue"]);
|
const emit = defineEmits(["changeValue"]);
|
||||||
const num = ref(props.value);
|
const num = ref(props.value);
|
||||||
const handleInput = (event) => {
|
const handleInput = (event:any) => {
|
||||||
const value = parseInt(event.target.value);
|
const value = parseInt(event.target.value);
|
||||||
if (!isNaN(value) && value >= 1) {
|
if (!isNaN(value) && value >= 1) {
|
||||||
num.value = value;
|
num.value = value;
|
||||||
|
@ -59,7 +59,7 @@ const decrease = () => {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-items: center;
|
justify-items: center;
|
||||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
padding: 0rpx 8rpx;
|
padding: 4px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
margin: 0rpx 16rpx;
|
margin: 0rpx 16rpx;
|
||||||
.uni-input {
|
.uni-input {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<block v-if="Object.keys(state.formData).length > 0">
|
<view v-if="Object.keys(state.formData).length > 0" class="app-container">
|
||||||
<view class="title">终端机自动打单配置</view>
|
<view class="title">终端机自动打单配置</view>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view
|
<view
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
<view
|
<view
|
||||||
>收货-待审核联单打印<AvatarInput
|
>收货-待审核联单打印<AvatarInput
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="7"
|
:max="5"
|
||||||
:value="state.formData.manualPrintAudit"
|
:value="state.formData.manualPrintAudit"
|
||||||
@changeValue="
|
@changeValue="
|
||||||
(v) => {
|
(v) => {
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
<view
|
<view
|
||||||
>收货-已审核联单打印<AvatarInput
|
>收货-已审核联单打印<AvatarInput
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="7"
|
:max="5"
|
||||||
:value="state.formData.manualPrintAudited"
|
:value="state.formData.manualPrintAudited"
|
||||||
@changeValue="
|
@changeValue="
|
||||||
(v) => {
|
(v) => {
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
<view
|
<view
|
||||||
>出货-待结算联单打印<AvatarInput
|
>出货-待结算联单打印<AvatarInput
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="7"
|
:max="5"
|
||||||
:value="state.formData.manualPrintToBeSettled"
|
:value="state.formData.manualPrintToBeSettled"
|
||||||
@changeValue="
|
@changeValue="
|
||||||
(v) => {
|
(v) => {
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
<view
|
<view
|
||||||
>出货-已结算联单打印<AvatarInput
|
>出货-已结算联单打印<AvatarInput
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="7"
|
:max="5"
|
||||||
:value="state.formData.manualPrintSettled"
|
:value="state.formData.manualPrintSettled"
|
||||||
@changeValue="
|
@changeValue="
|
||||||
(v) => {
|
(v) => {
|
||||||
|
@ -112,6 +112,7 @@
|
||||||
></view>
|
></view>
|
||||||
<view
|
<view
|
||||||
v-for="item in state.formData.devices"
|
v-for="item in state.formData.devices"
|
||||||
|
v-if="state.formData.autoSettlement"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
style="padding: 8rpx 44rpx"
|
style="padding: 8rpx 44rpx"
|
||||||
>{{ item.deviceName }}
|
>{{ item.deviceName }}
|
||||||
|
@ -128,7 +129,7 @@
|
||||||
天后自动结算</view
|
天后自动结算</view
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</view>
|
||||||
|
|
||||||
<view class="btn-box-fix-btn">
|
<view class="btn-box-fix-btn">
|
||||||
<u-button
|
<u-button
|
||||||
|
@ -198,6 +199,7 @@ const handleSave = () => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "设置更新成功",
|
title: "设置更新成功",
|
||||||
});
|
});
|
||||||
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -206,7 +208,7 @@ const showSelect = () => {
|
||||||
state.show = true;
|
state.show = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectClick = (v:any) => {
|
const selectClick = (v: any) => {
|
||||||
state.formData.settlementConfig = v.id;
|
state.formData.settlementConfig = v.id;
|
||||||
state.show = false;
|
state.show = false;
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,13 +8,22 @@
|
||||||
:checked="item.templateDeleted"
|
:checked="item.templateDeleted"
|
||||||
:activeColor="'#00D2E3'"
|
:activeColor="'#00D2E3'"
|
||||||
:usedAlone="true"
|
:usedAlone="true"
|
||||||
@change="(v) => {item.templateDeleted = v}"
|
@change="
|
||||||
|
(v:any) => {
|
||||||
|
item.templateDeleted = v;
|
||||||
|
}
|
||||||
|
"
|
||||||
>
|
>
|
||||||
</up-checkbox>
|
</up-checkbox>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn-box-fix-btn">
|
<view class="btn-box-fix-btn">
|
||||||
<u-button type="primary" text="保存" shape="circle" @click="handleSave"></u-button>
|
<u-button
|
||||||
|
type="primary"
|
||||||
|
text="保存"
|
||||||
|
shape="circle"
|
||||||
|
@click="handleSave"
|
||||||
|
></u-button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
@ -22,17 +31,20 @@ import { onLoad } from "@dcloudio/uni-app";
|
||||||
import { OtherConfigApi } from "@/services/index";
|
import { OtherConfigApi } from "@/services/index";
|
||||||
|
|
||||||
const title = ref("");
|
const title = ref("");
|
||||||
const list = ref([]);
|
const list: any = ref([]);
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
OtherConfigApi.updatePrintTemplate({printTemplatePos: list.value}).then(res => {
|
OtherConfigApi.updatePrintTemplate({ printTemplatePos: list.value }).then(
|
||||||
if(res.code === 200) {
|
(res) => {
|
||||||
uni.showToast({
|
if (res.code === 200) {
|
||||||
title: "设置更新成功",
|
uni.showToast({
|
||||||
});
|
title: "设置更新成功",
|
||||||
|
});
|
||||||
|
uni.navigateBack();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
}
|
};
|
||||||
onLoad((option: any) => {
|
onLoad((option: any) => {
|
||||||
// 设置页面标题
|
// 设置页面标题
|
||||||
if (option.key) {
|
if (option.key) {
|
||||||
|
|
|
@ -140,7 +140,7 @@ const getCode = () => {
|
||||||
(res: any) => {
|
(res: any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
store.setMechanismCode(res.data[0].mechanismCode);
|
store.setMechanism({mechanismCode: res.data[0].mechanismCode, mechanismName: res.data[0].mechanismName});
|
||||||
sendMsg();
|
sendMsg();
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="baseinfo">
|
<view class="baseinfo">
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view> 姓名: {{ profile.userName }} </view>
|
<view> 姓名: {{ profile.name }} </view>
|
||||||
<view> 性别: {{ profile.gender ? (profile.gender === 1 ? '男' : '女') :'未知' }} </view>
|
<view> 性别: {{ profile.gender ? (profile.gender === 1 ? '男' : '女') :'未知' }} </view>
|
||||||
<view> 手机号码: {{ profile.phone }} </view>
|
<view> 手机号码: {{ profile.phone }} </view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="c-card">
|
<view class="c-card app-container">
|
||||||
<u-form
|
<u-form
|
||||||
labelPosition="left"
|
labelPosition="left"
|
||||||
:model="model1"
|
:model="model1"
|
||||||
|
@ -111,7 +111,11 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="btn-box">
|
<view class="btn-box">
|
||||||
<u-button text="暂不定价" @click="handleBack()"></u-button>
|
<u-button text="暂不定价" @click="handleBack()"></u-button>
|
||||||
<u-button type="primary" text="保存" @click="save()"></u-button>
|
<u-button
|
||||||
|
type="primary"
|
||||||
|
:text="title === '定价详情' ? '定价' : '保存'"
|
||||||
|
@click="save()"
|
||||||
|
></u-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 收货产品弹框 -->
|
<!-- 收货产品弹框 -->
|
||||||
|
@ -188,17 +192,6 @@ const handleInput = (e: any, item: any) => {
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (item.key === "price") {
|
|
||||||
if (model1.order.minPrice && model1.order.maxPrice) {
|
|
||||||
if (temp < model1.order.minPrice || temp > model1.order.maxPrice) {
|
|
||||||
uni.showToast({
|
|
||||||
title: `${item.name}应在${model1.order.minPrice}-${model1.order.maxPrice}之间`,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
model1.order[item.key] = temp;
|
model1.order[item.key] = temp;
|
||||||
|
@ -674,18 +667,6 @@ const save = () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (model1.order.minPrice && model1.order.maxPrice) {
|
|
||||||
if (
|
|
||||||
parseFloat(model1.order.price + "") < parseFloat(model1.order.minPrice) ||
|
|
||||||
parseFloat(model1.order.price + "") > parseFloat(model1.order.maxPrice)
|
|
||||||
) {
|
|
||||||
uni.showToast({
|
|
||||||
title: `单价应在${model1.order.minPrice}-${model1.order.maxPrice}之间`,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (
|
if (
|
||||||
model1.order.grossWeight?.toString() &&
|
model1.order.grossWeight?.toString() &&
|
||||||
model1.order.grossWeight?.toString()[
|
model1.order.grossWeight?.toString()[
|
||||||
|
@ -766,22 +747,28 @@ const updateOrder = () => {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 0:有皮重 1:零皮重
|
// 0:有皮重 1:零皮重
|
||||||
uni.redirectTo({
|
uni.navigateBack();
|
||||||
url: "/pagesHome/index", // 要跳转到的页面路径
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const prePage = ref("");
|
const prePage = ref("");
|
||||||
onLoad((option) => {
|
const title = ref("")
|
||||||
model1.order.id = parseInt((option as any).id);
|
onLoad((option: any) => {
|
||||||
prePage.value = (option as any).prePage;
|
model1.order.id = parseInt(option.id);
|
||||||
|
prePage.value = option.prePage;
|
||||||
|
title.value = option.title
|
||||||
|
|
||||||
if (prePage.value) {
|
if (prePage.value) {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: "编辑信息",
|
title: "编辑信息",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (option.title) {
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: option.title,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (model1.order.id) {
|
if (model1.order.id) {
|
||||||
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
|
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入供应商名称"
|
placeholder="请输入供应商名称"
|
||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
:focus="true"
|
|
||||||
bgColor="#fff"
|
bgColor="#fff"
|
||||||
clearable
|
clearable
|
||||||
:showAction="false"
|
:showAction="false"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入供应商名称"
|
placeholder="请输入供应商名称"
|
||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
:focus="true"
|
|
||||||
bgColor="#fff"
|
bgColor="#fff"
|
||||||
clearable
|
clearable
|
||||||
:showAction="false"
|
:showAction="false"
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<text class="name"
|
<text class="name"
|
||||||
>{{ item.userName }} / {{ item.cardNumber }}</text
|
>{{ item.userName }} <text v-if="item.cardNumber"> / {{ item.cardNumber }}</text></text
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -111,6 +111,7 @@ import PageView from "@/components/PageView/index.vue";
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import { DeviceType, ScaleStatus } from "@/utils/enum";
|
import { DeviceType, ScaleStatus } from "@/utils/enum";
|
||||||
import _ from "underscore";
|
import _ from "underscore";
|
||||||
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
|
|
||||||
const stateNew = reactive<any>({
|
const stateNew = reactive<any>({
|
||||||
keywoard: "",
|
keywoard: "",
|
||||||
|
@ -183,8 +184,8 @@ const pricingDetail = (id: number) => {
|
||||||
resetPageList();
|
resetPageList();
|
||||||
getList();
|
getList();
|
||||||
} else {
|
} else {
|
||||||
uni.redirectTo({
|
uni.navigateTo({
|
||||||
url: "/pagesReceive/form/pricingForm?id=" + id, // 要跳转到的页面路径
|
url: `/pagesReceive/form/pricingForm?id=${id}&title=${state.scaleStatus === 0 ? '定价' : '编辑'}详情`, // 要跳转到的页面路径
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -227,9 +228,10 @@ const handleOk = () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onShow(() => {
|
||||||
|
resetPageList();
|
||||||
getList();
|
getList();
|
||||||
});
|
})
|
||||||
|
|
||||||
onLoad((option) => {
|
onLoad((option) => {
|
||||||
// 接收传递的标题参数
|
// 接收传递的标题参数
|
||||||
|
|
|
@ -13,11 +13,8 @@
|
||||||
>
|
>
|
||||||
<view class="time">{{ item.createTime }}</view>
|
<view class="time">{{ item.createTime }}</view>
|
||||||
<text class="tip">{{ getType(item.imagesType) }}过磅</text>
|
<text class="tip">{{ getType(item.imagesType) }}过磅</text>
|
||||||
<image
|
<image :src="item.url || `${url}/static/110/error.jpg`" :mode="'widthFix'" @click="showImage(index)">
|
||||||
:src="item.url"
|
</image>
|
||||||
:mode="'widthFix'"
|
|
||||||
@click="showImage(index)"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</up-col>
|
</up-col>
|
||||||
</up-row>
|
</up-row>
|
||||||
|
@ -31,6 +28,7 @@
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import { PictureApi } from "@/services/index";
|
import { PictureApi } from "@/services/index";
|
||||||
import { ImagesType } from "@/utils/enum";
|
import { ImagesType } from "@/utils/enum";
|
||||||
|
import { url } from "@/utils/data";
|
||||||
let list: any = ref([]);
|
let list: any = ref([]);
|
||||||
const getType = (v: number) => {
|
const getType = (v: number) => {
|
||||||
if (v === ImagesType.Tare) {
|
if (v === ImagesType.Tare) {
|
||||||
|
@ -42,12 +40,12 @@ const getType = (v: number) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const showImage = ( index:number) => {
|
const showImage = (index: number) => {
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls: list.value.map((item:any) => item.url), // 图片列表
|
urls: list.value.map((item: any) => item.url || `${url}/static/110/error.jpg`), // 图片列表
|
||||||
current: index, // 当前显示图片的索引
|
current: index, // 当前显示图片的索引
|
||||||
indicator: "default", // 图片指示器样式,默认为圆点
|
indicator: "default", // 图片指示器样式,默认为圆点
|
||||||
loop:true,
|
loop: true,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
onLoad((option: any) => {
|
onLoad((option: any) => {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入客户名称"
|
placeholder="请输入客户名称"
|
||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
:focus="true"
|
|
||||||
bgColor="#fff"
|
bgColor="#fff"
|
||||||
clearable
|
clearable
|
||||||
:showAction="false"
|
:showAction="false"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入客户名称"
|
placeholder="请输入客户名称"
|
||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
:focus="true"
|
|
||||||
bgColor="#fff"
|
bgColor="#fff"
|
||||||
clearable
|
clearable
|
||||||
:showAction="false"
|
:showAction="false"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<u-search
|
<u-search
|
||||||
placeholder="请输入客户名称"
|
placeholder="请输入客户名称"
|
||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
:focus="true"
|
|
||||||
bgColor="#fff"
|
bgColor="#fff"
|
||||||
clearable
|
clearable
|
||||||
:showAction="false"
|
:showAction="false"
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<text class="name"
|
<text class="name"
|
||||||
>{{ item.userName }} / {{ item.cardNumber }}</text
|
>{{ item.userName }} <text v-if="item.cardNumber"> / {{ item.cardNumber }}</text></text
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -38,7 +38,11 @@ body {
|
||||||
max-height: 600rpx;
|
max-height: 600rpx;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
.app-container {
|
||||||
|
height: calc(100vh - 70px);
|
||||||
|
overflow: scroll;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
.btn-box-fix-btn {
|
.btn-box-fix-btn {
|
||||||
margin-top: 60rpx;
|
margin-top: 60rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -24,7 +24,6 @@ export const useMemberStore = defineStore(
|
||||||
profile.value.menusNameList = _.pluck(val.menusList, "name");
|
profile.value.menusNameList = _.pluck(val.menusList, "name");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const setErr = (v: any) => {
|
const setErr = (v: any) => {
|
||||||
profile.value.err = v;
|
profile.value.err = v;
|
||||||
};
|
};
|
||||||
|
@ -42,9 +41,12 @@ export const useMemberStore = defineStore(
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const mechanismCode = ref<string>();
|
const mechanism = ref<any>({
|
||||||
const setMechanismCode = (v:string) => {
|
mechanismCode: "",
|
||||||
mechanismCode.value = v
|
mechanismName: "",
|
||||||
|
});
|
||||||
|
const setMechanism = (v: { mechanismCode: ""; mechanismName: "" }) => {
|
||||||
|
mechanism.value = v;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 记得 return
|
// 记得 return
|
||||||
|
@ -53,8 +55,8 @@ export const useMemberStore = defineStore(
|
||||||
setProfile,
|
setProfile,
|
||||||
setErr,
|
setErr,
|
||||||
clearProfile,
|
clearProfile,
|
||||||
mechanismCode,
|
mechanism,
|
||||||
setMechanismCode
|
setMechanism,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,8 @@ const obj = {
|
||||||
options.header["x-userToken"] = token;
|
options.header["x-userToken"] = token;
|
||||||
}
|
}
|
||||||
if (options.url.indexOf("/api/db/getCommonDbPhone") === -1) {
|
if (options.url.indexOf("/api/db/getCommonDbPhone") === -1) {
|
||||||
options.header["mechanismCode"] = store.mechanismCode;
|
options.header["mechanismCode"] = store.mechanism.mechanismCode;
|
||||||
|
options.header["mechanismName"] = store.mechanism.mechanismName;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -67,7 +68,7 @@ export const http = <T>(options: UniApp.RequestOptions) => {
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
timeout: 1800000,
|
timeout: 1800000,
|
||||||
url: baseUrl + '/test/sh0001' + options.url, //仅为示例,非真实的接口地址
|
url: options.url, //仅为示例,非真实的接口地址
|
||||||
fileType: "image",
|
fileType: "image",
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
files: (options as any).data.files,
|
files: (options as any).data.files,
|
||||||
|
|
|
@ -269,7 +269,15 @@ export function formatMoney(
|
||||||
export function countDots(str: any) {
|
export function countDots(str: any) {
|
||||||
return (str.match(/\./g) || []).length;
|
return (str.match(/\./g) || []).length;
|
||||||
}
|
}
|
||||||
|
export function isTwoDecimalPlaces(num:any) {
|
||||||
|
// 转换为字符串并移除可能的符号
|
||||||
|
const str = num.toString().replace(/[-]+/g, '');
|
||||||
|
// 分割整数部分和小数部分
|
||||||
|
const parts = str.split('.');
|
||||||
|
console.log(parts)
|
||||||
|
// 如果小数点后有两位数字,返回true
|
||||||
|
return parts.length === 2 && parts[1].length > 2;
|
||||||
|
}
|
||||||
export function validateRegex(regexValue: string, value: string) {
|
export function validateRegex(regexValue: string, value: string) {
|
||||||
const regex = new RegExp(regexValue);
|
const regex = new RegExp(regexValue);
|
||||||
return regex.test(value);
|
return regex.test(value);
|
||||||
|
|
|
@ -26,6 +26,10 @@ const valid = {
|
||||||
pattern: /[^0-9.]/g,
|
pattern: /[^0-9.]/g,
|
||||||
message: "请输入正确的数字",
|
message: "请输入正确的数字",
|
||||||
},
|
},
|
||||||
|
valid_decimal2: {
|
||||||
|
pattern: /([1-9]+[\d]*(\.[0-9]{0,2})?)/,
|
||||||
|
message: "请输入正确的数字",
|
||||||
|
},
|
||||||
valid_id_card: {
|
valid_id_card: {
|
||||||
pattern:
|
pattern:
|
||||||
/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
||||||
|
|
Loading…
Reference in New Issue