This commit is contained in:
cun-nan 2024-10-15 16:09:34 +08:00
parent 2285d94d08
commit 8a4189a778
2 changed files with 175 additions and 82 deletions

View File

@ -131,7 +131,7 @@
<div class="price_">{{ realAmount }}</div>
<div class="price_prefer">优惠合计:{{ disTotal }}</div>
</div>
<div class="anniu" @click="settlement()" :class="{ disabled: !isClickable }">立即结算</div>
<div class="anniu" @click="settlement()" :class="{ disabled: !isClickable }">立即结算</div>
</div>
</div>
@ -314,29 +314,29 @@
<el-button type="primary" @click="ScanCodePayment = false">关闭</el-button>
</span>
</el-dialog>
<!-- <el-dialog-->
<!-- title="现金支付"-->
<!-- :visible.sync="cashPayment"-->
<!-- width="439px"-->
<!-- center-->
<!-- >-->
<!-- <div class="tc-box">-->
<!-- <div class="title_">应收款 <span style="color: #F44522">¥{{realAmount}}</span></div>-->
<!-- <el-form :model="ruleForm2" :rules="rules2" ref="ruleForm2" label-width="100px" class="demo-ruleForm">-->
<!-- <el-form-item label="收款金额" prop="number">-->
<!-- <el-input v-model="ruleForm2.number">-->
<!-- <template slot="append"></template>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- <div class="t-size">-->
<!-- 应找零<span style="color: #F44522">¥{{getChangeShould}}</span>-->
<!-- </div>-->
<!-- </el-form>-->
<!-- </div>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="cashPaymentClick()">确定收款</el-button>-->
<!-- </span>-->
<!-- </el-dialog>-->
<!-- <el-dialog-->
<!-- title="现金支付"-->
<!-- :visible.sync="cashPayment"-->
<!-- width="439px"-->
<!-- center-->
<!-- >-->
<!-- <div class="tc-box">-->
<!-- <div class="title_">应收款 <span style="color: #F44522">¥{{realAmount}}</span></div>-->
<!-- <el-form :model="ruleForm2" :rules="rules2" ref="ruleForm2" label-width="100px" class="demo-ruleForm">-->
<!-- <el-form-item label="收款金额" prop="number">-->
<!-- <el-input v-model="ruleForm2.number">-->
<!-- <template slot="append"></template>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- <div class="t-size">-->
<!-- 应找零<span style="color: #F44522">¥{{getChangeShould}}</span>-->
<!-- </div>-->
<!-- </el-form>-->
<!-- </div>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="cashPaymentClick()">确定收款</el-button>-->
<!-- </span>-->
<!-- </el-dialog>-->
<el-dialog
title="挂单"
:visible.sync="hangingAnOrder"
@ -414,7 +414,7 @@
<accountPending :amount="oilGunClearing.amount" @changeAmount="changeAmount"></accountPending>
<span slot="footer" class="dialog-footer">
<el-button @click="accountPending = false"> </el-button>
<el-button type="primary" @click="accountPending = false"> </el-button>
<el-button type="primary" @click="addHangbill"> </el-button>
</span>
</el-dialog>
<el-dialog
@ -445,7 +445,8 @@
</el-dialog>
<!-- 确认充值-->
<el-dialog :close-on-click-modal="false" title="确认支付订单" :visible.sync="openConfirm" width="500px" append-to-body
<el-dialog :close-on-click-modal="false" title="确认支付订单" :visible.sync="openConfirm" width="500px"
append-to-body
@close="onDialogClose">
<div v-if="isPay"
v-loading="loading">
@ -559,9 +560,10 @@ import {
getCheckTheStatusOfYourPaymentApi,
rechargeCard
} from "@/api/cashier/cardSet";
import { getReturnCode, printOilOrderReport } from '@/api/print'
import {getReturnCode, printOilOrderReport} from '@/api/print'
import {addLJGoods, scanAppletQrCode} from "@/api/cashier/oilorder";
import { cashierOrderByOrderNo } from '@/api/cashier/cashierorder'
import {cashierOrderByOrderNo} from '@/api/cashier/cashierorder'
import {addHangBill} from "../../../api/cashier/hangbill";
export default {
dicts: ['CardCoupon_type'],
@ -618,7 +620,7 @@ export default {
oilGun: '',
//
oilGunClearing: {
amount:0
amount: 0
},
//
goodsList: [],
@ -665,6 +667,8 @@ export default {
pickUpTheOrder: false,
accountPending: false,
memberRecharge: false,
//
credit: {},
//
vipUserList: [],
chooseVipUser: {},
@ -699,12 +703,12 @@ export default {
realAmount: {
handler(newVal) {
console.log("结算金额", newVal);
//
if (this.realAmount > 0){
this.isClickable = true
}else {
this.isClickable = false
}
//
if (this.realAmount > 0) {
this.isClickable = true
} else {
this.isClickable = false
}
},
},
@ -795,8 +799,8 @@ export default {
},
computed: {
getChangeShould(){
return this.payForm.authCode-this.realAmount
getChangeShould() {
return this.payForm.authCode - this.realAmount
},
getGoodsItem() {
if (this.oilGunClearing.amount && this.oilGunClearing.amount !== undefined) {
@ -832,8 +836,8 @@ export default {
methods: {
//
onDialogClose(){
this.payForm.authCode=null
onDialogClose() {
this.payForm.authCode = null
},
sendCouponClick() {
@ -913,10 +917,10 @@ export default {
},
//
handClose1() {
this.isPay = true,
this.isPay = true,
this.isPaySuccess = false,
this.isQuery = true
this.openConfirm = false
this.openConfirm = false
this.payForm.authCode = null
@ -1065,17 +1069,17 @@ export default {
//this.getCode(this.realyPayBills, this.flag)
},
//
oilOrderReport () {
oilOrderReport() {
//
let oilOrderR = [
{
oilName : this.oilGunClearing.name,
amount : this.oilGunClearing.amount + '',
oilName: this.oilGunClearing.name,
amount: this.oilGunClearing.amount + '',
}
]
let goodsOrderR = []
if (this.goodsOrder && this.goodsOrder.length>0) {
if (this.goodsOrder && this.goodsOrder.length > 0) {
this.goodsOrder.forEach(order => {
let o = {
oilName: order.name,
@ -1099,52 +1103,52 @@ export default {
};
let payTypeText = payTypeMap[this.payType] || '小程序码';
let f ={
oilOrder:oilOrderR,
goodsOrder:goodsOrderR,
payType:payTypeText,
unitName:"", //
let f = {
oilOrder: oilOrderR,
goodsOrder: goodsOrderR,
payType: payTypeText,
unitName: "", //
// consumeAmount:this.consumeAmount,
creditAmount: (this.oilAmount+(+this.goodsAmount)).toFixed(2),//
creditAmount: (this.oilAmount + (+this.goodsAmount)).toFixed(2),//
//
discount:(this.oilDiscount + this.goodsDiscount + this.fullReduction + this.couponAmount).toFixed(2), //
discount: (this.oilDiscount + this.goodsDiscount + this.fullReduction + this.couponAmount).toFixed(2), //
//
consumeAmount:this.consumeAmount,
consumeAmount: this.consumeAmount,
//
consumeRefuelMoney:this.consumeRefuelMoney ? this.consumeRefuelMoney.toFixed(2) : 0,
consumeRefuelMoney: this.consumeRefuelMoney ? this.consumeRefuelMoney.toFixed(2) : 0,
//
actualPay : ((+this.oilActualPay)+(+this.goodsActualPay)).toFixed(2),
actualPay: ((+this.oilActualPay) + (+this.goodsActualPay)).toFixed(2),
//
seekZero:this.seekZero ? this.seekZero.toFixed(2) : 0,
seekZero: this.seekZero ? this.seekZero.toFixed(2) : 0,
}
if (this.form1 && this.form1.unitName) f.unitName = this.form1.unitName
printOilOrderReport(f).then(res=>{
console.log(res,1121)
printOilOrderReport(f).then(res => {
console.log(res, 1121)
})
},
//
resetting1(){
resetting1() {
//
this.userMobile=null
this.userMobile = null
//
this.oilGunClearing={}
this.oilGunClearing = {}
//
this.goodsList=[]
this.goodsList = []
this.userInfo=false
this.userInfo = false
//
this.payType = "ALIPAY"
},
//
queryPayStatus(){
queryPayStatus() {
let _this = this;
let timer = setInterval(function (){
let timer = setInterval(function () {
// "234520231228115544f073f4"
cashierOrderByOrderNo({orderNo:_this.orderNo}).then( response => {
if (response.data){
if (response.data.status == "paid"){
cashierOrderByOrderNo({orderNo: _this.orderNo}).then(response => {
if (response.data) {
if (response.data.status == "paid") {
_this.isPay = true;
_this.isPaySuccess = true;
_this.isQuery = false;
@ -1156,7 +1160,7 @@ export default {
_this.resetting1();
if (response.data.oilOrderAmount>0){
if (response.data.oilOrderAmount > 0) {
// for (let i =0;i<_this.oilPreferentialData.length;i++){
// _this.oilPreferentialData[i].oilPreferential.storeId = response.data.storeId
// _this.oilPreferentialData[i].oilPreferential.orderAmount = response.data.oilOrderAmount
@ -1169,7 +1173,7 @@ export default {
}
clearInterval(timer);
}
if (response.data.status == "payFail"){
if (response.data.status == "payFail") {
_this.isPaySuccess = false;
// _this.isPay = true;
_this.isQuery = false;
@ -1177,14 +1181,14 @@ export default {
_this.loading = false;
clearInterval(timer);
}
if (response.data.status == "unpaid"){
if (response.data.status == "unpaid") {
_this.isQuery = true;
_this.dialogVisiblejLoading = true
}
}
// _this.resetting1();
})
},1000)
}, 1000)
// 15
// if (_this.isQuery){
@ -1319,7 +1323,7 @@ export default {
// id
//
if (this.oilGunClearing){
if (this.oilGunClearing) {
this.payForm.oilOrder = JSON.stringify({
oilPrice: this.oilGunClearing.oilPrice,
oils: this.oilGunClearing.oilNameId,
@ -1328,7 +1332,7 @@ export default {
activeId: this.chooseAct.hasOwnProperty('actId') ? this.chooseAct.activeId : null,
activeType: this.chooseAct.hasOwnProperty('type') ? this.chooseAct.activeType : null,
})
}else {
} else {
this.payForm.oilOrder = null
}
@ -1382,7 +1386,7 @@ export default {
console.log('支付类型', this.payForm.paymentType)
//
this.payForm.realyPayBills= this.realAmount
this.payForm.realyPayBills = this.realAmount
this.isPay = true;
this.openConfirm = true;
this.flag = 3
@ -1805,26 +1809,115 @@ export default {
}
},
changeAmount(val){
console.log(val,1807)
changeAmount(val) {
console.log(val, 1807)
this.credit = val
},
//
addHangbill() {
addHangBill(this.credit).then(async response => {
if (response.data == 1) {
await this.addOrder();
this.$modal.msgSuccess("挂账记录添加成功");
this.accountPending = false;
// this.printLocally()
this.oilOrderReport()
this.payType = "WECHAT"
this.restVipUser();
this.resetting1();
} else {
this.$modal.msgError("挂账单位可用额度不足,无法进行挂账");
}
})
},
//
async addOrder() {
if (this.oilGunClearing) {
this.payForm.oilOrder = JSON.stringify({
oilPrice: this.oilGunClearing.oilPrice,
oils: this.oilGunClearing.oilNameId,
oilGunNum: this.oilGunClearing.id,
tankId: this.oilGunClearing.tankId,
activeId: this.chooseAct.hasOwnProperty('actId') ? this.chooseAct.activeId : null,
activeType: this.chooseAct.hasOwnProperty('type') ? this.chooseAct.activeType : null,
})
} else {
this.payForm.oilOrder = null
}
//
this.payForm.goodsOrder = JSON.stringify(this.goodsList)
//
this.payForm.payType = this.payType
//
this.payForm.oilAmount = this.oilGunClearing.amount || 0
//
this.payForm.goodsAmount = this.getGoodsNum
//
this.payForm.oilActualPay = this.oilGunClearing.amount || 0
//
this.payForm.goodsActualPay = this.getGoodsNum
//id
this.payForm.oilGunId = this.oilGunClearing.id
//
this.payForm.activeAmount = this.chooseAct.disAmount || 0.0
//
this.payForm.couponType = this.chooseCoupon.hasOwnProperty('type') ? this.chooseCoupon.type : null
//id
this.payForm.couponId = this.chooseCoupon.hasOwnProperty('couponId') ? this.chooseCoupon.id : null
//
this.payForm.payUser = this.chooseVipUser.mobile
//
this.payForm.oilDiscount = 0;
//
this.payForm.goodsDiscount = 0;
// ()
this.payForm.consumeAmount = this.realAmount;
//id
this.payForm.userId = this.chooseVipUser.id
// PC
this.payForm.terminal = "PC"
// ids
// id , this.goodsList
this.payForm.goodsIds = this.goodsList.map(item => item.id).join(",")
//
this.payForm.goodsNum = this.getGoodsListNum
// +
this.payForm.allAmount = this.realAmount
this.payForm.paymentType = this.payType
console.log('支付类型', this.payForm.paymentType)
//
this.payForm.realyPayBills = this.realAmount
await addLJGoods(this.payForm).then(response => {
})
},
/**
* 设置选中的支付方式
* @param value
*/
setindex(value) {
if (value=='after_pay'){
if (this.getGoodsNum>0){
if (value == 'after_pay') {
if (this.getGoodsNum > 0) {
this.$message.error("商品订单不支持挂账")
return
}
if (this.oilGunClearing.amount<=0){
if (this.oilGunClearing.amount <= 0) {
this.$message.error("请选择挂账订单")
return;
}
this.accountPending = true
}
console.log('支付方式',value);
console.log('支付方式', value);
this.payType = value
//
this.getActivity()

View File

@ -127,7 +127,7 @@ export default {
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="ruleForm.remark"></el-input>
<el-input type="textarea" v-model="ruleForm.remark" @input="changeAmount"></el-input>
</el-form-item>
</el-form>
</div>