| | |
| | | }); |
| | | }, |
| | | |
| | | /** 新接口人员行里姓名可能字段不同,统一取展示名 */ |
| | | 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); |
| | | }); |
| | |
| | | }, |
| | | |
| | | /** |
| | | * 获取司磅员列表 |
| | | * 获取司磅员列表(发货部门) |
| | | */ |
| | | 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); |
| | | }); |