|
@@ -276,6 +276,7 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="收款日期" prop="collectionMoneyDate">
|
|
|
<el-date-picker
|
|
|
+ @change="getInterestCountingDays"
|
|
|
clearable
|
|
|
v-model="form.collectionMoneyDate"
|
|
|
type="date"
|
|
@@ -316,7 +317,12 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="付款方式" prop="paymentMethod">
|
|
|
<!-- <el-input v-model="form.paymentMethod" placeholder="请输入付款方式" /> -->
|
|
|
- <el-select v-model="form.paymentMethod" clearable filterable>
|
|
|
+ <el-select
|
|
|
+ v-model="form.paymentMethod"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ @change="getInterestCountingDays"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in dict.type
|
|
|
.collection_registration_payment_method"
|
|
@@ -368,12 +374,36 @@
|
|
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <!-- <el-form-item label="记账标志" prop="bookkeepingFlag">
|
|
|
- <el-input
|
|
|
- v-model="form.bookkeepingFlag"
|
|
|
- placeholder="请输入记账标志"
|
|
|
- />
|
|
|
- </el-form-item> -->
|
|
|
+ <el-col :span="24" v-show="form.paymentMethod == 4">
|
|
|
+ <el-divider direction="horizontal"></el-divider>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" v-show="form.paymentMethod == 4">
|
|
|
+ <el-form-item label="贴 息" prop="interestSubsidy">
|
|
|
+ <el-input
|
|
|
+ v-model="form.interestSubsidy"
|
|
|
+ placeholder="请输入"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" v-show="form.paymentMethod == 4">
|
|
|
+ <el-form-item label="票据到期日" prop="dueDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.dueDate"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期"
|
|
|
+ @change="getInterestCountingDays"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" v-show="form.paymentMethod == 4">
|
|
|
+ <el-form-item label="计息天数" prop="interestCountingDays">
|
|
|
+ <el-input
|
|
|
+ v-model="form.interestCountingDays"
|
|
|
+ placeholder="请输入"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-form>
|
|
|
</el-row>
|
|
|
<el-dialog
|
|
@@ -488,6 +518,7 @@ import {
|
|
|
deleteSettlementUnit,
|
|
|
} from "@/api/system/SaleRegistrationCollection";
|
|
|
import moment from "moment";
|
|
|
+import { calculateDaysBetweenDates } from "@/utils/other";
|
|
|
|
|
|
export default {
|
|
|
name: "SaleRegistrationCollection",
|
|
@@ -574,6 +605,32 @@ export default {
|
|
|
this.initSelectData();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取计息天数
|
|
|
+ getInterestCountingDays() {
|
|
|
+ if (
|
|
|
+ this.form.paymentMethod == 4 &&
|
|
|
+ this.form.collectionMoneyDate &&
|
|
|
+ this.form.dueDate
|
|
|
+ ) {
|
|
|
+ console.log(
|
|
|
+ this.form.paymentMethod,
|
|
|
+ this.form.collectionMoneyDate,
|
|
|
+ this.form.dueDate
|
|
|
+ );
|
|
|
+ if (
|
|
|
+ new Date(this.form.collectionMoneyDate).getTime() >
|
|
|
+ new Date(this.form.dueDate).getTime()
|
|
|
+ ) {
|
|
|
+ this.form.interestCountingDays = 0;
|
|
|
+ this.$message.error("计息天数不能小于收款日期");
|
|
|
+ } else {
|
|
|
+ this.form.interestCountingDays = calculateDaysBetweenDates(
|
|
|
+ this.form.collectionMoneyDate,
|
|
|
+ this.form.dueDate
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 日期范围改变回调
|
|
|
timeRangeChange(val) {
|
|
|
this.queryParams.startTime = moment(val[0]).format("YYYY-MM-DD");
|
|
@@ -788,7 +845,9 @@ export default {
|
|
|
paymentMethod: null,
|
|
|
amounts: null,
|
|
|
collectionMoneyType: "货款",
|
|
|
- collectionMoneyDate: new Date(),
|
|
|
+ collectionMoneyDate: new Date(
|
|
|
+ moment(new Date()).format("YYYY-MM-DD 00:00:00")
|
|
|
+ ),
|
|
|
settlementUnitId: null,
|
|
|
remark: null,
|
|
|
bookkeepingFlag: null,
|
|
@@ -799,6 +858,9 @@ export default {
|
|
|
updateById: null,
|
|
|
updateTime: null,
|
|
|
delFlag: null,
|
|
|
+ interestSubsidy: "0.00", //贴息
|
|
|
+ dueDate: null, //到期日
|
|
|
+ interestCountingDays: null, //计息天数
|
|
|
};
|
|
|
this.settlementUnitList = [];
|
|
|
this.resetForm("form");
|