|
|
|
@ -15,7 +15,7 @@
|
|
|
|
:pageType="routeParams.type"
|
|
|
|
:pageType="routeParams.type"
|
|
|
|
:mode="false"
|
|
|
|
: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-row :gutter="20">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="有无合同" prop="contractFlag">
|
|
|
|
<el-form-item label="有无合同" prop="contractFlag">
|
|
|
|
@ -61,7 +61,7 @@
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="部门" prop="contractDeptId">
|
|
|
|
<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-option v-for="item in deptInfoList" :key="item.deptId" :label="item.deptName" :value="item.deptId" />
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
@ -167,10 +167,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 合同物料表格 -->
|
|
|
|
<!-- 合同物料表格 -->
|
|
|
|
<div style="margin-bottom: 16px">
|
|
|
|
<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>
|
|
|
|
</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="productName" min-width="120" />
|
|
|
|
<el-table-column label="规格描述" align="center" prop="specificationDescription" min-width="120" />
|
|
|
|
<el-table-column label="规格描述" align="center" prop="specificationDescription" min-width="120" />
|
|
|
|
<el-table-column label="物料编号" align="center" prop="materialCode" width="120" />
|
|
|
|
<el-table-column label="物料编号" align="center" prop="materialCode" width="120" />
|
|
|
|
@ -203,7 +203,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" min-width="100" />
|
|
|
|
<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">
|
|
|
|
<template #default="scope">
|
|
|
|
<el-button link type="primary" icon="Edit" @click="handleEditMaterial(scope.row)">编辑</el-button>
|
|
|
|
<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>
|
|
|
|
<el-button link type="danger" icon="Delete" @click="handleDeleteMaterial(scope.row)">删除</el-button>
|
|
|
|
@ -366,7 +366,6 @@
|
|
|
|
<script setup name="ContractInfoEdit" lang="ts">
|
|
|
|
<script setup name="ContractInfoEdit" lang="ts">
|
|
|
|
import { addContractInfo, contractSubmitAndFlowStart, getContractInfo, updateContractInfo } from '@/api/oa/erp/contractInfo';
|
|
|
|
import { addContractInfo, contractSubmitAndFlowStart, getContractInfo, updateContractInfo } from '@/api/oa/erp/contractInfo';
|
|
|
|
import { ContractInfoForm } from '@/api/oa/erp/contractInfo/types';
|
|
|
|
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 { ContractMaterialVO, ContractMaterialForm } from '@/api/oa/erp/contractMaterial/types';
|
|
|
|
import { getBaseUnitInfoList } from '@/api/oa/base/unitInfo';
|
|
|
|
import { getBaseUnitInfoList } from '@/api/oa/base/unitInfo';
|
|
|
|
import { getRuleGenerateCode } from '@/api/system/codeRule';
|
|
|
|
import { getRuleGenerateCode } from '@/api/system/codeRule';
|
|
|
|
@ -380,7 +379,8 @@ import { ref } from 'vue';
|
|
|
|
import { allListDept, listDept } from '@/api/system/dept';
|
|
|
|
import { allListDept, listDept } from '@/api/system/dept';
|
|
|
|
import { getCrmCustomerInfoList } from '@/api/oa/crm/customerInfo';
|
|
|
|
import { getCrmCustomerInfoList } from '@/api/oa/crm/customerInfo';
|
|
|
|
import { getBasePrintTemplateList } from '@/api/oa/base/printTemplate';
|
|
|
|
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 { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
const route = useRoute();
|
|
|
|
const route = useRoute();
|
|
|
|
@ -424,7 +424,6 @@ const ossFileModel = ref<string | string[] | undefined>(undefined);
|
|
|
|
const isCodeGenerated = ref(false);
|
|
|
|
const isCodeGenerated = ref(false);
|
|
|
|
|
|
|
|
|
|
|
|
// 合同物料相关
|
|
|
|
// 合同物料相关
|
|
|
|
const materialLoading = ref(false);
|
|
|
|
|
|
|
|
const materialFormRef = ref<ElFormInstance>();
|
|
|
|
const materialFormRef = ref<ElFormInstance>();
|
|
|
|
|
|
|
|
|
|
|
|
// 合同物料列表计算属性
|
|
|
|
// 合同物料列表计算属性
|
|
|
|
@ -609,7 +608,7 @@ const submitForm = (status: string, mode: boolean) => {
|
|
|
|
// 设置后端发起和不等于草稿状态 直接走流程发起
|
|
|
|
// 设置后端发起和不等于草稿状态 直接走流程发起
|
|
|
|
if (status != 'draft') {
|
|
|
|
if (status != 'draft') {
|
|
|
|
// 后端发起流程模式
|
|
|
|
// 后端发起流程模式
|
|
|
|
form.value.flowCode = 'OAC';
|
|
|
|
form.value.flowCode = FlowCodeEnum.CONTRACT_CODE;
|
|
|
|
// 流程变量
|
|
|
|
// 流程变量
|
|
|
|
form.value.variables = {
|
|
|
|
form.value.variables = {
|
|
|
|
contractName: form.value.contractName,
|
|
|
|
contractName: form.value.contractName,
|
|
|
|
@ -845,6 +844,16 @@ onMounted(async () => {
|
|
|
|
isCodeGenerated.value = false;
|
|
|
|
isCodeGenerated.value = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} 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) {
|
|
|
|
if (form.value.contractCode) {
|
|
|
|
isCodeGenerated.value = true;
|
|
|
|
isCodeGenerated.value = true;
|
|
|
|
|