This commit is contained in:
ljx
2025-08-23 09:13:54 +08:00
parent 7f19586b93
commit 0d180e63f2
3 changed files with 45 additions and 4 deletions

View File

@ -8,7 +8,7 @@ VITE_APP_ENV = 'development'
# 李陈杰 209
# VITE_APP_BASE_API = 'http://192.168.110.209:8899'
# 曾涛
VITE_APP_BASE_API = 'http://192.168.110.180:8899'
VITE_APP_BASE_API = 'http://192.168.110.209:8899'
# 罗成
# VITE_APP_BASE_API = 'http://192.168.110.213:8899'
# 朱银

View File

@ -61,3 +61,10 @@ export const delMaterialIssue = (id: string | number | Array<string | number>) =
method: 'delete'
});
};
//获取一起名称
export const getMaterialName = (id: any) => {
return request({
url: '/materials/materials/inventoryNumber/' + id,
method: 'get'
});
};

View File

@ -140,11 +140,13 @@
<el-row>
<el-col :span="12">
<el-form-item
label="名称"
label="名称11"
:prop="`itemList.${index}.name`"
:rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]"
>
<el-input v-model="item.name" placeholder="请输入名称" />
<el-select v-model="item.name" placeholder="请输入名称" @change="(value) => getNameChange(value, index, item)">
<el-option v-for="item in optionsName" :key="item.id" :label="item.materialsName" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
@ -249,7 +251,15 @@
</template>
<script setup name="MaterialIssue" lang="ts">
import { listMaterialIssue, getMaterialIssue, delMaterialIssue, addMaterialIssue, updateMaterialIssue } from '@/api/materials/materialIssue';
import {
listMaterialIssue,
getMaterialIssue,
delMaterialIssue,
addMaterialIssue,
updateMaterialIssue,
getMaterialName
} from '@/api/materials/materialIssue';
import { MaterialIssueVO, MaterialIssueQuery, MaterialIssueForm } from '@/api/materials/materialIssue/types';
import { useUserStoreHook } from '@/store/modules/user';
import wordllssue from './word/index.vue';
@ -345,6 +355,29 @@ const getList = async () => {
total.value = res.total;
loading.value = false;
};
const optionsName: any = ref([]);
//获取一起名称
const getName = async () => {
const res = await getMaterialName(currentProject.value.id);
console.log(res);
if (res.code == 200) {
optionsName.value = res.data;
}
};
const getNameChange = (value, index, item) => {
// 这里可以添加处理逻辑
console.log(value);
const data = optionsName.value.find((item) => item.id == value);
console.log(data);
form.value.itemList[index].name = data.materialsName;
form.value.itemList[index].specification = data.typeSpecificationName;
form.value.itemList[index].unit = data.weightId;
form.value.itemList[index].stockQuantity = data.inventoryNumber;
};
/** 取消按钮 */
const cancel = () => {
@ -447,6 +480,7 @@ const handleView = (row) => {
};
onMounted(() => {
getList();
getName();
});
//监听项目id刷新数据
const listeningProject = watch(