1.0.11 合同物料添加优化

dev
yinq 2 months ago
parent d8ad7227a9
commit 43d27c9dc3

@ -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;
/**
* ()
*/

@ -122,6 +122,11 @@ export interface ContractMaterialForm extends BaseEntity {
*/
materialId?: string | number;
/**
*
*/
materialName?: string;
/**
* ID
*/

@ -17,7 +17,7 @@
<el-form-item label="合同编号" prop="contractCode" v-if="form.contractFlag === '1'">
<el-input v-model="form.contractCode" placeholder="请输入合同编号">
<template #append>
<el-button type="primary" @click="generateContractCode" :disabled="isCodeGenerated">生成合同编号</el-button>
<el-button type="primary" @click="generateContractCode" :disabled="isCodeGenerated">生成合同编号 </el-button>
</template>
</el-input>
</el-form-item>
@ -50,7 +50,9 @@
</el-col>
<el-col :span="12">
<el-form-item label="部门" prop="contractDeptId">
<el-input v-model="form.contractDeptId" placeholder="请输入部门" />
<el-select v-model="form.contractDeptId" placeholder="请选择部门">
<el-option v-for="item in deptInfoList" :key="item.deptId" :label="item.deptName" :value="item.deptId" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
@ -68,38 +70,52 @@
</el-col>
<el-col :span="12">
<el-form-item label="付款方式" prop="paymentMethod">
<el-input v-model="form.paymentMethod" placeholder="请输入付款方式" />
<el-input v-model="form.paymentMethod" placeholder="3-3-3-1" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="甲方公司" prop="aCustomerId">
<el-input v-model="form.aCustomerId" placeholder="请输入甲方公司" />
<el-form-item label="甲方公司" prop="oneCustomerId">
<el-select v-model="form.oneCustomerId" placeholder="请选择甲方公司" filterable >
<el-option
v-for="item in customerInfoList"
:key="item.customerId"
:label="item.customerName"
:value="item.customerId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="乙方公司" prop="bCustomerId">
<el-input v-model="form.bCustomerId" placeholder="请输入乙方公司" />
<el-form-item label="乙方公司" prop="twoCustomerId">
<el-select v-model="form.twoCustomerId" placeholder="请选择乙方公司" filterable >
<el-option
v-for="item in customerInfoList"
:key="item.customerId"
:label="item.customerName"
:value="item.customerId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="甲方授权代表" prop="aRepresent">
<el-input v-model="form.aRepresent" placeholder="请输入甲方授权代表" />
<el-form-item label="甲方授权代表" prop="oneRepresent">
<el-input v-model="form.oneRepresent" placeholder="请输入甲方授权代表" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="乙方授权代表" prop="bRepresent">
<el-input v-model="form.bRepresent" placeholder="请输入乙方授权代表" />
<el-form-item label="乙方授权代表" prop="twoRepresent">
<el-input v-model="form.twoRepresent" placeholder="请输入乙方授权代表" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="甲方签字日期" prop="aDate">
<el-date-picker clearable v-model="form.aDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择甲方签字日期">
<el-form-item label="甲方签字日期" prop="oneDate">
<el-date-picker clearable v-model="form.oneDate" type="date" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择甲方签字日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="乙方签字日期" prop="bDate">
<el-date-picker clearable v-model="form.bDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择乙方签字日期">
<el-form-item label="乙方签字日期" prop="twoDate">
<el-date-picker clearable v-model="form.twoDate" type="date" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择乙方签字日期">
</el-date-picker>
</el-form-item>
</el-col>
@ -200,8 +216,19 @@
<el-form ref="materialFormRef" :model="materialForm" :rules="materialRules" label-width="120px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产品名称" prop="productName">
<el-input v-model="materialForm.productName" placeholder="计划内请点击右侧图标检索物料">
<el-form-item label="计划标识" prop="planFlag">
<el-radio-group v-model="materialForm.planFlag">
<el-radio
v-for="dict in plan_flag"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="materialForm.materialName" placeholder="计划内请点击右侧图标检索物料">
<template #suffix>
<el-icon style="cursor: pointer" @click="openMaterialSelect">
<Search />
@ -210,6 +237,11 @@
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品名称" prop="productName">
<el-input v-model="materialForm.productName" placeholder="请输入产品名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格描述" prop="specificationDescription">
<el-input v-model="materialForm.specificationDescription" placeholder="请输入规格描述" />
@ -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<any>(
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<any>(
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();
});
</script>

@ -105,18 +105,18 @@
</template>
</el-table-column>
<el-table-column label="合同总价" align="center" prop="totalPrice" v-if="columns[10].visible" />
<el-table-column label="甲方公司" align="center" prop="aCustomerId" v-if="columns[11].visible" />
<el-table-column label="甲方授权代表" align="center" prop="aRepresent" width="110" v-if="columns[12].visible" />
<el-table-column label="甲方公司" align="center" prop="oneCustomerId" v-if="columns[11].visible" />
<el-table-column label="甲方授权代表" align="center" prop="oneRepresent" width="110" v-if="columns[12].visible" />
<el-table-column label="甲方签字日期" align="center" prop="aDate" width="120" v-if="columns[13].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.aDate, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.oneDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="乙方公司" align="center" prop="bCustomerId" v-if="columns[14].visible" />
<el-table-column label="乙方授权代表" align="center" prop="bRepresent" width="110" v-if="columns[15].visible" />
<el-table-column label="乙方签字日期" align="center" prop="bDate" width="120" v-if="columns[16].visible">
<el-table-column label="乙方公司" align="center" prop="twoCustomerId" v-if="columns[14].visible" />
<el-table-column label="乙方授权代表" align="center" prop="twoRepresent" width="110" v-if="columns[15].visible" />
<el-table-column label="乙方签字日期" align="center" prop="twoDate" width="120" v-if="columns[16].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.bDate, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.twoDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="合同状态" align="center" prop="contractStatus" v-if="columns[17].visible">
@ -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,

Loading…
Cancel
Save