回收员选回收站及列表显示修复

master
mhsnet 3 months ago
parent 1e611984c2
commit a0ad6c96ec

@ -43,6 +43,8 @@ import java.util.Map;
@Tag(name = "设备柜清单", description = "scm")
@RequestMapping("/api/scm/RecycleDevice")
public class RecycleDeviceController {
@Autowired
private EnterpriserecyclestationService enterpriserecyclestationService;
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@ -404,4 +406,18 @@ public class RecycleDeviceController {
public ActionResult deviceCount(@PathVariable String companyId) {
return ActionResult.success(recycleDeviceService.deviceCount(companyId));
}
@PostMapping("/getRecycleStationList")
@Operation(summary = "获取回收站下拉列表")
public ActionResult getRecycleStationList() {
UserInfo userInfo = userProvider.get();
Boolean isAdministrator = userInfo.getIsAdministrator();
String organizeId = userInfo.getOrganizeId();
QueryWrapper<EnterpriserecyclestationEntity> wrapper = new QueryWrapper<>();
LambdaQueryWrapper<EnterpriserecyclestationEntity> lambda = wrapper.lambda();
if (!isAdministrator) {
lambda.eq(EnterpriserecyclestationEntity::getCompanyId, organizeId);
}
List<EnterpriserecyclestationEntity> list = enterpriserecyclestationService.list(lambda);
return ActionResult.success(list);
}
}

@ -269,3 +269,10 @@ export function getCompanyList() {
method: "POST"
});
}
// 获取桶设备列表
export function getRecycleStationList() {
return request({
url: `/api/scm/RecycleDevice/getRecycleStationList`,
method: "POST"
});
}

@ -194,6 +194,7 @@ import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"
import recycleSaffDeviceBox from "@/views/publicPopup/recycleSaffDevice";
import { getRecycleStationList } from "@/api/device";
export default {
components: {recycleSaffDeviceBox},
@ -272,7 +273,7 @@ export default {
],
},
stationIdOptions: [],
stationIdProps: { "label": "station_name", "value": "id" },
stationIdProps: { "label": "stationName", "value": "id" },
genderOptions: [{ "fullName": "男", "id": "1" }, { "fullName": "女", "id": "2" }],
genderProps: { "label": "fullName", "value": "id" },
recyclestaffdevicedeviceCodecolumnOptions: [{ "label": "设备编码", "value": "device_code" }, { "label": "设备名称", "value": "device_name" }, { "label": "地址", "value": "address" },],
@ -420,28 +421,32 @@ export default {
},
getstationIdOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.stationId))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if (json.relationField) {
let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue;
if (relationFieldAll.length > 1 && index > -1) {
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
} else {
val = this.dataForm[relationFieldAll]
}
json.defaultValue = val
}
}
let template = {
paramList: templateJsonList
}
getDataInterfaceRes('520259300875047493', template).then(res => {
let data = res.data
this.stationIdOptions = data
this.changeDataFormData(1, 'stationId', 'stationId', index, '')
})
// let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.stationId))
// for (let i = 0; i < templateJsonList.length; i++) {
// let json = templateJsonList[i];
// if (json.relationField) {
// let relationFieldAll = json.relationField.split("-");
// let val = json.defaultValue;
// if (relationFieldAll.length > 1 && index > -1) {
// val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
// } else {
// val = this.dataForm[relationFieldAll]
// }
// json.defaultValue = val
// }
// }
// let template = {
// paramList: templateJsonList
// }
// getDataInterfaceRes('520259300875047493', template).then(res => {
// let data = res.data
// this.stationIdOptions = data
// this.changeDataFormData(1, 'stationId', 'stationId', index, '')
// })
getRecycleStationList().then(res => {
this.stationIdOptions = res.data;
this.changeDataFormData(1, "stationId", "stationId", index, []);
});
},
goBack() {
this.$emit('refresh')

Loading…
Cancel
Save