diff --git a/src/api/order/index.js b/src/api/order/index.js index d145065..e22ad3d 100644 --- a/src/api/order/index.js +++ b/src/api/order/index.js @@ -24,4 +24,16 @@ export function orderorderDetail(params) { params }); } +/** + * 退单 + * @param {*} params + * @returns + */ +export function payreturnOrder(data) { + return request({ + method: "post", + url: "pay/returnOrder", + data + }); +} diff --git a/src/views/member/index.vue b/src/views/member/index.vue index cda2f80..6c06c6d 100644 --- a/src/views/member/index.vue +++ b/src/views/member/index.vue @@ -76,7 +76,8 @@ -->
- +
@@ -107,7 +108,8 @@ - + @@ -167,10 +169,13 @@ import add from '@/views/member/components/add.vue' import cwxeyboard from '@/components/cwx-keyboard/cwx-keyboard.vue' import keyboard from '@/views/home/components/keyboard.vue' const store = useUser() + const stored = ref(false)//储值余额 + const handleClose = async () => { stored.value = !stored.value } + const props = defineProps({//首页传值 membershow: { type: String, @@ -181,17 +186,20 @@ const props = defineProps({//首页传值 default: '提示' } }) + const flowingwater = reactive({//获取流水初始化 total: '', list: [] }) + const consumeFee = (e) => { //接收子组件值 并赋值给父组件 moneys.value = e } + const consumeFees = (e) => { tableData.phone = e - } + const confirmEvent = async () => {//子组件 确认按钮 try { let res = await accountPaymember({ @@ -212,6 +220,7 @@ const confirmEvent = async () => {//子组件 确认按钮 } } + const MemberAccount = async () => {//获取流水 try { let res = await memberqueryMemberAccount({ @@ -228,11 +237,15 @@ const MemberAccount = async () => {//获取流水 }) } } + const recharge = ref(false)//充值 + const memberaddshow = ref(false) //添加会员 + const memberaddshowclose = () => { memberaddshow.value = !memberaddshow.value } + const tableData = reactive({//表格数据 list: [{ name: "", @@ -247,9 +260,11 @@ const tableData = reactive({//表格数据 phone: '', total: '' }) + const inputChange = lodash.debounce(function () { //搜索手机号 asyncqueryMembermember() }, 500) + const asyncqueryMembermember = async () => {//会员列表数据 let res = await queryMembermember({ shopId: store.userInfo.shopId, @@ -263,25 +278,31 @@ const asyncqueryMembermember = async () => {//会员列表数据 MemberAccount() } } + const tableRowClassName = ({ row, rowIndex }) => {//动态给tab加样式 if (rowIndex === datarow.value) { return 'warning-row' } return '' } + const datarow = ref(0) //初始化右边 const cellclicktableData = (row, column, cell, event) => { const index = tableData.list.findIndex(item => item.id == row.id) datarow.value = index } + const handleCurrentChange = (val) => { //页码 tableData.page = val datarow.value = 0 asyncqueryMembermember() } + const handlerecharge = () => { recharge.value = !recharge.value } + const resetMembrform = ref({}) + const membrform = ref({ //membrform 添加会员表单 phone: '', nickName: '', @@ -290,7 +311,9 @@ const membrform = ref({ //membrform 添加会员表单 sex: '', level: '' }) + const formRef = ref(null); //ref membrform + const rules = reactive({ // membrform验证 phone: [ { diff --git a/src/views/order/index.vue b/src/views/order/index.vue index 03bd7f8..ecb7591 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -4,9 +4,8 @@
- - 搜索 + +
@@ -31,7 +30,7 @@
-
+
堂食订单 @@ -90,11 +89,12 @@
- 点单 + 打票 - 取消 + 退单 +
- 结算 +
@@ -135,7 +135,19 @@
-->
- + @@ -144,25 +156,38 @@ import { ref, onMounted, reactive } from 'vue' import { ElMessage, dayjs } from 'element-plus' import { useUser } from "@/store/user.js" import lodash from 'lodash' -import { orderfindOrder, orderorderDetail } from '@/api/order/index.js' +import { orderfindOrder, orderorderDetail, payreturnOrder } from '@/api/order/index.js' import add from '@/views/order/components/add.vue' const store = useUser() const itemboxshow = ref(false) +const drawershow = ref(true) const handleClick = (Name) => {//切换teb ordereData.status = Name.props.name asyncorderfindOrder() } const firstinput = ref('')//搜索输入框 -const onSubmit = () => { - if (firstinput.value) { - } else { - ElMessage({ - message: '请输入订单号查询', - type: 'warning', +const recharge = ref(true)//退单切换 + +const handlerecharge = () => { + recharge.value = !recharge.value +} + +const payreturnOrderclick = async () => { + try { + let result = orderDetaildata.value.detailList.map(item => { + return { + id: item.id, + orderId: orderDetaildata.value.id + } }) + await payreturnOrder(result) + asyncorderfindOrder() + } catch (error) { + } } + const emititemboxshow = async (e) => { //接收子组件值 并赋值给父组件 try { let res = await orderorderDetail({ @@ -177,7 +202,7 @@ const emititemboxshow = async (e) => { //接收子组件值 并赋值给父组 } } const orderDetaildata = ref({//详情数据 - + // loading }) const ordereData = reactive({//表格数据 list: [{ @@ -193,7 +218,6 @@ const ordereData = reactive({//表格数据 status: 'closed', total: '', orderNo: '', - ordernumbr: '' }) const asyncorderfindOrder = async () => {//获取流水 try { @@ -202,7 +226,7 @@ const asyncorderfindOrder = async () => {//获取流水 status: ordereData.status, size: ordereData.size, page: ordereData.page, - ordernumbr: ordereData.ordernumbr + orderNo: ordereData.orderNo }) ordereData.total = res.total ordereData.list = res.list @@ -378,6 +402,161 @@ onMounted(() => { } + .recharge_footer { + + // display: flex; + // justify-content: space-between; + .recharge_footer_item { + background: #f2f2f2; + width: 60%; + background: #f2f2f2; + border-radius: 10px; + padding: 20px; + display: flex; + justify-content: space-between; + flex-flow: wrap; + + .recharge_footer_items { + // background: #187ead; + border: 1px solid #187ead; + padding: 16px 22px; + width: 30%; + color: #187ead; + height: fit-content; + text-align: center; + border-radius: 10px; + margin-top: 10px; + } + } + + .recharge_footer_itemright { + padding-left: 20px; + width: 100%; + position: relative; + bottom: 0; + left: 0; + + .recharge_footer_itemright_input { + width: 100%; + background: #333333; + border-radius: 10px; + padding: 0 6px; + display: flex; + height: 60px; + justify-content: space-between; + align-items: center; + + div:nth-child(1) { + color: #56792e; + font-size: 16px; + } + + div:nth-child(2) { + color: #88937c; + font-size: 20px; + } + } + + .keyboard { + width: 100%; + height: 40vh; + background: #FFFFFF; + + .key-row { + display: flex; + display: -webkit-flex; + position: relative; + height: 10vh; + line-height: 10vh; + + + } + } + + + .keyboard .key-cell { + flex: 1; + -webkit-box-flex: 1; + font-size: 30px; + display: flex; + justify-content: center; + align-items: center; + } + + .keyboard .key-confirm { + position: absolute; + text-align: center; + height: 30vh; + width: 25%; + line-height: 30vh; + color: #FFFFFF; + z-index: 5; + right: 0; + bottom: 0; + + display: flex; + justify-content: center; + align-items: center; + } + + .keyboard .key-confirm2 { + position: absolute; + height: 10vh; + width: 25%; + line-height: 10vh; + z-index: 9999; + right: 0; + top: 60px; + font-size: 30px; + display: flex; + justify-content: center; + align-items: center; + } + + .key-zero-and-point { + display: flex; + height: 10vh; + justify-content: center; + align-items: center; + width: 75%; + font-size: 30px; + + .zero { + display: flex; + justify-content: center; + align-items: center; + width: 66.66%; + font-size: 30px; + text-align: center; + height: 100%; + } + + .point { + display: flex; + justify-content: center; + align-items: center; + width: 33.33%; + font-size: 30px; + text-align: center; + height: 100%; + } + } + + .key-cell:active { + color: white; + background: black; //黑色 + opacity: 0.1; //这里重要,就是通过这个透明度来设置 + } + + .a:active, + .key-confirm2:active { + color: white; + background: black; //黑色 + opacity: 0.1; //这里重要,就是通过这个透明度来设置 + } + } + } + .orderbox_right { position: relative; width: 40%;