diff --git a/src/components/user/userSelect.vue b/src/components/user/userSelect.vue new file mode 100644 index 0000000..8673350 --- /dev/null +++ b/src/components/user/userSelect.vue @@ -0,0 +1,236 @@ + + + + + \ No newline at end of file diff --git a/src/pages/outLocation/addForm.vue b/src/pages/outLocation/addForm.vue index 55958b6..edbd156 100644 --- a/src/pages/outLocation/addForm.vue +++ b/src/pages/outLocation/addForm.vue @@ -40,6 +40,26 @@ 申请数量:{{item.qty}} + + + 账外库位:{{item.outSite}} + + + + + 账外数量:{{item.outQty}} + + + + + 账内库位:{{item.inSite}} + + + + + 账内数量:{{item.inQty}} + + diff --git a/src/pages/sparePartsReturn/addForm.vue b/src/pages/sparePartsReturn/addForm.vue index efc4040..81f2c11 100644 --- a/src/pages/sparePartsReturn/addForm.vue +++ b/src/pages/sparePartsReturn/addForm.vue @@ -7,9 +7,9 @@ --> - + - {{selectFormat(form.reverterId,reverterUser)}} + {{form.nickname}} {{`请选择归还人员`}} @@ -89,6 +89,12 @@ + @@ -104,6 +110,7 @@ import * as sparePartsReturnApi from "@/api/sparePartsReturn" import * as sparePartsApi from "@/api/spareParts" import * as locationApi from "@/api/location" + import SelectUserList from "../../components/user/userSelect.vue" const { proxy } = getCurrentInstance() const loading = ref(false) @@ -129,7 +136,7 @@ const singleColumnShow = ref(false) const locationList = ref([])//备件的库位列表 const locationItem = ref('')//备件账内库 const isFocus = ref(false) - + const isShowSelectPerson = ref(false) const choosesingleColumnItem = ref() const itemNumber = ref() const msg = ref() @@ -178,10 +185,10 @@ const singleColumnShow = ref(false) } } - function selectFormat(val, array) { - let str = array.filter(item => item.value == val)[0].label - return str - } + // function selectFormat(val, array) { + // let str = array.filter(item => item.value == val)[0].label + // return str + // } // 单列模式 function openSingleColumn(fieldName, val, list) { singleColumnList.value = list @@ -218,7 +225,7 @@ const singleColumnShow = ref(false) itemNumber: "", itemName: '', locationNumber: '', - qty: '' + qty: '', } isPopupShow.value = true isShow.value= false @@ -357,6 +364,55 @@ const singleColumnShow = ref(false) function handelScanMsg1() { getSparePartsInfo() } + + // 单列模式 + function openSingleNewColumn(fieldName, val, list) { + singleColumnList.value = list + field.value = fieldName + if (val) { + singleColumnDefaultValue.value = [list.findIndex(item => item.value == val)] + } else { + singleColumnDefaultValue.value = [] + } + isShowSelectPerson.value = true; + singleColumnList.value = list + } + + async function searchPerson(name){ + await getUserList(name); + } + + async function choosePerson(type,forms){ + if(!forms.value.id&&type==1){ + proxy.$modal.showToast('请选择用户') + return + } + if(type==1){ + form.value.nickname = forms.value.temporarilyNickname + form.value.name =forms.value.temporarilyName + form.value.reverterId = forms.value.temporarilyId + } + await getUserList(null); + isShowSelectPerson.value = false; + } + + // 获取用户列表 + async function getUserList(name) { + await userApi.getReverterUser().then(res => { + // 如果入参为 null 或空字符串,则不过滤 + let filteredData = name ? res.data.filter(item => item.nickname.includes(name)) : res.data; + + // 处理匹配到的数据 + filteredData.map(item => { + item.value = item.id; + item.label = item.nickname; + }); + + reverterUser.value = filteredData; + singleColumnList.value = reverterUser.value; + }).catch(() => {}); + } + onLoad(async(option) => { getReverterUser() })