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 |  271 +++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 248 insertions(+), 23 deletions(-)

diff --git a/src/views/EmploymentManage/components/AddOrEditEmploymentView.vue b/src/views/EmploymentManage/components/AddOrEditEmploymentView.vue
index 1060e6b..eb8b548 100644
--- a/src/views/EmploymentManage/components/AddOrEditEmploymentView.vue
+++ b/src/views/EmploymentManage/components/AddOrEditEmploymentView.vue
@@ -5,14 +5,34 @@
         <ProForm :model="form" ref="productFormRef" label-width="110px" :is-read="isDetail">
           <ProFormCol>
             <ProFormColItem :span="12">
-              <ProFormItemV2 label="浠诲姟鍚嶇О:" prop="name">
+              <ProFormItemV2
+                label="浠诲姟鍚嶇О:"
+                prop="name"
+                :check-rules="[{ message: '璇疯緭鍏ヤ换鍔″悕绉�' }]"
+              >
                 <ProFormText v-model.trim="form.name" placeholder="璇疯緭鍏ヤ换鍔″悕绉�" />
               </ProFormItemV2>
             </ProFormColItem>
           </ProFormCol>
           <ProFormCol>
             <ProFormColItem :span="12">
-              <ProFormItemV2 label="鏈嶅姟璐�:" prop="billingMethod">
+              <ProFormItemV2
+                label="鏈嶅姟璐�:"
+                prop="billingMethod"
+                :check-rules="[
+                  {
+                    validator: (rule, value, callback) => {
+                      if (!form.billingMethod) {
+                        callback(new Error('璇烽�夋嫨鏈嶅姟璐圭被鍨�'));
+                      }
+                      if (!form.serviceFee) {
+                        callback(new Error('璇疯緭鍏ユ湇鍔¤垂'));
+                      }
+                      callback();
+                    },
+                  },
+                ]"
+              >
                 <RadioWithExtra
                   v-model="form.billingMethod"
                   :value-enum="EnumBillingMethodText"
@@ -24,6 +44,8 @@
                       :controls="false"
                       v-model="form.serviceFee"
                       placeholder="璇疯緭鍏�"
+                      :min="0"
+                      :max="999999999999"
                       :unit="EnumBillingMethodUnitText[form.billingMethod]"
                     ></ProFormInputNumber>
                   </template>
@@ -31,14 +53,68 @@
               </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 label="缁撶畻鏂瑰紡:" prop="settlementCycle">
+              <ProFormItemV2
+                label="缁撶畻鏂瑰紡:"
+                prop="settlementCycle"
+                :check-rules="[{ message: '璇烽�夋嫨缁撶畻鏂瑰紡' }]"
+              >
                 <ProFormRadio
                   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>
@@ -63,32 +139,54 @@
           </ProFormCol>
           <ProFormCol>
             <ProFormColItem :span="12">
-              <ProFormItemV2 label="骞撮緞鑼冨洿:" prop="ageRange" class="form-age-range">
+              <ProFormItemV2
+                label="骞撮緞鑼冨洿:"
+                prop="ageRange"
+                class="form-age-range"
+                :check-rules="[
+                  {
+                    validator: (rule, value, callback) => {
+                      if (!form.ageMinLimit) {
+                        callback(new Error('璇疯緭鍏ュ勾榫勮姹�'));
+                      }
+                      if (!form.ageMaxLimit) {
+                        callback(new Error('璇疯緭鍏ュ勾榫勮姹�'));
+                      }
+                      if (Number(form.ageMaxLimit) <= Number(form.ageMinLimit)) {
+                        callback(new Error('鏈�澶у勾榫勪笉鑳藉皬浜庢渶灏忓勾榫�'));
+                      }
+                      callback();
+                    },
+                  },
+                ]"
+              >
                 <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>
           <ProFormCol>
             <ProFormColItem :span="12">
-              <ProFormItemV2 label="鎬у埆瑕佹眰:" prop="genderLimit">
+              <ProFormItemV2
+                label="鎬у埆瑕佹眰:"
+                prop="genderLimit"
+                :check-rules="[{ message: '璇烽�夋嫨鎬у埆瑕佹眰' }]"
+              >
                 <ProFormRadio
                   v-model="form.genderLimit"
                   :value-enum="EnumUserGenderTextForEdit"
-                  show-all-btn
-                  :all-btn-label="'涓嶉檺'"
-                  :allBtnValue="0"
                 ></ProFormRadio>
               </ProFormItemV2>
             </ProFormColItem>
@@ -114,7 +212,11 @@
           </ProFormCol>
           <ProFormCol>
             <ProFormColItem :span="12">
-              <ProFormItemV2 label="浠诲姟鍦扮偣:" prop="weMapInfo">
+              <ProFormItemV2
+                label="浠诲姟鍦扮偣:"
+                prop="weMapInfo"
+                :check-rules="[{ message: '璇烽�夋嫨浠诲姟鍦扮偣', type: 'weMap' }]"
+              >
                 <WeMap v-if="!isDetail" v-model="form.weMapInfo" />
                 <div v-else>
                   {{
@@ -128,21 +230,70 @@
           </ProFormCol>
           <ProFormCol>
             <ProFormColItem :span="12">
-              <ProFormItemV2 label="璇︾粏鍦板潃:" prop="addressDetail">
-                <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="time">
+              <ProFormItemV2 label="浠诲姟鎻忚堪:" prop="description">
+                <ProFormTextArea
+                  :rows="4"
+                  v-model.trim="form.description"
+                  placeholder="璇疯緭鍏ヤ换鍔℃弿杩�"
+                />
+              </ProFormItemV2>
+            </ProFormColItem>
+          </ProFormCol>
+          <ProFormCol>
+            <ProFormColItem :span="12">
+              <ProFormItemV2
+                label="浠诲姟鏃堕棿:"
+                prop="time"
+                :check-rules="[{ message: '璇烽�夋嫨浠诲姟鏃堕棿', type: 'array' }]"
+              >
                 <ProFormDatePicker
                   v-model="form.time"
                   type="daterange"
                   range-separator="鑷�"
                   start-placeholder="寮�濮嬫棩鏈�"
                   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>
@@ -169,6 +320,8 @@
   ProFormRadio,
   ProFormDatePicker,
   ProFormCheckbox,
+  ProFormSelect,
+  ProFormTextArea,
 } from '@bole-core/components';
 import { FormInstance, ModelValueType } from 'element-plus';
 import { Message } from '@bole-core/core';
@@ -177,11 +330,17 @@
 import * as taskServices from '@/services/api/task';
 import {
   EnumUserGenderTextForEdit,
+  EnumBillingMethod,
   EnumBillingMethodText,
   EnumBillingMethodUnitText,
   EnumSettlementCycleText,
+  EnumSettlementCycleDateText,
+  EnumSettlementCycleDateMonthArray,
+  EnumSettlementCycleDateWeekArray,
+  EnumSettlementCycle,
+  EnumTaskCheckReceiveMethodText,
 } from '@/constants';
-import { format } from '@/utils';
+import { format, FormValidator } from '@/utils';
 import dayjs from 'dayjs';
 
 defineOptions({
@@ -195,6 +354,14 @@
 const id = route.params.id as string;
 const isEdit = !!id;
 
+function disabledDate(time: Date) {
+  return dayjs(time).isBefore(dayjs(), 'day');
+}
+
+function disabledapplyDate(time: Date) {
+  return dayjs(time).isBefore(form.time[0], 'day');
+}
+
 const eventContext = useGlobalEventContext();
 
 const { closeViewPush } = useRouteView();
@@ -203,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({
@@ -215,17 +392,23 @@
 
 const form = reactive({
   name: '',
-  billingMethod: '' as any as EnumBillingMethod,
-  serviceFee: 0,
-  settlementCycle: '' as any as EnumSettlementCycle,
+  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({
@@ -244,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;
@@ -252,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,
@@ -263,13 +451,25 @@
       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, {
-    name: 'EmploymentManageList',
+    name: 'TaskManageList',
   });
 }
 const productFormRef = ref<FormInstance>();
@@ -285,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,
@@ -304,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;
@@ -311,7 +517,7 @@
     let res = await taskServices.saveTaskInfo(params);
     if (res) {
       Message.successMessage('鎿嶄綔鎴愬姛');
-      eventContext.emit(isEdit ? 'employment:edit' : 'employment:add');
+      eventContext.emit(isEdit ? 'taskManage:edit' : 'taskManage:add');
       handleBack();
     }
   } catch (error) {}
@@ -361,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