feat: 收银台

pull/12/head
xingyu 2023-05-11 14:42:59 +08:00
parent aede08cbba
commit 5ecc18901a
5 changed files with 193 additions and 208 deletions

View File

@ -20,217 +20,201 @@
</a> </a>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts" setup name="RuleProps">
import { ref, defineComponent } from 'vue' import { ref } from 'vue'
import { remove } from '../../../utils' import { remove } from '../../../utils'
import { useFormDesignState } from '../../../hooks/useFormDesignState' import { useFormDesignState } from '../../../hooks/useFormDesignState'
import { isArray } from 'lodash-es' import { isArray } from 'lodash-es'
import { Form, FormItem, AutoComplete, Input } from 'ant-design-vue' import { Form, FormItem, AutoComplete, Input } from 'ant-design-vue'
import Icon from '@/components/Icon' import { Icon } from '@/components/Icon'
export default defineComponent({ //
name: 'RuleProps', const { formConfig } = useFormDesignState()
components: { // currentItem
Form, /**
FormItem, * 添加正则校验判断当前组件的rules是不是数组如果不是数组使用set方法重置成数组然后添加正则校验
AutoComplete, */
Input, const addRules = () => {
Icon if (!isArray(formConfig.value.currentItem!.rules)) formConfig.value.currentItem!['rules'] = []
formConfig.value.currentItem!.rules?.push({ pattern: '', message: '' })
}
/**
* 删除正则校验当正则规则为0时删除rules属性
* @param index {number} 需要删除的规则下标
*/
const removeRule = (index: number) => {
remove(formConfig.value.currentItem!.rules as Array<any>, index)
if (formConfig.value.currentItem!.rules?.length === 0) delete formConfig.value.currentItem!['rules']
}
const patternDataSource = ref([
{
value: '/^(?:(?:\\+|00)86)?1[3-9]\\d{9}$/',
text: '手机号码'
}, },
setup() { {
// value: '/^((ht|f)tps?:\\/\\/)?[\\w-]+(\\.[\\w-]+)+:\\d{1,5}\\/?$/',
const { formConfig } = useFormDesignState() text: '网址带端口号'
// currentItem },
/** {
* 添加正则校验判断当前组件的rules是不是数组如果不是数组使用set方法重置成数组然后添加正则校验 value: '/^(((ht|f)tps?):\\/\\/)?[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&:/~+#-\\(\\)]*[\\w@?^=%&/~+#-\\(\\)])?$/',
*/ text: '网址带参数'
const addRules = () => { },
if (!isArray(formConfig.value.currentItem!.rules)) formConfig.value.currentItem!['rules'] = [] {
formConfig.value.currentItem!.rules?.push({ pattern: '', message: '' }) value: '/^[0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/',
} text: '统一社会信用代码'
/** },
* 删除正则校验当正则规则为0时删除rules属性 {
* @param index {number} 需要删除的规则下标 value: '/^(s[hz]|S[HZ])(000[\\d]{3}|002[\\d]{3}|300[\\d]{3}|600[\\d]{3}|60[\\d]{4})$/',
*/ text: '股票代码'
const removeRule = (index: number) => { },
remove(formConfig.value.currentItem!.rules as Array<any>, index) {
if (formConfig.value.currentItem!.rules?.length === 0) delete formConfig.value.currentItem!['rules'] value: '/^([a-f\\d]{32}|[A-F\\d]{32})$/',
} text: 'md5格式32位'
},
const patternDataSource = ref([ {
{ value: '/^[a-f\\d]{4}(?:[a-f\\d]{4}-){4}[a-f\\d]{12}$/i',
value: '/^(?:(?:\\+|00)86)?1[3-9]\\d{9}$/', text: 'GUID/UUID'
text: '手机号码' },
}, {
{ value: '/^\\d+(?:\\.\\d+){2}$/',
value: '/^((ht|f)tps?:\\/\\/)?[\\w-]+(\\.[\\w-]+)+:\\d{1,5}\\/?$/', text: '版本号x.y.z格式'
text: '网址带端口号' },
}, {
{ value: '/^https?:\\/\\/(.+\\/)+.+(\\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i',
value: '/^(((ht|f)tps?):\\/\\/)?[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&:/~+#-\\(\\)]*[\\w@?^=%&/~+#-\\(\\)])?$/', text: '视频链接地址'
text: '网址带参数' },
}, {
{ value: '/^https?:\\/\\/(.+\\/)+.+(\\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i',
value: '/^[0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/', text: '图片链接地址'
text: '统一社会信用代码' },
}, {
{ value: '/^-?\\d+(,\\d{3})*(\\.\\d{1,2})?$/',
value: '/^(s[hz]|S[HZ])(000[\\d]{3}|002[\\d]{3}|300[\\d]{3}|600[\\d]{3}|60[\\d]{4})$/', text: '数字/货币金额(支持负数、千分位分隔符)'
text: '股票代码' },
}, {
{ value: '/(?:^[1-9]([0-9]+)?(?:\\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\\.[0-9](?:[0-9])?$)/',
value: '/^([a-f\\d]{32}|[A-F\\d]{32})$/', text: '数字/货币金额'
text: 'md5格式32位' },
}, {
{ value: '/^[1-9]\\d{9,29}$/',
value: '/^[a-f\\d]{4}(?:[a-f\\d]{4}-){4}[a-f\\d]{12}$/i', text: '银行卡号'
text: 'GUID/UUID' },
}, {
{ value: '/^(?:[\u4e00-\u9fa5·]{2,16})$/',
value: '/^\\d+(?:\\.\\d+){2}$/', text: '中文姓名'
text: '版本号x.y.z格式' },
}, {
{ value: '/(^[a-zA-Z][a-zA-Z\\s]{0,20}[a-zA-Z]$)/',
value: '/^https?:\\/\\/(.+\\/)+.+(\\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i', text: '英文姓名'
text: '视频链接地址' },
}, {
{ value:
value: '/^https?:\\/\\/(.+\\/)+.+(\\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i', // eslint-disable-next-line max-len
text: '图片链接地址' '/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z](?:((\\d{5}[A-HJK])|([A-HJK][A-HJ-NP-Z0-9][0-9]{4}))|[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳])$/',
}, text: '车牌号(新能源)'
{ },
value: '/^-?\\d+(,\\d{3})*(\\.\\d{1,2})?$/', {
text: '数字/货币金额(支持负数、千分位分隔符)' value: '/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]$/',
}, text: '车牌号(非新能源)'
{ },
value: '/(?:^[1-9]([0-9]+)?(?:\\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\\.[0-9](?:[0-9])?$)/', {
text: '数字/货币金额' value: '/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/',
}, text: '车牌号(新能源+非新能源)'
{ },
value: '/^[1-9]\\d{9,29}$/', {
text: '银行卡号' value:
}, // eslint-disable-next-line max-len
{ '/^(([^<>()[\\]\\\\.,;:\\s@"]+(\\.[^<>()[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/',
value: '/^(?:[\u4e00-\u9fa5·]{2,16})$/', text: 'email(邮箱)'
text: '中文姓名' },
}, {
{ value: '/^(?:(?:\\d{3}-)?\\d{8}|^(?:\\d{4}-)?\\d{7,8})(?:-\\d+)?$/',
value: '/(^[a-zA-Z][a-zA-Z\\s]{0,20}[a-zA-Z]$)/', text: '座机'
text: '英文姓名' },
}, {
{ value: '/^[1-9]\\d{5}(?:18|19|20)\\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\\d|30|31)\\d{3}[\\dXx]$/',
value: text: '身份证号'
// eslint-disable-next-line max-len },
'/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z](?:((\\d{5}[A-HJK])|([A-HJK][A-HJ-NP-Z0-9][0-9]{4}))|[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳])$/', {
text: '车牌号(新能源)' value: '/(^[EeKkGgDdSsPpHh]\\d{8}$)|(^(([Ee][a-fA-F])|([DdSsPp][Ee])|([Kk][Jj])|([Mm][Aa])|(1[45]))\\d{7}$)/',
}, text: '护照'
{ },
value: {
'/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]$/', value:
text: '车牌号(非新能源)' // eslint-disable-next-line max-len
}, '/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/',
{ text: '中文汉字'
value: },
'/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/', {
text: '车牌号(新能源+非新能源)' value: '/^\\d+\\.\\d+$/',
}, text: '小数'
{ },
value: {
// eslint-disable-next-line max-len value: '/^\\d{1,}$/',
'/^(([^<>()[\\]\\\\.,;:\\s@"]+(\\.[^<>()[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/', text: '数字'
text: 'email(邮箱)' },
}, {
{ value: '/^[1-9][0-9]{4,10}$/',
value: '/^(?:(?:\\d{3}-)?\\d{8}|^(?:\\d{4}-)?\\d{7,8})(?:-\\d+)?$/', text: 'qq号'
text: '座机' },
}, {
{ value: '/^[A-Za-z0-9]+$/',
value: '/^[1-9]\\d{5}(?:18|19|20)\\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\\d|30|31)\\d{3}[\\dXx]$/', text: '数字字母组合'
text: '身份证号' },
}, {
{ value: '/^[a-zA-Z]+$/',
value: '/(^[EeKkGgDdSsPpHh]\\d{8}$)|(^(([Ee][a-fA-F])|([DdSsPp][Ee])|([Kk][Jj])|([Mm][Aa])|(1[45]))\\d{7}$)/', text: '英文字母'
text: '护照' },
}, {
{ value: '/^[a-z]+$/',
value: text: '小写英文字母'
// eslint-disable-next-line max-len },
'/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/', {
text: '中文汉字' value: '/^[A-Z]+$/',
}, text: '大写英文字母'
{ },
value: '/^\\d+\\.\\d+$/', {
text: '小数' value: '/^[a-zA-Z0-9_-]{4,16}$/',
}, text: '用户名校验4到16位字母数字下划线减号'
{ },
value: '/^\\d{1,}$/', {
text: '数字' value: '/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/',
}, text: '16进制颜色'
{ },
value: '/^[1-9][0-9]{4,10}$/', {
text: 'qq号' value: '/^[a-zA-Z][-_a-zA-Z0-9]{5,19}$/',
}, text: '微信号'
{ },
value: '/^[A-Za-z0-9]+$/', {
text: '数字字母组合' value: '/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\\d{4}$/',
}, text: '邮政编码(中国)'
{ },
value: '/^[a-zA-Z]+$/', {
text: '英文字母' value: '/^[^A-Za-z]*$/',
}, text: '不能包含字母'
{ },
value: '/^[a-z]+$/', {
text: '小写英文字母' value: '/^\\+?[1-9]\\d*$/',
}, text: '正整数不包含0'
{ },
value: '/^[A-Z]+$/', {
text: '大写英文字母' value: '/^-[1-9]\\d*$/',
}, text: '负整数不包含0'
{ },
value: '/^[a-zA-Z0-9_-]{4,16}$/', {
text: '用户名校验4到16位字母数字下划线减号' value: '/^-?[0-9]\\d*$/',
}, text: '整数'
{ },
value: '/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/', {
text: '16进制颜色' value: '/^(-?\\d+)(\\.\\d+)?$/',
}, text: '浮点数'
{ },
value: '/^[a-zA-Z][-_a-zA-Z0-9]{5,19}$/', {
text: '微信号' value: '/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$/',
}, text: 'email(支持中文邮箱)'
{
value: '/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\\d{4}$/',
text: '邮政编码(中国)'
},
{
value: '/^[^A-Za-z]*$/',
text: '不能包含字母'
},
{
value: '/^\\+?[1-9]\\d*$/',
text: '正整数不包含0'
},
{
value: '/^-[1-9]\\d*$/',
text: '负整数不包含0'
},
{
value: '/^-?[0-9]\\d*$/',
text: '整数'
},
{
value: '/^(-?\\d+)(\\.\\d+)?$/',
text: '浮点数'
},
{
value: '/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$/',
text: 'email(支持中文邮箱)'
}
])
return { addRules, removeRule, formConfig, patternDataSource }
} }
}) ])
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -1,5 +1,5 @@
import { DictTag } from '@/components/DictTag' import { DictTag } from '@/components/DictTag'
import Icon from '@/components/Icon' import { Icon } from '@/components/Icon'
import { Button, Tag } from 'ant-design-vue' import { Button, Tag } from 'ant-design-vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { h } from 'vue' import { h } from 'vue'

View File

@ -33,7 +33,7 @@ import { Image } from 'ant-design-vue';
</template> </template>
<script lang="ts" setup name="WxLocation"> <script lang="ts" setup name="WxLocation">
import { Image } from 'ant-design-vue' import { Image } from 'ant-design-vue'
import Icon from '@/components/Icon' import { Icon } from '@/components/Icon'
const props = defineProps({ const props = defineProps({
locationX: { locationX: {

View File

@ -3,7 +3,7 @@
<template #headerContent> <template #headerContent>
请选择公众号 请选择公众号
<div :class="`${prefixCls}__link`"> <div :class="`${prefixCls}__link`">
<Select :value="queryParams.accountId" style="width: 200px" @change="getList"> <Select :value="queryParams.accountId as any" style="width: 200px" @change="getList">
<SelectOption v-for="item in accounts" :label="item.name" :value="parseInt(item.id)" :key="parseInt(item.id)" /> <SelectOption v-for="item in accounts" :label="item.name" :value="parseInt(item.id)" :key="parseInt(item.id)" />
</Select> </Select>
<!-- <a><Icon icon="bx:bx-paper-plane" color="#1890ff" /><span>开始</span></a> <!-- <a><Icon icon="bx:bx-paper-plane" color="#1890ff" /><span>开始</span></a>
@ -42,7 +42,7 @@
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
// import Icon from '@/components/Icon' // import { Icon } from '@/components/Icon'
import { PageWrapper } from '@/components/Page' import { PageWrapper } from '@/components/Page'
import { Card, List, Image, Select, Pagination } from 'ant-design-vue' import { Card, List, Image, Select, Pagination } from 'ant-design-vue'
import { useDesign } from '@/hooks/web/useDesign' import { useDesign } from '@/hooks/web/useDesign'

View File

@ -49,6 +49,7 @@
<script lang="ts" setup name="PayOrderSubmit"> <script lang="ts" setup name="PayOrderSubmit">
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { Card, List } from 'ant-design-vue' import { Card, List } from 'ant-design-vue'
import { Icon } from '@/components/Icon'
import { Description } from '@/components/Description' import { Description } from '@/components/Description'
import { descSchema } from './submit.data' import { descSchema } from './submit.data'
import { getOrder, submitOrder } from '@/api/pay/order' import { getOrder, submitOrder } from '@/api/pay/order'