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_">{{ realAmount }}</div>
<div class="price_prefer">优惠合计:{{ disTotal }}</div> <div class="price_prefer">优惠合计:{{ disTotal }}</div>
</div> </div>
<div class="anniu" @click="settlement()" :class="{ disabled: !isClickable }">立即结算</div> <div class="anniu" @click="settlement()" :class="{ disabled: !isClickable }">立即结算</div>
</div> </div>
</div> </div>
@ -314,29 +314,29 @@
<el-button type="primary" @click="ScanCodePayment = false">关闭</el-button> <el-button type="primary" @click="ScanCodePayment = false">关闭</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- <el-dialog--> <!-- <el-dialog-->
<!-- title="现金支付"--> <!-- title="现金支付"-->
<!-- :visible.sync="cashPayment"--> <!-- :visible.sync="cashPayment"-->
<!-- width="439px"--> <!-- width="439px"-->
<!-- center--> <!-- center-->
<!-- >--> <!-- >-->
<!-- <div class="tc-box">--> <!-- <div class="tc-box">-->
<!-- <div class="title_">应收款 <span style="color: #F44522">¥{{realAmount}}</span></div>--> <!-- <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 :model="ruleForm2" :rules="rules2" ref="ruleForm2" label-width="100px" class="demo-ruleForm">-->
<!-- <el-form-item label="收款金额" prop="number">--> <!-- <el-form-item label="收款金额" prop="number">-->
<!-- <el-input v-model="ruleForm2.number">--> <!-- <el-input v-model="ruleForm2.number">-->
<!-- <template slot="append"></template>--> <!-- <template slot="append"></template>-->
<!-- </el-input>--> <!-- </el-input>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- <div class="t-size">--> <!-- <div class="t-size">-->
<!-- 应找零<span style="color: #F44522">¥{{getChangeShould}}</span>--> <!-- 应找零<span style="color: #F44522">¥{{getChangeShould}}</span>-->
<!-- </div>--> <!-- </div>-->
<!-- </el-form>--> <!-- </el-form>-->
<!-- </div>--> <!-- </div>-->
<!-- <span slot="footer" class="dialog-footer">--> <!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="cashPaymentClick()">确定收款</el-button>--> <!-- <el-button type="primary" @click="cashPaymentClick()">确定收款</el-button>-->
<!-- </span>--> <!-- </span>-->
<!-- </el-dialog>--> <!-- </el-dialog>-->
<el-dialog <el-dialog
title="挂单" title="挂单"
:visible.sync="hangingAnOrder" :visible.sync="hangingAnOrder"
@ -414,7 +414,7 @@
<accountPending :amount="oilGunClearing.amount" @changeAmount="changeAmount"></accountPending> <accountPending :amount="oilGunClearing.amount" @changeAmount="changeAmount"></accountPending>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="accountPending = false"> </el-button> <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> </span>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
@ -445,7 +445,8 @@
</el-dialog> </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"> @close="onDialogClose">
<div v-if="isPay" <div v-if="isPay"
v-loading="loading"> v-loading="loading">
@ -559,9 +560,10 @@ import {
getCheckTheStatusOfYourPaymentApi, getCheckTheStatusOfYourPaymentApi,
rechargeCard rechargeCard
} from "@/api/cashier/cardSet"; } from "@/api/cashier/cardSet";
import { getReturnCode, printOilOrderReport } from '@/api/print' import {getReturnCode, printOilOrderReport} from '@/api/print'
import {addLJGoods, scanAppletQrCode} from "@/api/cashier/oilorder"; 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 { export default {
dicts: ['CardCoupon_type'], dicts: ['CardCoupon_type'],
@ -618,7 +620,7 @@ export default {
oilGun: '', oilGun: '',
// //
oilGunClearing: { oilGunClearing: {
amount:0 amount: 0
}, },
// //
goodsList: [], goodsList: [],
@ -665,6 +667,8 @@ export default {
pickUpTheOrder: false, pickUpTheOrder: false,
accountPending: false, accountPending: false,
memberRecharge: false, memberRecharge: false,
//
credit: {},
// //
vipUserList: [], vipUserList: [],
chooseVipUser: {}, chooseVipUser: {},
@ -699,12 +703,12 @@ export default {
realAmount: { realAmount: {
handler(newVal) { handler(newVal) {
console.log("结算金额", newVal); console.log("结算金额", newVal);
// //
if (this.realAmount > 0){ if (this.realAmount > 0) {
this.isClickable = true this.isClickable = true
}else { } else {
this.isClickable = false this.isClickable = false
} }
}, },
}, },
@ -795,8 +799,8 @@ export default {
}, },
computed: { computed: {
getChangeShould(){ getChangeShould() {
return this.payForm.authCode-this.realAmount return this.payForm.authCode - this.realAmount
}, },
getGoodsItem() { getGoodsItem() {
if (this.oilGunClearing.amount && this.oilGunClearing.amount !== undefined) { if (this.oilGunClearing.amount && this.oilGunClearing.amount !== undefined) {
@ -832,8 +836,8 @@ export default {
methods: { methods: {
// //
onDialogClose(){ onDialogClose() {
this.payForm.authCode=null this.payForm.authCode = null
}, },
sendCouponClick() { sendCouponClick() {
@ -913,10 +917,10 @@ export default {
}, },
// //
handClose1() { handClose1() {
this.isPay = true, this.isPay = true,
this.isPaySuccess = false, this.isPaySuccess = false,
this.isQuery = true this.isQuery = true
this.openConfirm = false this.openConfirm = false
this.payForm.authCode = null this.payForm.authCode = null
@ -1065,17 +1069,17 @@ export default {
//this.getCode(this.realyPayBills, this.flag) //this.getCode(this.realyPayBills, this.flag)
}, },
// //
oilOrderReport () { oilOrderReport() {
// //
let oilOrderR = [ let oilOrderR = [
{ {
oilName : this.oilGunClearing.name, oilName: this.oilGunClearing.name,
amount : this.oilGunClearing.amount + '', amount: this.oilGunClearing.amount + '',
} }
] ]
let goodsOrderR = [] let goodsOrderR = []
if (this.goodsOrder && this.goodsOrder.length>0) { if (this.goodsOrder && this.goodsOrder.length > 0) {
this.goodsOrder.forEach(order => { this.goodsOrder.forEach(order => {
let o = { let o = {
oilName: order.name, oilName: order.name,
@ -1099,52 +1103,52 @@ export default {
}; };
let payTypeText = payTypeMap[this.payType] || '小程序码'; let payTypeText = payTypeMap[this.payType] || '小程序码';
let f ={ let f = {
oilOrder:oilOrderR, oilOrder: oilOrderR,
goodsOrder:goodsOrderR, goodsOrder: goodsOrderR,
payType:payTypeText, payType: payTypeText,
unitName:"", // unitName: "", //
// consumeAmount:this.consumeAmount, // 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 if (this.form1 && this.form1.unitName) f.unitName = this.form1.unitName
printOilOrderReport(f).then(res=>{ printOilOrderReport(f).then(res => {
console.log(res,1121) 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" this.payType = "ALIPAY"
}, },
// //
queryPayStatus(){ queryPayStatus() {
let _this = this; let _this = this;
let timer = setInterval(function (){ let timer = setInterval(function () {
// "234520231228115544f073f4" // "234520231228115544f073f4"
cashierOrderByOrderNo({orderNo:_this.orderNo}).then( response => { cashierOrderByOrderNo({orderNo: _this.orderNo}).then(response => {
if (response.data){ if (response.data) {
if (response.data.status == "paid"){ if (response.data.status == "paid") {
_this.isPay = true; _this.isPay = true;
_this.isPaySuccess = true; _this.isPaySuccess = true;
_this.isQuery = false; _this.isQuery = false;
@ -1156,7 +1160,7 @@ export default {
_this.resetting1(); _this.resetting1();
if (response.data.oilOrderAmount>0){ if (response.data.oilOrderAmount > 0) {
// for (let i =0;i<_this.oilPreferentialData.length;i++){ // for (let i =0;i<_this.oilPreferentialData.length;i++){
// _this.oilPreferentialData[i].oilPreferential.storeId = response.data.storeId // _this.oilPreferentialData[i].oilPreferential.storeId = response.data.storeId
// _this.oilPreferentialData[i].oilPreferential.orderAmount = response.data.oilOrderAmount // _this.oilPreferentialData[i].oilPreferential.orderAmount = response.data.oilOrderAmount
@ -1169,7 +1173,7 @@ export default {
} }
clearInterval(timer); clearInterval(timer);
} }
if (response.data.status == "payFail"){ if (response.data.status == "payFail") {
_this.isPaySuccess = false; _this.isPaySuccess = false;
// _this.isPay = true; // _this.isPay = true;
_this.isQuery = false; _this.isQuery = false;
@ -1177,14 +1181,14 @@ export default {
_this.loading = false; _this.loading = false;
clearInterval(timer); clearInterval(timer);
} }
if (response.data.status == "unpaid"){ if (response.data.status == "unpaid") {
_this.isQuery = true; _this.isQuery = true;
_this.dialogVisiblejLoading = true _this.dialogVisiblejLoading = true
} }
} }
// _this.resetting1(); // _this.resetting1();
}) })
},1000) }, 1000)
// 15 // 15
// if (_this.isQuery){ // if (_this.isQuery){
@ -1319,7 +1323,7 @@ export default {
// id // id
// //
if (this.oilGunClearing){ if (this.oilGunClearing) {
this.payForm.oilOrder = JSON.stringify({ this.payForm.oilOrder = JSON.stringify({
oilPrice: this.oilGunClearing.oilPrice, oilPrice: this.oilGunClearing.oilPrice,
oils: this.oilGunClearing.oilNameId, oils: this.oilGunClearing.oilNameId,
@ -1328,7 +1332,7 @@ export default {
activeId: this.chooseAct.hasOwnProperty('actId') ? this.chooseAct.activeId : null, activeId: this.chooseAct.hasOwnProperty('actId') ? this.chooseAct.activeId : null,
activeType: this.chooseAct.hasOwnProperty('type') ? this.chooseAct.activeType : null, activeType: this.chooseAct.hasOwnProperty('type') ? this.chooseAct.activeType : null,
}) })
}else { } else {
this.payForm.oilOrder = null this.payForm.oilOrder = null
} }
@ -1382,7 +1386,7 @@ export default {
console.log('支付类型', this.payForm.paymentType) console.log('支付类型', this.payForm.paymentType)
// //
this.payForm.realyPayBills= this.realAmount this.payForm.realyPayBills = this.realAmount
this.isPay = true; this.isPay = true;
this.openConfirm = true; this.openConfirm = true;
this.flag = 3 this.flag = 3
@ -1805,26 +1809,115 @@ export default {
} }
}, },
changeAmount(val){ changeAmount(val) {
console.log(val,1807) 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 * @param value
*/ */
setindex(value) { setindex(value) {
if (value=='after_pay'){ if (value == 'after_pay') {
if (this.getGoodsNum>0){ if (this.getGoodsNum > 0) {
this.$message.error("商品订单不支持挂账") this.$message.error("商品订单不支持挂账")
return return
} }
if (this.oilGunClearing.amount<=0){ if (this.oilGunClearing.amount <= 0) {
this.$message.error("请选择挂账订单") this.$message.error("请选择挂账订单")
return; return;
} }
this.accountPending = true this.accountPending = true
} }
console.log('支付方式',value); console.log('支付方式', value);
this.payType = value this.payType = value
// //
this.getActivity() this.getActivity()

View File

@ -127,7 +127,7 @@ export default {
<el-form-item label="备注" prop="remark"> <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-item>
</el-form> </el-form>
</div> </div>