Selaa lähdekoodia

一些列表缺失字段的bug修复

lihaiting 14 tuntia sitten
vanhempi
commit
b17a9f1f4f

+ 13 - 7
src/api/hr/hiringApproval.js

@@ -197,7 +197,13 @@ export function adaptHiringApproval(raw = {}, extras = {}) {
     statusCode,
     status: HIRING_STATUS_LABELS[statusCode] || raw.approvalStatus || "-",
     offerId: raw.offerId,
-    offerSent: Boolean(raw.offerId || extras.offerSent),
+    /* 是否已发送 Offer:优先取接口字段 offerSent(兼容布尔 / 字符串 "true" / 数值 1);
+       接口未提供时回退为「存在 offerId 即视为已发送」,避免遗漏历史数据 */
+    offerSent: (() => {
+      const sent = raw.offerSent ?? extras.offerSent;
+      if (sent == null) return Boolean(raw.offerId);
+      return sent === true || sent === "true" || sent === 1 || sent === "1";
+    })(),
     createTime: raw.createTime,
     createUserId: raw.createUserId,
   };
@@ -364,32 +370,32 @@ export function serializeHiringApprovalQuery(params = {}) {
 
 // —— 人力资源-录用审批管理 ——
 
-/** 录用审批分页查询 GET /recruit/hiring-approvals */
+/** 录用审批分页查询 GET /hr/recruit/hiring-approvals */
 export const getHiringApprovalPage = async (params = {}) =>
   unwrap(
-    await request.get("/recruit/hiring-approvals", {
+    await request.get("/hr/recruit/hiring-approvals", {
       params: serializeHiringApprovalQuery(params),
     }),
   );
 
-/** 录用审批详情查询 GET /recruit/hiring-approvals/{id},id 为列表主键 */
+/** 录用审批详情查询 GET /hr/recruit/hiring-approvals/{id},id 为列表主键 */
 export const getHiringApprovalById = async (id) => {
   const hiringId = keepBigIntId(id);
   if (hiringId == null || hiringId === "") {
     return Promise.reject(new Error("缺少录用审批主键"));
   }
   return adaptHiringApproval(
-    await unwrap(await request.get(`/recruit/hiring-approvals/${hiringId}`)),
+    await unwrap(await request.get(`/hr/recruit/hiring-approvals/${hiringId}`)),
   );
 };
 
 /**
- * 保存录用审批草稿 POST /recruit/hiring-approvals
+ * 保存录用审批草稿 POST /hr/recruit/hiring-approvals
  * 成功返回主键 id;前端发起时再调 BPM create
  */
 export const createHiringApproval = async (data) => {
   const payload = serializeHiringApproval(data || {});
-  return unwrap(await request.post("/recruit/hiring-approvals", payload));
+  return unwrap(await request.post("/hr/recruit/hiring-approvals", payload));
 };
 
 /** 与 create 同一接口(文档无独立修改接口) */

+ 22 - 9
src/api/salary/socialScheme.js

@@ -108,8 +108,16 @@ export function socialItemTypeLabel(itemType) {
 function adaptScheme(d) {
   return {
     ...d,
-    /* 参保地:接口字段 location(省 / 市 / 区名称数组);非数组时兜底为空数组,便于级联组件回填 */
-    location: Array.isArray(d.location) ? d.location.filter(Boolean) : [],
+    /* 参保地:后端模型没有 location 字段,区级名称统一用 region 字段。
+       把 province / city / region 拼成名称数组,供列表展示与编辑弹框的省市区级联回填;
+       相邻重名(如市与区同名)去掉 */
+    location: (() => {
+      if (Array.isArray(d.location) && d.location.length) {
+        return d.location.filter(Boolean);
+      }
+      const parts = [d.province, d.city, d.region].filter(Boolean);
+      return parts.filter((part, idx) => part !== parts[idx - 1]);
+    })(),
     items: Array.isArray(d.items) ? d.items.map((item) => ({ ...item })) : [],
     statusLabel: schemeStatusMeta(d.status).label,
     statusType: schemeStatusMeta(d.status).type
@@ -134,7 +142,7 @@ export function createEmptySchemeItem(sortNo = 0) {
   };
 }
 
-/** 空方案表单:新增时用 */
+/** 空方案表单:新增时用,险种默认列出「其他」以外的全部常用险种(比例为空待填) */
 export function createEmptyScheme() {
   return {
     id: null,
@@ -162,7 +170,10 @@ export function createEmptyScheme() {
     policyId: null,
     policyVersion: '',
     remark: '',
-    items: []
+    /* 除「其他」外的险种默认各预置一行,比例 / 固定金额留空待 HR 按当地政策填写 */
+    items: SOCIAL_ITEM_TYPE_OPTIONS
+      .filter((opt) => opt.value !== 'OTHER')
+      .map((opt, index) => ({ ...createEmptySchemeItem(index), itemType: opt.value }))
   };
 }
 
@@ -172,6 +183,12 @@ export function createEmptyScheme() {
  */
 function toSchemeBody(data = {}) {
   const num = (v) => (v === '' || v == null || isNaN(Number(v)) ? undefined : Number(v));
+  /* 参保地:按原提交方式——后端通过 location(省 / 市 / 区名称数组)、addressId、addressName 接收,
+     不单独拆 province / city / region;location 空数组视为未填。
+     注:前端回显仍统一读 region(见 adaptScheme),此处只管提交结构不变 */
+  const locationArr = Array.isArray(data.location) && data.location.length
+    ? data.location.map((item) => String(item))
+    : undefined;
   return {
     id: data.id || undefined,
     schemeCode: String(data.schemeCode || '').trim(),
@@ -180,11 +197,7 @@ function toSchemeBody(data = {}) {
     legalEntityName: data.legalEntityName || undefined,
     addressId: num(data.addressId),
     addressName: data.addressName || undefined,
-    /* 参保地:接口字段为名称数组(省 / 市 / 区),空数组视为未填 */
-    location:
-      Array.isArray(data.location) && data.location.length
-        ? data.location.map((item) => String(item))
-        : undefined,
+    location: locationArr,
     schemeYear: num(data.schemeYear),
     effectiveDate: data.effectiveDate || undefined,
     expiryDate: data.expiryDate || undefined,

+ 2 - 2
src/views/hiring/hiringApproval/components/ApprovalFormDrawer.vue

@@ -894,7 +894,7 @@ export default {
       }
       // positionType 为只读展示,无需加载字典归一
     },
-    /** 只调用 POST /recruit/hiring-approvals */
+    /** 只调用 POST /hr/recruit/hiring-approvals */
     async saveHiringApproval() {
       this.syncOrgAndDeptFields();
       const valid = await this.$refs.form.validate().catch(() => false);
@@ -940,7 +940,7 @@ export default {
       this.form.status = this.form.status || "草稿";
       return id;
     },
-    /** 保存:直接 POST /recruit/hiring-approvals */
+    /** 保存:直接 POST /hr/recruit/hiring-approvals */
     async saveDraft() {
       if (this.saving || this.submitting) return;
       this.saving = true;

+ 9 - 0
src/views/hiring/hiringApproval/index.vue

@@ -256,6 +256,15 @@ export default {
           align: "left",
           slot: "status",
         },
+        {
+          prop: "offerSent",
+          columnKey: "offerSent",
+          label: "是否已发送Offer",
+          width: 220,
+          align: "left",
+          formatter: (_r, _c, value) =>
+            value ? "已成功发送邮件或已确认线下通知" : "尚未发送",
+        },
         {
           prop: "createUserName",
           columnKey: "createUserName",

+ 17 - 32
src/views/hrManagement/positionTransfer/index.vue

@@ -602,30 +602,22 @@ export default {
           align: "left",
           slot: "employee",
         },
-        {
-          prop: "dept",
-          label: "所属部门",
-          minWidth: 150,
-          align: "left",
-          showOverflowTooltip: true,
-          formatter: (_r, _c, value) => value || "-",
-        },
+        // {
+        //   prop: "dept",
+        //   label: "所属部门",
+        //   minWidth: 150,
+        //   align: "left",
+        //   showOverflowTooltip: true,
+        //   formatter: (_r, _c, value) => value || "-",
+        // },
         {
           prop: "originPosition",
-          label: "原岗位",
+          label: "原岗位 / 部门",
           minWidth: 130,
           align: "left",
           showOverflowTooltip: true,
           formatter: (_r, _c, value) => value || "-",
         },
-        {
-          columnKey: "duties",
-          label: "岗位职责",
-          minWidth: 180,
-          align: "left",
-          showOverflowTooltip: true,
-          slot: "duties",
-        },
         {
           columnKey: "move",
           label: "调动岗位 / 部门",
@@ -642,21 +634,6 @@ export default {
           showOverflowTooltip: true,
           formatter: (_r, _c, value) => value || "-",
         },
-        {
-          prop: "workLocation",
-          label: "调动工作地点",
-          minWidth: 120,
-          align: "left",
-          showOverflowTooltip: true,
-          formatter: (_r, _c, value) => value || "-",
-        },
-        {
-          prop: "effectiveDate",
-          label: "生效日期",
-          width: 110,
-          align: "left",
-          formatter: (_r, _c, value) => value || "-",
-        },
         {
           columnKey: "audit",
           label: "审批状态",
@@ -671,6 +648,14 @@ export default {
           align: "left",
           slot: "docStatus",
         },
+        {
+          prop: "effectiveDate",
+          label: "生效日期",
+          width: 110,
+          align: "left",
+          formatter: (_r, _c, value) => value || "-",
+        },
+        
         {
           prop: "createUserName",
           label: "创建人",

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 646 - 674
src/views/salary/components/user-edit.vue


+ 5 - 5
src/views/salary/salarySlip/index.vue

@@ -49,12 +49,12 @@
                 clearable
                 placeholder="请选择"
                 style="width: 180px"
-                @change="onFilterChange"
+                @change="search"
               >
                 <el-option
                   v-for="item in templateOptions"
                   :key="item.id"
-                  :label="item.templateName"
+                  :label="item.templateName + (item.templateCode ? `(${item.templateCode})` : '')"
                   :value="item.id"
                 />
               </el-select>
@@ -685,7 +685,8 @@
           this.where.organizationId = this.defaultOrganizationId;
         }
       },
-      /* 加载薪资模板:查询接口按法人返回全量摘要(companyId 必填),只取已启用模板 */
+      /* 加载薪资模板:与「薪资模板设定」列表同口径(GET /hr/payroll/templates?companyId=),
+         取该法人下全部模板,不再按启用态过滤,保证下拉与列表看到的数据一致 */
       async loadTemplates() {
         if (!this.where.organizationId) {
           this.templateOptions = [];
@@ -695,8 +696,7 @@
           const res = await getSalaryTemplatePageList({
             companyId: this.where.organizationId,
             pageNum: 1,
-            size: 1000,
-            isEnabled: true
+            size: 1000
           });
           this.templateOptions = res?.list || res || [];
         } catch (error) {

+ 11 - 2
src/views/salary/socialScheme/SchemeEditDialog.vue

@@ -71,7 +71,8 @@
           </el-col>
           <!--
             参保地:省 / 市 / 区三级级联,替代原来的「参保省份 + 参保城市」两个输入框。
-            提交给接口的字段是 location,格式为地点名称数组:["湖南省","长沙市","岳麓区"]
+            后端保存参数没有 location 字段,实际拆存 province / city / addressName
+            (见 api/salary/socialScheme.js 的 toSchemeBody),回显时由 adaptScheme 拼回数组
           -->
           <el-col :span="24">
             <el-form-item label="参保地" prop="location">
@@ -461,7 +462,9 @@
         form: createEmptyScheme(),
         /* 参保地级联选项(省 / 市 / 区三级,value 为中文名称) */
         areaOptions: pcaTextArr,
-        areaProps: { expandTrigger: 'hover' },
+        /* checkStrictly:允许只选到「省 / 市」就确认(很多城市社保按市统筹、不细分到区),
+           否则回显仅有省/市两级数据时级联渲染异常 */
+        areaProps: { expandTrigger: 'hover', checkStrictly: true },
         itemTypeOptions: SOCIAL_ITEM_TYPE_OPTIONS,
         baseSourceOptions: SOCIAL_BASE_SOURCE_OPTIONS,
         roundingModeOptions: ROUNDING_MODE_OPTIONS,
@@ -512,6 +515,8 @@
               console.warn('方案详情接口失败,回落到列表行数据', error);
             }
             const source = detail || this.data;
+            /* 记录打开时的参保地:保存时若用户改过参保地,旧的 addressId(地区主键)不再可信,需清空 */
+            this.initialLocationKey = (source.location || []).join('|');
             this.form = {
               ...createEmptyScheme(),
               ...source,
@@ -612,6 +617,10 @@
               ...this.form,
               items: this.form.items.map((item, index) => ({ ...item, sortNo: index }))
             };
+            /* 参保地改过则旧 addressId 与新省市区名称不匹配,置空交由后端按名称处理 */
+            if ((this.form.location || []).join('|') !== this.initialLocationKey) {
+              payload.addressId = undefined;
+            }
             await saveSocialScheme(payload);
             this.$message.success(this.form.id ? '修改成功' : '新增成功');
             this.updateVisible(false);

+ 37 - 17
src/views/salary/socialScheme/index.vue

@@ -69,8 +69,8 @@
         <!-- 缴费基数区间 -->
         <template v-slot:baseRange="{ row }">
           <div class="base-range">
-            <span>{{ rangeText(row.socialBaseMin, row.socialBaseMax) }}</span>
-            <span v-if="fundRangeDiffers(row)" class="base-range-fund">公积金 {{ rangeText(row.fundBaseMin,
+            <span>社保基数区间:{{ rangeText(row.socialBaseMin, row.socialBaseMax) }}</span>
+            <span v-if="fundRangeDiffers(row)">公积金基数区间:{{ rangeText(row.fundBaseMin,
               row.fundBaseMax) }}</span>
           </div>
         </template>
@@ -174,7 +174,8 @@ export default {
           columnKey: 'area',
           label: '参保地',
           align: 'left',
-          minWidth: 120
+          minWidth: 120,
+          slot: 'area'
         },
         {
           prop: 'schemeYear',
@@ -186,23 +187,39 @@ export default {
           columnKey: 'baseRange',
           label: '缴费基数区间(元)',
           align: 'left',
-          minWidth: 200
+          minWidth: 200,
+          slot: 'baseRange'
         },
+        // {
+        //   columnKey: 'personalTotal',
+        //   label: `个人合计`,
+        //   align: 'right',
+        //   width: 210,
+        //   slot: 'personalTotal'
+        // },
+        // {
+        //   columnKey: 'companyTotal',
+        //   label: '企业合计(用工成本)',
+        //   align: 'right',
+        //   width: 180,
+        //   slot: 'companyTotal'
+        // },
         {
-          columnKey: 'personalTotal',
-          label: `个人合计(按 ${TRIAL_BASE} 基数试算)`,
-          align: 'right',
-          width: 210
+          columnKey: 'status',
+          label: '状态',
+          align: 'center',
+          width: 100,
+          slot: 'status'
         },
         {
-          columnKey: 'companyTotal',
-          label: '企业合计(用工成本)',
-          align: 'right',
-          width: 180
+          prop: 'createUserName',
+          label: '创建人',
+          align: 'center',
+          width: 100
         },
         {
-          columnKey: 'status',
-          label: '状态',
+          prop: 'createTime',
+          label: '创建时间',
           align: 'center',
           width: 100
         },
@@ -211,7 +228,8 @@ export default {
           label: '操作',
           width: 190,
           align: 'left',
-          fixed: 'right'
+          fixed: 'right',
+          slot: 'action'
         }
       ],
       pageSize: this.$store.state.tablePageSize || 20
@@ -263,11 +281,13 @@ export default {
         return { list: [], count: 0 };
       }
     },
-    /* 参保地:优先接口的 location 数组(省 / 市 / 区),回落历史数据的城市/省份/地区名称 */
+    /* 参保地:优先接口的 location 数组(省 / 市 / 区);回落时把 province / city / region 拼全。
+       区级名称统一用 region 字段 */
     areaText(row) {
       const location = Array.isArray(row.location) ? row.location.filter(Boolean) : [];
       if (location.length) return location.join(' / ');
-      return row.city || row.province || row.addressName || '—';
+      const fallback = [row.province, row.city, row.region].filter(Boolean);
+      return fallback.length ? fallback.join(' / ') : '—';
     },
     rangeText(min, max) {
       const fmt = (v) => (v == null || v === '' ? null : Number(v).toLocaleString('zh-CN'));

+ 1 - 1
vue.config.js

@@ -42,7 +42,7 @@ function stripProxyCacheHeaders(proxyRes) {
 const apiProxy = resolveApiProxyTarget(
   process.env.VUE_APP_PROXY_TARGET ||
     "http://192.168.1.147:18086",
-    // "http://aiot.zoomwin.com.cn:51010",
+    // "http://aiot.zoomwin.com.cn:51001",
 );
 
 // element-ui / ele-admin 仍使用 Sass @import,静音 Dart Sass 弃用警告

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä