From d8ef10a07b7b32a05be40cb77f629a6f9b8a0966 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期日, 19 十月 2025 13:48:48 +0800
Subject: [PATCH] feat: 1.2.0.1
---
src/views/EmploymentManage/components/AddOrEditEmploymentView.vue | 195 ++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 178 insertions(+), 17 deletions(-)
diff --git a/src/views/EmploymentManage/components/AddOrEditEmploymentView.vue b/src/views/EmploymentManage/components/AddOrEditEmploymentView.vue
index c40ec24..eb8b548 100644
--- a/src/views/EmploymentManage/components/AddOrEditEmploymentView.vue
+++ b/src/views/EmploymentManage/components/AddOrEditEmploymentView.vue
@@ -44,6 +44,8 @@
:controls="false"
v-model="form.serviceFee"
placeholder="璇疯緭鍏�"
+ :min="0"
+ :max="999999999999"
:unit="EnumBillingMethodUnitText[form.billingMethod]"
></ProFormInputNumber>
</template>
@@ -51,6 +53,37 @@
</ProFormItemV2>
</ProFormColItem>
</ProFormCol>
+ <template v-if="form.billingMethod === EnumBillingMethod.Hour">
+ <ProFormCol>
+ <ProFormColItem :span="12">
+ <ProFormItemV2 label="鏍稿畾宸ユ椂:" prop="verifyWorkHours">
+ <ProFormInputNumber
+ :controls="false"
+ v-model="form.verifyWorkHours"
+ placeholder="璇疯緭鍏ユ牳瀹氬伐鏃�"
+ :min="0"
+ :max="999999999999"
+ unit="灏忔椂/澶�"
+ ></ProFormInputNumber>
+ </ProFormItemV2>
+ </ProFormColItem>
+ </ProFormCol>
+ <ProFormCol>
+ <ProFormColItem :span="12">
+ <ProFormItemV2 label="瓒呮椂鏈嶅姟璐�:" prop="timeoutServiceFee">
+ <ProFormInputNumber
+ :controls="false"
+ v-model="form.timeoutServiceFee"
+ placeholder="璇疯緭鍏ヨ秴鏃舵湇鍔¤垂"
+ :min="0"
+ :max="999999999999"
+ unit="鍏�/灏忔椂"
+ ></ProFormInputNumber>
+ </ProFormItemV2>
+ </ProFormColItem>
+ </ProFormCol>
+ </template>
+
<ProFormCol>
<ProFormColItem :span="12">
<ProFormItemV2
@@ -62,7 +95,26 @@
v-model="form.settlementCycle"
:value-enum="EnumSettlementCycleText"
:button-style="false"
+ @change="handleSettlementCycleChange"
></ProFormRadio>
+ </ProFormItemV2>
+ </ProFormColItem>
+ </ProFormCol>
+ <ProFormCol>
+ <ProFormColItem :span="12" class="settlement-cycle-date-form-item">
+ <ProFormItemV2
+ v-if="form.settlementCycle !== EnumSettlementCycle.Day"
+ label="缁撶畻鏃ユ湡:"
+ prop="settlementCycle"
+ :check-rules="[{ message: '璇烽�夋嫨缁撶畻鏃ユ湡' }]"
+ >
+ {{ EnumSettlementCycleDateText[form.settlementCycle] }}
+ <ProFormSelect
+ v-model="form.settlementDate"
+ :value-enum="settlementDateList"
+ :button-style="false"
+ ></ProFormSelect>
+ {{ '缁撶畻' }}
</ProFormItemV2>
</ProFormColItem>
</ProFormCol>
@@ -110,17 +162,18 @@
>
<ProFormInputNumber
:controls="false"
- :min="1"
+ :min="16"
v-model="form.ageMinLimit"
placeholder="璇疯緭鍏�"
></ProFormInputNumber>
<div class="form-input-separator">鑷�</div>
<ProFormInputNumber
:controls="false"
- :min="1"
+ :min="16"
v-model="form.ageMaxLimit"
placeholder="璇疯緭鍏�"
></ProFormInputNumber>
+ 宀�
</ProFormItemV2>
</ProFormColItem>
</ProFormCol>
@@ -162,9 +215,7 @@
<ProFormItemV2
label="浠诲姟鍦扮偣:"
prop="weMapInfo"
- :check-rules="[
- { message: '璇烽�夋嫨浠诲姟鍦扮偣', validator: FormValidator.validatorWeMap },
- ]"
+ :check-rules="[{ message: '璇烽�夋嫨浠诲姟鍦扮偣', type: 'weMap' }]"
>
<WeMap v-if="!isDetail" v-model="form.weMapInfo" />
<div v-else>
@@ -179,12 +230,19 @@
</ProFormCol>
<ProFormCol>
<ProFormColItem :span="12">
- <ProFormItemV2
- label="璇︾粏鍦板潃:"
- prop="addressDetail"
- :check-rules="[{ message: '璇疯緭鍏ヨ缁嗗湴鍧�' }]"
- >
- <ProFormText v-model.trim="form.addressDetail" placeholder="璇疯緭鍏ヨ缁嗗湴鍧�" />
+ <ProFormItemV2 label="鍦扮偣璇存槑:" prop="addressDetail">
+ <ProFormText v-model.trim="form.addressDetail" placeholder="璇疯緭鍏ュ湴鐐硅鏄�" />
+ </ProFormItemV2>
+ </ProFormColItem>
+ </ProFormCol>
+ <ProFormCol>
+ <ProFormColItem :span="12">
+ <ProFormItemV2 label="浠诲姟鎻忚堪:" prop="description">
+ <ProFormTextArea
+ :rows="4"
+ v-model.trim="form.description"
+ placeholder="璇疯緭鍏ヤ换鍔℃弿杩�"
+ />
</ProFormItemV2>
</ProFormColItem>
</ProFormCol>
@@ -203,6 +261,39 @@
end-placeholder="缁撴潫鏃ユ湡"
:disabled-date="disabledDate"
></ProFormDatePicker>
+ </ProFormItemV2>
+ </ProFormColItem>
+ </ProFormCol>
+ <ProFormCol>
+ <ProFormColItem :span="12">
+ <ProFormItemV2
+ label="鎶ュ悕鏃堕棿:"
+ prop="applyTime"
+ :check-rules="[{ message: '璇烽�夋嫨鎶ュ悕鏃堕棿', type: 'array' }]"
+ >
+ <ProFormDatePicker
+ v-model="form.applyTime"
+ type="daterange"
+ range-separator="鑷�"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡"
+ :disabled-date="disabledapplyDate"
+ ></ProFormDatePicker>
+ </ProFormItemV2>
+ </ProFormColItem>
+ </ProFormCol>
+ <ProFormCol>
+ <ProFormColItem :span="12">
+ <ProFormItemV2
+ label="楠屾敹鏂瑰紡:"
+ prop="checkReceiveMethod"
+ :check-rules="[{ message: '璇烽�夋嫨楠屾敹鏂瑰紡' }]"
+ >
+ <ProFormRadio
+ v-model="form.checkReceiveMethod"
+ :value-enum="EnumTaskCheckReceiveMethodText"
+ :button-style="false"
+ ></ProFormRadio>
</ProFormItemV2>
</ProFormColItem>
</ProFormCol>
@@ -229,6 +320,8 @@
ProFormRadio,
ProFormDatePicker,
ProFormCheckbox,
+ ProFormSelect,
+ ProFormTextArea,
} from '@bole-core/components';
import { FormInstance, ModelValueType } from 'element-plus';
import { Message } from '@bole-core/core';
@@ -237,9 +330,15 @@
import * as taskServices from '@/services/api/task';
import {
EnumUserGenderTextForEdit,
+ EnumBillingMethod,
EnumBillingMethodText,
EnumBillingMethodUnitText,
EnumSettlementCycleText,
+ EnumSettlementCycleDateText,
+ EnumSettlementCycleDateMonthArray,
+ EnumSettlementCycleDateWeekArray,
+ EnumSettlementCycle,
+ EnumTaskCheckReceiveMethodText,
} from '@/constants';
import { format, FormValidator } from '@/utils';
import dayjs from 'dayjs';
@@ -259,6 +358,10 @@
return dayjs(time).isBefore(dayjs(), 'day');
}
+function disabledapplyDate(time: Date) {
+ return dayjs(time).isBefore(form.time[0], 'day');
+}
+
const eventContext = useGlobalEventContext();
const { closeViewPush } = useRouteView();
@@ -267,6 +370,16 @@
});
const { dictionaryDataList: certificateTypeList } = useDictionaryDataSelect({
categoryCode: CategoryCode.CertificateType,
+});
+
+const settlementDateList = computed(() => {
+ if (form.settlementCycle === EnumSettlementCycle.Month) {
+ return EnumSettlementCycleDateMonthArray;
+ }
+ if (form.settlementCycle === EnumSettlementCycle.Week) {
+ return EnumSettlementCycleDateWeekArray;
+ }
+ return [];
});
const state = reactive({
@@ -279,17 +392,23 @@
const form = reactive({
name: '',
- billingMethod: '' as any as EnumBillingMethod,
- serviceFee: 0,
- settlementCycle: EnumSettlementCycle.Month,
+ billingMethod: EnumBillingMethod.Day,
+ serviceFee: null,
+ settlementCycle: EnumSettlementCycle.Day,
+ settlementDate: null as number,
benefits: [] as string[],
- ageMinLimit: 0,
- ageMaxLimit: 0,
+ ageMinLimit: null,
+ ageMaxLimit: null,
genderLimit: 0 as any as EnumUserGender,
credentialLimits: [] as string[],
time: [] as unknown as ModelValueType,
weMapInfo: {} as WeMapModel,
addressDetail: '',
+ verifyWorkHours: null as number,
+ timeoutServiceFee: null as number,
+ description: '',
+ checkReceiveMethod: '' as any as EnumTaskCheckReceiveMethod,
+ applyTime: [] as unknown as ModelValueType,
});
const { isLoading } = useQuery({
@@ -308,6 +427,7 @@
form.billingMethod = data.billingMethod;
form.serviceFee = data.serviceFee;
form.settlementCycle = data.settlementCycle;
+ form.settlementDate = data.settlementDate;
form.benefits = data.benefits?.map((x) => x.benefitCode) ?? [];
form.ageMinLimit = data.ageMinLimit;
form.ageMaxLimit = data.ageMaxLimit;
@@ -316,6 +436,10 @@
form.time = [
format(data.beginTime, 'YYYY-MM-DD 00:00:00'),
format(data.endTime, 'YYYY-MM-DD 23:59:59'),
+ ];
+ form.applyTime = [
+ format(data.applyBeginTime, 'YYYY-MM-DD 00:00:00'),
+ format(data.applyEndTime, 'YYYY-MM-DD 23:59:59'),
];
form.weMapInfo = {
latitude: data.latitude,
@@ -327,9 +451,21 @@
addressName: data.addressName,
};
form.addressDetail = data.addressDetail;
+ form.verifyWorkHours = data.verifyWorkHours;
+ form.timeoutServiceFee = data.timeoutServiceFee;
+ form.description = data.description;
+ form.checkReceiveMethod = data.checkReceiveMethod;
+ form.applyTime = [
+ format(data.applyBeginTime, 'YYYY-MM-DD 00:00:00'),
+ format(data.applyEndTime, 'YYYY-MM-DD 23:59:59'),
+ ];
},
enabled: isEdit,
});
+
+function handleSettlementCycleChange() {
+ form.settlementDate = null as number;
+}
function handleBack() {
closeViewPush(route, {
@@ -349,12 +485,12 @@
}
async function submit() {
try {
- console.log('form.weMapInfo: ', form.weMapInfo);
let params: API.SaveTaskInfoCommand = {
name: form.name,
billingMethod: form.billingMethod,
serviceFee: form.serviceFee,
settlementCycle: form.settlementCycle,
+ settlementDate: form.settlementDate ? form.settlementDate : 0,
benefits: form.benefits,
ageMinLimit: form.ageMinLimit,
ageMaxLimit: form.ageMaxLimit,
@@ -368,6 +504,12 @@
latitude: form.weMapInfo.latitude,
beginTime: dayjs(form.time[0]).format('YYYY-MM-DD 00:00:00'),
endTime: dayjs(form.time[1]).format('YYYY-MM-DD 23:59:59'),
+ applyBeginTime: dayjs(form.applyTime[0]).format('YYYY-MM-DD 00:00:00'),
+ applyEndTime: dayjs(form.applyTime[1]).format('YYYY-MM-DD 23:59:59'),
+ verifyWorkHours: form.verifyWorkHours,
+ timeoutServiceFee: form.timeoutServiceFee,
+ description: form.description,
+ checkReceiveMethod: form.checkReceiveMethod,
};
if (isEdit) {
params.id = id;
@@ -425,5 +567,24 @@
width: auto;
}
}
+
+ .settlement-cycle-date-form-item {
+ color: inherit;
+
+ .el-form-item__content {
+ flex-wrap: nowrap;
+
+ .el-select {
+ margin: 0 20px;
+ width: auto;
+ min-width: 0;
+ flex: 1;
+ }
+
+ .pro-from-item-read-content-wrapper {
+ width: auto;
+ }
+ }
+ }
}
</style>
--
Gitblit v1.9.1