This commit is contained in:
duan 2024-11-29 16:35:13 +08:00
commit 8e1991e1bf
28 changed files with 1960 additions and 162 deletions

View File

@ -3,10 +3,10 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置 # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
# 测试 # 测试
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn' VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
# 生产 # 生产
VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn' # VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
# 预发布接口 # 预发布接口
# VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn' # VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'

68
src/api/Instead.js Normal file
View File

@ -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
}
});
}

199
src/api/coup/index.js Normal file
View File

@ -0,0 +1,199 @@
// 代客下单
import request from "@/utils/request-php";
// 抖音团购核销准备
export function $douyin_fulfilmentcertificateprepare(data) {
return request({
url: 'douyin/fulfilmentcertificateprepare',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 抖音团购核销
export function $douyin_certificateprepare(data) {
return request({
url: 'douyin/certificateprepare',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 抖音团购核销撤销
export function $douyin_fulfilmentcertificatecancel(data) {
return request({
url: 'douyin/fulfilmentcertificatecancel',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 抖音团购核销记录
export function $douyin_orderlist(data) {
return request({
url: 'douyin/orderlist',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 抖音门店列表
export function $douyin_storelist(data) {
return request({
url: 'douyin/storelist',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 抖音绑定门店
export function $douyin_bindstore(data) {
return request({
url: 'douyin/bindstore',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 抖音订单查询
export function $douyin_orderquery(data) {
return request({
url: 'douyin/orderquery',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
//会员签入
export function $douyin_checkIn(data) {
return request({
url: 'douyin/checkIn',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
//美团
// 美团获取uisdk 绑定 链接
export function $meituan_getuisdkurl(data) {
return request({
url: 'meituan/getuisdkurl',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 美团获取uisdk 解绑 链接
export function $meituan_getuisdkuniurl(data) {
return request({
url: 'meituan/getuisdkuniurl',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 美团团购核销准备
export function $meituan_fulfilmentcertificateprepare(data) {
return request({
url: 'meituan/fulfilmentcertificateprepare',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 美团执行核销
export function $meituan_certificateprepare(data) {
return request({
url: 'meituan/certificateprepare',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 美团团购核销记录
export function $meituan_orderlist(data) {
return request({
url: 'meituan/orderlist',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 美团团购撤销
export function $meituan_fulfilmentcertificatecancel(data) {
return request({
url: 'meituan/fulfilmentcertificatecancel',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 美团查询绑定状态
export function $meituan_searchstorestatus(data) {
return request({
url: 'meituan/searchstorestatus',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
// 登出
export function $logout(data) {
return request({
url: 'user/logout',
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}

View File

@ -1,7 +1,7 @@
import request from '@/utils/request' import request from '@/utils/request'
/** /**
* 获取挂账列表 * 获取挂账列表
* @returns * @returns
*/ */
export function getCreditBuyerList(params) { export function getCreditBuyerList(params) {
@ -15,7 +15,7 @@ export function getCreditBuyerList(params) {
} }
/** /**
* 获取挂账详情 * 获取挂账详情
* @returns * @returns
*/ */
export function getCreditBuyerInfo(id) { export function getCreditBuyerInfo(id) {
@ -38,6 +38,18 @@ export function addCreditBuyer(data) {
}) })
} }
/**
* 编辑挂账人
* @returns
*/
export function editCreditBuyer(data) {
return request({
url: '/api/credit/buyer',
method: 'put',
data
})
}
/** /**
* 还款 * 还款
* @returns * @returns

BIN
src/assets/images/scan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

101
src/utils/request-php.js Normal file
View File

@ -0,0 +1,101 @@
import axios from 'axios'
import router from '@/router/routers'
import { Notification } from 'element-ui'
import store from '../store'
import { getToken } from '@/utils/auth'
import Config from '@/settings'
import Cookies from 'js-cookie'
import { setToken } from '@/utils/globalCancelToken.js'
// 创建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['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
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 => {
return response.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

View File

@ -127,7 +127,7 @@ export default {
* 重置 * 重置
*/ */
reset() { reset() {
this.query = { ...this.resetQuery } this.query.paymentMethod = ''
this.getTableData() this.getTableData()
} }
} }

View File

@ -21,7 +21,7 @@
<el-input v-model="form.debtor" placeholder="请输入挂账人名称" /> <el-input v-model="form.debtor" placeholder="请输入挂账人名称" />
</el-form-item> </el-form-item>
<el-form-item label="手机号" prop="mobile" style="width: 100%;"> <el-form-item label="手机号" prop="mobile" style="width: 100%;">
<el-input v-model="form.mobile" placeholder="请输入手机号" oninput="value= value.replace(/[^1-9]/g, '')" maxlength="11" /> <el-input v-model="form.mobile" placeholder="请输入手机号" oninput="value= value.replace(/[^0-9]/g, '')" maxlength="11" />
</el-form-item> </el-form-item>
<el-form-item label="职位" prop="position" style="width: 100%;"> <el-form-item label="职位" prop="position" style="width: 100%;">
<el-input v-model="form.position" placeholder="请输入职位" /> <el-input v-model="form.position" placeholder="请输入职位" />
@ -50,7 +50,7 @@
</template> </template>
<script> <script>
import { addCreditBuyer } from '@/api/credit' import { addCreditBuyer, editCreditBuyer } from '@/api/credit'
export default { export default {
// eslint-disable-next-line vue/require-prop-types // eslint-disable-next-line vue/require-prop-types
@ -131,8 +131,12 @@ export default {
try { try {
this.loading = true this.loading = true
if (!this.form.shopId) { this.form.shopId = localStorage.getItem('shopId') } if (!this.form.shopId) { this.form.shopId = localStorage.getItem('shopId') }
// eslint-disable-next-line no-unused-vars, prefer-const let res
let res = await addCreditBuyer(this.form) if (!this.form.id) {
res = await addCreditBuyer(this.form)
} else {
res = await editCreditBuyer(this.form)
}
this.$notify({ this.$notify({
title: '成功', title: '成功',
message: `${this.form.id ? '编辑' : '添加'}成功`, message: `${this.form.id ? '编辑' : '添加'}成功`,

View File

@ -90,11 +90,11 @@ export default {
this.resetForm = { ...this.form } this.resetForm = { ...this.form }
}, },
methods: { methods: {
/** /**
* 确定 * 确定
*/ */
async onSubmitHandle() { // eslint-disable-next-line no-undef
onSubmitHandle: _.debounce(function async() {
this.$refs.form.validate(async valid => { this.$refs.form.validate(async valid => {
if (valid) { if (valid) {
try { try {
@ -120,7 +120,7 @@ export default {
} }
} }
}) })
}, }, 1000),
/** /**
* 打开 * 打开
@ -135,6 +135,9 @@ export default {
this.form.id = row.id this.form.id = row.id
} }
this.form.repaymentMethod = row.repaymentMethod this.form.repaymentMethod = row.repaymentMethod
this.form.debtor = row.debtor
this.form.owedAmount = row.owedAmount
this.form.accountBalance = row.accountBalance
this.dialogVisible = true this.dialogVisible = true
}, },

View File

@ -16,7 +16,7 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
<el-button type="primary" @click="getTableData()"> <el-button type="primary" @click="search">
查询 查询
</el-button> </el-button>
</div> </div>
@ -119,7 +119,10 @@ export default {
this.getTableData() this.getTableData()
}, },
methods: { methods: {
search() {
this.tableData.page = 1
this.getTableData()
},
/** /**
* 获取挂账人列表 * 获取挂账人列表
*/ */

View File

@ -27,13 +27,13 @@
</el-form-item> </el-form-item>
<template> <template>
<el-form-item> <el-form-item>
<el-select v-model="query.status" placeholder="全部状态" style="width: 140px;"> <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-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
<el-form-item> <el-form-item>
<el-button type="primary" @click="getTableData">查询</el-button> <el-button type="primary" @click="search">查询</el-button>
<el-button @click="resetHandle">重置</el-button> <el-button @click="resetHandle">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -161,6 +161,10 @@ export default {
// this.tbShopCategoryGet() // this.tbShopCategoryGet()
}, },
methods: { methods: {
search() {
this.query.page = 1
this.getTableData()
},
/** /**
* 获取明细数据 * 获取明细数据
*/ */
@ -172,6 +176,7 @@ export default {
let params = { let params = {
page: this.query.page, page: this.query.page,
size: this.query.size, size: this.query.size,
status: this.query.status,
creditBuyerId: this.query.creditBuyerId creditBuyerId: this.query.creditBuyerId
} }
if (this.query.createdAt.length > 0) { if (this.query.createdAt.length > 0) {
@ -197,6 +202,7 @@ export default {
let params = { let params = {
page: this.query.page, page: this.query.page,
size: this.query.size, size: this.query.size,
status: this.query.status,
creditBuyerId: this.query.creditBuyerId creditBuyerId: this.query.creditBuyerId
} }
if (this.query.createdAt.length > 0) { if (this.query.createdAt.length > 0) {
@ -222,7 +228,7 @@ export default {
if (type === 'payment' && this.repaymentMethod === 'order') { if (type === 'payment' && this.repaymentMethod === 'order') {
this.$refs.creditRepayment.show({ creditBuyerId: this.query.creditBuyerId, repaymentMethod: this.repaymentMethod }, row) this.$refs.creditRepayment.show({ creditBuyerId: this.query.creditBuyerId, repaymentMethod: this.repaymentMethod }, row)
} else if (type === 'paymentRecord') { } else if (type === 'paymentRecord') {
this.$refs.creditRepaymentRecord.show({ creditBuyerId: this.query.creditBuyerId, repaymentMethod: this.repaymentMethod }, row.id) this.$refs.creditRepaymentRecord.show({ id: this.query.creditBuyerId, repaymentMethod: this.repaymentMethod }, row.orderId)
} }
}, },
@ -318,7 +324,8 @@ export default {
* @param e * @param e
*/ */
sizeChange(e) { sizeChange(e) {
this.tableData.size = e console.log(e)
this.query.size = e
this.getTableData() this.getTableData()
}, },

View File

@ -81,7 +81,8 @@ export default {
stocktakinNum: '', // stocktakinNum: '', //
price: '', // price: '', //
remark: "", // remark: "", //
stockNumber: 0 stockNumber: 0,
balance: ''
}, },
rules: { rules: {
stocktakinNum: [ stocktakinNum: [
@ -155,6 +156,7 @@ export default {
}) })
}, },
async show(obj) { async show(obj) {
console.log(obj, 111)
let res = await hasPermission('允许耗材盘点'); let res = await hasPermission('允许耗材盘点');
if (!res) { return; } if (!res) { return; }
this.form.remark = '' this.form.remark = ''
@ -165,8 +167,9 @@ export default {
this.form = Object.assign(this.form, obj) this.form = Object.assign(this.form, obj)
this.dialogVisible = true this.dialogVisible = true
this.form.conInfoId = obj.consId this.form.conInfoId = obj.consId
this.form.stockNumber = obj.stockNumber this.form.stockNumber = obj.balance < 0 ? 0 : obj.balance
this.form.balance = obj.stockNumber // this.form.balance = obj.stockNumber
this.form.balance = obj.balance
this.form.price == null ? 0 : this.form.price this.form.price == null ? 0 : this.form.price
this.searhForm.productId = obj.id this.searhForm.productId = obj.id
this.getTableData() this.getTableData()
@ -186,7 +189,7 @@ export default {
try { try {
this.tableData.loading = true this.tableData.loading = true
const res = await tbConCheckGet({ const res = await tbConCheckGet({
page: this.tableData.page, page: this.tableData.page,
size: this.tableData.size, size: this.tableData.size,
conInfoId: this.searhForm.productId, conInfoId: this.searhForm.productId,

View File

@ -123,13 +123,14 @@
<div class="tips" style="font-size: 16px;">原价 <div class="tips" style="font-size: 16px;">原价
<!-- {{ scope.row.costPrice }}/{{ scope.row.conUnit }} --> <!-- {{ scope.row.costPrice }}/{{ scope.row.conUnit }} -->
{{ !scope.row.unit ? {{ !scope.row.unit ?
(scope.row.defaultUnit ? (scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo? scope.row.defaultUnit == scope.row.conUnitTwo ?
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice:scope.row.costPrice) ((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) :
: scope.row.unit== scope.row.conUnitTwo? scope.row.costPrice : scope.row.costPrice)
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): 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.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }} scope.row.conUnit) : scope.row.unit }}
@ -154,13 +155,13 @@
controls-position="right" controls-position="right"
@change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number> @change="consCountTotal($event, scope.row, 'stockNumber')"></el-input-number>
<div class="tips" style="font-size: 16px;">入库前 <div class="tips" style="font-size: 16px;">入库前
{{ !scope.row.unit ? {{ !scope.row.unit ?
(scope.row.defaultUnit ? (scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo? scope.row.defaultUnit == scope.row.conUnitTwo ?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number:scope.row.number) (scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number : scope.row.number)
: scope.row.unit== scope.row.conUnitTwo? : scope.row.unit == scope.row.conUnitTwo ?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number}} (scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number }}
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit : {{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }} scope.row.conUnit) : scope.row.unit }}
</div> </div>
@ -343,6 +344,17 @@ export default {
mounted() { mounted() {
this.resetForm = { ...this.queryForm } this.resetForm = { ...this.queryForm }
this.tbShopPurveyorGet() 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: { methods: {
async querySearchAsync(queryString, cb) {// async querySearchAsync(queryString, cb) {//
@ -556,6 +568,7 @@ export default {
}, },
// //
selectConsumable(res) { selectConsumable(res) {
console.log(res)
let arr = res.map(item => { let arr = res.map(item => {
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true) item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
item.stockNumber = 0 item.stockNumber = 0

View File

@ -126,8 +126,8 @@
<el-button type="text" size="mini" round @click="Uppop(scope.row.id)">付款</el-button> <el-button type="text" size="mini" round @click="Uppop(scope.row.id)">付款</el-button>
<el-button type="text" size="mini" <el-button type="text" size="mini"
@click="typedialogshowsumbit(scope.row.id)">账单付款记录</el-button> @click="typedialogshowsumbit(scope.row.id)">账单付款记录</el-button>
<el-button type="text" size="mini" @click="stockData.size = 10, <el-button type="text" size="mini" @click="stockData.size = 10,
stockData.page = 0, gettbConsInfoFlowstock(scope.row)">出入库记录</el-button> stockData.page = 0, gettbConsInfoFlowstock(scope.row)">货单记录</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -175,10 +175,10 @@
</el-table> </el-table>
</el-dialog> </el-dialog>
<!--入库记录 --> <!--入库记录 -->
<el-dialog title="出入库记录" :visible.sync="variabilityshow" width="75%"> <el-dialog title="货单记录" :visible.sync="variabilityshow" width="75%">
<div class="head-container"> <div class="head-container">
<el-table ref="table" :data="stockData.data" v-loading="stockData.loading" row-key="id" height="450"> <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"> <template v-slot="scope">
{{ scope.row.type == 'reject' ? '退货出库' : '供应商入库' }} {{ scope.row.type == 'reject' ? '退货出库' : '供应商入库' }}
</template> </template>
@ -194,16 +194,23 @@
<template v-slot="scope"> <template v-slot="scope">
{{ dayjs(scope.row.stockTime).format('YYYY-MM-DD HH:mm:ss') }} {{ dayjs(scope.row.stockTime).format('YYYY-MM-DD HH:mm:ss') }}
</template> </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> </el-table>
</div> </div>
<div class="head-container"> <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" <!-- <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) => { layout="total, sizes, prev, pager, next, jumper" @current-change="wstockChange" @size-change="(e) => {
stockData.size = e; stockData.size = e;
stockData.page = 0; stockData.page = 0;
gettbConsInfoFlowstock(); gettbConsInfoFlowstock();
}" /> }" /> -->
<div></div>
<div style="color: #43a9fe;" @click="func()">转出库单</div>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -315,6 +322,7 @@ export default {
total: 0, total: 0,
id: '' id: ''
}, },
consdata: []//
} }
}, },
filters: { filters: {
@ -463,29 +471,40 @@ export default {
this.stockData.page = e - 1; this.stockData.page = e - 1;
this.gettbConsInfoFlowstock(); this.gettbConsInfoFlowstock();
}, },
func() {
this.$router.push({
name: 'operation_in',
query: {
consdata: this.consdata
}
})
},
async gettbConsInfoFlowstock(item) { async gettbConsInfoFlowstock(item) {
console.log(item)
if (item) { if (item) {
this.stockData.id = item.id this.stockData.id = item.id
this.consdata = item.cons
this.stockData.data = item.conFlows
} }
this.variabilityshow = true this.variabilityshow = true
this.stockData.loading = true; // this.stockData.loading = true;
let arr = [] let arr = []
// if (this.query.createdAt.length) { // if (this.query.createdAt.length) {
// arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59'] // arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
// } else { // } else {
// arr = [] // arr = []
// } // }
let res = await tbProductStockOperatepage({ // let res = await tbProductStockOperatepage({
page: this.stockData.page, // page: this.stockData.page,
size: this.stockData.size, // size: this.stockData.size,
shopId: localStorage.getItem("shopId"), // shopId: localStorage.getItem("shopId"),
type: ["cons_in", "cons_out"],//id // type: ["cons_in", "cons_out"],//id
purveyorId: this.stockData.id,// // purveyorId: this.stockData.id,//
createdAt: arr//id // createdAt: arr//id
}) // })
this.stockData.loading = false; // this.stockData.loading = false;
this.stockData.data = res.content; // this.stockData.data = res.content;
this.stockData.total = res.totalElements; // this.stockData.total = res.totalElements;
}, },
} }
} }

View File

@ -31,7 +31,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="username" label="用户名" /> <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 :show-overflow-tooltip="true" prop="address" label="IP来源" />
<el-table-column prop="description" label="描述" /> <el-table-column prop="description" label="描述" />
<el-table-column prop="browser" label="浏览器" /> <el-table-column prop="browser" label="浏览器" />

View File

@ -57,9 +57,9 @@
</el-form> </el-form>
</div> </div>
<div class="head-container"> <!-- <div class="head-container">
<div class="collect_wrap"> <div class="collect_wrap">
<!-- <div class="item"> <div class="item">
<div class="icon_wrap" style="--bg-color:#C978EE"> <div class="icon_wrap" style="--bg-color:#C978EE">
<i class="icon el-icon-s-goods"></i> <i class="icon el-icon-s-goods"></i>
</div> </div>
@ -68,7 +68,9 @@
<div class="t">总金额</div> <div class="t">总金额</div>
</div> </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"> <div class="icon_wrap" style="--bg-color:#fff">
<el-image class="img" :src="item.icon"></el-image> <el-image class="img" :src="item.icon"></el-image>
</div> </div>
@ -76,9 +78,10 @@
<div class="m">{{ item.payAmount || 0 }}</div> <div class="m">{{ item.payAmount || 0 }}</div>
<div class="t">{{ item.payType }}</div> <div class="t">{{ item.payType }}</div>
</div> </div>
</div> --> </div>
</div>
</div> </div>
</div> </div>-->
<div class="head-container"> <div class="head-container">
<el-table :data="tableData.data" v-loading="tableData.loading"> <el-table :data="tableData.data" v-loading="tableData.loading">
<el-table-column label="订单号信息"> <el-table-column label="订单号信息">

View File

@ -192,7 +192,18 @@ export default {
}, },
// //
selectConfirmGoods(res) { 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 // tab
tabChange() { tabChange() {

View File

@ -7,8 +7,12 @@
</el-input> </el-input>
</div> </div>
<div class="tree_wrap"> <div class="tree_wrap">
<el-tree :data="treeData" node-key="id" highlight-current :props="{ label: 'name' }" default-expand-all <!-- <el-tree :data="treeData" node-key="id" highlight-current :props="{ label: 'name' }" default-expand-all
@node-click="treeItemClick"></el-tree> @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> </div>
<div class="table_wrap"> <div class="table_wrap">
@ -62,6 +66,7 @@ export default {
query: { query: {
name: '' name: ''
}, },
selectCatoryIndex: 0,
selectCatory: '', selectCatory: '',
treeDataOrgin: [], treeDataOrgin: [],
treeData: [], treeData: [],
@ -88,6 +93,12 @@ export default {
this.treeData = this.treeDataOrgin.filter(item => { this.treeData = this.treeDataOrgin.filter(item => {
return item.name.includes(this.query.name) return item.name.includes(this.query.name)
}) })
if (this.treeData.length) {
this.selectCatoryIndex = 0
this.selectCatory = this.treeData[this.selectCatoryIndex]
this.getTableData()
}
}, },
// //
tableDrag() { tableDrag() {
@ -147,7 +158,8 @@ export default {
} }
}, },
// //
treeItemClick(data) { treeItemClick(data, index) {
this.selectCatoryIndex = index
this.selectCatory = data this.selectCatory = data
this.tableData.page = 1 this.tableData.page = 1
this.getTableData() this.getTableData()
@ -164,6 +176,7 @@ export default {
}) })
this.treeDataOrgin = res.content this.treeDataOrgin = res.content
this.treeData = res.content this.treeData = res.content
this.selectCatory = res.content[this.selectCatoryIndex]
this.getTableData() this.getTableData()
} catch (error) { } catch (error) {
console.log(error) console.log(error)
@ -235,6 +248,22 @@ export default {
width: 100%; width: 100%;
height: calc(100% - 70px); height: calc(100% - 70px);
overflow-y: auto; overflow-y: auto;
.item {
padding: 10px 15px;
font-size: 14px;
display: flex;
align-items: center;
&:hover {
cursor: pointer;
}
&.active {
background-color: #1890ff;
color: #fff;
}
}
} }
} }

View File

@ -4,8 +4,12 @@
:class="[isActive]" :class="[isActive]"
@click="itemClick" @click="itemClick"
> >
<span class="absolute pack" v-if="item.isPack === 'true'"> </span> <div class="absolute status-box">
<span class="absolute tui" v-if="item.status === 'return'"> 退 </span> <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="flex u-col-top">
<div class="img"> <div class="img">
<div <div
@ -14,6 +18,12 @@
> >
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</div> </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="" /> <img v-else :src="item.coverImg" class="" alt="" />
</div> </div>
<div class="good-info u-p-t-6"> <div class="good-info u-p-t-6">
@ -30,7 +40,7 @@
</div> </div>
<div class="" v-if="placeNum == 0"> <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> <div class="note flex" v-else>
<span>备注:</span> <span>备注:</span>
<span class="el-icon-edit u-font-12" @click="editNote"></span> <span class="el-icon-edit u-font-12" @click="editNote"></span>
@ -74,11 +84,23 @@
<span v-else> {{ isShowVipPrice ? vipAllPrice : allPrice }}</span> <span v-else> {{ isShowVipPrice ? vipAllPrice : allPrice }}</span>
</div> </div>
</template> </template>
<template v-else-if="item.discountSaleAmount">
<div>{{ discountNewPrice }}</div>
<div class="free-price">
<span> {{ isShowVipPrice ? vipAllPrice : allPrice }}</span>
</div>
</template>
<template v-else> <template v-else>
<div v-if="isSeatFee">{{ item.totalAmount }}</div> <div v-if="isSeatFee">{{ item.totalAmount }}</div>
<div v-else> <div v-else>
<div v-if="isShowVipPrice&&vipAllPrice!=allPrice">{{ vipAllPrice }}</div> <div v-if="isShowVipPrice && vipAllPrice != allPrice">
<div :class="{ 'free-price': isShowVipPrice&&vipAllPrice!=allPrice }"> {{ vipAllPrice }}
</div>
<div
:class="{
'free-price': isShowVipPrice && vipAllPrice != allPrice,
}"
>
<span> {{ allPrice }}</span> <span> {{ allPrice }}</span>
</div> </div>
</div> </div>
@ -142,13 +164,21 @@ export default {
}; };
}, },
computed: { 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() { vipAllPrice() {
const item = this.item; const item = this.item;
const price = const price =
this.isShowVipPrice && this.isShowVipPrice &&
item.memberPrice != null && item.memberPrice != null &&
item.memberPrice != undefined item.memberPrice != undefined
? (item.memberPrice<=0?item.salePrice:item.memberPrice) ? item.memberPrice <= 0
? item.salePrice
: item.memberPrice
: item.salePrice; : item.salePrice;
return (price * item.number + (item.packAmount || 0)).toFixed(2); return (price * item.number + (item.packAmount || 0)).toFixed(2);
}, },
@ -262,27 +292,36 @@ export default {
justify-content: space-between; justify-content: space-between;
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
transition: all 0.3s; transition: all 0.3s;
.pack { .status-box {
right: 100%;
width: 18px; 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; background: #35ac6a;
border-radius: 4px 0 4px 0;
font-size: 12px;
color: #fff;
text-align: center;
line-height: 17px;
} }
.tui { .tui {
right: 100%;
width: 18px;
height: 18px;
background: #ac4735; background: #ac4735;
border-radius: 4px 0 4px 0;
font-size: 12px;
color: #fff;
text-align: center;
line-height: 17px;
} }
&.active { &.active {
background-color: rgba(0, 0, 0, 0.04); background-color: rgba(0, 0, 0, 0.04);

View File

@ -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>

View File

@ -6,6 +6,7 @@
<span> {{ number }}</span> <span> {{ number }}</span>
</slot> </slot>
</div> </div>
<slot name="tips"></slot>
<div class="number_list_box"> <div class="number_list_box">
<div class="yd-keyboard"> <div class="yd-keyboard">
<div class="mini-number-box1"> <div class="mini-number-box1">
@ -79,13 +80,18 @@ export default {
default: false, default: false,
}, },
max: { max: {
type: Number, type: [Number,String],
default: Infinity, default: Infinity,
}, },
value: { value: {
type: [String, Number], type: [String, Number],
default: 0, default: 0,
}, },
//
isFloat: {
type: Boolean,
default: false,
}
}, },
data() { data() {
return { return {
@ -102,14 +108,21 @@ export default {
}, },
methods: { methods: {
clearFunction() { clearFunction() {
if(this.isFloat){
return this.keyboradAdd('.')
}
this.$emit("clear", this.number); this.$emit("clear", this.number);
}, },
keyboradAdd(n) { keyboradAdd(n) {
if(n=='.'&& `${this.number}`.includes('.')){
return
}
if (Number(this.number) == 0) { if (Number(this.number) == 0) {
return (this.number = n); return (this.number = n);
} }
const newval = 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); return this.$message( this.maxTips);
} }
this.number = newval; this.number = newval;

View File

@ -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>

View File

@ -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>

View File

@ -8,12 +8,20 @@
<div> <div>
<div>将临时菜添加至购物车不会影响总商品库</div> <div>将临时菜添加至购物车不会影响总商品库</div>
<div class="u-m-t-16"> <div class="u-m-t-16">
<el-form ref="form" :model="form" label-width="80px"> <el-form ref="form" :model="form" label-width="80px" :rules="rules">
<el-form-item label="菜品名称"> <el-form-item label="菜品名称" prop="name">
<el-input v-model="form.name"></el-input> <el-input
v-model="form.name"
placeholder="请输入菜品名称"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="菜品分类"> <el-form-item label="菜品分类" prop="categoryId">
<el-select v-model="form.category" filterable placeholder="选择分类"> <el-select
v-model="form.categoryId"
@change="selectChange($event, 'form', 'categoryId')"
filterable
placeholder="选择分类"
>
<el-option <el-option
v-for="item in category" v-for="item in category"
:key="item.id" :key="item.id"
@ -23,13 +31,22 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="价格"> <el-form-item label="价格" prop="price">
<el-input v-model="form.price" placeholder="请输入价格" type="number"> <el-input
<template slot="append"></template> v-model="form.price"
placeholder="请输入价格"
type="number"
>
<template slot="append"></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="单位"> <el-form-item label="单位" prop="unit">
<el-select v-model="form.unit" filterable placeholder="选择单位"> <el-select
v-model="form.unit"
filterable
placeholder="选择单位"
@change="selectChange($event, 'form', 'unit')"
>
<el-option <el-option
v-for="item in units" v-for="item in units"
:key="item.id" :key="item.id"
@ -39,13 +56,16 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="下单数量"> <el-form-item label="下单数量" prop="num">
<el-input v-model="form.num" placeholder="请输入下单数量" type="number"> <el-input
v-model="form.num"
placeholder="请输入下单数量"
type="number"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="form.note" placeholder="请输入备注" > <el-input v-model="form.note" placeholder="请输入备注"> </el-input>
</el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -57,22 +77,32 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { tbShopCategoryGet,tbShopUnit } from "@/api/shop"; import { tbShopCategoryGet, tbShopUnit } from "@/api/shop";
import * as $InsteadApi from "@/api/Instead";
export default { export default {
data() { data() {
return { return {
show: false, 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: { form: {
name: "", name: "",
category:'', categoryId: "",
price: "", price: "",
unit:'', unit: "",
num:1, num: 1,
note:'' note: "",
}, },
category:[], category: [],
units:[] units: [],
option:{}
}; };
}, },
@ -96,24 +126,52 @@ export default {
sort: "id", sort: "id",
shopId: localStorage.getItem("shopId"), shopId: localStorage.getItem("shopId"),
}); });
this.units = content this.units = content;
},
reset() {
this.$refs.form.resetFields();
}, },
reset() {},
open() { open(opt) {
this.show = true; this.show = true;
this.option=opt
}, },
close() { close() {
this.show = false; 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(); 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() { mounted() {
this.getCategory() this.getCategory();
this.getUnit() this.getUnit();
}, },
}; };
</script> </script>
@ -131,7 +189,7 @@ input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none; -webkit-appearance: none;
margin: 0; margin: 0;
} }
::v-deep .el-input__inner::-webkit-inner-spin-button { ::v-deep .el-input__inner::-webkit-inner-spin-button {
-webkit-appearance: none; -webkit-appearance: none;
margin: 0; margin: 0;
} }

View File

@ -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>

View File

@ -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>

View File

@ -399,11 +399,18 @@
<div slot="content"> <div slot="content">
<div <div
class="u-flex color-000 u-font-14 u-row-between" 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="font-bold">会员优惠 </span>
<span class="">{{ vipDiscountPrice }} </span> <span class="">{{ vipDiscountPrice }} </span>
</div> </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> </div>
<span> 已优惠{{ youhuiAllPrice }} </span> <span> 已优惠{{ youhuiAllPrice }} </span>
<i class="el-icon-arrow-right"></i> <i class="el-icon-arrow-right"></i>
@ -500,7 +507,7 @@
<el-button <el-button
size="medium" size="medium"
:disabled=" :disabled="
!order.list.length && !order.old.list.length !order.list.length && order.old.list.length <= 0
" "
@click="toCreateOrderDebounce(true)" @click="toCreateOrderDebounce(true)"
> >
@ -639,21 +646,36 @@
> >
退菜 退菜
</div> </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" class="btn"
> >
单品改价 单品改价
</div> </div>
<div <div
class="btn" class="btn"
@click="orderBtnsClick('isWaitCall')"
:class="{ disabled: order.selIndex < 0 }"
> >
等叫 {{ returnWaingText }}
</div> </div>
<div <div
class="btn no-wrap u-font-12" class="btn no-wrap u-font-12"
@click="orderBtnsClick('AllWaitCall')"
:class="{ disabled: isCreateOrder}"
> >
取消全部等叫 {{ returnWaingAllText }}
</div> --> </div>
<!-- <div <!-- <div
class="btn" class="btn"
@ -713,7 +735,7 @@
</div> </div>
<template v-if="goods.list.length"> <template v-if="goods.list.length">
<div class="goods-list"> <div class="goods-list">
<!-- <div <div
@click="lingshicaiShow" @click="lingshicaiShow"
class="goods-item lingshicai text-center color-999" class="goods-item lingshicai text-center color-999"
:class="{ :class="{
@ -723,7 +745,7 @@
> >
<span class="el-icon-plus" style="font-size: 26px"></span> <span class="el-icon-plus" style="font-size: 26px"></span>
<div class="u-m-t-10">临时菜</div> <div class="u-m-t-10">临时菜</div>
</div> --> </div>
<div <div
class="goods-item" class="goods-item"
:class="{ :class="{
@ -933,8 +955,35 @@
</template> </template>
</div> </div>
</div> </div>
<div class="u-flex flex-wrap"> <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> <span class="font-bold no-wrap">优惠券</span>
<div <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" 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 +994,7 @@
class="el-icon-arrow-down color-999 u-m-r-10" class="el-icon-arrow-down color-999 u-m-r-10"
></span> ></span>
</div> </div>
<!-- <el-button size="medium " type="text"> <!-- <el-button size="medium " type="text">
查看不可用券 查看不可用券
</el-button> --> </el-button> -->
@ -1019,6 +1069,9 @@
:disabledPayType="disabledPayType" :disabledPayType="disabledPayType"
> >
</pay-type> </pay-type>
<el-button
:disabled="disabledPayType.includes('creditBuyer')"
@click="guazhangShow" size="medium">挂账</el-button>
<div style="margin-top: 20px"> <div style="margin-top: 20px">
<el-button type="primary" size="medium" @click="payOrder"> <el-button type="primary" size="medium" @click="payOrder">
<span>立即支付</span> <span>立即支付</span>
@ -1413,7 +1466,25 @@
></return-cart> ></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>
<!-- 挂账 -->
<popup-choose-guazhang
ref="refGuaZhang"
:payMoney="yinFuJinE"
@confirm="guazhangPayConfirm"
></popup-choose-guazhang>
</div> </div>
</template> </template>
@ -1431,6 +1502,11 @@ import chooseDinersNumber from "./components/choose-diners-number.vue";
import returnCart from "./components/return-cart.vue"; import returnCart from "./components/return-cart.vue";
import moneyKeyboard from "./components/money-keyboard.vue"; import moneyKeyboard from "./components/money-keyboard.vue";
import caiAdd from "./components/popup-linshiCai.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 tuanQuanTable from "./components/tuan-quan-table.vue";
import popupChooseGuazhang from "./components/popup-choose-guazhang.vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { tbShopInfo } from "@/api/user"; import { tbShopInfo } from "@/api/user";
import { hasPermission } from "@/utils/limits.js"; import { hasPermission } from "@/utils/limits.js";
@ -1463,7 +1539,9 @@ import {
$calcUsablePoints, $calcUsablePoints,
$calcDeDuctionPoints, $calcDeDuctionPoints,
} from "@/api/table"; } from "@/api/table";
import { tbShopCategoryGet } from "@/api/shop"; import { tbShopCategoryGet } from "@/api/shop";
import { $checkCoupon,$waitCall } from "@/api/Instead";
import { import {
isCanBuy, isCanBuy,
arrayContainsAll, arrayContainsAll,
@ -1480,10 +1558,15 @@ import { returnProductCoupAllPrice } from "./quan_util.js";
//0n //0n
let $goodsPayPriceMap = {}; let $goodsPayPriceMap = {};
import { $status } from "@/utils/table.js"; import { $status } from "@/utils/table.js";
import PopupChooseGuazhang from "./components/popup-choose-guazhang.vue";
let $originTableList = []; let $originTableList = [];
export default { export default {
components: { components: {
popupChooseGuazhang,
cartChangePrice,
popTuanQuan,
tuanQuanTable,
caiAdd, caiAdd,
quansPop, quansPop,
returnCart, returnCart,
@ -1496,9 +1579,12 @@ export default {
moneyDiscount, moneyDiscount,
cartItem, cartItem,
chooseDinersNumber, chooseDinersNumber,
PopupChooseGuazhang,
}, },
data() { data() {
return { return {
//
guazhangRen: "",
disabledPayType: [], disabledPayType: [],
// //
points: { points: {
@ -1512,6 +1598,8 @@ export default {
value: 0, value: 0,
toMoney: 0, toMoney: 0,
}, },
//
tuanQuan: "",
// //
quansSelArr: [], quansSelArr: [],
// //
@ -1710,9 +1798,33 @@ export default {
}, },
}, },
timer: null, timer: null,
isAllWaitCall: false,
}; };
}, },
computed: { 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() { pointsDiscountAmount() {
if (this.points.selected) { if (this.points.selected) {
return this.points.toMoney; return this.points.toMoney;
@ -1765,6 +1877,8 @@ export default {
!this.order.selGoods || !this.order.selGoods ||
this.order.old.list.length <= 0 || this.order.old.list.length <= 0 ||
this.order.selGoods.status == "return" this.order.selGoods.status == "return"
||this.order.selGoods.useType=='dine-in'
||this.order.selGoods.useType=='dine-in-before'
); );
}, },
title() { title() {
@ -1918,8 +2032,28 @@ export default {
}, 0); }, 0);
return (oldMemberPrice + nowMemberprice).toFixed(2); 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() { youhuiAllPrice() {
return (this.vipDiscountPrice * 1 + this.allGiftMoney * 1).toFixed(2); return (
this.vipDiscountPrice * 1 +
this.allGiftMoney * 1 +
this.discountSaleAmount * 1
).toFixed(2);
}, },
allNumber() { allNumber() {
const oldNumber = this.order.old.list.reduce((a, b) => { const oldNumber = this.order.old.list.reduce((a, b) => {
@ -1975,7 +2109,7 @@ export default {
watch: { watch: {
yinFuJinE: function (newval) { yinFuJinE: function (newval) {
if (newval <= 0) { if (newval <= 0) {
this.disabledPayType = ["scanCode", "deposit"]; this.disabledPayType = ["scanCode", "deposit","creditBuyer"];
} else { } else {
this.disabledPayType = []; this.disabledPayType = [];
} }
@ -2194,6 +2328,38 @@ export default {
this.open(this.$route.query); this.open(this.$route.query);
}, },
methods: { methods: {
//
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) { returnProDiscount(row) {
console.log(row); console.log(row);
// //
@ -2216,20 +2382,24 @@ export default {
} }
}, },
lingshicaiShow() { lingshicaiShow() {
this.$refs.refPopAddCai.open(); this.$refs.refPopAddCai.open({
masterId: this.masterId,
tableId: this.table.tableId,
vipUserId: this.vipUser.id,
});
}, },
delQuan(row) { delQuan(row) {
const index = this.quansSelArr.findIndex((v) => v.id == row.id); const index = this.quansSelArr.findIndex((v) => v.id == row.id);
console.log(index); console.log(index);
if (index != -1) { if (index != -1) {
this.quansSelArr.splice(index, 1); this.quansSelArr.splice(index, 1);
this.quansSelArr this.quansSelArr.map((v, index) => {
.map((v, index) => { return {
return { ...v,
...v, discountAmount:
discountAmount:v.type==2?this.returnProDiscount(v):v.discountAmount, v.type == 2 ? this.returnProDiscount(v) : v.discountAmount,
}; };
}); });
} }
}, },
async getCalcUsablePoints() { async getCalcUsablePoints() {
@ -2249,8 +2419,8 @@ export default {
this.vipUser.accountPoints, this.vipUser.accountPoints,
this.points.res.maxUsablePoints || 0 this.points.res.maxUsablePoints || 0
); );
if(!pointsRes.usable){ if (!pointsRes.usable) {
this.points.selected=false this.points.selected = false;
} }
} }
return pointsRes; return pointsRes;
@ -2296,11 +2466,12 @@ export default {
this.createOrder.discount = 1; this.createOrder.discount = 1;
this.points.selected = ""; this.points.selected = "";
e.map((v, index) => { e.map((v, index) => {
return { return {
...v, ...v,
discountAmount:v.type==2? this.returnProDiscount(v):v.discountAmount, discountAmount:
}; v.type == 2 ? this.returnProDiscount(v) : v.discountAmount,
}); };
});
this.quansSelArr = [...e]; this.quansSelArr = [...e];
$goodsPayPriceMap = goodsPayPriceMap; $goodsPayPriceMap = goodsPayPriceMap;
}, },
@ -2892,7 +3063,7 @@ export default {
this.pays(); this.pays();
}, },
// //
async pays() { async pays(par) {
this.loading = true; this.loading = true;
const userCouponInfos = this.quansSelArr.reduce((prve, cur) => { const userCouponInfos = this.quansSelArr.reduce((prve, cur) => {
const index = prve.findIndex((v) => v.userCouponId == cur.couponId); const index = prve.findIndex((v) => v.userCouponId == cur.couponId);
@ -2907,6 +3078,15 @@ export default {
return prve; return prve;
}, []); }, []);
try { 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({ const res = await $payOrder({
tableId: this.table.tableId, tableId: this.table.tableId,
masterId: this.masterId, masterId: this.masterId,
@ -2915,8 +3095,9 @@ export default {
vipUserId: this.createOrder.data.memberId || this.vipUser.id, vipUserId: this.createOrder.data.memberId || this.vipUser.id,
discount: this.createOrder.discount, discount: this.createOrder.discount,
code: this.createOrder.code, code: this.createOrder.code,
userCouponInfos, userCouponInfos: userCouponInfos.length > 0 ? userCouponInfos : "",
pointsNum: this.points.value, pointsNum: this.points.value,
...par,
}); });
this.loading = false; this.loading = false;
this.payOrderSuccess(); this.payOrderSuccess();
@ -3044,7 +3225,16 @@ export default {
updateOrder(par = {}) { updateOrder(par = {}) {
let item = this.order.list[this.order.selIndex]; let item = this.order.list[this.order.selIndex];
console.log(this.table); console.log(this.table);
const { productId, skuId, isPack, isGift, number, id } = item; const {
productId,
skuId,
isPack,
isGift,
number,
id,
isPrint,
isWaitCall,
} = item;
$updateCart({ $updateCart({
cartId: id, cartId: id,
masterId: this.masterId, masterId: this.masterId,
@ -3055,6 +3245,8 @@ export default {
num: number, num: number,
isPack: isPack === "true" ? true : false, isPack: isPack === "true" ? true : false,
isGift: isGift === "true" ? true : false, isGift: isGift === "true" ? true : false,
isPrint,
isWaitCall,
...par, ...par,
}).then((res) => { }).then((res) => {
this.$set(this.order.list, this.order.selIndex, { this.$set(this.order.list, this.order.selIndex, {
@ -3107,7 +3299,7 @@ export default {
// }, // },
// //
orderBtnsClick(key) { async orderBtnsClick(key) {
const orderGoods = this.order.list[this.order.selIndex]; const orderGoods = this.order.list[this.order.selIndex];
if (this.key != "isJieZhang" && this.payAfter) { if (this.key != "isJieZhang" && this.payAfter) {
this.createOrderClose(); this.createOrderClose();
@ -3132,6 +3324,27 @@ export default {
if (key === "del") { if (key === "del") {
return this.removeCart(); 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") { if (key === "save") {
this.prveOrder.list.push({ this.prveOrder.list.push({
cart: this.order.list, cart: this.order.list,
@ -3532,6 +3745,7 @@ export default {
tableId: this.table.tableId, tableId: this.table.tableId,
num: this.skuGoods.number, // 0 num: this.skuGoods.number, // 0
isPack: false, // isPack: false, //
isWaitCall:this.isAllWaitCall //
}); });
this.orderListPush({ ...res, specSnap: name }); this.orderListPush({ ...res, specSnap: name });
// this.orderListPush({ // this.orderListPush({
@ -3637,6 +3851,7 @@ export default {
}, },
reset() { reset() {
// this.goods.list = []; // this.goods.list = [];
this.guazhangRen = "";
this.order.status = ""; this.order.status = "";
this.loading = false; this.loading = false;
this.table = ""; this.table = "";
@ -3671,7 +3886,8 @@ export default {
// //
setCart(res) { setCart(res) {
console.log(res); console.log(res);
const { seatFee } = res; try {
const { seatFee } = res;
this.order.seatFee = seatFee this.order.seatFee = seatFee
? { ? {
...seatFee, ...seatFee,
@ -3690,6 +3906,32 @@ export default {
this.order.old.list = oldCart ? oldCart : []; this.order.old.list = oldCart ? oldCart : [];
// this.order.gift.list = returnGiftArr(res.records); // this.order.gift.list = returnGiftArr(res.records);
console.log(this.order.old.list); 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() { async getCart() {
@ -3833,6 +4075,7 @@ export default {
tableId: this.table.tableId, tableId: this.table.tableId,
num: item.specList[0].suit, // 0 num: item.specList[0].suit, // 0
isPack: false, // isPack: false, //
isWaitCall:this.isAllWaitCall //
}); });
this.orderListPush(res); this.orderListPush(res);
} }
@ -4114,9 +4357,7 @@ input[type="number"]::-webkit-outer-spin-button {
background-color: #fff; background-color: #fff;
height: 100%; height: 100%;
} }
::v-deep .el-button--text {
// color: #000;
}
::v-deep .meal_box .el-button-group { ::v-deep .meal_box .el-button-group {
width: 100%; width: 100%;
display: flex; display: flex;
@ -4635,13 +4876,6 @@ input[type="number"]::-webkit-outer-spin-button {
background-color: #fff; background-color: #fff;
border: 1px solid #dcdfe6; 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 { ::v-deep .tag-group .el-tag--dark {
background: rgba(34, 191, 100, 0.1); background: rgba(34, 191, 100, 0.1);

View File

@ -218,4 +218,14 @@ export function returnCouponAllPrice(coupArr, goodsArr, vipUser) {
const poductAllprice=returnProductCouponAllPrice(coupArr, goodsArr, vipUser) const poductAllprice=returnProductCouponAllPrice(coupArr, goodsArr, vipUser)
const pointAllPrice=returnFullReductionCouponAllPrice(coupArr) const pointAllPrice=returnFullReductionCouponAllPrice(coupArr)
return (poductAllprice*1+pointAllPrice*1).toFixed(2); 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
} }