Ver Fonte

Merge branch 'feature/v1' into dev/shenliang

Huanyi há 2 semanas atrás
pai
commit
404b06e7f3
3 ficheiros alterados com 24 adições e 5 exclusões
  1. 21 2
      src/views/fulfiller/pool/index.vue
  2. 1 1
      src/views/system/store/index.vue
  3. 2 2
      vite.config.ts

+ 21 - 2
src/views/fulfiller/pool/index.vue

@@ -507,6 +507,11 @@
             <el-option v-for="tag in allTags" :key="tag.id" :label="tag.name" :value="tag.id" />
           </el-select>
         </el-form-item>
+        <el-form-item label="服务类型">
+          <el-select v-model="editDialog.serviceTypeIds" multiple placeholder="请选择服务类型" style="width: 100%">
+            <el-option v-for="item in serviceOptions" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+        </el-form-item>
         <el-form-item label="认证状态">
           <el-checkbox v-model="editDialog.form.authId">身份证认证</el-checkbox>
           <el-checkbox v-model="editDialog.form.authQual">专业资质认证</el-checkbox>
@@ -582,6 +587,11 @@
             <el-option v-for="tag in allTags" :key="tag.id" :label="tag.name" :value="tag.id" />
           </el-select>
         </el-form-item>
+        <el-form-item label="服务类型">
+          <el-select v-model="createDialog.serviceTypeIds" multiple placeholder="请选择服务类型" style="width: 100%">
+            <el-option v-for="item in serviceOptions" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+        </el-form-item>
       </el-form>
       <template #footer>
         <el-button @click="createDialog.visible = false">取消</el-button>
@@ -885,7 +895,8 @@ const editDialog = reactive({
   visible: false,
   form: {} as FlfFulfillerForm,
   cascaderValue: [] as any[],
-  stationOptions: [] as SysAreaStationOnStoreVo[]
+  stationOptions: [] as SysAreaStationOnStoreVo[],
+  serviceTypeIds: [] as any[] // 服务类型多选辅助数组(提交时转为逗号字符串)
 })
 
 const createDialog = reactive({
@@ -894,7 +905,8 @@ const createDialog = reactive({
     name: '', phone: '', password: '', cityCode: '', cityName: '', stationId: undefined as any, gender: '0', workType: 'full_time'
   },
   cascaderValue: [] as any[],
-  stationOptions: [] as SysAreaStationOnStoreVo[]
+  stationOptions: [] as SysAreaStationOnStoreVo[],
+  serviceTypeIds: [] as any[] // 服务类型多选辅助数组(提交时转为逗号字符串)
 })
 
 const pointsDialog = reactive({
@@ -1010,6 +1022,8 @@ const handleEdit = (row: FlfFulfillerVO) => {
     authQual: row.authQual,
     tagIds: row.tags ? row.tags.map(t => t.id) : []
   }
+  // 将后端逗号字符串 serviceTypes 解析为数组用于多选回显
+  editDialog.serviceTypeIds = row.serviceTypes ? row.serviceTypes.split(',').filter(Boolean) : []
   if (row.stationId || row.cityCode) {
     const targetId = row.stationId || Number(row.cityCode)
     const path: any[] = []
@@ -1032,6 +1046,7 @@ const handleCreate = () => {
   createDialog.form = {
     name: '', phone: '', password: '', cityCode: '', cityName: '', stationId: undefined, gender: '0', workType: 'full_time', tagIds: []
   }
+  createDialog.serviceTypeIds = [] // 重置服务类型辅助数组
   createDialog.cascaderValue = []
   createDialog.stationOptions = []
   createDialog.visible = true
@@ -1042,6 +1057,8 @@ const submitCreate = async () => {
     ElMessage.warning('请填写完整信息')
     return
   }
+  // 将选中的服务类型数组转为逗号拼接字符串后提交
+  ;(createDialog.form as any).serviceTypes = createDialog.serviceTypeIds.join(',')
   try {
     await addFulfiller(createDialog.form as FlfFulfillerForm)
     createDialog.visible = false
@@ -1051,6 +1068,8 @@ const submitCreate = async () => {
 }
 
 const saveEdit = async () => {
+  // 将选中的服务类型数组转为逗号拼接字符串后提交
+  ;(editDialog.form as any).serviceTypes = editDialog.serviceTypeIds.join(',')
   try {
     await updateFulfiller(editDialog.form)
     ElMessage.success('更新成功')

+ 1 - 1
src/views/system/store/index.vue

@@ -207,7 +207,7 @@
           <el-input v-model="form.contactNumber" placeholder="请输入联系电话" />
         </el-form-item>
         <el-form-item label="有效期至" prop="validity">
-          <el-date-picker clearable v-model="form.validity" type="date" value-format="YYYY-MM-DD" placeholder="请选择有效期至" style="width: 100%" />
+          <el-date-picker :disabled="!!form.id" clearable v-model="form.validity" type="date" value-format="YYYY-MM-DD" placeholder="请选择有效期至" style="width: 100%" />
         </el-form-item>
         <el-form-item label="所属站点" prop="site">
           <el-cascader v-model="regionValue" :options="areaOptions" :props="{ value: 'id', label: 'name' }" placeholder="选择站点" style="width: 100%" @change="handleAreaChange" />

+ 2 - 2
vite.config.ts

@@ -25,8 +25,8 @@ export default defineConfig(({ mode, command }) => {
       // open: true,
       proxy: {
         [env.VITE_APP_BASE_API]: {
-          target: 'http://127.0.0.1:8080',
-          // target: 'http://www.hoomeng.pet/api',
+          // target: 'http://127.0.0.1:8080',
+          target: 'http://www.hoomeng.pet/api',
           changeOrigin: true,
           ws: true,
           rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')