|
|
@@ -2,7 +2,8 @@
|
|
|
开单确认提交面板(常驻在购物车右侧,非弹窗)
|
|
|
由开单 POS 页四栏布局直接挂载,始终渲染;切换客户时刷新表单。
|
|
|
UI/业务对齐 ghsApp affirm:账单日期入口已下线;送货日期写入 sendTime,可补录过去日期。
|
|
|
- 键盘:Ctrl+Enter 提交,差价弹窗也用 Ctrl+Enter 确认,F7 备注,Alt+1~3 配送,Alt+Q/W/E/R 付款。
|
|
|
+ 键盘:Ctrl+Enter 先开大号确认框,框内再 Ctrl+Enter / 点确定才下单;Esc 取消。
|
|
|
+ 差价弹窗也用 Ctrl+Enter 确认,F7 备注,Alt+1~3 配送,Alt+Q/W/E/R 付款。
|
|
|
-->
|
|
|
<template>
|
|
|
<aside class="order-commit-panel" :class="{ 'is-kb-zone': kbActive }">
|
|
|
@@ -291,6 +292,32 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 打折:1–9折 / 不打 / 自定义;append-to-body 保证遮罩盖住整页 -->
|
|
|
+ <!-- 大号确认:替代 Element MessageBox,确定键写上 Ctrl+Enter -->
|
|
|
+ <el-dialog
|
|
|
+ :title="confirmTitle"
|
|
|
+ :visible.sync="confirmVisible"
|
|
|
+ width="560px"
|
|
|
+ append-to-body
|
|
|
+ custom-class="commit-confirm-dialog"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ @opened="focusConfirmBtn"
|
|
|
+ >
|
|
|
+ <div class="commit-confirm-body">
|
|
|
+ <div class="commit-confirm-tip">{{ confirmTip }}</div>
|
|
|
+ <div class="commit-confirm-row">客户 {{ form.customName || customName || '-' }}</div>
|
|
|
+ <div class="commit-confirm-row">收款 <span class="pay">¥{{ modifyPrice }}</span></div>
|
|
|
+ </div>
|
|
|
+ <span slot="footer">
|
|
|
+ <el-button @click="closeConfirmDialog">取消(Esc)</el-button>
|
|
|
+ <el-button
|
|
|
+ ref="confirmSubmitBtn"
|
|
|
+ type="primary"
|
|
|
+ :loading="submitting"
|
|
|
+ @click="submitOrder(false)"
|
|
|
+ >确定(Ctrl+Enter)</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<el-dialog title="选择打折" :visible.sync="discountVisible" width="440px" append-to-body>
|
|
|
<div class="discount-box">
|
|
|
<el-button
|
|
|
@@ -336,6 +363,8 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
submitting: false,
|
|
|
+ /** 大号确认框:点提交或 Ctrl+Enter 先弹这个,再确认才真正下单 */
|
|
|
+ confirmVisible: false,
|
|
|
modifyPrice: 0,
|
|
|
diffList: [],
|
|
|
diffVisible: false,
|
|
|
@@ -404,6 +433,21 @@ export default {
|
|
|
const shop = this.currentShop || {}
|
|
|
return shop.shopName || shop.name || '门店'
|
|
|
},
|
|
|
+ /** 确认框标题:跟付款方式走,避免只写「提示」看不出在确认什么 */
|
|
|
+ confirmTitle() {
|
|
|
+ if (this.form.hasPay == 1) return '确认线下付款'
|
|
|
+ if (this.form.hasPay == 2) return '确认挂账'
|
|
|
+ if (this.form.hasPay == 4) return '确认余额支付'
|
|
|
+ if (this.form.hasPay == 0) return '确认扫码收款'
|
|
|
+ return '确认提交'
|
|
|
+ },
|
|
|
+ confirmTip() {
|
|
|
+ if (this.form.hasPay == 1) return '确认线下付款提交这张单?'
|
|
|
+ if (this.form.hasPay == 2) return '确认挂账提交这张单?'
|
|
|
+ if (this.form.hasPay == 4) return '确认用余额支付这张单?'
|
|
|
+ if (this.form.hasPay == 0) return '确认扫码收款提交这张单?'
|
|
|
+ return '确认提交这张单?'
|
|
|
+ },
|
|
|
displayPackCost() {
|
|
|
return this.currentShop.pfLevel && this.currentShop.pfLevel == 1
|
|
|
},
|
|
|
@@ -475,6 +519,7 @@ export default {
|
|
|
* 用于:进页、切换客户、提交成功后;侧栏常驻,不再关弹窗
|
|
|
*/
|
|
|
resetPanel() {
|
|
|
+ this.confirmVisible = false
|
|
|
this.diffVisible = false
|
|
|
this.diffList = []
|
|
|
this.discountValue = 0
|
|
|
@@ -777,6 +822,17 @@ export default {
|
|
|
/**
|
|
|
* 挂账确认框关掉后差价弹窗才出现,延迟抢焦点,避免焦点还留在已关的 MessageBox 上
|
|
|
*/
|
|
|
+ /** 父页 Esc:关掉提交确认框,不跳回搜索 */
|
|
|
+ closeConfirmDialog() {
|
|
|
+ this.confirmVisible = false
|
|
|
+ },
|
|
|
+ /** 弹框打开后焦点落到确定,方便看见当前可 Ctrl+Enter */
|
|
|
+ focusConfirmBtn() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const btn = this.$refs.confirmSubmitBtn
|
|
|
+ if (btn && btn.$el && typeof btn.$el.focus === 'function') btn.$el.focus()
|
|
|
+ })
|
|
|
+ },
|
|
|
focusDiffConfirm() {
|
|
|
const focusBtn = () => {
|
|
|
const btn = this.$refs.diffConfirmBtn
|
|
|
@@ -930,19 +986,18 @@ export default {
|
|
|
|
|
|
// 差价弹窗里已点过确认,不再套一层「确认挂账」
|
|
|
if (forceDealPrice) {
|
|
|
+ this.confirmVisible = false
|
|
|
doCreate()
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- let tip = '确认提交'
|
|
|
- if (this.form.hasPay == 1) tip = '确认线下付款?'
|
|
|
- else if (this.form.hasPay == 2) tip = '确认挂账?'
|
|
|
- else if (this.form.hasPay == 4) tip = '确认余额支付?'
|
|
|
- else if (this.form.hasPay == 0) tip = '确认扫码收款?'
|
|
|
-
|
|
|
- this.$confirm(tip, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
|
|
- doCreate()
|
|
|
- }).catch(() => {})
|
|
|
+ // 第一次点/Ctrl+Enter 只开大号确认框;框已开再确认才下单
|
|
|
+ if (!this.confirmVisible) {
|
|
|
+ this.confirmVisible = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.confirmVisible = false
|
|
|
+ doCreate()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -950,6 +1005,50 @@ export default {
|
|
|
|
|
|
<style lang="scss">
|
|
|
/* 侧栏内嵌套弹窗无需改 el-dialog 全局高度 */
|
|
|
+/* append-to-body 的确认框不受 scoped 影响,单独放大标题/金额/按钮 */
|
|
|
+.commit-confirm-dialog {
|
|
|
+ .el-dialog__header {
|
|
|
+ padding: 24px 32px 10px;
|
|
|
+ }
|
|
|
+ .el-dialog__title {
|
|
|
+ font-size: 22px;
|
|
|
+ font-weight: 700;
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
+ .el-dialog__body {
|
|
|
+ padding: 8px 32px 6px;
|
|
|
+ }
|
|
|
+ .el-dialog__footer {
|
|
|
+ padding: 16px 32px 28px;
|
|
|
+ }
|
|
|
+ .el-dialog__footer .el-button {
|
|
|
+ min-width: 168px;
|
|
|
+ height: 48px;
|
|
|
+ font-size: 16px;
|
|
|
+ padding: 0 18px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.commit-confirm-body {
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 1.6;
|
|
|
+ color: #303133;
|
|
|
+}
|
|
|
+.commit-confirm-tip {
|
|
|
+ margin-bottom: 16px;
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: 700;
|
|
|
+ color: #303133;
|
|
|
+}
|
|
|
+.commit-confirm-row {
|
|
|
+ margin-top: 12px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #606266;
|
|
|
+ .pay {
|
|
|
+ font-size: 28px;
|
|
|
+ font-weight: 700;
|
|
|
+ color: #f56c6c;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss" scoped>
|