1.0.24 合同新增自动获取用户部门

dev
yinq 2 months ago
parent f6d5103869
commit 8d5ae3fe41

@ -44,3 +44,14 @@ export enum ProjectCategoryEnum {
}
/**
*
*/
export enum FlowCodeEnum {
/**
*
*/
CONTRACT_CODE = 'OAC',
}

@ -15,7 +15,7 @@
:pageType="routeParams.type"
:mode="false"
/>
<el-form ref="contractInfoFormRef" :model="form" :disabled="routeParams.type === 'view'" :rules="rules" label-width="120px">
<el-form ref="contractInfoFormRef" :model="form" :loading="buttonLoading" :disabled="routeParams.type === 'view' || routeParams.type === 'approval'" :rules="rules" label-width="120px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="有无合同" prop="contractFlag">
@ -61,7 +61,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="部门" prop="contractDeptId">
<el-select v-model="form.contractDeptId" placeholder="请选择部门">
<el-select v-model="form.contractDeptId" disabled>
<el-option v-for="item in deptInfoList" :key="item.deptId" :label="item.deptName" :value="item.deptId" />
</el-select>
</el-form-item>
@ -167,10 +167,10 @@
<!-- 合同物料表格 -->
<div style="margin-bottom: 16px">
<el-button type="primary" icon="Plus" v-if="routeParams.type !== 'view'" @click="handleAddMaterial"> </el-button>
<el-button type="primary" icon="Plus" v-if="routeParams.type !== 'view' && routeParams.type != 'approval'" @click="handleAddMaterial"> </el-button>
</div>
<el-table :data="contractMaterialList" border v-loading="materialLoading">
<el-table :data="contractMaterialList" v-loading="buttonLoading" border>
<el-table-column label="产品名称" align="center" prop="productName" min-width="120" />
<el-table-column label="规格描述" align="center" prop="specificationDescription" min-width="120" />
<el-table-column label="物料编号" align="center" prop="materialCode" width="120" />
@ -203,7 +203,7 @@
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" min-width="100" />
<el-table-column label="操作" align="center" fixed="right" width="150" v-if="routeParams.type !== 'view'">
<el-table-column label="操作" align="center" fixed="right" width="150" v-if="routeParams.type !== 'view' && routeParams.type != 'approval'">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleEditMaterial(scope.row)"></el-button>
<el-button link type="danger" icon="Delete" @click="handleDeleteMaterial(scope.row)"></el-button>
@ -366,7 +366,6 @@
<script setup name="ContractInfoEdit" lang="ts">
import { addContractInfo, contractSubmitAndFlowStart, getContractInfo, updateContractInfo } from '@/api/oa/erp/contractInfo';
import { ContractInfoForm } from '@/api/oa/erp/contractInfo/types';
import { getErpContractMaterialList } from '@/api/oa/erp/contractMaterial';
import { ContractMaterialVO, ContractMaterialForm } from '@/api/oa/erp/contractMaterial/types';
import { getBaseUnitInfoList } from '@/api/oa/base/unitInfo';
import { getRuleGenerateCode } from '@/api/system/codeRule';
@ -380,7 +379,8 @@ import { ref } from 'vue';
import { allListDept, listDept } from '@/api/system/dept';
import { getCrmCustomerInfoList } from '@/api/oa/crm/customerInfo';
import { getBasePrintTemplateList } from '@/api/oa/base/printTemplate';
import { CodeRuleEnum } from '@/enums/OAEnum';
import { CodeRuleEnum, FlowCodeEnum } from '@/enums/OAEnum';
import { getInfo } from '@/api/login';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute();
@ -424,7 +424,6 @@ const ossFileModel = ref<string | string[] | undefined>(undefined);
const isCodeGenerated = ref(false);
//
const materialLoading = ref(false);
const materialFormRef = ref<ElFormInstance>();
//
@ -609,7 +608,7 @@ const submitForm = (status: string, mode: boolean) => {
// 稿
if (status != 'draft') {
//
form.value.flowCode = 'OAC';
form.value.flowCode = FlowCodeEnum.CONTRACT_CODE;
//
form.value.variables = {
contractName: form.value.contractName,
@ -845,6 +844,16 @@ onMounted(async () => {
isCodeGenerated.value = false;
}
} else {
// ID
try {
const userInfoRes = await getInfo();
if (userInfoRes.data?.user?.deptId && !form.value.contractDeptId) {
form.value.contractDeptId = userInfoRes.data.user.deptId;
}
} catch (error) {
console.error('获取用户信息失败:', error);
}
//
if (form.value.contractCode) {
isCodeGenerated.value = true;

Loading…
Cancel
Save