diff --git a/src/api/oa/erp/contractInfo/types.ts b/src/api/oa/erp/contractInfo/types.ts
index 6715ad4..554064b 100644
--- a/src/api/oa/erp/contractInfo/types.ts
+++ b/src/api/oa/erp/contractInfo/types.ts
@@ -52,32 +52,32 @@ export interface ContractInfoVO {
/**
* 甲方公司
*/
- aCustomerId: string | number;
+ oneCustomerId: string | number;
/**
* 甲方授权代表
*/
- aRepresent: string;
+ oneRepresent: string;
/**
* 甲方签字日期
*/
- aDate: string;
+ oneDate: string;
/**
* 乙方公司
*/
- bCustomerId: string | number;
+ twoCustomerId: string | number;
/**
* 乙方授权代表
*/
- bRepresent: string;
+ twoRepresent: string;
/**
* 乙方签字日期
*/
- bDate: string;
+ twoDate: string;
/**
* 合同状态(1暂存 2审批中 3可用)
@@ -109,6 +109,31 @@ export interface ContractInfoVO {
*/
signatureAppendix: number;
+ /**
+ * 内部合同号
+ */
+ internalContractCode: string;
+
+ /**
+ * 外部合同号
+ */
+ externalContractCode: string;
+
+ /**
+ * 订单号
+ */
+ orderContractCode: string;
+
+ /**
+ * 项目号
+ */
+ projectContractCode: string;
+
+ /**
+ * 质保期(天)
+ */
+ warrantyPeriod: number;
+
/**
* 合同税率(预留)
*/
@@ -124,26 +149,6 @@ export interface ContractInfoVO {
*/
activeFlag: string;
- /**
- * 创建人
- */
- createBy: number;
-
- /**
- * 创建时间
- */
- createTime: string;
-
- /**
- * 更新人
- */
- updateBy: number;
-
- /**
- * 更新时间
- */
- updateTime: string;
-
}
export interface ContractInfoForm extends BaseEntity {
@@ -200,32 +205,32 @@ export interface ContractInfoForm extends BaseEntity {
/**
* 甲方公司
*/
- aCustomerId?: string | number;
+ oneCustomerId?: string | number;
/**
* 甲方授权代表
*/
- aRepresent?: string;
+ oneRepresent?: string;
/**
* 甲方签字日期
*/
- aDate?: string;
+ oneDate?: string;
/**
* 乙方公司
*/
- bCustomerId?: string | number;
+ twoCustomerId?: string | number;
/**
* 乙方授权代表
*/
- bRepresent?: string;
+ twoRepresent?: string;
/**
* 乙方签字日期
*/
- bDate?: string;
+ twoDate?: string;
/**
* 合同状态(1暂存 2审批中 3可用)
@@ -257,6 +262,31 @@ export interface ContractInfoForm extends BaseEntity {
*/
signatureAppendix?: number;
+ /**
+ * 内部合同号
+ */
+ internalContractCode?: string;
+
+ /**
+ * 外部合同号
+ */
+ externalContractCode?: string;
+
+ /**
+ * 订单号
+ */
+ orderContractCode?: string;
+
+ /**
+ * 项目号
+ */
+ projectContractCode?: string;
+
+ /**
+ * 质保期(天)
+ */
+ warrantyPeriod?: number;
+
/**
* 合同税率(预留)
*/
@@ -275,7 +305,7 @@ export interface ContractInfoForm extends BaseEntity {
/**
* 合同物料列表
*/
- contractMaterielList?: any[];
+ contractMaterialList?: any[];
}
@@ -329,32 +359,32 @@ export interface ContractInfoQuery extends PageQuery {
/**
* 甲方公司
*/
- aCustomerId?: string | number;
+ oneCustomerId?: string | number;
/**
* 甲方授权代表
*/
- aRepresent?: string;
+ oneRepresent?: string;
/**
* 甲方签字日期
*/
- aDate?: string;
+ oneDate?: string;
/**
* 乙方公司
*/
- bCustomerId?: string | number;
+ twoCustomerId?: string | number;
/**
* 乙方授权代表
*/
- bRepresent?: string;
+ twoRepresent?: string;
/**
* 乙方签字日期
*/
- bDate?: string;
+ twoDate?: string;
/**
* 合同状态(1暂存 2审批中 3可用)
@@ -386,6 +416,31 @@ export interface ContractInfoQuery extends PageQuery {
*/
signatureAppendix?: number;
+ /**
+ * 内部合同号
+ */
+ internalContractCode?: string;
+
+ /**
+ * 外部合同号
+ */
+ externalContractCode?: string;
+
+ /**
+ * 订单号
+ */
+ orderContractCode?: string;
+
+ /**
+ * 项目号
+ */
+ projectContractCode?: string;
+
+ /**
+ * 质保期(天)
+ */
+ warrantyPeriod?: number;
+
/**
* 合同税率(预留)
*/
diff --git a/src/api/oa/erp/contractMaterial/types.ts b/src/api/oa/erp/contractMaterial/types.ts
index 94e5acb..09ebfd0 100644
--- a/src/api/oa/erp/contractMaterial/types.ts
+++ b/src/api/oa/erp/contractMaterial/types.ts
@@ -122,6 +122,11 @@ export interface ContractMaterialForm extends BaseEntity {
*/
materialId?: string | number;
+ /**
+ * 物料名称
+ */
+ materialName?: string;
+
/**
* 销售物料ID
*/
diff --git a/src/views/oa/erp/contractInfo/edit.vue b/src/views/oa/erp/contractInfo/edit.vue
index 38e4682..712f434 100644
--- a/src/views/oa/erp/contractInfo/edit.vue
+++ b/src/views/oa/erp/contractInfo/edit.vue
@@ -17,7 +17,7 @@
- 生成合同编号
+ 生成合同编号
@@ -50,7 +50,9 @@
-
+
+
+
@@ -68,38 +70,52 @@
-
+
-
-
+
+
+
+
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -200,8 +216,19 @@
-
-
+
+
+ {{dict.label}}
+
+
+
+
+
+
@@ -210,6 +237,11 @@
+
+
+
+
+
@@ -320,11 +352,13 @@ import { getBaseUnitInfoList } from '@/api/oa/base/unitInfo';
import { getRuleGenerateCode } from '@/api/system/codeRule';
import MaterialSelect from '@/components/MaterialSelect/index.vue';
import { ref } from 'vue';
+import { listDept } from '@/api/system/dept';
+import { getCrmCustomerInfoList } from '@/api/oa/crm/customerInfo';
const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { contract_category, business_direction, active_flag, contract_flag, contract_type, contract_status } = toRefs(
- proxy?.useDict('contract_category', 'business_direction', 'active_flag', 'contract_flag', 'contract_type', 'contract_status')
+const { contract_category, business_direction, active_flag, contract_flag, contract_type, contract_status, plan_flag } = toRefs(
+ proxy?.useDict('contract_category', 'business_direction', 'active_flag', 'contract_flag', 'contract_type', 'contract_status', 'plan_flag')
);
const buttonLoading = ref(false);
@@ -350,6 +384,21 @@ const getUnitInfoListSelect = async () => {
unitInfoList.value = res.data;
};
+/** 查询部门信息下拉框结构 */
+const deptInfoList = ref([]);
+const getDeptInfoListSelect = async () => {
+ const params = { deptCategory: '03' } as any;
+ let res = await listDept(params);
+ deptInfoList.value = res.data;
+};
+
+/** 查询客户信息下拉框结构 */
+const customerInfoList = ref([]);
+const getCustomerInfoListSelect = async () => {
+ let res = await getCrmCustomerInfoList(null);
+ customerInfoList.value = res.data;
+};
+
// 合同物料对话框
const materialDialog = reactive({
visible: false,
@@ -359,6 +408,7 @@ const materialDialog = reactive({
// 合同物料表单数据
const initMaterialFormData: ContractMaterialForm = {
contractMaterialId: undefined,
+ planFlag: '2',
contractId: undefined,
productName: undefined,
specificationDescription: undefined,
@@ -393,14 +443,14 @@ const initFormData: ContractInfoForm = {
businessDirection: undefined,
contractDeptId: undefined,
contractDate: undefined,
- totalPrice: undefined,
- aCustomerId: undefined,
- aRepresent: undefined,
- aDate: undefined,
- bCustomerId: undefined,
- bRepresent: undefined,
- bDate: undefined,
- contractStatus: undefined,
+ totalPrice: 0,
+ oneCustomerId: undefined,
+ oneRepresent: undefined,
+ oneDate: undefined,
+ twoCustomerId: undefined,
+ twoRepresent: undefined,
+ twoDate: undefined,
+ contractStatus: '1',
flowStatus: undefined,
templateId: undefined,
ossId: undefined,
@@ -408,7 +458,7 @@ const initFormData: ContractInfoForm = {
signatureAppendix: undefined,
taxRate: undefined,
remark: undefined,
- activeFlag: undefined,
+ activeFlag: '1',
contractMaterialList: []
} as any;
@@ -426,14 +476,16 @@ const goBack = () => {
};
// 监听contractFlag变化
-watch(() => form.value.contractFlag, (newVal, oldVal) => {
- if (newVal === '2') {
- // 当选择"无合同"时,清空合同编号并重置生成状态
- form.value.contractCode = undefined;
- isCodeGenerated.value = false;
+watch(
+ () => form.value.contractFlag,
+ (newVal, oldVal) => {
+ if (newVal === '2') {
+ // 当选择"无合同"时,清空合同编号并重置生成状态
+ form.value.contractCode = undefined;
+ isCodeGenerated.value = false;
+ }
}
-});
-
+);
// 生成合同编号
const generateContractCode = async () => {
@@ -471,6 +523,13 @@ const submitForm = () => {
contractInfoFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
+ console.log('提交的表单数据:', JSON.stringify(form.value, null, 2));
+ console.log('甲方公司ID:', form.value.oneCustomerId);
+ console.log('甲方授权代表:', form.value.oneRepresent);
+ console.log('甲方签字日期:', form.value.oneDate);
+ console.log('乙方公司ID:', form.value.twoCustomerId);
+ console.log('乙方授权代表:', form.value.twoRepresent);
+ console.log('乙方签字日期:', form.value.twoDate);
if (form.value.contractId) {
await updateContractInfo(form.value).finally(() => (buttonLoading.value = false));
} else {
@@ -502,7 +561,7 @@ const getContractMaterialList = async () => {
// 新增物料(新增合同时也可添加,不依赖contractId)
const handleAddMaterial = () => {
resetMaterialForm();
- materialForm.value.contractId = form.value.contractId;
+ // materialForm.value.contractId = form.value.contractId;
materialDialog.visible = true;
materialDialog.title = '新增合同物料';
};
@@ -656,5 +715,7 @@ onMounted(async () => {
}
}
await getUnitInfoListSelect();
+ await getDeptInfoListSelect();
+ await getCustomerInfoListSelect();
});
diff --git a/src/views/oa/erp/contractInfo/index.vue b/src/views/oa/erp/contractInfo/index.vue
index a654bc9..d5a698a 100644
--- a/src/views/oa/erp/contractInfo/index.vue
+++ b/src/views/oa/erp/contractInfo/index.vue
@@ -105,18 +105,18 @@
-
-
+
+
- {{ parseTime(scope.row.aDate, '{y}-{m}-{d}') }}
+ {{ parseTime(scope.row.oneDate, '{y}-{m}-{d}') }}
-
-
-
+
+
+
- {{ parseTime(scope.row.bDate, '{y}-{m}-{d}') }}
+ {{ parseTime(scope.row.twoDate, '{y}-{m}-{d}') }}
@@ -233,12 +233,12 @@ const data = reactive<{ queryParams: ContractInfoQuery }>({
contractDeptId: undefined,
contractDate: undefined,
totalPrice: undefined,
- aCustomerId: undefined,
- aRepresent: undefined,
- aDate: undefined,
- bCustomerId: undefined,
- bRepresent: undefined,
- bDate: undefined,
+ oneCustomerId: undefined,
+ oneRepresent: undefined,
+ oneDate: undefined,
+ twoCustomerId: undefined,
+ twoRepresent: undefined,
+ twoDate: undefined,
contractStatus: undefined,
flowStatus: undefined,
templateId: undefined,