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

@ -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">
@ -562,6 +563,7 @@ import {
import {getReturnCode, printOilOrderReport} from '@/api/print'
import {addLJGoods, scanAppletQrCode} from "@/api/cashier/oilorder";
import {cashierOrderByOrderNo} from '@/api/cashier/cashierorder'
import {addHangBill} from "../../../api/cashier/hangbill";
export default {
dicts: ['CardCoupon_type'],
@ -665,6 +667,8 @@ export default {
pickUpTheOrder: false,
accountPending: false,
memberRecharge: false,
//
credit: {},
//
vipUserList: [],
chooseVipUser: {},
@ -1807,6 +1811,95 @@ export default {
},
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 => {
})
},
/**
* 设置选中的支付方式

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>