Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into test
This commit is contained in:
commit
a175a76deb
|
|
@ -7,7 +7,7 @@ const request=http.request
|
|||
*/
|
||||
export function tbPrintMachine(data, method = 'post') {
|
||||
return request({
|
||||
url: '/api/tbPrintMachine',
|
||||
url: '/api/shop-config/printer',
|
||||
method: method,
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
|
|
@ -22,7 +22,7 @@ export function tbPrintMachine(data, method = 'post') {
|
|||
*/
|
||||
export function tbPrintMachineGet(params) {
|
||||
return request({
|
||||
url: '/api/tbPrintMachine',
|
||||
url: '/api/shop-config/printer/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
|
|
@ -30,4 +30,28 @@ export function tbPrintMachineGet(params) {
|
|||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// 修改打印机状态
|
||||
export function shopConfigprinter(params) {
|
||||
return request({
|
||||
url: '/api/shop-config/printer',
|
||||
method: 'put',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// * 打印机详情
|
||||
export function printerd(id) {
|
||||
return request({
|
||||
url: '/api/shop-config/printer/' + id,
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
// 删除
|
||||
export function delTableHandle(id) {
|
||||
return request({
|
||||
url: '/api/shop-config/printer/' + id,
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,8 @@ function commonsProcess(showLoading, httpReqCallback) {
|
|||
// if(bodyData.code == 500){ // 密码已过期, 直接跳转到更改密码页面
|
||||
// uni.redirectTo({url: '/pages/login/index'})
|
||||
// }
|
||||
return Promise.reject(bodyData)
|
||||
return bodyData
|
||||
// return Promise.reject(bodyData)
|
||||
}
|
||||
|
||||
// 加密数据
|
||||
|
|
|
|||
|
|
@ -18,6 +18,21 @@ export function dateProduct(params) {
|
|||
params
|
||||
})
|
||||
}
|
||||
// 是否开启
|
||||
export function updateStatus(data) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff/updateStatus`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 编辑
|
||||
export function tbPlussShopStaffDetail(id) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff/${id}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
// 桌型列表
|
||||
export function callTable(params) {
|
||||
return request({
|
||||
|
|
@ -66,4 +81,41 @@ export function callTablecall(data) {
|
|||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
}
|
||||
// 获取员工列表
|
||||
export function rolesGet() {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
// 删除员工
|
||||
export function shopStaffDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff`,
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 新增员工获取权限
|
||||
export function tbShopPermissionList() {
|
||||
return request({
|
||||
url: `/api/tbShopPermission/list`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
// 获取角色权限
|
||||
export function getroles() {
|
||||
return request({
|
||||
url: `/api/roles`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
export function tbPlussShopStaff(data) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff`,
|
||||
method: data.id ? "put" : "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -15,7 +15,8 @@
|
|||
</JeepayTableList>
|
||||
<view class="footer-wrapper">
|
||||
<view class="footer-button footer-button-style">
|
||||
<button hover-class="hover-button" hover-stay-time="150" class="flex-center" @tap="createStaff">创建</button>
|
||||
<button hover-class="hover-button" hover-stay-time="150" class="flex-center"
|
||||
@tap="createStaff">创建</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -23,87 +24,104 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { nextTick, reactive, ref } from 'vue';
|
||||
import { onReachBottom, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import emit from '@/commons/utils/emit.js';
|
||||
import { reqLoad, API_URL_SYS_USER_LIST } from '@/http/apiManager.js';
|
||||
import SysUserRender from '@/pages/list/render/SysUserRender.vue';
|
||||
import {
|
||||
nextTick,
|
||||
reactive,
|
||||
ref
|
||||
} from 'vue';
|
||||
import {
|
||||
onReachBottom,
|
||||
onShow,
|
||||
onUnload
|
||||
} from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import emit from '@/commons/utils/emit.js';
|
||||
import SysUserRender from '@/pages/list/render/SysUserRender.vue';
|
||||
import {rolesGet } from '@/http/yskApi/requestAll.js';
|
||||
const jeepayTableListRef = ref();
|
||||
const jeepayPopupConfirmRef = ref();
|
||||
|
||||
const jeepayTableListRef = ref();
|
||||
const jeepayPopupConfirmRef = ref();
|
||||
onReachBottom(() => {});
|
||||
|
||||
onReachBottom(() => {});
|
||||
// // 监听 更新事件
|
||||
onUnload(() => uni.$off(emit.ENAME_REF_SYS_USER_LIST));
|
||||
uni.$on(emit.ENAME_REF_SYS_USER_LIST, function(data) {
|
||||
jeepayTableListRef.value.refTable(true);
|
||||
});
|
||||
|
||||
// // 监听 更新事件
|
||||
onUnload(() => uni.$off(emit.ENAME_REF_SYS_USER_LIST));
|
||||
uni.$on(emit.ENAME_REF_SYS_USER_LIST, function (data) {
|
||||
jeepayTableListRef.value.refTable(true);
|
||||
});
|
||||
// 请求
|
||||
function reqTableDataFunc(params) {
|
||||
// 不查询普通用户
|
||||
params.isNotHasType2 = 1;
|
||||
rolesGet({
|
||||
}).then((res) => {
|
||||
console.log(res, '调试1')
|
||||
})
|
||||
return res.content
|
||||
}
|
||||
|
||||
// 请求
|
||||
function reqTableDataFunc(params) {
|
||||
// 不查询普通用户
|
||||
params.isNotHasType2 = 1;
|
||||
|
||||
return reqLoad.list(API_URL_SYS_USER_LIST, params);
|
||||
}
|
||||
|
||||
// 创建员工
|
||||
const createStaff = () => {
|
||||
go.to('PAGES_USER_EDIT');
|
||||
};
|
||||
// 创建员工
|
||||
const createStaff = () => {
|
||||
go.to('PAGES_USER_EDIT');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.sta-input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 30rpx;
|
||||
height: 110rpx;
|
||||
background-color: $J-bg-ff;
|
||||
.input-main {
|
||||
flex: 1;
|
||||
.sta-input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 70rpx;
|
||||
background-color: $J-bg-f5;
|
||||
border-radius: $J-b-r12;
|
||||
color: rgba(0, 0, 0, 0.35);
|
||||
font-size: 27rpx;
|
||||
font-weight: 400;
|
||||
image {
|
||||
padding: 22rpx;
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
padding: 0 30rpx;
|
||||
height: 110rpx;
|
||||
background-color: $J-bg-ff;
|
||||
|
||||
.input-main {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 70rpx;
|
||||
background-color: $J-bg-f5;
|
||||
border-radius: $J-b-r12;
|
||||
color: rgba(0, 0, 0, 0.35);
|
||||
font-size: 27rpx;
|
||||
font-weight: 400;
|
||||
|
||||
image {
|
||||
padding: 22rpx;
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-more {
|
||||
margin-left: 30rpx;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
}
|
||||
}
|
||||
.icon-more {
|
||||
margin-left: 30rpx;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
}
|
||||
}
|
||||
.footer-wrapper {
|
||||
height: 170rpx;
|
||||
background-color: transparent;
|
||||
.footer-button {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 30rpx;
|
||||
button {
|
||||
height: 110rpx;
|
||||
font-size: 33rpx;
|
||||
font-weight: 500;
|
||||
color: $J-color-tff;
|
||||
border-radius: 20rpx;
|
||||
background: $jeepay-bg-primary;
|
||||
}
|
||||
.hover-button {
|
||||
opacity: 0.5;
|
||||
|
||||
.footer-wrapper {
|
||||
height: 170rpx;
|
||||
background-color: transparent;
|
||||
|
||||
.footer-button {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 30rpx;
|
||||
|
||||
button {
|
||||
height: 110rpx;
|
||||
font-size: 33rpx;
|
||||
font-weight: 500;
|
||||
color: $J-color-tff;
|
||||
border-radius: 20rpx;
|
||||
background: $jeepay-bg-primary;
|
||||
}
|
||||
|
||||
.hover-button {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
@ -70,7 +70,6 @@
|
|||
page: 1,
|
||||
size: 9999
|
||||
}).then((res) => {
|
||||
console.log(res, '调试1')
|
||||
datas.list = res.records
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,20 @@
|
|||
<!-- 播报弹窗 -->
|
||||
<uni-popup ref="alertDialog" type="dialog">
|
||||
<uni-popup-dialog :type="datas.msgType" cancelText="完成" confirmText="过号" confirmText-color="#000" title="播报"
|
||||
content="通知消息已发送" @confirm="dialogConfirm(1)" @close="dialogConfirm(2)"></uni-popup-dialog>
|
||||
@confirm="dialogConfirm(1)" @close="dialogConfirm(2)">
|
||||
<view class="">
|
||||
<view class="">
|
||||
正在叫号请稍后
|
||||
</view>
|
||||
<view style="font-size: 24rpx; text-align:center;color: #52C41A;"
|
||||
v-if="datas.profilepicturedata.state==1">
|
||||
已发送至用户
|
||||
</view>
|
||||
<view style="font-size: 24rpx;text-align:center;color: #F02C45;" v-else>
|
||||
用户未订阅消息
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<!-- 取号遮罩层 -->
|
||||
<up-popup :show="datas.show" :round="18" mode="center" @close="close" @open="open">
|
||||
|
|
@ -129,7 +142,10 @@
|
|||
// 顶部全部\大桌选择
|
||||
selecttopType: '',
|
||||
// 选中拨号的id
|
||||
dialId: ""
|
||||
dialId: "",
|
||||
// 拨号是否订阅
|
||||
profilepicturedata: ""
|
||||
|
||||
})
|
||||
onMounted(() => {
|
||||
getList()
|
||||
|
|
@ -215,17 +231,7 @@
|
|||
datas.showtowData = res
|
||||
datas.phone = ''
|
||||
getList()
|
||||
// 取号成功
|
||||
// getrefs.ctx.$refs.uToastRef.show({
|
||||
// type: 'default',
|
||||
// title: '默认主题',
|
||||
// message: "取号成功",
|
||||
// iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png',
|
||||
// complete() {
|
||||
// datas.phone = ''
|
||||
// getList()
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -240,8 +246,8 @@
|
|||
callTablecall({
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
callQueueId: item.id
|
||||
}).then(() => {
|
||||
// datas.msgType = type
|
||||
}).then((res) => {
|
||||
datas.profilepicturedata = res
|
||||
getrefs.ctx.$refs.alertDialog.open()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,68 +1,179 @@
|
|||
<template>
|
||||
<view class="page-gray color-333 u-font-28">
|
||||
<view class="block">
|
||||
<picker-item title="打印机类型" v-model="brands.selIndex" rangeKey="name" :list="brands.list"></picker-item>
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view class="title">设备尺寸</view>
|
||||
<view class="u-m-t-16">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange">
|
||||
<label class="radio u-m-r-60" v-for="(item,index) in deciveSize.list" :key="index">
|
||||
<radio :value="''+index" :checked="index === deciveSize.selIndex" class="scale7" />
|
||||
<text>{{item.label}}</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<picker-item title="打印机品牌" v-model="form.contentType" :modelValue="form.contentType"
|
||||
:list="brandt.list"></picker-item>
|
||||
<picker-item title="小票打印" v-model="form.subType" :modelValue="form.subType"
|
||||
:list="receipt.list"></picker-item>
|
||||
<view class="u-p-b-14 u-m-b-24 border-bottom">
|
||||
<view class="title">名称</view>
|
||||
<view class="title">打印机名称</view>
|
||||
<view class="">
|
||||
<uni-easyinput :inputBorder="false" :padding-none="true" v-model="form.form"
|
||||
<uni-easyinput :inputBorder="false" :padding-none="true" v-model="form.name"
|
||||
placeholder="设置打印机名称"></uni-easyinput>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-b-14 u-m-b-24 border-bottom">
|
||||
<view class="title">设备号</view>
|
||||
<view class="title">打印机编号</view>
|
||||
<view class="">
|
||||
<uni-easyinput :inputBorder="false" :padding-none="true" v-model="form.form"
|
||||
placeholder="输入设备号"></uni-easyinput>
|
||||
<uni-easyinput :inputBorder="false" :padding-none="true" v-model="form.address"
|
||||
placeholder="设置打印机名称"></uni-easyinput>
|
||||
</view>
|
||||
</view>
|
||||
<picker-item title="打印份数" v-model="printerNums.selIndex" rangeKey="label"
|
||||
:list="printerNums.list"></picker-item>
|
||||
<picker-item title="出品模式" v-model="form.config.model" rangeKey="name" rangeValue="value"
|
||||
:list="models"></picker-item>
|
||||
<picker-item title="打印类型" v-model="form.subType" rangeKey="name" rangeValue="value"
|
||||
:list="subTypes"></picker-item>
|
||||
<picker-item title="尾部留空"
|
||||
v-model="form.config.feet" rangeKey="name" rangeValue="value"
|
||||
:list="feets"></picker-item>
|
||||
|
||||
<view class="u-p-b-24 u-flex u-row-between u-m-b-24 border-bottom">
|
||||
<view class="title">自动切刀</view>
|
||||
<view class="u-p-b-14 u-m-b-24 border-bottom">
|
||||
<view class="title">打印机密钥</view>
|
||||
<view class="">
|
||||
<my-switch v-model="form.config.autoCut"></my-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-b-24 u-flex u-row-between u-m-b-24 border-bottom">
|
||||
<view class="title">状态</view>
|
||||
<view class="">
|
||||
<my-switch v-model="form.config.autoCut"></my-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-b-24 u-flex u-row-between u-m-b-24 border-bottom">
|
||||
<view class="title">排序</view>
|
||||
<view class="">
|
||||
<uni-number-box v-model="form.sort" ></uni-number-box>
|
||||
<uni-easyinput :inputBorder="false" :padding-none="true" v-model="form.port"
|
||||
placeholder="设置打印机名称"></uni-easyinput>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view class="title">小票尺寸</view>
|
||||
<view class="u-m-t-16">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'receiptSize')">
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="58mm" :checked="form.receiptSize == '58mm'" class="scale7" />
|
||||
<text>58mm</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="80mm" :checked="form.receiptSize == '80mm'" class="scale7" />
|
||||
<text>80mm</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view class="title">分类打印</view>
|
||||
<view class="u-m-t-16">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'classifyPrint')">
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="0" :checked="form.classifyPrint == '0'" class="scale7" />
|
||||
<text>打印所有</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="1" :checked="form.classifyPrint == '1'" class="scale7" />
|
||||
<text>部分分类</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="2" :checked="form.classifyPrint == '2'" class="scale7" />
|
||||
<text>部分商品</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view class="title">桌台打印</view>
|
||||
<view class="u-m-t-16">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'tablePrint')">
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="0" :checked="form.tablePrint == '0'" class="scale7" />
|
||||
<text>打印所有</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="1" :checked="form.tablePrint == '1'" class="scale7" />
|
||||
<text>打印部分桌台</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view class="title">打印数量</view>
|
||||
<view class="u-m-t-16">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'printQty')">
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="c1m1^2" :checked="form.printQty == 'c1m1^2'" class="scale7" />
|
||||
<text>顾客联+商家联「2张」</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="m1^1" :checked="form.printQty == 'm1^1'" class="scale7" />
|
||||
<text>只打印商家联「1张」</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="c1^1" :checked="form.printQty == 'c1^1'" class="scale7" />
|
||||
<text>只打印顾客联「1张」</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="c2m1^3" :checked="form.printQty == 'c2m1^3'" class="scale7" />
|
||||
<text>2张顾客联+1张商家联「3张」</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view class="title">打印方式</view>
|
||||
<view class="u-m-t-16">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'printMethod')">
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="1" :checked="form.printMethod == '1'" class="scale7" />
|
||||
<text>普通</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="2" :checked="form.printMethod == '2'" class="scale7" />
|
||||
<text>单个菜</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view class="title">打印类型</view>
|
||||
<view class="u-m-t-16" style="display: flex;">
|
||||
<up-checkbox-group v-model="form.printType">
|
||||
<up-checkbox :customStyle="{marginBottom: '8px'}" label="确认退款单" name="1"
|
||||
style="margin-right: 40rpx;font-size: 28rpx;">
|
||||
</up-checkbox>
|
||||
<up-checkbox :customStyle="{marginBottom: '8px'}" label="交班单" name="2"
|
||||
style="margin-right: 40rpx;font-size: 28rpx;">
|
||||
</up-checkbox>
|
||||
<up-checkbox :customStyle="{marginBottom: '8px'}" label="排队取号" name="3"
|
||||
style="margin-right: 40rpx;font-size: 28rpx;">
|
||||
</up-checkbox>
|
||||
</up-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view class="title">打印单据</view>
|
||||
<view class="u-m-t-16">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'printReceipt')">
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="0" class="scale7" />
|
||||
<text>全部打印</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="1" :checked="form.printReceipt == '1'" class="scale7" />
|
||||
<text>仅厨房</text>
|
||||
</label><label class="radio u-m-r-60">
|
||||
<radio value="2" :checked="form.printReceipt == '2'" class="scale7" />
|
||||
<text>仅前台</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-p-b-24 u-flex u-row-between u-m-b-24 border-bottom">
|
||||
<view class="title">打印机状态</view>
|
||||
<view class="">
|
||||
<!-- <my-switch v-model="form.status"></my-switch> -->
|
||||
<my-switch v-model="form.status"></my-switch>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="u-p-b-24 u-flex u-row-between u-m-b-24 border-bottom">
|
||||
<view class="title">排序</view>
|
||||
<view class="">
|
||||
<uni-number-box v-model="form.sort"></uni-number-box>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view class="title font-bold">商品分类</view>
|
||||
<view class="u-m-t-16 u-flex u-row-between " @click="categoryShow">
|
||||
<view class="color-333" v-if="form.sort">{{form.sort}}</view>
|
||||
<view class="color-999" v-else>请选择</view>
|
||||
<uni-icons type="right" color="#999" size="16"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<view style="height: 60rpx;"></view>
|
||||
|
|
@ -71,8 +182,8 @@
|
|||
<my-button shape="circle" @click="save">保存</my-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 选择分类 -->
|
||||
<choose-category v-model="chooseCategoryShow"></choose-category>
|
||||
</view>
|
||||
|
|
@ -84,7 +195,9 @@
|
|||
import {
|
||||
devices,
|
||||
models,
|
||||
subTypes
|
||||
subTypes,
|
||||
brand,
|
||||
receipts
|
||||
} from '@/pagePrinter/devices.js'
|
||||
import {
|
||||
onLoad,
|
||||
|
|
@ -102,13 +215,24 @@
|
|||
import myRadioGroup from './components/my-radio-group.vue';
|
||||
import * as Api from '@/http/yskApi/devices.js'
|
||||
import chooseCategory from './components/choose-category.vue';
|
||||
|
||||
//选择分类
|
||||
let chooseCategoryShow=ref(false)
|
||||
function categoryShow(){
|
||||
chooseCategoryShow.value=true
|
||||
}
|
||||
|
||||
//选择分类
|
||||
let chooseCategoryShow = ref(false)
|
||||
|
||||
function categoryShow() {
|
||||
chooseCategoryShow.value = true
|
||||
}
|
||||
// brand
|
||||
const brandt = reactive({
|
||||
list: brand,
|
||||
selIndex: '',
|
||||
})
|
||||
// 小票
|
||||
const receipt = reactive({
|
||||
list: receipts,
|
||||
selIndex: '',
|
||||
})
|
||||
let userId = ref(null)
|
||||
//品牌
|
||||
const brands = reactive({
|
||||
list: devices,
|
||||
|
|
@ -129,8 +253,8 @@
|
|||
selIndex: 1
|
||||
})
|
||||
|
||||
function sizeChange(e) {
|
||||
deciveSize.selIndex = e.detail.value
|
||||
function sizeChange(e, name) {
|
||||
form[name] = e.detail.value
|
||||
}
|
||||
|
||||
//打印份数
|
||||
|
|
@ -144,39 +268,52 @@
|
|||
selIndex: 0
|
||||
})
|
||||
//尾部留空
|
||||
const feets = ref([0,1,2,3,4,5,8].map(v=>{
|
||||
return v+'行'
|
||||
const feets = ref([0, 1, 2, 3, 4, 5, 8].map(v => {
|
||||
return v + '行'
|
||||
}))
|
||||
|
||||
const form = reactive({
|
||||
id: '',
|
||||
contentType: '',
|
||||
config: {
|
||||
width: '80mm', // 设备尺寸
|
||||
printerNum: 1, //打印份数
|
||||
categoryList: '', // 商品分类
|
||||
model: 'normal', // 出品模式,
|
||||
feet: '0',
|
||||
autoCut: 0
|
||||
},
|
||||
name: '',
|
||||
subType: 'kitchen', // 打印类型
|
||||
let form = reactive({
|
||||
sort: "0",
|
||||
status: 0,
|
||||
sort: ''
|
||||
connectionType: "network",
|
||||
printType: [],
|
||||
name: ''
|
||||
})
|
||||
|
||||
function save() {
|
||||
async function save() {
|
||||
if (userId.value) {
|
||||
delete form.createdAt
|
||||
delete form.updatedAt
|
||||
const res = await Api.tbPrintMachine({
|
||||
...form
|
||||
}, 'put')
|
||||
} else {
|
||||
const res = await Api.tbPrintMachine({
|
||||
...form
|
||||
})
|
||||
}
|
||||
|
||||
go.to('/pagePrinter/index/index')
|
||||
}
|
||||
watch(() => form.config.model, (newval) => {
|
||||
console.log(newval);
|
||||
})
|
||||
// watch(() => form.config.model, (newval) => {
|
||||
// console.log(newval);
|
||||
// })
|
||||
|
||||
const option = reactive({})
|
||||
|
||||
onLoad((opt) => {
|
||||
console.log(opt);
|
||||
Object.assign(option, opt)
|
||||
// const option = reactive({})
|
||||
async function getdetails() {
|
||||
const res = await Api.printerd(userId.value)
|
||||
form = Object.assign(form, res)
|
||||
form.printType = JSON.parse(res.printType)
|
||||
}
|
||||
onLoad((options) => {
|
||||
if (options.id) {
|
||||
// 有id是编辑,获取详情
|
||||
userId.value = options.id
|
||||
getdetails()
|
||||
} else {
|
||||
userId.value = null
|
||||
}
|
||||
// Object.assign(option, opt)
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
|
||||
|
|
@ -205,7 +342,8 @@
|
|||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.fixed_b{
|
||||
|
||||
.fixed_b {
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
bottom: calc(env(safe-area-inset-bottom) + 10rpx);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
<template>
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view class="title font-bold">{{title}}</view>
|
||||
<picker
|
||||
@change="change"
|
||||
:range-key="rangeKey"
|
||||
:value="index"
|
||||
:range="list">
|
||||
<picker @change="change" range-key="name" :value="value" :range="list">
|
||||
<view class="u-m-t-16 u-flex u-row-between ">
|
||||
<view class="color-333" v-if="selText">{{selText}}</view>
|
||||
<view class="color-999" v-else>请选择</view>
|
||||
|
|
@ -18,17 +14,10 @@
|
|||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
ref, watch
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
const props = defineProps({
|
||||
rangeValue:{
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
},
|
||||
rangeKey:{
|
||||
type:String,
|
||||
default:'label'
|
||||
},
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
|
|
@ -38,49 +27,23 @@
|
|||
default: '标题'
|
||||
},
|
||||
modelValue: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
type: String,
|
||||
}
|
||||
})
|
||||
function isObj(obj){
|
||||
return typeof obj ==='object'
|
||||
}
|
||||
function findIndex(){
|
||||
return props.list.findIndex(v=>{
|
||||
if(isObj(v)){
|
||||
return v[props.rangeValue]==props.modelValue
|
||||
}else{
|
||||
return v==props.modelValue
|
||||
}
|
||||
})
|
||||
}
|
||||
function findValue(){
|
||||
const item=props.list[index.value]
|
||||
if(isObj(item)){
|
||||
return item[props.rangeValue]
|
||||
}else{
|
||||
return item
|
||||
}
|
||||
}
|
||||
const computedIndex=props.rangeValue? findIndex(): props.modelValue
|
||||
const index = ref(computedIndex)
|
||||
const index = ref(props.modelValue)
|
||||
const emits = defineEmits(['update:modelValue'], )
|
||||
watch(()=>index.value,(newval)=>{
|
||||
const value=props.rangeValue?findValue() :newval
|
||||
console.log(value);
|
||||
emits('update:modelValue',value)
|
||||
const selText = computed(() => {
|
||||
const item = props.list.filter(ele => ele.value == props.modelValue)[0]
|
||||
return item.name
|
||||
})
|
||||
function change(e){
|
||||
index.value=e.detail.value
|
||||
|
||||
watch(() => index.value, (newval) => {
|
||||
emits('update:modelValue', props.list[newval].value)
|
||||
})
|
||||
|
||||
function change(e) {
|
||||
index.value = e.detail.value
|
||||
}
|
||||
const selText=computed(()=>{
|
||||
const item=props.list[index.value]
|
||||
if(item&&isObj(item)){
|
||||
return item?item[props.rangeKey]:''
|
||||
}else{
|
||||
return item
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -1,44 +1,63 @@
|
|||
export const devices = [
|
||||
{
|
||||
value: 'printer',
|
||||
name: '本地'
|
||||
},
|
||||
{
|
||||
value: 'yxyPrinter',
|
||||
name: '云想印'
|
||||
},
|
||||
{
|
||||
value: 'fePrinter',
|
||||
name: '飞鹅'
|
||||
}
|
||||
export const brand = [{
|
||||
value: 'yxyPrinter',
|
||||
name: '云想印'
|
||||
},
|
||||
{
|
||||
value: 'fePrinter',
|
||||
name: '飞鹅'
|
||||
}
|
||||
]
|
||||
export const receipts = [{
|
||||
value: 'label',
|
||||
name: '标签'
|
||||
},
|
||||
{
|
||||
value: 'kitchen',
|
||||
name: '出品'
|
||||
},
|
||||
{
|
||||
value: 'cash',
|
||||
name: '小票'
|
||||
}
|
||||
]
|
||||
export const devices = [{
|
||||
value: 'printer',
|
||||
name: '本地'
|
||||
},
|
||||
{
|
||||
value: 'yxyPrinter',
|
||||
name: '云想印'
|
||||
},
|
||||
{
|
||||
value: 'fePrinter',
|
||||
name: '飞鹅'
|
||||
}
|
||||
]
|
||||
|
||||
export const models = [
|
||||
{
|
||||
value: 'normal',
|
||||
name: '普通出单'
|
||||
},
|
||||
{
|
||||
value: 'one',
|
||||
name: '一菜一品'
|
||||
},
|
||||
{
|
||||
value: 'category',
|
||||
name: '分类出单'
|
||||
}
|
||||
export const models = [{
|
||||
value: 'normal',
|
||||
name: '普通出单'
|
||||
},
|
||||
{
|
||||
value: 'one',
|
||||
name: '一菜一品'
|
||||
},
|
||||
{
|
||||
value: 'category',
|
||||
name: '分类出单'
|
||||
}
|
||||
]
|
||||
|
||||
export const subTypes = [
|
||||
{
|
||||
value: 'kitchen',
|
||||
name: '出品'
|
||||
},
|
||||
{
|
||||
value: 'cash',
|
||||
name: '小票'
|
||||
},
|
||||
{
|
||||
value: 'label',
|
||||
name: '标签'
|
||||
}
|
||||
export const subTypes = [{
|
||||
value: 'kitchen',
|
||||
name: '出品'
|
||||
},
|
||||
{
|
||||
value: 'cash',
|
||||
name: '小票'
|
||||
},
|
||||
{
|
||||
value: 'label',
|
||||
name: '标签'
|
||||
}
|
||||
]
|
||||
|
|
@ -8,24 +8,24 @@
|
|||
</view>
|
||||
<view class="u-flex u-col-center">
|
||||
<template v-if="data.status">
|
||||
<text class="online" >在线,状态正常</text>
|
||||
<text class="online">在线,状态正常</text>
|
||||
</template>
|
||||
<template v-else>
|
||||
<image class="icon-warning" src="/pagePrinter/static/icon/icon-warning.svg" mode=""></image>
|
||||
<text class="leave u-m-l-10" >离线</text>
|
||||
<text class="leave u-m-l-10">离线</text>
|
||||
</template>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="u-m-t-24">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="u-flex u-col-center">
|
||||
<image class="icon" src="/pagePrinter/static/icon/icon-setting.svg" mode=""></image>
|
||||
<view class="color-666 u-m-l-10">设置</view>
|
||||
<view class="color-666 u-m-l-10">是否启用</view>
|
||||
</view>
|
||||
<view>
|
||||
{{modelsName(data.config.model)}}
|
||||
<my-switch v-model="data.status" @change="openDiscountChange"></my-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-32">
|
||||
|
|
@ -47,28 +47,40 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-32 u-flex u-row-right gap-20">
|
||||
<my-button shape="circle" :width="140" :height="56" type="cancel" plain>删除</my-button>
|
||||
<my-button shape="circle" @click="toUrl" :width="140" :height="56" plain>编辑</my-button>
|
||||
<my-button shape="circle" :width="140" :height="56" type="cancel" @tap="delTableHandleEvent()"
|
||||
plain>删除</my-button>
|
||||
<my-button shape="circle" @click="toUrl" :width="140" :height="56" plain>编辑</my-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { devices, models, subTypes } from '@/pagePrinter/devices.js'
|
||||
import {
|
||||
devices,
|
||||
models,
|
||||
subTypes
|
||||
} from '@/pagePrinter/devices.js'
|
||||
import go from '@/commons/utils/go.js'
|
||||
import {
|
||||
shopConfigprinter,
|
||||
delTableHandle
|
||||
} from '@/http/yskApi/devices.js'
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
})
|
||||
let toUrl =()=>{
|
||||
go.to('PAGES_PRINTER_EDIT',{
|
||||
id:1
|
||||
const emit = defineEmits(['init'])
|
||||
let toUrl = () => {
|
||||
go.to('PAGES_PRINTER_ADD', {
|
||||
id: props.data.id
|
||||
})
|
||||
}
|
||||
|
||||
function devicesName(value) {
|
||||
return devices.find(item => item.value == value).name
|
||||
}
|
||||
|
|
@ -84,26 +96,46 @@
|
|||
function timeFilter(s) {
|
||||
return dayjs(s).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
|
||||
async function openDiscountChange(d) {
|
||||
delete props.data.createdAt
|
||||
delete props.data.updatedAt
|
||||
const res = await shopConfigprinter({
|
||||
...props.data,
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
})
|
||||
emit('init', '')
|
||||
}
|
||||
// 删除
|
||||
async function delTableHandleEvent() {
|
||||
const res = await delTableHandle(props.data.id)
|
||||
emit('init', '')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.border-bottom{
|
||||
border-bottom: 1px solid rgb(240,240,240);
|
||||
.border-bottom {
|
||||
border-bottom: 1px solid rgb(240, 240, 240);
|
||||
}
|
||||
|
||||
.box-shadow {
|
||||
box-shadow: 0 0 5px #eee;
|
||||
}
|
||||
.online{
|
||||
|
||||
.online {
|
||||
color: #0FC161;
|
||||
}
|
||||
.leave{
|
||||
color:#999 ;
|
||||
|
||||
.leave {
|
||||
color: #999;
|
||||
}
|
||||
.icon-warning{
|
||||
|
||||
.icon-warning {
|
||||
width: 34rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
.icon{
|
||||
|
||||
.icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@
|
|||
//品牌
|
||||
const brands = reactive({
|
||||
list: devices,
|
||||
brand:brand,
|
||||
selIndex: '',
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="min-page bg-gray u-p-30 u-flex u-flex-col u-row-center">
|
||||
<view class="min-page bg-gray u-p-30 u-flex u-flex-col ">
|
||||
<div class="w-full" v-for="item in pageData.list " :key="item.id">
|
||||
<printer-item :data="item"></printer-item>
|
||||
<printer-item :data="item" @init='init'></printer-item>
|
||||
</div>
|
||||
<view v-if="!pageData.list.length&&pageData.hasAjax">
|
||||
<my-img-empty ></my-img-empty>
|
||||
|
|
@ -43,7 +43,6 @@
|
|||
async function init() {
|
||||
const res =await Api.tbPrintMachineGet(pageData.query)
|
||||
pageData.hasAjax=true
|
||||
console.log(res);
|
||||
pageData.list = res.filter(v=>v.address)
|
||||
}
|
||||
onMounted(() => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,261 @@
|
|||
<template>
|
||||
<view class="h7">基本信息设置</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<view>
|
||||
员工姓名
|
||||
</view>
|
||||
<input type="text" v-model="datas.formData.name" placeholder="请填写员工名称" />
|
||||
<hr />
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
手机号
|
||||
</view>
|
||||
<input type="text" v-model="datas.formData.phone" placeholder="请填写手机号" />
|
||||
<hr />
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view>
|
||||
员工编号
|
||||
</view>
|
||||
<input type="text" v-model="datas.formData.code" placeholder="请填写员工编号" />
|
||||
<hr />
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view>
|
||||
员工账号
|
||||
</view>
|
||||
<input type="text" v-model="datas.formData.account" placeholder="请填写员工账号,建议使用手机号" />
|
||||
<hr />
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
登录密码
|
||||
</view>
|
||||
<input type="text" v-model="datas.formData.password" placeholder="请输入登录密码,不填写默认123456" />
|
||||
<hr />
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
优惠类型
|
||||
</view>
|
||||
<up-radio-group v-model="datas.formData.discountType" placement="row">
|
||||
<up-radio label="折扣" name="1"></up-radio>
|
||||
<up-radio style="margin: 18px 10px;" label="金额" name="0"></up-radio>
|
||||
</up-radio-group>
|
||||
<hr />
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
最低优惠折扣
|
||||
</view>
|
||||
<input type="text" v-model="datas.formData.maxDiscountAmount" placeholder="0" />
|
||||
<hr />
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
角色
|
||||
</view>
|
||||
<view @tap="show=true" style="height: 50rpx;font-size: 28rpx;color: #999999;">{{datas.rolesdata }}</view>
|
||||
<hr />
|
||||
</view>
|
||||
</view>
|
||||
<view class="h7">员工权限设置</view>
|
||||
<view class="contentBottom" v-for="item in datas.formData.permissions" :key="item.id">
|
||||
<view>
|
||||
{{item.label}}
|
||||
</view>
|
||||
<view class="">
|
||||
<up-checkbox shape='circle' :customStyle="{marginBottom: '8px'}" v-model:checked="ele.hasPermission"
|
||||
usedAlone v-for="(ele, index) in item.children" :key="index" :label="ele.label"
|
||||
style="margin-right: 40rpx;font-size: 28rpx;">
|
||||
</up-checkbox>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottomBotton" @tap="sumbitEvent">
|
||||
保存
|
||||
</view>
|
||||
<view class="bottomBotton2" @tap="toUrl">
|
||||
取消
|
||||
</view>
|
||||
<!-- 角色选择器 -->
|
||||
<up-picker :show="show" @confirm="confirm" @cancel="show = false" :columns="columns"></up-picker>
|
||||
<!-- 弹窗 -->
|
||||
<uni-popup ref="message" type="message">
|
||||
<uni-popup-message type="warn" message="请选择角色" :duration="2000"></uni-popup-message>
|
||||
</uni-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
getCurrentInstance,
|
||||
onMounted,
|
||||
reactive,
|
||||
ref
|
||||
} from 'vue';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
tbShopPermissionList,
|
||||
getroles,
|
||||
tbPlussShopStaff,
|
||||
tbPlussShopStaffDetail
|
||||
} from "@/http/yskApi/requestAll.js"
|
||||
const currentInstance = getCurrentInstance()
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String
|
||||
},
|
||||
id: {
|
||||
type: Number
|
||||
}
|
||||
})
|
||||
let datas = reactive({
|
||||
formData: {
|
||||
permissions: []
|
||||
},
|
||||
rolesList: [],
|
||||
columns: [],
|
||||
rolesdata: '请选择角色'
|
||||
})
|
||||
const columns = reactive([
|
||||
[]
|
||||
]);
|
||||
const show = ref(false)
|
||||
onMounted(() => {
|
||||
// 获取角色信息
|
||||
getrolesEvent()
|
||||
if (props.type == 'add') {
|
||||
getList()
|
||||
} else {
|
||||
// 调用id查询接口和编辑接口
|
||||
gettbPlussShopStaffDetail(props.id)
|
||||
}
|
||||
})
|
||||
|
||||
function gettbPlussShopStaffDetail(id) {
|
||||
tbPlussShopStaffDetail(id).then(res => {
|
||||
datas.formData = res
|
||||
datas.rolesdata = datas.rolesList.filter(ele => ele.id == res.roleId)[0].name
|
||||
})
|
||||
}
|
||||
|
||||
function sumbitEvent() {
|
||||
let rolesId = datas.rolesList.filter(ele => ele.name == datas.rolesdata)
|
||||
if (rolesId.length == 0) {
|
||||
currentInstance.ctx.$refs.message.open()
|
||||
return
|
||||
}
|
||||
datas.formData.roleId = rolesId[0].id
|
||||
datas.formData.permissions.forEach(ele => {
|
||||
ele.children.forEach(res => {
|
||||
if (res.hasPermission) {
|
||||
res.hasPermission = 1
|
||||
}
|
||||
})
|
||||
})
|
||||
tbPlussShopStaff({
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...datas.formData
|
||||
}).then(res => {
|
||||
toUrl()
|
||||
})
|
||||
}
|
||||
|
||||
function getList() {
|
||||
tbShopPermissionList().then((res) => {
|
||||
datas.formData.permissions = res
|
||||
})
|
||||
}
|
||||
|
||||
function getrolesEvent() {
|
||||
getroles().then((res) => {
|
||||
datas.rolesList = res.content
|
||||
res.content.forEach(ele => {
|
||||
columns[0].push(ele.name)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function confirm(e) {
|
||||
// console.log(e.value, '调试1')
|
||||
datas.rolesdata = e.value[0]
|
||||
show.value = false
|
||||
}
|
||||
|
||||
function toUrl() {
|
||||
go.to('PAGES_STAFF')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
padding: 32rpx 28rpx;
|
||||
}
|
||||
|
||||
.h7 {
|
||||
margin: 32rpx 0;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 694rpx;
|
||||
// height: 1256rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
>view {
|
||||
padding: 32rpx 24rpx;
|
||||
background-color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
|
||||
>input {
|
||||
padding: 24rpx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contentBottom {
|
||||
width: 694rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.bottomBotton {
|
||||
width: 530rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: #318AFE;
|
||||
border-radius: 56rpx 56rpx 56rpx 56rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top: 50rpx;
|
||||
margin-left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.bottomBotton2 {
|
||||
width: 530rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
margin-left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
<template>
|
||||
<ul class="liststyle">
|
||||
<li v-for="item in datas.list " :key="item.id">
|
||||
<view class="">
|
||||
<view class="">
|
||||
<span style="font-size: 28rpx;color: #333333; ">{{item.name}}</span>
|
||||
<span style="font-size: 24rpx;color: #999; ">{{item.code}}</span>
|
||||
</view>
|
||||
<view class="" style="font-size: 24rpx;color: #666666;">
|
||||
{{item.account}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
<span style="font-size: 28rpx;color: #999999;">是否启用用</span>
|
||||
<up-switch :activeValue="1" :inactiveValue="0" v-model="item.status" size="18"
|
||||
@change="switch2Change($event,item)"></up-switch>
|
||||
</view>
|
||||
<view class="df">
|
||||
<up-button size="small" style="border-radius: 28rpx 28rpx 28rpx 28rpx;"
|
||||
@tap="datas.show = true;datas.rolesId=item.id" text="删除"></up-button>
|
||||
<up-button type="primary" plain size="small"
|
||||
style="border-radius: 28rpx 28rpx 28rpx 28rpx;margin-left: 16rpx;" @tap="toUrl(item)"
|
||||
text="编辑"></up-button>
|
||||
</view>
|
||||
</view>
|
||||
</li>
|
||||
</ul>
|
||||
<view class="bottomBotton" @tap="toUrl">
|
||||
添加员工
|
||||
</view>
|
||||
<!-- 删除确认框 -->
|
||||
<up-modal :show="datas.show" contentTextAlign="center" showCancelButton @confirm='delTableHandle'
|
||||
@cancel='datas.show=false' content='是否确认删除?'></up-modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
watch,
|
||||
onMounted
|
||||
} from 'vue';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
rolesGet,
|
||||
shopStaffDelete,
|
||||
updateStatus
|
||||
} from "@/http/yskApi/requestAll.js"
|
||||
let datas = reactive({
|
||||
list: [],
|
||||
show: false,
|
||||
// 删除员工id
|
||||
rolesId: ""
|
||||
})
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
function delTableHandle() {
|
||||
shopStaffDelete(
|
||||
[datas.rolesId]
|
||||
)
|
||||
datas.show = false
|
||||
setTimeout(() => {
|
||||
getList()
|
||||
}, 500)
|
||||
}
|
||||
|
||||
function toUrl(d) {
|
||||
if (d.id) {
|
||||
go.to('PAGES_ADD_STAFF', {
|
||||
type: '',
|
||||
id: d.id
|
||||
})
|
||||
} else {
|
||||
go.to('PAGES_ADD_STAFF', {
|
||||
type: 'add',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function switch2Change(e, d) {
|
||||
updateStatus({
|
||||
id: d.id,
|
||||
status: e
|
||||
}).then(res => {
|
||||
setTimeout(() => {
|
||||
getList()
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
|
||||
function getList() {
|
||||
rolesGet({
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
page: 1,
|
||||
size: 100
|
||||
}).then((res) => {
|
||||
datas.list = res.content
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
* {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.liststyle {
|
||||
>li {
|
||||
width: 694rpx;
|
||||
height: 192rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
padding: 0 16rpx;
|
||||
margin: 32rpx auto;
|
||||
|
||||
>view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 96rpx;
|
||||
|
||||
}
|
||||
|
||||
>view:first-child {
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottomBotton {
|
||||
width: 530rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: #318AFE;
|
||||
border-radius: 56rpx 56rpx 56rpx 56rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.df {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
39
pages.json
39
pages.json
|
|
@ -1237,8 +1237,7 @@
|
|||
"pageId": "PAGES_ORDER_INDEX",
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单管理",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": "订单管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -1247,20 +1246,6 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_ORDER_PAY",
|
||||
"path": "pay-order/pay-order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "结账"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_ORDER_TUIKUAN",
|
||||
"path": "tuikuan/tuikuan",
|
||||
"style": {
|
||||
"navigationBarTitleText": "退款"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
|
|
@ -1296,7 +1281,6 @@
|
|||
"navigationBarTitleText": "商品销售排行"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -1315,7 +1299,22 @@
|
|||
}
|
||||
}]
|
||||
},
|
||||
|
||||
{
|
||||
"root": "pageStaff",
|
||||
"pages": [{
|
||||
"pageId": "PAGES_STAFF",
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "员工管理"
|
||||
}
|
||||
}, {
|
||||
"pageId": "PAGES_ADD_STAFF",
|
||||
"path": "addstaff",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增员工"
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"root": "pageConsumables",
|
||||
"pages": [{
|
||||
|
|
@ -1358,8 +1357,8 @@
|
|||
"pageId": "PAGES_PRINTER_ADD",
|
||||
"path": "add-printer/add-printer",
|
||||
"style": {
|
||||
// "navigationBarTitleText" : "添加/编辑云打印机"
|
||||
"navigationBarTitleText": ""
|
||||
"navigationBarTitleText" : "添加/编辑云打印机"
|
||||
// "navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,6 +75,10 @@
|
|||
title: '用户管理',
|
||||
icon: '/static/indexImg/icon-user.svg',
|
||||
pageUrl: 'PAGES_USER_CONTROL',
|
||||
},{
|
||||
title: '员工管理',
|
||||
icon: '/static/indexImg/icon-staff.svg',
|
||||
pageUrl: 'PAGES_STAFF'
|
||||
},
|
||||
{
|
||||
title: '桌台',
|
||||
|
|
|
|||
Loading…
Reference in New Issue