采购单
This commit is contained in:
@ -54,9 +54,9 @@ const onNewsClick = (item: any) => {
|
|||||||
//并且写入pinia
|
//并且写入pinia
|
||||||
noticeStore.state.value.notices = newsList.value;
|
noticeStore.state.value.notices = newsList.value;
|
||||||
//如果有formPath,就前往
|
//如果有formPath,就前往
|
||||||
console.log('🚀 ~ onNewsClick ~ item.formPath:', item.formPath, newsList.value);
|
console.log('🚀 ~ onNewsClick ~ item.formPath:', newsList.value);
|
||||||
if (newsList.value[item].formPath) {
|
if (newsList.value[item].route) {
|
||||||
proxy?.$tab.openPage('/' + newsList.value[item].formPath, '', { id: newsList.value[item].businessId, type: 'view' });
|
proxy?.$tab.openPage('/' + newsList.value[item].route, '', { id: newsList.value[item].detailId, type: 'view' });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-6 bg-gray-50">
|
<div class="p-6 bg-gray-50 pt-50">
|
||||||
<div class="appWidth mx-auto bg-white rounded-xl shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
|
<div class="appWidth mx-auto bg-white rounded-xl shadow-sm overflow-hidden transition-all duration-300 hover:shadow-md">
|
||||||
<!-- 表单标题区域 -->
|
<!-- 表单标题区域 -->
|
||||||
<div class="bg-gradient-to-r from-blue-500 to-blue-600 text-white p-6">
|
<div class="bg-gradient-to-r from-blue-500 to-blue-600 text-white p-6">
|
||||||
<h2 class="text-2xl font-bold flex items-center"><i class="el-icon-user-circle mr-3"></i>人员配置</h2>
|
<h2 class="text-2xl font-bold flex items-center"><i class="el-icon-user-circle mr-3"></i>人员配置</h2>
|
||||||
<p class="text-blue-100 mt-2 opacity-90">请配置采购专员信息</p>
|
<p class="text-blue-100 mt-2 opacity-90">请配置采购专员信息</p>
|
||||||
<!-- ,带 <span class="text-red-300">*</span> 为必填项 -->
|
<!-- ,带 <span class="text-red-300">*</span> 为必填项 -->
|
||||||
|
<el-button @click="isDisabled = false" class="px-8 py-2.5 transition-all duration-300 font-medium" v-if="isDisabled"> 点击编辑 </el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 表单内容区域 -->
|
<!-- 表单内容区域 -->
|
||||||
<el-form ref="leaveFormRef" :model="form" :rules="rules" label-width="120px" class="p-6 space-y-6">
|
<el-form ref="leaveFormRef" :model="form" :rules="rules" label-width="120px" class="p-6 pt30 space-y-6 h75" :disabled="isDisabled">
|
||||||
<!-- 设计负责人 -->
|
<!-- 设计负责人 -->
|
||||||
<div class="fonts">
|
<div class="fonts">
|
||||||
<el-form-item label="采购专员" prop="userId" class="mb-4">
|
<el-form-item label="采购专员" prop="userId" class="mb-4">
|
||||||
@ -24,7 +25,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 提交按钮区域 -->
|
<!-- 提交按钮区域 -->
|
||||||
<div class="flex justify-center space-x-6 mt-8 pt-6 border-t border-gray-100">
|
<div class="flex justify-center space-x-6 mt-8 pt-6 border-t border-gray-100" v-if="!isDisabled">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="submitForm"
|
@click="submitForm"
|
||||||
@ -60,6 +61,7 @@ const userStore = useUserStoreHook();
|
|||||||
const currentProject = computed(() => userStore.selectedProject);
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
// 专业字典数据
|
// 专业字典数据
|
||||||
const { des_user_major } = toRefs<any>(proxy?.useDict('des_user_major'));
|
const { des_user_major } = toRefs<any>(proxy?.useDict('des_user_major'));
|
||||||
|
const isDisabled = ref(false);
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
@ -106,9 +108,12 @@ const designUser = async () => {
|
|||||||
if (!res.data) {
|
if (!res.data) {
|
||||||
resetForm();
|
resetForm();
|
||||||
form.id = null;
|
form.id = null;
|
||||||
|
isDisabled.value = false;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Object.assign(form, res.data);
|
Object.assign(form, res.data);
|
||||||
|
isDisabled.value = true;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
ElMessage.error('获取配置数据失败');
|
ElMessage.error('获取配置数据失败');
|
||||||
@ -136,6 +141,7 @@ const submitForm = async () => {
|
|||||||
const res = await designUserAdd(data);
|
const res = await designUserAdd(data);
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
ElMessage.success('提交成功');
|
ElMessage.success('提交成功');
|
||||||
|
isDisabled.value = true;
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg || '提交失败');
|
ElMessage.error(res.msg || '提交失败');
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,13 @@
|
|||||||
<el-button link type="primary" icon="Upload" @click="handleUpload(scope.row)" v-hasPermi="['cailiaoshebei:purchaseDoc:edit']"
|
<el-button link type="primary" icon="Upload" @click="handleUpload(scope.row)" v-hasPermi="['cailiaoshebei:purchaseDoc:edit']"
|
||||||
>上传</el-button
|
>上传</el-button
|
||||||
>
|
>
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['cailiaoshebei:purchaseDoc:edit']"
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-if="scope.row.status == 'draft'"
|
||||||
|
v-hasPermi="['cailiaoshebei:purchaseDoc:edit']"
|
||||||
>修改</el-button
|
>修改</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -225,11 +225,12 @@ const handleUpdate = async (row?: ConfigVO) => {
|
|||||||
const submitForm = () => {
|
const submitForm = () => {
|
||||||
configFormRef.value?.validate(async (valid: boolean) => {
|
configFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
// buttonLoading.value = true;
|
||||||
if (form.value.id) {
|
if (form.value.id) {
|
||||||
|
form.value.userId = form.value.userId ? form.value.userId?.join(',') : '';
|
||||||
await updateConfig(form.value).finally(() => (buttonLoading.value = false));
|
await updateConfig(form.value).finally(() => (buttonLoading.value = false));
|
||||||
} else {
|
} else {
|
||||||
form.value.userId = form.value.userId.join(',');
|
form.value.userId = form.value.userId?.join(',');
|
||||||
await addConfig(form.value).finally(() => (buttonLoading.value = false));
|
await addConfig(form.value).finally(() => (buttonLoading.value = false));
|
||||||
}
|
}
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
@ -271,7 +272,7 @@ const handleExport = () => {
|
|||||||
// };
|
// };
|
||||||
/** 查询部门下拉树结构 */
|
/** 查询部门下拉树结构 */
|
||||||
const getDeptTree = async () => {
|
const getDeptTree = async () => {
|
||||||
const res = await deptTreeSelect({ isShow: '1', deptId: 100 });
|
const res = await deptTreeSelect({ isShow: '1' });
|
||||||
deptList.value = filterDisabledDept(res.data);
|
deptList.value = filterDisabledDept(res.data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user