mirror of
https://github.com/shawncai/ERP.git
synced 2025-01-01 04:51:48 +08:00
Merge branch 'master' of https://github.com/shawncai/ERP
This commit is contained in:
commit
973d2e0250
8 changed files with 349 additions and 27 deletions
|
@ -90,11 +90,12 @@ export function searchsaleOut(query) {
|
|||
}
|
||||
|
||||
// 修改销售出库单
|
||||
export function updatesaleOut(query, query2, query3) {
|
||||
export function updatesaleOut(query, query2, query3, query4) {
|
||||
var params = new URLSearchParams()
|
||||
params.append('Json', query) // 你要传给后台的参数值 key/value
|
||||
params.append('detailJson', query2) // 你要传给后台的参数值 key/value
|
||||
params.append('giftJson', query3) // 你要传给后台的参数值 key/value
|
||||
params.append('receivableMoney2', query4) // 你要传给后台的参数值 key/value
|
||||
return request({
|
||||
url: '/saleOut/update',
|
||||
method: 'post',
|
||||
|
|
|
@ -3981,7 +3981,8 @@ export default {
|
|||
leftMoney: '剩余金额',
|
||||
number2: '数量',
|
||||
ffxx: '发放信息',
|
||||
couponNumbers: '优惠券码'
|
||||
couponNumbers: '优惠券码',
|
||||
couponSupport2: '优惠劵抵用金额'
|
||||
},
|
||||
collectAndPayDetail: {
|
||||
name: '名称',
|
||||
|
|
|
@ -64,9 +64,15 @@
|
|||
<el-input v-model="personalForm.receiptAccountNumber" style="margin-left: 18px;width: 200px" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-for="(item, index) in personalForm.couponSupports" :key="index" :span="6">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport') + (index + 1)" style="width: 100%;">
|
||||
<el-input v-model="item.couponSupport" style="margin-left: 18px;width: 130px" @blur="changeCoupon"/>
|
||||
<el-button v-show="index === personalForm.couponSupports.length -1" icon="el-icon-plus" type="success" @click="addDomain" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.couponSupport" style="margin-left: 18px;width: 200px" type="number" @change="changemoney"/>
|
||||
<el-form-item :label="$t('collectAndPay.couponSupport2')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.couponSupport" disabled style="margin-left: 18px;width: 200px" type="number" @change="changemoney"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
|
@ -190,6 +196,7 @@
|
|||
|
||||
<script>
|
||||
import '@/directive/noMoreClick/index.js'
|
||||
import { returnMoney } from '@/api/Coupon'
|
||||
import { createreceipt } from '@/api/Receipt'
|
||||
import { agentCollectList } from '@/api/public'
|
||||
import MyEmp from './components/MyEmp'
|
||||
|
@ -287,6 +294,11 @@ export default {
|
|||
payModes: [],
|
||||
// 销售订单信息数据
|
||||
personalForm: {
|
||||
couponSupports: [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
],
|
||||
createPersonId: this.$store.getters.userId,
|
||||
countryId: this.$store.getters.countryId,
|
||||
repositoryId: this.$store.getters.repositoryId,
|
||||
|
@ -296,7 +308,8 @@ export default {
|
|||
receiptMoney: 0,
|
||||
deductionMoney: 0,
|
||||
totalLackMoney: 0,
|
||||
couponSupport: 0
|
||||
couponSupport: 0,
|
||||
couponMoney: 0
|
||||
},
|
||||
allpenalty: 0,
|
||||
// 商品信息
|
||||
|
@ -351,7 +364,7 @@ export default {
|
|||
num2 += this.switchmoney[i].penalty
|
||||
}
|
||||
console.log('num=====', num)
|
||||
this.personalForm.receiptMoney = num - this.personalForm.couponSupport
|
||||
this.personalForm.receiptMoney = num
|
||||
this.allpenalty = num2
|
||||
},
|
||||
deep: true,
|
||||
|
@ -388,6 +401,32 @@ export default {
|
|||
_that = this
|
||||
},
|
||||
methods: {
|
||||
changeCoupon() {
|
||||
console.log('this.personalForm.couponSupports', this.personalForm.couponSupports)
|
||||
const parms2 = JSON.stringify(this.personalForm.couponSupports)
|
||||
returnMoney(parms2).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
if (res.data.data.content > this.personalForm.receiptMoney) {
|
||||
this.personalForm.couponSupport = this.personalForm.receiptMoney
|
||||
} else {
|
||||
this.personalForm.couponSupport = res.data.data.content
|
||||
}
|
||||
console.log('res.data.data.content', res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
addDomain() {
|
||||
this.personalForm.couponSupports.push({
|
||||
couponSupport: 0
|
||||
})
|
||||
},
|
||||
handlechooserepo() {
|
||||
this.repositorycontrol = true
|
||||
},
|
||||
|
@ -1027,6 +1066,17 @@ export default {
|
|||
return false
|
||||
}
|
||||
const parms2 = JSON.stringify(EnterDetail)
|
||||
console.log('this.personalForm.couponSupports', this.personalForm.couponSupports)
|
||||
let couponNumbers = ''
|
||||
for (let i = 0; i < this.personalForm.couponSupports.length; i++) {
|
||||
if (this.personalForm.couponSupports[i].couponSupport !== 0 && this.personalForm.couponSupports[i].couponSupport !== '') {
|
||||
couponNumbers = couponNumbers + this.personalForm.couponSupports[i].couponSupport + ','
|
||||
}
|
||||
}
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
this.personalForm.couponNumbers = couponNumbers
|
||||
const Data = this.personalForm
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
|
|
|
@ -38,6 +38,16 @@
|
|||
<span>{{ personalForm.receiptMoney }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport')" style="width: 100%;">
|
||||
<span>{{ personalForm.couponSupport }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('collectAndPay.couponNumbers')" style="width: 100%;">
|
||||
<span>{{ personalForm.couponNumbers }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('payment.payMode')" prop="totalMoney" style="width: 100%;">
|
||||
<span>{{ personalForm.payModeName }}</span>
|
||||
|
|
|
@ -62,9 +62,15 @@
|
|||
<el-input v-model="personalForm.receiptAccountNumber" style="margin-left: 18px;width: 200px" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-for="(item, index) in personalForm2.couponSupports" :key="index" :span="12">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport') + (index + 1)" style="width: 100%;">
|
||||
<el-input v-model="item.couponSupport" style="margin-left: 18px;width: 130px" @blur="changeCoupon"/>
|
||||
<el-button v-show="index === personalForm2.couponSupports.length -1" icon="el-icon-plus" type="success" @click="addDomain" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.couponSupport" style="margin-left: 18px;width: 200px" type="number" @change="changemoney"/>
|
||||
<el-form-item :label="$t('collectAndPay.couponSupport2')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.couponSupport" disabled style="margin-left: 18px;width: 200px" type="number" @change="changemoney"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
@ -73,7 +79,7 @@
|
|||
</el-form-item>
|
||||
<my-emp :control.sync="stockControl" @stockName="stockName"/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('Receipt.receiptRepositoryId')" prop="receiptRepositoryId" style="width: 100%;">
|
||||
<el-input v-model="receiptRepositoryId" style="margin-left: 18px;width: 200px" @focus="handlechooserepo"/>
|
||||
</el-form-item>
|
||||
|
@ -187,6 +193,7 @@
|
|||
|
||||
<script>
|
||||
import '@/directive/noMoreClick/index.js'
|
||||
import { returnMoney } from '@/api/Coupon'
|
||||
import { updatereceipt2 } from '@/api/Receipt'
|
||||
import { agentCollectList } from '@/api/public'
|
||||
import { installmentlist } from '@/api/InstallmentList'
|
||||
|
@ -256,6 +263,13 @@ export default {
|
|||
}
|
||||
}
|
||||
return {
|
||||
personalForm2: {
|
||||
couponSupports: [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
},
|
||||
repositorycontrol: false,
|
||||
// 收款门店
|
||||
receiptRepositoryId: '',
|
||||
|
@ -346,6 +360,30 @@ export default {
|
|||
editdata() {
|
||||
this.getways()
|
||||
this.personalForm = this.editdata
|
||||
if (this.personalForm.couponNumbers === '' || this.personalForm.couponNumbers === null || this.personalForm.couponNumbers === undefined) {
|
||||
this.personalForm2.couponSupports = [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
} else {
|
||||
this.personalForm2.couponSupports = [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
const coupon = []
|
||||
var b = this.personalForm.couponNumbers.split(',')
|
||||
console.log('b', b)
|
||||
for (let i = 0; i < b.length; i++) {
|
||||
const param = {}
|
||||
param.couponSupport = b[i]
|
||||
coupon.push(param)
|
||||
}
|
||||
console.log('coupon', coupon)
|
||||
this.personalForm2.couponSupports = coupon
|
||||
console.log('this.personalForm.couponSupports2', this.personalForm2.couponSupports)
|
||||
}
|
||||
console.log('this.personalForm', this.personalForm)
|
||||
this.customerId = this.personalForm.customerName
|
||||
this.receiptPersonId = this.personalForm.receiptPersonName
|
||||
|
@ -363,7 +401,7 @@ export default {
|
|||
num += this.switchmoney[i].thisMoney
|
||||
}
|
||||
console.log('num=====', num)
|
||||
this.personalForm.receiptMoney = num - this.personalForm.couponSupport
|
||||
this.personalForm.receiptMoney = num
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
|
@ -375,6 +413,32 @@ export default {
|
|||
_that = this
|
||||
},
|
||||
methods: {
|
||||
changeCoupon() {
|
||||
console.log('this.personalForm.couponSupports', this.personalForm2.couponSupports)
|
||||
const parms2 = JSON.stringify(this.personalForm2.couponSupports)
|
||||
returnMoney(parms2).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
if (res.data.data.content > this.personalForm.receiptMoney) {
|
||||
this.personalForm.couponSupport = this.personalForm.receiptMoney
|
||||
} else {
|
||||
this.personalForm.couponSupport = res.data.data.content
|
||||
}
|
||||
console.log('res.data.data.content', res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
addDomain() {
|
||||
this.personalForm2.couponSupports.push({
|
||||
couponSupport: 0
|
||||
})
|
||||
},
|
||||
handlechooserepo() {
|
||||
this.repositorycontrol = true
|
||||
},
|
||||
|
@ -1044,6 +1108,17 @@ export default {
|
|||
return false
|
||||
}
|
||||
const parms2 = JSON.stringify(EnterDetail)
|
||||
console.log('this.personalForm.couponSupports', this.personalForm2.couponSupports)
|
||||
let couponNumbers = ''
|
||||
for (let i = 0; i < this.personalForm2.couponSupports.length; i++) {
|
||||
if (this.personalForm2.couponSupports[i].couponSupport !== 0 && this.personalForm2.couponSupports[i].couponSupport !== '') {
|
||||
couponNumbers = couponNumbers + this.personalForm2.couponSupports[i].couponSupport + ','
|
||||
}
|
||||
}
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
this.personalForm.couponNumbers = couponNumbers
|
||||
const Data = this.personalForm
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
|
|
|
@ -2189,6 +2189,17 @@ export default {
|
|||
handlesave() {
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.personalForm.sourceType === '5') {
|
||||
if (this.personalForm.saleType === '2') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '无来源时销售类别不能是分期',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const EnterDetail = this.deepClone(this.$refs.editable.getRecords())
|
||||
// 整车出库时相关编码必填
|
||||
let m = 1
|
||||
|
|
|
@ -202,7 +202,7 @@
|
|||
</el-col>
|
||||
<el-col v-for="(item, index) in personalForm.couponSupports" :key="index" :span="6">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport') + (index + 1)" style="width: 100%;">
|
||||
<el-input v-model="item.couponSupport" style="margin-left: 18px;width: 100px" type="number"/>
|
||||
<el-input v-model="item.couponSupport" style="margin-left: 18px;width: 130px" @blur="changeCoupon"/>
|
||||
<el-button v-show="index === personalForm.couponSupports.length -1" icon="el-icon-plus" type="success" @click="addDomain" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -548,6 +548,7 @@
|
|||
<script>
|
||||
import '@/directive/noMoreClick/index.js'
|
||||
import { customerlist2 } from '@/api/Customer'
|
||||
import { returnMoney } from '@/api/Coupon'
|
||||
import { getPackage } from '@/api/Package'
|
||||
import { getAllBatch, vehicleInfo, getQuantity2 } from '@/api/public'
|
||||
import { createsaleOut } from '@/api/SaleOut'
|
||||
|
@ -765,7 +766,8 @@ export default {
|
|||
ridBikeMoney: 0,
|
||||
advanceMoney: 0,
|
||||
receiveMoney: 0,
|
||||
isInvoice: 1
|
||||
isInvoice: 1,
|
||||
couponMoney: 0
|
||||
},
|
||||
// 销售订单规则数据
|
||||
personalrules: {
|
||||
|
@ -898,6 +900,24 @@ export default {
|
|||
_that = this
|
||||
},
|
||||
methods: {
|
||||
changeCoupon() {
|
||||
console.log('this.personalForm.couponSupports', this.personalForm.couponSupports)
|
||||
const parms2 = JSON.stringify(this.personalForm.couponSupports)
|
||||
returnMoney(parms2).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.personalForm.couponMoney = res.data.data.content
|
||||
console.log('res.data.data.content', res.data.data.content)
|
||||
this.getReceivableMoney(res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
addDomain() {
|
||||
this.personalForm.couponSupports.push({
|
||||
couponSupport: 0
|
||||
|
@ -1083,14 +1103,46 @@ export default {
|
|||
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.heji4', this.heji4)
|
||||
this.personalForm.receivableMoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
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))
|
||||
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else if (this.$store.getters.newsaleoutdata.firstMoney) {
|
||||
this.personalForm.receivableMoney = this.$store.getters.newsaleoutdata.firstMoney
|
||||
console.log('123', 123)
|
||||
let needmoney = (this.$store.getters.newsaleoutdata.firstMoney - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.$store.getters.newsaleoutdata.firstMoney)
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else if (this.receivableMoney !== '' || this.receivableMoney !== null || this.receivableMoney !== undefined) {
|
||||
console.log('是否是销售合同带入过来')
|
||||
this.personalForm.receivableMoney = this.receivableMoney
|
||||
console.log('234', 234)
|
||||
let needmoney = (this.receivableMoney - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.receivableMoney)
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else {
|
||||
this.personalForm.receivableMoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
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))
|
||||
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
}
|
||||
|
||||
// if (this.personalForm.pointSupport && this.personalForm.couponSupport && this.personalForm.ridMoney && this.personalForm.ridBikeMoney && this.personalForm.advanceMoney) {
|
||||
|
@ -2333,6 +2385,16 @@ export default {
|
|||
// })
|
||||
const parms2 = JSON.stringify(EnterDetail)
|
||||
const parms3 = ''
|
||||
let couponNumbers = ''
|
||||
for (let i = 0; i < this.personalForm.couponSupports.length; i++) {
|
||||
if (this.personalForm.couponSupports[i].couponSupport !== 0 && this.personalForm.couponSupports[i].couponSupport !== '') {
|
||||
couponNumbers = couponNumbers + this.personalForm.couponSupports[i].couponSupport + ','
|
||||
}
|
||||
}
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
this.personalForm.couponNumbers = couponNumbers
|
||||
const Data = this.personalForm
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
|
@ -2343,7 +2405,7 @@ export default {
|
|||
}
|
||||
}
|
||||
const parms = JSON.stringify(Data)
|
||||
createsaleOut(parms, parms2, parms3, this.personalForm).then(res => {
|
||||
createsaleOut(parms, parms2, parms3, this.personalForm, this.personalForm.receivableMoney2).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
|
|
|
@ -153,11 +153,6 @@
|
|||
<el-input v-model="personalForm.pointSupport" :disabled="personalForm.customerType === '1'" style="margin-left: 18px;width: 200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.couponSupport" style="margin-left: 18px;width: 200px" @change="changemoney"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.ridMoney')" style="width: 100%;">
|
||||
<el-input v-model="personalForm.ridMoney" style="margin-left: 18px;width: 200px" disabled/>
|
||||
|
@ -176,6 +171,12 @@
|
|||
{{ personalForm.receivableMoney }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-for="(item, index) in personalForm2.couponSupports" :key="index" :span="12">
|
||||
<el-form-item :label="$t('SaleOut.couponSupport') + (index + 1)" style="width: 100%;">
|
||||
<el-input v-model="item.couponSupport" style="margin-left: 18px;width: 130px" @blur="changeCoupon"/>
|
||||
<el-button v-show="index === personalForm2.couponSupports.length -1" icon="el-icon-plus" type="success" @click="addDomain" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.isInvoice')" style="width: 100%;">
|
||||
<el-radio-group v-model="personalForm.isInvoice" style="margin-left: 18px;width: 200px">
|
||||
|
@ -483,6 +484,7 @@
|
|||
|
||||
<script>
|
||||
import { customerlist2 } from '@/api/Customer'
|
||||
import { returnMoney } from '@/api/Coupon'
|
||||
import { getPackage } from '@/api/Package'
|
||||
import { getAllBatch, vehicleInfo } from '@/api/public'
|
||||
import { updatesaleOut } from '@/api/SaleOut'
|
||||
|
@ -580,6 +582,13 @@ export default {
|
|||
}
|
||||
}
|
||||
return {
|
||||
personalForm2: {
|
||||
couponSupports: [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
},
|
||||
pickerOptions1: {
|
||||
disabledDate: (time) => {
|
||||
return time.getTime() < new Date().getTime() - 8.64e7
|
||||
|
@ -726,6 +735,32 @@ export default {
|
|||
},
|
||||
editdata() {
|
||||
this.personalForm = this.editdata
|
||||
this.personalForm.couponMoney = this.personalForm.couponSupport
|
||||
console.log('this.personalForm.receivableMoney', this.personalForm.receivableMoney)
|
||||
if (this.personalForm.couponNumbers === '' || this.personalForm.couponNumbers === null || this.personalForm.couponNumbers === undefined) {
|
||||
this.personalForm2.couponSupports = [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
} else {
|
||||
this.personalForm2.couponSupports = [
|
||||
{
|
||||
couponSupport: 0
|
||||
}
|
||||
]
|
||||
const coupon = []
|
||||
var b = this.personalForm.couponNumbers.split(',')
|
||||
console.log('b', b)
|
||||
for (let i = 0; i < b.length; i++) {
|
||||
const param = {}
|
||||
param.couponSupport = b[i]
|
||||
coupon.push(param)
|
||||
}
|
||||
console.log('coupon', coupon)
|
||||
this.personalForm2.couponSupports = coupon
|
||||
console.log('this.personalForm.couponSupports2', this.personalForm2.couponSupports)
|
||||
}
|
||||
if (this.personalForm.sourceType === '5') {
|
||||
this.Isproduct = false
|
||||
this.IsSourceNumber = true
|
||||
|
@ -812,6 +847,31 @@ export default {
|
|||
_that = this
|
||||
},
|
||||
methods: {
|
||||
changeCoupon() {
|
||||
console.log('this.personalForm.couponSupports2', this.personalForm2.couponSupports)
|
||||
const parms2 = JSON.stringify(this.personalForm2.couponSupports)
|
||||
returnMoney(parms2).then(res => {
|
||||
console.log(res)
|
||||
if (res.data.ret === 200) {
|
||||
this.personalForm.couponMoney = res.data.data.content
|
||||
console.log('res.data.data.content', res.data.data.content)
|
||||
this.getReceivableMoney(res.data.data.content)
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 100
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
addDomain() {
|
||||
console.log('this.personalForm2.couponSupports', this.personalForm2.couponSupports)
|
||||
this.personalForm2.couponSupports.push({
|
||||
couponSupport: 0
|
||||
})
|
||||
console.log('this.personalForm.couponSupports', this.personalForm2.couponSupports)
|
||||
},
|
||||
getReceivableMoney() {
|
||||
console.log('666', 666)
|
||||
if (!this.personalForm.pointSupport) {
|
||||
|
@ -833,14 +893,46 @@ export default {
|
|||
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.heji4', this.heji4)
|
||||
this.personalForm.receivableMoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
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))
|
||||
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else if (this.$store.getters.newsaleoutdata.firstMoney) {
|
||||
this.personalForm.receivableMoney = this.$store.getters.newsaleoutdata.firstMoney
|
||||
console.log('123', 123)
|
||||
let needmoney = (this.$store.getters.newsaleoutdata.firstMoney - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.$store.getters.newsaleoutdata.firstMoney)
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else if (this.receivableMoney !== '' || this.receivableMoney !== null || this.receivableMoney !== undefined) {
|
||||
console.log('是否是销售合同带入过来')
|
||||
this.personalForm.receivableMoney = this.personalForm.receivableMoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
console.log('234', 234)
|
||||
let needmoney = (this.receivableMoney - Number(this.personalForm.couponMoney))
|
||||
const needmoney2 = (this.receivableMoney)
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
} else {
|
||||
this.personalForm.receivableMoney = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.couponSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
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))
|
||||
const needmoney2 = (this.heji3 - this.heji4 - Number(this.personalForm.pointSupport) - Number(this.personalForm.ridMoney) - Number(this.personalForm.ridBikeMoney) - Number(this.personalForm.advanceMoney))
|
||||
if (needmoney < 0) {
|
||||
needmoney = 0
|
||||
}
|
||||
this.$set(this.personalForm, 'receivableMoney', needmoney)
|
||||
// 未减去优惠券额的金额
|
||||
this.$set(this.personalForm, 'receivableMoney2', needmoney2)
|
||||
}
|
||||
|
||||
// if (this.personalForm.pointSupport && this.personalForm.couponSupport && this.personalForm.ridMoney && this.personalForm.ridBikeMoney && this.personalForm.advanceMoney) {
|
||||
|
@ -1798,6 +1890,16 @@ export default {
|
|||
delete this.personalForm.currency
|
||||
this.$refs.personalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.personalForm.sourceType === '5') {
|
||||
if (this.personalForm.saleType === '2') {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '无来源时销售类别不能是分期',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
this.personalForm.repositoryId = this.$store.getters.repositoryId
|
||||
this.personalForm.regionId = this.$store.getters.regionId
|
||||
this.personalForm.createPersonId = this.$store.getters.userId
|
||||
|
@ -1991,6 +2093,16 @@ export default {
|
|||
})
|
||||
const parms2 = JSON.stringify(EnterDetail)
|
||||
const parms3 = JSON.stringify(EnterDetail2)
|
||||
let couponNumbers = ''
|
||||
for (let i = 0; i < this.personalForm2.couponSupports.length; i++) {
|
||||
if (this.personalForm2.couponSupports[i].couponSupport !== 0 && this.personalForm2.couponSupports[i].couponSupport !== '') {
|
||||
couponNumbers = couponNumbers + this.personalForm2.couponSupports[i].couponSupport + ','
|
||||
}
|
||||
}
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
|
||||
console.log('couponNumbers', couponNumbers)
|
||||
this.personalForm.couponNumbers = couponNumbers
|
||||
const Data = this.personalForm
|
||||
for (const key in Data) {
|
||||
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
|
||||
|
@ -2001,7 +2113,7 @@ export default {
|
|||
}
|
||||
}
|
||||
const parms = JSON.stringify(Data)
|
||||
updatesaleOut(parms, parms2, parms3).then(res => {
|
||||
updatesaleOut(parms, parms2, parms3, this.personalForm.receivableMoney2).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.$notify({
|
||||
title: '操作成功',
|
||||
|
|
Loading…
Reference in a new issue