|
|
@@ -1,29 +1,16 @@
|
|
|
<!--
|
|
|
- 开单确认提交弹窗
|
|
|
- 开单确认提交弹窗
|
|
|
+ 开单确认提交面板(常驻在购物车右侧,非弹窗)
|
|
|
+ 由开单 POS 页四栏布局直接挂载,始终渲染;切换客户时刷新表单。
|
|
|
UI/业务对齐 ghsApp affirm:配送、打折、付款与备注提交。
|
|
|
- 查看财务在 POS 购物车侧;本弹窗供 add.vue 复用。
|
|
|
-->
|
|
|
<template>
|
|
|
- <el-dialog
|
|
|
- title="确认提交"
|
|
|
- :visible.sync="innerVisible"
|
|
|
- :width="dialogWidth"
|
|
|
- center
|
|
|
- append-to-body
|
|
|
- :close-on-click-modal="false"
|
|
|
- custom-class="order-commit-dialog"
|
|
|
- @open="onOpen"
|
|
|
- >
|
|
|
+ <aside class="order-commit-panel">
|
|
|
+ <!-- 与购物车 .pos-cart-head 同高,保证右栏标题齐平 -->
|
|
|
+ <div class="panel-head">确认提交</div>
|
|
|
+ <!-- 中间可滚动:表单内容多,避免挤掉底部提交按钮 -->
|
|
|
+ <div class="panel-scroll">
|
|
|
<div class="commit-body">
|
|
|
- <div class="accounts-list">
|
|
|
- <span class="accounts-label">当前门店</span>
|
|
|
- <div class="accounts-center shop-name">{{ displayShopName }}</div>
|
|
|
- </div>
|
|
|
- <div class="accounts-list">
|
|
|
- <span class="accounts-label">客户名称</span>
|
|
|
- <div class="accounts-center" style="font-weight:bold;color:black;">{{ form.customName }}</div>
|
|
|
- </div>
|
|
|
+ <!-- 当前门店/客户名称已移至顶栏展示,此处不再重复渲染;form.customName 仍用于提交 -->
|
|
|
|
|
|
<!-- 批发商 pfLevel:同城/德邦等 -->
|
|
|
<div class="accounts-list" v-if="currentShop.pfLevel && currentShop.pfLevel == 1">
|
|
|
@@ -254,12 +241,6 @@
|
|
|
<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="form.remark" />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="accounts-list accounts-list--footer">
|
|
|
- <el-button @click="innerVisible = false">取消(Esc)</el-button>
|
|
|
- <el-button type="primary" :loading="submitting" @click="submitOrder(false)">确认(Ctrl+Enter)</el-button>
|
|
|
- </div>
|
|
|
- <p class="tip">按 Tab 切到下一个,按空格选中</p>
|
|
|
-
|
|
|
<div v-if="!$util.isEmpty(diffList)" class="diff-box">
|
|
|
<div class="diff-title">以下花材开单价与系统售价不一致,确认提交吗?</div>
|
|
|
<el-button type="primary" size="mini" @click="submitOrder(true)">确认差价(Ctrl+Alt+Enter)</el-button>
|
|
|
@@ -270,8 +251,17 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 底部固定提交:始终可见,不随表单滚动 -->
|
|
|
+ <div class="panel-footer">
|
|
|
+ <el-button type="primary" :loading="submitting" class="submit-btn" @click="submitOrder(false)">
|
|
|
+ 确认提交(Ctrl+Enter)
|
|
|
+ </el-button>
|
|
|
+ <p class="tip">按 Tab 切到下一个,按空格选中</p>
|
|
|
+ </div>
|
|
|
|
|
|
- <!-- 选物流 -->
|
|
|
+ <!-- 选物流:嵌套弹窗挂到 body,避免被侧栏裁剪 -->
|
|
|
<el-dialog title="请选择物流" :visible.sync="wlPickerVisible" width="420px" append-to-body>
|
|
|
<div v-loading="wlLoading">
|
|
|
<el-button
|
|
|
@@ -286,7 +276,7 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <!-- 打折:1–9折 / 不打 / 自定义 -->
|
|
|
+ <!-- 打折:1–9折 / 不打 / 自定义;append-to-body 保证遮罩盖住整页 -->
|
|
|
<el-dialog title="选择打折" :visible.sync="discountVisible" width="440px" append-to-body>
|
|
|
<div class="discount-box">
|
|
|
<el-button
|
|
|
@@ -307,7 +297,7 @@
|
|
|
<el-button @click="discountVisible = false">取消</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- </el-dialog>
|
|
|
+ </aside>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
@@ -316,7 +306,6 @@ import dayjs from 'dayjs'
|
|
|
export default {
|
|
|
name: 'OrderCommitDialog',
|
|
|
props: {
|
|
|
- visible: { type: Boolean, default: false },
|
|
|
customId: { type: [Number, String], default: 0 },
|
|
|
customName: { type: String, default: '' },
|
|
|
/** 当前开单门店名,与 POS 页「当前在 xxx」一致 */
|
|
|
@@ -391,21 +380,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- innerVisible: {
|
|
|
- get() { return this.visible },
|
|
|
- set(v) { this.$emit('update:visible', v) }
|
|
|
- },
|
|
|
+ // 面板已隐藏「当前门店」行;仍保留计算,避免与 shopName/currentShop 同步逻辑脱节
|
|
|
displayShopName() {
|
|
|
if (this.shopName) return this.shopName
|
|
|
const shop = this.currentShop || {}
|
|
|
return shop.shopName || shop.name || '门店'
|
|
|
},
|
|
|
- dialogWidth() {
|
|
|
- if (typeof window !== 'undefined' && window.innerWidth < 720) {
|
|
|
- return '92%'
|
|
|
- }
|
|
|
- return '655px'
|
|
|
- },
|
|
|
displayPackCost() {
|
|
|
return this.currentShop.pfLevel && this.currentShop.pfLevel == 1
|
|
|
},
|
|
|
@@ -459,10 +439,24 @@ export default {
|
|
|
} else {
|
|
|
this.modifyPrice = val
|
|
|
}
|
|
|
+ },
|
|
|
+ /** 切换客户时重置面板,避免沿用上一客户配送/付款等选项 */
|
|
|
+ customId() {
|
|
|
+ this.resetPanel()
|
|
|
+ },
|
|
|
+ customName(val) {
|
|
|
+ this.form.customName = val || ''
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.resetPanel()
|
|
|
+ },
|
|
|
methods: {
|
|
|
- onOpen() {
|
|
|
+ /**
|
|
|
+ * 重置面板表单与询价状态
|
|
|
+ * 用于:进页、切换客户、提交成功后;侧栏常驻,不再关弹窗
|
|
|
+ */
|
|
|
+ resetPanel() {
|
|
|
this.diffList = []
|
|
|
this.discountValue = 0
|
|
|
this.customDiscount = ''
|
|
|
@@ -487,8 +481,6 @@ export default {
|
|
|
this.form.callErrand = 0
|
|
|
this.form.weight = 1
|
|
|
this.form.deliveryRemark = ''
|
|
|
- this.discountValue = 0
|
|
|
- this.customDiscount = ''
|
|
|
this.pickupTimeValue = dayjs().format('YYYY-MM-DD HH:mm')
|
|
|
this.$nextTick(() => {
|
|
|
this.modifyPrice = this.finalPrice
|
|
|
@@ -666,6 +658,8 @@ export default {
|
|
|
},
|
|
|
/**
|
|
|
* 提交订单;forceDealPrice 为差价二次确认
|
|
|
+ * 成功后只重置面板并 emit success,不关侧栏(侧栏始终展示)
|
|
|
+ * 父页可通过 $refs.commitPanel.submitOrder(false) 走快捷键提交
|
|
|
*/
|
|
|
submitOrder(forceDealPrice) {
|
|
|
const that = this
|
|
|
@@ -756,7 +750,8 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
that.$notify({ title: '成功', message: '开单成功', type: 'success' })
|
|
|
- that.innerVisible = false
|
|
|
+ // 成功后重置表单,面板继续常驻;清车等由父页 onOrderSuccess 处理
|
|
|
+ that.resetPanel()
|
|
|
that.$emit('success', data)
|
|
|
}).catch(() => {
|
|
|
that.submitting = false
|
|
|
@@ -768,41 +763,82 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
-.order-commit-dialog {
|
|
|
- .el-dialog__body {
|
|
|
- max-height: calc(100vh - 160px);
|
|
|
- overflow-y: auto;
|
|
|
- padding-top: 10px;
|
|
|
- }
|
|
|
-}
|
|
|
+/* 侧栏内嵌套弹窗无需改 el-dialog 全局高度 */
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+/* 右侧常驻面板:约 360px,与收窄后的购物车并列 */
|
|
|
+.order-commit-panel {
|
|
|
+ flex-shrink: 0;
|
|
|
+ width: 360px;
|
|
|
+ max-width: 360px;
|
|
|
+ background: #fff;
|
|
|
+ border-left: 1px solid #ebeef5;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ min-height: 0;
|
|
|
+ height: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+/* 与开单页 .pos-cart-head 统一 48px,避免两侧 header 高低不一 */
|
|
|
+.panel-head {
|
|
|
+ flex-shrink: 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ height: 48px;
|
|
|
+ min-height: 48px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 14px;
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 22px;
|
|
|
+ font-weight: 700;
|
|
|
+ color: #303133;
|
|
|
+ border-bottom: 1px solid #ebeef5;
|
|
|
+}
|
|
|
+.panel-scroll {
|
|
|
+ flex: 1;
|
|
|
+ min-height: 0;
|
|
|
+ overflow-y: auto;
|
|
|
+ padding: 12px 12px 8px;
|
|
|
+}
|
|
|
+.panel-footer {
|
|
|
+ flex-shrink: 0;
|
|
|
+ padding: 10px 12px 14px;
|
|
|
+ border-top: 1px solid #ebeef5;
|
|
|
+ background: #fff;
|
|
|
+ .submit-btn {
|
|
|
+ width: 100%;
|
|
|
+ height: 40px;
|
|
|
+ font-size: 15px;
|
|
|
+ }
|
|
|
+ .tip {
|
|
|
+ text-align: center;
|
|
|
+ color: #999;
|
|
|
+ margin: 8px 0 0;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+}
|
|
|
.commit-body {
|
|
|
.accounts-list {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: flex-start;
|
|
|
margin-bottom: 12px;
|
|
|
- font-size: 14px;
|
|
|
+ font-size: 13px;
|
|
|
color: #666;
|
|
|
}
|
|
|
.accounts-list--top {
|
|
|
align-items: flex-start;
|
|
|
}
|
|
|
- .accounts-list--footer {
|
|
|
- justify-content: flex-end;
|
|
|
- margin-top: 4px;
|
|
|
- }
|
|
|
.accounts-label {
|
|
|
flex-shrink: 0;
|
|
|
- width: 72px;
|
|
|
+ width: 64px;
|
|
|
line-height: 32px;
|
|
|
}
|
|
|
.accounts-center {
|
|
|
flex: 1;
|
|
|
min-width: 0;
|
|
|
- margin-left: 12px;
|
|
|
+ margin-left: 8px;
|
|
|
text-align: left;
|
|
|
}
|
|
|
.accounts-center--row {
|
|
|
@@ -822,6 +858,27 @@ export default {
|
|
|
color: #909399;
|
|
|
font-size: 12px;
|
|
|
}
|
|
|
+ .discount-tag {
|
|
|
+ margin-left: 8px;
|
|
|
+ color: #3385ff;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+ .diff-box {
|
|
|
+ text-align: left;
|
|
|
+ margin-top: 12px;
|
|
|
+ }
|
|
|
+ .diff-title {
|
|
|
+ color: red;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ }
|
|
|
+ .diff-line {
|
|
|
+ color: #3385ff;
|
|
|
+ margin-top: 4px;
|
|
|
+ font-size: 12px;
|
|
|
+ .g { color: green; font-weight: bold; margin-left: 4px; }
|
|
|
+ .r { color: red; font-weight: bold; margin-left: 4px; }
|
|
|
+ }
|
|
|
.quotes-tip {
|
|
|
color: #909399;
|
|
|
font-size: 13px;
|
|
|
@@ -831,61 +888,34 @@ export default {
|
|
|
flex-wrap: wrap;
|
|
|
}
|
|
|
.quote-item {
|
|
|
- min-width: 88px;
|
|
|
- margin: 0 8px 8px 0;
|
|
|
- padding: 8px 10px;
|
|
|
+ width: calc(50% - 6px);
|
|
|
+ margin: 0 6px 6px 0;
|
|
|
+ padding: 8px;
|
|
|
border: 1px solid #dcdfe6;
|
|
|
border-radius: 4px;
|
|
|
- text-align: center;
|
|
|
cursor: pointer;
|
|
|
+ box-sizing: border-box;
|
|
|
&.active {
|
|
|
border-color: #3385ff;
|
|
|
background: #ecf5ff;
|
|
|
- color: #3385ff;
|
|
|
}
|
|
|
&.disabled {
|
|
|
- opacity: 0.45;
|
|
|
- cursor: not-allowed;
|
|
|
+ opacity: 0.5;
|
|
|
+ pointer-events: none;
|
|
|
}
|
|
|
.platform-name {
|
|
|
- font-size: 13px;
|
|
|
font-weight: 600;
|
|
|
+ color: #303133;
|
|
|
}
|
|
|
.platform-price {
|
|
|
+ color: #3385ff;
|
|
|
margin-top: 4px;
|
|
|
- font-size: 14px;
|
|
|
}
|
|
|
.platform-type {
|
|
|
- margin-top: 2px;
|
|
|
font-size: 12px;
|
|
|
color: #909399;
|
|
|
}
|
|
|
}
|
|
|
- .discount-tag {
|
|
|
- margin-left: 8px;
|
|
|
- color: #3385ff;
|
|
|
- font-weight: 600;
|
|
|
- }
|
|
|
- .tip {
|
|
|
- text-align: center;
|
|
|
- color: #999;
|
|
|
- margin: 8px 0 0;
|
|
|
- }
|
|
|
- .diff-box {
|
|
|
- text-align: left;
|
|
|
- margin-top: 12px;
|
|
|
- }
|
|
|
- .diff-title {
|
|
|
- color: red;
|
|
|
- font-weight: bold;
|
|
|
- margin-bottom: 8px;
|
|
|
- }
|
|
|
- .diff-line {
|
|
|
- color: #3385ff;
|
|
|
- margin-top: 4px;
|
|
|
- .g { color: green; font-weight: bold; margin-left: 4px; }
|
|
|
- .r { color: red; font-weight: bold; margin-left: 4px; }
|
|
|
- }
|
|
|
}
|
|
|
.discount-box {
|
|
|
.discount-btn {
|
|
|
@@ -895,8 +925,6 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
margin-top: 12px;
|
|
|
- padding-top: 12px;
|
|
|
- border-top: 1px solid #ebeef5;
|
|
|
}
|
|
|
}
|
|
|
</style>
|