第一次提交

This commit is contained in:
wangxulei
2024-12-06 22:42:03 +08:00
commit 2e054b0966
535 changed files with 49684 additions and 0 deletions

View File

@@ -0,0 +1,132 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="会员卡名" prop="cardName" class="is-required">
<el-input v-model="temp.cardName" placeholder="会员卡名" />
</el-form-item>
<el-form-item label="卡编号" prop="cardNo" class="is-required">
<el-input v-model="temp.cardNo" placeholder="卡编号" />
</el-form-item>
<el-form-item label="预设开卡金" prop="cardAmount" class="is-required">
<el-input v-model="temp.cardAmount" placeholder="预设开卡金" />
</el-form-item>
<el-form-item label="预设赠送金" prop="giveAmount" class="is-required">
<el-input v-model="temp.giveAmount" placeholder="预设赠送金" />
</el-form-item>
<el-form-item label="最低开卡金额" prop="buildCardAmount" class="is-required">
<el-input v-model="temp.buildCardAmount" placeholder="最低开卡金额" />
</el-form-item>
<el-form-item label="卡折扣" prop="cardDiscount" class="is-required">
<el-input v-model="temp.cardDiscount" placeholder="卡折扣" />
</el-form-item>
<el-form-item label="卡提成" prop="cardPushPercent" class="is-required">
<el-input v-model="temp.cardPushPercent" placeholder="卡提成" />
</el-form-item>
<el-form-item label="工本费用" prop="todos" class="is-required">
<el-input v-model="temp.todos" placeholder="工本费用" />
</el-form-item>
<el-form-item label="状态" prop="cardStatus" class="is-required">
<el-radio-group v-model="temp.cardStatus" size="small">
<el-radio-button label="0">正常</el-radio-button>
<el-radio-button label="1">禁用</el-radio-button>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="所属门店" prop="shopId" class="is-required">-->
<!-- <dept-select v-model="temp.shopId" @changeSelect="getDept" style="width: 100%;"/>-->
<!-- </el-form-item>-->
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addCard} from "@/api/business/card/card";
import {setRequiredFields} from "@/utils";
import DeptSelect from "@/views/common/system/deptSelect";
const requiredFields = []
export default {
name: "addForm",
components: {DeptSelect},
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
cardName:'',
cardNo:'',
cardAmount:'',
giveAmount:'',
buildCardAmount:'',
cardDiscount:'',
cardPushPercent:'',
todos:'',
cardStatus:0,
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addCard(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
},
getDept(e){
this.temp.shopName = e.deptName
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,333 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="会员卡名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardName }}
</template>
</el-table-column>
<el-table-column
label="卡编号"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardNo }}
</template>
</el-table-column>
<el-table-column
label="预设开卡金"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardAmount }}
</template>
</el-table-column>
<el-table-column
label="预设赠送金"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.giveAmount }}
</template>
</el-table-column>
<el-table-column
label="最低开卡金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.buildCardAmount }}
</template>
</el-table-column>
<el-table-column
label="卡折扣"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardDiscount }}
</template>
</el-table-column>
<el-table-column
label="卡提成"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardPushPercent }}
</template>
</el-table-column>
<el-table-column
label="工本费用"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.todos }}
</template>
</el-table-column>
<el-table-column
label="0正常 1下架"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardStatus }}
</template>
</el-table-column>
<el-table-column
label="0正常 1删除"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.deleted }}
</template>
</el-table-column>
<el-table-column
label="门店名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="修改时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateTime }}
</template>
</el-table-column>
<el-table-column
label="修改人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateName }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getCardPage,deleteCard} from "@/api/business/card/card";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/card/addCard";
import editForm from "@/views/business/card/editCard";
export default {
name: 'card',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getCardPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteCard(scope.row.cardId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,128 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="会员卡名" prop="cardName" class="is-required">
<el-input v-model="temp.cardName" placeholder="会员卡名" />
</el-form-item>
<el-form-item label="卡编号" prop="cardNo" class="is-required">
<el-input v-model="temp.cardNo" placeholder="卡编号" />
</el-form-item>
<el-form-item label="预设开卡金" prop="cardAmount" class="is-required">
<el-input v-model="temp.cardAmount" placeholder="预设开卡金" />
</el-form-item>
<el-form-item label="预设赠送金" prop="giveAmount" class="is-required">
<el-input v-model="temp.giveAmount" placeholder="预设赠送金" />
</el-form-item>
<el-form-item label="最低开卡金额" prop="buildCardAmount" class="is-required">
<el-input v-model="temp.buildCardAmount" placeholder="最低开卡金额" />
</el-form-item>
<el-form-item label="卡折扣" prop="cardDiscount" class="is-required">
<el-input v-model="temp.cardDiscount" placeholder="卡折扣" />
</el-form-item>
<el-form-item label="卡提成" prop="cardPushPercent" class="is-required">
<el-input v-model="temp.cardPushPercent" placeholder="卡提成" />
</el-form-item>
<el-form-item label="工本费用" prop="todos" class="is-required">
<el-input v-model="temp.todos" placeholder="工本费用" />
</el-form-item>
<el-form-item label="状态" prop="cardStatus" class="is-required">
<el-radio-group v-model="temp.cardStatus" size="small">
<el-radio-button label="0">正常</el-radio-button>
<el-radio-button label="1">禁用</el-radio-button>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="所属门店" prop="shopId" class="is-required">-->
<!-- <dept-select v-model="temp.shopId" @changeSelect="getDept" style="width: 100%;"/>-->
<!-- </el-form-item>-->
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editCard } from "@/api/business/card/card";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
cardId:'',
cardName:'',
cardNo:'',
cardAmount:'',
giveAmount:'',
buildCardAmount:'',
cardDiscount:'',
cardPushPercent:'',
todos:'',
cardStatus:0,
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editCard(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,53 @@
<template>
<div>
<el-dialog
append-to-body
top="2vh"
width="60%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div" style="height:80vh">
<pending-sell-list ref="pendingSellListRef" @ok="getCheckedsell"/>
</div>
</el-dialog>
</div>
</template>
<script>
import pendingSellList from "@/views/business/cashier/pendingSellList";
export default {
name: "chooseSell",
components: {pendingSellList},
props: {
sellList: Array,
},
data() {
return {
dialogVisible: false,
temp:{}
}
},
methods: {
open() {
this.dialogVisible = true
//并获取最新值
this.$refs.pendingSellListRef.fetchData()
},
getCheckedsell(sell){
this.$emit('ok', sell)
this.handleCancel()
},
handleCancel(){
this.dialogVisible = false
},
submit(){
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,56 @@
<template>
<div>
<el-dialog
append-to-body
top="2vh"
width="60%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div" style="height:80vh">
<server-list ref="serverListRef" @ok="getCheckedsell"/>
</div>
</el-dialog>
</div>
</template>
<script>
import serverList from "@/views/business/cashier/serverList";
export default {
name: "chooseServer",
components: {serverList},
props: {
sellList: Array,
},
data() {
return {
dialogVisible: false,
temp:{},
scope:{}
}
},
methods: {
open() {
this.dialogVisible = true
//并获取最新值
this.$nextTick(() => {
this.$refs.serverListRef.fetchData()
})
},
getCheckedsell(serverList){
this.$emit('ok', serverList)
this.handleCancel()
},
handleCancel(){
this.dialogVisible = false
},
submit(){
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,161 @@
<template>
<div>
<!-- :close-on-click-modal="false"-->
<el-dialog
append-to-body
top="15vh"
width="35%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div" style="height:40vh;text-align: center;">
<div style="text-align: left;">
<h2> 应付金额<span class="price-text">{{totalPrice}}</span></h2>
<h2> 实付金额<span class="price-text">{{realTotalPrice}}</span></h2>
<h2> 仍需支付<span class="price-text">{{app.Subtr(totalPrice,realTotalPrice)}}</span></h2>
</div>
<div style="width:100%;"
v-for="(item,index) in payTypeList"
:key="item.payType">
<el-input
style="text-align: center;width: 70%;margin-bottom: 10px;"
placeholder="请输入金额"
@click.native="inputClick(item,payTypeList,index)"
v-model="item.amount">
<span slot="prefix" style="line-height: 40px;text-align: right;width: 80px;display: inline-block;">{{item.payName}}&nbsp;</span>
<span slot="suffix" style="line-height: 40px;text-align: right;width: 200px;display: inline-block;" v-if="app.isNotEmpty(memberCard.memberCardId) && item.payType == '1'">
会员卡总余额<span class="price-text">{{app.getFloatStr(memberCardAmount)}}</span>
</span>
</el-input>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<slot name="button2"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
import {accAdd,error,isNotEmpty} from "@/utils";
export default {
name: "payType",
props: {
},
data() {
return {
dialogVisible: false,
temp:{},
menu: '',
totalPrice:'',
memberCard:{amount:0,giveAmount:0},
payTypeList:[
{payType:"1",payName:"会员卡支付",amount:""},
{payType:"2",payName:"扫码支付",amount:""},
{payType:"3",payName:"现金支付",amount:""},
{payType:"888",payName:"优惠",amount:""},
]
}
},
computed:{
realTotalPrice(){
let realTotalPrice = 0;
for(let pay of this.payTypeList){
if(pay.amount){
realTotalPrice = accAdd(pay.amount,realTotalPrice);
}
}
return realTotalPrice;
},
memberCardAmount(){
let memberCardAmount = 0;
if(isNotEmpty(this.memberCard.memberCardId)){
memberCardAmount = accAdd(this.memberCard.amount,this.memberCard.giveAmount);
}
return memberCardAmount;
}
},
methods: {
open(totalPrice,memberCard,menu) {
this.menu = menu
// 打印应付金额和会员卡信息
console.log('应付金额' + totalPrice)
console.log('当前会员卡' + memberCard)
// 设置应付金额
this.totalPrice = totalPrice
// 根据会员卡是否存在进行不同操作
if(isNotEmpty(memberCard.memberCardId)){
// 存在会员卡,设置会员卡信息
this.memberCard = memberCard
if(menu == '2' || menu == '3'){
this.payTypeList.splice(0, 1)
}
} else {
// 不存在会员卡,调整支付类型列表
this.payTypeList.splice(0, 1)
}
// 显示对话框
this.dialogVisible = true
},
//首次输入金额时自动填充
inputClick(pay, payList,index) {
let flag = true;
for (let i = 0; i < payList.length; i++) {
if (isNotEmpty(payList[i].amount)) {
flag = false;
break;
}
}
let needPay = this.totalPrice;
if (needPay > 0 && flag) {
if(index==0 && this.menu == '1' && isNotEmpty(this.memberCard.memberCardId)){
//证明是卡金支付
//如果应付金额大于卡金总余额 则卡金这一栏仅填写卡金余额
if(needPay>this.memberCardAmount){
pay.amount = this.memberCardAmount
}else{
pay.amount = needPay;
}
}else{
pay.amount = needPay;
}
}
},
handleCancel(){
this.dialogVisible = false
this.totalPrice = this.$options.data().totalPrice
this.menu = this.$options.data().menu
this.memberCard = this.$options.data().memberCard
this.payTypeList = this.$options.data().payTypeList
},
submit(){
if(this.totalPrice == this.realTotalPrice){
let payList = this.payTypeList.filter(item => item.amount > 0)
this.$emit('ok', payList)
this.handleCancel()
}else{
error('应付金额不等于实际金额~')
}
}
},
}
</script>
<style scoped>
::v-deep .el-input--prefix .el-input__inner{
padding-left: 90px !important;
}
</style>

View File

@@ -0,0 +1,289 @@
<template>
<div class="app-container">
<div class="filter-container" style="margin-bottom: 10px;">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
</el-button-group>
</div>
<el-row :gutter="24" class="row-container">
<el-table
ref="productTable"
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="80%"
class="table-container"
highlight-current-row
@row-click="handleRowClick"
@selection-change="getSelection"
>
<el-table-column
align="center"
type="selection"
width="55">
</el-table-column>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="会员"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberName }}
</template>
</el-table-column>
<el-table-column
label="手机号"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberPhone }}
</template>
</el-table-column>
<el-table-column
label="下单时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="操作人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="门店名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<div class="div-border" style="height: 29%;margin-top:15px;">
<el-alert
type="warning"
:closable="false">
<template slot="title">
已选择的条目{{productList.length}}
<el-button style="margin-left: 15px;"
@click="chooseDone"
icon="el-icon-check"
type="danger">选好了</el-button>
</template>
</el-alert>
<div class="tag-view">
<el-tag
v-for="(tag,index) in productList"
:key="tag.productId"
closable
effect="dark"
@close="handleClose(tag,index)"
>
{{tag.memberName}}
</el-tag>
</div>
</div>
</el-row>
</div>
</template>
<script>
import {deleteProduct} from "@/api/business/product/product";
import {deepClone,success} from "@/utils";
import {deleteSelljson, getSelljsonPage} from "@/api/business/sellJson/sellJson";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/product/addProduct";
import editForm from "@/views/business/product/editProduct";
import {error} from "@/utils";
export default {
name: 'productList',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: '',
pendingStatus:0
},
defaultProps: {
id: 'categoryId',
label: 'categoryName',
},
temp: {},
productList: []
}
},
created() {
this.fetchData()
},
methods: {
handleClose(tag,index){
this.productList.splice(index,1);
//取消选中状态
this.$refs.productTable.toggleRowSelection(tag, false);
},
chooseDone(){
if(this.productList.length==0){
error('还没有选择订单')
return false
}
this.$emit('ok', this.productList[0])
const table = this.$refs.productTable;
const rows = table.store.states.data; // 获取表格所有行的数据(不同组件获取方式可能不同)
rows.forEach(row => {
table.toggleRowSelection(row, false); // 调用toggleRowSelection方法第二个参数传false表示取消选中
});
},
handleRowClick(row) {
//先删除所选中的 只选当前行
const table = this.$refs.productTable;
const rows = table.store.states.data; // 获取表格所有行的数据(不同组件获取方式可能不同)
rows.forEach(row => {
table.toggleRowSelection(row, false); // 调用toggleRowSelection方法第二个参数传false表示取消选中
});
this.$refs.productTable.toggleRowSelection(row)
},
getSelection(e){
this.productList = e
},
handleNodeClick(e){
this.listQuery.categoryId = e.categoryId
this.fetchData()
},
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getSelljsonPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open(this.listQuery.categoryId)
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteSelljson(scope.row.jsonId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
.tag-view /deep/ .el-tag {
margin: 10px;
}
</style>

View File

@@ -0,0 +1,271 @@
<template>
<div class="app-container">
<div class="filter-container" style="margin-bottom: 10px;">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
</div>
<el-row :gutter="24" class="row-container">
<el-table
ref="productTable"
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="80%"
class="table-container"
highlight-current-row
@row-click="handleRowClick"
@selection-change="getSelection"
>
<el-table-column
align="center"
type="selection"
width="55">
</el-table-column>
<el-table-column
label="工号"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.serverNo }}
</template>
</el-table-column>
<el-table-column
label="服务人员名称"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.serverName }}
</template>
</el-table-column>
<el-table-column
label="服务人员手机号"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.serverPhone }}
</template>
</el-table-column>
<el-table-column
label="入职时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.joinTime }}
</template>
</el-table-column>
<el-table-column
label="门店名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<div class="div-border" style="height: 29%;margin-top:15px;">
<el-alert
type="warning"
:closable="false">
<template slot="title">
已选择的条目{{productList.length}}
<el-button style="margin-left: 15px;"
@click="chooseDone"
icon="el-icon-check"
type="danger">选好了
</el-button>
</template>
</el-alert>
<div class="tag-view">
<el-tag
v-for="(tag,index) in productList"
:key="tag.serverId"
closable
effect="dark"
@close="handleClose(tag,index)"
>
{{tag.serverName}}
</el-tag>
</div>
</div>
</el-row>
</div>
</template>
<script>
import {getServerPage, deleteServer} from "@/api/business/server/server";
import {deepClone, error, success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/server/addServer";
import editForm from "@/views/business/server/editServer";
export default {
name: 'serverList',
components: {addForm, editForm, Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
productList: []
}
},
created() {
this.fetchData()
},
methods: {
getSelection(e) {
this.productList = e
},
chooseDone() {
if (this.productList.length == 0) {
error('还没有选择订单')
return false
}
this.$emit('ok', this.productList)
const table = this.$refs.productTable;
const rows = table.store.states.data; // 获取表格所有行的数据(不同组件获取方式可能不同)
rows.forEach(row => {
table.toggleRowSelection(row, false); // 调用toggleRowSelection方法第二个参数传false表示取消选中
});
},
handleRowClick(row) {
//先删除所选中的 只选当前行
// const table = this.$refs.productTable;
// const rows = table.store.states.data; // 获取表格所有行的数据(不同组件获取方式可能不同)
// rows.forEach(row => {
// table.toggleRowSelection(row, false); // 调用toggleRowSelection方法第二个参数传false表示取消选中
// });
this.$refs.productTable.toggleRowSelection(row)
},
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getServerPage(this.listQuery).then(response => {
const {records, total} = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add() {
this.$refs.addForm.open()
},
addOk() {
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk() {
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res => {
if (res) {
deleteServer(scope.row.serverId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
.tag-view /deep/ .el-tag {
margin: 10px;
}
</style>

View File

@@ -0,0 +1,98 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="分类名" prop="categoryName" class="is-required">
<el-input v-model="temp.categoryName" placeholder="分类名" />
</el-form-item>
<el-form-item label="状态" prop="categoryStatus" class="is-required">
<el-radio-group v-model="temp.categoryStatus" size="small">
<el-radio-button label="0">正常</el-radio-button>
<el-radio-button label="1">禁用</el-radio-button>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="所属门店" prop="shopId" class="is-required">-->
<!-- <dept-select v-model="temp.shopId" @changeSelect="getDept" style="width: 100%;"/>-->
<!-- </el-form-item>-->
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addCategory} from "@/api/business/category/category";
import {setRequiredFields} from "@/utils";
import DeptSelect from "@/views/common/system/deptSelect";
const requiredFields = []
export default {
name: "addForm",
components: {DeptSelect},
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
categoryName:'',
categoryStatus:0,
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addCategory(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
},
getDept(e){
console.log(e)
this.temp.shopName = e.deptName
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,249 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="分类名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.categoryName }}
</template>
</el-table-column>
<el-table-column
label="0正常 1禁用"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.categoryStatus }}
</template>
</el-table-column>
<el-table-column
label="门店名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="修改时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateTime }}
</template>
</el-table-column>
<el-table-column
label="修改人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateName }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getCategoryPage,deleteCategory} from "@/api/business/category/category";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/category/addCategory";
import editForm from "@/views/business/category/editCategory";
export default {
name: 'category',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getCategoryPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteCategory(scope.row.categoryId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,104 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="分类名" prop="categoryName" class="is-required">
<el-input v-model="temp.categoryName" placeholder="分类名" />
</el-form-item>
<el-form-item label="状态" prop="categoryStatus" class="is-required">
<el-radio-group v-model="temp.categoryStatus" size="small">
<el-radio-button label="0">正常</el-radio-button>
<el-radio-button label="1">禁用</el-radio-button>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="所属门店" prop="shopId" class="is-required">-->
<!-- <dept-select v-model="temp.shopId" @changeSelect="getDept" style="width: 100%;"/>-->
<!-- </el-form-item>-->
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editCategory } from "@/api/business/category/category";
import {setRequiredFields} from "@/utils";
import DeptSelect from "@/views/common/system/deptSelect";
const requiredFields = []
export default {
name: "editForm",
components: {DeptSelect},
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
categoryId:'',
categoryName:'',
categoryStatus:'',
shopId:'',
shopName:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editCategory(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
},
getDept(e){
console.log(e)
this.temp.shopName = e.deptName
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,156 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="详单对应服务人员记录id" prop="detailServerId" class="is-required">
<el-input v-model="temp.detailServerId" placeholder="详单对应服务人员记录id" />
</el-form-item>
<el-form-item label="订单id" prop="sellId" class="is-required">
<el-input v-model="temp.sellId" placeholder="订单id" />
</el-form-item>
<el-form-item label="详单id" prop="sellDetailId" class="is-required">
<el-input v-model="temp.sellDetailId" placeholder="详单id" />
</el-form-item>
<el-form-item label="服务人员" prop="serverId" class="is-required">
<el-input v-model="temp.serverId" placeholder="服务人员" />
</el-form-item>
<el-form-item label="服务人员" prop="serverName" class="is-required">
<el-input v-model="temp.serverName" placeholder="服务人员" />
</el-form-item>
<el-form-item label="提成" prop="serverPushMoney" class="is-required">
<el-input v-model="temp.serverPushMoney" placeholder="提成" />
</el-form-item>
<el-form-item label="业绩" prop="serverGrade" class="is-required">
<el-input v-model="temp.serverGrade" placeholder="业绩" />
</el-form-item>
<el-form-item label="门店id" prop="shopId" class="is-required">
<el-input v-model="temp.shopId" placeholder="门店id" />
</el-form-item>
<el-form-item label="门店名" prop="shopName" class="is-required">
<el-input v-model="temp.shopName" placeholder="门店名" />
</el-form-item>
<el-form-item label="创建人" prop="createName" class="is-required">
<el-input v-model="temp.createName" placeholder="创建人" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
<el-form-item label="创建人id" prop="createId" class="is-required">
<el-input v-model="temp.createId" placeholder="创建人id" />
</el-form-item>
<el-form-item label="修改时间" prop="updateTime" class="is-required">
<el-input v-model="temp.updateTime" placeholder="修改时间" />
</el-form-item>
<el-form-item label="修改人" prop="updateName" class="is-required">
<el-input v-model="temp.updateName" placeholder="修改人" />
</el-form-item>
<el-form-item label="修改人id" prop="updateId" class="is-required">
<el-input v-model="temp.updateId" placeholder="修改人id" />
</el-form-item>
<el-form-item label="备注" prop="remark" class="is-required">
<el-input v-model="temp.remark" placeholder="备注" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addSellDetailServer} from "@/api/business/detailServer/detailServer";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "addForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
detailServerId:'',
sellId:'',
sellDetailId:'',
serverId:'',
serverName:'',
serverPushMoney:'',
serverGrade:'',
shopId:'',
shopName:'',
createName:'',
createTime:'',
createId:'',
updateTime:'',
updateName:'',
updateId:'',
remark:'',
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addSellDetailServer(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,343 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="详单对应服务人员记录id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.detailServerId }}
</template>
</el-table-column>
<el-table-column
label="订单id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.sellId }}
</template>
</el-table-column>
<el-table-column
label="详单id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.sellDetailId }}
</template>
</el-table-column>
<el-table-column
label="服务人员"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.serverId }}
</template>
</el-table-column>
<el-table-column
label="服务人员"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.serverName }}
</template>
</el-table-column>
<el-table-column
label="提成"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.serverPushMoney }}
</template>
</el-table-column>
<el-table-column
label="业绩"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.serverGrade }}
</template>
</el-table-column>
<el-table-column
label="门店id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopId }}
</template>
</el-table-column>
<el-table-column
label="门店名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="创建人id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createId }}
</template>
</el-table-column>
<el-table-column
label="修改时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateTime }}
</template>
</el-table-column>
<el-table-column
label="修改人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateName }}
</template>
</el-table-column>
<el-table-column
label="修改人id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateId }}
</template>
</el-table-column>
<el-table-column
label="备注"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.remark }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getSellDetailServerPage,deleteSellDetailServer} from "@/api/business/detailServer/detailServer";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/detailServer/addSellDetailServer";
import editForm from "@/views/business/detailServer/editSellDetailServer";
export default {
name: 'detailServer',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getSellDetailServerPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteSellDetailServer(scope.row.detailServerId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,157 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="详单对应服务人员记录id" prop="detailServerId" class="is-required">
<el-input v-model="temp.detailServerId" placeholder="详单对应服务人员记录id" />
</el-form-item>
<el-form-item label="订单id" prop="sellId" class="is-required">
<el-input v-model="temp.sellId" placeholder="订单id" />
</el-form-item>
<el-form-item label="详单id" prop="sellDetailId" class="is-required">
<el-input v-model="temp.sellDetailId" placeholder="详单id" />
</el-form-item>
<el-form-item label="服务人员" prop="serverId" class="is-required">
<el-input v-model="temp.serverId" placeholder="服务人员" />
</el-form-item>
<el-form-item label="服务人员" prop="serverName" class="is-required">
<el-input v-model="temp.serverName" placeholder="服务人员" />
</el-form-item>
<el-form-item label="提成" prop="serverPushMoney" class="is-required">
<el-input v-model="temp.serverPushMoney" placeholder="提成" />
</el-form-item>
<el-form-item label="业绩" prop="serverGrade" class="is-required">
<el-input v-model="temp.serverGrade" placeholder="业绩" />
</el-form-item>
<el-form-item label="门店id" prop="shopId" class="is-required">
<el-input v-model="temp.shopId" placeholder="门店id" />
</el-form-item>
<el-form-item label="门店名" prop="shopName" class="is-required">
<el-input v-model="temp.shopName" placeholder="门店名" />
</el-form-item>
<el-form-item label="创建人" prop="createName" class="is-required">
<el-input v-model="temp.createName" placeholder="创建人" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
<el-form-item label="创建人id" prop="createId" class="is-required">
<el-input v-model="temp.createId" placeholder="创建人id" />
</el-form-item>
<el-form-item label="修改时间" prop="updateTime" class="is-required">
<el-input v-model="temp.updateTime" placeholder="修改时间" />
</el-form-item>
<el-form-item label="修改人" prop="updateName" class="is-required">
<el-input v-model="temp.updateName" placeholder="修改人" />
</el-form-item>
<el-form-item label="修改人id" prop="updateId" class="is-required">
<el-input v-model="temp.updateId" placeholder="修改人id" />
</el-form-item>
<el-form-item label="备注" prop="remark" class="is-required">
<el-input v-model="temp.remark" placeholder="备注" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editSellDetailServer } from "@/api/business/detailServer/detailServer";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
detailServerId:'',
sellId:'',
sellDetailId:'',
serverId:'',
serverName:'',
serverPushMoney:'',
serverGrade:'',
shopId:'',
shopName:'',
createName:'',
createTime:'',
createId:'',
updateTime:'',
updateName:'',
updateId:'',
remark:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editSellDetailServer(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,131 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="文件id" prop="fileId" class="is-required">
<el-input v-model="temp.fileId" placeholder="文件id" />
</el-form-item>
<el-form-item label="上级id" prop="parentId" class="is-required">
<el-input v-model="temp.parentId" placeholder="上级id" />
</el-form-item>
<el-form-item label="文件仓库oss仓库" prop="fileBucket" class="is-required">
<el-input v-model="temp.fileBucket" placeholder="文件仓库oss仓库" />
</el-form-item>
<el-form-item label="文件名称" prop="fileName" class="is-required">
<el-input v-model="temp.fileName" placeholder="文件名称" />
</el-form-item>
<el-form-item label="文件后缀" prop="fileSuffix" class="is-required">
<el-input v-model="temp.fileSuffix" placeholder="文件后缀" />
</el-form-item>
<el-form-item label="文件大小kb" prop="fileSizeKb" class="is-required">
<el-input v-model="temp.fileSizeKb" placeholder="文件大小kb" />
</el-form-item>
<el-form-item label="文件唯一标识id" prop="finalName" class="is-required">
<el-input v-model="temp.finalName" placeholder="文件唯一标识id" />
</el-form-item>
<el-form-item label="存储路径" prop="filePath" class="is-required">
<el-input v-model="temp.filePath" placeholder="存储路径" />
</el-form-item>
<el-form-item label="0文件夹 1文件" prop="fileType" class="is-required">
<el-input v-model="temp.fileType" placeholder="0文件夹 1文件" />
</el-form-item>
<el-form-item label="存放的系统路径" prop="fileSysPath" class="is-required">
<el-input v-model="temp.fileSysPath" placeholder="存放的系统路径" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addFile} from "@/api/business/file/file";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "addForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
fileId:'',
parentId:'',
fileBucket:'',
fileName:'',
fileSuffix:'',
fileSizeKb:'',
finalName:'',
filePath:'',
fileType:'',
fileSysPath:'',
createTime:'',
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addFile(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,132 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="文件id" prop="fileId" class="is-required">
<el-input v-model="temp.fileId" placeholder="文件id" />
</el-form-item>
<el-form-item label="上级id" prop="parentId" class="is-required">
<el-input v-model="temp.parentId" placeholder="上级id" />
</el-form-item>
<el-form-item label="文件仓库oss仓库" prop="fileBucket" class="is-required">
<el-input v-model="temp.fileBucket" placeholder="文件仓库oss仓库" />
</el-form-item>
<el-form-item label="文件名称" prop="fileName" class="is-required">
<el-input v-model="temp.fileName" placeholder="文件名称" />
</el-form-item>
<el-form-item label="文件后缀" prop="fileSuffix" class="is-required">
<el-input v-model="temp.fileSuffix" placeholder="文件后缀" />
</el-form-item>
<el-form-item label="文件大小kb" prop="fileSizeKb" class="is-required">
<el-input v-model="temp.fileSizeKb" placeholder="文件大小kb" />
</el-form-item>
<el-form-item label="文件唯一标识id" prop="finalName" class="is-required">
<el-input v-model="temp.finalName" placeholder="文件唯一标识id" />
</el-form-item>
<el-form-item label="存储路径" prop="filePath" class="is-required">
<el-input v-model="temp.filePath" placeholder="存储路径" />
</el-form-item>
<el-form-item label="0文件夹 1文件" prop="fileType" class="is-required">
<el-input v-model="temp.fileType" placeholder="0文件夹 1文件" />
</el-form-item>
<el-form-item label="存放的系统路径" prop="fileSysPath" class="is-required">
<el-input v-model="temp.fileSysPath" placeholder="存放的系统路径" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editFile } from "@/api/business/file/file";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
fileId:'',
parentId:'',
fileBucket:'',
fileName:'',
fileSuffix:'',
fileSizeKb:'',
finalName:'',
filePath:'',
fileType:'',
fileSysPath:'',
createTime:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editFile(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,293 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="文件id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.fileId }}
</template>
</el-table-column>
<el-table-column
label="上级id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.parentId }}
</template>
</el-table-column>
<el-table-column
label="文件仓库oss仓库"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.fileBucket }}
</template>
</el-table-column>
<el-table-column
label="文件名称"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.fileName }}
</template>
</el-table-column>
<el-table-column
label="文件后缀"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.fileSuffix }}
</template>
</el-table-column>
<el-table-column
label="文件大小kb"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.fileSizeKb }}
</template>
</el-table-column>
<el-table-column
label="文件唯一标识id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.finalName }}
</template>
</el-table-column>
<el-table-column
label="存储路径"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.filePath }}
</template>
</el-table-column>
<el-table-column
label="0文件夹 1文件"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.fileType }}
</template>
</el-table-column>
<el-table-column
label="存放的系统路径"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.fileSysPath }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getFilePage,deleteFile} from "@/api/business/file/file";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/file/addFile";
import editForm from "@/views/business/file/editFile";
export default {
name: 'file',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getFilePage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteFile(scope.row.fileId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,112 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="会员姓名" prop="memberName" class="is-required">
<el-input v-model="temp.memberName" placeholder="会员姓名" />
</el-form-item>
<el-form-item label="手机号" prop="memberPhone" class="is-required">
<el-input v-model="temp.memberPhone" placeholder="手机号" />
</el-form-item>
<el-form-item label="备注" prop="remark" class="is-required">
<el-input type="textarea"
:rows="2" v-model="temp.remark" placeholder="备注" />
</el-form-item>
<el-form-item label="消费密码" prop="payPassword" >
<el-input v-model="temp.payPassword" placeholder="消费密码" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addMember} from "@/api/business/member/member";
import {getDeptList} from "@/api/system/dept/dept";
import {setRequiredFields,getSelectObj} from "@/utils";
const requiredFields = []
export default {
name: "addForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
memberId:'',
memberName:'',
memberPhone:'',
remark:'',
payPassword:'',
shopName:'',
shopId:'',
createTime:'',
},
deptList:[]
}
},
methods: {
open() {
this.dialogVisible = true
getDeptList().then(response => {
this.deptList = response.data
})
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addMember(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
},
handleSelect(e){
console.log(e)
let obj = getSelectObj(e,this.deptList,"deptId")
console.log(obj)
this.temp.shopName = obj.deptName
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,124 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="会员姓名" prop="memberName" class="is-required">
<el-input v-model="temp.memberName" placeholder="会员姓名" />
</el-form-item>
<el-form-item label="手机号" prop="memberPhone" class="is-required">
<el-input v-model="temp.memberPhone" placeholder="手机号" />
</el-form-item>
<el-form-item label="备注" prop="remark" class="is-required">
<el-input v-model="temp.remark" placeholder="备注" />
</el-form-item>
<el-form-item label="消费密码" prop="payPassword" class="is-required">
<el-input v-model="temp.payPassword" placeholder="消费密码" />
</el-form-item>
<!-- <el-form-item label="所属门店" prop="shopId" class="is-required">-->
<!-- <el-select v-model="temp.shopId" placeholder="请选择" @change="handleSelect">-->
<!-- <el-option-->
<!-- v-for="item in deptList"-->
<!-- :key="item.deptId"-->
<!-- :label="item.deptName"-->
<!-- :value="item.deptId">-->
<!-- <span style="float: left">{{ item.deptName }}</span>-->
<!-- <span style="float: right; color: #8492a6; font-size: 13px">{{ item.deptNo }}</span>-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editMember } from "@/api/business/member/member";
import {getDeptList} from "@/api/system/dept/dept";
import {setRequiredFields,getSelectObj} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
memberId:'',
memberName:'',
memberPhone:'',
remark:'',
payPassword:'',
shopName:'',
shopId:'',
createTime:'',
},
deptList:[]
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
getDeptList().then(response => {
this.deptList = response.data
})
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editMember(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
},
handleSelect(e){
console.log(e)
let obj = getSelectObj(e,this.deptList,"deptId")
console.log(obj)
this.temp.shopName = obj.deptName
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,245 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="会员姓名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberName }}
</template>
</el-table-column>
<el-table-column
label="手机号"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberPhone }}
</template>
</el-table-column>
<el-table-column
label="备注"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.remark }}
</template>
</el-table-column>
<el-table-column
label="消费密码"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.payPassword }}
</template>
</el-table-column>
<el-table-column
label="门店名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<!-- <el-button-->
<!-- type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- @click="del(scope)"-->
<!-- >-->
<!-- 删除-->
<!-- </el-button>-->
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getMemberPage,deleteMember} from "@/api/business/member/member";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination/index'
import addForm from "@/views/business/member/addMember";
import editForm from "@/views/business/member/editMember";
export default {
name: 'member',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getMemberPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteMember(scope.row.memberId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,181 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="会员卡id" prop="memberCardId" class="is-required">
<el-input v-model="temp.memberCardId" placeholder="会员卡id" />
</el-form-item>
<el-form-item label="会员id" prop="memberId" class="is-required">
<el-input v-model="temp.memberId" placeholder="会员id" />
</el-form-item>
<el-form-item label="卡项ID" prop="cardId" class="is-required">
<el-input v-model="temp.cardId" placeholder="卡项ID" />
</el-form-item>
<el-form-item label="卡号" prop="cardNo" class="is-required">
<el-input v-model="temp.cardNo" placeholder="卡号" />
</el-form-item>
<el-form-item label="卡名称" prop="cardName" class="is-required">
<el-input v-model="temp.cardName" placeholder="卡名称" />
</el-form-item>
<el-form-item label="余额" prop="amount" class="is-required">
<el-input v-model="temp.amount" placeholder="余额" />
</el-form-item>
<el-form-item label="赠送金额" prop="giveAmount" class="is-required">
<el-input v-model="temp.giveAmount" placeholder="赠送金额" />
</el-form-item>
<el-form-item label="商品折扣" prop="discount" class="is-required">
<el-input v-model="temp.discount" placeholder="商品折扣" />
</el-form-item>
<el-form-item label="开卡金额" prop="buildCardAmount" class="is-required">
<el-input v-model="temp.buildCardAmount" placeholder="开卡金额" />
</el-form-item>
<el-form-item label="提成比例" prop="pushMoney" class="is-required">
<el-input v-model="temp.pushMoney" placeholder="提成比例" />
</el-form-item>
<el-form-item label="0正常 1取消" prop="cardStatus" class="is-required">
<el-input v-model="temp.cardStatus" placeholder="0正常 1取消" />
</el-form-item>
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
</el-form-item>
<el-form-item label="乐观锁字段" prop="version" class="is-required">
<el-input v-model="temp.version" placeholder="乐观锁字段" />
</el-form-item>
<el-form-item label="门店id" prop="shopId" class="is-required">
<el-input v-model="temp.shopId" placeholder="门店id" />
</el-form-item>
<el-form-item label="门店名" prop="shopName" class="is-required">
<el-input v-model="temp.shopName" placeholder="门店名" />
</el-form-item>
<el-form-item label="创建人" prop="createName" class="is-required">
<el-input v-model="temp.createName" placeholder="创建人" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
<el-form-item label="创建人id" prop="createId" class="is-required">
<el-input v-model="temp.createId" placeholder="创建人id" />
</el-form-item>
<el-form-item label="修改时间" prop="updateTime" class="is-required">
<el-input v-model="temp.updateTime" placeholder="修改时间" />
</el-form-item>
<el-form-item label="修改人" prop="updateName" class="is-required">
<el-input v-model="temp.updateName" placeholder="修改人" />
</el-form-item>
<el-form-item label="修改人id" prop="updateId" class="is-required">
<el-input v-model="temp.updateId" placeholder="修改人id" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addMemberCard} from "@/api/business/memberCard/memberCard";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "addForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
memberCardId:'',
memberId:'',
cardId:'',
cardNo:'',
cardName:'',
amount:'',
giveAmount:'',
discount:'',
buildCardAmount:'',
pushMoney:'',
cardStatus:'',
deleted:'',
version:'',
shopId:'',
shopName:'',
createName:'',
createTime:'',
createId:'',
updateTime:'',
updateName:'',
updateId:'',
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addMemberCard(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,182 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="会员卡id" prop="memberCardId" class="is-required">
<el-input v-model="temp.memberCardId" placeholder="会员卡id" />
</el-form-item>
<el-form-item label="会员id" prop="memberId" class="is-required">
<el-input v-model="temp.memberId" placeholder="会员id" />
</el-form-item>
<el-form-item label="卡项ID" prop="cardId" class="is-required">
<el-input v-model="temp.cardId" placeholder="卡项ID" />
</el-form-item>
<el-form-item label="卡号" prop="cardNo" class="is-required">
<el-input v-model="temp.cardNo" placeholder="卡号" />
</el-form-item>
<el-form-item label="卡名称" prop="cardName" class="is-required">
<el-input v-model="temp.cardName" placeholder="卡名称" />
</el-form-item>
<el-form-item label="余额" prop="amount" class="is-required">
<el-input v-model="temp.amount" placeholder="余额" />
</el-form-item>
<el-form-item label="赠送金额" prop="giveAmount" class="is-required">
<el-input v-model="temp.giveAmount" placeholder="赠送金额" />
</el-form-item>
<el-form-item label="商品折扣" prop="discount" class="is-required">
<el-input v-model="temp.discount" placeholder="商品折扣" />
</el-form-item>
<el-form-item label="开卡金额" prop="buildCardAmount" class="is-required">
<el-input v-model="temp.buildCardAmount" placeholder="开卡金额" />
</el-form-item>
<el-form-item label="提成比例" prop="pushMoney" class="is-required">
<el-input v-model="temp.pushMoney" placeholder="提成比例" />
</el-form-item>
<el-form-item label="0正常 1取消" prop="cardStatus" class="is-required">
<el-input v-model="temp.cardStatus" placeholder="0正常 1取消" />
</el-form-item>
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
</el-form-item>
<el-form-item label="乐观锁字段" prop="version" class="is-required">
<el-input v-model="temp.version" placeholder="乐观锁字段" />
</el-form-item>
<el-form-item label="门店id" prop="shopId" class="is-required">
<el-input v-model="temp.shopId" placeholder="门店id" />
</el-form-item>
<el-form-item label="门店名" prop="shopName" class="is-required">
<el-input v-model="temp.shopName" placeholder="门店名" />
</el-form-item>
<el-form-item label="创建人" prop="createName" class="is-required">
<el-input v-model="temp.createName" placeholder="创建人" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
<el-form-item label="创建人id" prop="createId" class="is-required">
<el-input v-model="temp.createId" placeholder="创建人id" />
</el-form-item>
<el-form-item label="修改时间" prop="updateTime" class="is-required">
<el-input v-model="temp.updateTime" placeholder="修改时间" />
</el-form-item>
<el-form-item label="修改人" prop="updateName" class="is-required">
<el-input v-model="temp.updateName" placeholder="修改人" />
</el-form-item>
<el-form-item label="修改人id" prop="updateId" class="is-required">
<el-input v-model="temp.updateId" placeholder="修改人id" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editMemberCard } from "@/api/business/memberCard/memberCard";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
memberCardId:'',
memberId:'',
cardId:'',
cardNo:'',
cardName:'',
amount:'',
giveAmount:'',
discount:'',
buildCardAmount:'',
pushMoney:'',
cardStatus:'',
deleted:'',
version:'',
shopId:'',
shopName:'',
createName:'',
createTime:'',
createId:'',
updateTime:'',
updateName:'',
updateId:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editMemberCard(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,393 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="会员卡id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberCardId }}
</template>
</el-table-column>
<el-table-column
label="会员id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberId }}
</template>
</el-table-column>
<el-table-column
label="卡项ID"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardId }}
</template>
</el-table-column>
<el-table-column
label="卡号"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardNo }}
</template>
</el-table-column>
<el-table-column
label="卡名称"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardName }}
</template>
</el-table-column>
<el-table-column
label="余额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.amount }}
</template>
</el-table-column>
<el-table-column
label="赠送金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.giveAmount }}
</template>
</el-table-column>
<el-table-column
label="商品折扣"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.discount }}
</template>
</el-table-column>
<el-table-column
label="开卡金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.buildCardAmount }}
</template>
</el-table-column>
<el-table-column
label="提成比例"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.pushMoney }}
</template>
</el-table-column>
<el-table-column
label="0正常 1取消"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardStatus }}
</template>
</el-table-column>
<el-table-column
label="0正常 1删除"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.deleted }}
</template>
</el-table-column>
<el-table-column
label="乐观锁字段"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.version }}
</template>
</el-table-column>
<el-table-column
label="门店id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopId }}
</template>
</el-table-column>
<el-table-column
label="门店名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="创建人id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createId }}
</template>
</el-table-column>
<el-table-column
label="修改时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateTime }}
</template>
</el-table-column>
<el-table-column
label="修改人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateName }}
</template>
</el-table-column>
<el-table-column
label="修改人id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateId }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getMemberCardPage,deleteMemberCard} from "@/api/business/memberCard/memberCard";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/memberCard/addMemberCard";
import editForm from "@/views/business/memberCard/editMemberCard";
export default {
name: 'memberCard',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getMemberCardPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteMemberCard(scope.row.memberCardId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,156 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="日志id" prop="operId" class="is-required">
<el-input v-model="temp.operId" placeholder="日志id" />
</el-form-item>
<el-form-item label="请求模块" prop="operModule" class="is-required">
<el-input v-model="temp.operModule" placeholder="请求模块" />
</el-form-item>
<el-form-item label="操作类型" prop="operType" class="is-required">
<el-input v-model="temp.operType" placeholder="操作类型" />
</el-form-item>
<el-form-item label="操作描述" prop="operDesc" class="is-required">
<el-input v-model="temp.operDesc" placeholder="操作描述" />
</el-form-item>
<el-form-item label="操作方法" prop="operMethod" class="is-required">
<el-input v-model="temp.operMethod" placeholder="操作方法" />
</el-form-item>
<el-form-item label="请求参数" prop="oprrRequestParam" class="is-required">
<el-input v-model="temp.oprrRequestParam" placeholder="请求参数" />
</el-form-item>
<el-form-item label="响应参数" prop="operResponseParam" class="is-required">
<el-input v-model="temp.operResponseParam" placeholder="响应参数" />
</el-form-item>
<el-form-item label="操作人姓名" prop="operUserId" class="is-required">
<el-input v-model="temp.operUserId" placeholder="操作人姓名" />
</el-form-item>
<el-form-item label="操作人ID" prop="operUserName" class="is-required">
<el-input v-model="temp.operUserName" placeholder="操作人ID" />
</el-form-item>
<el-form-item label="操作ip" prop="operIp" class="is-required">
<el-input v-model="temp.operIp" placeholder="操作ip" />
</el-form-item>
<el-form-item label="请求url" prop="operUrl" class="is-required">
<el-input v-model="temp.operUrl" placeholder="请求url" />
</el-form-item>
<el-form-item label="操作机构id" prop="operDeptId" class="is-required">
<el-input v-model="temp.operDeptId" placeholder="操作机构id" />
</el-form-item>
<el-form-item label="机构名" prop="operDeptName" class="is-required">
<el-input v-model="temp.operDeptName" placeholder="机构名" />
</el-form-item>
<el-form-item label="" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="" />
</el-form-item>
<el-form-item label="会员id" prop="memberId" class="is-required">
<el-input v-model="temp.memberId" placeholder="会员id" />
</el-form-item>
<el-form-item label="会员名" prop="memberName" class="is-required">
<el-input v-model="temp.memberName" placeholder="会员名" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addOperationLog} from "@/api/business/operationLog/operationLog";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "addForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
operId:'',
operModule:'',
operType:'',
operDesc:'',
operMethod:'',
oprrRequestParam:'',
operResponseParam:'',
operUserId:'',
operUserName:'',
operIp:'',
operUrl:'',
operDeptId:'',
operDeptName:'',
createTime:'',
memberId:'',
memberName:'',
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addOperationLog(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,157 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="日志id" prop="operId" class="is-required">
<el-input v-model="temp.operId" placeholder="日志id" />
</el-form-item>
<el-form-item label="请求模块" prop="operModule" class="is-required">
<el-input v-model="temp.operModule" placeholder="请求模块" />
</el-form-item>
<el-form-item label="操作类型" prop="operType" class="is-required">
<el-input v-model="temp.operType" placeholder="操作类型" />
</el-form-item>
<el-form-item label="操作描述" prop="operDesc" class="is-required">
<el-input v-model="temp.operDesc" placeholder="操作描述" />
</el-form-item>
<el-form-item label="操作方法" prop="operMethod" class="is-required">
<el-input v-model="temp.operMethod" placeholder="操作方法" />
</el-form-item>
<el-form-item label="请求参数" prop="oprrRequestParam" class="is-required">
<el-input v-model="temp.oprrRequestParam" placeholder="请求参数" />
</el-form-item>
<el-form-item label="响应参数" prop="operResponseParam" class="is-required">
<el-input v-model="temp.operResponseParam" placeholder="响应参数" />
</el-form-item>
<el-form-item label="操作人姓名" prop="operUserId" class="is-required">
<el-input v-model="temp.operUserId" placeholder="操作人姓名" />
</el-form-item>
<el-form-item label="操作人ID" prop="operUserName" class="is-required">
<el-input v-model="temp.operUserName" placeholder="操作人ID" />
</el-form-item>
<el-form-item label="操作ip" prop="operIp" class="is-required">
<el-input v-model="temp.operIp" placeholder="操作ip" />
</el-form-item>
<el-form-item label="请求url" prop="operUrl" class="is-required">
<el-input v-model="temp.operUrl" placeholder="请求url" />
</el-form-item>
<el-form-item label="操作机构id" prop="operDeptId" class="is-required">
<el-input v-model="temp.operDeptId" placeholder="操作机构id" />
</el-form-item>
<el-form-item label="机构名" prop="operDeptName" class="is-required">
<el-input v-model="temp.operDeptName" placeholder="机构名" />
</el-form-item>
<el-form-item label="" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="" />
</el-form-item>
<el-form-item label="会员id" prop="memberId" class="is-required">
<el-input v-model="temp.memberId" placeholder="会员id" />
</el-form-item>
<el-form-item label="会员名" prop="memberName" class="is-required">
<el-input v-model="temp.memberName" placeholder="会员名" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editOperationLog } from "@/api/business/operationLog/operationLog";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
operId:'',
operModule:'',
operType:'',
operDesc:'',
operMethod:'',
oprrRequestParam:'',
operResponseParam:'',
operUserId:'',
operUserName:'',
operIp:'',
operUrl:'',
operDeptId:'',
operDeptName:'',
createTime:'',
memberId:'',
memberName:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editOperationLog(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,326 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="操作ip"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.operIp }}
</template>
</el-table-column>
<el-table-column
label="请求模块"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.operModule }}
</template>
</el-table-column>
<el-table-column
label="操作类型"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.operType }}
</template>
</el-table-column>
<el-table-column
label="操作描述"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.operDesc }}
</template>
</el-table-column>
<el-table-column
label="操作方法"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.operMethod }}
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- label="请求参数"-->
<!-- width="160"-->
<!-- align="center"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.oprrRequestParam }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
label="操作人姓名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.operUserId }}
</template>
</el-table-column>
<el-table-column
label="操作人ID"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.operUserName }}
</template>
</el-table-column>
<el-table-column
label="请求url"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.operUrl }}
</template>
</el-table-column>
<el-table-column
label="操作机构id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.operDeptId }}
</template>
</el-table-column>
<el-table-column
label="机构名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.operDeptName }}
</template>
</el-table-column>
<el-table-column
label=""
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="会员id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberId }}
</template>
</el-table-column>
<el-table-column
label="会员名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberName }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getOperationLogPage,deleteOperationLog} from "@/api/business/operationLog/operationLog";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/operationLog/addOperationLog";
import editForm from "@/views/business/operationLog/editOperationLog";
export default {
name: 'operationLog',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getOperationLogPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteOperationLog(scope.row.operationLogId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,242 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="3vh"
height="80%"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="分类" prop="categoryId" class="is-required">
<category-select v-model="temp.categoryId" @changeSelect="getCategory"/>
</el-form-item>
<el-form-item label="商品名" prop="productName" class="is-required">
<el-input v-model="temp.productName" placeholder="商品名" />
</el-form-item>
<el-form-item label="商品金额" prop="productAmount" class="is-required">
<el-input v-model="temp.productAmount" placeholder="商品金额" />
</el-form-item>
<el-form-item label="商品会员金额" prop="productMemberAmount" class="is-required">
<el-input v-model="temp.productMemberAmount" placeholder="商品会员金额" />
</el-form-item>
<el-form-item label="商品图片" prop="productImage" class="is-required">
<el-upload
class="avatar-uploader"
:action="''"
:show-file-list="false"
:before-upload="beforeAvatarUpload"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar" style="width: 140px;height: 140px;">
<div style="width: 140px;height: 140px;display: flex;justify-content: center;align-items: center;border: 1px solid #eee;" v-else>
<i class="el-icon-plus avatar-uploader-icon" ></i>
</div>
</el-upload>
<x-cropper ref="iscropper"/>
</el-form-item>
<el-form-item label="库存管理" prop="stockControl" class="is-required">
<el-radio-group v-model="temp.stockControl" size="small">
<el-radio-button label="0">关闭</el-radio-button>
<el-radio-button label="1">开启</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item v-if="temp.stockControl==1" label="初始化库存数量" prop="productCount" class="is-required">
<el-input v-model="temp.productCount" placeholder="初始化库存数量" />
</el-form-item>
<el-form-item label="提成方式" prop="pushType" class="is-required">
<el-radio-group v-model="temp.pushType" size="small">
<el-radio-button label="0">固定金额</el-radio-button>
<el-radio-button label="1">比例</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="提成金额" v-if="temp.pushType==0" prop="pushAmount" class="is-required">
<el-input v-model="temp.pushAmount" placeholder="提成金额" />
</el-form-item>
<el-form-item label="提成比例" v-if="temp.pushType==1" prop="pushPercent" class="is-required">
<el-input v-model="temp.pushPercent" placeholder="提成比例" />
</el-form-item>
<el-form-item label="状态" prop="productStatus" class="is-required">
<el-radio-group v-model="temp.productStatus" size="small">
<el-radio-button label="0">正常</el-radio-button>
<el-radio-button label="1">禁用</el-radio-button>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="所属门店" prop="shopId" class="is-required">-->
<!-- <dept-select v-model="temp.shopId" @changeSelect="getDept" style="width: 100%;"/>-->
<!-- </el-form-item>-->
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import request from '@/utils/request'
import {addProduct} from "@/api/business/product/product";
import {setRequiredFields} from "@/utils";
import CategorySelect from "@/views/common/business/categorySelect";
import XCropper from "@/views/common/XCropper";
import DeptSelect from "@/views/common/system/deptSelect";
const requiredFields = []
export default {
name: "addForm",
components: {DeptSelect, XCropper, CategorySelect},
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
productId:'',
categoryId:'',
categoryName:'',
productName:'',
productAmount:'',
productMemberAmount:'',
productImage:'',
productCount:'',
pushAmount:'',
pushPercent:'',
stockControl:0,
productStatus:0,
shopId:'',
shopName:'',
},
imageUrl: ''
}
},
methods: {
open(categoryId) {
this.dialogVisible = true
this.temp.categoryId = categoryId
},
beforeAvatarUpload(file){
console.log("进入了文件上传")
let _this = this
return new Promise((resolve, reject) => {
let types = ['image/jpeg', 'image/jpg', 'image/png'];
// let width = 140;
// let height = 140;
const isJPG = types.includes(file.type)
const isLt2M = file.size / 1024 / 1024 < 10
if (!isJPG) {
_this.$message.error('上传图片只能是 JPG 或 png格式!')
reject()
return
}
if (!isLt2M) {
_this.$message.error('上传图片大小不能超过 10MB!')
reject()
return
}
let _URL = window.URL || window.webkitURL;
console.log( _this.$refs.iscropper)
//上传前对图片进行裁剪
_this.$refs.iscropper.showModal({
img: _URL.createObjectURL(file) , // 裁剪图片的地址
autoCropWidth: 140, // 默认生成截图框宽度
autoCropHeight: 140, // 默认生成截图框高度
fixedBox:true,
success: res => {
//拿到裁剪后图片没有name 属性
//file的name属性为只读 不能手动设置
//创建一个新的图片对象 设置原始文件名
const cloneFile = new File([res.img], file.name);
const formData = new FormData()
// console.log(param.file)
//通过 append 函数往formdata对象里传参这里传的是后端需求的接口信息
formData.append('file', cloneFile)
formData.append('fileSavePath', "productImage")
//执行上传操作
request({
method: "post",
url: "/upload",
data: formData,
headers: { "Content-Type": "multipart/form-data" },
}).then(response => {
//请求成功
_this.handleAvatarSuccess(response,cloneFile)
})
resolve()
}
})
})
},
handleAvatarSuccess(res,file) {
if(res.code == 200){
this.imageUrl = URL.createObjectURL(file);
this.temp.productImage = res.data.fileId
}else{
this.imageUrl = '';
this.temp.productImg = ''
}
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addProduct(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.imageUrl = '';
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
},
getCategory(e){
console.log(e)
this.temp.categoryName = e.categoryName
},
getDept(e){
this.temp.shopName = e.deptName
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,243 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="3vh"
height="80%"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="分类" prop="categoryId" class="is-required">
<category-select v-model="temp.categoryId" @changeSelect="getCategory"/>
</el-form-item>
<el-form-item label="商品名" prop="productName" class="is-required">
<el-input v-model="temp.productName" placeholder="商品名" />
</el-form-item>
<el-form-item label="商品金额" prop="productAmount" class="is-required">
<el-input v-model="temp.productAmount" placeholder="商品金额" />
</el-form-item>
<el-form-item label="商品会员金额" prop="productMemberAmount" class="is-required">
<el-input v-model="temp.productMemberAmount" placeholder="商品会员金额" />
</el-form-item>
<el-form-item label="商品图片" prop="productImage" class="is-required">
<el-upload
class="avatar-uploader"
:action="''"
:show-file-list="false"
:before-upload="beforeAvatarUpload"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar" style="width: 140px;height: 140px;">
<div style="width: 140px;height: 140px;display: flex;justify-content: center;align-items: center;border: 1px solid #eee;" v-else>
<i class="el-icon-plus avatar-uploader-icon" ></i>
</div>
</el-upload>
<x-cropper ref="iscropper"/>
</el-form-item>
<el-form-item label="库存管理" prop="stockControl" class="is-required">
<el-radio-group v-model="temp.stockControl" size="small">
<el-radio-button label="0">关闭</el-radio-button>
<el-radio-button label="1">开启</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item v-if="temp.stockControl==1" label="库存数量" prop="productCount" class="is-required">
<el-input v-model="temp.productCount" readonly placeholder="库存数量" />
</el-form-item>
<el-form-item label="提成方式" prop="pushType" class="is-required">
<el-radio-group v-model="temp.pushType" size="small">
<el-radio-button label="0">固定金额</el-radio-button>
<el-radio-button label="1">比例</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="提成金额" v-if="temp.pushType==0" prop="pushAmount" class="is-required">
<el-input v-model="temp.pushAmount" placeholder="提成金额" />
</el-form-item>
<el-form-item label="提成比例" v-if="temp.pushType==1" prop="pushPercent" class="is-required">
<el-input v-model="temp.pushPercent" placeholder="提成比例" />
</el-form-item>
<el-form-item label="状态" prop="productStatus" class="is-required">
<el-radio-group v-model="temp.productStatus" size="small">
<el-radio-button label="0">正常</el-radio-button>
<el-radio-button label="1">禁用</el-radio-button>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="所属门店" prop="shopId" class="is-required">-->
<!-- <dept-select v-model="temp.shopId" @changeSelect="getDept" style="width: 100%;"/>-->
<!-- </el-form-item>-->
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import request from '@/utils/request'
import { editProduct } from "@/api/business/product/product";
import {setRequiredFields} from "@/utils";
import CategorySelect from "@/views/common/business/categorySelect";
import XCropper from "@/views/common/XCropper";
import DeptSelect from "@/views/common/system/deptSelect";
const requiredFields = []
export default {
name: "editForm",
components: {DeptSelect, XCropper, CategorySelect},
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
productId:'',
categoryId:'',
categoryName:'',
productName:'',
productAmount:'',
productMemberAmount:'',
productImage:'',
productCount:'',
pushAmount:'',
pushPercent:'',
productStatus:0,
shopId:'',
shopName:'',
pushType:0
},
imageUrl:''
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
if(this.temp.productImageUrl){
this.imageUrl = this.baseUrl + this.temp.productImageUrl
}
this.dialogVisible = true
},
beforeAvatarUpload(file){
console.log("进入了文件上传")
let _this = this
return new Promise((resolve, reject) => {
let types = ['image/jpeg', 'image/jpg', 'image/png'];
// let width = 140;
// let height = 140;
const isJPG = types.includes(file.type)
const isLt2M = file.size / 1024 / 1024 < 2
if (!isJPG) {
_this.$message.error('上传图片只能是 JPG 或 png格式!')
reject()
}
if (!isLt2M) {
_this.$message.error('上传图片大小不能超过 2MB!')
reject()
}
let _URL = window.URL || window.webkitURL;
console.log( _this.$refs.iscropper)
//上传前对图片进行裁剪
_this.$refs.iscropper.showModal({
img: _URL.createObjectURL(file) , // 裁剪图片的地址
autoCropWidth: 140, // 默认生成截图框宽度
autoCropHeight: 140, // 默认生成截图框高度
fixedBox:true,
success: res => {
//拿到裁剪后图片没有name 属性
//file的name属性为只读 不能手动设置
//创建一个新的图片对象 设置原始文件名
const cloneFile = new File([res.img], file.name);
const formData = new FormData()
// console.log(param.file)
//通过 append 函数往formdata对象里传参这里传的是后端需求的接口信息
formData.append('file', cloneFile)
formData.append('fileSavePath', "productImage")
//执行上传操作
request({
method: "post",
url: "/upload",
data: formData,
headers: { "Content-Type": "multipart/form-data" },
}).then(response => {
//请求成功
_this.handleAvatarSuccess(response,cloneFile)
})
resolve()
}
})
})
},
handleAvatarSuccess(res,file) {
if(res.code == 200){
this.imageUrl = URL.createObjectURL(file);
this.temp.productImage = res.data.fileId
}else{
this.imageUrl = '';
this.temp.productImg = ''
}
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editProduct(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
},
getCategory(e){
console.log(e)
this.temp.categoryName = e.categoryName
},
getDept(e){
this.temp.shopName = e.deptName
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,360 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-row :gutter="24" class="row-container">
<el-col :span="4" style="height: 100%;">
<el-tree
default-expand-all
:data="categoryList"
node-key="categoryId"
:props="defaultProps"
@node-click="handleNodeClick"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span :class="listQuery.categoryId==data.categoryId?'info-text':''" > {{ node.label }}</span>
</span>
</el-tree>
</el-col>
<el-col :span="20" style="height: 100%;">
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="分类名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.categoryName }}
</template>
</el-table-column>
<el-table-column
label="商品名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productName }}
</template>
</el-table-column>
<el-table-column
label="商品金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productAmount }}
</template>
</el-table-column>
<el-table-column
label="商品会员金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productMemberAmount }}
</template>
</el-table-column>
<el-table-column
label="商品图片"
width="160"
align="center"
>
<template slot-scope="scope">
<img v-if="scope.row.productImage" :src=" baseUrl + scope.row.productImageUrl" class="avatar" style="width: 40px;height: 40px;">
</template>
</el-table-column>
<el-table-column
label="库存数量"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productCount }}
</template>
</el-table-column>
<el-table-column
label="提成金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.pushAmount }}
</template>
</el-table-column>
<el-table-column
label="提成比例"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.pushPercent }}
</template>
</el-table-column>
<el-table-column
label="0正常 1下架"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productStatus }}
</template>
</el-table-column>
<el-table-column
label="门店名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="修改人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateName }}
</template>
</el-table-column>
<el-table-column
label="修改时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateTime }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
v-hasPerms="'product:del'"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
</el-col>
</el-row>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getCategoryList} from "@/api/business/category/category";
import {getProductPage,deleteProduct} from "@/api/business/product/product";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/product/addProduct";
import editForm from "@/views/business/product/editProduct";
export default {
name: 'product',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
categoryId: '',
keyword: ''
},
defaultProps: {
id: 'categoryId',
label: 'categoryName',
},
temp: {},
categoryList: []
}
},
created() {
this.fetchData()
this.getCategoryList()
},
methods: {
getCategoryList(){
getCategoryList().then(res => {
this.categoryList = res.data
})
},
handleNodeClick(e){
this.listQuery.categoryId = e.categoryId
this.fetchData()
},
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getProductPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open(this.listQuery.categoryId)
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteProduct(scope.row.productId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,181 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="订单id" prop="sellId" class="is-required">
<el-input v-model="temp.sellId" placeholder="订单id" />
</el-form-item>
<el-form-item label="订单号" prop="sellNo" class="is-required">
<el-input v-model="temp.sellNo" placeholder="订单号" />
</el-form-item>
<el-form-item label="流水号" prop="serialNo" class="is-required">
<el-input v-model="temp.serialNo" placeholder="流水号" />
</el-form-item>
<el-form-item label="会员ID" prop="memberId" class="is-required">
<el-input v-model="temp.memberId" placeholder="会员ID" />
</el-form-item>
<el-form-item label="会员名称" prop="memberName" class="is-required">
<el-input v-model="temp.memberName" placeholder="会员名称" />
</el-form-item>
<el-form-item label="消费金额" prop="sellAmount" class="is-required">
<el-input v-model="temp.sellAmount" placeholder="消费金额" />
</el-form-item>
<el-form-item label="实际入账" prop="realAmount" class="is-required">
<el-input v-model="temp.realAmount" placeholder="实际入账" />
</el-form-item>
<el-form-item label="1开卡 2续卡 3项目/商品" prop="sellType" class="is-required">
<el-input v-model="temp.sellType" placeholder="1开卡 2续卡 3项目/商品" />
</el-form-item>
<el-form-item label="0正常 1取消" prop="sellStatus" class="is-required">
<el-input v-model="temp.sellStatus" placeholder="0正常 1取消" />
</el-form-item>
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
</el-form-item>
<el-form-item label="乐观锁字段" prop="version" class="is-required">
<el-input v-model="temp.version" placeholder="乐观锁字段" />
</el-form-item>
<el-form-item label="门店id" prop="shopId" class="is-required">
<el-input v-model="temp.shopId" placeholder="门店id" />
</el-form-item>
<el-form-item label="门店名" prop="shopName" class="is-required">
<el-input v-model="temp.shopName" placeholder="门店名" />
</el-form-item>
<el-form-item label="创建人" prop="createName" class="is-required">
<el-input v-model="temp.createName" placeholder="创建人" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
<el-form-item label="创建人id" prop="createId" class="is-required">
<el-input v-model="temp.createId" placeholder="创建人id" />
</el-form-item>
<el-form-item label="修改时间" prop="updateTime" class="is-required">
<el-input v-model="temp.updateTime" placeholder="修改时间" />
</el-form-item>
<el-form-item label="修改人" prop="updateName" class="is-required">
<el-input v-model="temp.updateName" placeholder="修改人" />
</el-form-item>
<el-form-item label="修改人id" prop="updateId" class="is-required">
<el-input v-model="temp.updateId" placeholder="修改人id" />
</el-form-item>
<el-form-item label="消费后金额" prop="memberCardAfterAmount" class="is-required">
<el-input v-model="temp.memberCardAfterAmount" placeholder="消费后金额" />
</el-form-item>
<el-form-item label="" prop="memberCardBeforeAmount" class="is-required">
<el-input v-model="temp.memberCardBeforeAmount" placeholder="" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addSell} from "@/api/business/sell/sell";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "addForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
sellId:'',
sellNo:'',
serialNo:'',
memberId:'',
memberName:'',
sellAmount:'',
realAmount:'',
sellType:'',
sellStatus:'',
deleted:'',
version:'',
shopId:'',
shopName:'',
createName:'',
createTime:'',
createId:'',
updateTime:'',
updateName:'',
updateId:'',
memberCardAfterAmount:'',
memberCardBeforeAmount:'',
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addSell(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,182 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="订单id" prop="sellId" class="is-required">
<el-input v-model="temp.sellId" placeholder="订单id" />
</el-form-item>
<el-form-item label="订单号" prop="sellNo" class="is-required">
<el-input v-model="temp.sellNo" placeholder="订单号" />
</el-form-item>
<el-form-item label="流水号" prop="serialNo" class="is-required">
<el-input v-model="temp.serialNo" placeholder="流水号" />
</el-form-item>
<el-form-item label="会员ID" prop="memberId" class="is-required">
<el-input v-model="temp.memberId" placeholder="会员ID" />
</el-form-item>
<el-form-item label="会员名称" prop="memberName" class="is-required">
<el-input v-model="temp.memberName" placeholder="会员名称" />
</el-form-item>
<el-form-item label="消费金额" prop="sellAmount" class="is-required">
<el-input v-model="temp.sellAmount" placeholder="消费金额" />
</el-form-item>
<el-form-item label="实际入账" prop="realAmount" class="is-required">
<el-input v-model="temp.realAmount" placeholder="实际入账" />
</el-form-item>
<el-form-item label="1开卡 2续卡 3项目/商品" prop="sellType" class="is-required">
<el-input v-model="temp.sellType" placeholder="1开卡 2续卡 3项目/商品" />
</el-form-item>
<el-form-item label="0正常 1取消" prop="sellStatus" class="is-required">
<el-input v-model="temp.sellStatus" placeholder="0正常 1取消" />
</el-form-item>
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
</el-form-item>
<el-form-item label="乐观锁字段" prop="version" class="is-required">
<el-input v-model="temp.version" placeholder="乐观锁字段" />
</el-form-item>
<el-form-item label="门店id" prop="shopId" class="is-required">
<el-input v-model="temp.shopId" placeholder="门店id" />
</el-form-item>
<el-form-item label="门店名" prop="shopName" class="is-required">
<el-input v-model="temp.shopName" placeholder="门店名" />
</el-form-item>
<el-form-item label="创建人" prop="createName" class="is-required">
<el-input v-model="temp.createName" placeholder="创建人" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
<el-form-item label="创建人id" prop="createId" class="is-required">
<el-input v-model="temp.createId" placeholder="创建人id" />
</el-form-item>
<el-form-item label="修改时间" prop="updateTime" class="is-required">
<el-input v-model="temp.updateTime" placeholder="修改时间" />
</el-form-item>
<el-form-item label="修改人" prop="updateName" class="is-required">
<el-input v-model="temp.updateName" placeholder="修改人" />
</el-form-item>
<el-form-item label="修改人id" prop="updateId" class="is-required">
<el-input v-model="temp.updateId" placeholder="修改人id" />
</el-form-item>
<el-form-item label="消费后金额" prop="memberCardAfterAmount" class="is-required">
<el-input v-model="temp.memberCardAfterAmount" placeholder="消费后金额" />
</el-form-item>
<el-form-item label="" prop="memberCardBeforeAmount" class="is-required">
<el-input v-model="temp.memberCardBeforeAmount" placeholder="" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editSell } from "@/api/business/sell/sell";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
sellId:'',
sellNo:'',
serialNo:'',
memberId:'',
memberName:'',
sellAmount:'',
realAmount:'',
sellType:'',
sellStatus:'',
deleted:'',
version:'',
shopId:'',
shopName:'',
createName:'',
createTime:'',
createId:'',
updateTime:'',
updateName:'',
updateId:'',
memberCardAfterAmount:'',
memberCardBeforeAmount:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editSell(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,473 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
fit
height="100%"
class="table-container"
highlight-current-row
stripe
@row-click="handleRowClick"
row-key="sellId"
ref="multipleTableRef"
:expand-row-keys="expandedKeys"
>
<el-table-column type="expand">
<template slot-scope="scope">
<el-row :gutter="20">
<el-col :span="13">
<el-table :data="scope.row.sellDetailList" stripe >
<template v-if="scope.row.sellType == 1">
<el-table-column>
<template slot="header">
<div class="info-text" style="text-align: center;">销售详情</div>
</template>
<el-table-column prop="productName" label="商品名称" align="center">
<template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.productName }}</div>
</template>
</el-table-column>
<el-table-column prop="count" label="数量" align="center">
<template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.count }}</div>
</template>
</el-table-column>
<el-table-column prop="discount" label="折扣" align="center">
<template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.discount?scope.row.discount:'-' }}</div>
</template>
</el-table-column>
<el-table-column prop="amount" label="金额" align="center">
<template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.amount }}</div>
</template>
</el-table-column>
<el-table-column prop="realAmount" label="实际金额" align="center">
<template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.realAmount }}</div>
</template>
</el-table-column>
<el-table-column prop="serverList" width="380" label="服务人员信息" align="center">
<template slot-scope="scope">
<span v-show="scope.row.detailServerList.length == 0">-</span>
<el-descriptions :column="3" class="server">
<template v-for="item in scope.row.detailServerList">
<el-descriptions-item label="服务人员">{{item.serverName}}</el-descriptions-item>
<el-descriptions-item label="业绩">{{item.serverGrade}}</el-descriptions-item>
<el-descriptions-item label="提成">{{item.serverPushMoney}}</el-descriptions-item>
</template>
</el-descriptions>
</template>
</el-table-column>
</el-table-column>
</template>
<template v-if="scope.row.sellType == 2 || scope.row.sellType == 3">
<el-table-column>
<template slot="header">
<div class="info-text" style="text-align: center;">充卡详情</div>
</template>
<el-table-column prop="productName" label="卡名" align="center">
<template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.cardName }}</div>
</template>
</el-table-column>
<el-table-column prop="amount" label="金额" align="center">
<template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.amount }}</div>
</template>
</el-table-column>
<el-table-column prop="realAmount" label="赠送金额" align="center">
<template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.giveAmount }}</div>
</template>
</el-table-column>
<el-table-column prop="serverList" width="380" label="服务人员信息" align="center">
<template slot-scope="scope">
<span v-show="scope.row.detailServerList.length == 0">-</span>
<el-descriptions :column="3" class="server">
<template v-for="item in scope.row.detailServerList">
<el-descriptions-item label="服务人员">{{item.serverName}}</el-descriptions-item>
<el-descriptions-item label="业绩">{{item.serverGrade}}</el-descriptions-item>
<el-descriptions-item label="提成">{{item.serverPushMoney}}</el-descriptions-item>
</template>
</el-descriptions>
</template>
</el-table-column>
</el-table-column>
</template>
</el-table>
</el-col>
<el-col :span="6">
<el-table :data="scope.row.sellPayList">
<el-table-column>
<template slot="header">
<div class="info-text" style="text-align: center;">支付方式</div>
</template>
<el-table-column prop="payName" label="支付名称" align="center">
<template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.payName }}</div>
</template>
</el-table-column>
<el-table-column prop="amount" label="支付金额" align="center">
<template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.amount }}</div>
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-col>
</el-row>
</template>
</el-table-column>
<el-table-column
label="订单号"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.sellNo }}
</template>
</el-table-column>
<el-table-column
label="类型"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.sellType == 1">
商品
</span>
<span v-if="scope.row.sellType == 2">
开卡
</span>
<span v-if="scope.row.sellType == 3">
续卡
</span>
</template>
</el-table-column>
<el-table-column
label="会员信息"
width="200"
align="center"
>
<template slot-scope="scope">
<div class="info-text">
<span>{{ scope.row.memberName?scope.row.memberName:'散客' }}</span><br/>
<span v-if="app.isNotEmpty(scope.row.memberCardId)"> {{ scope.row.memberCardName }} ({{scope.row.memberCardNo}})</span>
</div>
</template>
</el-table-column>
<el-table-column
label="消费金额"
align="center"
>
<template slot-scope="scope">
<span class="price-text"> {{ scope.row.sellAmount }}</span>
</template>
</el-table-column>
<el-table-column
label="实际入账"
align="center"
>
<template slot-scope="scope">
<span class="price-text">{{ scope.row.realAmount }}</span>
</template>
</el-table-column>
<el-table-column
label="门店名"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="修改时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateTime }}
</template>
</el-table-column>
<el-table-column
label="修改人"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateName }}
</template>
</el-table-column>
<el-table-column
label="状态"
align="center"
>
<template slot-scope="scope">
<span v-show="scope.row.sellStatus==0" class="info-text">正常</span>
<span v-show="scope.row.sellStatus==1" class="price-text">销单</span>
</template>
</el-table-column>
<el-table-column
label="消费前金额"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberCardBeforeAmount }}
</template>
</el-table-column>
<el-table-column
label="消费前赠送金额"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberCardBeforeGiveAmount }}
</template>
</el-table-column>
<el-table-column
label="消费后金额"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberCardAfterAmount }}
</template>
</el-table-column>
<el-table-column
label="消费后赠送金额"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberCardAfterGiveAmount }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="160"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="danger"
size="mini"
@click="del(scope)"
>
销单
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getSellPage,deleteSell,cancelSell} from "@/api/business/sell/sell";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import prompt from "@/utils/prompt";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/sell/addSell";
import editForm from "@/views/business/sell/editSell";
export default {
name: 'sell',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
expandedKeys: []
}
},
created() {
this.fetchData()
},
methods: {
handleRowClick(row, event, column) {
console.log(this.expandedKeys)
if (this.expandedKeys.length > 0 && this.expandedKeys[0] == row.sellId) {
console.log('我被关闭了')
// 关闭之前展开的项
this.expandedKeys = []
// this.$refs.multipleTableRef.toggleRowExpansion(row, false);
}else{
this.expandedKeys = [row.sellId];
this.$refs.multipleTableRef.toggleRowExpansion(row);
}
},
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getSellPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要销单吗?销单后余额和库存会发生改变!").then(res=>{
if(res){
prompt("请输入销单原因").then(res =>{
if(res){
cancelSell({
sellId:scope.row.sellId,
remark:res
}).then(res => {
console.log("销单成功")
this.fetchData()
})
}
})
}
})
},
}
}
</script>
<style scoped>
.demo-table-expand {
font-size: 0;
}
.demo-table-expand label {
width: 90px;
color: #99a9bf;
}
.demo-table-expand .el-form-item {
margin-right: 0;
margin-bottom: 0;
}
.el-form-item__label {
text-align: center;
}
/deep/ .el-descriptions__body{
background: transparent;
}
/deep/ .el-table tr{
background: transparent;
}
</style>

View File

@@ -0,0 +1,191 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="销售细单id" prop="sellDetailId" class="is-required">
<el-input v-model="temp.sellDetailId" placeholder="销售细单id" />
</el-form-item>
<el-form-item label="会员id" prop="memberId" class="is-required">
<el-input v-model="temp.memberId" placeholder="会员id" />
</el-form-item>
<el-form-item label="订单id" prop="sellId" class="is-required">
<el-input v-model="temp.sellId" placeholder="订单id" />
</el-form-item>
<el-form-item label="1开卡 2续卡 3项目 4商品" prop="sellType" class="is-required">
<el-input v-model="temp.sellType" placeholder="1开卡 2续卡 3项目 4商品" />
</el-form-item>
<el-form-item label="会员卡id" prop="memberCardId" class="is-required">
<el-input v-model="temp.memberCardId" placeholder="会员卡id" />
</el-form-item>
<el-form-item label="商品ID" prop="productId" class="is-required">
<el-input v-model="temp.productId" placeholder="商品ID" />
</el-form-item>
<el-form-item label="商品名" prop="productName" class="is-required">
<el-input v-model="temp.productName" placeholder="商品名" />
</el-form-item>
<el-form-item label="商品数量" prop="count" class="is-required">
<el-input v-model="temp.count" placeholder="商品数量" />
</el-form-item>
<el-form-item label="折扣" prop="discount" class="is-required">
<el-input v-model="temp.discount" placeholder="折扣" />
</el-form-item>
<el-form-item label="金额" prop="amount" class="is-required">
<el-input v-model="temp.amount" placeholder="金额" />
</el-form-item>
<el-form-item label="实际金额" prop="realAmount" class="is-required">
<el-input v-model="temp.realAmount" placeholder="实际金额" />
</el-form-item>
<el-form-item label="卡项ID" prop="cardId" class="is-required">
<el-input v-model="temp.cardId" placeholder="卡项ID" />
</el-form-item>
<el-form-item label="卡名" prop="cardName" class="is-required">
<el-input v-model="temp.cardName" placeholder="卡名" />
</el-form-item>
<el-form-item label="赠送金额" prop="giveAmount" class="is-required">
<el-input v-model="temp.giveAmount" placeholder="赠送金额" />
</el-form-item>
<el-form-item label="门店id" prop="shopId" class="is-required">
<el-input v-model="temp.shopId" placeholder="门店id" />
</el-form-item>
<el-form-item label="门店名" prop="shopName" class="is-required">
<el-input v-model="temp.shopName" placeholder="门店名" />
</el-form-item>
<el-form-item label="创建人" prop="createName" class="is-required">
<el-input v-model="temp.createName" placeholder="创建人" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
<el-form-item label="创建人id" prop="createId" class="is-required">
<el-input v-model="temp.createId" placeholder="创建人id" />
</el-form-item>
<el-form-item label="修改时间" prop="updateTime" class="is-required">
<el-input v-model="temp.updateTime" placeholder="修改时间" />
</el-form-item>
<el-form-item label="修改人" prop="updateName" class="is-required">
<el-input v-model="temp.updateName" placeholder="修改人" />
</el-form-item>
<el-form-item label="修改人id" prop="updateId" class="is-required">
<el-input v-model="temp.updateId" placeholder="修改人id" />
</el-form-item>
<el-form-item label="0正常 1取消" prop="sellStatus" class="is-required">
<el-input v-model="temp.sellStatus" placeholder="0正常 1取消" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addSellDetail} from "@/api/business/sellDetail/sellDetail";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "addForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
sellDetailId:'',
memberId:'',
sellId:'',
sellType:'',
memberCardId:'',
productId:'',
productName:'',
count:'',
discount:'',
amount:'',
realAmount:'',
cardId:'',
cardName:'',
giveAmount:'',
shopId:'',
shopName:'',
createName:'',
createTime:'',
createId:'',
updateTime:'',
updateName:'',
updateId:'',
sellStatus:'',
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addSellDetail(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,192 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="销售细单id" prop="sellDetailId" class="is-required">
<el-input v-model="temp.sellDetailId" placeholder="销售细单id" />
</el-form-item>
<el-form-item label="会员id" prop="memberId" class="is-required">
<el-input v-model="temp.memberId" placeholder="会员id" />
</el-form-item>
<el-form-item label="订单id" prop="sellId" class="is-required">
<el-input v-model="temp.sellId" placeholder="订单id" />
</el-form-item>
<el-form-item label="1开卡 2续卡 3项目 4商品" prop="sellType" class="is-required">
<el-input v-model="temp.sellType" placeholder="1开卡 2续卡 3项目 4商品" />
</el-form-item>
<el-form-item label="会员卡id" prop="memberCardId" class="is-required">
<el-input v-model="temp.memberCardId" placeholder="会员卡id" />
</el-form-item>
<el-form-item label="商品ID" prop="productId" class="is-required">
<el-input v-model="temp.productId" placeholder="商品ID" />
</el-form-item>
<el-form-item label="商品名" prop="productName" class="is-required">
<el-input v-model="temp.productName" placeholder="商品名" />
</el-form-item>
<el-form-item label="商品数量" prop="count" class="is-required">
<el-input v-model="temp.count" placeholder="商品数量" />
</el-form-item>
<el-form-item label="折扣" prop="discount" class="is-required">
<el-input v-model="temp.discount" placeholder="折扣" />
</el-form-item>
<el-form-item label="金额" prop="amount" class="is-required">
<el-input v-model="temp.amount" placeholder="金额" />
</el-form-item>
<el-form-item label="实际金额" prop="realAmount" class="is-required">
<el-input v-model="temp.realAmount" placeholder="实际金额" />
</el-form-item>
<el-form-item label="卡项ID" prop="cardId" class="is-required">
<el-input v-model="temp.cardId" placeholder="卡项ID" />
</el-form-item>
<el-form-item label="卡名" prop="cardName" class="is-required">
<el-input v-model="temp.cardName" placeholder="卡名" />
</el-form-item>
<el-form-item label="赠送金额" prop="giveAmount" class="is-required">
<el-input v-model="temp.giveAmount" placeholder="赠送金额" />
</el-form-item>
<el-form-item label="门店id" prop="shopId" class="is-required">
<el-input v-model="temp.shopId" placeholder="门店id" />
</el-form-item>
<el-form-item label="门店名" prop="shopName" class="is-required">
<el-input v-model="temp.shopName" placeholder="门店名" />
</el-form-item>
<el-form-item label="创建人" prop="createName" class="is-required">
<el-input v-model="temp.createName" placeholder="创建人" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
<el-form-item label="创建人id" prop="createId" class="is-required">
<el-input v-model="temp.createId" placeholder="创建人id" />
</el-form-item>
<el-form-item label="修改时间" prop="updateTime" class="is-required">
<el-input v-model="temp.updateTime" placeholder="修改时间" />
</el-form-item>
<el-form-item label="修改人" prop="updateName" class="is-required">
<el-input v-model="temp.updateName" placeholder="修改人" />
</el-form-item>
<el-form-item label="修改人id" prop="updateId" class="is-required">
<el-input v-model="temp.updateId" placeholder="修改人id" />
</el-form-item>
<el-form-item label="0正常 1取消" prop="sellStatus" class="is-required">
<el-input v-model="temp.sellStatus" placeholder="0正常 1取消" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editSellDetail } from "@/api/business/sellDetail/sellDetail";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
sellDetailId:'',
memberId:'',
sellId:'',
sellType:'',
memberCardId:'',
productId:'',
productName:'',
count:'',
discount:'',
amount:'',
realAmount:'',
cardId:'',
cardName:'',
giveAmount:'',
shopId:'',
shopName:'',
createName:'',
createTime:'',
createId:'',
updateTime:'',
updateName:'',
updateId:'',
sellStatus:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editSellDetail(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,413 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="销售细单id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.sellDetailId }}
</template>
</el-table-column>
<el-table-column
label="会员id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberId }}
</template>
</el-table-column>
<el-table-column
label="订单id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.sellId }}
</template>
</el-table-column>
<el-table-column
label="1开卡 2续卡 3项目 4商品"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.sellType }}
</template>
</el-table-column>
<el-table-column
label="会员卡id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.memberCardId }}
</template>
</el-table-column>
<el-table-column
label="商品ID"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productId }}
</template>
</el-table-column>
<el-table-column
label="商品名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productName }}
</template>
</el-table-column>
<el-table-column
label="商品数量"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.count }}
</template>
</el-table-column>
<el-table-column
label="折扣"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.discount }}
</template>
</el-table-column>
<el-table-column
label="金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.amount }}
</template>
</el-table-column>
<el-table-column
label="实际金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.realAmount }}
</template>
</el-table-column>
<el-table-column
label="卡项ID"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardId }}
</template>
</el-table-column>
<el-table-column
label="卡名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.cardName }}
</template>
</el-table-column>
<el-table-column
label="赠送金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.giveAmount }}
</template>
</el-table-column>
<el-table-column
label="门店id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopId }}
</template>
</el-table-column>
<el-table-column
label="门店名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="创建人id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createId }}
</template>
</el-table-column>
<el-table-column
label="修改时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateTime }}
</template>
</el-table-column>
<el-table-column
label="修改人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateName }}
</template>
</el-table-column>
<el-table-column
label="修改人id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateId }}
</template>
</el-table-column>
<el-table-column
label="0正常 1取消"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.sellStatus }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getSellDetailPage,deleteSellDetail} from "@/api/business/sellDetail/sellDetail";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/sellDetail/addSellDetail";
import editForm from "@/views/business/sellDetail/editSellDetail";
export default {
name: 'sellDetail',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getSellDetailPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteSellDetail(scope.row.sellDetailId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,91 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="" prop="jsonId" class="is-required">
<el-input v-model="temp.jsonId" placeholder="" />
</el-form-item>
<el-form-item label="订单id" prop="sellId" class="is-required">
<el-input v-model="temp.sellId" placeholder="订单id" />
</el-form-item>
<el-form-item label="获得下订单时的JSON" prop="sellJson" class="is-required">
<el-input v-model="temp.sellJson" placeholder="获得下订单时的JSON" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addSelljson} from "@/api/business/sellJson/sellJson";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "addForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
jsonId:'',
sellId:'',
sellJson:'',
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addSelljson(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,92 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="" prop="jsonId" class="is-required">
<el-input v-model="temp.jsonId" placeholder="" />
</el-form-item>
<el-form-item label="订单id" prop="sellId" class="is-required">
<el-input v-model="temp.sellId" placeholder="订单id" />
</el-form-item>
<el-form-item label="获得下订单时的JSON" prop="sellJson" class="is-required">
<el-input v-model="temp.sellJson" placeholder="获得下订单时的JSON" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editSelljson } from "@/api/business/sellJson/sellJson";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
jsonId:'',
sellId:'',
sellJson:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editSelljson(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,213 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label=""
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.jsonId }}
</template>
</el-table-column>
<el-table-column
label="订单id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.sellId }}
</template>
</el-table-column>
<el-table-column
label="获得下订单时的JSON"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.sellJson }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getSelljsonPage,deleteSelljson} from "@/api/business/sellJson/sellJson";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/sellJson/addSelljson";
import editForm from "@/views/business/sellJson/editSelljson";
export default {
name: 'sellJson',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getSelljsonPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteSelljson(scope.row.sellJsonId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,101 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="支付id" prop="sellPayId" class="is-required">
<el-input v-model="temp.sellPayId" placeholder="支付id" />
</el-form-item>
<el-form-item label="销售单id" prop="sellId" class="is-required">
<el-input v-model="temp.sellId" placeholder="销售单id" />
</el-form-item>
<el-form-item label="支付方式名称" prop="payName" class="is-required">
<el-input v-model="temp.payName" placeholder="支付方式名称" />
</el-form-item>
<el-form-item label="1.卡金 2.扫码 3.现金 888.优惠 " prop="payType" class="is-required">
<el-input v-model="temp.payType" placeholder="1.卡金 2.扫码 3.现金 888.优惠 " />
</el-form-item>
<el-form-item label="金额" prop="amount" class="is-required">
<el-input v-model="temp.amount" placeholder="金额" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addSellpay} from "@/api/business/sellPay/sellPay";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "addForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
sellPayId:'',
sellId:'',
payName:'',
payType:'',
amount:'',
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addSellpay(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,102 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="支付id" prop="sellPayId" class="is-required">
<el-input v-model="temp.sellPayId" placeholder="支付id" />
</el-form-item>
<el-form-item label="销售单id" prop="sellId" class="is-required">
<el-input v-model="temp.sellId" placeholder="销售单id" />
</el-form-item>
<el-form-item label="支付方式名称" prop="payName" class="is-required">
<el-input v-model="temp.payName" placeholder="支付方式名称" />
</el-form-item>
<el-form-item label="1.卡金 2.扫码 3.现金 888.优惠 " prop="payType" class="is-required">
<el-input v-model="temp.payType" placeholder="1.卡金 2.扫码 3.现金 888.优惠 " />
</el-form-item>
<el-form-item label="金额" prop="amount" class="is-required">
<el-input v-model="temp.amount" placeholder="金额" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editSellpay } from "@/api/business/sellPay/sellPay";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
sellPayId:'',
sellId:'',
payName:'',
payType:'',
amount:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editSellpay(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,233 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="支付id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.sellPayId }}
</template>
</el-table-column>
<el-table-column
label="销售单id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.sellId }}
</template>
</el-table-column>
<el-table-column
label="支付方式名称"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.payName }}
</template>
</el-table-column>
<el-table-column
label="1.卡金 2.扫码 3.现金 888.优惠 "
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.payType }}
</template>
</el-table-column>
<el-table-column
label="金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.amount }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getSellpayPage,deleteSellpay} from "@/api/business/sellPay/sellPay";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/sellPay/addSellpay";
import editForm from "@/views/business/sellPay/editSellpay";
export default {
name: 'sellPay',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getSellpayPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteSellpay(scope.row.sellPayId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,115 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="工号" prop="serverNo" class="is-required">
<el-input v-model="temp.serverNo" placeholder="工号" />
</el-form-item>
<el-form-item label="服务人员名称" prop="serverName" class="is-required">
<el-input v-model="temp.serverName" placeholder="服务人员名称" />
</el-form-item>
<el-form-item label="服务人员手机号" prop="serverPhone" class="is-required">
<el-input v-model="temp.serverPhone" placeholder="服务人员手机号" />
</el-form-item>
<el-form-item label="入职时间" prop="joinTime" class="is-required">
<el-date-picker
v-model="temp.joinTime"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
</el-form-item>
<el-form-item label="小程序密码" prop="miniappPassword" class="is-required">
<el-input v-model="temp.miniappPassword" placeholder="小程序密码-" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addServer} from "@/api/business/server/server";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "addForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
serverId:'',
serverNo:'',
serverName:'',
serverPhone:'',
joinTime:'',
miniappPassword:'',
deleted:'',
shopId:'',
shopName:'',
createName:'',
createTime:'',
createId:'',
updateTime:'',
updateName:'',
updateId:'',
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addServer(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,117 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="工号" prop="serverNo" class="is-required">
<el-input v-model="temp.serverNo" placeholder="工号" />
</el-form-item>
<el-form-item label="服务人员名称" prop="serverName" class="is-required">
<el-input v-model="temp.serverName" placeholder="服务人员名称" />
</el-form-item>
<el-form-item label="服务人员手机号" prop="serverPhone" class="is-required">
<el-input v-model="temp.serverPhone" placeholder="服务人员手机号" />
</el-form-item>
<el-form-item label="入职时间" prop="joinTime" class="is-required">
<el-input v-model="temp.joinTime" placeholder="入职时间" />
</el-form-item>
<el-form-item label="小程序密码-" prop="miniappPassword" class="is-required">
<el-input v-model="temp.miniappPassword" placeholder="小程序密码-" />
</el-form-item>
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editServer } from "@/api/business/server/server";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
serverId:'',
serverNo:'',
serverName:'',
serverPhone:'',
joinTime:'',
miniappPassword:'',
deleted:'',
shopId:'',
shopName:'',
createName:'',
createTime:'',
createId:'',
updateTime:'',
updateName:'',
updateId:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editServer(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,254 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="工号"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.serverNo }}
</template>
</el-table-column>
<el-table-column
label="服务人员名称"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.serverName }}
</template>
</el-table-column>
<el-table-column
label="服务人员手机号"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.serverPhone }}
</template>
</el-table-column>
<el-table-column
label="入职时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.joinTime }}
</template>
</el-table-column>
<el-table-column
label="门店名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getServerPage,deleteServer} from "@/api/business/server/server";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/server/addServer";
import editForm from "@/views/business/server/editServer";
export default {
name: 'serverList',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getServerPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteServer(scope.row.serverId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,228 @@
<template>
<div>
<el-dialog :close-on-click-modal="false"
top="8vh"
width="30%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-alert
title="基本信息"
type="info"
:closable="false">
</el-alert>
<div style="padding-top: 10px;">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="入库门店" style="wdith:100%;" prop="deptName" class="is-required">
{{temp.deptName}}
</el-form-item>
<el-form-item label="入库方式" prop="stockInType" class="is-required">
<el-select style="wdith:100%;" v-model="temp.stockInType" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark" >
<el-input type="textarea" v-model="temp.remark" placeholder="备注" />
</el-form-item>
</el-form>
</div>
<el-alert
title="入库商品"
type="info"
:closable="false">
</el-alert>
<div style="width: 100%;padding-top: 10px">
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
label="操作"
width="120">
<template slot-scope="scope">
<i class="el-icon-circle-plus-outline el-icon-size" @click="chooseProduct(scope.$index)" ></i>
<i class="el-icon-delete el-icon-size" @click="deleteCon(scope.$index)" ></i>
</template>
</el-table-column>
<el-table-column
prop="productName"
label="商品名"
width="180">
</el-table-column>
<el-table-column
prop="count"
label="数量">
<template slot-scope="scope">
<el-input
:key="scope.row.id"
class="product-count"
v-model="scope.row.count"
@keyup.native="app.clearNoNum"
placeholder="请输入数量"></el-input>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
<choose-product ref="chooseProductRef" @ok="getCheckedProducts"/>
</div>
</template>
<script>
import {addStock} from "@/api/business/stock/stock";
import {setRequiredFields,isEmpty,accAdd,error,clearNoNum,getLoginUser} from "@/utils";
import ChooseProduct from "@/views/business/stock/chooseProduct";
const requiredFields = ['inStockType']
export default {
name: "addForm",
components: {ChooseProduct},
data() {
return {
rules: setRequiredFields(requiredFields),
options: [{
value: 1,
label: '采购入库'
}, {
value: 2,
label: '其他入库'
}],
dialogVisible: false,
temp: {
remark:'',
deptName:'',
StockType: 1,
},
tableData: [{
productNo:'',
productId:'',
productName:'',
count:0,
categoryName:'',
amount:'',
}],
}
},
methods: {
deleteCon(index){
if(this.tableData.length==1){
this.tableData = this.$options.data().tableData
}else{
this.tableData.splice(index,1)
}
},
open() {
this.dialogVisible = true
const loginUser = getLoginUser()
this.temp.deptName = loginUser.deptName
},
getCheckedProducts(list){
console.log('getCheckedProducts' + list)
if(this.tableData.length==1&&isEmpty(this.tableData[0].name)){
let obj = list[0];
this.tableData[0] = {
productId:obj.productId,
productName:obj.productName,
categoryName:obj.categoryName,
amount:obj.amount,
count:0,
}
list.splice(0,1);
}
test:for(let i=list.length-1;i>=0;i--){
let obj = list[i];
for(let item of this.tableData){
if(item.productId==obj.productId){
item.count = accAdd(item.count,1);
list.splice(i,1); //执行后aa.length会减一
break;
}
}
}
let tableData = list.map(obj=>{
return {
productNo:obj.productNo,
productId:obj.productId,
productName:obj.productName,
categoryName:obj.categoryName,
amount:obj.amount,
count:0,
}
})
this.tableData = this.tableData.concat(tableData);
},
chooseProduct(){
this.$refs.chooseProductRef.open()
},
submit() {
if(this.tableData.length==0|isEmpty(this.tableData[0].productId)){
error('请完善商品信息!');
return false;
}
for(let item of this.tableData){
if(item.count==0){
error('请输入正确的数量!');
return false;
}
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.temp.productList = this.tableData
addStock(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.tableData = this.$options.data().tableData
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
},
onInput(){
this.$forceUpdate();
}
},
}
</script>
<style scoped>
.el-icon-size{
font-size: 24px;
margin-left: 12px;
cursor: pointer;
}
.product-count /deep/ input{
color: red;
}
</style>

View File

@@ -0,0 +1,228 @@
<template>
<div>
<el-dialog :close-on-click-modal="false"
top="8vh"
width="30%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-alert
title="基本信息"
type="info"
:closable="false">
</el-alert>
<div style="padding-top: 10px;">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="出库门店" style="wdith:100%;" prop="deptName" class="is-required">
{{temp.deptName}}
</el-form-item>
<el-form-item label="出库方式" prop="stockInType" class="is-required">
<el-select style="wdith:100%;" v-model="temp.stockInType" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark" >
<el-input type="textarea" v-model="temp.remark" placeholder="备注" />
</el-form-item>
</el-form>
</div>
<el-alert
title="出库商品"
type="info"
:closable="false">
</el-alert>
<div style="width: 100%;padding-top: 10px">
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
label="操作"
width="120">
<template slot-scope="scope">
<i class="el-icon-circle-plus-outline el-icon-size" @click="chooseProduct(scope.$index)" ></i>
<i class="el-icon-delete el-icon-size" @click="deleteCon(scope.$index)" ></i>
</template>
</el-table-column>
<el-table-column
prop="productName"
label="商品名"
width="180">
</el-table-column>
<el-table-column
prop="count"
label="数量">
<template slot-scope="scope">
<el-input
:key="scope.row.id"
class="product-count"
v-model="scope.row.count"
@keyup.native="app.clearNoNum"
placeholder="请输入数量"></el-input>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
<choose-product ref="chooseProductRef" @ok="getCheckedProducts"/>
</div>
</template>
<script>
import {addStock} from "@/api/business/stock/stock";
import {setRequiredFields,isEmpty,accAdd,error,clearNoNum,getLoginUser} from "@/utils";
import ChooseProduct from "@/views/business/stock/chooseProduct";
const requiredFields = ['inStockType']
export default {
name: "addForm",
components: {ChooseProduct},
data() {
return {
rules: setRequiredFields(requiredFields),
options: [{
value: 1,
label: '损耗出库'
}, {
value: 2,
label: '其他出库'
}],
dialogVisible: false,
temp: {
remark:'',
deptName:'',
StockType: 1,
},
tableData: [{
productNo:'',
productId:'',
productName:'',
count:0,
categoryName:'',
amount:'',
}],
}
},
methods: {
deleteCon(index){
if(this.tableData.length==1){
this.tableData = this.$options.data().tableData
}else{
this.tableData.splice(index,1)
}
},
open() {
this.dialogVisible = true
const loginUser = getLoginUser()
this.temp.deptName = loginUser.deptName
},
getCheckedProducts(list){
console.log('getCheckedProducts' + list)
if(this.tableData.length==1&&isEmpty(this.tableData[0].name)){
let obj = list[0];
this.tableData[0] = {
productId:obj.productId,
productName:obj.productName,
categoryName:obj.categoryName,
amount:obj.amount,
count:0,
}
list.splice(0,1);
}
test:for(let i=list.length-1;i>=0;i--){
let obj = list[i];
for(let item of this.tableData){
if(item.productId==obj.productId){
item.count = accAdd(item.count,1);
list.splice(i,1); //执行后aa.length会减一
break;
}
}
}
let tableData = list.map(obj=>{
return {
productNo:obj.productNo,
productId:obj.productId,
productName:obj.productName,
categoryName:obj.categoryName,
amount:obj.amount,
count:0,
}
})
this.tableData = this.tableData.concat(tableData);
},
chooseProduct(){
this.$refs.chooseProductRef.open()
},
submit() {
if(this.tableData.length==0|isEmpty(this.tableData[0].productId)){
error('请完善商品信息!');
return false;
}
for(let item of this.tableData){
if(item.count==0){
error('请输入正确的数量!');
return false;
}
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.temp.productList = this.tableData
addStockOut(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.tableData = this.$options.data().tableData
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
},
onInput(){
this.$forceUpdate();
}
},
}
</script>
<style scoped>
.el-icon-size{
font-size: 24px;
margin-left: 12px;
cursor: pointer;
}
.product-count /deep/ input{
color: red;
}
</style>

View File

@@ -0,0 +1,53 @@
<template>
<div>
<el-dialog
append-to-body
top="2vh"
width="80%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div" style="height:80vh">
<product-list @ok="getCheckedProducts"/>
</div>
</el-dialog>
</div>
</template>
<script>
import Product from "@/views/business/product/productList";
import ProductList from "@/views/business/stock/productList";
export default {
name: "chooseProduct",
components: {ProductList, Product},
props: {
sellList: Array,
},
data() {
return {
dialogVisible: false,
temp:{}
}
},
methods: {
open() {
this.dialogVisible = true
},
getCheckedProducts(productList){
console.log(productList)
this.$emit('ok', productList)
this.handleCancel()
},
handleCancel(){
this.dialogVisible = false
},
submit(){
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,182 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="库存单id" prop="stockId" class="is-required">
<el-input v-model="temp.stockId" placeholder="库存单id" />
</el-form-item>
<el-form-item label="库存单表头" prop="stockTitle" class="is-required">
<el-input v-model="temp.stockTitle" placeholder="库存单表头" />
</el-form-item>
<el-form-item label="库存单编号" prop="stockNo" class="is-required">
<el-input v-model="temp.stockNo" placeholder="库存单编号" />
</el-form-item>
<el-form-item label="0正常 1审核完毕 2取消" prop="stockStatus" class="is-required">
<el-input v-model="temp.stockStatus" placeholder="0正常 1审核完毕 2取消" />
</el-form-item>
<el-form-item label="门店id" prop="shopId" class="is-required">
<el-input v-model="temp.shopId" placeholder="门店id" />
</el-form-item>
<el-form-item label="门店名" prop="shopName" class="is-required">
<el-input v-model="temp.shopName" placeholder="门店名" />
</el-form-item>
<el-form-item label="创建人" prop="createName" class="is-required">
<el-input v-model="temp.createName" placeholder="创建人" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
<el-form-item label="创建人id" prop="createId" class="is-required">
<el-input v-model="temp.createId" placeholder="创建人id" />
</el-form-item>
<el-form-item label="修改时间" prop="updateTime" class="is-required">
<el-input v-model="temp.updateTime" placeholder="修改时间" />
</el-form-item>
<el-form-item label="修改人" prop="updateName" class="is-required">
<el-input v-model="temp.updateName" placeholder="修改人" />
</el-form-item>
<el-form-item label="修改人id" prop="updateId" class="is-required">
<el-input v-model="temp.updateId" placeholder="修改人id" />
</el-form-item>
<el-form-item label="审核人ID" prop="checkId" class="is-required">
<el-input v-model="temp.checkId" placeholder="审核人ID" />
</el-form-item>
<el-form-item label="审核人姓名" prop="checkName" class="is-required">
<el-input v-model="temp.checkName" placeholder="审核人姓名" />
</el-form-item>
<el-form-item label="审核时间" prop="checkTime" class="is-required">
<el-input v-model="temp.checkTime" placeholder="审核时间" />
</el-form-item>
<el-form-item label="类型 1入库 2出库" prop="stockType" class="is-required">
<el-input v-model="temp.stockType" placeholder="类型 1入库 2出库" />
</el-form-item>
<el-form-item label="金额" prop="stockMoney" class="is-required">
<el-input v-model="temp.stockMoney" placeholder="金额" />
</el-form-item>
<el-form-item label="入库类型" prop="stockInType" class="is-required">
<el-input v-model="temp.stockInType" placeholder="入库类型" />
</el-form-item>
<el-form-item label="出库类型" prop="stockOutType" class="is-required">
<el-input v-model="temp.stockOutType" placeholder="出库类型" />
</el-form-item>
<el-form-item label="乐观锁字段" prop="version" class="is-required">
<el-input v-model="temp.version" placeholder="乐观锁字段" />
</el-form-item>
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editStock } from "@/api/business/stock/stock";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
stockId:'',
stockTitle:'',
stockNo:'',
stockStatus:'',
shopId:'',
shopName:'',
createName:'',
createTime:'',
createId:'',
updateTime:'',
updateName:'',
updateId:'',
checkId:'',
checkName:'',
checkTime:'',
stockType:'',
stockMoney:'',
stockInType:'',
stockOutType:'',
version:'',
deleted:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editStock(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,426 @@
<template>
<div class="app-container">
<div class="filter-container" style="margin-bottom: 10px;">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-row :gutter="24" class="row-container">
<el-col :span="4" style="height: 100%;">
<el-tree
default-expand-all
:data="categoryList"
node-key="categoryId"
:props="defaultProps"
@node-click="handleNodeClick"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span :class="listQuery.categoryId==data.categoryId?'info-text':''" > {{ node.label }}</span>
</span>
</el-tree>
</el-col>
<el-col :span="20" style="height: 100%;">
<el-table
ref="productTable"
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="80%"
class="table-container"
highlight-current-row
@row-click="handleRowClick"
@selection-change="getSelection"
>
<el-table-column
align="center"
type="selection"
width="55">
</el-table-column>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="分类名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.categoryName }}
</template>
</el-table-column>
<el-table-column
label="商品名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productName }}
</template>
</el-table-column>
<el-table-column
label="商品金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productAmount }}
</template>
</el-table-column>
<el-table-column
label="商品会员金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productMemberAmount }}
</template>
</el-table-column>
<el-table-column
label="商品图片"
width="160"
align="center"
>
<template slot-scope="scope">
<img v-if="scope.row.productImage" :src=" baseUrl + scope.row.productImageUrl" class="avatar" style="width: 40px;height: 40px;">
</template>
</el-table-column>
<el-table-column
label="库存数量"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productCount }}
</template>
</el-table-column>
<el-table-column
label="提成金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.pushAmount }}
</template>
</el-table-column>
<el-table-column
label="提成比例"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.pushPercent }}
</template>
</el-table-column>
<el-table-column
label="0正常 1下架"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productStatus }}
</template>
</el-table-column>
<el-table-column
label="门店名"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="修改人"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateName }}
</template>
</el-table-column>
<el-table-column
label="修改时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.updateTime }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
v-hasPerms="'product:del'"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<div class="div-border" style="height: 29%;margin-top:15px;">
<el-alert
type="warning"
:closable="false">
<template slot="title">
已选择的条目{{productList.length}}
<el-button style="margin-left: 15px;"
@click="chooseDone"
icon="el-icon-check"
type="danger">选好了</el-button>
</template>
</el-alert>
<div class="tag-view">
<el-tag
v-for="(tag,index) in productList"
:key="tag.productId"
closable
effect="dark"
@close="handleClose(tag,index)"
>
{{tag.productName}}
</el-tag>
</div>
</div>
</el-col>
</el-row>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getCategoryList} from "@/api/business/category/category";
import {getProductPage,deleteProduct} from "@/api/business/product/product";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/product/addProduct";
import editForm from "@/views/business/product/editProduct";
export default {
name: 'productList',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
categoryId: '',
keyword: '',
stockControl:1
},
defaultProps: {
id: 'categoryId',
label: 'categoryName',
},
temp: {},
categoryList: [],
productList: []
}
},
created() {
this.fetchData()
this.getCategoryList()
},
methods: {
handleClose(tag,index){
this.productList.splice(index,1);
//取消选中状态
this.$refs.productTable.toggleRowSelection(tag, false);
},
getCategoryList(){
getCategoryList().then(res => {
this.categoryList = res.data
})
},
chooseDone(){
if(this.productList.length==0){
error('还没有选择商品')
return false
}
this.$emit('ok', this.productList)
const table = this.$refs.productTable;
const rows = table.store.states.data; // 获取表格所有行的数据(不同组件获取方式可能不同)
rows.forEach(row => {
table.toggleRowSelection(row, false); // 调用toggleRowSelection方法第二个参数传false表示取消选中
});
},
handleRowClick(row) {
let obj = row
this.$refs.productTable.toggleRowSelection(row)
},
getSelection(e){
this.productList = e
},
handleNodeClick(e){
this.listQuery.categoryId = e.categoryId
this.fetchData()
},
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getProductPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open(this.listQuery.categoryId)
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteProduct(scope.row.productId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
.tag-view /deep/ .el-tag {
margin: 10px;
}
</style>

View File

@@ -0,0 +1,281 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
@row-click="handleRowClick"
row-key="stockId"
ref="stockTableRef"
:expand-row-keys="expandedKeys"
>
<el-table-column type="expand">
<template slot-scope="scope">
<el-table :data="scope.row.stockDetailVos" border>
<el-table-column
label="商品名称"
prop="detailField1"
align="center"
>
<template slot-scope="detailScope">
{{ detailScope.row.productName }}
</template>
</el-table-column>
<el-table-column
label="入库数量"
prop="detailField2"
align="center"
>
<template slot-scope="detailScope">
{{ detailScope.row.count }}
</template>
</el-table-column>
<!-- 可以根据实际的 stockDetailVos 中的属性继续添加更多列 -->
</el-table>
</template>
</el-table-column>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="库存单编号"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.stockNo }}
</template>
</el-table-column>
<el-table-column
label="库存单标题"
width="300"
align="center"
>
<template slot-scope="scope">
{{ scope.row.stockTitle }}
</template>
</el-table-column>
<el-table-column
label="门店"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="入库类型"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.stockInType==1">采购入库</span>
<span v-if="scope.row.stockInType==2">其他入库</span>
<span v-if="scope.row.stockInType==3">销单返回入库</span>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- fixed="right"-->
<!-- label="操作"-->
<!-- width="200"-->
<!-- align="center"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-group>-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- @click="edit(scope)"-->
<!-- >-->
<!-- 修改-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- @click="del(scope)"-->
<!-- >-->
<!-- 删除-->
<!-- </el-button>-->
<!-- </el-button-group>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getStockPage,deleteStock} from "@/api/business/stock/stock";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/stock/addStock";
import editForm from "@/views/business/stock/editStock";
export default {
name: 'stock',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: '',
stockType: 1
},
temp: {},
expandedKeys: []
}
},
created() {
this.fetchData()
},
methods: {
handleRowClick(row, event, column) {
if (this.expandedKeys.length > 0 && this.expandedKeys[0] === row.stockId) {
this.expandedKeys = [];
} else {
this.expandedKeys = [row.stockId];
}
this.$refs.stockTableRef.toggleRowExpansion(row);
},
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getStockPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteStock(scope.row.stockId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,281 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
@row-click="handleRowClick"
row-key="stockId"
ref="stockTableRef"
:expand-row-keys="expandedKeys"
>
<el-table-column type="expand">
<template slot-scope="scope">
<el-table :data="scope.row.stockDetailVos" border>
<el-table-column
label="商品名称"
prop="detailField1"
align="center"
>
<template slot-scope="detailScope">
{{ detailScope.row.productName }}
</template>
</el-table-column>
<el-table-column
label="出库数量"
prop="detailField2"
align="center"
>
<template slot-scope="detailScope">
{{ detailScope.row.count }}
</template>
</el-table-column>
<!-- 可以根据实际的 stockDetailVos 中的属性继续添加更多列 -->
</el-table>
</template>
</el-table-column>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="库存单编号"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.stockNo }}
</template>
</el-table-column>
<el-table-column
label="库存单标题"
width="300"
align="center"
>
<template slot-scope="scope">
{{ scope.row.stockTitle }}
</template>
</el-table-column>
<el-table-column
label="门店"
align="center"
>
<template slot-scope="scope">
{{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column
label="创建人"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
label="出库类型"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.stockOutType==1">损耗出库</span>
<span v-if="scope.row.stockOutType==2">其他出库</span>
<span v-if="scope.row.stockOutType==3">使用出库</span>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- fixed="right"-->
<!-- label="操作"-->
<!-- width="200"-->
<!-- align="center"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-group>-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- @click="edit(scope)"-->
<!-- >-->
<!-- 修改-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- @click="del(scope)"-->
<!-- >-->
<!-- 删除-->
<!-- </el-button>-->
<!-- </el-button-group>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getStockPage,deleteStock} from "@/api/business/stock/stock";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/stock/addStockOut";
import editForm from "@/views/business/stock/editStock";
export default {
name: 'stock',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: '',
stockType: 2
},
temp: {},
expandedKeys: []
}
},
created() {
this.fetchData()
},
methods: {
handleRowClick(row, event, column) {
if (this.expandedKeys.length > 0 && this.expandedKeys[0] === row.stockId) {
this.expandedKeys = [];
} else {
this.expandedKeys = [row.stockId];
}
this.$refs.stockTableRef.toggleRowExpansion(row);
},
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getStockPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteStock(scope.row.stockId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,121 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="库存详情id" prop="stockDetailId" class="is-required">
<el-input v-model="temp.stockDetailId" placeholder="库存详情id" />
</el-form-item>
<el-form-item label="库存单id" prop="stockId" class="is-required">
<el-input v-model="temp.stockId" placeholder="库存单id" />
</el-form-item>
<el-form-item label="商品" prop="productId" class="is-required">
<el-input v-model="temp.productId" placeholder="商品" />
</el-form-item>
<el-form-item label="商品名 " prop="productName" class="is-required">
<el-input v-model="temp.productName" placeholder="商品名 " />
</el-form-item>
<el-form-item label="库存数量" prop="count" class="is-required">
<el-input v-model="temp.count" placeholder="库存数量" />
</el-form-item>
<el-form-item label="0正常 1审核完毕 2取消" prop="stockStatus" class="is-required">
<el-input v-model="temp.stockStatus" placeholder="0正常 1审核完毕 2取消" />
</el-form-item>
<el-form-item label="类型 1入库 2出库" prop="stockType" class="is-required">
<el-input v-model="temp.stockType" placeholder="类型 1入库 2出库" />
</el-form-item>
<el-form-item label="金额" prop="amount" class="is-required">
<el-input v-model="temp.amount" placeholder="金额" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {addStockDetail} from "@/api/business/stockDetail/stockDetail";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "addForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
stockDetailId:'',
stockId:'',
productId:'',
productName:'',
count:'',
stockStatus:'',
stockType:'',
amount:'',
createTime:'',
},
}
},
methods: {
open() {
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
addStockDetail(this.temp).then(response =>{
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields();
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,122 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
top="8vh"
width="40%"
:visible.sync="dialogVisible"
center
@close="handleCancel"
>
<div class="el-dialog-div">
<el-form
:rules="rules"
ref="dataForm"
:model="temp"
label-position="right"
label-width="120px"
style="height: 90%;"
>
<el-form-item label="库存详情id" prop="stockDetailId" class="is-required">
<el-input v-model="temp.stockDetailId" placeholder="库存详情id" />
</el-form-item>
<el-form-item label="库存单id" prop="stockId" class="is-required">
<el-input v-model="temp.stockId" placeholder="库存单id" />
</el-form-item>
<el-form-item label="商品" prop="productId" class="is-required">
<el-input v-model="temp.productId" placeholder="商品" />
</el-form-item>
<el-form-item label="商品名 " prop="productName" class="is-required">
<el-input v-model="temp.productName" placeholder="商品名 " />
</el-form-item>
<el-form-item label="库存数量" prop="count" class="is-required">
<el-input v-model="temp.count" placeholder="库存数量" />
</el-form-item>
<el-form-item label="0正常 1审核完毕 2取消" prop="stockStatus" class="is-required">
<el-input v-model="temp.stockStatus" placeholder="0正常 1审核完毕 2取消" />
</el-form-item>
<el-form-item label="类型 1入库 2出库" prop="stockType" class="is-required">
<el-input v-model="temp.stockType" placeholder="类型 1入库 2出库" />
</el-form-item>
<el-form-item label="金额" prop="amount" class="is-required">
<el-input v-model="temp.amount" placeholder="金额" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime" class="is-required">
<el-input v-model="temp.createTime" placeholder="创建时间" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { editStockDetail } from "@/api/business/stockDetail/stockDetail";
import {setRequiredFields} from "@/utils";
const requiredFields = []
export default {
name: "editForm",
data() {
return {
rules: setRequiredFields(requiredFields),
dialogVisible: false,
temp: {
stockDetailId:'',
stockId:'',
productId:'',
productName:'',
count:'',
stockStatus:'',
stockType:'',
amount:'',
createTime:'',
},
}
},
methods: {
open(row) {
this.temp = this.$options.data().temp
this.temp = row
this.dialogVisible = true
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
editStockDetail(this.temp).then(response => {
this.handleCancel()
this.$emit('ok', response.data)
})
} else {
console.log('error submit!!');
return false;
}
});
},
handleCancel() {
//初始化
this.temp = this.$options.data().temp
this.dialogVisible = false
this.$refs['dataForm'].resetFields()
}
},
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,273 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyword"
size="small"
placeholder="请输入关键词"
clearable
class="filter-item"
style="width: 200px;margin-left: 10px;"
/>
<el-button-group style="margin-left: 10px;">
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-search"
@click="search"
>
搜索
</el-button>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-refresh"
@click="refresh"
>
重置
</el-button>
</el-button-group>
<el-button
size="small"
class="filter-item"
type="primary"
icon="el-icon-plus"
style="margin-left: 10px;"
@click="add"
>
新增
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
height="100%"
class="table-container"
highlight-current-row
>
<el-table-column
label="序号"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
<el-table-column
label="库存详情id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.stockDetailId }}
</template>
</el-table-column>
<el-table-column
label="库存单id"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.stockId }}
</template>
</el-table-column>
<el-table-column
label="商品"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productId }}
</template>
</el-table-column>
<el-table-column
label="商品名 "
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.productName }}
</template>
</el-table-column>
<el-table-column
label="库存数量"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.count }}
</template>
</el-table-column>
<el-table-column
label="0正常 1审核完毕 2取消"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.stockStatus }}
</template>
</el-table-column>
<el-table-column
label="类型 1入库 2出库"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.stockType }}
</template>
</el-table-column>
<el-table-column
label="金额"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.amount }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="160"
align="center"
>
<template slot-scope="scope">
{{ scope.row.createTime }}
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="200"
align="center"
>
<template slot-scope="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-edit"
size="mini"
@click="edit(scope)"
>
修改
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="del(scope)"
>
删除
</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="fetchData"
/>
<add-form ref="addForm" @ok="addOk" />
<edit-form ref="editForm" @ok="editOk" />
</div>
</template>
<script>
import {getStockDetailPage,deleteStockDetail} from "@/api/business/stockDetail/stockDetail";
import {deepClone,success} from "@/utils";
import confirm from "@/utils/confirm";
import Pagination from '@/components/Pagination'
import addForm from "@/views/business/stockDetail/addStockDetail";
import editForm from "@/views/business/stockDetail/editStockDetail";
export default {
name: 'stockDetail',
components: {addForm,editForm,Pagination},
data() {
return {
total: 0,
list: [],
listLoading: true,
listQuery: {
page: 1,
limit: 50,
keyword: ''
},
temp: {},
}
},
created() {
this.fetchData()
},
methods: {
search() {
this.fetchData()
},
refresh() {
this.listQuery = this.$options.data().listQuery
this.fetchData()
},
fetchData() {
this.listLoading = true
getStockDetailPage(this.listQuery).then(response => {
const { records, total } = response.data
this.list = records
this.total = total
this.listLoading = false
})
},
add(){
this.$refs.addForm.open()
},
addOk(){
this.fetchData()
},
edit(scope) {
const temp = deepClone(scope.row)
this.$refs.editForm.open(temp)
},
editOk(){
this.fetchData()
},
del(scope) {
confirm("确定要删除吗?").then(res=>{
if(res){
deleteStockDetail(scope.row.stockDetailId).then(response => {
console.log(response)
success('删除成功')
this.fetchData()
})
}
})
},
}
}
</script>
<style scoped>
</style>