|
|
@@ -88,7 +88,10 @@
|
|
|
<el-radio :label="1">是</el-radio>
|
|
|
<el-radio :label="0">否</el-radio>
|
|
|
</el-radio-group>
|
|
|
- <span v-if="form.isSuspend == 1" style="margin-left: 10px; font-size: 12px; color: #1890ff;">
|
|
|
+ <span
|
|
|
+ v-if="form.isSuspend == 1"
|
|
|
+ style="margin-left: 10px; font-size: 12px; color: #1890ff"
|
|
|
+ >
|
|
|
挂单只能选择一个产品
|
|
|
</span>
|
|
|
</el-form-item>
|
|
|
@@ -118,8 +121,6 @@
|
|
|
/>
|
|
|
</el-form-item> -->
|
|
|
|
|
|
-
|
|
|
-
|
|
|
<!-- <el-form-item prop="productionRequirements" label="生产要求">
|
|
|
<el-input
|
|
|
clearable
|
|
|
@@ -255,10 +256,7 @@
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item
|
|
|
- label="业务员"
|
|
|
- prop="salesmanId"
|
|
|
- >
|
|
|
+ <el-form-item label="业务员" prop="salesmanId">
|
|
|
<personSelect
|
|
|
ref="salseManDirectorRef"
|
|
|
v-model="form.salesmanId"
|
|
|
@@ -285,7 +283,6 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
-
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="交易方式" prop="transactionMode">
|
|
|
<el-select
|
|
|
@@ -328,7 +325,11 @@
|
|
|
>
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="form.settlementMode == 1" label="结算日期范围" prop="settlementDate">
|
|
|
+ <el-form-item
|
|
|
+ v-if="form.settlementMode == 1"
|
|
|
+ label="结算日期范围"
|
|
|
+ prop="settlementDate"
|
|
|
+ >
|
|
|
<el-date-picker
|
|
|
style="width: 100%"
|
|
|
v-model="form.settlementDate"
|
|
|
@@ -338,11 +339,16 @@
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
- @change="settlementDateChange">
|
|
|
+ @change="settlementDateChange"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item v-if="form.settlementMode == 2" label="结算月份范围" prop="settlementDate">
|
|
|
+ <el-form-item
|
|
|
+ v-if="form.settlementMode == 2"
|
|
|
+ label="结算月份范围"
|
|
|
+ prop="settlementDate"
|
|
|
+ >
|
|
|
<!-- <el-date-picker
|
|
|
v-model="form.contractEndDate"
|
|
|
type="date"
|
|
|
@@ -363,17 +369,30 @@
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="form.settlementMode == 2" label="收款日期" prop="receiptDate">
|
|
|
- <el-input type="number" :min="1" :max="31" placeholder="请输入" v-model="form.receiptDate" @input="receiptDateChange">
|
|
|
+ <el-form-item
|
|
|
+ v-if="form.settlementMode == 2"
|
|
|
+ label="收款日期"
|
|
|
+ prop="receiptDate"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ :min="1"
|
|
|
+ :max="31"
|
|
|
+ placeholder="请输入"
|
|
|
+ v-model="form.receiptDate"
|
|
|
+ @input="receiptDateChange"
|
|
|
+ >
|
|
|
<template slot="prepend">每月</template>
|
|
|
<template slot="append">日</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="期数"
|
|
|
- prop="issueNumber"
|
|
|
- >
|
|
|
- <el-input type="number" :min="1" v-model="form.issueNumber" @input="issueNumberChange">
|
|
|
+ <el-form-item label="期数" prop="issueNumber">
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ :min="1"
|
|
|
+ v-model="form.issueNumber"
|
|
|
+ @input="issueNumberChange"
|
|
|
+ >
|
|
|
<template slot="append">
|
|
|
<span>期</span>
|
|
|
</template>
|
|
|
@@ -655,10 +674,7 @@
|
|
|
</el-row>
|
|
|
|
|
|
<div v-if="form.needProduce != 2 && form.needProduce != 4">
|
|
|
- <headerTitle
|
|
|
- title="收款计划"
|
|
|
- style="margin-top: 30px"
|
|
|
- ></headerTitle>
|
|
|
+ <headerTitle title="收款计划" style="margin-top: 30px"></headerTitle>
|
|
|
<PaymentCollectionPlan
|
|
|
ref="paymentCollectionPlanRef"
|
|
|
menu="sale"
|
|
|
@@ -666,7 +682,6 @@
|
|
|
@getIssueNumber="setIssueNumber"
|
|
|
></PaymentCollectionPlan>
|
|
|
</div>
|
|
|
-
|
|
|
</el-form>
|
|
|
|
|
|
<div slot="footer" class="footer">
|
|
|
@@ -724,6 +739,9 @@
|
|
|
<saleOrderListDialog
|
|
|
ref="saleOrderListDialogRef"
|
|
|
:isMy="true"
|
|
|
+ :contactData="{
|
|
|
+ id: form.partaId
|
|
|
+ }"
|
|
|
@changeParent="saleOrderListDialogChange"
|
|
|
></saleOrderListDialog>
|
|
|
<!-- 退货 -->
|
|
|
@@ -767,7 +785,10 @@
|
|
|
import projectListDialog from './projectListDialog.vue';
|
|
|
|
|
|
import paymentList from './paymentList.vue';
|
|
|
- import { listOrganizations, listOrganizationsNew } from '@/api/system/organization';
|
|
|
+ import {
|
|
|
+ listOrganizations,
|
|
|
+ listOrganizationsNew
|
|
|
+ } from '@/api/system/organization';
|
|
|
import { copyObj } from '@/utils/util';
|
|
|
import { enterprisePage } from '@/api/contractManage/contractBook';
|
|
|
// import fileMain from '@/components/addDoc/index.vue';
|
|
|
@@ -782,7 +803,7 @@
|
|
|
import opportunityDialog from '@/views/financialManage/components/opportunityDialog.vue';
|
|
|
import { mapGetters } from 'vuex';
|
|
|
import personSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
- import PaymentCollectionPlan from '@/BIZComponents/paymentCollectionPlan/Index.vue'
|
|
|
+ import PaymentCollectionPlan from '@/BIZComponents/paymentCollectionPlan/Index.vue';
|
|
|
import { shippingModeOp, transactionMethodsOp } from '@/enum/dict.js';
|
|
|
import { formatPrice } from '@/BIZComponents/setProduct.js';
|
|
|
export default {
|
|
|
@@ -959,7 +980,7 @@
|
|
|
isTaxRate: 0,
|
|
|
isSinglePrice: 0,
|
|
|
isDeptAndPerson: 0,
|
|
|
- defaultTransactionMode: 1,
|
|
|
+ defaultTransactionMode: 1
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -1033,10 +1054,26 @@
|
|
|
{ pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur' }
|
|
|
],
|
|
|
payAmount: [{ required: true, message: '请输入', trigger: 'blur' }],
|
|
|
- salesmanId: [{ required: this.isDeptAndPerson == 1 ? true : false, message: '请选择业务员', trigger: 'change' }],
|
|
|
- salesDeptId: [{ required: this.isDeptAndPerson == 1 ? true : false, message: '请选择销售部门', trigger: 'change' }],
|
|
|
- settlementDate: [{ required: true, message: '请选择结算日期', trigger: 'change' }],
|
|
|
- receiptDate: [{ required: true, message: '请选择收款日期', trigger: 'change' }]
|
|
|
+ salesmanId: [
|
|
|
+ {
|
|
|
+ required: this.isDeptAndPerson == 1 ? true : false,
|
|
|
+ message: '请选择业务员',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ salesDeptId: [
|
|
|
+ {
|
|
|
+ required: this.isDeptAndPerson == 1 ? true : false,
|
|
|
+ message: '请选择销售部门',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ settlementDate: [
|
|
|
+ { required: true, message: '请选择结算日期', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ receiptDate: [
|
|
|
+ { required: true, message: '请选择收款日期', trigger: 'change' }
|
|
|
+ ]
|
|
|
};
|
|
|
}
|
|
|
},
|
|
|
@@ -1087,15 +1124,21 @@
|
|
|
},
|
|
|
setCountAmount(allPrice, discountTotalPrice) {
|
|
|
this.form.totalAmount = allPrice;
|
|
|
- this.form.payAmount = discountTotalPrice ? discountTotalPrice : allPrice;
|
|
|
- this.$refs.paymentCollectionPlanRef?.setDiscountAmount(this.form.payAmount);
|
|
|
+ this.form.payAmount = discountTotalPrice
|
|
|
+ ? discountTotalPrice
|
|
|
+ : allPrice;
|
|
|
+ this.$refs.paymentCollectionPlanRef?.setDiscountAmount(
|
|
|
+ this.form.payAmount
|
|
|
+ );
|
|
|
},
|
|
|
setTotalPlanNum(totalPlanNum) {
|
|
|
this.$set(this.form, 'totalPlanNum', totalPlanNum);
|
|
|
},
|
|
|
discountInput() {
|
|
|
this.$refs.inventoryTable.discountInputByOrder(this.form.payAmount);
|
|
|
- this.$refs.paymentCollectionPlanRef?.setDiscountAmount(this.form.payAmount);
|
|
|
+ this.$refs.paymentCollectionPlanRef?.setDiscountAmount(
|
|
|
+ this.form.payAmount
|
|
|
+ );
|
|
|
},
|
|
|
// 选择负责人部门
|
|
|
change_principalDep(id) {
|
|
|
@@ -1106,7 +1149,6 @@
|
|
|
// 根据部门获取人员
|
|
|
this.$nextTick(() => {});
|
|
|
this.getSalesmanUser(id);
|
|
|
-
|
|
|
},
|
|
|
getSalesmanUser(groupId) {
|
|
|
if (groupId) {
|
|
|
@@ -1120,7 +1162,12 @@
|
|
|
},
|
|
|
// 获取公司数据
|
|
|
getGroupAll() {
|
|
|
- const apiRequest = this.clientEnvironmentId == 6 ? listOrganizationsNew({deptIds: ['1998632792148717569', '1998632872721297409']}) : listOrganizations();
|
|
|
+ const apiRequest =
|
|
|
+ this.clientEnvironmentId == 6
|
|
|
+ ? listOrganizationsNew({
|
|
|
+ deptIds: ['1998632792148717569', '1998632872721297409']
|
|
|
+ })
|
|
|
+ : listOrganizations();
|
|
|
apiRequest.then((list) => {
|
|
|
// console.log('listOrganizations', list);
|
|
|
this.groupData = list;
|
|
|
@@ -1327,7 +1374,7 @@
|
|
|
if (data) {
|
|
|
await this.changeParent({ id: data.contractVO?.partaId }, true);
|
|
|
let { contractVO } = data;
|
|
|
-
|
|
|
+
|
|
|
this.$nextTick(() => {
|
|
|
let {
|
|
|
partaAddress,
|
|
|
@@ -1368,7 +1415,7 @@
|
|
|
deliveryMode,
|
|
|
contractStartDate
|
|
|
} = contractVO;
|
|
|
- if(businessDeptId){
|
|
|
+ if (businessDeptId) {
|
|
|
this.getSalesmanUser(businessDeptId);
|
|
|
}
|
|
|
this.form = Object.assign(
|
|
|
@@ -1398,7 +1445,8 @@
|
|
|
partbUnifiedSocialCreditCode,
|
|
|
totalAmount: totalPrice,
|
|
|
payAmount: discountTotalPrice || totalPrice,
|
|
|
- receiveAddress: this.clientEnvironmentId == 5 ? '' : partaAddress,
|
|
|
+ receiveAddress:
|
|
|
+ this.clientEnvironmentId == 5 ? '' : partaAddress,
|
|
|
settlementMode,
|
|
|
settlementModeName,
|
|
|
contractNo,
|
|
|
@@ -1415,7 +1463,9 @@
|
|
|
endSettlementDate,
|
|
|
deliveryMode,
|
|
|
contractStartDate,
|
|
|
- settlementDate: startSettlementDate ? [startSettlementDate, endSettlementDate] : [],
|
|
|
+ settlementDate: startSettlementDate
|
|
|
+ ? [startSettlementDate, endSettlementDate]
|
|
|
+ : []
|
|
|
},
|
|
|
!row
|
|
|
? {
|
|
|
@@ -1435,15 +1485,13 @@
|
|
|
const receiptData = {
|
|
|
receiptPaymentList: data.receiptPaymentList,
|
|
|
payAmount: discountTotalPrice
|
|
|
- }
|
|
|
+ };
|
|
|
this.$refs.paymentCollectionPlanRef &&
|
|
|
this.$refs.paymentCollectionPlanRef.putTableValue(receiptData);
|
|
|
|
|
|
this.getLinkInfo(partaId);
|
|
|
this.$refs.inventoryTable &&
|
|
|
this.$refs.inventoryTable.putTableValue(data);
|
|
|
-
|
|
|
-
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
@@ -1454,7 +1502,9 @@
|
|
|
this.loading = true;
|
|
|
const data = await getSaleOrderDetail(id);
|
|
|
this.loading = false;
|
|
|
- data.settlementDate = data.startSettlementDate ? [data.startSettlementDate, data.endSettlementDate] : [];
|
|
|
+ data.settlementDate = data.startSettlementDate
|
|
|
+ ? [data.startSettlementDate, data.endSettlementDate]
|
|
|
+ : [];
|
|
|
this.form = data;
|
|
|
if (data.partaId) {
|
|
|
await this.changeParent({ id: data.partaId }, true);
|
|
|
@@ -1463,18 +1513,19 @@
|
|
|
if (data) {
|
|
|
data.saleType = +data.saleType;
|
|
|
this.$nextTick(() => {
|
|
|
- if(data.salesDeptId) {
|
|
|
+ if (data.salesDeptId) {
|
|
|
this.getSalesmanUser(data.salesDeptId);
|
|
|
}
|
|
|
this.$refs.inventoryTable &&
|
|
|
this.$refs.inventoryTable.putTableValue(data);
|
|
|
this.$refs.typeListRef &&
|
|
|
this.$refs.typeListRef.putTableValue(data.typedetailList);
|
|
|
-
|
|
|
+
|
|
|
this.getLinkInfo(data.partaId);
|
|
|
console.log('paymentCollectionPlanRef~~~~', data);
|
|
|
-
|
|
|
- this.$refs.paymentCollectionPlanRef && this.$refs.paymentCollectionPlanRef.putTableValue(data);
|
|
|
+
|
|
|
+ this.$refs.paymentCollectionPlanRef &&
|
|
|
+ this.$refs.paymentCollectionPlanRef.putTableValue(data);
|
|
|
// this.$refs.paymentCollectionPlanRef.setDiscountAmount(data.payAmount);
|
|
|
this.$store.commit('order/setContractId', data.partaId);
|
|
|
});
|
|
|
@@ -1509,6 +1560,10 @@
|
|
|
this.$refs.headRef.open(item);
|
|
|
},
|
|
|
orderListShow() {
|
|
|
+ if (!this.form.partaId) {
|
|
|
+ this.$message.warning('请先选择客户');
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$refs.saleOrderListDialogRef.open();
|
|
|
},
|
|
|
async saleOrderListDialogChange(row) {
|
|
|
@@ -1550,7 +1605,8 @@
|
|
|
this.$refs.inventoryTable.putTableValue(data);
|
|
|
this.$refs.typeListRef &&
|
|
|
this.$refs.typeListRef.putTableValue(data.typedetailList);
|
|
|
- this.$refs.paymentCollectionPlanRef && this.$refs.paymentCollectionPlanRef.putTableValue(data);
|
|
|
+ this.$refs.paymentCollectionPlanRef &&
|
|
|
+ this.$refs.paymentCollectionPlanRef.putTableValue(data);
|
|
|
|
|
|
this.getLinkInfo(data.partaId);
|
|
|
this.$store.commit('order/setContractId', data.partaId);
|
|
|
@@ -1594,7 +1650,10 @@
|
|
|
partaTel: '',
|
|
|
partaUnifiedSocialCreditCode: base?.unifiedSocialCreditCode,
|
|
|
customerMark: base?.serialNo,
|
|
|
- receiveAddress: this.clientEnvironmentId == 5 ? '' : other?.addressName + other?.address,
|
|
|
+ receiveAddress:
|
|
|
+ this.clientEnvironmentId == 5
|
|
|
+ ? ''
|
|
|
+ : other?.addressName + other?.address,
|
|
|
receivePerson: defaultReceived?.linkName
|
|
|
});
|
|
|
this.changePersonel(userInfo?.id ? userInfo : '');
|
|
|
@@ -1653,7 +1712,7 @@
|
|
|
contractName: obj.contractName,
|
|
|
relationType: 3,
|
|
|
productionRequirements: obj.productionRequirements,
|
|
|
- contractStartDate: obj.contractStartDate,
|
|
|
+ contractStartDate: obj.contractStartDate
|
|
|
});
|
|
|
this.getDetailData(obj.id);
|
|
|
this.$store.commit('order/setContractId', obj.id);
|
|
|
@@ -1770,7 +1829,7 @@
|
|
|
this.form.saleType = 1;
|
|
|
this.$nextTick(() => {
|
|
|
this.issueNumberChange(this.form.issueNumber);
|
|
|
- })
|
|
|
+ });
|
|
|
// this.form.progress = 700;
|
|
|
//嘉实默认值
|
|
|
if (this.clientEnvironmentId == 5) {
|
|
|
@@ -1779,7 +1838,7 @@
|
|
|
this.form.progress = 700;
|
|
|
this.form.settlementMode = '6';
|
|
|
this.form.settlementModeName = '款到发货';
|
|
|
- this.form.transactionMode = 2
|
|
|
+ this.form.transactionMode = 2;
|
|
|
}
|
|
|
//宝悦默认值
|
|
|
if (this.clientEnvironmentId == 4) {
|
|
|
@@ -1791,8 +1850,8 @@
|
|
|
this.form.salesDeptId = '1998632792148717569';
|
|
|
this.form.salesDeptName = '营销部';
|
|
|
this.$nextTick(() => {
|
|
|
- this.getSalesmanUser(this.form.salesDeptId)
|
|
|
- })
|
|
|
+ this.getSalesmanUser(this.form.salesDeptId);
|
|
|
+ });
|
|
|
}
|
|
|
} else {
|
|
|
this.isUpdate = true;
|
|
|
@@ -1850,13 +1909,9 @@
|
|
|
},
|
|
|
|
|
|
// 交易方式改变
|
|
|
- transactionModeChange(v) {
|
|
|
-
|
|
|
- },
|
|
|
+ transactionModeChange(v) {},
|
|
|
// 配送方式改变
|
|
|
- deliveryModeChange(v) {
|
|
|
-
|
|
|
- },
|
|
|
+ deliveryModeChange(v) {},
|
|
|
|
|
|
// 结算方式改变
|
|
|
settlementModeChange(v) {
|
|
|
@@ -1865,14 +1920,17 @@
|
|
|
// this.$set(this.form, 'issueNumber', 1);
|
|
|
this.$set(this.form, 'settlementDate', []);
|
|
|
this.$set(this.form, 'receiptDate', 1);
|
|
|
-
|
|
|
- if(v.dictCode == 3) {
|
|
|
+
|
|
|
+ if (v.dictCode == 3) {
|
|
|
this.$set(this.form, 'issueNumber', 2);
|
|
|
} else {
|
|
|
this.$set(this.form, 'issueNumber', 1);
|
|
|
}
|
|
|
- this.$refs.paymentCollectionPlanRef?.defaultList(v.dictCode, this.form.issueNumber);
|
|
|
- },
|
|
|
+ this.$refs.paymentCollectionPlanRef?.defaultList(
|
|
|
+ v.dictCode,
|
|
|
+ this.form.issueNumber
|
|
|
+ );
|
|
|
+ },
|
|
|
ifChiefChange(value, idx) {
|
|
|
if (value === 1) {
|
|
|
this.tableLinkData.forEach((e) => (e.ifChief = 0));
|
|
|
@@ -1920,7 +1978,7 @@
|
|
|
})
|
|
|
);
|
|
|
}
|
|
|
- if(this.form.needProduce != 2 && this.form.needProduce != 4) {
|
|
|
+ if (this.form.needProduce != 2 && this.form.needProduce != 4) {
|
|
|
arr.push(
|
|
|
new Promise((resolve, reject) => {
|
|
|
this.$refs.paymentCollectionPlanRef.validateForm((valid) => {
|
|
|
@@ -1933,14 +1991,13 @@
|
|
|
})
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
|
|
|
return Promise.all(arr);
|
|
|
},
|
|
|
async save(type) {
|
|
|
try {
|
|
|
await this.getValidate();
|
|
|
-
|
|
|
+
|
|
|
// 表单验证通过,执行保存操作
|
|
|
this.loading = true;
|
|
|
let isTemporary = [];
|
|
|
@@ -1953,25 +2010,60 @@
|
|
|
productList: this.$refs?.inventoryTable?.getTableValue() || [],
|
|
|
typedetailList: this.$refs?.typeListRef?.getTableValue() || [],
|
|
|
saleTypeName: this.getDictValue('销售类型', this.form.saleType),
|
|
|
- receiptPaymentList: this.$refs?.paymentCollectionPlanRef?.getTableValue() || [],
|
|
|
- endSettlementDate: this.form.settlementDate?.length ?this.form.settlementDate[1] : '',
|
|
|
- startSettlementDate: this.form.settlementDate?.length ? this.form.settlementDate[0] : ''
|
|
|
+ receiptPaymentList:
|
|
|
+ this.$refs?.paymentCollectionPlanRef?.getTableValue() || [],
|
|
|
+ endSettlementDate: this.form.settlementDate?.length
|
|
|
+ ? this.form.settlementDate[1]
|
|
|
+ : '',
|
|
|
+ startSettlementDate: this.form.settlementDate?.length
|
|
|
+ ? this.form.settlementDate[0]
|
|
|
+ : ''
|
|
|
// progress: this.form.needProduce == 0 ? 700 : 0
|
|
|
});
|
|
|
|
|
|
- if(commitData.isSuspend == 1 && commitData.productList?.length > 1){
|
|
|
+ if (commitData.isSuspend == 1 && commitData.productList?.length > 1) {
|
|
|
this.$message.error('挂起订单只能选择一个产品');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if(commitData.needProduce != 2 && commitData.needProduce != 4) {
|
|
|
- const ratioSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + +cur.ratio, 0);
|
|
|
+ if (commitData.needProduce != 2 && commitData.needProduce != 4) {
|
|
|
+ const ratioSum = commitData.receiptPaymentList.reduce(
|
|
|
+ (acc, cur) => acc + +cur.ratio,
|
|
|
+ 0
|
|
|
+ );
|
|
|
|
|
|
- if(+ratioSum > 100){
|
|
|
+ if (+ratioSum > 100) {
|
|
|
this.$message.error('比例合计不能超过100%');
|
|
|
return;
|
|
|
}
|
|
|
+ let is = false;
|
|
|
+ commitData.productList.forEach((v, i) => {
|
|
|
+ commitData.productList.forEach((v2, j) => {
|
|
|
+ if (
|
|
|
+ v.productCode == v2.productCode &&
|
|
|
+ v.taskId == v2.taskId &&
|
|
|
+ v.batchNo == v2.batchNo &&
|
|
|
+ v.colorKey == v2.colorKey &&
|
|
|
+ i != j
|
|
|
+ ) {
|
|
|
+ is = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ if (isTemporary.length > 0) {
|
|
|
+ this.$message.error(
|
|
|
+ isTemporary.toString() +
|
|
|
+ '是临时产品,无法创建订单,请先去主数据维护!'
|
|
|
+ );
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
+ if (is) {
|
|
|
+ this.$message.error('同产品,工序、批次号、颜色不能完全一致!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
// if(+ratioSum != 100){
|
|
|
// this.$message.error('比例合计必须为100%');
|
|
|
// return;
|
|
|
@@ -1980,7 +2072,7 @@
|
|
|
// 使用万分之一进行计算,避免浮点数精度问题(对应4位小数)
|
|
|
// let receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + Math.round(+cur.price * 10000), 0) / 10000;
|
|
|
// const payAmount = +commitData.payAmount;
|
|
|
-
|
|
|
+
|
|
|
// if(+ratioSum == 100) {
|
|
|
// // 使用万分之一进行计算,避免浮点数精度问题
|
|
|
// const difference = Math.round((payAmount - receiptPaymentListSum) * 10000) / 10000;
|
|
|
@@ -2001,7 +2093,7 @@
|
|
|
// return;
|
|
|
// }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (isTemporary.length > 0) {
|
|
|
this.$message.error(
|
|
|
isTemporary.toString() +
|
|
|
@@ -2022,7 +2114,7 @@
|
|
|
API(commitData)
|
|
|
.then((res) => {
|
|
|
this.loading = false;
|
|
|
- if(this.form.partaId) {
|
|
|
+ if (this.form.partaId) {
|
|
|
updateRelationStatus([this.form.partaId]);
|
|
|
}
|
|
|
if (this.form.contractId) {
|
|
|
@@ -2133,64 +2225,84 @@
|
|
|
settlementDateChange(val) {
|
|
|
// console.log(val);
|
|
|
let dateRange = [];
|
|
|
- if(this.form.settlementMode == 1) {
|
|
|
- // // this.transformDays(val)
|
|
|
+ if (this.form.settlementMode == 1) {
|
|
|
+ // // this.transformDays(val)
|
|
|
dateRange = this.transformDaysFun(val);
|
|
|
}
|
|
|
- if(this.form.settlementMode == 2) {
|
|
|
- // // this.transformMonth(val)
|
|
|
+ if (this.form.settlementMode == 2) {
|
|
|
+ // // this.transformMonth(val)
|
|
|
dateRange = this.transformMonthFun(val, this.form.receiptDate);
|
|
|
}
|
|
|
console.log('dateRange~~~', dateRange);
|
|
|
this.$set(this.form, 'issueNumber', dateRange.length);
|
|
|
// this.setDefaultList(dateRange)
|
|
|
- this.$refs.paymentCollectionPlanRef.defaultList(this.form.settlementMode, this.form.issueNumber, dateRange);
|
|
|
+ this.$refs.paymentCollectionPlanRef.defaultList(
|
|
|
+ this.form.settlementMode,
|
|
|
+ this.form.issueNumber,
|
|
|
+ dateRange
|
|
|
+ );
|
|
|
},
|
|
|
// 收款日变化
|
|
|
receiptDateChange(v) {
|
|
|
// this.transformMonth(this.form.settlementDate)
|
|
|
- if(this.form.settlementDate.length > 0 && this.form.issueNumber) {
|
|
|
+ if (this.form.settlementDate.length > 0 && this.form.issueNumber) {
|
|
|
const dateRange = this.transformMonthFun(this.form.settlementDate, v);
|
|
|
- this.$refs.paymentCollectionPlanRef.defaultList(this.form.settlementMode, this.form.issueNumber, dateRange);
|
|
|
+ this.$refs.paymentCollectionPlanRef.defaultList(
|
|
|
+ this.form.settlementMode,
|
|
|
+ this.form.issueNumber,
|
|
|
+ dateRange
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
// 期数变化
|
|
|
issueNumberChange(v) {
|
|
|
let dateRange = [];
|
|
|
- if(this.form.settlementMode == 1) {
|
|
|
+ if (this.form.settlementMode == 1) {
|
|
|
dateRange = this.transformDaysFun(this.form.settlementDate, v);
|
|
|
- this.$refs.paymentCollectionPlanRef.defaultList(this.form.settlementMode, v, dateRange);
|
|
|
- } else if(this.form.settlementMode == 2) {
|
|
|
+ this.$refs.paymentCollectionPlanRef.defaultList(
|
|
|
+ this.form.settlementMode,
|
|
|
+ v,
|
|
|
+ dateRange
|
|
|
+ );
|
|
|
+ } else if (this.form.settlementMode == 2) {
|
|
|
dateRange = this.transformMonthFun(this.form.settlementDate, v);
|
|
|
- this.$refs.paymentCollectionPlanRef.defaultList(this.form.settlementMode, v, dateRange);
|
|
|
+ this.$refs.paymentCollectionPlanRef.defaultList(
|
|
|
+ this.form.settlementMode,
|
|
|
+ v,
|
|
|
+ dateRange
|
|
|
+ );
|
|
|
} else {
|
|
|
- this.$refs.paymentCollectionPlanRef.defaultList(this.form.settlementMode, v);
|
|
|
+ this.$refs.paymentCollectionPlanRef.defaultList(
|
|
|
+ this.form.settlementMode,
|
|
|
+ v
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
transformDaysFun(date) {
|
|
|
const startDate = new Date(date[0]);
|
|
|
const endDate = new Date(date[1]);
|
|
|
// 计算毫秒差并转换为天数,使用Math.ceil确保结果为整数
|
|
|
- const days = Math.ceil((endDate - startDate) / (1000 * 60 * 60 * 24)) + 1;
|
|
|
+ const days =
|
|
|
+ Math.ceil((endDate - startDate) / (1000 * 60 * 60 * 24)) + 1;
|
|
|
console.log('包含两头的天数:', days);
|
|
|
|
|
|
// 生成包括头尾在内的所有日期
|
|
|
const allDates = [];
|
|
|
const current = new Date(startDate);
|
|
|
-
|
|
|
+
|
|
|
// 遍历从开始日期到结束日期的所有天数
|
|
|
while (current <= endDate) {
|
|
|
// 格式化日期为YYYY-MM-dd
|
|
|
const year = current.getFullYear();
|
|
|
const month = current.getMonth() + 1; // 月份从0开始,需要+1
|
|
|
const day = current.getDate();
|
|
|
-
|
|
|
+
|
|
|
const formattedMonth = String(month).padStart(2, '0');
|
|
|
const formattedDay = String(day).padStart(2, '0');
|
|
|
const formattedDateStr = `${year}-${formattedMonth}-${formattedDay}`;
|
|
|
-
|
|
|
+
|
|
|
allDates.push(formattedDateStr);
|
|
|
-
|
|
|
+
|
|
|
// 移动到下一天
|
|
|
current.setDate(current.getDate() + 1);
|
|
|
}
|
|
|
@@ -2201,32 +2313,34 @@
|
|
|
const parseMonthDate = (dateStr) => {
|
|
|
return dateStr instanceof Date ? dateStr : new Date(dateStr + '-01');
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
const start = parseMonthDate(date[0]);
|
|
|
const end = parseMonthDate(date[1]);
|
|
|
-
|
|
|
+
|
|
|
// 先生成所有月份的日期数组
|
|
|
const allMonthDates = [];
|
|
|
const currentDate = new Date(start);
|
|
|
-
|
|
|
+
|
|
|
// 遍历从开始月份到结束月份的所有月份
|
|
|
while (currentDate <= end) {
|
|
|
const year = currentDate.getFullYear();
|
|
|
const month = currentDate.getMonth() + 1; // 月份从0开始,需要+1
|
|
|
const receiptDate = day;
|
|
|
-
|
|
|
+
|
|
|
// 格式化日期为YYYY-MM-dd
|
|
|
const formattedMonth = String(month).padStart(2, '0');
|
|
|
const formattedDate = String(receiptDate).padStart(2, '0');
|
|
|
- const deadLine = receiptDate ? `${year}-${formattedMonth}-${formattedDate}` : '';
|
|
|
-
|
|
|
+ const deadLine = receiptDate
|
|
|
+ ? `${year}-${formattedMonth}-${formattedDate}`
|
|
|
+ : '';
|
|
|
+
|
|
|
allMonthDates.push(deadLine);
|
|
|
-
|
|
|
+
|
|
|
// 使用Date对象的setMonth方法正确移动到下一个月(自动处理年份变化)
|
|
|
currentDate.setMonth(currentDate.getMonth() + 1);
|
|
|
}
|
|
|
return allMonthDates;
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|