Browse Source

活动名校验

lihui/feature-20251104165712-现金二期
lihuilin 2 weeks ago
parent
commit
1fdf042aa8
  1. 50
      src/views/activityManage/activity.vue
  2. 4
      src/views/moneyManage/executor/executor.vue
  3. 12
      src/views/moneyManage/refundDetail/refundCharge.vue
  4. 12
      src/views/moneyManage/refundDetail/refundFinance.vue
  5. 12
      src/views/moneyManage/refundDetail/refundHeader.vue

50
src/views/activityManage/activity.vue

@ -71,13 +71,13 @@
</el-table>
<el-pagination v-model:current-page="pagination.pageNum" v-model:page-size="pagination.pageSize"
layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" style="margin-top: 1vh;" />
layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" style="margin-top: 1vh;" />
</el-card>
<el-dialog v-model="showAdd" width="20vw" draggable align-center style="background-color: rgb(243,250,254);">
<div class="add-item">
<el-text size="large">活动名称</el-text>
<el-input v-model="addForm.activityName" style="width: 12vw" placeholder="请输入活动名称" clearable />
<el-input v-model="addForm.activityName" style="width: 12vw" placeholder="请输入活动名称" maxlength="100" clearable />
</div>
<div class="add-item">
<el-text size="large">业绩归属</el-text>
@ -93,12 +93,12 @@
</div>
<div class="add-item">
<el-text size="large">开始时间</el-text>
<el-date-picker v-model="addForm.startTime" type="datetime" placeholder="请选择付款时间"
<el-date-picker v-model="addForm.startTime" type="datetime" placeholder="请选择开始时间"
:default-time="defaultStartTime" style="width: 12vw" />
</div>
<div class="add-item">
<el-text size="large">结束时间</el-text>
<el-date-picker v-model="addForm.endTime" type="datetime" placeholder="请选择付款时间"
<el-date-picker v-model="addForm.endTime" type="datetime" placeholder="请选择结束时间"
:default-time="defaultEndTime" style="width: 12vw" />
</div>
<div style="display: flex; justify-content: center; margin-top: 5vh;">
@ -110,7 +110,7 @@
<el-dialog v-model="showEdit" width="20vw" draggable align-center style="background-color: rgb(243,250,254);">
<div class="edit-item">
<el-text size="large">活动名称</el-text>
<el-input v-model="editForm.activityName" style="width: 12vw" placeholder="请输入活动名称" clearable />
<el-input v-model="editForm.activityName" style="width: 12vw" placeholder="请输入活动名称" maxlength="100" clearable />
</div>
<div class="edit-item">
@ -127,12 +127,12 @@
</div>
<div class="edit-item">
<el-text size="large">开始时间</el-text>
<el-date-picker v-model="editForm.startTime" type="datetime" placeholder="请选择付款时间"
<el-date-picker v-model="editForm.startTime" type="datetime" placeholder="请选择开始时间"
:default-time="defaultStartTime" style="width: 12vw" />
</div>
<div class="edit-item">
<el-text size="large">结束时间</el-text>
<el-date-picker v-model="editForm.endTime" type="datetime" placeholder="请选择付款时间"
<el-date-picker v-model="editForm.endTime" type="datetime" placeholder="请选择结束时间"
:default-time="defaultEndTime" style="width: 12vw" />
</div>
<div style="display: flex; justify-content: center; margin-top: 5vh;">
@ -141,8 +141,7 @@
</div>
</el-dialog>
<ConfirmDialog v-model="showDel" message="删除该活动数据" @confirm="handleDel()"
@cancel="hideDel" @close="hideDel" />
<ConfirmDialog v-model="showDel" message="删除该活动数据" @confirm="handleDel()" @cancel="hideDel" @close="hideDel" />
</template>
<script setup>
import { ElMessage, ElPagination } from 'element-plus';
@ -156,6 +155,8 @@ const adminStore = useAdminStore();
const { adminData, menuTree } = storeToRefs(adminStore)
import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue'
import { add } from 'lodash';
//
const activityNameReg = /^[a-zA-Z0-9\u4e00-\u9fa5\u0e00-\u0e7f\uff0c\uff0e\uff01\uff1f\uff0c\uff1b\uff1a\u201c\u201d\u2018\u2019\uff08\uff09\u300a\u300b\u3010\u3011\u2014\uff5e,.,!?:;'"()\[\]_\-&+=\s]{0,100}$/;
const tableData = ref([])
const pagination = ref({
@ -211,10 +212,9 @@ const getActivity = async function () {
}
}
const handleAdd = async function () {
if (!addForm.value.activityName) {
ElMessage.error('请输入活动名称')
return
}
const activityName = addForm.value.activityName
if (!validateActivityName(activityName)) return
if (!addForm.value.businessBelong) {
ElMessage.error('请选择业绩归属')
return
@ -256,13 +256,16 @@ const handleAdd = async function () {
startTime: null,
endTime: null,
}
} else{
} else {
ElMessage.error(res.msg || '添加失败')
return
}
}
const handleEdit = async function () {
const activityName = editForm.value.activityName
if (!validateActivityName(activityName)) return
if (!editForm.value.activityName) {
ElMessage.error('请输入活动名称')
return
@ -408,6 +411,25 @@ const hideAdd = () => {
endTime: null
}
}
const validateActivityName = (name) => {
//
if (!name.trim()) {
ElMessage.error('活动名称不能为空');
return false;
}
// 100
if (name.length > 100) {
ElMessage.error('活动名称长度不能超过100字符');
return false;
}
//
if (!activityNameReg.test(name)) {
ElMessage.error('活动名称仅支持汉字、英文字母、泰语、数字及常见标点');
return false;
}
return true;
};
onMounted(() => {
getActivity()
getmarkets()

4
src/views/moneyManage/executor/executor.vue

@ -56,7 +56,7 @@
<el-table-column type="index" label="序号" width="60" fixed="left" />
<el-table-column prop="jwcode" label="Homily ID" width="120" fixed="left" />
<el-table-column prop="name" label="姓名" width="120" fixed="left" show-overflow-tooltip />
<el-table-column prop="market" label="所属地区" width="120" />
<el-table-column prop="marketName" label="所属地区" width="120" />
<el-table-column prop="goodsName" label="产品名称" width="120" />
<el-table-column prop="goodsNum" label="产品数量" width="120" />
<el-table-column prop="refundModel" label="退款方式" width="120">
@ -166,7 +166,7 @@
</div>
<div class="dialog-item">
<el-text style="width:4vw;">提交人</el-text>
<el-input v-model="editRow.submitterName" style="width:10vw;" disabled />
<el-input v-model="editRow.submitter" style="width:10vw;" disabled />
</div>
<div class="dialog-item">
<el-text style="width:4vw;">转账凭证</el-text>

12
src/views/moneyManage/refundDetail/refundCharge.vue

@ -69,7 +69,7 @@
{{ scope.row.refundModel === 1 ? '部分退款' : '全部退款' }}
</template>
</el-table-column>
<el-table-column prop="areaServise" label="提交人" width="120" />
<el-table-column prop="submitter" label="提交人" width="120" />
<el-table-column prop="refundReason" label="退款理由" width="120" show-overflow-tooltip />
<el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip />
<el-table-column prop="status" label="订单状态" width="120">
@ -172,7 +172,7 @@
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">手续费</el-text>
<el-input v-model="auditRow.handlingCharges" size="small" style="width:10vw;" disabled />
<el-input v-model="auditRow.handlingCharge" size="small" style="width:10vw;" disabled />
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">付款时间</el-text>
@ -180,7 +180,7 @@
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">提交人</el-text>
<el-input v-model="auditRow.submitterName" size="small" style="width:10vw;" disabled />
<el-input v-model="auditRow.submitter" size="small" style="width:10vw;" disabled />
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">到账时间</el-text>
@ -222,7 +222,7 @@
<el-step>
<template #title>
<div>
提交人<br>{{ submitterName || '未知提交人' }}
提交人<br>{{ submitter || '未知提交人' }}
</div>
</template>
<template #icon>
@ -360,7 +360,7 @@ const market = ref([])
const showAudit2 = ref(false)
const tableData = ref([])
const showSteps = ref(false)
const submitterName = ref('')//
const submitter = ref('')//
const areaFinance = ref('')//
const areaCharge = ref('')//
const headFinance = ref('')//
@ -568,7 +568,7 @@ const showStep = function (row) {
}
isReject.value = false
submitterName.value = row.areaServise || ''
submitter.value = row.submitter || ''
areaFinance.value = row.areaFinance || ''
areaCharge.value = row.areaCharge || ''
headFinance.value = row.headFinance || ''

12
src/views/moneyManage/refundDetail/refundFinance.vue

@ -68,7 +68,7 @@
{{ scope.row.refundModel === 1 ? '部分退款' : '全部退款' }}
</template>
</el-table-column>
<el-table-column prop="areaServise" label="提交人" width="120" />
<el-table-column prop="submitter" label="提交人" width="120" />
<el-table-column prop="refundReason" label="退款理由" width="120" show-overflow-tooltip />
<el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip />
<el-table-column prop="status" label="订单状态" width="120">
@ -171,7 +171,7 @@
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">手续费</el-text>
<el-input v-model="auditRow.handlingCharges" size="small" style="width:10vw;" disabled />
<el-input v-model="auditRow.handlingCharge" size="small" style="width:10vw;" disabled />
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">付款时间</el-text>
@ -179,7 +179,7 @@
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">提交人</el-text>
<el-input v-model="auditRow.submitterName" size="small" style="width:10vw;" disabled />
<el-input v-model="auditRow.submitter" size="small" style="width:10vw;" disabled />
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">到账时间</el-text>
@ -221,7 +221,7 @@
<el-step>
<template #title>
<div>
提交人<br>{{ submitterName || '未知提交人' }}
提交人<br>{{ submitter || '未知提交人' }}
</div>
</template>
<template #icon>
@ -361,7 +361,7 @@ const showAudit = ref(false)
const auditRow = ref({})//
const showSteps = ref(false)
const uploadRef = ref(null)
const submitterName = ref('')//
const submitter = ref('')//
const areaFinance = ref('')//
const areaCharge = ref('')//
const headFinance = ref('')//
@ -785,7 +785,7 @@ const showStep = function (row) {
}
isReject.value = false
submitterName.value = row.areaServise || ''
submitter.value = row.submitter || ''
areaFinance.value = row.areaFinance || ''
areaCharge.value = row.areaCharge || ''
headFinance.value = row.headFinance || ''

12
src/views/moneyManage/refundDetail/refundHeader.vue

@ -69,7 +69,7 @@
{{ scope.row.refundModel === 1 ? '部分退款' : '全部退款' }}
</template>
</el-table-column>
<el-table-column prop="areaServise" label="提交人" width="120" />
<el-table-column prop="submitter" label="提交人" width="120" />
<el-table-column prop="refundReason" label="退款理由" width="120" show-overflow-tooltip />
<el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip />
<el-table-column prop="status" label="订单状态" width="120">
@ -172,7 +172,7 @@
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">手续费</el-text>
<el-input v-model="auditRow.handlingCharges" size="small" style="width:10vw;" disabled />
<el-input v-model="auditRow.handlingCharge" size="small" style="width:10vw;" disabled />
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">付款时间</el-text>
@ -180,7 +180,7 @@
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">提交人</el-text>
<el-input v-model="auditRow.submitterName" size="small" style="width:10vw;" disabled />
<el-input v-model="auditRow.submitter" size="small" style="width:10vw;" disabled />
</div>
<div class="right-item">
<el-text style="width:4vw;" size="small">到账时间</el-text>
@ -232,7 +232,7 @@
<el-step>
<template #title>
<div>
提交人<br>{{ submitterName || '未知提交人' }}
提交人<br>{{ submitter || '未知提交人' }}
</div>
</template>
<template #icon>
@ -370,7 +370,7 @@ const showAudit2 = ref(false)
const tableData = ref([])
const showSteps = ref(false)
const uploadRef = ref(null)
const submitterName = ref('')//
const submitter = ref('')//
const areaFinance = ref('')//
const areaCharge = ref('')//
const headFinance = ref('')//
@ -759,7 +759,7 @@ const showStep = function (row) {
}
isReject.value = false
submitterName.value = row.areaServise || ''
submitter.value = row.submitter || ''
areaFinance.value = row.areaFinance || ''
areaCharge.value = row.areaCharge || ''
headFinance.value = row.headFinance || ''

Loading…
Cancel
Save