This commit is contained in:
LHG 2025-04-28 14:18:48 +08:00
commit ffcfa49df4
8 changed files with 134 additions and 155 deletions

View File

@ -450,6 +450,11 @@ const regionConfigInfo = (record) => {
const handleOkConfgModal = () => { const handleOkConfgModal = () => {
formModelConfig.value.formSave((data => { formModelConfig.value.formSave((data => {
openConfig.value = false; openConfig.value = false;
if (data['code'] == 200) {
getData()
} else {
message.error(data.message)
}
})); }));
} }

View File

@ -9,7 +9,7 @@
<a-col :xs="24"> <a-col :xs="24">
<a-form-item <a-form-item
required required
name="isOperate" name="onlineService"
:rules="[{ required: true, message: '请选择在线客服' }]" :rules="[{ required: true, message: '请选择在线客服' }]"
:label-col="{ sm: { span: 4 }}" :label-col="{ sm: { span: 4 }}"
:wrapper-Col="{span: 24 }" :wrapper-Col="{span: 24 }"
@ -21,9 +21,8 @@
</a-tooltip> </a-tooltip>
</template> </template>
<a-radio-group <a-radio-group
v-model:value="form.authentication" v-model:value="form.onlineService"
name="radioGroup" name="radioGroup"
@change="changeIsOperate"
> >
<a-radio value="1">开启</a-radio> <a-radio value="1">开启</a-radio>
<a-radio value="2">关闭</a-radio> <a-radio value="2">关闭</a-radio>
@ -116,18 +115,8 @@ import { getGUID } from '@/utils/tools';
import { TimeRangePicker } from 'ant-design-vue' import { TimeRangePicker } from 'ant-design-vue'
import _ from 'lodash' import _ from 'lodash'
const formRef = ref(); const formRef = ref();
const time = ref(false);
const week = ref(false);
const showoperateTime = ref(false);
const form = ref({ const form = ref({
isOperate: "1",
operateType: "1",
outageNotice: "",
accessChannel: "",
operateTimeBytime: "",
customerServiceConfig: [] customerServiceConfig: []
}); });
const columns = ref([ const columns = ref([
@ -162,10 +151,6 @@ const columns = ref([
fixed: 'right', fixed: 'right',
}]) }])
const changeIsOperate = () => {
}
const addRecord = () => { const addRecord = () => {
form.value.customerServiceConfig.push({ form.value.customerServiceConfig.push({
key: getGUID(), key: getGUID(),
@ -190,32 +175,11 @@ const remove = (val, filed, array) => {
} }
const changeOperateType = (data) => {
const value = data.target.value;
if (value == "2") {
showoperateTime.value = true;
time.value = true;
week.value = false;
} else if (value == "3") {
showoperateTime.value = true;
week.value = true;
time.value = false;
} else {
week.value = false;
time.value = false;
showoperateTime.value = false;
}
}
const validateForm = async () => { const validateForm = async () => {
try {
// await formRef.value.validate();
await formRef.value.validate(); form.value.tableName = 'ebikeSysLinktelDto'
// return form.value;
console.log("表单验证通过");
} catch (error) {
}
} }
defineExpose({ defineExpose({
validateForm validateForm

View File

@ -157,9 +157,6 @@
<script setup> <script setup>
import { ref, defineProps } from 'vue' import { ref, defineProps } from 'vue'
const formRef = ref(); const formRef = ref();
const time = ref(false);
const week = ref(false);
const showoperateTime = ref(false);
const form = ref({}); const form = ref({});
const autoReturn = ref(false); const autoReturn = ref(false);
const autoLock = ref(false); const autoLock = ref(false);
@ -178,32 +175,10 @@ const changeAutoReturnType = (e) => {
} }
} }
const changeOperateType = (data) => {
const value = data.target.value;
if (value == "2") {
showoperateTime.value = true;
time.value = true;
week.value = false;
} else if (value == "3") {
showoperateTime.value = true;
week.value = true;
time.value = false;
} else {
week.value = false;
time.value = false;
showoperateTime.value = false;
}
}
const validateForm = async () => { const validateForm = async () => {
try { await formRef.value.validate();
// form.value.tableName = 'ebikeSysrlocksetDto'
await formRef.value.validate(); return form.value;
//
console.log("表单验证通过");
} catch (error) {
}
} }
defineExpose({ defineExpose({
validateForm validateForm

View File

@ -69,21 +69,40 @@ const openForm = (params = {}) => {
} }
}; };
const formSave = () => { const formSave = (onCallBack) => {
const forms = [switchForm, operateForm, useCarForm, lockCarForm, returnCarForm, customerServiceForm]; const forms = [switchForm, operateForm, useCarForm, lockCarForm, returnCarForm, customerServiceForm];
let flag = false; let params = {};
for (let form of forms) { // Promise
const validationPromises = forms.map(form => {
if (form.value) { if (form.value) {
form.value.validateForm().then(res => { return form.value.validateForm().then(res => {
debugger const tableName = res['tableName'];
}).catch(() => { if (tableName == "ebikeSysLinktelDto") {
flag = true; params['ebikeSysRoperatesetDto'] = { ...params['ebikeSysRoperatesetDto'], onlineService: res['onlineService'] };
params[tableName] = res['customerServiceConfig'];
} else {
delete res['tableName'];
params[tableName] = res;
}
}).catch((e) => {
return Promise.reject(e);
}); });
} }
} });
if (!flag) { // 使 Promise.all
Promise.all(validationPromises).then(() => {
} tipContent.value = "保存中..."
spinning.value = true;
callOperate("/ebikeSysRoperateset/save", params).then(res => {
spinning.value = false;
if (onCallBack) {
res.data = params;
onCallBack(res);
}
})
}).catch(error => {
console.log(error);
});
}; };
defineExpose({ openForm, formSave }); defineExpose({ openForm, formSave });

View File

@ -655,6 +655,7 @@
v-model:value="amountInput" v-model:value="amountInput"
placeholder="请输入充值金额" placeholder="请输入充值金额"
type="number" type="number"
:rules="[]"
/> />
<a-button <a-button
style="margin-left: 20px;" style="margin-left: 20px;"
@ -693,7 +694,9 @@ import _ from 'lodash'
const amountInput = ref(); const amountInput = ref();
const formRef = ref(); const formRef = ref();
const form = ref({}); const form = ref({
rechargeRule: []
});
const extraText = ref(""); const extraText = ref("");
const showFirstFreeAmount = ref(false); const showFirstFreeAmount = ref(false);
const orderAppeal = ref(false); const orderAppeal = ref(false);
@ -737,7 +740,7 @@ const changeEnableRecharge = (e) => {
showRechargeRule.value = true showRechargeRule.value = true
} else { } else {
showRechargeRule.value = false showRechargeRule.value = false
form.value.rechargeRule = null; form.value.rechargeRule = [];
} }
} }
@ -747,7 +750,8 @@ const changeBalanceRefund = (e) => {
showBalanceRefund.value = true showBalanceRefund.value = true
} else { } else {
showBalanceRefund.value = false showBalanceRefund.value = false
form.value.rechargeRule = null; form.value.BalanceAutomaticRefund = null;
form.value.deductionGift = null;
} }
} }
@ -789,12 +793,9 @@ const remove = (val, filed, array) => {
} }
const validateForm = async () => { const validateForm = async () => {
try { await formRef.value.validate();
await formRef.value.validate(); form.value.tableName = 'ebikeSysRoperatesetDto'
return form.value; return form.value;
} catch (error) {
}
} }
defineExpose({ defineExpose({
validateForm validateForm

View File

@ -208,7 +208,10 @@
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col v-if="showDistance" :xs="12"> <a-col
v-if="showDistance"
:xs="12"
>
<a-form-item <a-form-item
required required
name="distance" name="distance"
@ -244,12 +247,61 @@
<a-radio-group <a-radio-group
v-model:value="form.freeDispatchStudy" v-model:value="form.freeDispatchStudy"
name="radioGroup" name="radioGroup"
@change="changeFreeDispatchStudy"
> >
<a-radio value="1"></a-radio> <a-radio value="1"></a-radio>
<a-radio value="2"></a-radio> <a-radio value="2"></a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col
v-if="isFreeDispatchStudy"
:xs="12"
>
<a-form-item
required
label="学习免调度费次数"
name="freeDispatchCount"
:rules="[{ required: true, message: '请输入学习免调度费次数' }]"
>
<a-input
v-model:value="form.freeDispatchCount"
placeholder="请输入学习免调度费次数"
type="number"
/>
</a-form-item>
</a-col>
<a-col
v-if="isFreeDispatchStudy"
:xs="12"
>
<a-form-item
required
name="freeFeturnType"
:rules="[{ required: true, message: '请选择学习免调度费还车类型' }]"
:label-col="{ sm: { span: 10 }}"
:wrapper-Col="{span: 24 }"
>
<template #label>
学习免调度费还车类型
<a-tooltip title="允许用户可以通过学习还车规则,免调度费还车的不规范还车类型">
<QuestionCircleOutlined style="margin-left: 5px;color: rgb(192,192,192);" />
</a-tooltip>
</template>
<a-select
v-model:value="form.freeFeturnType"
mode="multiple"
style="width: 100%"
placeholder="请选择"
:max-tag-count="1"
>
<a-select-option value="1">不在运营区</a-select-option>
<a-select-option value="2">不在停车区</a-select-option>
<a-select-option value="3">禁停区</a-select-option>
<a-select-option value="4">道钉还车</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row> </a-row>
<a-row :gutter="8"> <a-row :gutter="8">
<a-col :xs="12"> <a-col :xs="12">
@ -282,13 +334,12 @@
<script setup> <script setup>
import { ref, defineProps } from 'vue' import { ref, defineProps } from 'vue'
const formRef = ref(); const formRef = ref();
const time = ref(false);
const week = ref(false);
const showoperateTime = ref(false);
const form = ref({}); const form = ref({});
const showAngularOffsetError = ref(false); const showAngularOffsetError = ref(false);
const isIgnoreRegular = ref(false); const isIgnoreRegular = ref(false);
const showDistance = ref(false); const showDistance = ref(false);
const isFreeDispatchStudy = ref(false);
const changeParkNinety = (e) => { const changeParkNinety = (e) => {
const value = e.target.value; const value = e.target.value;
@ -296,6 +347,7 @@ const changeParkNinety = (e) => {
showAngularOffsetError.value = true; showAngularOffsetError.value = true;
} else { } else {
showAngularOffsetError.value = false; showAngularOffsetError.value = false;
form.value.angularOffsetError = null;
} }
} }
@ -305,44 +357,35 @@ const changeLocation = (e) => {
showDistance.value = true; showDistance.value = true;
} else { } else {
showDistance.value = false; showDistance.value = false;
form.value.distance = null;
} }
} }
const changeFreeDispatchStudy = (e) => {
const value = e.target.value;
if (value == '1') {
isFreeDispatchStudy.value = true;
} else {
isFreeDispatchStudy.value = false;
form.value.freeFeturnType = null;
form.value.freeDispatchCount = null;
}
}
const changeIgnoreRegular = (e) => { const changeIgnoreRegular = (e) => {
const value = e.target.value; const value = e.target.value;
if (value == '1') { if (value == '1') {
isIgnoreRegular.value = true; isIgnoreRegular.value = true;
} else { } else {
isIgnoreRegular.value = false; isIgnoreRegular.value = false;
} form.value.ignoreRegularErrorCount = null;
} form.value.ignoreRegularType = null;
const changeOperateType = (data) => {
const value = data.target.value;
if (value == "2") {
showoperateTime.value = true;
time.value = true;
week.value = false;
} else if (value == "3") {
showoperateTime.value = true;
week.value = true;
time.value = false;
} else {
week.value = false;
time.value = false;
showoperateTime.value = false;
} }
} }
const validateForm = async () => { const validateForm = async () => {
try { await formRef.value.validate();
// form.value.tableName = 'ebikeSysRbacksetDto'
await formRef.value.validate(); return form.value;
//
console.log("表单验证通过");
} catch (error) {
}
} }
defineExpose({ defineExpose({
validateForm validateForm

View File

@ -221,7 +221,6 @@
<script setup> <script setup>
import { ref, defineProps } from 'vue' import { ref, defineProps } from 'vue'
import { TimeRangePicker } from 'ant-design-vue' import { TimeRangePicker } from 'ant-design-vue'
import { TimePicker } from 'ant-design-vue'
import { getGUID } from '@/utils/tools'; import { getGUID } from '@/utils/tools';
import _ from 'lodash' import _ from 'lodash'
@ -312,12 +311,10 @@ const changeOperateType = (data) => {
} }
const validateForm = async () => { const validateForm = async () => {
try {
await formRef.value.validate();
return form.value;
} catch (error) {
} await formRef.value.validate();
form.value.tableName = 'ebikeSysRoperatesetDto'
return form.value;
} }
defineExpose({ defineExpose({
validateForm validateForm

View File

@ -304,7 +304,7 @@
</a-tooltip> </a-tooltip>
</template> </template>
<a-input <a-input
v-model:value="form.freeDuration" v-model:value="form.poweroffCapcity"
placeholder="请输入低电骑行断电电量" placeholder="请输入低电骑行断电电量"
type="number" type="number"
/> />
@ -472,7 +472,7 @@
:wrapper-Col="{span: 24 }" :wrapper-Col="{span: 24 }"
> >
<a-input <a-input
v-model:value="form.useOutTime" v-model:value="form.outTempPoweredOnTime"
placeholder="请输入区域外临时通电时间" placeholder="请输入区域外临时通电时间"
type="number" type="number"
/> />
@ -767,9 +767,6 @@
<script setup> <script setup>
import { ref, defineProps } from 'vue' import { ref, defineProps } from 'vue'
const formRef = ref(); const formRef = ref();
const time = ref(false);
const week = ref(false);
const showoperateTime = ref(false);
const showMinimumAmount = ref(false); const showMinimumAmount = ref(false);
const form = ref({}); const form = ref({});
const prefixText = ref(""); const prefixText = ref("");
@ -864,32 +861,10 @@ const changeMinimumAmount = (e) => {
} }
} }
const changeOperateType = (data) => {
const value = data.target.value;
if (value == "2") {
showoperateTime.value = true;
time.value = true;
week.value = false;
} else if (value == "3") {
showoperateTime.value = true;
week.value = true;
time.value = false;
} else {
week.value = false;
time.value = false;
showoperateTime.value = false;
}
}
const validateForm = async () => { const validateForm = async () => {
try { await formRef.value.validate();
// form.value.tableName = 'ebikeSysRusecondsetDto'
await formRef.value.validate(); return form.value;
//
console.log("表单验证通过");
} catch (error) {
}
} }
defineExpose({ defineExpose({
validateForm validateForm