Merge branch 'test' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into gyq
This commit is contained in:
commit
e9b60e238d
|
|
@ -0,0 +1,68 @@
|
|||
// 代客下单
|
||||
import request from "@/utils/request";
|
||||
//就餐形式,默认堂食后付费
|
||||
const useType='dine-in-after'
|
||||
function getUseType(){
|
||||
const type=localStorage.getItem("useType")
|
||||
return type?type:useType
|
||||
}
|
||||
|
||||
// 购物车-临时菜添加
|
||||
export function $temporaryDishes(data) {
|
||||
return request({
|
||||
url: '/api/place/temporaryDishes',
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
useType:getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 购物车-单品改价
|
||||
export function $updatePrice(data) {
|
||||
return request({
|
||||
url: '/api/place/updatePrice',
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 团购券-获取可使用团购券列表
|
||||
|
||||
export function $thirdPartyCoupon(data) {
|
||||
return request({
|
||||
url: '/api/thirdPartyCoupon/list',
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
//核销团购券商品
|
||||
export function $checkCoupon(data) {
|
||||
return request({
|
||||
url: '/api/place/checkCoupon',
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
//整体等叫/取消等叫
|
||||
export function $waitCall(data) {
|
||||
return request({
|
||||
url: '/api/place/waitCall',
|
||||
method: "put",
|
||||
data:{
|
||||
useType:getUseType(),
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ export function tbPrintMachine(data, method = "post") {
|
|||
// 开票
|
||||
export function getbinding(data) {
|
||||
return request({
|
||||
url: "/api/tbShopInfo/binding",
|
||||
url: "/api/invoice/binding",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
|
|
@ -26,6 +26,53 @@ export function getbinding(data) {
|
|||
}
|
||||
});
|
||||
}
|
||||
// 提交开票
|
||||
export function getsubInvoicing(data) {
|
||||
return request({
|
||||
url: "/api/invoice/subInvoicing",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 获取数电发票类型
|
||||
export function getdigitalInvoice(data) {
|
||||
return request({
|
||||
url: "/api/invoice/digitalInvoice",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 获取项目分类
|
||||
export function getindustry(data) {
|
||||
return request({
|
||||
url: "/api/invoice/industry",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 计算税额
|
||||
export function getstoreSe(data) {
|
||||
return request({
|
||||
url: "/api/invoice/storeSe",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
is_tax:1,
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取应用中心列表
|
||||
* @returns
|
||||
|
|
|
|||
|
|
@ -0,0 +1,205 @@
|
|||
// 代客下单
|
||||
import request from "@/utils/request-php";
|
||||
import { getToken } from '@/utils/auth'
|
||||
function getLoginName() {
|
||||
const obj = localStorage.getItem("userInfo") || '';
|
||||
const { username } = obj ? JSON.parse(obj) : {};
|
||||
return username
|
||||
}
|
||||
// 抖音团购核销准备
|
||||
export function $douyin_fulfilmentcertificateprepare(data) {
|
||||
return request({
|
||||
url: 'douyin/fulfilmentcertificateprepare',
|
||||
method: "post",
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 抖音团购核销
|
||||
export function $douyin_certificateprepare(data) {
|
||||
return request({
|
||||
url: 'douyin/certificateprepare',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 抖音团购核销撤销
|
||||
export function $douyin_fulfilmentcertificatecancel(data) {
|
||||
return request({
|
||||
url: 'douyin/fulfilmentcertificatecancel',
|
||||
method: "post",
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 抖音团购核销记录
|
||||
export function $douyin_orderlist(data) {
|
||||
return request({
|
||||
url: 'douyin/orderlist',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 抖音门店列表
|
||||
export function $douyin_storelist(data) {
|
||||
return request({
|
||||
url: 'douyin/storelist',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 抖音绑定门店
|
||||
export function $douyin_bindstore(data) {
|
||||
return request({
|
||||
url: 'douyin/bindstore',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 抖音订单查询
|
||||
|
||||
export function $douyin_orderquery(data) {
|
||||
return request({
|
||||
url: 'douyin/orderquery',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
//会员签入
|
||||
export function $douyin_checkIn(data) {
|
||||
return request({
|
||||
url: 'douyin/checkIn',
|
||||
method: "post",
|
||||
data: {
|
||||
clientType: 'ADMIN',
|
||||
token: getToken(),
|
||||
loginName: getLoginName(),
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//美团
|
||||
|
||||
// 美团获取uisdk 绑定 链接
|
||||
|
||||
export function $meituan_getuisdkurl(data) {
|
||||
return request({
|
||||
url: 'meituan/getuisdkurl',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 美团获取uisdk 解绑 链接
|
||||
|
||||
export function $meituan_getuisdkuniurl(data) {
|
||||
return request({
|
||||
url: 'meituan/getuisdkuniurl',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 美团团购核销准备
|
||||
|
||||
export function $meituan_fulfilmentcertificateprepare(data) {
|
||||
return request({
|
||||
url: 'meituan/fulfilmentcertificateprepare',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 美团执行核销
|
||||
|
||||
export function $meituan_certificateprepare(data) {
|
||||
return request({
|
||||
url: 'meituan/certificateprepare',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 美团团购核销记录
|
||||
|
||||
|
||||
export function $meituan_orderlist(data) {
|
||||
return request({
|
||||
url: 'meituan/orderlist',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 美团团购撤销
|
||||
|
||||
|
||||
export function $meituan_fulfilmentcertificatecancel(data) {
|
||||
return request({
|
||||
url: 'meituan/fulfilmentcertificatecancel',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 美团查询绑定状态
|
||||
export function $meituan_searchstorestatus(data) {
|
||||
return request({
|
||||
url: 'meituan/searchstorestatus',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 登出
|
||||
export function $logout(data) {
|
||||
return request({
|
||||
url: 'user/logout',
|
||||
method: "post",
|
||||
data: {
|
||||
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取挂账人列表
|
||||
* @returns
|
||||
*/
|
||||
export function getCreditBuyerList(params) {
|
||||
return request({
|
||||
url: '/api/credit/buyer/page',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取挂账人详情
|
||||
* @returns
|
||||
*/
|
||||
export function getCreditBuyerInfo(id) {
|
||||
return request({
|
||||
url: '/api/credit/buyer/' + id,
|
||||
method: 'get',
|
||||
params: {}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加挂账人
|
||||
* @returns
|
||||
*/
|
||||
export function addCreditBuyer(data) {
|
||||
return request({
|
||||
url: '/api/credit/buyer',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑挂账人
|
||||
* @returns
|
||||
*/
|
||||
export function editCreditBuyer(data) {
|
||||
return request({
|
||||
url: '/api/credit/buyer',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 还款
|
||||
* @returns
|
||||
*/
|
||||
export function creditRePayment(data) {
|
||||
return request({
|
||||
url: '/api/credit/buyer/repayment',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取还款记录
|
||||
* @returns
|
||||
*/
|
||||
export function creditRePaymentRecord(params) {
|
||||
return request({
|
||||
url: '/api/credit/payment-record/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除挂账人
|
||||
* @returns
|
||||
*/
|
||||
export function delCreditBuyer(id) {
|
||||
return request({
|
||||
url: `/api/credit/buyer/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂账人-查看明细
|
||||
* @returns
|
||||
*/
|
||||
export function creditBuyerOrderList(params) {
|
||||
return request({
|
||||
url: '/api/credit/buyer-order/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂账人-查看明细-统计
|
||||
* @returns
|
||||
*/
|
||||
export function creditBuyerOrderSummary(params) {
|
||||
return request({
|
||||
url: '/api/credit/buyer-order/summary',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂账人-查看明细-付款
|
||||
* @returns
|
||||
*/
|
||||
export function creditPayment(data) {
|
||||
return request({
|
||||
url: '/api/credit/buyer-order/pay',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
@ -11,6 +11,31 @@ export function tbShopPayTypeGet(params) {
|
|||
params
|
||||
});
|
||||
}
|
||||
// 同步数据提交
|
||||
export function getsync(data) {
|
||||
return request({
|
||||
url: "/api/tbShopSyncInfo/sync",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
// 撤销同步
|
||||
export function setclear(data) {
|
||||
return request({
|
||||
url: "/api/tbShopSyncInfo/clear",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
// 同步数据列表
|
||||
export function gettbShopSyncInfo(params) {
|
||||
return request({
|
||||
url: "/api/tbShopSyncInfo",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更改/增加支付方式
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
|
|
@ -10,11 +10,10 @@
|
|||
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
||||
<div class="avatar-wrapper">
|
||||
<img :src="logo || Avatar" class="sidebar-logo">
|
||||
<span class="shop_name">{{ shopName }}</span>
|
||||
<span class="shop_name">{{ shopName.length>8?shopName.substring(0,7)+'...' :shopName.substring(0,7) }}</span>
|
||||
<i class="el-icon-arrow-down icon"></i>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
|
||||
<!-- <span style="display:block;" @click="show = true">
|
||||
<el-dropdown-item>
|
||||
布局设置
|
||||
|
|
|
|||
|
|
@ -59,6 +59,19 @@ export const constantRouterMap = [
|
|||
name: 'data_tables',
|
||||
meta: { title: '桌台统计' }
|
||||
},
|
||||
{
|
||||
path: 'data_credit',
|
||||
component: (resolve) => require(['@/views/home/data_credit'], resolve),
|
||||
name: 'data_credit',
|
||||
meta: { title: '挂账管理' }
|
||||
},
|
||||
{
|
||||
path: 'data_creditDetail',
|
||||
component: (resolve) => require(['@/views/home/data_creditDetail'], resolve),
|
||||
name: 'data_creditDetail',
|
||||
hidden: true,
|
||||
meta: { title: '挂账明细' }
|
||||
},
|
||||
{
|
||||
path: 'data_record',
|
||||
component: (resolve) => require(['@/views/home/data_record'], resolve),
|
||||
|
|
|
|||
|
|
@ -0,0 +1,133 @@
|
|||
import axios from 'axios'
|
||||
import router from '@/router/routers'
|
||||
import { Notification } from 'element-ui'
|
||||
import store from '../store'
|
||||
import Config from '@/settings'
|
||||
import Cookies from 'js-cookie'
|
||||
import { setToken } from '@/utils/globalCancelToken.js'
|
||||
function getToken() {
|
||||
return localStorage.getItem('bausertoken')
|
||||
}
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
// baseURL: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_API : '/',
|
||||
baseURL: 'https://czgdoumei.sxczgkj.com/index.php/api/', // api 的 base_url
|
||||
timeout: Config.timeout // 请求超时时间
|
||||
})
|
||||
|
||||
// request拦截器
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
if (getToken()) {
|
||||
config.headers['bausertoken'] = getToken()
|
||||
}
|
||||
config.headers['Content-Type'] = 'application/json'
|
||||
// 添加可取消请求配置
|
||||
config.cancelToken = new axios.CancelToken(c => setToken(c))
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// response 拦截器
|
||||
service.interceptors.response.use(
|
||||
response => {
|
||||
const data = response.data
|
||||
console.log(data)
|
||||
if (data.code == 0) {
|
||||
Notification.error({
|
||||
title: data.msg,
|
||||
duration: 5000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (data.code == 439) {
|
||||
Notification.error({
|
||||
title: '请登录',
|
||||
duration: 5000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (data.code == 4399) {
|
||||
Notification.error({
|
||||
title: data.msg,
|
||||
duration: 5000
|
||||
})
|
||||
return data
|
||||
}
|
||||
if (data.code == 1&&!data.data) {
|
||||
// Notification.success({
|
||||
// title: data.msg,
|
||||
// duration: 5000
|
||||
// })
|
||||
return true
|
||||
}
|
||||
return data.data
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
if (axios.isCancel(error)) {
|
||||
console.log('请求已取消')
|
||||
Notification.error({
|
||||
title: '请求已取消',
|
||||
duration: 5000
|
||||
})
|
||||
return Promise.reject('请求已取消')
|
||||
}
|
||||
|
||||
// 兼容blob下载出错json提示
|
||||
if (error.response.data instanceof Blob && error.response.data.type.toLowerCase().indexOf('json') !== -1) {
|
||||
const reader = new FileReader()
|
||||
reader.readAsText(error.response.data, 'utf-8')
|
||||
reader.onload = function (e) {
|
||||
const errorMsg = JSON.parse(reader.result).message
|
||||
Notification.error({
|
||||
title: errorMsg,
|
||||
duration: 5000
|
||||
})
|
||||
}
|
||||
} else {
|
||||
let code = 0
|
||||
try {
|
||||
code = error.response.data.status
|
||||
} catch (e) {
|
||||
if (error.toString().indexOf('Error: timeout') !== -1) {
|
||||
Notification.error({
|
||||
title: '网络请求超时',
|
||||
duration: 5000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
}
|
||||
console.log(code)
|
||||
if (code) {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
// 用户登录界面提示
|
||||
Cookies.set('point', 401)
|
||||
location.reload()
|
||||
})
|
||||
} else if (code === 403) {
|
||||
router.push({ path: '/401' })
|
||||
} else {
|
||||
const errorMsg = error.response.data.message
|
||||
if (errorMsg !== undefined) {
|
||||
Notification.error({
|
||||
title: errorMsg,
|
||||
duration: 5000
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Notification.error({
|
||||
title: '接口请求失败',
|
||||
duration: 5000
|
||||
})
|
||||
}
|
||||
}
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
export default service
|
||||
|
|
@ -2,15 +2,6 @@
|
|||
<div class="app-container">
|
||||
<div class="title">应用中心</div>
|
||||
<div class="list">
|
||||
<div class="item" @click="upPop">
|
||||
<img src="./kp.png" class="icon">
|
||||
<div class="info">
|
||||
<div class="name">开票</div>
|
||||
<div class="intro">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" v-for="item in list" :key="item.id" @click="to(item)">
|
||||
<img :src="item.coverImg" class="icon">
|
||||
<div class="info">
|
||||
|
|
@ -22,28 +13,35 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- 弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" >
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%">
|
||||
<el-form :model="forms">
|
||||
<el-form-item label="账号:" label-width="60px">
|
||||
<el-form-item label="账号:" label-width="100px">
|
||||
<el-input v-model="forms.account" :disabled="title != '绑定数点票账号'" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="密码/验证码" label-width="120px">
|
||||
<el-input v-model="forms.name" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票项目:" label-width="120px">
|
||||
<el-input v-model="forms.name" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票类型:" label-width="120px">
|
||||
<el-input v-model="forms.name" autocomplete="off"></el-input>
|
||||
</el-form-item> -->
|
||||
<div style="text-align: right;" v-if="title == '绑定数点票账号'">联系区域经理开通</div>
|
||||
<div style="text-align: center;" v-else @click="title = '绑定数点票账号'">更换绑定</div>
|
||||
<!-- <el-form-item label="活动区域" label-width="120px">
|
||||
<el-select v-model="form.region" placeholder="请选择活动区域">
|
||||
<el-option label="区域一" value="shanghai"></el-option>
|
||||
<el-option label="区域二" value="beijing"></el-option>
|
||||
<el-form-item label="项目分类:" label-width="100px">
|
||||
<el-select v-model="forms.article" :disabled="title != '绑定数点票账号'" :filter-method="getindustry"
|
||||
filterable style="width: 100%;" placeholder="餐饮">
|
||||
<el-option :label="item.name" :value="item.name" v-for="(item, index) in getindustryList"
|
||||
:key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="数电发票:" label-width="100px">
|
||||
<el-select v-model="forms.sdType" :disabled="title != '绑定数点票账号'"
|
||||
style="width: 100%;" placeholder="">
|
||||
<el-option :label="item" :value="item" v-for="(item, index) in digitalInvoiceList[0]"
|
||||
:key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="税率:" label-width="100px">
|
||||
<el-select :disabled="title != '绑定数点票账号'" v-model="forms.taxAmount" style="width: 100%;"
|
||||
placeholder="">
|
||||
<el-option :label="item" :value="item" v-for="(item, index) in digitalInvoiceList[1]"
|
||||
:key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<div style="text-align: right;" v-if="title == '绑定数点票账号'">联系区域经理开通</div>
|
||||
<div style="text-align: center;cursor: pointer;" v-else @click="title = '绑定数点票账号'">更换绑定</div>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer" v-if="title == '绑定数点票账号'">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
|
|
@ -54,20 +52,26 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { appCenterGet, getbinding } from "@/api/application";
|
||||
import { appCenterGet, getbinding, getindustry, getdigitalInvoice } from "@/api/application";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
dialogVisible: false,
|
||||
forms: {},
|
||||
forms: {
|
||||
article: '餐饮',
|
||||
sdType: ""
|
||||
},
|
||||
title: '绑定数点票账号',
|
||||
|
||||
digitalInvoiceList: [],
|
||||
getindustryList: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.appCenterGet()
|
||||
this.getbinding()
|
||||
this.getdigitalInvoice()
|
||||
this.getindustry()
|
||||
},
|
||||
methods: {
|
||||
upPop() {
|
||||
|
|
@ -75,16 +79,30 @@ export default {
|
|||
},
|
||||
sumbitEvent() {
|
||||
if (this.forms.account) {
|
||||
this.dialogVisible = false
|
||||
this.getbinding(this.forms)
|
||||
}
|
||||
},
|
||||
// 获取数电发票类型
|
||||
async getdigitalInvoice() {
|
||||
const res = await getdigitalInvoice()
|
||||
this.digitalInvoiceList = res
|
||||
},
|
||||
// 获取项目分类
|
||||
async getindustry(d = '餐饮') {
|
||||
const res = await getindustry({ article: d })
|
||||
this.getindustryList = res.list
|
||||
},
|
||||
// 跳转
|
||||
to(item) {
|
||||
localStorage.setItem('applocation', JSON.stringify(item))
|
||||
this.$router.push({
|
||||
name: item.absUrl
|
||||
})
|
||||
if (item.absUrl) {
|
||||
|
||||
this.$router.push({
|
||||
name: item.absUrl
|
||||
})
|
||||
} else {
|
||||
this.upPop()
|
||||
}
|
||||
},
|
||||
// 获取应用列表
|
||||
async appCenterGet() {
|
||||
|
|
@ -102,7 +120,11 @@ export default {
|
|||
const res = await getbinding(d)
|
||||
if (res) {
|
||||
this.forms = res.store
|
||||
this.$set(this.forms, 'article', res.article)
|
||||
this.$set(this.forms, 'sdType', res.sdType)
|
||||
this.$set(this.forms, 'taxAmount', res.taxAmount)
|
||||
this.title = '数电票账号已绑定'
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
this.title = '绑定数点票账号'
|
||||
this.forms = {}
|
||||
|
|
|
|||
|
|
@ -320,7 +320,6 @@ export default {
|
|||
* @param item
|
||||
*/
|
||||
tabClick(item) {
|
||||
console.log(this.form)
|
||||
this.form = this.resetForm
|
||||
this.form.number = ''
|
||||
this.form.type = item.type
|
||||
|
|
|
|||
|
|
@ -0,0 +1,204 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog title="账单还款记录" :visible.sync="dialogVisible" :close-on-click-modal="false" width="70%" @close="reset">
|
||||
<div class="search">
|
||||
<el-form :model="query" inline label-position="left">
|
||||
<el-form-item>
|
||||
<el-input v-model="query.paymentMethod" placeholder="支付方式" style="" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table v-loading="tableData.loading" :data="tableData.data">
|
||||
<el-table-column label="支付方式" prpo="paymentMethod">
|
||||
<template v-slot="scope"> <div>{{ scope.row.paymentMethod ? scope.row.paymentMethod : '-' }}</div> </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付金额" prpo="repaymentAmount">
|
||||
<template v-slot="scope"> <div>{{ scope.row.repaymentAmount ? scope.row.repaymentAmount : '-' }}</div> </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prpo="remark">
|
||||
<template v-slot="scope"> <div>{{ scope.row.remark ? scope.row.remark : '-' }}</div> </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作时间" prop="createTime" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
:total="tableData.total"
|
||||
:current-page="query.page"
|
||||
:page-size="query.size"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChange"
|
||||
@size-change="sizeChange"
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { creditRePaymentRecord } from '@/api/credit'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
query: {
|
||||
creditBuyerId: '',
|
||||
paymentMethod: '',
|
||||
orderId: '',
|
||||
page: 1,
|
||||
size: 10
|
||||
},
|
||||
resetQuery: null,
|
||||
tableData: {
|
||||
data: [],
|
||||
loading: false,
|
||||
total: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetQuery = { ...this.query }
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
async getTableData() {
|
||||
// eslint-disable-next-line no-unused-vars, prefer-const
|
||||
let params = {
|
||||
creditBuyerId: this.query.creditBuyerId,
|
||||
value: this.query.value,
|
||||
page: this.query.page,
|
||||
size: this.query.size,
|
||||
paymentMethod: this.query.paymentMethod
|
||||
}
|
||||
if (this.query.orderId) { params.orderId = this.query.orderId }
|
||||
// eslint-disable-next-line prefer-const
|
||||
let res = await creditRePaymentRecord(params)
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
},
|
||||
|
||||
/**
|
||||
* 打开
|
||||
* @param row
|
||||
*/
|
||||
show(row, orderId) {
|
||||
this.query = { ...this.resetQuery }
|
||||
this.dialogVisible = true
|
||||
this.query.creditBuyerId = row.id
|
||||
this.query.orderId = orderId
|
||||
this.getTableData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 分页大小改变
|
||||
* @param e
|
||||
*/
|
||||
sizeChange(e) {
|
||||
this.query.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 分页回调
|
||||
* @param e
|
||||
*/
|
||||
paginationChange(e) {
|
||||
this.query.page = e
|
||||
this.getTableData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭
|
||||
*/
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
reset() {
|
||||
this.query.paymentMethod = ''
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shop_list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.item_wrap {
|
||||
$size: 80px;
|
||||
|
||||
.item {
|
||||
$radius: 4px;
|
||||
width: $size;
|
||||
height: $size;
|
||||
border-radius: $radius;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
margin-top: 10px;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: attr(data-index);
|
||||
font-size: 12px;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
border-radius: 0 0 $radius 0;
|
||||
align-items: center;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(10px);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: '删除';
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(10px);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
transition: all .1s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
width: $size;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
:show-close="false"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
center
|
||||
>
|
||||
<div slot="title" class="dialog-title">{{ form.id?'编辑':'创建' }}挂账人</div>
|
||||
<div class="content">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||
<el-form-item label="状态" prop="status" style="width: 100%;">
|
||||
<el-switch
|
||||
v-model="form.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="挂账人" prop="debtor" style="width: 100%;">
|
||||
<el-input v-model="form.debtor" placeholder="请输入挂账人名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="mobile" style="width: 100%;">
|
||||
<el-input v-model="form.mobile" placeholder="请输入手机号" oninput="value= value.replace(/[^0-9]/g, '')" maxlength="11" />
|
||||
</el-form-item>
|
||||
<el-form-item label="职位" prop="position" style="width: 100%;">
|
||||
<el-input v-model="form.position" placeholder="请输入职位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="挂账额度" prop="creditAmount" style="width: 100%;">
|
||||
<el-input v-model="form.creditAmount" placeholder="" oninput="value= value.replace(/[^\d|\.]/g, '')">
|
||||
<template slot="prepend">¥</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="还款方式" style="width: 100%;">
|
||||
<el-radio-group v-model="form.repaymentMethod" :disabled="isExist(form.id)">
|
||||
<el-radio v-for="item in repaymentMethodList" :key="item.value" :label="item.value">
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<div style="font-size: 12px;color: #999;">一经创建无法更改还款方式</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onSubmitHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addCreditBuyer, editCreditBuyer } from '@/api/credit'
|
||||
|
||||
export default {
|
||||
// eslint-disable-next-line vue/require-prop-types
|
||||
props: ['couponId'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
repaymentMethodList: [
|
||||
{ label: '按总金额还款', value: 'total' },
|
||||
{ label: '按订单还款', value: 'order' }
|
||||
],
|
||||
form: {
|
||||
id: '',
|
||||
shopId: '',
|
||||
status: 0,
|
||||
debtor: '',
|
||||
mobile: '',
|
||||
position: '',
|
||||
creditAmount: '',
|
||||
repaymentMethod: 'total'
|
||||
},
|
||||
rules: {
|
||||
debtor: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入挂账人名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
mobile: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入手机号',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
position: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入职位',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
creditAmount: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入挂账额度',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
resetForm: null
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form }
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 校验是否存在
|
||||
*/
|
||||
isExist(val) {
|
||||
if (val) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 确定
|
||||
*/
|
||||
async onSubmitHandle() {
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.loading = true
|
||||
if (!this.form.shopId) { this.form.shopId = localStorage.getItem('shopId') }
|
||||
let res
|
||||
if (!this.form.id) {
|
||||
res = await addCreditBuyer(this.form)
|
||||
} else {
|
||||
res = await editCreditBuyer(this.form)
|
||||
}
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: `${this.form.id ? '编辑' : '添加'}成功`,
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogVisible = false
|
||||
this.loading = false
|
||||
this.$emit('success', res)
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 打开详情
|
||||
* @param row
|
||||
*/
|
||||
show(row) {
|
||||
if (row && row.id) {
|
||||
this.form = row
|
||||
} else {
|
||||
this.form = this.resetForm
|
||||
}
|
||||
this.form.status = Number(this.form.status)
|
||||
this.dialogVisible = true
|
||||
this.$refs.form.resetFields()
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭
|
||||
*/
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.dialog-title{
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
<!-- eslint-disable vue/no-use-v-if-with-v-for -->
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
:show-close="false"
|
||||
:visible.sync="dialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
width="30%"
|
||||
center
|
||||
>
|
||||
<div slot="title" class="dialog-title">挂账还款</div>
|
||||
<div class="content">
|
||||
<div v-if="form.repaymentMethod == 'total' && !form.creditBuyerId" class="credit_info">
|
||||
<div>挂账人:{{ form.debtor }}</div>
|
||||
<div>挂账金额:¥{{ form.owedAmount || 0 }}</div>
|
||||
<div>账户余额: ¥{{ form.accountBalance || 0 }}</div>
|
||||
</div>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||
<el-form-item v-if="form.repaymentMethod == 'total' && !form.creditBuyerId" label="还款方式" style="width: 100%;">
|
||||
<el-radio-group v-model="form.repaymentMethod">
|
||||
<el-radio v-for="item in repaymentMethodList" v-if="form.repaymentMethod == item.value" :key="item.value" :label="item.value">
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="还款金额" prop="repaymentAmount" style="width: 100%;">
|
||||
<el-input v-model="form.repaymentAmount" placeholder="" oninput="value= value.replace(/[^\d|\.]/g, '')">
|
||||
<template slot="prepend">¥</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="paymentMethod" style="width: 100%;">
|
||||
<el-input v-model="form.paymentMethod" placeholder="请输入支付方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark" style="width: 100%;">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onSubmitHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { creditRePayment, creditPayment } from '@/api/credit'
|
||||
|
||||
export default {
|
||||
// eslint-disable-next-line vue/require-prop-types
|
||||
props: ['couponId'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
repaymentMethodList: [
|
||||
{ label: '按总金额还款', value: 'total' },
|
||||
{ label: '按订单还款', value: 'order' }
|
||||
],
|
||||
form: {
|
||||
id: '',
|
||||
creditBuyerId: '',
|
||||
orderId: '',
|
||||
repaymentMethod: '',
|
||||
repaymentAmount: '',
|
||||
paymentMethod: '',
|
||||
remark: ''
|
||||
},
|
||||
rules: {
|
||||
repaymentAmount: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入还款金额',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
paymentMethod: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入支付方式',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
resetForm: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form }
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 确定
|
||||
*/
|
||||
// eslint-disable-next-line no-undef
|
||||
onSubmitHandle: _.debounce(function async() {
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.loading = true
|
||||
// if (!this.form.shopId) { this.form.shopId = localStorage.getItem('shopId') }
|
||||
let res
|
||||
if (this.form.repaymentMethod === 'total') {
|
||||
res = await creditRePayment(this.form)
|
||||
} else {
|
||||
res = await creditPayment(this.form)
|
||||
}
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: res.repaymentMsg,
|
||||
type: 'success'
|
||||
})
|
||||
this.dialogVisible = false
|
||||
this.loading = false
|
||||
this.$emit('success', res)
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 1000),
|
||||
|
||||
/**
|
||||
* 打开
|
||||
* @param row
|
||||
*/
|
||||
show(row, order) {
|
||||
this.form = { ...this.resetForm }
|
||||
if (row.creditBuyerId) {
|
||||
this.form.creditBuyerId = row.creditBuyerId
|
||||
this.form.orderId = order.id
|
||||
} else {
|
||||
this.form.id = row.id
|
||||
}
|
||||
this.form.repaymentMethod = row.repaymentMethod
|
||||
this.form.debtor = row.debtor
|
||||
this.form.owedAmount = row.owedAmount
|
||||
this.form.accountBalance = row.accountBalance
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭
|
||||
*/
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
|
||||
reset() {
|
||||
this.query = { ...this.resetQuery }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.credit_info{
|
||||
width: 100%;
|
||||
background: #F7F7FA;
|
||||
border-radius: 3px 3px 3px 3px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 15px 25px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 30px;
|
||||
view{
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
.dialog-title{
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container filtration">
|
||||
<div class="l">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="openDialog(null,'add')">
|
||||
创建挂账人
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="r">
|
||||
<el-input v-model="tableData.keywords" placeholder="按挂账人或手机号" style="width: 138px;" />
|
||||
<el-select v-model="tableData.status" placeholder="全部状态" clearable style="width: 123px;">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="search">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container content">
|
||||
<el-table v-loading="tableData.loading" :data="tableData.data">
|
||||
<el-table-column label="挂账编码" prop="id" />
|
||||
<el-table-column label="状态">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.status == '1' ? '启用' : '停用' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="挂账人" prop="debtor" />
|
||||
<el-table-column label="手机号" prop="mobile" />
|
||||
<el-table-column label="挂账额度(元)" prop="creditAmount" />
|
||||
<el-table-column label="已挂账金额(元)" prop="owedAmount" />
|
||||
<el-table-column label="剩余挂账额度(元)" prop="remainingAmount" />
|
||||
<el-table-column label="账户余额" prop="accountBalance" />
|
||||
<el-table-column label="适用门店" prop="shopName" />
|
||||
<el-table-column label="操作" width="250">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" @click="$router.push({name: 'data_creditDetail', query: {id: scope.row.id, repaymentMethod: scope.row.repaymentMethod}} )">查看明细</el-button>
|
||||
<el-button type="text" @click="openDialog(scope.row,'edit')">编辑</el-button>
|
||||
<el-button :style="{ color: scope.row.repaymentMethod == 'order' ? '#999' :''}" type="text" @click="openDialog(scope.row,'repayment')">还款</el-button>
|
||||
<el-button type="text" @click="openDialog(scope.row,'rePaymentRecord')">还款记录</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button
|
||||
slot="reference"
|
||||
type="text"
|
||||
>删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
:total="tableData.total"
|
||||
:current-page="tableData.page"
|
||||
:page-size="tableData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChange"
|
||||
@size-change="sizeChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 创建挂账人 -->
|
||||
<creditAdd ref="creditAdd" @success="resetHandle" />
|
||||
|
||||
<!-- 还款 -->
|
||||
<creditRepayment ref="creditRepayment" @success="resetHandle" />
|
||||
|
||||
<!-- 还款记录 -->
|
||||
<creditRepaymentRecord ref="creditRepaymentRecord" @success="resetHandle" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import creditAdd from './components/credit_add.vue'
|
||||
import creditRepayment from './components/credit_repayment.vue'
|
||||
import creditRepaymentRecord from './components/credit_RePaymentRecord.vue'
|
||||
import { getCreditBuyerList, delCreditBuyer } from '@/api/credit'
|
||||
export default {
|
||||
// eslint-disable-next-line vue/no-unused-components
|
||||
components: { creditAdd, creditRepayment, creditRepaymentRecord },
|
||||
filters: {
|
||||
|
||||
typeFilter(value) {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
},
|
||||
effectTypeFilter(value) {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
value: '1',
|
||||
label: '启用'
|
||||
},
|
||||
{
|
||||
value: '0',
|
||||
label: '停用'
|
||||
}
|
||||
],
|
||||
tableData: {
|
||||
keywords: '',
|
||||
status: '',
|
||||
data: [],
|
||||
page: 1,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.tableData.page = 1
|
||||
this.getTableData()
|
||||
},
|
||||
/**
|
||||
* 获取挂账人列表
|
||||
*/
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await getCreditBuyerList({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
keywords: this.tableData.keywords,
|
||||
status: this.tableData.status,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除挂账人
|
||||
* @param id
|
||||
*/
|
||||
async delTableHandle(id) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const res = await delCreditBuyer(id)
|
||||
this.getTableData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 操作
|
||||
*/
|
||||
openDialog(row, type) {
|
||||
if (type === 'add') {
|
||||
this.$refs.creditAdd.show()
|
||||
} else if (type === 'edit') {
|
||||
this.$refs.creditAdd.show(row)
|
||||
} else if (type === 'repayment' && row.repaymentMethod === 'total') {
|
||||
this.$refs.creditRepayment.show(row)
|
||||
} else if (type === 'rePaymentRecord') {
|
||||
this.$refs.creditRepaymentRecord.show(row)
|
||||
}
|
||||
},
|
||||
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.page = 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.title{
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
}
|
||||
.filtration{
|
||||
overflow: hidden;
|
||||
.l{
|
||||
float: left;
|
||||
}
|
||||
.r{
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,471 @@
|
|||
<!-- eslint-disable vue/valid-v-bind -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline label-position="left">
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="timeValue" @change="timeChange">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button label="0">今天</el-radio-button>
|
||||
<el-radio-button label="-1">昨天</el-radio-button>
|
||||
<el-radio-button label="-7">最近7天</el-radio-button>
|
||||
<el-radio-button label="-30">最近30天</el-radio-button>
|
||||
<el-radio-button label="week">本周</el-radio-button>
|
||||
<el-radio-button label="month">本月</el-radio-button>
|
||||
<el-radio-button label="custom">自定义</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-if="timeValue == 'custom'"
|
||||
v-model="query.createdAt"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
<template>
|
||||
<el-form-item>
|
||||
<el-select v-model="query.status" placeholder="全部状态" clearable style="width: 140px;">
|
||||
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="search">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<div class="collect_wrap">
|
||||
<div v-for="(item,index) in payCountList" :key="index" class="item">
|
||||
<div class="icon_wrap" :style="{ backgroundColor: `rgba(${item.color},0.5)` }">
|
||||
<div />
|
||||
<i class="icon" :class="item.icon" :style="{ color: `rgba(${item.color},1)` }" />
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="m">
|
||||
¥{{ item.amount }}
|
||||
</div>
|
||||
<div class="t">{{ item.label }}{{ index == 0 ? item.count+'笔' : '' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table v-loading="tableData.loading" :data="tableData.data">
|
||||
<el-table-column label="创建日期" prop="createTime" />
|
||||
<el-table-column label="订单号" prop="orderId" />
|
||||
<el-table-column label="应付金额" prop="payAmount">
|
||||
<template v-slot="scope"> {{ '¥'+scope.row.payAmount || '-' }} </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已付款金额" prop="paidAmount">
|
||||
<template v-slot="scope"> {{ '¥'+scope.row.paidAmount || '-' }} </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="待付款金额" prop="unpaidAmount">
|
||||
<template v-slot="scope"> {{ '¥'+scope.row.unpaidAmount || '-' }} </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="salesAmount">
|
||||
<template v-slot="scope">
|
||||
{{
|
||||
scope.row.status == 'unpaid' ? '未付款' :
|
||||
scope.row.status == 'partial' ? '部分支付' :
|
||||
scope.row.status == 'paid' ? '已付款' : ''
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款方式" prop="lastPaymentMethod">
|
||||
<template v-slot="scope"> {{ scope.row.lastPaymentMethod }} </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark">
|
||||
<template v-slot="scope"> {{ scope.row.remark }} </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款时间" prop="lastPaymentTime" />
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" :style="{ color: repaymentMethod == 'total' ? '#999' :''}" @click="openDialog(scope.row,'payment')">付款</el-button>
|
||||
<el-button type="text" @click="openDialog(scope.row,'paymentRecord')">账单付款记录</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
:total="tableData.total"
|
||||
:current-page="query.page"
|
||||
:page-size="query.size"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChange"
|
||||
@size-change="sizeChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 还款 -->
|
||||
<creditRepayment ref="creditRepayment" @success="resetHandle" />
|
||||
|
||||
<!-- 还款记录 -->
|
||||
<creditRepaymentRecord ref="creditRepaymentRecord" @success="resetHandle" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import creditRepayment from './components/credit_repayment.vue'
|
||||
import creditRepaymentRecord from './components/credit_RePaymentRecord.vue'
|
||||
import { creditBuyerOrderList, creditBuyerOrderSummary } from '@/api/credit'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
export default {
|
||||
components: { creditRepayment, creditRepaymentRecord },
|
||||
filters: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timeValue: '',
|
||||
resetQuery: null,
|
||||
repaymentMethod: '',
|
||||
statusList: [
|
||||
{ label: '未付款', value: 'unpaid' },
|
||||
{ label: '部分支付', value: 'partial' },
|
||||
{ label: '已付款', value: 'paid' }
|
||||
],
|
||||
query: {
|
||||
page: 1,
|
||||
size: 10,
|
||||
creditBuyerId: '',
|
||||
createdAt: [],
|
||||
status: ''
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
downloadLoading: false,
|
||||
payCountList: [
|
||||
{ label: '总交易', icon: 'el-icon-info', color: '201, 120, 236', amount: 0, count: 0 },
|
||||
{ label: '已支付金额', icon: 'el-icon-success', color: '70, 181, 24', amount: 0 },
|
||||
{ label: '待支付金额', icon: 'el-icon-circle-plus', color: '248, 110, 16', amount: 0 },
|
||||
{ label: '待支付笔数', icon: 'el-icon-warning', color: '254, 180, 38', amount: 0 }
|
||||
],
|
||||
payCountTotal: 0
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.query.creditBuyerId = this.$route.query.id
|
||||
this.repaymentMethod = this.$route.query.repaymentMethod
|
||||
this.resetQuery = { ...this.query }
|
||||
// repaymentMethod
|
||||
this.getTableData()
|
||||
// this.tbShopCategoryGet()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.query.page = 1
|
||||
this.getTableData()
|
||||
},
|
||||
/**
|
||||
* 获取明细数据
|
||||
*/
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
this.creditDetailSummary()
|
||||
// eslint-disable-next-line prefer-const
|
||||
let params = {
|
||||
page: this.query.page,
|
||||
size: this.query.size,
|
||||
status: this.query.status,
|
||||
creditBuyerId: this.query.creditBuyerId
|
||||
}
|
||||
if (this.query.createdAt.length > 0) {
|
||||
params.beginDate = this.query.createdAt[0].substring(0, 10)
|
||||
params.endDate = this.query.createdAt[1].substring(0, 10)
|
||||
}
|
||||
// eslint-disable-next-line prefer-const
|
||||
let res = await creditBuyerOrderList(params)
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取明细统计
|
||||
*/
|
||||
async creditDetailSummary() {
|
||||
try {
|
||||
// eslint-disable-next-line prefer-const
|
||||
let params = {
|
||||
page: this.query.page,
|
||||
size: this.query.size,
|
||||
status: this.query.status,
|
||||
creditBuyerId: this.query.creditBuyerId
|
||||
}
|
||||
if (this.query.createdAt.length > 0) {
|
||||
params.beginDate = this.query.createdAt[0].substring(0, 10)
|
||||
params.endDate = this.query.createdAt[1].substring(0, 10)
|
||||
}
|
||||
// eslint-disable-next-line prefer-const
|
||||
let res = await creditBuyerOrderSummary(params)
|
||||
this.payCountList[0].amount = res.payAmountTotal
|
||||
this.payCountList[0].count = res.count
|
||||
this.payCountList[1].amount = res.paidAmountTotal
|
||||
this.payCountList[2].amount = res.unpaidAmountTotal
|
||||
this.payCountList[3].amount = res.unpaidCount
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 操作
|
||||
*/
|
||||
openDialog(row, type) {
|
||||
if (type === 'payment' && this.repaymentMethod === 'order') {
|
||||
this.$refs.creditRepayment.show({ creditBuyerId: this.query.creditBuyerId, repaymentMethod: this.repaymentMethod }, row)
|
||||
} else if (type === 'paymentRecord') {
|
||||
this.$refs.creditRepaymentRecord.show({ id: this.query.creditBuyerId, repaymentMethod: this.repaymentMethod }, row.orderId)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 切换时间
|
||||
* @param e
|
||||
*/
|
||||
timeChange(e) {
|
||||
const format = ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59']
|
||||
switch (e) {
|
||||
case '':
|
||||
// 全部
|
||||
this.query.createdAt = []
|
||||
break
|
||||
case '0':
|
||||
// 今天
|
||||
this.query.createdAt = [
|
||||
dayjs().format(format[0]),
|
||||
dayjs().format(format[1])
|
||||
]
|
||||
break
|
||||
case '-1':
|
||||
// 昨天
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.add(-1, 'd')
|
||||
.format(format[0]),
|
||||
dayjs()
|
||||
.add(-1, 'd')
|
||||
.format(format[1])
|
||||
]
|
||||
break
|
||||
case '-7':
|
||||
// 最近7天
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.add(-7, 'd')
|
||||
.format(format[0]),
|
||||
dayjs().format(format[1])
|
||||
]
|
||||
break
|
||||
case '-30':
|
||||
// 最近7天
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.add(-30, 'd')
|
||||
.format(format[0]),
|
||||
dayjs().format(format[1])
|
||||
]
|
||||
break
|
||||
case 'week':
|
||||
// 本周
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.startOf('week')
|
||||
.format(format[0]),
|
||||
dayjs()
|
||||
.endOf('week')
|
||||
.format(format[1])
|
||||
]
|
||||
break
|
||||
case 'month':
|
||||
// 本周
|
||||
this.query.createdAt = [
|
||||
dayjs()
|
||||
.startOf('month')
|
||||
.format(format[0]),
|
||||
dayjs()
|
||||
.endOf('month')
|
||||
.format(format[1])
|
||||
]
|
||||
break
|
||||
case 'custom':
|
||||
// 自定义
|
||||
this.query.createdAt = []
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 重置查询
|
||||
*/
|
||||
resetHandle() {
|
||||
this.timeValue = ''
|
||||
this.query = { ...this.resetQuery }
|
||||
this.getTableData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 分页大小改变
|
||||
* @param e
|
||||
*/
|
||||
sizeChange(e) {
|
||||
console.log(e)
|
||||
this.query.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 分页回调
|
||||
* @param e
|
||||
*/
|
||||
paginationChange(e) {
|
||||
this.query.page = e
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.collect_wrap {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
justify-content: space-between;
|
||||
|
||||
.item {
|
||||
background-size: 100% 100%;
|
||||
width: 255px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #F7F7FA;
|
||||
padding: 20px;
|
||||
border-radius: 7px 7px 7px 7px;
|
||||
|
||||
.icon_wrap {
|
||||
$size: 34px;
|
||||
$border: 6px;
|
||||
width: $size;
|
||||
height: $size;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: var(--bg-color);
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
>div{
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
&::after {
|
||||
content: "";
|
||||
width: $size + $border;
|
||||
height: $size + $border;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: var(--bg-color);
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 32px;
|
||||
position: absolute;
|
||||
left: 1px;
|
||||
right: 0;
|
||||
top: 1px;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 10px;
|
||||
|
||||
.m {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.t {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
padding-top: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.refund {
|
||||
color: #ff9731;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.table_order_info {
|
||||
.order_no {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.type {
|
||||
color: #e6a23c;
|
||||
}
|
||||
}
|
||||
|
||||
.goods_info {
|
||||
.row {
|
||||
display: flex;
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.cover {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 10px;
|
||||
|
||||
.sku {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -81,7 +81,8 @@ export default {
|
|||
stocktakinNum: '', // 必传
|
||||
price: '', // 商品价格 非必传 为空盘点价格为商品价格
|
||||
remark: "", // 盘点备注 非必传
|
||||
stockNumber: 0
|
||||
stockNumber: 0,
|
||||
balance: ''
|
||||
},
|
||||
rules: {
|
||||
stocktakinNum: [
|
||||
|
|
@ -155,6 +156,7 @@ export default {
|
|||
})
|
||||
},
|
||||
async show(obj) {
|
||||
console.log(obj, 111)
|
||||
let res = await hasPermission('允许耗材盘点');
|
||||
if (!res) { return; }
|
||||
this.form.remark = ''
|
||||
|
|
@ -165,8 +167,9 @@ export default {
|
|||
this.form = Object.assign(this.form, obj)
|
||||
this.dialogVisible = true
|
||||
this.form.conInfoId = obj.consId
|
||||
this.form.stockNumber = obj.stockNumber
|
||||
this.form.balance = obj.stockNumber
|
||||
this.form.stockNumber = obj.balance < 0 ? 0 : obj.balance
|
||||
// this.form.balance = obj.stockNumber
|
||||
this.form.balance = obj.balance
|
||||
this.form.price == null ? 0 : this.form.price
|
||||
this.searhForm.productId = obj.id
|
||||
this.getTableData()
|
||||
|
|
@ -186,7 +189,7 @@ export default {
|
|||
try {
|
||||
this.tableData.loading = true
|
||||
const res = await tbConCheckGet({
|
||||
|
||||
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
conInfoId: this.searhForm.productId,
|
||||
|
|
|
|||
|
|
@ -123,13 +123,14 @@
|
|||
<div class="tips" style="font-size: 16px;">原价¥
|
||||
<!-- {{ scope.row.costPrice }}/{{ scope.row.conUnit }} -->
|
||||
|
||||
{{ !scope.row.unit ?
|
||||
(scope.row.defaultUnit ?
|
||||
scope.row.defaultUnit== scope.row.conUnitTwo?
|
||||
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice:scope.row.costPrice)
|
||||
: scope.row.unit== scope.row.conUnitTwo?
|
||||
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice}}
|
||||
/
|
||||
{{ !scope.row.unit ?
|
||||
(scope.row.defaultUnit ?
|
||||
scope.row.defaultUnit == scope.row.conUnitTwo ?
|
||||
((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) :
|
||||
scope.row.costPrice : scope.row.costPrice)
|
||||
: scope.row.unit == scope.row.conUnitTwo ?
|
||||
((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) : scope.row.costPrice }}
|
||||
/
|
||||
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
|
||||
scope.row.conUnit) : scope.row.unit }}
|
||||
|
||||
|
|
@ -154,13 +155,13 @@
|
|||
controls-position="right"
|
||||
@change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number>
|
||||
<div class="tips" style="font-size: 16px;">入库前:
|
||||
{{ !scope.row.unit ?
|
||||
(scope.row.defaultUnit ?
|
||||
scope.row.defaultUnit== scope.row.conUnitTwo?
|
||||
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number:scope.row.number)
|
||||
: scope.row.unit== scope.row.conUnitTwo?
|
||||
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number}}
|
||||
|
||||
{{ !scope.row.unit ?
|
||||
(scope.row.defaultUnit ?
|
||||
scope.row.defaultUnit == scope.row.conUnitTwo ?
|
||||
(scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number : scope.row.number)
|
||||
: scope.row.unit == scope.row.conUnitTwo ?
|
||||
(scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number }}
|
||||
|
||||
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
|
||||
scope.row.conUnit) : scope.row.unit }}
|
||||
</div>
|
||||
|
|
@ -343,6 +344,17 @@ export default {
|
|||
mounted() {
|
||||
this.resetForm = { ...this.queryForm }
|
||||
this.tbShopPurveyorGet()
|
||||
console.log(this.$route.query.consdata)
|
||||
if (this.$route.query.consdata) {
|
||||
let arr = this.$route.query.consdata.map(item => {
|
||||
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
|
||||
item.stockNumber = 0
|
||||
item.costPrice = item.price
|
||||
item.conInfoId = item.id
|
||||
return item
|
||||
})
|
||||
this.tableData.list = [...this.tableData.list, ...arr]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async querySearchAsync(queryString, cb) {//快捷搜索
|
||||
|
|
@ -556,6 +568,7 @@ export default {
|
|||
},
|
||||
// 选择耗材
|
||||
selectConsumable(res) {
|
||||
console.log(res)
|
||||
let arr = res.map(item => {
|
||||
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
|
||||
item.stockNumber = 0
|
||||
|
|
|
|||
|
|
@ -126,8 +126,8 @@
|
|||
<el-button type="text" size="mini" round @click="Uppop(scope.row.id)">付款</el-button>
|
||||
<el-button type="text" size="mini"
|
||||
@click="typedialogshowsumbit(scope.row.id)">账单付款记录</el-button>
|
||||
<el-button type="text" size="mini" @click="stockData.size = 10,
|
||||
stockData.page = 0, gettbConsInfoFlowstock(scope.row)">出入库记录</el-button>
|
||||
<el-button type="text" size="mini" @click="stockData.size = 10,
|
||||
stockData.page = 0, gettbConsInfoFlowstock(scope.row)">货单记录</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -175,10 +175,10 @@
|
|||
</el-table>
|
||||
</el-dialog>
|
||||
<!--入库记录 -->
|
||||
<el-dialog title="出入库记录" :visible.sync="variabilityshow" width="75%">
|
||||
<el-dialog title="货单记录" :visible.sync="variabilityshow" width="75%">
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="stockData.data" v-loading="stockData.loading" row-key="id" height="450">
|
||||
<el-table-column label="类型" prop="type">
|
||||
<!-- <el-table-column label="类型" prop="type">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.type == 'reject' ? '退货出库' : '供应商入库' }}
|
||||
</template>
|
||||
|
|
@ -194,16 +194,23 @@
|
|||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.stockTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="耗材" prop="name" />
|
||||
<el-table-column label="单价" prop="price" />
|
||||
<el-table-column label="数量" prop="stockNumber" />
|
||||
<el-table-column label="单位" prop="unit" />
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="stockData.total" :current-page="stockData.page + 1" :page-size="stockData.size"
|
||||
<div class="head-container" style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<!-- <el-pagination :total="stockData.total" :current-page="stockData.page + 1" :page-size="stockData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" @current-change="wstockChange" @size-change="(e) => {
|
||||
stockData.size = e;
|
||||
stockData.page = 0;
|
||||
gettbConsInfoFlowstock();
|
||||
}" />
|
||||
}" /> -->
|
||||
<div></div>
|
||||
<div style="color: #43a9fe;" @click="func()">转出库单</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -315,6 +322,7 @@ export default {
|
|||
total: 0,
|
||||
id: ''
|
||||
},
|
||||
consdata: []//回填跳转到入库
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
|
|
@ -463,29 +471,40 @@ export default {
|
|||
this.stockData.page = e - 1;
|
||||
this.gettbConsInfoFlowstock();
|
||||
},
|
||||
func() {
|
||||
this.$router.push({
|
||||
name: 'operation_in',
|
||||
query: {
|
||||
consdata: this.consdata
|
||||
}
|
||||
})
|
||||
},
|
||||
async gettbConsInfoFlowstock(item) {
|
||||
console.log(item)
|
||||
if (item) {
|
||||
this.stockData.id = item.id
|
||||
this.consdata = item.cons
|
||||
this.stockData.data = item.conFlows
|
||||
}
|
||||
this.variabilityshow = true
|
||||
this.stockData.loading = true;
|
||||
// this.stockData.loading = true;
|
||||
let arr = []
|
||||
// if (this.query.createdAt.length) {
|
||||
// arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
|
||||
// } else {
|
||||
// arr = []
|
||||
// }
|
||||
let res = await tbProductStockOperatepage({
|
||||
page: this.stockData.page,
|
||||
size: this.stockData.size,
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
type: ["cons_in", "cons_out"],//预留耗材id
|
||||
purveyorId: this.stockData.id,//列名
|
||||
createdAt: arr//耗材id
|
||||
})
|
||||
this.stockData.loading = false;
|
||||
this.stockData.data = res.content;
|
||||
this.stockData.total = res.totalElements;
|
||||
// let res = await tbProductStockOperatepage({
|
||||
// page: this.stockData.page,
|
||||
// size: this.stockData.size,
|
||||
// shopId: localStorage.getItem("shopId"),
|
||||
// type: ["cons_in", "cons_out"],//预留耗材id
|
||||
// purveyorId: this.stockData.id,//列名
|
||||
// createdAt: arr//耗材id
|
||||
// })
|
||||
// this.stockData.loading = false;
|
||||
// this.stockData.data = res.content;
|
||||
// this.stockData.total = res.totalElements;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@
|
|||
import { encrypt } from '@/utils/rsaEncrypt'
|
||||
import Config from '@/settings'
|
||||
import { getCodeImg } from '@/api/login'
|
||||
import { $douyin_checkIn } from '@/api/coup/index'
|
||||
import Cookies from 'js-cookie'
|
||||
import qs from 'qs'
|
||||
import Background from '@/assets/images/background_img.jpg'
|
||||
|
|
@ -175,8 +176,12 @@ export default {
|
|||
// }
|
||||
// console.log(user);
|
||||
const user = { ...this.loginForm }
|
||||
console.log(user)
|
||||
user.password = encrypt(user.password)
|
||||
this.$store.dispatch('Login', user).then(() => {
|
||||
$douyin_checkIn({
|
||||
loginName:user.username
|
||||
})
|
||||
this.loading = false
|
||||
// 保存商户号
|
||||
localStorage.setItem('MerchantId', JSON.stringify({
|
||||
|
|
@ -185,7 +190,8 @@ export default {
|
|||
}))
|
||||
this.$router.push({ path: this.redirect || '/' })
|
||||
// window.location.replace = './'
|
||||
}).catch(() => {
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
this.loading = false
|
||||
this.getCode()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="requestIp" label="IP" />
|
||||
<!-- <el-table-column prop="requestIp" label="IP" /> -->
|
||||
<el-table-column :show-overflow-tooltip="true" prop="address" label="IP来源" />
|
||||
<el-table-column prop="description" label="描述" />
|
||||
<el-table-column prop="browser" label="浏览器" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,132 @@
|
|||
<template>
|
||||
<el-dialog title="开票" :visible.sync="dialogFormVisible">
|
||||
<el-form :model="forms">
|
||||
<el-form-item label="项目分类:" :label-width="labelWidth">
|
||||
<el-select v-model="forms.article" :filter-method="getindustry" filterable style="width: 100%;"
|
||||
placeholder="餐饮">
|
||||
<el-option :label="item.name" :value="item.name" v-for="(item, index) in getindustryList"
|
||||
:key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数电发票:" :label-width="labelWidth">
|
||||
<el-select v-model="forms.type" style="width: 100%;" placeholder="">
|
||||
<el-option :label="item" :value="item" v-for="(item, index) in digitalInvoiceList[0]"
|
||||
:key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="税率:" :label-width="labelWidth">
|
||||
<el-select v-model="forms.se_amount" @change="changeevent" style="width: 100%;" placeholder="">
|
||||
<el-option :label="item" :value="item" v-for="(item, index) in digitalInvoiceList[1]"
|
||||
:key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票金额:" :label-width="labelWidth">
|
||||
<el-input v-model="forms.price" @change="changeevent" type="number" placeholder="请输入金额"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票人账号:" :label-width="labelWidth">
|
||||
<el-select v-model="forms.dlzh" style="width: 100%;" placeholder="">
|
||||
<el-option :label="item.bsryxm" :value="item.dlzh" v-for="(item, index) in Binding"
|
||||
:key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单价:" :label-width="labelWidth">
|
||||
<el-input v-model="forms.d_price" disabled placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="税额:" :label-width="labelWidth">
|
||||
<el-input v-model="forms.tax_amount" disabled placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量:" :label-width="labelWidth">
|
||||
<el-input v-model="forms.number" type="number" placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注:" :label-width="labelWidth">
|
||||
<el-input v-model="forms.notes" type="text" placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号:" :label-width="labelWidth">
|
||||
<el-input v-model="forms.notes" type="text" placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品单位(桌):" :label-width="labelWidth">
|
||||
<el-input v-model="forms.notes" type="number" placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="printloading" @click="SubmitEvent">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { getbinding, getindustry, getdigitalInvoice, getstoreSe, getsubInvoicing } from "@/api/application";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogFormVisible: false,
|
||||
forms: {},
|
||||
digitalInvoiceList: [],
|
||||
getindustryList: [],
|
||||
labelWidth: '120px',
|
||||
// 绑定人信息
|
||||
Binding: [],
|
||||
item: "",
|
||||
printloading: false,
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getdigitalInvoice()
|
||||
this.getindustry()
|
||||
},
|
||||
methods: {
|
||||
show(d) {
|
||||
this.dialogFormVisible = !this.dialogFormVisible
|
||||
this.item = d
|
||||
this.getbinding()
|
||||
},
|
||||
async changeevent() {
|
||||
let obj = {
|
||||
se_amount: this.forms.se_amount.slice(0, -1),
|
||||
amount: this.forms.price
|
||||
}
|
||||
const res = await getstoreSe(obj)
|
||||
this.forms.d_price = res.d_amount
|
||||
this.forms.tax_amount = res.tx
|
||||
},
|
||||
async SubmitEvent() {
|
||||
this.printloading = true
|
||||
this.forms.se_amount = this.forms.se_amount.slice(0, -1)
|
||||
const res = await getsubInvoicing(this.forms)
|
||||
this.dialogFormVisible = !this.dialogFormVisible
|
||||
this.printloading = false
|
||||
this.$emit('qrcode', res.invoice_records)
|
||||
},
|
||||
// 获取项目分类
|
||||
async getindustry(d = '餐饮') {
|
||||
const res = await getindustry({ article: d })
|
||||
this.getindustryList = res.list
|
||||
},
|
||||
// 获取数电发票类型
|
||||
async getdigitalInvoice() {
|
||||
const res = await getdigitalInvoice()
|
||||
this.digitalInvoiceList = res
|
||||
},
|
||||
// 开票
|
||||
async getbinding(d = "") {
|
||||
const res = await getbinding(d)
|
||||
this.forms = {
|
||||
account: res.bindAccount,
|
||||
dlzh: res.taxation[0].dlzh,
|
||||
article: res.article,
|
||||
type: res.sdType,
|
||||
se_amount: res.taxAmount,
|
||||
number: 1,
|
||||
d_price: '',
|
||||
tax_amount: '',
|
||||
price: this.item.payAmount,
|
||||
cash_out: this.item.orderNo,
|
||||
}
|
||||
this.Binding = res.taxation
|
||||
this.changeevent()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
//==本JS是加载Lodop插件或Web打印服务CLodop/Lodop7的综合示例,可直接使用,建议理解后融入自己程序==
|
||||
|
||||
//用双端口加载主JS文件Lodop.js(或CLodopfuncs.js兼容老版本)以防其中某端口被占:
|
||||
var MainJS ="CLodopfuncs.js",
|
||||
URL_WS1 = "ws://localhost:8000/"+MainJS, //ws用8000/18000
|
||||
URL_WS2 = "ws://localhost:18000/"+MainJS,
|
||||
URL_HTTP1 = "http://localhost:8000/"+MainJS, //http用8000/18000
|
||||
URL_HTTP2 = "http://localhost:18000/"+MainJS,
|
||||
URL_HTTP3 = "https://localhost.lodop.net:8443/"+MainJS; //https用8000/8443
|
||||
|
||||
var CreatedOKLodopObject, CLodopIsLocal, LoadJsState;
|
||||
|
||||
//==判断是否需要CLodop(那些不支持插件的浏览器):==
|
||||
function needCLodop() {
|
||||
try {
|
||||
var ua = navigator.userAgent;
|
||||
if (ua.match(/Windows\sPhone/i) ||
|
||||
ua.match(/iPhone|iPod|iPad/i) ||
|
||||
ua.match(/Android/i) ||
|
||||
ua.match(/Edge\D?\d+/i))
|
||||
return true;
|
||||
var verTrident = ua.match(/Trident\D?\d+/i);
|
||||
var verIE = ua.match(/MSIE\D?\d+/i);
|
||||
var verOPR = ua.match(/OPR\D?\d+/i);
|
||||
var verFF = ua.match(/Firefox\D?\d+/i);
|
||||
var x64 = ua.match(/x64/i);
|
||||
if ((!verTrident) && (!verIE) && (x64)) return true;
|
||||
else if (verFF) {
|
||||
verFF = verFF[0].match(/\d+/);
|
||||
if ((verFF[0] >= 41) || (x64)) return true;
|
||||
} else if (verOPR) {
|
||||
verOPR = verOPR[0].match(/\d+/);
|
||||
if (verOPR[0] >= 32) return true;
|
||||
} else if ((!verTrident) && (!verIE)) {
|
||||
var verChrome = ua.match(/Chrome\D?\d+/i);
|
||||
if (verChrome) {
|
||||
verChrome = verChrome[0].match(/\d+/);
|
||||
if (verChrome[0] >= 41) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} catch (err) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//==检查加载成功与否,如没成功则用http(s)再试==
|
||||
//==低版本CLODOP6.561/Lodop7.043及前)用本方法==
|
||||
function checkOrTryHttp() {
|
||||
if (window.getCLodop) {
|
||||
LoadJsState = "complete";
|
||||
return true;
|
||||
}
|
||||
if (LoadJsState == "loadingB" || LoadJsState == "complete") return;
|
||||
LoadJsState = "loadingB";
|
||||
var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
|
||||
var JS1 = document.createElement("script")
|
||||
,JS2 = document.createElement("script")
|
||||
,JS3 = document.createElement("script");
|
||||
JS1.src = URL_HTTP1;
|
||||
JS2.src = URL_HTTP2;
|
||||
JS3.src = URL_HTTP3;
|
||||
JS1.onload = JS2.onload = JS3.onload = JS2.onerror = JS3.onerror=function(){LoadJsState = "complete";}
|
||||
JS1.onerror = function(e) {
|
||||
if (window.location.protocol !== 'https:')
|
||||
head.insertBefore(JS2, head.firstChild); else
|
||||
head.insertBefore(JS3, head.firstChild);
|
||||
}
|
||||
head.insertBefore(JS1,head.firstChild);
|
||||
}
|
||||
|
||||
//==加载Lodop对象的主过程:==
|
||||
(function loadCLodop(){
|
||||
if (!needCLodop()) return;
|
||||
CLodopIsLocal = !!((URL_WS1 + URL_WS2).match(/\/\/localho|\/\/127.0.0./i));
|
||||
LoadJsState = "loadingA";
|
||||
if (!window.WebSocket && window.MozWebSocket) window.WebSocket=window.MozWebSocket;
|
||||
//ws方式速度快(小于200ms)且可避免CORS错误,但要求Lodop版本足够新:
|
||||
try {
|
||||
var WSK1=new WebSocket(URL_WS1);
|
||||
WSK1.onopen = function(e) { setTimeout("checkOrTryHttp()",200); }
|
||||
WSK1.onmessage = function(e) {if (!window.getCLodop) eval(e.data);}
|
||||
WSK1.onerror = function(e) {
|
||||
var WSK2=new WebSocket(URL_WS2);
|
||||
WSK2.onopen = function(e) {setTimeout("checkOrTryHttp()",200);}
|
||||
WSK2.onmessage = function(e) {if (!window.getCLodop) eval(e.data);}
|
||||
WSK2.onerror= function(e) {checkOrTryHttp();}
|
||||
}
|
||||
} catch(e){
|
||||
checkOrTryHttp();
|
||||
}
|
||||
})();
|
||||
|
||||
//==获取LODOP对象主过程,判断是否安装、需否升级:==
|
||||
export function getLodop(oOBJECT, oEMBED) {
|
||||
var strFontTag = "<br><font color='#FF00FF'>打印控件";
|
||||
var strLodopInstall = strFontTag + "未安装!点击这里<a href='install_lodop32.exe' target='_self'>执行安装</a>";
|
||||
var strLodopUpdate = strFontTag + "需要升级!点击这里<a href='install_lodop32.exe' target='_self'>执行升级</a>";
|
||||
var strLodop64Install = strFontTag + "未安装!点击这里<a href='install_lodop64.exe' target='_self'>执行安装</a>";
|
||||
var strLodop64Update = strFontTag + "需要升级!点击这里<a href='install_lodop64.exe' target='_self'>执行升级</a>";
|
||||
var strCLodopInstallA = "<br><font color='#FF00FF'>Web打印服务CLodop未安装启动,点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>下载执行安装</a>";
|
||||
var strCLodopInstallB = "<br>(若此前已安装过,可<a href='CLodop.protocol:setup' target='_self'>点这里直接再次启动</a>)";
|
||||
var strCLodopUpdate = "<br><font color='#FF00FF'>Web打印服务CLodop需升级!点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>";
|
||||
var strLodop7FontTag = "<br><font color='#FF00FF'>Web打印服务Lodop7";
|
||||
var strLodop7HrefX86 = "点击这里<a href='Lodop7_Linux_X86_64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
|
||||
var strLodop7HrefARM = "点击这里<a href='Lodop7_Linux_ARM64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
|
||||
var strLodop7Install_X86 = strLodop7FontTag + "未安装启动," + strLodop7HrefX86;
|
||||
var strLodop7Install_ARM = strLodop7FontTag + "未安装启动," + strLodop7HrefARM;
|
||||
var strLodop7Update_X86 = strLodop7FontTag + "需升级," + strLodop7HrefX86;
|
||||
var strLodop7Update_ARM = strLodop7FontTag + "需升级," + strLodop7HrefARM;
|
||||
var strInstallOK = ",成功后请刷新本页面或重启浏览器。</font>";
|
||||
var LODOP;
|
||||
try {
|
||||
var isWinIE = (/MSIE/i.test(navigator.userAgent)) || (/Trident/i.test(navigator.userAgent));
|
||||
var isWinIE64 = isWinIE && (/x64/i.test(navigator.userAgent));
|
||||
var isLinuxX86 = (/Linux/i.test(navigator.platform)) && (/x86/i.test(navigator.platform));
|
||||
var isLinuxARM = (/Linux/i.test(navigator.platform)) && (/aarch/i.test(navigator.platform));
|
||||
|
||||
if (needCLodop() || isLinuxX86 || isLinuxARM) {
|
||||
try {
|
||||
LODOP = window.getCLodop();
|
||||
} catch (err) {}
|
||||
if (!LODOP && LoadJsState !== "complete") {
|
||||
if (!LoadJsState)
|
||||
alert("未曾加载Lodop主JS文件,请先调用loadCLodop过程."); else
|
||||
alert("网页还没下载完毕,请稍等一下再操作.");
|
||||
return;
|
||||
}
|
||||
var strAlertMessage;
|
||||
if (!LODOP) {
|
||||
if (isLinuxX86)
|
||||
strAlertMessage = strLodop7Install_X86;
|
||||
else if (isLinuxARM)
|
||||
strAlertMessage = strLodop7Install_ARM;
|
||||
else
|
||||
strAlertMessage = strCLodopInstallA + (CLodopIsLocal ? strCLodopInstallB : "");
|
||||
document.body.innerHTML = strAlertMessage + strInstallOK + document.body.innerHTML;
|
||||
return;
|
||||
} else {
|
||||
if (isLinuxX86 && LODOP.CVERSION < "7.0.7.5")
|
||||
strAlertMessage = strLodop7Update_X86;
|
||||
else if (isLinuxARM && LODOP.CVERSION < "7.0.7.5")
|
||||
strAlertMessage = strLodop7Update_ARM;
|
||||
else if (CLODOP.CVERSION < "6.5.9.4")
|
||||
strAlertMessage = strCLodopUpdate;
|
||||
|
||||
if (strAlertMessage)
|
||||
document.body.innerHTML = strAlertMessage + strInstallOK + document.body.innerHTML;
|
||||
}
|
||||
} else {
|
||||
//==如果页面有Lodop插件就直接使用,否则新建:==
|
||||
if (oOBJECT || oEMBED) {
|
||||
if (isWinIE)
|
||||
LODOP = oOBJECT;
|
||||
else
|
||||
LODOP = oEMBED;
|
||||
} else if (!CreatedOKLodopObject) {
|
||||
LODOP = document.createElement("object");
|
||||
LODOP.setAttribute("width", 0);
|
||||
LODOP.setAttribute("height", 0);
|
||||
LODOP.setAttribute("style", "position:absolute;left:0px;top:-100px;width:0px;height:0px;");
|
||||
if (isWinIE)
|
||||
LODOP.setAttribute("classid", "clsid:2105C259-1E0C-4534-8141-A753534CB4CA");
|
||||
else
|
||||
LODOP.setAttribute("type", "application/x-print-lodop");
|
||||
document.documentElement.appendChild(LODOP);
|
||||
CreatedOKLodopObject = LODOP;
|
||||
} else
|
||||
LODOP = CreatedOKLodopObject;
|
||||
//==Lodop插件未安装时提示下载地址:==
|
||||
if ((!LODOP) || (!LODOP.VERSION)) {
|
||||
document.body.innerHTML = (isWinIE64 ? strLodop64Install : strLodopInstall) + strInstallOK + document.body.innerHTML;
|
||||
return LODOP;
|
||||
}
|
||||
if (LODOP.VERSION < "6.2.2.6") {
|
||||
document.body.innerHTML = (isWinIE64 ? strLodop64Update : strLodopUpdate) + strInstallOK + document.body.innerHTML;
|
||||
}
|
||||
}
|
||||
//===如下空白位置适合调用统一功能(如注册语句、语言选择等):=======================
|
||||
|
||||
|
||||
//===============================================================================
|
||||
return LODOP;
|
||||
} catch (err) {
|
||||
alert("getLodop出错:" + err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -141,10 +141,25 @@
|
|||
<template v-slot="scope"> x{{ scope.row.num }} </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价">
|
||||
<template v-slot="scope"> ¥{{ scope.row.price }}/ </template>
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.price }}
|
||||
<!-- <template v-if="isUseCalcPrice(scope.row)">
|
||||
<div class=""> ¥{{ (scope.row.canReturnAmount / scope.row.num) |to2 }}</div>
|
||||
<div class="line-th"> ¥{{ scope.row.price }}</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div v-if="isShowGoodsVipPrice(scope.row)">
|
||||
<div class="" > ¥{{ scope.row.memberPrice }}</div>
|
||||
<div class="line-th"> ¥{{ scope.row.price }}</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="" > ¥{{ scope.row.price }}</div>
|
||||
</div>
|
||||
</template> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
<template v-slot="scope"> ¥{{ scope.row.priceAmount }} </template>
|
||||
<template v-slot="scope"> ¥{{ scope.row.canReturnAmount }} </template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template v-slot="scope">
|
||||
|
|
@ -274,6 +289,9 @@ export default {
|
|||
};
|
||||
},
|
||||
filters: {
|
||||
to2(n){
|
||||
return Number(n).toFixed(2)
|
||||
},
|
||||
orderTypeFilter(t) {
|
||||
if (t) {
|
||||
return t && orderEnum.orderType.find((item) => item.key == t).label;
|
||||
|
|
@ -333,11 +351,9 @@ export default {
|
|||
youHuiJinE() {
|
||||
console.log(this.vipDiscountAmount);
|
||||
const discountAmount=this.detail.discountAmount;
|
||||
const calcDiscountAmount=(this.detail.originAmount*(1-this.detail.discountRatio)).toFixed(2);
|
||||
console.log(this.detail.originAmount*(1-this.detail.discountRatio))
|
||||
const n = $util.numSum([
|
||||
this.vipDiscountAmount,
|
||||
(discountAmount?discountAmount:calcDiscountAmount),
|
||||
discountAmount,
|
||||
this.detail.productCouponDiscountAmount,
|
||||
this.detail.fullCouponDiscountAmount,
|
||||
this.detail.pointsDiscountAmount,
|
||||
|
|
@ -349,6 +365,12 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
isShowGoodsVipPrice(item){
|
||||
return $util.isShowGoodsVipPrice(item);
|
||||
},
|
||||
isUseCalcPrice(item){
|
||||
return $util.isUseCalcPrice(this.detail,item);
|
||||
},
|
||||
close() {
|
||||
console.log("drawer close");
|
||||
this.$emit("close");
|
||||
|
|
@ -391,7 +413,7 @@ export default {
|
|||
tuikuan(item) {
|
||||
this.selGoods = item;
|
||||
console.log(item);
|
||||
this.$refs.refReturnMoney.open(item);
|
||||
this.$refs.refReturnMoney.open({...item,priceAmount:item.canReturnAmount});
|
||||
},
|
||||
tuiCai(item) {
|
||||
this.selGoods = item;
|
||||
|
|
@ -488,7 +510,9 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.line-th{
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.container {
|
||||
padding: 0 20px;
|
||||
font-size: 14px;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,238 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="query.d_order_id" placeholder="订单号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="query.status" placeholder="状态">
|
||||
<el-option label="等待验券" value="0" />
|
||||
<el-option label="成功" value="1" />
|
||||
<el-option label="失败" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table border :data="tableData.data">
|
||||
<el-table-column
|
||||
label="订单号"
|
||||
prop="d_order_id"
|
||||
width="100px"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="店铺名称"
|
||||
prop="title"
|
||||
width="100px"
|
||||
></el-table-column>
|
||||
<el-table-column label="套餐">
|
||||
<template v-slot="scope">
|
||||
<el-table border :data="scope.row.douyinCodeGoods">
|
||||
<el-table-column label="套餐名称" prop="title">
|
||||
<template v-slot="taocan">
|
||||
{{ taocan.row.title }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付金额" >
|
||||
<template v-slot="taocan">
|
||||
{{ taocan.row.pay_amount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="原价" >
|
||||
<template v-slot="taocan">
|
||||
{{ taocan.row.market_price }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
></el-table-column>
|
||||
<el-table-column label="状态" width="100px">
|
||||
<template v-slot="taocan">
|
||||
<el-tag :type="statusF(scope.row.status)">
|
||||
{{ returnStatus(taocan.row.status) }}
|
||||
</el-tag>
|
||||
<span
|
||||
:style="{ color: statusList[taocan.row.status].type }"
|
||||
></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template v-slot="taocan">
|
||||
<el-button type="primary"
|
||||
v-if="taocan.row.status == 1"
|
||||
@click="showRefund(taocan.row)"
|
||||
>撤销核销</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
:total="tableData.total"
|
||||
:current-page="tableData.page + 1"
|
||||
:page-size="tableData.size"
|
||||
@current-change="paginationChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as $api from "@/api/coup/index.js";
|
||||
import dayjs from "dayjs";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
d_order_id: "",
|
||||
status: "",
|
||||
},
|
||||
resetQuery: "",
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 1,
|
||||
loading: false,
|
||||
total: 0,
|
||||
},
|
||||
payTypes: [
|
||||
{
|
||||
value: "wechatPay",
|
||||
label: "微信支付",
|
||||
},
|
||||
{
|
||||
value: "aliPay",
|
||||
label: "支付宝支付",
|
||||
},
|
||||
],
|
||||
statusList: [
|
||||
{
|
||||
value: "0",
|
||||
label: "等待验券",
|
||||
type: "warning",
|
||||
},
|
||||
{
|
||||
value: "1",
|
||||
label: "成功",
|
||||
type: "primary",
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "失败",
|
||||
type: "success",
|
||||
},
|
||||
],
|
||||
row: "",
|
||||
showDialog: false,
|
||||
refundNumList: [],
|
||||
refundLoading: false,
|
||||
refundForm: {
|
||||
num: "",
|
||||
orderId: "",
|
||||
refundAmount: "",
|
||||
refundDesc: "",
|
||||
refundReason: "",
|
||||
},
|
||||
refundFormRules: {
|
||||
num: [
|
||||
{
|
||||
required: true,
|
||||
message: " ",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
timeFilter(s) {
|
||||
return dayjs(s).format("YYYY-MM-DD HH:mm:ss");
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData();
|
||||
this.resetQuery = { ...this.query };
|
||||
},
|
||||
methods: {
|
||||
statusF(t) {
|
||||
if(!t){
|
||||
return ''
|
||||
}
|
||||
return this.statusList[t]? this.statusList[t].type:'';
|
||||
},
|
||||
returnStatus(status) {
|
||||
return this.statusList[status].label || "";
|
||||
}, // 撤销核销
|
||||
showRefund(row) {
|
||||
this.$confirm("是否确认撤销核销", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
// for(let i in row.douyinCodeGoods){
|
||||
const item = row
|
||||
$api.$douyin_fulfilmentcertificatecancel({
|
||||
verify_id: item.verify_id,
|
||||
certificate_id: item.certificate_id,
|
||||
}).then(res=>{
|
||||
this.$message.success("撤销核销成功");
|
||||
this.getTableData();
|
||||
})
|
||||
// }
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 切换状态
|
||||
async statusChange(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true;
|
||||
const data = { ...row };
|
||||
data.status = e;
|
||||
await tbPrintMachine(data, "put");
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
this.tableData.loading = false;
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query = { ...this.resetQuery };
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
// 获取列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await $api.$douyin_orderlist({
|
||||
...this.query,
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.list;
|
||||
console.log(this.tableData.data);
|
||||
this.tableData.total = res.count;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -18,7 +18,7 @@ export function canTuicai(orderInfo,item){
|
|||
}
|
||||
export function canTuiKuan(orderInfo,item){
|
||||
// return orderInfo.status!='unpaid'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding'
|
||||
return orderInfo.status=='closed'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding' && !item.userCouponId
|
||||
return orderInfo.status=='closed'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding'
|
||||
}
|
||||
export function isTui(item){
|
||||
return item.status=='return'||item.status=='refund'||item.status=='refunding'
|
||||
|
|
@ -28,4 +28,17 @@ export function numSum(arr){
|
|||
return a+b*100
|
||||
},0)
|
||||
return (sum/100).toFixed(2)
|
||||
}
|
||||
//是否使用计算的会员价
|
||||
export function isUseCalcPrice(order,item){
|
||||
console.log(order)
|
||||
if(order.fullCouponDiscountAmount>0||order.pointsDiscountAmount>0){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
//商品列表是否展示会员价
|
||||
export function isShowGoodsVipPrice(item){
|
||||
return item.isMember==1&&item.memberPrice&&item.memberPrice!=item.price
|
||||
}
|
||||
|
|
@ -57,9 +57,9 @@
|
|||
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<!-- <div class="head-container">
|
||||
<div class="collect_wrap">
|
||||
<!-- <div class="item">
|
||||
<div class="item">
|
||||
<div class="icon_wrap" style="--bg-color:#C978EE">
|
||||
<i class="icon el-icon-s-goods"></i>
|
||||
</div>
|
||||
|
|
@ -68,7 +68,9 @@
|
|||
<div class="t">总金额</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="item" v-for="item in payCountList" :key="item.payType">
|
||||
<!-- <div class="item" v-for="item in payCountList" :key="item.payType">
|
||||
</div>
|
||||
<div class="item" v-for="item in payCountList" :key="item.payType">
|
||||
<div class="icon_wrap" style="--bg-color:#fff">
|
||||
<el-image class="img" :src="item.icon"></el-image>
|
||||
</div>
|
||||
|
|
@ -77,8 +79,9 @@
|
|||
<div class="t">{{ item.payType }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading">
|
||||
<el-table-column label="订单号信息">
|
||||
|
|
@ -150,7 +153,10 @@
|
|||
<template v-slot="scope">
|
||||
<div class="u-flex gap-10">
|
||||
<el-button type="text" @click="$refs.orderDetail.show(scope.row)">详情</el-button>
|
||||
<el-button v-if="scope.row.status == 'unpaid'" type="primary" size="mini" @click="payOrder(scope.row)">结账</el-button>
|
||||
<el-button type="text" v-if="scope.row.status == 'closed'"
|
||||
@click="$refs.Invoicing.show(scope.row)">开票</el-button>
|
||||
<el-button v-if="scope.row.status == 'unpaid'" type="primary" size="mini"
|
||||
@click="payOrder(scope.row)">结账</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -162,20 +168,38 @@
|
|||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
<orderDetail ref="orderDetail" @close="getTableData" />
|
||||
<!-- 开票 -->
|
||||
<Invoicing ref="Invoicing" @qrcode="qrcodeEvent"></Invoicing>
|
||||
<!-- 二维码 -->
|
||||
<div class="qrStyle" v-if="isuppop">
|
||||
<div class="box">
|
||||
<div> <span></span> {{ codeinfo.type }}<i class="el-icon-close" @click="isuppopEvent()"></i> </div>
|
||||
<canvas ref="canvas" id="canvas"></canvas>
|
||||
<div>
|
||||
税率:{{ codeinfo.se_amount + '%' }}
|
||||
金额:{{ codeinfo.price }}<br />
|
||||
<div style="color: red;margin-top: 5px;"> {{ codeinfo.string1 }} </div> <br />
|
||||
<el-button type="primary" style="margin-top: 10px;" @click="printEvent(codeinfo)">打印</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import orderEnum from "./orderEnum";
|
||||
import { getLodop } from "./components/LodopFuncs.js";
|
||||
import { tbShopPayTypeGet } from "@/api/setting";
|
||||
import { tbOrderInfoData, tbOrderInfoDownload, payCount } from "@/api/order";
|
||||
import dayjs from "dayjs";
|
||||
import { downloadFile } from "@/utils/index";
|
||||
import QRCode from "qrcode";
|
||||
|
||||
import orderDetail from "./components/orderDetail";
|
||||
import Invoicing from "./components/Invoicing";
|
||||
|
||||
export default {
|
||||
components: { orderDetail },
|
||||
components: { orderDetail, Invoicing },
|
||||
data() {
|
||||
return {
|
||||
orderEnum,
|
||||
|
|
@ -200,31 +224,34 @@ export default {
|
|||
},
|
||||
downloadLoading: false,
|
||||
payCountList: "",
|
||||
payCountTotal: 0
|
||||
payCountTotal: 0,
|
||||
isuppop: false,
|
||||
codeinfo: "",
|
||||
};
|
||||
},
|
||||
|
||||
filters: {
|
||||
orderTypeFilter(t) {
|
||||
if (t) {
|
||||
const item= orderEnum.orderType.find(item => item.key == t);
|
||||
return t && item?item.label:'';
|
||||
const item = orderEnum.orderType.find(item => item.key == t);
|
||||
return t && item ? item.label : '';
|
||||
} else {
|
||||
return t;
|
||||
}
|
||||
},
|
||||
|
||||
sendTypeFilter(t) {
|
||||
if (t) {
|
||||
const item= orderEnum.sendType.find(item => item.key == t);
|
||||
return item?item.label:'';
|
||||
const item = orderEnum.sendType.find(item => item.key == t);
|
||||
return item ? item.label : '';
|
||||
} else {
|
||||
return t;
|
||||
}
|
||||
},
|
||||
statusFilter(t) {
|
||||
if (t) {
|
||||
const item= orderEnum.status.find(item => item.key == t);
|
||||
return t && item?item.label:'';
|
||||
const item = orderEnum.status.find(item => item.key == t);
|
||||
return t && item ? item.label : '';
|
||||
} else {
|
||||
return t;
|
||||
}
|
||||
|
|
@ -234,6 +261,8 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
||||
if (this.$route.query.tableName) {
|
||||
this.query.tableName = this.$route.query.tableName
|
||||
}
|
||||
|
|
@ -254,11 +283,57 @@ export default {
|
|||
this.getTableData();
|
||||
}, 200);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
printEvent(data) {
|
||||
console.log('打印方法执行', data)
|
||||
let LODOP = getLodop();
|
||||
LODOP.PRINT_INIT("打印小票");
|
||||
LODOP.SET_PRINTER_INDEX('MHT-POS58');//设置默认打印机(这里用的是打印机名称)
|
||||
// 设置打印纸大小D
|
||||
LODOP.SET_PRINT_PAGESIZE(3, 800, '', '')
|
||||
// 二维码控制大小
|
||||
LODOP.ADD_PRINT_BARCODE('', '30px', '150px', '150px', 'QRCode', data.url) //打印产品代码条码
|
||||
LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-Width ') //设置打印风格,这里是等宽打印
|
||||
LODOP.SET_PRINT_STYLE("Alignment", 2);
|
||||
// 文字内容
|
||||
LODOP.ADD_PRINT_HTM(
|
||||
'150px',
|
||||
'5px',
|
||||
'100%',
|
||||
'100%',
|
||||
`<div style="width: 100%;font-size: 12px; ">项目分类:${data.article}</div>
|
||||
<div style="width: 100%;font-size: 12px; margin-top:6px;">发票类型:${data.type}</div>
|
||||
<div style="width: 100%;font-size: 12px; margin-top:6px;">生成时间:${dayjs().format('YYYY-MM-DD HH:mm:ss')}</div>
|
||||
<div style="width: 100%;font-size: 12px; margin-top:6px;">*二维码有效期30天,超过自动失效!</div>
|
||||
<div style="width: 100%;font-size: 14px; margin-top: 15px;">您可以使用微信,扫码开票</div>`
|
||||
)
|
||||
LODOP.SET_LICENSES('', 'DCFF409304DFCEB3E2C644BF96CD0720', '', '')
|
||||
LODOP.PRINT()
|
||||
|
||||
},
|
||||
qrcodeEvent(d) {
|
||||
this.codeinfo = d
|
||||
this.isuppopEvent()
|
||||
setTimeout(() => {
|
||||
QRCode.toCanvas(
|
||||
this.$refs.canvas,
|
||||
this.codeinfo.url, {
|
||||
width: 160,
|
||||
height: 160,
|
||||
}, function (error) {
|
||||
console.log(error);
|
||||
}
|
||||
);
|
||||
}, 500);
|
||||
|
||||
},
|
||||
isuppopEvent() {
|
||||
this.isuppop = !this.isuppop
|
||||
},
|
||||
//结账
|
||||
payOrder(order){
|
||||
payOrder(order) {
|
||||
console.log(order);
|
||||
this.$router.push({
|
||||
path: "/tool/Instead/index",
|
||||
|
|
@ -268,7 +343,7 @@ export default {
|
|||
useType: order.useType,
|
||||
masterId: order.masterId,
|
||||
orderId: order.id,
|
||||
key:'isJieZhang'
|
||||
key: 'isJieZhang'
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
@ -324,7 +399,7 @@ export default {
|
|||
async getTableData(switchs = false) {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
this.payCount();
|
||||
// this.payCount();
|
||||
const productName = this.query.productName.replace(/\s+/g, '')
|
||||
const res = await tbOrderInfoData({
|
||||
page: this.tableData.page,
|
||||
|
|
@ -543,4 +618,40 @@ export default {
|
|||
.colorStyle {
|
||||
color: #ffc315;
|
||||
}
|
||||
|
||||
.qrStyle {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba($color: #000000, $alpha: 0.7);
|
||||
position: fixed;
|
||||
z-index: 999999;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
.box {
|
||||
width: 380px;
|
||||
height: 320px;
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
top: 26%;
|
||||
left: 36%;
|
||||
padding: 18px;
|
||||
|
||||
>div:first-child {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
margin-left: 49%;
|
||||
transform: translateX(-80px);
|
||||
}
|
||||
|
||||
>div:last-child {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -189,11 +189,13 @@
|
|||
style="margin-left: 20px !important;">
|
||||
<el-button type="text" icon="el-icon-edit">编辑</el-button>
|
||||
</router-link> -->
|
||||
<el-button type="text" icon="el-icon-edit" @click="toPath('/product/add_shop', scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
<div style="display: flex;gap: 10px;">
|
||||
<el-button type="text" icon="el-icon-edit" @click="toPath('/product/add_shop', scope.row)"
|
||||
v-if="scope.row.typeEnum">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -244,7 +246,7 @@ import { tbProductListV2, tbShopCategoryGet, tbProductDelete, tbProductIsHot, up
|
|||
import { hasPermission } from '@/utils/limits.js'
|
||||
|
||||
export default {
|
||||
name:'product',
|
||||
name: 'product',
|
||||
components: {
|
||||
BindCons,
|
||||
StockHistory
|
||||
|
|
|
|||
|
|
@ -192,7 +192,18 @@ export default {
|
|||
},
|
||||
// 确认选择商品
|
||||
selectConfirmGoods(res) {
|
||||
this.$set(this.form.list, this.activeItem, { ...res[0] })
|
||||
// this.form.list = res
|
||||
const flag = this.form.list.filter(item => item.id == res[0].id)
|
||||
|
||||
if (flag.length) {
|
||||
this.$notify({
|
||||
title: '注意',
|
||||
message: '请勿重复添加',
|
||||
type: 'error'
|
||||
})
|
||||
} else {
|
||||
this.$set(this.form.list, this.activeItem, { ...res[0] })
|
||||
}
|
||||
},
|
||||
// 切换tab
|
||||
tabChange() {
|
||||
|
|
|
|||
|
|
@ -7,8 +7,12 @@
|
|||
</el-input>
|
||||
</div>
|
||||
<div class="tree_wrap">
|
||||
<el-tree :data="treeData" node-key="id" highlight-current :props="{ label: 'name' }" default-expand-all
|
||||
@node-click="treeItemClick"></el-tree>
|
||||
<!-- <el-tree :data="treeData" node-key="id" highlight-current :props="{ label: 'name' }" default-expand-all
|
||||
@node-click="treeItemClick"></el-tree> -->
|
||||
<div class="item" :class="{ active: selectCatoryIndex == index }" v-for="(item, index) in treeData"
|
||||
:key="item.id" @click="treeItemClick(item, index)">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table_wrap">
|
||||
|
|
@ -62,6 +66,7 @@ export default {
|
|||
query: {
|
||||
name: ''
|
||||
},
|
||||
selectCatoryIndex: 0,
|
||||
selectCatory: '',
|
||||
treeDataOrgin: [],
|
||||
treeData: [],
|
||||
|
|
@ -88,6 +93,12 @@ export default {
|
|||
this.treeData = this.treeDataOrgin.filter(item => {
|
||||
return item.name.includes(this.query.name)
|
||||
})
|
||||
|
||||
if (this.treeData.length) {
|
||||
this.selectCatoryIndex = 0
|
||||
this.selectCatory = this.treeData[this.selectCatoryIndex]
|
||||
this.getTableData()
|
||||
}
|
||||
},
|
||||
//表格拖拽
|
||||
tableDrag() {
|
||||
|
|
@ -147,7 +158,8 @@ export default {
|
|||
}
|
||||
},
|
||||
// 分类被点击
|
||||
treeItemClick(data) {
|
||||
treeItemClick(data, index) {
|
||||
this.selectCatoryIndex = index
|
||||
this.selectCatory = data
|
||||
this.tableData.page = 1
|
||||
this.getTableData()
|
||||
|
|
@ -164,6 +176,7 @@ export default {
|
|||
})
|
||||
this.treeDataOrgin = res.content
|
||||
this.treeData = res.content
|
||||
this.selectCatory = res.content[this.selectCatoryIndex]
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
|
|
@ -235,6 +248,22 @@ export default {
|
|||
width: 100%;
|
||||
height: calc(100% - 70px);
|
||||
overflow-y: auto;
|
||||
|
||||
.item {
|
||||
padding: 10px 15px;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: #1890ff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,189 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<div class="head-container">
|
||||
<el-form :model="forms">
|
||||
<el-form-item label="步骤一" label-width="80px">
|
||||
单位({{ forms.proUnit > 0 ? forms.proUnit : 0 }}) <el-checkbox v-if="disableds"
|
||||
:true-label="1" :false-label="0" @change="selectChange($event, 'proUnit')"
|
||||
v-model="forms.proUnit"></el-checkbox>
|
||||
规格({{ forms.proSpec > 0 ? forms.proSpec : 0 }}) <el-checkbox :true-label="1"
|
||||
v-if="disableds" :false-label="0" @change="selectChange($event, 'proSpec')"
|
||||
v-model="forms.proSpec"></el-checkbox>
|
||||
分类({{ forms.proCategory > 0 ? forms.proCategory : 0 }}) <el-checkbox v-if="disableds"
|
||||
:true-label="1" :false-label="0" @change="selectChange($event, 'proCategory')"
|
||||
v-model="forms.proCategory"></el-checkbox>
|
||||
耗材类型({{ forms.consType > 0 ? forms.consType : 0 }}) <el-checkbox v-if="disableds"
|
||||
:true-label="1" :false-label="0" @change="selectChange($event, 'consType')"
|
||||
v-model="forms.consType"></el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item label="步骤二" label-width="80px">
|
||||
商品({{ forms.product > 0 ? forms.product : 0 }}) <el-checkbox v-if="disableds"
|
||||
:true-label="1" :false-label="0" @change="selectChange($event, 'product')"
|
||||
v-model="forms.product"></el-checkbox>
|
||||
耗材信息({{ forms.consInfo > 0 ? forms.consInfo : 0 }}) <el-checkbox v-if="disableds"
|
||||
:true-label="1" :false-label="0" @change="selectChange($event, 'consInfo')"
|
||||
v-model="forms.consInfo"></el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item label="步骤三" label-width="80px">
|
||||
分组({{ forms.proGroup > 0 ? forms.proGroup : 0 }}) <el-checkbox v-if="disableds"
|
||||
:true-label="1" :false-label="0" @change="selectChange($event, 'proGroup')"
|
||||
v-model="forms.proGroup"></el-checkbox>
|
||||
配方({{ forms.consPro > 0 ? forms.consPro : 0 }}) <el-checkbox v-if="disableds"
|
||||
:true-label="1" :false-label="0" @change="selectChange($event, 'consPro')"
|
||||
v-model="forms.consPro"></el-checkbox>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-button type="primary" @click="sumbitForm" :disabled="!disableds">同步</el-button>
|
||||
<el-button type="primary" @click="outsync" :disabled="disableds">撤销同步</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { gettbShopSyncInfo, getsync, setclear } from '@/api/setting.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
forms: {
|
||||
proUnit: 0,
|
||||
proSpec: 0,
|
||||
proCategory: 0,
|
||||
consType: 0,
|
||||
product: 0,
|
||||
consInfo: 0,
|
||||
proGroup: 0,
|
||||
consPro: 0,
|
||||
sourceShopId: localStorage.getItem("mainId"),
|
||||
pointShopId: localStorage.getItem("shopId"),
|
||||
},
|
||||
disableds: false,
|
||||
}
|
||||
}
|
||||
,
|
||||
mounted() {
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
async sumbitForm() {
|
||||
if (this.forms.sourceShopId == this.forms.pointShopId) {
|
||||
this.$message.error('当前店铺和源店铺一致');
|
||||
} else {
|
||||
let res = await getsync(this.forms)
|
||||
this.getlist()
|
||||
}
|
||||
|
||||
},
|
||||
outsync() {
|
||||
this.$confirm('此操作会撤销所有, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
let res = await setclear({ pointShopId: localStorage.getItem("shopId") })
|
||||
this.getlist()
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '撤销成功!'
|
||||
});
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
selectChange(v, k) {
|
||||
switch (k) {
|
||||
case 'proUnit':
|
||||
if (v == 0) {
|
||||
this.forms.product = v
|
||||
this.forms.consPro = v
|
||||
this.forms.proGroup = 0
|
||||
} else this.forms.consPro = 0
|
||||
break;
|
||||
case 'proSpec':
|
||||
if (v == 0) {
|
||||
this.forms.product = v
|
||||
this.forms.consPro = v
|
||||
this.forms.proGroup = 0
|
||||
} else this.forms.consPro = 0
|
||||
break;
|
||||
case 'proCategory':
|
||||
if (v == 0) {
|
||||
this.forms.product = v
|
||||
this.forms.consPro = v
|
||||
this.forms.proGroup = 0
|
||||
} else this.forms.consPro = 0
|
||||
break;
|
||||
case 'consType':
|
||||
// 耗材类型
|
||||
if (v == 0) {
|
||||
this.forms.consInfo = v
|
||||
this.forms.consPro = 0
|
||||
}
|
||||
break;
|
||||
case 'product':
|
||||
// 商品
|
||||
if (v == 1) {
|
||||
this.forms.proUnit = v
|
||||
this.forms.proSpec = v
|
||||
this.forms.proCategory = v
|
||||
} else {
|
||||
this.forms.proGroup = 0
|
||||
this.forms.consPro = 0
|
||||
}
|
||||
break;
|
||||
case 'consInfo':
|
||||
// 耗材信息
|
||||
if (v == 1) {
|
||||
console.log(this.forms, '调试1')
|
||||
this.forms.consType = 1
|
||||
} else {
|
||||
this.forms.consPro = 0
|
||||
}
|
||||
break;
|
||||
case 'proGroup':
|
||||
// 分组
|
||||
this.forms.proUnit = 1
|
||||
this.forms.proSpec = 1
|
||||
this.forms.proCategory = 1
|
||||
this.forms.product = 1
|
||||
break;
|
||||
case 'consPro':
|
||||
// 配方
|
||||
this.forms.product = 1
|
||||
this.forms.consType = 1
|
||||
this.forms.consInfo = 1
|
||||
this.forms.proUnit = 1
|
||||
this.forms.proSpec = 1
|
||||
this.forms.proCategory = 1
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
},
|
||||
async getlist() {
|
||||
let res = await gettbShopSyncInfo({ pointShopId: localStorage.getItem("shopId") })
|
||||
if (res) {
|
||||
this.forms = res
|
||||
this.disableds = false
|
||||
} else {
|
||||
this.disableds = true
|
||||
|
||||
this.forms = {
|
||||
proUnit: 0,
|
||||
proSpec: 0,
|
||||
proCategory: 0,
|
||||
consType: 0,
|
||||
product: 0,
|
||||
consInfo: 0,
|
||||
proGroup: 0,
|
||||
consPro: 0,
|
||||
sourceShopId: localStorage.getItem("mainId"),
|
||||
pointShopId: localStorage.getItem("shopId"),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -4,8 +4,12 @@
|
|||
:class="[isActive]"
|
||||
@click="itemClick"
|
||||
>
|
||||
<span class="absolute pack" v-if="item.isPack === 'true'"> 包 </span>
|
||||
<span class="absolute tui" v-if="item.status === 'return'"> 退 </span>
|
||||
<div class="absolute status-box">
|
||||
<span class="pack" v-if="item.isPack === 'true'"> 包 </span>
|
||||
<span class="da" v-if="item.isPrint"> 打 </span>
|
||||
<span class="isWaitCall" v-if="item.isWaitCall">等 </span>
|
||||
<span class="tui" v-if="item.status === 'return'"> 退 </span>
|
||||
</div>
|
||||
<div class="flex u-col-top">
|
||||
<div class="img">
|
||||
<div
|
||||
|
|
@ -14,6 +18,12 @@
|
|||
>
|
||||
<span>{{ item.name }}</span>
|
||||
</div>
|
||||
<div
|
||||
class="isSeatFee img u-line-1 u-flex u-col-center u-row-center"
|
||||
v-else-if="!item.productId"
|
||||
>
|
||||
<span> 临时菜 </span>
|
||||
</div>
|
||||
<img v-else :src="item.coverImg" class="" alt="" />
|
||||
</div>
|
||||
<div class="good-info u-p-t-6">
|
||||
|
|
@ -30,7 +40,7 @@
|
|||
</div>
|
||||
|
||||
<div class="" v-if="placeNum == 0">
|
||||
<div class="note" v-if="item.note">备注:{{ item.note || "" }}</div>
|
||||
<div class="note" v-if="item.note">备注:{{ item.note }}</div>
|
||||
<div class="note flex" v-else>
|
||||
<span>备注:</span>
|
||||
<span class="el-icon-edit u-font-12" @click="editNote"></span>
|
||||
|
|
@ -74,11 +84,23 @@
|
|||
<span v-else> ¥{{ isShowVipPrice ? vipAllPrice : allPrice }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="item.discountSaleAmount">
|
||||
<div>¥{{ discountNewPrice }}</div>
|
||||
<div class="free-price">
|
||||
<span> ¥{{ isShowVipPrice ? vipAllPrice : allPrice }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div v-if="isSeatFee">¥{{ item.totalAmount }}</div>
|
||||
<div v-else>
|
||||
<div v-if="isShowVipPrice&&vipAllPrice!=allPrice">¥{{ vipAllPrice }}</div>
|
||||
<div :class="{ 'free-price': isShowVipPrice&&vipAllPrice!=allPrice }">
|
||||
<div v-if="isShowVipPrice && vipAllPrice != allPrice">
|
||||
¥{{ vipAllPrice }}
|
||||
</div>
|
||||
<div
|
||||
:class="{
|
||||
'free-price': isShowVipPrice && vipAllPrice != allPrice,
|
||||
}"
|
||||
>
|
||||
<span> ¥{{ allPrice }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -142,13 +164,21 @@ export default {
|
|||
};
|
||||
},
|
||||
computed: {
|
||||
discountNewPrice(){
|
||||
const item = this.item;
|
||||
const originPrice=this.isShowVipPrice?this.vipAllPrice:this.allPrice
|
||||
const discount=(this.item.discountSaleAmount*this.item.number)
|
||||
return (originPrice-discount).toFixed(2)
|
||||
},
|
||||
vipAllPrice() {
|
||||
const item = this.item;
|
||||
const price =
|
||||
this.isShowVipPrice &&
|
||||
item.memberPrice != null &&
|
||||
item.memberPrice != undefined
|
||||
? (item.memberPrice<=0?item.salePrice:item.memberPrice)
|
||||
? item.memberPrice <= 0
|
||||
? item.salePrice
|
||||
: item.memberPrice
|
||||
: item.salePrice;
|
||||
return (price * item.number + (item.packAmount || 0)).toFixed(2);
|
||||
},
|
||||
|
|
@ -262,27 +292,36 @@ export default {
|
|||
justify-content: space-between;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
transition: all 0.3s;
|
||||
.pack {
|
||||
right: 100%;
|
||||
.status-box {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
> span {
|
||||
display: block;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 4px 0 4px 0;
|
||||
font-size: 12px;
|
||||
line-height: 17px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.isWaitCall {
|
||||
background: #d3adf7;
|
||||
}
|
||||
.pack {
|
||||
background: #35ac6a;
|
||||
}
|
||||
.da {
|
||||
background: #35ac6a;
|
||||
border-radius: 4px 0 4px 0;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 17px;
|
||||
}
|
||||
.tui {
|
||||
right: 100%;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background: #ac4735;
|
||||
border-radius: 4px 0 4px 0;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 17px;
|
||||
}
|
||||
&.active {
|
||||
background-color: rgba(0, 0, 0, 0.04);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,181 @@
|
|||
<template>
|
||||
<el-dialog title="选择挂账人" width="850px" :visible.sync="show" top="20px">
|
||||
<div class="app-container">
|
||||
<div class="head-container filtration">
|
||||
<div class="r">
|
||||
<el-input
|
||||
v-model="tableData.keywords"
|
||||
placeholder="按挂账人或手机号"
|
||||
style="width: 138px"
|
||||
/>
|
||||
<!-- <el-select
|
||||
v-model="tableData.status"
|
||||
placeholder="全部状态"
|
||||
clearable
|
||||
style="width: 123px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select> -->
|
||||
<el-button type="primary" @click="getTableData()"> 查询 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container content">
|
||||
<el-table
|
||||
v-loading="tableData.loading"
|
||||
:data="tableData.data"
|
||||
@cell-click="cellClick"
|
||||
>
|
||||
<el-table-column label="ID" prop="id" />
|
||||
|
||||
<el-table-column label="挂账人" prop="debtor" />
|
||||
<el-table-column label="手机号" prop="mobile" />
|
||||
<el-table-column label="已挂账金额(元)" prop="owedAmount" />
|
||||
<el-table-column label="可用挂账额度(元)" prop="remainingAmount" />
|
||||
<el-table-column label="操作">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" @click="cellClick(scope.row)"
|
||||
>选择</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
:total="tableData.total"
|
||||
:current-page="tableData.page"
|
||||
:page-size="tableData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChange"
|
||||
@size-change="sizeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import { getCreditBuyerList, delCreditBuyer } from "@/api/credit";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
options: [
|
||||
{
|
||||
value: "1",
|
||||
label: "启用",
|
||||
},
|
||||
{
|
||||
value: "0",
|
||||
label: "停用",
|
||||
},
|
||||
],
|
||||
tableData: {
|
||||
keywords: "",
|
||||
status: "1",
|
||||
data: [],
|
||||
page: 1,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
cellClick(row) {
|
||||
this.$emit("confirm", row);
|
||||
this.show = false;
|
||||
},
|
||||
open() {
|
||||
this.getTableData();
|
||||
this.show = true;
|
||||
},
|
||||
/**
|
||||
* 获取挂账人列表
|
||||
*/
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await getCreditBuyerList({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
keywords: this.tableData.keywords,
|
||||
status: this.tableData.status,
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除挂账人
|
||||
* @param id
|
||||
*/
|
||||
async delTableHandle(id) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const res = await delCreditBuyer(id);
|
||||
this.getTableData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 操作
|
||||
*/
|
||||
openDialog(row, type) {
|
||||
if (type === "add") {
|
||||
this.$refs.creditAdd.show();
|
||||
} else if (type === "edit") {
|
||||
this.$refs.creditAdd.show(row);
|
||||
} else if (type === "repayment" && row.repaymentMethod === "total") {
|
||||
this.$refs.creditRepayment.show(row);
|
||||
} else if (type === "rePaymentRecord") {
|
||||
this.$refs.creditRepaymentRecord.show(row);
|
||||
}
|
||||
},
|
||||
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.page = 1;
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e;
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e;
|
||||
this.getTableData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.title {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
}
|
||||
.filtration {
|
||||
overflow: hidden;
|
||||
.l {
|
||||
float: left;
|
||||
}
|
||||
.r {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
<template>
|
||||
<el-dialog title="选择商品" width="450px" :visible.sync="show">
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
ref="table"
|
||||
@selection-change="handleSelectionChange"
|
||||
@cell-click="cellClick"
|
||||
>
|
||||
<el-table-column type="selection" width="55"> </el-table-column>
|
||||
<el-table-column label="套餐名称" prop="title"></el-table-column>
|
||||
<el-table-column label="原价" prop="amount"></el-table-column>
|
||||
</el-table>
|
||||
<div class="u-flex u-row-center u-m-t-50 gap-20">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm"
|
||||
>确认核销</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
$douyin_certificateprepare,
|
||||
$meituan_certificateprepare,
|
||||
} from "@/api/coup/index";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
data: {},
|
||||
tableData: [],
|
||||
selArr: [],
|
||||
types: "douyin", //douyin meituan
|
||||
};
|
||||
},
|
||||
filters: {},
|
||||
mounted() {
|
||||
// this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(e) {
|
||||
this.selArr = e;
|
||||
console.log(e);
|
||||
},
|
||||
cellClick(user) {
|
||||
this.$refs.table.toggleRowSelection(user);
|
||||
},
|
||||
async choose(user) {
|
||||
console.log(user);
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
async confirm() {
|
||||
console.log(this.selArr.length);
|
||||
if (this.selArr.length <= 0) {
|
||||
return this.$message.error("请选择套餐商品");
|
||||
}
|
||||
console.log(this.types);
|
||||
if (this.types == "meituan") {
|
||||
//美团
|
||||
const mRes = await $meituan_certificateprepare({
|
||||
couponCode: this.data.couponCode,
|
||||
num: this.selArr.length,
|
||||
});
|
||||
}
|
||||
//抖音
|
||||
if (this.types == "douyin") {
|
||||
const res = await $douyin_certificateprepare({
|
||||
verify_token: this.data.verify_token,
|
||||
encrypted_codes: this.selArr
|
||||
.map((item) => item.encrypted_code)
|
||||
.join(","),
|
||||
id: this.data.id,
|
||||
});
|
||||
}
|
||||
|
||||
this.$message.success("核销成功");
|
||||
this.close();
|
||||
this.$emit("hexiaoSuccess");
|
||||
},
|
||||
open(res, types) {
|
||||
this.data = res;
|
||||
this.types = types?types:this.types;
|
||||
this.tableData = res.goods;
|
||||
this.show = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.user_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.name {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
::v-deep .el-input--small .el-input__inner {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
::v-deep .image-slot {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #efefef;
|
||||
font-size: 20px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.card {
|
||||
background-color: #f5f5f5;
|
||||
padding: 0 14px;
|
||||
|
||||
.title {
|
||||
font-size: 22px;
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
padding: 20px 0;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
|
||||
.t {
|
||||
text-align: center;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.n {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
padding-top: 6px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.gap-20 {
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="u-p-15">
|
||||
<div class="u-m-t-20">
|
||||
<el-form label-width="90px" label-position="left">
|
||||
<el-form-item label="总价">
|
||||
<el-form-item label="应付金额">
|
||||
<div class="color-red u-font-18 font-600">¥{{ form.money }}</div>
|
||||
<!-- <el-input :value="form.money" disabled> </el-input> -->
|
||||
</el-form-item>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,234 @@
|
|||
<template>
|
||||
<el-dialog title="绑定门店" width="450px" :visible.sync="show" >
|
||||
<div class="app-container">
|
||||
<!-- <div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<el-form-item label="">
|
||||
<el-input
|
||||
v-model="query.name"
|
||||
placeholder="请输入昵称或手机号"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<div class="flex gap-20">
|
||||
<el-button type="primary" @click="getTableData" size="medium"
|
||||
>搜索</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="head-container">
|
||||
<el-table
|
||||
:data="tableData.data"
|
||||
v-loading="tableData.loading"
|
||||
@cell-click="cellClick"
|
||||
>
|
||||
<el-table-column label="店铺名称" prop="poi_name"></el-table-column>
|
||||
<el-table-column label="店铺地址" prop="address"></el-table-column>
|
||||
<el-table-column label="操作" width="90" fixed="right">
|
||||
<template v-slot="scope">
|
||||
<el-button type="primary" size="mini" @click="choose(scope.row)"
|
||||
>绑定门店</el-button
|
||||
>
|
||||
<!-- <el-button type="text" @click="charge(scope.row)">充值</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
:total="tableData.total"
|
||||
:current-page="tableData.page + 1"
|
||||
:page-size="tableData.size"
|
||||
@size-change="sizeChange"
|
||||
@current-change="paginationChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { $douyin_storelist,$douyin_bindstore } from "@/api/coup/index";
|
||||
import { $returnMemberPointsList } from "@/api/table";
|
||||
import dayjs from "dayjs";
|
||||
let cacheData = {};
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
query: {},
|
||||
shopInfo: {
|
||||
balanceTotal: 0,
|
||||
userTotal: 0,
|
||||
chageTotal: 0,
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
timeFilter(s) {
|
||||
return dayjs(s).format("YYYY-MM-DD HH:mm:ss");
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
cellClick(user) {
|
||||
this.choose(user)
|
||||
},
|
||||
async choose(user) {
|
||||
this.$emit("chooseUser", user);
|
||||
const res= $douyin_bindstore({
|
||||
poi_id:user.poi_id,
|
||||
}).then(res=>{
|
||||
this.close()
|
||||
})
|
||||
console.log(user)
|
||||
},
|
||||
charge(user) {
|
||||
console.log(user);
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
open() {
|
||||
this.getTableData();
|
||||
this.show = true;
|
||||
},
|
||||
toPage(type) {
|
||||
const pages = {
|
||||
charge: "charge_list",
|
||||
cost: "cost_list",
|
||||
};
|
||||
this.$router.push({
|
||||
name: pages[type],
|
||||
});
|
||||
console.log(pages[type]);
|
||||
},
|
||||
// 获取商家用户概述信息
|
||||
|
||||
sizeChange() {
|
||||
this.tableData.page = 0;
|
||||
this.getTableData();
|
||||
},
|
||||
// 切换状态
|
||||
async statusChange(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true;
|
||||
const data = { ...row };
|
||||
data.status = e;
|
||||
await modityActivate(data);
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
this.tableData.loading = false;
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.name = "";
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await $douyin_storelist({
|
||||
...this.query,
|
||||
size: this.tableData.size,
|
||||
page: this.tableData.page + 1,
|
||||
});
|
||||
console.log(res);
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.list;
|
||||
this.tableData.total = res.count;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.user_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.name {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
::v-deep .el-input--small .el-input__inner {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
::v-deep .image-slot {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #efefef;
|
||||
font-size: 20px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.card {
|
||||
background-color: #f5f5f5;
|
||||
padding: 0 14px;
|
||||
|
||||
.title {
|
||||
font-size: 22px;
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
padding: 20px 0;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
|
||||
.t {
|
||||
text-align: center;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.n {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
padding-top: 6px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.gap-20 {
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
<span> {{ number }}</span>
|
||||
</slot>
|
||||
</div>
|
||||
<slot name="tips"></slot>
|
||||
<div class="number_list_box">
|
||||
<div class="yd-keyboard">
|
||||
<div class="mini-number-box1">
|
||||
|
|
@ -79,13 +80,18 @@ export default {
|
|||
default: false,
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
type: [Number,String],
|
||||
default: Infinity,
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
// 是否启用小数
|
||||
isFloat: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -102,14 +108,21 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
clearFunction() {
|
||||
if(this.isFloat){
|
||||
return this.keyboradAdd('.')
|
||||
}
|
||||
this.$emit("clear", this.number);
|
||||
},
|
||||
keyboradAdd(n) {
|
||||
if(n=='.'&& `${this.number}`.includes('.')){
|
||||
return
|
||||
}
|
||||
if (Number(this.number) == 0) {
|
||||
return (this.number = n);
|
||||
}
|
||||
const newval = this.number + n;
|
||||
if (newval > this.max) {
|
||||
console.log(newval)
|
||||
if (newval*1 > this.max*1) {
|
||||
return this.$message( this.maxTips);
|
||||
}
|
||||
this.number = newval;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,205 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
title="单品改价"
|
||||
width="410px"
|
||||
:visible.sync="show"
|
||||
@close="reset"
|
||||
:modal="modal"
|
||||
>
|
||||
<div class="u-m-t-30 u-flex">
|
||||
<div class="no-wrap u-m-r-20">价格更改</div>
|
||||
<el-input
|
||||
:min="min"
|
||||
:max="max"
|
||||
placeholder="减8.88元请输入8.88元"
|
||||
v-model="price"
|
||||
@blur="checkPrice"
|
||||
type="number"
|
||||
>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="u-m-t-16">
|
||||
<span class="color-red">*</span>
|
||||
<span>当前单品单价:{{max }}元</span>
|
||||
</div>
|
||||
|
||||
<div class="u-m-t-30">
|
||||
<div><span>更改原因</span> <span class="color-red">*</span></div>
|
||||
</div>
|
||||
|
||||
<div class="u-flex u-flex-wrap tags">
|
||||
<div
|
||||
class="tag"
|
||||
v-for="(tag, index) in tags"
|
||||
@click="changeSel(tag)"
|
||||
:key="index"
|
||||
:class="{ active: tag.checked }"
|
||||
>
|
||||
{{ tag.label }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="note"
|
||||
size="medium"
|
||||
placeholder="请输入自定义内容"
|
||||
></el-input>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<el-button size="medium" @click="close"> 取消 </el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { returnCartPrice } from "../util.js";
|
||||
import {$updatePrice} from '@/api/Instead';
|
||||
export default {
|
||||
props: {
|
||||
modal: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
vipUser:{
|
||||
type:Object,
|
||||
default:()=>{
|
||||
return {
|
||||
isVip:false,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
max: 0,
|
||||
min: 0,
|
||||
price: '',
|
||||
tagSel: -1,
|
||||
show: false,
|
||||
tags: [
|
||||
{ label: "顾客投诉质量", checked: false },
|
||||
{ label: "友情打折", checked: false },
|
||||
{ label: "临时活动", checked: false },
|
||||
],
|
||||
note: "",
|
||||
goods: {
|
||||
productId: -999,
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isSeatFee() {
|
||||
return returnIsSeatFee(this.goods);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
checkPrice(){
|
||||
if(this.price>this.max||this.price<0){
|
||||
this.$message.error(`改价的区间为${this.min}-${this.max}元`);
|
||||
}
|
||||
if(this.price>this.max){
|
||||
this.price=this.max;
|
||||
}
|
||||
if(this.price<0){
|
||||
this.price=0;
|
||||
}
|
||||
},
|
||||
changeSel(item) {
|
||||
item.checked = !item.checked;
|
||||
},
|
||||
reset() {
|
||||
this.note = "";
|
||||
this.number = 1;
|
||||
this.tags.map((v) => {
|
||||
v.checked = false;
|
||||
});
|
||||
console.log(this.number);
|
||||
},
|
||||
delTag(index) {
|
||||
this.tags.splice(index, 1);
|
||||
},
|
||||
addNote(tag) {
|
||||
if (this.note.length <= 0) {
|
||||
return (this.note = tag);
|
||||
}
|
||||
this.note = tag + "," + this.note;
|
||||
},
|
||||
open(item) {
|
||||
this.goods = item ? item : this.goods;
|
||||
this.max=returnCartPrice(this.goods,this.vipUser)
|
||||
this.show = true;
|
||||
if (item.productId != "-999") {
|
||||
|
||||
} else {
|
||||
this.price = item.discountSaleAmount||'';
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
this.number = 1;
|
||||
},
|
||||
async confirm() {
|
||||
const selTag = this.tags
|
||||
.filter((item) => item.checked)
|
||||
.map((item) => item.label)
|
||||
.join(",");
|
||||
const note = selTag + (this.note.length > 0 ? "," + this.note : "");
|
||||
if (!note) {
|
||||
return this.$message.error("请输入更改原因");
|
||||
}
|
||||
const res=await $updatePrice({
|
||||
cartId: this.goods.id,
|
||||
saleAmount:this.price,
|
||||
note:note,
|
||||
})
|
||||
this.$message.success("修改价格成功");
|
||||
this.close();
|
||||
this.$emit('updateCart',res)
|
||||
// this.$emit("confirm", { note: note, num: this.number });
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
margin-bottom: 14px;
|
||||
margin-top: 14px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
::v-deep .el-tag {
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
.tags {
|
||||
.tag {
|
||||
margin: 10px 10px 0 0;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
padding: 10px 13px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
&.active {
|
||||
color: #1890ff;
|
||||
background: #e8f4ff;
|
||||
border-color: #a3d3ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
::v-deep .el-dialog__body {
|
||||
color: #333;
|
||||
}
|
||||
::v-deep input::-webkit-outer-spin-button,
|
||||
::v-deep input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none !important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,357 @@
|
|||
<template>
|
||||
<div class="select_desk">
|
||||
<el-dialog width="410px" title="挂账" :visible.sync="show">
|
||||
<div class="guazhangren u-flex u-row-between" @click="guazhangShow">
|
||||
<template v-if="guazhangRen">
|
||||
<div>
|
||||
<div class="name">
|
||||
{{ guazhangRen.debtor }}/{{ guazhangRen.position }}
|
||||
</div>
|
||||
<div class="u-m-t-6">手机号:{{ guazhangRen.mobile }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="">可用额度</div>
|
||||
<div class="u-m-t-6">{{ guazhangRen.remainingAmount }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="color-999">选择挂账人/单位</div>
|
||||
<span class="el-icon-caret-bottom"></span>
|
||||
</template>
|
||||
</div>
|
||||
<div class="select_desk_dialog u-p-b-20">
|
||||
<key-board
|
||||
isCanEmpty
|
||||
v-model="number"
|
||||
isFloat
|
||||
@clear="clear"
|
||||
:max="payMoney"
|
||||
:maxTips="'超出未结账金额'"
|
||||
>
|
||||
<div slot="clear">.</div>
|
||||
<div
|
||||
|
||||
slot="tips"
|
||||
class="color-red w-full u-p-l-20 u-text-left u-m-t-10 u-m-b-30"
|
||||
>
|
||||
{{ tips }}
|
||||
</div>
|
||||
<div slot="input" class="u-p-l-20 u-p-r-20 u-flex w-full">
|
||||
<div class="font-bold u-font-32">¥</div>
|
||||
<el-input
|
||||
placeholder="请输入挂账金额"
|
||||
v-model="number"
|
||||
@input="inputNumber"
|
||||
@change="inputChange"
|
||||
@focus="inputFocus"
|
||||
@blur="inputBlur"
|
||||
:type="focus ? 'number' : 'text'"
|
||||
>
|
||||
</el-input>
|
||||
</div>
|
||||
</key-board>
|
||||
<div class="confirm_btns">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button type="primary" size="medium" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<choose-guazhang
|
||||
ref="refChooseGuazhang"
|
||||
@confirm="chooseGuazhangConfirm"
|
||||
></choose-guazhang>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import keyBoard from "./keyboard.vue";
|
||||
import chooseGuazhang from "./choose-guazhang.vue";
|
||||
export default {
|
||||
components: { keyBoard, chooseGuazhang },
|
||||
props: {
|
||||
payMoney: {
|
||||
type: [Number, String],
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
guazhangRen: "",
|
||||
number: "",
|
||||
show: false,
|
||||
hasOpen: false,
|
||||
loading: false,
|
||||
tips: "",
|
||||
focus: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
number(newval) {
|
||||
console.log(newval);
|
||||
if (newval * 1 > this.payMoney * 1) {
|
||||
this.number = this.payMoney;
|
||||
this.number = newval;
|
||||
}
|
||||
if (newval * 1 > this.payMoney * 1) {
|
||||
this.tips =
|
||||
"已超出未结账金额";
|
||||
} else {
|
||||
const shengyu=this.payMoney - this.number
|
||||
|
||||
this.tips =shengyu>0?
|
||||
"还需额外支付" + shengyu.toFixed(2) + "元":'';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
inputFocus() {
|
||||
this.focus = true;
|
||||
},
|
||||
inputBlur() {
|
||||
this.focus = false;
|
||||
},
|
||||
chooseGuazhangConfirm(e) {
|
||||
this.guazhangRen = e;
|
||||
},
|
||||
guazhangShow() {
|
||||
this.$refs.refChooseGuazhang.open();
|
||||
},
|
||||
|
||||
inputNumber(e) {
|
||||
console.log("inputNumber");
|
||||
if (e * 1 > this.payMoney * 1) {
|
||||
this.tips = "已超出未结账金额";
|
||||
}
|
||||
},
|
||||
inputChange(e) {
|
||||
if (e * 1 > this.payMoney * 1) {
|
||||
this.tips = "已超出未结账金额";
|
||||
}
|
||||
console.log(e);
|
||||
},
|
||||
clear(e) {
|
||||
console.log(e);
|
||||
this.number = "";
|
||||
},
|
||||
confirm() {
|
||||
if (this.number*1 > this.payMoney*1) {
|
||||
return this.$message("已超出未结账金额");
|
||||
}
|
||||
if (this.number * 1 <= 0) {
|
||||
return this.$message("支付金额不正确");
|
||||
}
|
||||
if (!this.guazhangRen) {
|
||||
return this.$message("请选择挂账人");
|
||||
}
|
||||
this.$emit("confirm",this.guazhangRen, this.number);
|
||||
this.close();
|
||||
},
|
||||
open(number) {
|
||||
this.number = this.payMoney*1
|
||||
this.show = true;
|
||||
this.tips = "还需额外支付" + this.payMoney + "元";
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
this.number = "";
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-button {
|
||||
padding: 12px 20px;
|
||||
}
|
||||
::v-deep .carts .box_status {
|
||||
margin-bottom: 0;
|
||||
margin-top: 30px;
|
||||
}
|
||||
::v-deep .select_desk_dialog .el-input__inner {
|
||||
border: none;
|
||||
font-size: 32px;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-button--success {
|
||||
border-color: #22bf64;
|
||||
background-color: #22bf64;
|
||||
}
|
||||
.select_desk .btn {
|
||||
height: 34px;
|
||||
}
|
||||
.tags {
|
||||
font-size: 16px;
|
||||
&.using {
|
||||
color: rgb(234, 64, 37);
|
||||
}
|
||||
&.wait {
|
||||
color: rgb(252, 236, 79);
|
||||
}
|
||||
&.idle {
|
||||
color: rgb(137, 234, 71);
|
||||
}
|
||||
&.closed {
|
||||
color: rgb(221, 221, 221);
|
||||
filter: grayscale(1);
|
||||
}
|
||||
}
|
||||
::v-deep .inputs .el-input__inner {
|
||||
border-color: transparent !important;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.select_desk .select_desk_dialog {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
width: 286px;
|
||||
height: 38px;
|
||||
background: #dcf0e8;
|
||||
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li,
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
border-radius: 4px;
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li {
|
||||
width: 140px;
|
||||
height: 34px;
|
||||
color: #0fc161;
|
||||
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .lion {
|
||||
background: #0fc161;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .inputs {
|
||||
width: 370px;
|
||||
line-height: 54px;
|
||||
margin-top: 24px;
|
||||
height: 54px;
|
||||
margin-bottom: 20px;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .inputs .close {
|
||||
color: #aaa;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
line-height: 30px;
|
||||
top: 50%;
|
||||
margin-top: -15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.guazhangren {
|
||||
padding: 12px 10px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
margin-top: 20px;
|
||||
min-height: 58px;
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
.name {
|
||||
color: #3f9eff;
|
||||
}
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard {
|
||||
display: flex;
|
||||
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
border-right: 1px solid #dcdfe6;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li {
|
||||
height: 60px;
|
||||
width: 33.333%;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
font-size: 24px;
|
||||
color: #212121;
|
||||
cursor: pointer;
|
||||
|
||||
user-select: none;
|
||||
border-left: 1px solid #dcdfe6;
|
||||
border-top: 1px solid #dcdfe6;
|
||||
|
||||
transition: all 0.1s;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li:hover {
|
||||
background: #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li .icon {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm {
|
||||
height: 140px;
|
||||
background: #ff9f2e;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm:hover {
|
||||
background: #f88502;
|
||||
}
|
||||
|
||||
.confirm_btns {
|
||||
display: flex;
|
||||
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.confirm_btns .el-button {
|
||||
width: 175px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -8,12 +8,20 @@
|
|||
<div>
|
||||
<div>将临时菜添加至购物车,不会影响总商品库</div>
|
||||
<div class="u-m-t-16">
|
||||
<el-form ref="form" :model="form" label-width="80px">
|
||||
<el-form-item label="菜品名称">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
|
||||
<el-form-item label="菜品名称" prop="name">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
placeholder="请输入菜品名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜品分类">
|
||||
<el-select v-model="form.category" filterable placeholder="选择分类">
|
||||
<el-form-item label="菜品分类" prop="categoryId">
|
||||
<el-select
|
||||
v-model="form.categoryId"
|
||||
@change="selectChange($event, 'form', 'categoryId')"
|
||||
filterable
|
||||
placeholder="选择分类"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in category"
|
||||
:key="item.id"
|
||||
|
|
@ -23,13 +31,22 @@
|
|||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="价格">
|
||||
<el-input v-model="form.price" placeholder="请输入价格" type="number">
|
||||
<template slot="append">元</template>
|
||||
<el-form-item label="价格" prop="price">
|
||||
<el-input
|
||||
v-model="form.price"
|
||||
placeholder="请输入价格"
|
||||
type="number"
|
||||
>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位">
|
||||
<el-select v-model="form.unit" filterable placeholder="选择单位">
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-select
|
||||
v-model="form.unit"
|
||||
filterable
|
||||
placeholder="选择单位"
|
||||
@change="selectChange($event, 'form', 'unit')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in units"
|
||||
:key="item.id"
|
||||
|
|
@ -39,13 +56,16 @@
|
|||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="下单数量">
|
||||
<el-input v-model="form.num" placeholder="请输入下单数量" type="number">
|
||||
<el-form-item label="下单数量" prop="num">
|
||||
<el-input
|
||||
v-model="form.num"
|
||||
placeholder="请输入下单数量"
|
||||
type="number"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.note" placeholder="请输入备注" >
|
||||
</el-input>
|
||||
<el-input v-model="form.note" placeholder="请输入备注"> </el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
|
@ -57,22 +77,32 @@
|
|||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { tbShopCategoryGet,tbShopUnit } from "@/api/shop";
|
||||
|
||||
import { tbShopCategoryGet, tbShopUnit } from "@/api/shop";
|
||||
import * as $InsteadApi from "@/api/Instead";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入菜品名称", trigger: "blur" }],
|
||||
categoryId: [
|
||||
{ required: true, message: "请选择菜品分类", trigger: "blur" },
|
||||
],
|
||||
price: [{ required: true, message: "请输入菜品价格", trigger: "blur" }],
|
||||
unit: [{ required: true, message: "请选择菜品单位", trigger: "blur" }],
|
||||
num: [{ required: true, message: "请输入下单数量", trigger: "blur" }],
|
||||
},
|
||||
form: {
|
||||
name: "",
|
||||
category:'',
|
||||
categoryId: "",
|
||||
price: "",
|
||||
unit:'',
|
||||
num:1,
|
||||
note:''
|
||||
unit: "",
|
||||
num: 1,
|
||||
note: "",
|
||||
},
|
||||
category:[],
|
||||
units:[]
|
||||
category: [],
|
||||
units: [],
|
||||
option:{}
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -96,24 +126,52 @@ export default {
|
|||
sort: "id",
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
});
|
||||
this.units = content
|
||||
this.units = content;
|
||||
},
|
||||
reset() {
|
||||
this.$refs.form.resetFields();
|
||||
},
|
||||
reset() {},
|
||||
|
||||
open() {
|
||||
open(opt) {
|
||||
this.show = true;
|
||||
this.option=opt
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
confirm() {
|
||||
this.$emit("confirm", this.form);
|
||||
|
||||
//解决selectc值改变后未验证问题
|
||||
selectChange($event, ref, type) {
|
||||
// this.$refs[ref][0].validateField(type)
|
||||
this.$refs[ref].validateField(type);
|
||||
},
|
||||
async submit() {
|
||||
const res = await $InsteadApi.$temporaryDishes({...this.option,...this.form});
|
||||
console.log(res);
|
||||
this.$notify({
|
||||
title: "临时菜添加成功",
|
||||
type: "success",
|
||||
});
|
||||
this.$emit("updateCart");
|
||||
this.close();
|
||||
},
|
||||
confirm() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(valid);
|
||||
// this.$emit("confirm", this.form);
|
||||
// this.close();
|
||||
this.submit();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getCategory()
|
||||
this.getUnit()
|
||||
this.getCategory();
|
||||
this.getUnit();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -131,7 +189,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,225 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog width="400px" :title="title" :visible.sync="show" @close="reset">
|
||||
<div class="u-p-15">
|
||||
<div v-if="openSwitch">
|
||||
<el-button
|
||||
size="medium"
|
||||
@click="changeKey('paysSel', index)"
|
||||
v-for="(item, index) in pays"
|
||||
:key="index"
|
||||
:type="paysSel == index ? 'primary' : ''"
|
||||
>{{ item.text }}</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-alert
|
||||
:closable="false"
|
||||
v-if="tips"
|
||||
:title="tips"
|
||||
type="warning"
|
||||
show-icon
|
||||
>
|
||||
</el-alert>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-form label-width="90px" label-position="left">
|
||||
<el-form-item label="券码">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
@change="codeInputChange"
|
||||
placeholder="请扫码或者输入券码"
|
||||
ref="refInputCode"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<div class="u-flex u-row-center u-m-t-50">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<bind-shop ref="refBindShop"></bind-shop>
|
||||
<choose-goods
|
||||
ref="refChooseGoods"
|
||||
@hexiaoSuccess="hexiaoSuccess"
|
||||
></choose-goods>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import * as $Api from "@/api/coup/index.js";
|
||||
import { tbOrderInfoDetail } from "@/api/order";
|
||||
import bindShop from "./douyin-quan-bind-shop.vue";
|
||||
import chooseGoods from "./choose-quan-goods.vue";
|
||||
export default {
|
||||
components: { bindShop, chooseGoods },
|
||||
props: {
|
||||
openSwitch: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
order: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "团购券核销",
|
||||
},
|
||||
price: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
defaultTips: {
|
||||
type: String,
|
||||
default: "请使用扫码枪扫描付券码",
|
||||
},
|
||||
},
|
||||
filters: {
|
||||
to2(n) {
|
||||
return n.toFixed(2);
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tips: "",
|
||||
paysSel: 0,
|
||||
form: {
|
||||
code: "",
|
||||
},
|
||||
pays: [
|
||||
{
|
||||
text: "美团",
|
||||
},
|
||||
{
|
||||
text: "抖音",
|
||||
},
|
||||
],
|
||||
show: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
defaultTips(val) {
|
||||
this.tips = val;
|
||||
},
|
||||
price(val) {
|
||||
console.log(val);
|
||||
this.form.money = Number(val).toFixed(2);
|
||||
},
|
||||
number(newval) {
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
refChooseGoodsOpen(data,types) {
|
||||
this.$refs.refChooseGoods.open(data,types);
|
||||
},
|
||||
refBindShopOpen() {
|
||||
this.$refs.refBindShop.open();
|
||||
},
|
||||
clear() {
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
hexiaoSuccess() {
|
||||
this.reset();
|
||||
this.close();
|
||||
},
|
||||
async getOrderDetail() {
|
||||
const res = await tbOrderInfoDetail(this.order.id);
|
||||
if (res.status == "closed") {
|
||||
this.clear();
|
||||
this.$emit("paySuccess");
|
||||
}
|
||||
},
|
||||
codeInputChange(e) {
|
||||
console.log(e);
|
||||
// this.$emit("confirm", this.form.code);
|
||||
},
|
||||
reset() {
|
||||
// this.form.money=''
|
||||
this.form.code = "";
|
||||
this.paysSel = 0;
|
||||
this.clear();
|
||||
},
|
||||
changeKey(key, val) {
|
||||
this[key] = val;
|
||||
},
|
||||
|
||||
async confirm() {
|
||||
if (!this.form.code) {
|
||||
return this.$message.error("请输入或扫付券码");
|
||||
}
|
||||
|
||||
if (this.paysSel == 1) {
|
||||
//抖音
|
||||
const res = await $Api.$douyin_fulfilmentcertificateprepare({
|
||||
object_id: this.form.code,
|
||||
});
|
||||
if (res.code == 4399) {
|
||||
this.refBindShopOpen();
|
||||
}
|
||||
if (res) {
|
||||
this.refChooseGoodsOpen(res);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this.paysSel == 0) {
|
||||
//美团
|
||||
const res = await $Api.$meituan_searchstorestatus({
|
||||
});
|
||||
if(res.status==0){
|
||||
const res2 = await $Api.$meituan_getuisdkurl({
|
||||
});
|
||||
window.open(res2);
|
||||
return;
|
||||
}
|
||||
const res1 = await $Api.$meituan_fulfilmentcertificateprepare({
|
||||
code: this.form.code,
|
||||
});
|
||||
if(res1){
|
||||
const types='meituan'
|
||||
this.refChooseGoodsOpen(res1,types);
|
||||
}
|
||||
}
|
||||
// this.$message.success("核销成功");
|
||||
},
|
||||
open(data) {
|
||||
this.show = true;
|
||||
$Api.$douyin_checkIn().then((res) => {
|
||||
console.log(res);
|
||||
localStorage.setItem("bausertoken", res.userInfo.token);
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refInputCode.focus();
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
numberInput(val) {
|
||||
console.log(val);
|
||||
this.number = `${Number(val)}`;
|
||||
},
|
||||
keyboradConfirm() {
|
||||
this.$emit("confirm", this.number);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
this.tips = this.defaultTips;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.codeImg {
|
||||
width: 164px;
|
||||
border: 1px solid rgb(220, 223, 230);
|
||||
height: 164px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,165 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog width="400px" :title="title" :visible.sync="show" @close="reset">
|
||||
<div class="u-p-15">
|
||||
<div class="u-m-t-20">
|
||||
<el-alert
|
||||
:closable="false"
|
||||
v-if="tips"
|
||||
:title="tips"
|
||||
type="warning"
|
||||
show-icon
|
||||
>
|
||||
</el-alert>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<template>
|
||||
<el-form label-width="90px" label-position="left">
|
||||
<el-form-item label="团购代金券">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
@change="codeInputChange"
|
||||
placeholder="请扫码或者输入付款码"
|
||||
ref="refInputCode"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<div class="u-flex u-row-center u-m-t-50">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog width="400px" title="团购券商品" :visible.sync="tuanGoodsShow">
|
||||
<tuan-quan-table
|
||||
:data="canDikouGoods"
|
||||
ref="refGoodsTable"
|
||||
></tuan-quan-table>
|
||||
<div class="u-flex u-row-center u-m-t-30 u-p-b-20">
|
||||
<el-button size="medium" @click="tuanGoodsShow = false">取消</el-button>
|
||||
<el-button size="medium" type="primary" @click="tuanGoodsConfirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { $thirdPartyCoupon } from "@/api/Instead";
|
||||
import tuanQuanTable from "./tuan-quan-table.vue";
|
||||
|
||||
export default {
|
||||
components: { tuanQuanTable },
|
||||
props: {
|
||||
cartGoods: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "团购代金券核销",
|
||||
},
|
||||
},
|
||||
filters: {
|
||||
to2(n) {
|
||||
return n.toFixed(2);
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
canDikouGoods: [],
|
||||
tuanQuan: {
|
||||
goods: [],
|
||||
},
|
||||
tuanGoodsShow: false,
|
||||
tips: "请使用扫码枪扫描团购代金券",
|
||||
form: {
|
||||
money: "",
|
||||
code: "",
|
||||
},
|
||||
number: "0",
|
||||
show: false,
|
||||
timer: null,
|
||||
payPar: {},
|
||||
selGoodsArr: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
defaultTips(val) {
|
||||
this.tips = val;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
codeInputChange(e) {
|
||||
console.log(e);
|
||||
// this.$emit("confirm", this.form.code);
|
||||
},
|
||||
reset() {
|
||||
this.tuanQuan = {
|
||||
goods: [],
|
||||
};
|
||||
this.form.code = "";
|
||||
this.selGoodsArr = [];
|
||||
},
|
||||
tuanGoodsConfirm() {
|
||||
const selGoods = this.$refs.refGoodsTable.getSelectRows();
|
||||
if (selGoods.length == 0) {
|
||||
return this.$message.error("请选择商品");
|
||||
}
|
||||
this.$emit("confirm", {
|
||||
...this.tuanQuan,
|
||||
goods: selGoods,
|
||||
});
|
||||
this.tuanGoodsShow = false;
|
||||
this.show = false;
|
||||
},
|
||||
async confirm() {
|
||||
if (!this.form.code) {
|
||||
return this.$message.error("请输入或扫团购代金券");
|
||||
}
|
||||
const res = await $thirdPartyCoupon({
|
||||
code: this.form.code,
|
||||
});
|
||||
this.tuanQuan = res;
|
||||
this.tuanGoodsShow = true;
|
||||
console.log(res);
|
||||
// this.close();
|
||||
// this.$emit("confirm", this.form.code);
|
||||
},
|
||||
open(data) {
|
||||
this.show = true;
|
||||
this.canDikouGoods=this.cartGoods.filter(item=>item.productId!='-999')
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refInputCode.focus();
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
numberInput(val) {
|
||||
console.log(val);
|
||||
this.number = `${Number(val)}`;
|
||||
},
|
||||
keyboradConfirm() {
|
||||
this.$emit("confirm", this.number);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
this.tips = this.defaultTips;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.codeImg {
|
||||
width: 164px;
|
||||
border: 1px solid rgb(220, 223, 230);
|
||||
height: 164px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,343 @@
|
|||
<template>
|
||||
<div class="select_desk">
|
||||
<el-dialog width="410px" title="套餐" :visible.sync="show">
|
||||
<div class="select_desk_dialog u-p-b-20">
|
||||
<key-board isCanEmpty v-model="number" isFloat @clear="clear">
|
||||
<div slot="clear">.</div>
|
||||
<div
|
||||
slot="input"
|
||||
class="u-font-14 u-row-between u-flex w-full u-text-left"
|
||||
>
|
||||
<div class="">
|
||||
<div>单价</div>
|
||||
<div class="u-m-t-10">
|
||||
<el-tag type="primary" size="medium">¥1/克</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="u-font-14">重量</div>
|
||||
<div class="u-m-t-10">
|
||||
<el-input
|
||||
placeholder="请输入挂账金额"
|
||||
v-model="number"
|
||||
@input="inputNumber"
|
||||
@change="inputChange"
|
||||
@focus="inputFocus"
|
||||
@blur="inputBlur"
|
||||
:type="focus ? 'number' : 'text'"
|
||||
>
|
||||
<template slot="append">克</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</key-board>
|
||||
<div class="price u-text-left w-full">¥ {{ 11 }}</div>
|
||||
|
||||
<div class="confirm_btns u-flex u-m-t-20">
|
||||
<el-button style="width: 100%;" type="primary" size="medium" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<choose-guazhang
|
||||
ref="refChooseGuazhang"
|
||||
@confirm="chooseGuazhangConfirm"
|
||||
></choose-guazhang>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import keyBoard from "./keyboard.vue";
|
||||
import chooseGuazhang from "./choose-guazhang.vue";
|
||||
export default {
|
||||
components: { keyBoard, chooseGuazhang },
|
||||
props: {
|
||||
payMoney: {
|
||||
type: [Number, String],
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
guazhangRen: "",
|
||||
number: "",
|
||||
show: false,
|
||||
hasOpen: false,
|
||||
loading: false,
|
||||
tips: "",
|
||||
focus: false,
|
||||
data:{}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
number(newval) {
|
||||
console.log(newval);
|
||||
if (newval * 1 > this.payMoney * 1) {
|
||||
this.number = this.payMoney;
|
||||
this.number = newval;
|
||||
}
|
||||
if (newval * 1 > this.payMoney * 1) {
|
||||
this.tips = "已超出未结账金额";
|
||||
} else {
|
||||
const shengyu = this.payMoney - this.number;
|
||||
|
||||
this.tips =
|
||||
shengyu > 0 ? "还需额外支付" + shengyu.toFixed(2) + "元" : "";
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
inputFocus() {
|
||||
this.focus = true;
|
||||
},
|
||||
inputBlur() {
|
||||
this.focus = false;
|
||||
},
|
||||
chooseGuazhangConfirm(e) {
|
||||
this.guazhangRen = e;
|
||||
},
|
||||
guazhangShow() {
|
||||
this.$refs.refChooseGuazhang.open();
|
||||
},
|
||||
|
||||
inputNumber(e) {
|
||||
console.log("inputNumber");
|
||||
if (e * 1 > this.payMoney * 1) {
|
||||
this.tips = "已超出未结账金额";
|
||||
}
|
||||
},
|
||||
inputChange(e) {
|
||||
if (e * 1 > this.payMoney * 1) {
|
||||
this.tips = "已超出未结账金额";
|
||||
}
|
||||
console.log(e);
|
||||
},
|
||||
clear(e) {
|
||||
console.log(e);
|
||||
this.number = "";
|
||||
},
|
||||
confirm() {
|
||||
if (this.number * 1 > this.payMoney * 1) {
|
||||
return this.$message("已超出未结账金额");
|
||||
}
|
||||
if (this.number * 1 <= 0) {
|
||||
return this.$message("支付金额不正确");
|
||||
}
|
||||
if (!this.guazhangRen) {
|
||||
return this.$message("请选择挂账人");
|
||||
}
|
||||
this.$emit("confirm", this.guazhangRen, this.number);
|
||||
this.close();
|
||||
},
|
||||
open(number) {
|
||||
this.number = this.payMoney * 1;
|
||||
this.show = true;
|
||||
this.tips = "还需额外支付" + this.payMoney + "元";
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
this.number = "";
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-button {
|
||||
padding: 12px 20px;
|
||||
}
|
||||
::v-deep .carts .box_status {
|
||||
border: none;
|
||||
}
|
||||
::v-deep .select_desk_dialog .el-input__inner {
|
||||
// border: none;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-button--success {
|
||||
border-color: #22bf64;
|
||||
background-color: #22bf64;
|
||||
}
|
||||
.select_desk .btn {
|
||||
height: 34px;
|
||||
}
|
||||
.tags {
|
||||
font-size: 16px;
|
||||
&.using {
|
||||
color: rgb(234, 64, 37);
|
||||
}
|
||||
&.wait {
|
||||
color: rgb(252, 236, 79);
|
||||
}
|
||||
&.idle {
|
||||
color: rgb(137, 234, 71);
|
||||
}
|
||||
&.closed {
|
||||
color: rgb(221, 221, 221);
|
||||
filter: grayscale(1);
|
||||
}
|
||||
}
|
||||
::v-deep .inputs .el-input__inner {
|
||||
border-color: transparent !important;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.select_desk .select_desk_dialog {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
width: 286px;
|
||||
height: 38px;
|
||||
background: #dcf0e8;
|
||||
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li,
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
border-radius: 4px;
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li {
|
||||
width: 140px;
|
||||
height: 34px;
|
||||
color: #0fc161;
|
||||
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .lion {
|
||||
background: #0fc161;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .inputs {
|
||||
width: 370px;
|
||||
line-height: 54px;
|
||||
margin-top: 24px;
|
||||
height: 54px;
|
||||
margin-bottom: 20px;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
position: relative;
|
||||
}
|
||||
.price {
|
||||
font-size: 18px;
|
||||
text-align: left;
|
||||
color: rgb(255, 81, 82);
|
||||
font-weight: 600;
|
||||
}
|
||||
.select_desk .select_desk_dialog .inputs .close {
|
||||
color: #aaa;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
line-height: 30px;
|
||||
top: 50%;
|
||||
margin-top: -15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.guazhangren {
|
||||
padding: 12px 10px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
margin-top: 20px;
|
||||
min-height: 58px;
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
.name {
|
||||
color: #3f9eff;
|
||||
}
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard {
|
||||
display: flex;
|
||||
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
border-right: 1px solid #dcdfe6;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li {
|
||||
height: 60px;
|
||||
width: 33.333%;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
font-size: 24px;
|
||||
color: #212121;
|
||||
cursor: pointer;
|
||||
|
||||
user-select: none;
|
||||
border-left: 1px solid #dcdfe6;
|
||||
border-top: 1px solid #dcdfe6;
|
||||
|
||||
transition: all 0.1s;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li:hover {
|
||||
background: #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li .icon {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm {
|
||||
height: 140px;
|
||||
background: #ff9f2e;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm:hover {
|
||||
background: #f88502;
|
||||
}
|
||||
|
||||
.confirm_btns {
|
||||
display: flex;
|
||||
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.confirm_btns .el-button {
|
||||
width: 175px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -286,11 +286,13 @@ export default {
|
|||
//相同商品抵扣券数组
|
||||
const arr = this.quans.productCoupon.filter((v) => v.proId == row.proId);
|
||||
const index = arr.findIndex((v) => v.id == row.id);
|
||||
const item=this.goodsArr.find((v) => v.productId == row.proId);
|
||||
if (index != -1) {
|
||||
const n=returnProductCoupAllPrice(
|
||||
$goodsPayPriceMap[row.proId],
|
||||
index,
|
||||
row.num
|
||||
row.num,
|
||||
item.isMember
|
||||
)
|
||||
return (n*this.discount).toFixed(2);
|
||||
} else {
|
||||
|
|
@ -385,7 +387,7 @@ export default {
|
|||
.catch(() => {});
|
||||
}
|
||||
if (this.fullReductionCouponSel.fullAmount > payPrice) {
|
||||
this.$confirm(
|
||||
this.$confirm(
|
||||
"选择该商品券后将不满足选择抵扣券的最低满减需求,继续选择将取消选择的满减券",
|
||||
"提示",
|
||||
{
|
||||
|
|
@ -399,7 +401,11 @@ export default {
|
|||
id: "",
|
||||
};
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
item.checked=false
|
||||
const index = this.quansSelArr.findIndex((v) => v.id == item.id);
|
||||
this.quansSelArr.splice(index, 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
item.checked = !item.checked;
|
||||
|
|
@ -441,7 +447,6 @@ export default {
|
|||
async open(data, propSelCoup) {
|
||||
console.log(data);
|
||||
this.orderPrice = data.orderPrice;
|
||||
this.discount=data.discount||1
|
||||
this.quansSelArr = [...propSelCoup];
|
||||
$goodsPayPriceMap = returnGoodsPayPriceMap(this.goodsArr || []);
|
||||
if (data.memberId) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="data"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
@cell-click="cellClick"
|
||||
>
|
||||
<template v-if="type == 'edit'">
|
||||
<el-table-column type="selection" width="55"> </el-table-column>
|
||||
</template>
|
||||
<el-table-column
|
||||
prop="productName"
|
||||
label="商品名称"
|
||||
width="100"
|
||||
></el-table-column>
|
||||
<el-table-column prop="price" label="商品单价"></el-table-column>
|
||||
<el-table-column prop="num" label="商品数量"></el-table-column>
|
||||
<el-table-column prop="priceAmount" label="商品总价"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
type: {
|
||||
type: String, //edit show
|
||||
default: "edit",
|
||||
},
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selArr: [],
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
|
||||
},
|
||||
methods: {
|
||||
getSelectRows() {
|
||||
return this.selArr;
|
||||
},
|
||||
handleSelectionChange(e) {
|
||||
if (this.type == "edit") {
|
||||
this.selArr = e;
|
||||
}
|
||||
},
|
||||
cellClick(row) {
|
||||
if (this.type == "edit") {
|
||||
this.$refs.table.toggleRowSelection(row);
|
||||
}
|
||||
console.log(row);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -83,6 +83,13 @@
|
|||
{{ table ? "桌台号:" + table.name : "选择桌号" }}
|
||||
</div>
|
||||
</el-popover>
|
||||
|
||||
<div class="u-m-l-28">
|
||||
<el-button
|
||||
type="warning"
|
||||
@click="refQuanHexiaoOpen"
|
||||
>扫码验券</el-button>
|
||||
</div>
|
||||
<!-- 先付后付start -->
|
||||
<!-- <el-dropdown @command="changePostPay">
|
||||
<el-button plain type="primary" size="mini">
|
||||
|
|
@ -100,6 +107,7 @@
|
|||
</el-button> -->
|
||||
|
||||
<!-- 先付后付end -->
|
||||
|
||||
<span
|
||||
@click="toggleFullScreen"
|
||||
class="flex flex-xy-center cur-pointer full-screen"
|
||||
|
|
@ -399,11 +407,18 @@
|
|||
<div slot="content">
|
||||
<div
|
||||
class="u-flex color-000 u-font-14 u-row-between"
|
||||
v-if="vipDiscountPrice > 0"
|
||||
v-if="vipDiscountPrice * 1 > 0"
|
||||
>
|
||||
<span class="font-bold">会员优惠 </span>
|
||||
<span class="">{{ vipDiscountPrice }} </span>
|
||||
</div>
|
||||
<div
|
||||
class="u-flex color-000 u-font-14 u-row-between"
|
||||
v-if="discountSaleAmount * 1 > 0"
|
||||
>
|
||||
<span class="font-bold">单品改价优惠 </span>
|
||||
<span class="">{{ discountSaleAmount }} </span>
|
||||
</div>
|
||||
</div>
|
||||
<span> 已优惠¥{{ youhuiAllPrice }} </span>
|
||||
<i class="el-icon-arrow-right"></i>
|
||||
|
|
@ -500,7 +515,7 @@
|
|||
<el-button
|
||||
size="medium"
|
||||
:disabled="
|
||||
!order.list.length && !order.old.list.length
|
||||
!order.list.length && order.old.list.length <= 0
|
||||
"
|
||||
@click="toCreateOrderDebounce(true)"
|
||||
>
|
||||
|
|
@ -639,21 +654,36 @@
|
|||
>
|
||||
退菜
|
||||
</div>
|
||||
<!-- <div
|
||||
<div
|
||||
@click="orderBtnsClick('print')"
|
||||
:class="{ disabled: order.selIndex < 0 }"
|
||||
class="btn"
|
||||
>
|
||||
{{ returnPrintText }}
|
||||
|
||||
</div>
|
||||
<div
|
||||
@click="refPopChangePriceShow"
|
||||
:class="{ disabled: order.selIndex < 0 }"
|
||||
class="btn"
|
||||
>
|
||||
单品改价
|
||||
</div>
|
||||
<div
|
||||
class="btn"
|
||||
@click="orderBtnsClick('isWaitCall')"
|
||||
:class="{ disabled: order.selIndex < 0 }"
|
||||
>
|
||||
等叫
|
||||
{{ returnWaingText }}
|
||||
</div>
|
||||
<div
|
||||
class="btn no-wrap u-font-12"
|
||||
@click="orderBtnsClick('AllWaitCall')"
|
||||
:class="{ disabled: isCreateOrder}"
|
||||
|
||||
>
|
||||
取消全部等叫
|
||||
</div> -->
|
||||
{{ returnWaingAllText }}
|
||||
</div>
|
||||
|
||||
<!-- <div
|
||||
class="btn"
|
||||
|
|
@ -713,7 +743,7 @@
|
|||
</div>
|
||||
<template v-if="goods.list.length">
|
||||
<div class="goods-list">
|
||||
<!-- <div
|
||||
<div
|
||||
@click="lingshicaiShow"
|
||||
class="goods-item lingshicai text-center color-999"
|
||||
:class="{
|
||||
|
|
@ -723,7 +753,7 @@
|
|||
>
|
||||
<span class="el-icon-plus" style="font-size: 26px"></span>
|
||||
<div class="u-m-t-10">临时菜</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div
|
||||
class="goods-item"
|
||||
:class="{
|
||||
|
|
@ -786,7 +816,10 @@
|
|||
<span>{{ item | returntypeName }}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="name">{{ item.name }}</div>
|
||||
<div class="name u-flex u-flex-wrap">
|
||||
<span class="weight" v-if="item.type=='weigh'">称重</span>
|
||||
<span> {{ item.name }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<template v-if="layout.sel === 'text'">
|
||||
<div class="text-sell-out flex">
|
||||
|
|
@ -933,8 +966,35 @@
|
|||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="u-flex flex-wrap">
|
||||
<span class="font-bold no-wrap">团购代金券</span>
|
||||
<div
|
||||
class="border u-p-l-20 cur-pointer u-m-r-20 u-flex no-wrap u-p-t-10 u-p-b-10 border-r-4 selQuan"
|
||||
@click="shouwTuanQuan"
|
||||
>
|
||||
<span class="color-999 u-p-r-10">代金券名称</span>
|
||||
<span
|
||||
class="el-icon-arrow-down color-999 u-m-r-10"
|
||||
></span>
|
||||
</div>
|
||||
<img
|
||||
style="width: 30px; height: 30px"
|
||||
class="cur-pointer"
|
||||
@click="shouwTuanQuan"
|
||||
src="@/assets/images/scan.png"
|
||||
/>
|
||||
<!-- <el-button size="medium " type="text">
|
||||
查看不可用券
|
||||
</el-button> -->
|
||||
</div>
|
||||
<template v-if="tuanQuan">
|
||||
<tuan-quan-table
|
||||
:data="tuanQuan.goods"
|
||||
type="show"
|
||||
ref="refGoodsTable"
|
||||
></tuan-quan-table>
|
||||
</template>
|
||||
<div class="u-flex flex-wrap u-m-t-20">
|
||||
<span class="font-bold no-wrap">优惠券</span>
|
||||
<div
|
||||
class="border u-p-l-20 cur-pointer u-m-r-20 u-flex no-wrap u-p-t-10 u-p-b-10 border-r-4 selQuan"
|
||||
|
|
@ -945,6 +1005,7 @@
|
|||
class="el-icon-arrow-down color-999 u-m-r-10"
|
||||
></span>
|
||||
</div>
|
||||
|
||||
<!-- <el-button size="medium " type="text">
|
||||
查看不可用券
|
||||
</el-button> -->
|
||||
|
|
@ -1019,6 +1080,9 @@
|
|||
:disabledPayType="disabledPayType"
|
||||
>
|
||||
</pay-type>
|
||||
<el-button
|
||||
:disabled="disabledPayType.includes('creditBuyer')"
|
||||
@click="guazhangShow" size="medium">挂账</el-button>
|
||||
<div style="margin-top: 20px">
|
||||
<el-button type="primary" size="medium" @click="payOrder">
|
||||
<span>立即支付</span>
|
||||
|
|
@ -1065,16 +1129,11 @@
|
|||
</div>
|
||||
<div class="detail_form_item">
|
||||
<div class="left">积分抵扣</div>
|
||||
<div class="right">-¥{{ points.toMoney | to2 }}</div>
|
||||
<div class="right">-¥{{ pointsDiscountAmount | to2 }}</div>
|
||||
</div>
|
||||
<div class="detail_form_item">
|
||||
<div class="left">整单改价</div>
|
||||
<div class="right">
|
||||
-¥{{
|
||||
((1 - createOrder.discount) * createOrder.data.amount)
|
||||
| to2
|
||||
}}
|
||||
</div>
|
||||
<div class="right">-¥{{ gaijia | to2 }}</div>
|
||||
</div>
|
||||
<div class="detail_form_item" v-if="createOrder.data.packFee">
|
||||
<div class="left">打包费</div>
|
||||
|
|
@ -1418,7 +1477,35 @@
|
|||
></return-cart>
|
||||
|
||||
<!-- 临时菜 -->
|
||||
<cai-add ref="refPopAddCai"></cai-add>
|
||||
<cai-add ref="refPopAddCai" @updateCart="getCart"></cai-add>
|
||||
<!-- 单品改价 -->
|
||||
<cart-change-price
|
||||
ref="refPopChangePrice"
|
||||
:vipUser="vipUser"
|
||||
@updateCart="updateCartItem"
|
||||
></cart-change-price>
|
||||
<!-- 用户选择团购券 -->
|
||||
<pop-tuan-quan
|
||||
:cartGoods="createOrder.data.detailList || []"
|
||||
ref="refPopTuanQuan"
|
||||
@confirm="tuanQuanConfirm"
|
||||
></pop-tuan-quan>
|
||||
<!-- 美团/抖音团购券核销 -->
|
||||
<pop-quan-hexiao ref="refQuanHexiao">
|
||||
</pop-quan-hexiao>
|
||||
<!-- 挂账 -->
|
||||
<popup-choose-guazhang
|
||||
ref="refGuaZhang"
|
||||
:payMoney="yinFuJinE"
|
||||
@confirm="guazhangPayConfirm"
|
||||
></popup-choose-guazhang>
|
||||
|
||||
<!-- 称重商品 -->
|
||||
<popup-weight-goods
|
||||
ref="refWeightGoods"
|
||||
@confirm="refWeightGoodsConfirm"
|
||||
>
|
||||
</popup-weight-goods>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -1436,6 +1523,13 @@ import chooseDinersNumber from "./components/choose-diners-number.vue";
|
|||
import returnCart from "./components/return-cart.vue";
|
||||
import moneyKeyboard from "./components/money-keyboard.vue";
|
||||
import caiAdd from "./components/popup-linshiCai.vue";
|
||||
import cartChangePrice from "./components/popup-cart-changePrice.vue";
|
||||
import popTuanQuan from "./components/popup-tuan-quan.vue";
|
||||
import popQuanHexiao from "./components/popup-quan-hexiao.vue";
|
||||
import tuanQuanTable from "./components/tuan-quan-table.vue";
|
||||
import popupChooseGuazhang from "./components/popup-choose-guazhang.vue";
|
||||
import popupWeightGoods from "./components/popup-weight-goods.vue";
|
||||
|
||||
import dayjs from "dayjs";
|
||||
import { tbShopInfo } from "@/api/user";
|
||||
import { hasPermission } from "@/utils/limits.js";
|
||||
|
|
@ -1468,7 +1562,9 @@ import {
|
|||
$calcUsablePoints,
|
||||
$calcDeDuctionPoints,
|
||||
} from "@/api/table";
|
||||
|
||||
import { tbShopCategoryGet } from "@/api/shop";
|
||||
import { $checkCoupon,$waitCall } from "@/api/Instead";
|
||||
import {
|
||||
isCanBuy,
|
||||
arrayContainsAll,
|
||||
|
|
@ -1485,10 +1581,15 @@ import { returnProductCoupAllPrice } from "./quan_util.js";
|
|||
//商品数量从0到n每一个对应的价格
|
||||
let $goodsPayPriceMap = {};
|
||||
import { $status } from "@/utils/table.js";
|
||||
import PopupChooseGuazhang from "./components/popup-choose-guazhang.vue";
|
||||
|
||||
let $originTableList = [];
|
||||
export default {
|
||||
components: {
|
||||
components: {popupWeightGoods,popQuanHexiao,
|
||||
popupChooseGuazhang,
|
||||
cartChangePrice,
|
||||
popTuanQuan,
|
||||
tuanQuanTable,
|
||||
caiAdd,
|
||||
quansPop,
|
||||
returnCart,
|
||||
|
|
@ -1501,9 +1602,12 @@ export default {
|
|||
moneyDiscount,
|
||||
cartItem,
|
||||
chooseDinersNumber,
|
||||
PopupChooseGuazhang,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//挂账人
|
||||
guazhangRen: "",
|
||||
disabledPayType: [],
|
||||
//积分抵扣
|
||||
points: {
|
||||
|
|
@ -1517,6 +1621,8 @@ export default {
|
|||
value: 0,
|
||||
toMoney: 0,
|
||||
},
|
||||
//团购券
|
||||
tuanQuan: "",
|
||||
//选中可用优惠券
|
||||
quansSelArr: [],
|
||||
//台桌搜索文字
|
||||
|
|
@ -1715,9 +1821,49 @@ export default {
|
|||
},
|
||||
},
|
||||
timer: null,
|
||||
isAllWaitCall: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
returnPrintText(){
|
||||
if (this.order.selIndex < 0) {
|
||||
return "免厨打";
|
||||
}
|
||||
return this.order.list[this.order.selIndex].isPrint
|
||||
? "免厨打"
|
||||
: "打印";
|
||||
},
|
||||
returnWaingText() {
|
||||
if (this.order.selIndex < 0) {
|
||||
return "等叫";
|
||||
}
|
||||
return this.order.list[this.order.selIndex].isWaitCall == 1
|
||||
? "取消等叫"
|
||||
: "等叫";
|
||||
},
|
||||
isHasWaiting() {
|
||||
const waitingArr = this.order.list.filter((v) => v.isWaitCall == 1);
|
||||
return waitingArr.length > 0 ? true : false;
|
||||
},
|
||||
returnWaingAllText() {
|
||||
return this.isAllWaitCall ? "取消全部等叫" : "整单等叫";
|
||||
},
|
||||
pointsDiscountAmount() {
|
||||
if (this.points.selected) {
|
||||
return this.points.toMoney;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
gaijia() {
|
||||
const disCountOriginPrice =
|
||||
this.createOrder.data.amount - this.coupdiscount;
|
||||
const disocunt = (1 - this.createOrder.discount) * disCountOriginPrice;
|
||||
return disocunt.toFixed(2);
|
||||
},
|
||||
pointsCanDicountMoney() {
|
||||
return (this.yinFuJinE - this.points.toMoney).toFixed(2);
|
||||
},
|
||||
isShowVipPrice() {
|
||||
if (!this.shopInfo.isMemberPrice) {
|
||||
return false;
|
||||
|
|
@ -1725,44 +1871,22 @@ export default {
|
|||
return this.vipUser.isVip ? true : false;
|
||||
},
|
||||
coupdiscount() {
|
||||
return (this.createOrder.discount*returnCouponAllPrice(
|
||||
this.quansSelArr,
|
||||
this.createOrder.data.detailList || [],
|
||||
this.vipUser
|
||||
)).toFixed(2)
|
||||
const n = this.quansSelArr.reduce((prve, cur) => {
|
||||
return prve + cur.discountAmount * 1;
|
||||
}, 0);
|
||||
return n;
|
||||
},
|
||||
goodsDisCount() {
|
||||
const goodsQuanArr = this.quansSelArr.filter((v) => v.type == 2);
|
||||
let result = 0;
|
||||
if (goodsQuanArr.length < 0) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = goodsQuanArr.reduce((a, b) => {
|
||||
const item = this.createOrder.data.detailList.find(
|
||||
(v) => v.productId == b.proId
|
||||
);
|
||||
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
||||
const price = item
|
||||
? this.vipUser.isVip
|
||||
? memberPrice
|
||||
: item.price
|
||||
: 0;
|
||||
return a + price;
|
||||
}, 0);
|
||||
}
|
||||
return result.toFixed(2);
|
||||
},
|
||||
|
||||
currentPayMoney() {
|
||||
const amount = this.createOrder.data.amount || 0;
|
||||
const discount = this.createOrder.discount || 1;
|
||||
// const total=((amount - this.coupdiscount) * this.createOrder.discount - this.points.toMoney)
|
||||
const total = (amount) * this.createOrder.discount - this.coupdiscount;
|
||||
const total = amount - this.gaijia - this.coupdiscount;
|
||||
return total <= 0 ? 0 : total;
|
||||
},
|
||||
yinFuJinE() {
|
||||
const total = this.currentPayMoney - (this.points.toMoney || 0);
|
||||
console.log(total)
|
||||
const total =
|
||||
this.currentPayMoney - (this.points.selected ? this.points.toMoney : 0);
|
||||
console.log(total);
|
||||
if (this.isCreateOrder) {
|
||||
return total.toFixed(2);
|
||||
} else {
|
||||
|
|
@ -1776,6 +1900,8 @@ export default {
|
|||
!this.order.selGoods ||
|
||||
this.order.old.list.length <= 0 ||
|
||||
this.order.selGoods.status == "return"
|
||||
||this.order.selGoods.useType=='dine-in'
|
||||
||this.order.selGoods.useType=='dine-in-before'
|
||||
);
|
||||
},
|
||||
title() {
|
||||
|
|
@ -1886,13 +2012,20 @@ export default {
|
|||
const seatFee =
|
||||
this.order.seatFee.totalAmount *
|
||||
(returnStatus.includes(this.order.seatFee.status) ? 0 : 1);
|
||||
// return (
|
||||
// (oldPrice + price + +packFee + seatFee - this.youhuiAllPrice) *
|
||||
// this.createOrder.discount
|
||||
// ).toFixed(2);
|
||||
return (
|
||||
(oldPrice + price + +packFee + seatFee - this.youhuiAllPrice) *
|
||||
this.createOrder.discount
|
||||
oldPrice +
|
||||
price +
|
||||
+packFee +
|
||||
seatFee -
|
||||
this.youhuiAllPrice
|
||||
).toFixed(2);
|
||||
},
|
||||
vipDiscountPrice() {
|
||||
if (!this.vipUser.isVip) {
|
||||
if (!this.vipUser.isVip || !this.shopInfo.isMemberPrice) {
|
||||
return 0;
|
||||
}
|
||||
const oldMemberPrice = this.order.old.list.reduce((a, b) => {
|
||||
|
|
@ -1922,8 +2055,28 @@ export default {
|
|||
}, 0);
|
||||
return (oldMemberPrice + nowMemberprice).toFixed(2);
|
||||
},
|
||||
discountSaleAmount() {
|
||||
const oldTotal = this.order.old.list.reduce((a, b) => {
|
||||
const bTotal = b.info
|
||||
.filter((v) => v.discountSaleAmount && v.discountSaleAmount > 0)
|
||||
.reduce((prve, cur) => {
|
||||
return prve + cur.number * cur.discountSaleAmount;
|
||||
}, 0);
|
||||
return a + bTotal;
|
||||
}, 0);
|
||||
const nowTotal = this.order.list
|
||||
.filter((v) => v.discountSaleAmount && v.discountSaleAmount > 0)
|
||||
.reduce((a, b) => {
|
||||
return a + b.number * b.discountSaleAmount;
|
||||
}, 0);
|
||||
return (oldTotal + nowTotal).toFixed(2);
|
||||
},
|
||||
youhuiAllPrice() {
|
||||
return (this.vipDiscountPrice * 1 + this.allGiftMoney * 1).toFixed(2);
|
||||
return (
|
||||
this.vipDiscountPrice * 1 +
|
||||
this.allGiftMoney * 1 +
|
||||
this.discountSaleAmount * 1
|
||||
).toFixed(2);
|
||||
},
|
||||
allNumber() {
|
||||
const oldNumber = this.order.old.list.reduce((a, b) => {
|
||||
|
|
@ -1979,7 +2132,7 @@ export default {
|
|||
watch: {
|
||||
yinFuJinE: function (newval) {
|
||||
if (newval <= 0) {
|
||||
this.disabledPayType = ["scanCode", "deposit"];
|
||||
this.disabledPayType = ["scanCode", "deposit","creditBuyer"];
|
||||
} else {
|
||||
this.disabledPayType = [];
|
||||
}
|
||||
|
|
@ -1990,10 +2143,15 @@ export default {
|
|||
this.goods.status = "loadmore";
|
||||
this.getGoods();
|
||||
},
|
||||
pointsCanDicountMoney: function (newval) {
|
||||
this.getCalcUsablePoints();
|
||||
},
|
||||
currentPayMoney: function (newval) {
|
||||
if (this.createOrder.data.memberId || this.vipUser.id) {
|
||||
this.getCalcUsablePoints().then((res) => {
|
||||
this.pointsValueChange(this.points.value);
|
||||
if (this.points.selected) {
|
||||
this.pointsValueChange(this.points.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
@ -2054,8 +2212,12 @@ export default {
|
|||
if (this.order.status == "finish") {
|
||||
return;
|
||||
}
|
||||
if(!this.table.tableId&&(this.order.list.length<=0&&this.order.old.list.length<=0)){
|
||||
return ;
|
||||
if (
|
||||
!this.table.tableId &&
|
||||
this.order.list.length <= 0 &&
|
||||
this.order.old.list.length <= 0
|
||||
) {
|
||||
return;
|
||||
}
|
||||
$setUser({
|
||||
tableId: this.table.tableId,
|
||||
|
|
@ -2189,30 +2351,90 @@ export default {
|
|||
this.open(this.$route.query);
|
||||
},
|
||||
methods: {
|
||||
//美团抖音团购券核销弹窗
|
||||
refQuanHexiaoOpen(){
|
||||
this.$refs.refQuanHexiao.open()
|
||||
},
|
||||
//称重商品弹窗
|
||||
refWeightGoodsShow() {
|
||||
this.$refs.refWeightGoods.open();
|
||||
},
|
||||
//称重商品确认
|
||||
refWeightGoodsConfirm(){
|
||||
|
||||
},
|
||||
//挂账人支付确认
|
||||
guazhangPayConfirm(guazhangren, price) {
|
||||
this.guazhangRen = guazhangren;
|
||||
this.pays({
|
||||
creditBuyerId: this.guazhangRen.id,
|
||||
payType: "creditBuyer",
|
||||
});
|
||||
},
|
||||
//挂账
|
||||
guazhangShow() {
|
||||
this.$refs.refGuaZhang.open();
|
||||
},
|
||||
//团购券扫码弹窗
|
||||
shouwTuanQuan() {
|
||||
this.$refs.refPopTuanQuan.open();
|
||||
},
|
||||
tuanQuanConfirm(e) {
|
||||
console.log(e);
|
||||
this.tuanQuan = e;
|
||||
},
|
||||
//更新单品改价数据
|
||||
updateCartItem(res) {
|
||||
if (res) {
|
||||
// this.order.list[this.order.selIndex] = res;
|
||||
this.$set(this.order.list, this.order.selIndex, res)
|
||||
}
|
||||
},
|
||||
// 单品改价
|
||||
refPopChangePriceShow() {
|
||||
const orderGoods = this.order.list[this.order.selIndex];
|
||||
this.$refs.refPopChangePrice.open(orderGoods);
|
||||
},
|
||||
returnProDiscount(row) {
|
||||
console.log(row);
|
||||
//相同商品抵扣券数组
|
||||
const arr = this.quansSelArr.filter((v) => v.proId == row.proId);
|
||||
const index = arr.findIndex((v) => v.id == row.id);
|
||||
const item = this.createOrder.data.detailList.find(
|
||||
(v) => v.productId == row.proId
|
||||
);
|
||||
|
||||
if (index != -1) {
|
||||
const n=returnProductCoupAllPrice(
|
||||
const n = returnProductCoupAllPrice(
|
||||
$goodsPayPriceMap[row.proId],
|
||||
index,
|
||||
row.num
|
||||
)
|
||||
return (n*this.createOrder.discount).toFixed(2);
|
||||
row.num,
|
||||
item.isMember
|
||||
);
|
||||
return (n * this.createOrder.discount).toFixed(2);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
lingshicaiShow() {
|
||||
this.$refs.refPopAddCai.open();
|
||||
this.$refs.refPopAddCai.open({
|
||||
masterId: this.masterId,
|
||||
tableId: this.table.tableId,
|
||||
vipUserId: this.vipUser.id,
|
||||
});
|
||||
},
|
||||
delQuan(row) {
|
||||
const index = this.quansSelArr.findIndex((v) => v.id == row.id);
|
||||
console.log(index);
|
||||
if (index != -1) {
|
||||
this.quansSelArr.splice(index, 1);
|
||||
this.quansSelArr.map((v, index) => {
|
||||
return {
|
||||
...v,
|
||||
discountAmount:
|
||||
v.type == 2 ? this.returnProDiscount(v) : v.discountAmount,
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
async getCalcUsablePoints() {
|
||||
|
|
@ -2232,6 +2454,9 @@ export default {
|
|||
this.vipUser.accountPoints,
|
||||
this.points.res.maxUsablePoints || 0
|
||||
);
|
||||
if (!pointsRes.usable) {
|
||||
this.points.selected = false;
|
||||
}
|
||||
}
|
||||
return pointsRes;
|
||||
},
|
||||
|
|
@ -2266,13 +2491,22 @@ export default {
|
|||
id: this.createOrder.data.id,
|
||||
memberId: this.createOrder.data.memberId || this.vipUser.id,
|
||||
orderPrice: (this.yinFuJinE * 1 + this.coupdiscount * 1).toFixed(2),
|
||||
discount:this.createOrder.discount
|
||||
discount: this.createOrder.discount,
|
||||
},
|
||||
[...this.quansSelArr]
|
||||
);
|
||||
},
|
||||
quansConfirm(e, goodsPayPriceMap) {
|
||||
console.log(e);
|
||||
this.createOrder.discount = 1;
|
||||
this.points.selected = "";
|
||||
e.map((v, index) => {
|
||||
return {
|
||||
...v,
|
||||
discountAmount:
|
||||
v.type == 2 ? this.returnProDiscount(v) : v.discountAmount,
|
||||
};
|
||||
});
|
||||
this.quansSelArr = [...e];
|
||||
$goodsPayPriceMap = goodsPayPriceMap;
|
||||
},
|
||||
|
|
@ -2320,7 +2554,7 @@ export default {
|
|||
// return
|
||||
// }
|
||||
await this.returnCreateOrderData();
|
||||
this.payBeforeClear();
|
||||
// this.payBeforeClear();
|
||||
// this.order.payType = "";
|
||||
},
|
||||
async cashPayClick() {
|
||||
|
|
@ -2413,10 +2647,13 @@ export default {
|
|||
if (!canJiesuan) {
|
||||
return;
|
||||
}
|
||||
const order = await this.returnCreateOrderData();
|
||||
this.order.payType = "scanCode";
|
||||
this.payTypeItemClick({ payType: "scanCode", order });
|
||||
this.payBeforeClear();
|
||||
if (!this.isCreateOrder) {
|
||||
const order = await this.returnCreateOrderData();
|
||||
this.order.payType = "scanCode";
|
||||
this.payTypeItemClick({ payType: "scanCode", order });
|
||||
return;
|
||||
}
|
||||
this.payTypeItemClick({ payType: "scanCode" });
|
||||
},
|
||||
async changeOrderUseType(useType) {
|
||||
if (useType && this.order.list.length) {
|
||||
|
|
@ -2553,10 +2790,11 @@ export default {
|
|||
},
|
||||
//退菜
|
||||
async refReturnCartConfirm(e) {
|
||||
console.log(this.order.selGoods);
|
||||
const res = await $returnCart({
|
||||
...e,
|
||||
cartId: this.order.selGoods.cartId,
|
||||
cartId: this.isCreateOrder
|
||||
? this.order.selGoods.id
|
||||
: this.order.selGoods.cartId,
|
||||
tableId: this.table.tableId,
|
||||
});
|
||||
this.order.selGoods.status = "return";
|
||||
|
|
@ -2675,14 +2913,41 @@ export default {
|
|||
}
|
||||
},
|
||||
ChangeDiscount(discount) {
|
||||
const fullCoupIndex = this.quansSelArr.findIndex((v) => v.type == 1);
|
||||
const fullCoup = this.quansSelArr[fullCoupIndex];
|
||||
this.createOrder.discount = discount;
|
||||
if (fullCoup && this.yinFuJinE < fullCoup.fullAmount) {
|
||||
return this.$confirm(
|
||||
"改价后价格不满足满减券最低满减需求" + fullCoup.fullAmount + "元",
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "删除满减券",
|
||||
cancelButtonText: "取消改价",
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
this.quansSelArr.splice(fullCoupIndex, 1);
|
||||
this.createOrder.discount = discount;
|
||||
})
|
||||
.catch((action) => {
|
||||
this.createOrder.discount = 1;
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "已取消改价",
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
async disCountShow() {
|
||||
const canDiscount = await hasPermission("允许打折");
|
||||
if (!canDiscount) {
|
||||
return;
|
||||
}
|
||||
const amount = this.createOrder.data.amount;
|
||||
const amount = (this.createOrder.data.amount - this.coupdiscount).toFixed(
|
||||
2
|
||||
);
|
||||
console.log(amount);
|
||||
this.refToggle("refDiscount", true, {
|
||||
amount,
|
||||
discount: this.createOrder.discount * 100,
|
||||
|
|
@ -2833,7 +3098,7 @@ export default {
|
|||
this.pays();
|
||||
},
|
||||
// 支付订单
|
||||
async pays() {
|
||||
async pays(par) {
|
||||
this.loading = true;
|
||||
const userCouponInfos = this.quansSelArr.reduce((prve, cur) => {
|
||||
const index = prve.findIndex((v) => v.userCouponId == cur.couponId);
|
||||
|
|
@ -2848,6 +3113,15 @@ export default {
|
|||
return prve;
|
||||
}, []);
|
||||
try {
|
||||
// 核销团购券商品
|
||||
if (this.tuanQuan && this.tuanQuan.goods.length > 0) {
|
||||
await $checkCoupon({
|
||||
code: this.tuanQuan.couponCode,
|
||||
num: this.tuanQuan.number,
|
||||
orderId: this.createOrder.data.id,
|
||||
cartId: this.tuanQuan.goods.map((v) => v.cartId),
|
||||
});
|
||||
}
|
||||
const res = await $payOrder({
|
||||
tableId: this.table.tableId,
|
||||
masterId: this.masterId,
|
||||
|
|
@ -2856,8 +3130,9 @@ export default {
|
|||
vipUserId: this.createOrder.data.memberId || this.vipUser.id,
|
||||
discount: this.createOrder.discount,
|
||||
code: this.createOrder.code,
|
||||
userCouponInfos,
|
||||
userCouponInfos: userCouponInfos.length > 0 ? userCouponInfos : "",
|
||||
pointsNum: this.points.value,
|
||||
...par,
|
||||
});
|
||||
this.loading = false;
|
||||
this.payOrderSuccess();
|
||||
|
|
@ -2985,7 +3260,16 @@ export default {
|
|||
updateOrder(par = {}) {
|
||||
let item = this.order.list[this.order.selIndex];
|
||||
console.log(this.table);
|
||||
const { productId, skuId, isPack, isGift, number, id } = item;
|
||||
const {
|
||||
productId,
|
||||
skuId,
|
||||
isPack,
|
||||
isGift,
|
||||
number,
|
||||
id,
|
||||
isPrint,
|
||||
isWaitCall,
|
||||
} = item;
|
||||
$updateCart({
|
||||
cartId: id,
|
||||
masterId: this.masterId,
|
||||
|
|
@ -2996,6 +3280,8 @@ export default {
|
|||
num: number,
|
||||
isPack: isPack === "true" ? true : false,
|
||||
isGift: isGift === "true" ? true : false,
|
||||
isPrint,
|
||||
isWaitCall,
|
||||
...par,
|
||||
}).then((res) => {
|
||||
this.$set(this.order.list, this.order.selIndex, {
|
||||
|
|
@ -3048,7 +3334,7 @@ export default {
|
|||
// },
|
||||
|
||||
//右侧控制按钮点击事件
|
||||
orderBtnsClick(key) {
|
||||
async orderBtnsClick(key) {
|
||||
const orderGoods = this.order.list[this.order.selIndex];
|
||||
if (this.key != "isJieZhang" && this.payAfter) {
|
||||
this.createOrderClose();
|
||||
|
|
@ -3073,6 +3359,27 @@ export default {
|
|||
if (key === "del") {
|
||||
return this.removeCart();
|
||||
}
|
||||
if (key === "print") {
|
||||
const isPrint = orderGoods.isPrint;
|
||||
this.updateOrder({ isPrint: !isPrint });
|
||||
return;
|
||||
}
|
||||
if (key === "isWaitCall") {
|
||||
const isWaitCall = orderGoods.isWaitCall;
|
||||
this.updateOrder({ isWaitCall: !isWaitCall });
|
||||
return;
|
||||
}
|
||||
if (key == "AllWaitCall") {
|
||||
await $waitCall({
|
||||
orderId:this.createOrder.data.id,
|
||||
masterId:this.masterId,
|
||||
tableId:this.table.tableId,
|
||||
isWaitCall: !this.isAllWaitCall?1:0
|
||||
})
|
||||
this.isAllWaitCall=!this.isAllWaitCall;
|
||||
this.getCart()
|
||||
return;
|
||||
}
|
||||
if (key === "save") {
|
||||
this.prveOrder.list.push({
|
||||
cart: this.order.list,
|
||||
|
|
@ -3473,6 +3780,7 @@ export default {
|
|||
tableId: this.table.tableId,
|
||||
num: this.skuGoods.number, // 0会删除此商品
|
||||
isPack: false, // 是否打包
|
||||
isWaitCall:this.isAllWaitCall //是否等叫
|
||||
});
|
||||
this.orderListPush({ ...res, specSnap: name });
|
||||
// this.orderListPush({
|
||||
|
|
@ -3578,6 +3886,7 @@ export default {
|
|||
},
|
||||
reset() {
|
||||
// this.goods.list = [];
|
||||
this.guazhangRen = "";
|
||||
this.order.status = "";
|
||||
this.loading = false;
|
||||
this.table = "";
|
||||
|
|
@ -3612,7 +3921,8 @@ export default {
|
|||
//设置购物车数据
|
||||
setCart(res) {
|
||||
console.log(res);
|
||||
const { seatFee } = res;
|
||||
try {
|
||||
const { seatFee } = res;
|
||||
this.order.seatFee = seatFee
|
||||
? {
|
||||
...seatFee,
|
||||
|
|
@ -3631,6 +3941,32 @@ export default {
|
|||
this.order.old.list = oldCart ? oldCart : [];
|
||||
// this.order.gift.list = returnGiftArr(res.records);
|
||||
console.log(this.order.old.list);
|
||||
} catch (error) {
|
||||
//当购物车数据发生错误时会导致页面报错购物车商品不展示
|
||||
this.$confirm('购物车数据结构错误,是否清空购物车商品?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$clearCart({
|
||||
masterId: this.masterId,
|
||||
tableId: this.table.tableId,
|
||||
}).then((res) => {
|
||||
this.order.list = [];
|
||||
this.changeOrderSel(-1);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "清除成功!",
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
//获取购物车数据
|
||||
async getCart() {
|
||||
|
|
@ -3726,6 +4062,9 @@ export default {
|
|||
// if (!this.table) {
|
||||
// return this.$message.error("暂不支持无桌台下单,请先选择桌台");
|
||||
// }
|
||||
if(item.type=='weigh'){
|
||||
return this.refWeightGoodsShow()
|
||||
}
|
||||
if (item.typeEnum === "sku") {
|
||||
this.selGoods.data = item;
|
||||
this.selGoods.skuMap = {};
|
||||
|
|
@ -3774,6 +4113,7 @@ export default {
|
|||
tableId: this.table.tableId,
|
||||
num: item.specList[0].suit, // 0会删除此商品
|
||||
isPack: false, // 是否打包
|
||||
isWaitCall:this.isAllWaitCall //是否等叫
|
||||
});
|
||||
this.orderListPush(res);
|
||||
}
|
||||
|
|
@ -4055,9 +4395,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
background-color: #fff;
|
||||
height: 100%;
|
||||
}
|
||||
::v-deep .el-button--text {
|
||||
// color: #000;
|
||||
}
|
||||
|
||||
::v-deep .meal_box .el-button-group {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
|
@ -4516,11 +4854,13 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
font-weight: 600;
|
||||
}
|
||||
::v-deep input[aria-hidden="true"] {
|
||||
display: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
::v-deep .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
|
||||
box-shadow: none !important;
|
||||
|
||||
::v-deep
|
||||
.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled)
|
||||
.el-radio__inner {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
::v-deep .categorys .el-tag--plain.el-tag--info {
|
||||
|
|
@ -4574,13 +4914,6 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
background-color: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
|
||||
// background-color: #22bf64;
|
||||
// border-color: #22bf64;
|
||||
}
|
||||
::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
|
||||
// color: #22bf64;
|
||||
}
|
||||
|
||||
::v-deep .tag-group .el-tag--dark {
|
||||
background: rgba(34, 191, 100, 0.1);
|
||||
|
|
@ -5181,7 +5514,16 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
border-radius: 4px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.weight{
|
||||
height: 15px;
|
||||
background: linear-gradient(124deg, rgb(115, 201, 105) 6%, rgb(39, 146, 27) 93%);
|
||||
border-radius: 2px;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
line-height: 15px;
|
||||
padding: 0px 2px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
.cashier_left .el-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,11 +91,12 @@ export function returnProductPayPrice(goods,vipUser){
|
|||
return price
|
||||
}
|
||||
//返回商品券抵扣的商品价格
|
||||
export function returnProductCoupAllPrice(productPriceArr,startIndex,num){
|
||||
export function returnProductCoupAllPrice(productPriceArr,startIndex,num,isMember=true){
|
||||
console.log(productPriceArr);
|
||||
return productPriceArr.slice(startIndex,startIndex+num).reduce((prve,cur)=>{
|
||||
let curPrice=0
|
||||
if(typeof cur==='object'){
|
||||
curPrice=cur.memberPrice*1
|
||||
curPrice=isMember?cur.memberPrice*1:cur.price
|
||||
}else{
|
||||
curPrice=cur*1
|
||||
}
|
||||
|
|
@ -216,9 +217,9 @@ export function returnCouponAllPrice(coupArr, goodsArr, vipUser) {
|
|||
export function returnCanUseFullReductionCoupon(coupArr, payPrice, selCoup) {
|
||||
return coupArr.map(v => {
|
||||
if (v.id == selCoup.id) {
|
||||
return v
|
||||
return {...v,use:true}
|
||||
}
|
||||
const isfullAmount = payPrice >= v.fullAmount * 1
|
||||
const isfullAmount = payPrice*1 >= v.fullAmount * 1
|
||||
if(payPrice<=0){
|
||||
return {
|
||||
...v,
|
||||
|
|
@ -229,5 +230,21 @@ export function returnCanUseFullReductionCoupon(coupArr, payPrice, selCoup) {
|
|||
...v,
|
||||
use: v.use && isfullAmount
|
||||
}
|
||||
})
|
||||
}).filter(v => v.use)
|
||||
}
|
||||
|
||||
//根据商品数量还有商品券数量返回优惠券可以使用的数量数组
|
||||
export function returnCanUseNumProductCoup(coupArr,){
|
||||
let productCoup = coupArr.filter(v => v.type == 2)
|
||||
//商品券分组
|
||||
let coupMap={}
|
||||
for(let i in productCoup){
|
||||
const coup=productCoup[i]
|
||||
if(coupMap.hasOwnProperty(coup.proId)){
|
||||
coupMap[coup.proId].push(coup)
|
||||
}else{
|
||||
coupMap[coup.proId]=[coup]
|
||||
}
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
|
@ -218,4 +218,14 @@ export function returnCouponAllPrice(coupArr, goodsArr, vipUser) {
|
|||
const poductAllprice=returnProductCouponAllPrice(coupArr, goodsArr, vipUser)
|
||||
const pointAllPrice=returnFullReductionCouponAllPrice(coupArr)
|
||||
return (poductAllprice*1+pointAllPrice*1).toFixed(2);
|
||||
}
|
||||
|
||||
//返回购物车商品价格
|
||||
export function returnCartPrice(goods, vipUser) {
|
||||
const price=goods.price||goods.salePrice
|
||||
if(!vipUser||!vipUser.id ||!vipUser.isVip){
|
||||
return price
|
||||
}
|
||||
const memberPrice = goods.memberPrice ? goods.memberPrice :price;
|
||||
return memberPrice
|
||||
}
|
||||
Loading…
Reference in New Issue