|
|
|
@ -20,8 +20,8 @@
|
|
|
|
<el-button class="float-right" link @click="goBack">返回</el-button>
|
|
|
|
<el-button class="float-right" link @click="goBack">返回</el-button>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
|
|
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
|
|
|
<el-form-item label="变更编号" prop="changeCode" :disabled="isFormDisabled">
|
|
|
|
<el-form-item label="变更编号" prop="changeCode">
|
|
|
|
<el-input v-model="form.changeCode" placeholder="保存后自动生成" />
|
|
|
|
<el-input v-model="form.changeCode" placeholder="保存后自动生成" disabled/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="变更类型" prop="changeType">
|
|
|
|
<el-form-item label="变更类型" prop="changeType">
|
|
|
|
<el-radio-group v-model="form.changeType" :disabled="isFormDisabled">
|
|
|
|
<el-radio-group v-model="form.changeType" :disabled="isFormDisabled">
|
|
|
|
@ -648,20 +648,21 @@ function contractSelectCallBack(list: ContractInfoVO[]) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function onContractChange(contractId: string | number) {
|
|
|
|
async function onContractChange(contractId: string | number) {
|
|
|
|
if (!contractId || form.value.changeType !== '1') return;
|
|
|
|
if (!contractId) return;
|
|
|
|
const res = await getContractInfo(contractId);
|
|
|
|
const res = await getContractInfo(contractId);
|
|
|
|
const c = res.data;
|
|
|
|
const c = res.data;
|
|
|
|
if (!c) return;
|
|
|
|
if (!c) return;
|
|
|
|
|
|
|
|
const cAny = c as any;
|
|
|
|
form.value.contractCode = c.contractCode;
|
|
|
|
form.value.contractCode = c.contractCode;
|
|
|
|
form.value.contractName = c.contractName;
|
|
|
|
form.value.contractName = c.contractName;
|
|
|
|
const cAny = c as any;
|
|
|
|
|
|
|
|
form.value.originalCustomerName = cAny.oneCustomerName || cAny.twoCustomerName;
|
|
|
|
form.value.originalCustomerName = cAny.oneCustomerName || cAny.twoCustomerName;
|
|
|
|
form.value.originalContractAmount = c.totalPrice as any;
|
|
|
|
form.value.originalContractAmount = c.totalPrice as any;
|
|
|
|
|
|
|
|
if (form.value.changeType === '1') {
|
|
|
|
form.value.changeContractCode = c.contractCode;
|
|
|
|
form.value.changeContractCode = c.contractCode;
|
|
|
|
form.value.changeContractName = c.contractName;
|
|
|
|
form.value.changeContractName = c.contractName;
|
|
|
|
form.value.customerName = cAny.oneCustomerName || cAny.twoCustomerName;
|
|
|
|
form.value.customerName = cAny.oneCustomerName || cAny.twoCustomerName;
|
|
|
|
form.value.changeContractAmount = c.totalPrice as any;
|
|
|
|
form.value.changeContractAmount = c.totalPrice as any;
|
|
|
|
form.value.changeInfo = c ? mapContractToChangeInfo(c) : undefined;
|
|
|
|
form.value.changeInfo = mapContractToChangeInfo(c);
|
|
|
|
form.value.changeMaterialList = (cAny.contractMaterialList || []).map((m: any) => ({
|
|
|
|
form.value.changeMaterialList = (cAny.contractMaterialList || []).map((m: any) => ({
|
|
|
|
...m,
|
|
|
|
...m,
|
|
|
|
changeMaterialId: undefined,
|
|
|
|
changeMaterialId: undefined,
|
|
|
|
@ -672,6 +673,7 @@ async function onContractChange(contractId: string | number) {
|
|
|
|
changePaymentId: undefined,
|
|
|
|
changePaymentId: undefined,
|
|
|
|
contractChangeId: undefined
|
|
|
|
contractChangeId: undefined
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function mapContractToChangeInfo(c: any) {
|
|
|
|
function mapContractToChangeInfo(c: any) {
|
|
|
|
|