This commit is contained in:
shawn 2020-02-08 09:38:32 +08:00
commit 04dea29df5

View file

@ -177,6 +177,11 @@
<el-input v-model="personalForm.pointSupport" :disabled="personalForm.customerType === '1'" style="margin-left: 18px;width: 200px"/> <el-input v-model="personalForm.pointSupport" :disabled="personalForm.customerType === '1'" style="margin-left: 18px;width: 200px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item :label="$t('collectAndPay.couponSupportOld')" style="width: 100%;">
<el-input-number v-model="personalForm.couponSupportOld" :controls="false" :step="0.1" :min="0" style="margin-left: 18px;width: 200px" @blur="getReceivableMoney"/>
</el-form-item>
</el-col>
<!-- <el-col :span="6"> <!-- <el-col :span="6">
<el-form-item :label="$t('SaleOut.couponSupport')" style="width: 100%;"> <el-form-item :label="$t('SaleOut.couponSupport')" style="width: 100%;">
<el-input v-model="personalForm.couponSupport" style="margin-left: 18px;width: 200px" type="number"/> <el-input v-model="personalForm.couponSupport" style="margin-left: 18px;width: 200px" type="number"/>
@ -767,7 +772,8 @@ export default {
advanceMoney: 0, advanceMoney: 0,
receiveMoney: 0, receiveMoney: 0,
isInvoice: 1, isInvoice: 1,
couponMoney: 0 couponMoney: 0,
couponSupportOld: 0
}, },
// //
personalrules: { personalrules: {
@ -1100,12 +1106,15 @@ export default {
this.personalForm.advanceMoney = 0 this.personalForm.advanceMoney = 0
} }
console.log('this.personalForm.sourceTypethis.personalForm.sourceType', this.personalForm.sourceType) console.log('this.personalForm.sourceTypethis.personalForm.sourceType', this.personalForm.sourceType)
if (this.personalForm.couponSupportOld === null || this.personalForm.couponSupportOld === '' || this.personalForm.couponSupportOld === undefined) {
this.personalForm.couponSupportOld = 0
}
if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '3' || this.personalForm.sourceType === '4' || this.personalForm.sourceType === '5' || this.personalForm.sourceType === '6') { if (this.personalForm.sourceType === '1' || this.personalForm.sourceType === '3' || this.personalForm.sourceType === '4' || this.personalForm.sourceType === '5' || this.personalForm.sourceType === '6') {
console.log('this.heji3', this.heji3) console.log('this.heji3', this.heji3)
console.log('this.heji4', this.heji4) console.log('this.heji4', this.heji4)
console.log('this.personalForm.couponMoney', this.personalForm.couponMoney) console.log('this.personalForm.couponMoney', this.personalForm.couponMoney)
let needmoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponMoney)) let needmoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponSupportOld) - Number(this.personalForm.couponMoney))
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney)) const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponSupportOld))
if (needmoney < 0) { if (needmoney < 0) {
needmoney = 0 needmoney = 0
} }
@ -1114,8 +1123,8 @@ export default {
this.$set(this.personalForm, 'receivableMoney2', needmoney2) this.$set(this.personalForm, 'receivableMoney2', needmoney2)
} else if (this.$store.getters.newsaleoutdata.firstMoney) { } else if (this.$store.getters.newsaleoutdata.firstMoney) {
console.log('123', 123) console.log('123', 123)
let needmoney = (this.$store.getters.newsaleoutdata.firstMoney - Number(this.personalForm.couponMoney)) let needmoney = (this.$store.getters.newsaleoutdata.firstMoney - Number(this.personalForm.couponSupportOld) - Number(this.personalForm.couponMoney))
const needmoney2 = (this.$store.getters.newsaleoutdata.firstMoney) const needmoney2 = (this.$store.getters.newsaleoutdata.firstMoney - Number(this.personalForm.couponSupportOld))
if (needmoney < 0) { if (needmoney < 0) {
needmoney = 0 needmoney = 0
} }
@ -1125,8 +1134,8 @@ export default {
} else if (this.receivableMoney !== '' || this.receivableMoney !== null || this.receivableMoney !== undefined) { } else if (this.receivableMoney !== '' || this.receivableMoney !== null || this.receivableMoney !== undefined) {
console.log('是否是销售合同带入过来') console.log('是否是销售合同带入过来')
console.log('234', 234) console.log('234', 234)
let needmoney = (this.receivableMoney - Number(this.personalForm.couponMoney)) let needmoney = (this.receivableMoney - Number(this.personalForm.couponSupportOld) - Number(this.personalForm.couponMoney))
const needmoney2 = (this.receivableMoney) const needmoney2 = (this.receivableMoney - Number(this.personalForm.couponSupportOld))
if (needmoney < 0) { if (needmoney < 0) {
needmoney = 0 needmoney = 0
} }
@ -1135,8 +1144,8 @@ export default {
this.$set(this.personalForm, 'receivableMoney2', needmoney2) this.$set(this.personalForm, 'receivableMoney2', needmoney2)
} else { } else {
console.log('456', 456) console.log('456', 456)
let needmoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponMoney)) let needmoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponSupportOld) - Number(this.personalForm.couponMoney))
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney)) const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney) - Number(this.personalForm.couponSupportOld))
if (needmoney < 0) { if (needmoney < 0) {
needmoney = 0 needmoney = 0
} }
@ -2179,7 +2188,8 @@ export default {
ridBikeMoney: 0, ridBikeMoney: 0,
advanceMoney: 0, advanceMoney: 0,
receiveMoney: 0, receiveMoney: 0,
isInvoice: 1 isInvoice: 1,
couponSupportOld: 0
} }
this.customerId = null this.customerId = null
this.salePersonId = this.$store.state.user.name this.salePersonId = this.$store.state.user.name
@ -2197,6 +2207,9 @@ export default {
handlesave() { handlesave() {
this.$refs.personalForm.validate((valid) => { this.$refs.personalForm.validate((valid) => {
if (valid) { if (valid) {
if (this.personalForm.couponSupportOld === null || this.personalForm.couponSupportOld === '' || this.personalForm.couponSupportOld === undefined) {
this.personalForm.couponSupportOld = 0
}
const EnterDetail = this.deepClone(this.$refs.editable.getRecords()) const EnterDetail = this.deepClone(this.$refs.editable.getRecords())
// //
let m = 1 let m = 1