更新岗位人员接口,调整获取叉车工和司磅员的逻辑,统一展示姓名字段
已修改2个文件
39 ■■■■ 文件已修改
common/http.api.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/createwriteoffform.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/http.api.js
@@ -563,8 +563,8 @@
        NuclearScaleEntry: {
            // 获取客户名称
            selClient: (params = {}) => vm.$u.get('/mes/weighingVerification/selClient'),
            // 获取岗位人员(司磅员/叉车工)
            listStaff: (params = {}) => vm.$u.post('/mes/staff/listStaff', params),
            // 获取岗位人员(司磅员/叉车工)PDA:按部门、岗位
            listStaff: (params = {}) => vm.$u.get('/mes/post-sort/pda/list', params),
            // 创建核磅单提交
            createMain: (params = {}) => vm.$u.post('/mes/weighingVerification/createMain', params),
            // 核磅单号
pages/wareHouse/nuclearScale/createwriteoffform.vue
@@ -533,21 +533,37 @@
        });
    },
    /** 新接口人员行里姓名可能字段不同,统一取展示名 */
    staffRowDisplayName(row) {
      if (!row || typeof row !== "object") return "";
      return (
        row.staffName ||
        row.name ||
        row.userName ||
        row.nickName ||
        row.realName ||
        ""
      );
    },
    /**
     * 获取叉车工列表
     * 获取叉车工列表(发货部门)
     */
    fetchForkliftOperators() {
      this.$u.api
        .NuclearScaleEntry.listStaff({
          postNames: ["叉车工"],
          department: "发货",
          post: "叉车工",
        })
        .then((res) => {
          const list = res?.data?.records || res?.data || [];
          if (res.code === 0 && Array.isArray(list) && list.length > 0) {
            list.forEach((i) => {
              const name = this.staffRowDisplayName(i);
              if (!name) return;
              const obj = Object.assign({
                label: i.staffName,
                value: i.staffName,
                label: name,
                value: name,
              });
              this.checkboxList.push(obj);
            });
@@ -568,20 +584,23 @@
    },
    /**
     * 获取司磅员列表
     * 获取司磅员列表(发货部门)
     */
    fetchWeighmen() {
      this.$u.api
        .NuclearScaleEntry.listStaff({
          postNames: ["司磅员"],
          department: "发货",
          post: "司磅员",
        })
        .then((res) => {
          const list = res?.data?.records || res?.data || [];
          if (res.code === 0 && Array.isArray(list) && list.length > 0) {
            list.forEach((i) => {
              const name = this.staffRowDisplayName(i);
              if (!name) return;
              const obj = Object.assign({
                label: i.staffName,
                value: i.staffName,
                label: name,
                value: name,
              });
              this.weighmanList.push(obj);
            });