|
@@ -1,52 +1,51 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="app-list-content">
|
|
<div class="app-list-content">
|
|
|
<x-crud class="liu-crud-wrap" @load="onLoad">
|
|
<x-crud class="liu-crud-wrap" @load="onLoad">
|
|
|
- <!-- 余额 -->
|
|
|
|
|
<template #table-column-balance="{scope}">
|
|
<template #table-column-balance="{scope}">
|
|
|
<el-link :underline="true" @click="detailShowFn(scope.row)" style="font-size:12px;display:inline-block;">{{ scope.row.balance }}</el-link>
|
|
<el-link :underline="true" @click="detailShowFn(scope.row)" style="font-size:12px;display:inline-block;">{{ scope.row.balance }}</el-link>
|
|
|
</template>
|
|
</template>
|
|
|
- <!-- 收入 -->
|
|
|
|
|
<template #table-column-totalIncome="{scope}">
|
|
<template #table-column-totalIncome="{scope}">
|
|
|
<el-link :underline="true" @click="AmountShowFn(scope.row,'1')" style="font-size:12px;display:inline-block;">{{ scope.row.totalIncome }}</el-link>
|
|
<el-link :underline="true" @click="AmountShowFn(scope.row,'1')" style="font-size:12px;display:inline-block;">{{ scope.row.totalIncome }}</el-link>
|
|
|
</template>
|
|
</template>
|
|
|
- <!-- 支出 -->
|
|
|
|
|
- <template #table-column-totalExpend="{scope}">
|
|
|
|
|
- <el-link :underline="true" @click="AmountShowFn(scope.row,'0')" style="font-size:12px;display:inline-block;">{{ scope.row.totalExpend }}</el-link>
|
|
|
|
|
- </template>
|
|
|
|
|
- <!-- 收款码 -->
|
|
|
|
|
- <template #table-column-gatheringCode>
|
|
|
|
|
- <el-button type="text">下载</el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- <!-- 充值 -->
|
|
|
|
|
<template #slot-apply="{scope}">
|
|
<template #slot-apply="{scope}">
|
|
|
<el-button type="text" @click="addStaff(scope.row)">添加员工</el-button>
|
|
<el-button type="text" @click="addStaff(scope.row)">添加员工</el-button>
|
|
|
|
|
+ <el-button type="text" @click="clearStock(scope.row)">清库存</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</x-crud>
|
|
</x-crud>
|
|
|
|
|
|
|
|
- <!-- 用户详情 -->
|
|
|
|
|
<balance-detail v-if='showBalanceDetail' @closeFn='showBalanceDetail = false' ref="balanceDetail" :orderOperate="optionData" />
|
|
<balance-detail v-if='showBalanceDetail' @closeFn='showBalanceDetail = false' ref="balanceDetail" :orderOperate="optionData" />
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<amount-detail v-if='showAmountDetail' @closeFn='showAmountDetail = false' ref="amountDetail" :orderOperate="optionData" />
|
|
<amount-detail v-if='showAmountDetail' @closeFn='showAmountDetail = false' ref="amountDetail" :orderOperate="optionData" />
|
|
|
|
|
|
|
|
- <el-dialog :visible.sync="addYgPop" :close-on-click-modal="false" width="500px" >
|
|
|
|
|
- <el-form :model="addStaffForm" :rules="ruleForm" ref="adForm" label-width="80px" class="demo-form" >
|
|
|
|
|
|
|
+ <el-dialog :visible.sync="addStaffPop" :close-on-click-modal="false" width="500px" title="添加员工">
|
|
|
|
|
+ <el-form :model="addStaffForm" :rules="addStaffRule" ref="addStaffRef" label-width="80px" class="demo-form" >
|
|
|
<el-form-item label="手机号" prop="mobile" style="text-align:left;" >
|
|
<el-form-item label="手机号" prop="mobile" style="text-align:left;" >
|
|
|
<el-input placeholder="请输入手机号" size="small" v-model="addStaffForm.mobile" ></el-input>
|
|
<el-input placeholder="请输入手机号" size="small" v-model="addStaffForm.mobile" ></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="昵称" prop="nickName" style="text-align: left;" >
|
|
<el-form-item label="昵称" prop="nickName" style="text-align: left;" >
|
|
|
<el-input placeholder="请输入昵称" size="small" v-model="addStaffForm.nickName"></el-input>
|
|
<el-input placeholder="请输入昵称" size="small" v-model="addStaffForm.nickName"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
-
|
|
|
|
|
<el-form-item label="超管" prop="super">
|
|
<el-form-item label="超管" prop="super">
|
|
|
<el-select v-model="addStaffForm.superName" size="small" placeholder="请选择" @change="changeSuperFn">
|
|
<el-select v-model="addStaffForm.superName" size="small" placeholder="请选择" @change="changeSuperFn">
|
|
|
<el-option v-for="(item, index) in superList" :key="index" :value="item.name" >{{ item.name }}</el-option>
|
|
<el-option v-for="(item, index) in superList" :key="index" :value="item.name" >{{ item.name }}</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button size="small" @click="resetAddStaffForm">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" size="small" @click="putAddStaffForm">确认</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
|
|
|
|
|
+ <el-dialog :visible.sync="clearStockPop" :close-on-click-modal="false" width="500px" title="清空库存">
|
|
|
|
|
+ <el-form :model="clearStockForm" :rules="clearStockRule" ref="clearStockRef" label-width="80px" class="demo-form" >
|
|
|
|
|
+ <el-form-item label="密码" prop="password" style="text-align: left;" >
|
|
|
|
|
+ <el-input placeholder="请输入密码" size="small" v-model="clearStockForm.password" show-password></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button size="small" @click="resetForm">取 消</el-button>
|
|
|
|
|
- <el-button type="primary" size="small" @click="submitForm">确认</el-button>
|
|
|
|
|
|
|
+ <el-button size="small" @click="resetclearStockForm">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" size="small" @click="putClearStockForm">确认</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
@@ -63,8 +62,7 @@ export default {
|
|
|
showBalanceDetail: false,
|
|
showBalanceDetail: false,
|
|
|
showAmountDetail: false,
|
|
showAmountDetail: false,
|
|
|
optionData: {},
|
|
optionData: {},
|
|
|
- addYgPop: false,
|
|
|
|
|
- dialogTitle: '',
|
|
|
|
|
|
|
+ addStaffPop: false,
|
|
|
addStaffForm: {
|
|
addStaffForm: {
|
|
|
mobile: '',
|
|
mobile: '',
|
|
|
nickName: '',
|
|
nickName: '',
|
|
@@ -72,20 +70,54 @@ export default {
|
|
|
superName:'是',
|
|
superName:'是',
|
|
|
shopId:0
|
|
shopId:0
|
|
|
},
|
|
},
|
|
|
- ruleForm: {
|
|
|
|
|
- mobile: [{ required: true, message: '请输入充值金额', trigger: 'blur' }],
|
|
|
|
|
- nickName: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
|
|
|
|
|
|
|
+ addStaffRule: {
|
|
|
|
|
+ mobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
|
|
|
|
+ nickName: [{ required: true, message: '请输入昵称', trigger: 'blur' }],
|
|
|
},
|
|
},
|
|
|
- superList:[{name:'是',id:1},{name:'否',id:0}]
|
|
|
|
|
|
|
+ superList:[{name:'是',id:1},{name:'否',id:0}],
|
|
|
|
|
+ clearStockPop:false,
|
|
|
|
|
+ clearStockForm:{
|
|
|
|
|
+ password:'',
|
|
|
|
|
+ shopId:0
|
|
|
|
|
+ },
|
|
|
|
|
+ clearStockRule:{
|
|
|
|
|
+ password: [{ required: true, message: '请输入密码', trigger: 'blur' }]
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ clearStock(shop){
|
|
|
|
|
+ this.clearStockPop = true
|
|
|
|
|
+ this.clearStockForm.shopId = shop.id
|
|
|
|
|
+ },
|
|
|
|
|
+ resetclearStockForm(){
|
|
|
|
|
+ this.$refs['clearStockRef'].resetFields()
|
|
|
|
|
+ this.clearStockPop = false
|
|
|
|
|
+ },
|
|
|
addStaff(shop) {
|
|
addStaff(shop) {
|
|
|
- this.addYgPop = true
|
|
|
|
|
|
|
+ this.addStaffPop = true
|
|
|
this.addStaffForm.shopId = shop.id
|
|
this.addStaffForm.shopId = shop.id
|
|
|
},
|
|
},
|
|
|
|
|
+ putClearStockForm(){
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ that.$refs['clearStockRef'].validate(valid => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ // that.$service.shop.addStaff(that.addStaffForm).then(res => {
|
|
|
|
|
+ // if(res.id && Number(res.id)>0){
|
|
|
|
|
+ // that.$message.success('操作成功')
|
|
|
|
|
+ // that.addStaffPop = false
|
|
|
|
|
+ // that.$refs['addStaffRef'].resetFields()
|
|
|
|
|
+ // that.app.refresh()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.log('出错了哦');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
changeSuperFn(val){
|
|
changeSuperFn(val){
|
|
|
let index = this.superList.findIndex((e) => e.name == val);
|
|
let index = this.superList.findIndex((e) => e.name == val);
|
|
|
this.addStaffForm.super = this.superList[index].id;
|
|
this.addStaffForm.super = this.superList[index].id;
|
|
@@ -131,12 +163,6 @@ export default {
|
|
|
width: '100',
|
|
width: '100',
|
|
|
align: 'center'
|
|
align: 'center'
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- prop: 'totalExpend',
|
|
|
|
|
- label: '支出',
|
|
|
|
|
- width: '100',
|
|
|
|
|
- align: 'center'
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
prop: 'mobile',
|
|
prop: 'mobile',
|
|
|
label: '手机号',
|
|
label: '手机号',
|
|
@@ -173,9 +199,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
op: {
|
|
op: {
|
|
|
- visible: true, // 是否显示
|
|
|
|
|
|
|
+ visible: true,
|
|
|
props: {
|
|
props: {
|
|
|
- width: 120,
|
|
|
|
|
|
|
+ width: 190,
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
|
label: '操作'
|
|
label: '操作'
|
|
@@ -205,26 +231,27 @@ export default {
|
|
|
.done();
|
|
.done();
|
|
|
app.refresh();
|
|
app.refresh();
|
|
|
},
|
|
},
|
|
|
- resetForm () {
|
|
|
|
|
- this.$refs['adForm'].resetFields();
|
|
|
|
|
- this.addYgPop = false;
|
|
|
|
|
|
|
+ resetAddStaffForm () {
|
|
|
|
|
+ this.$refs['addStaffRef'].resetFields()
|
|
|
|
|
+ this.addStaffPop = false
|
|
|
},
|
|
},
|
|
|
- submitForm () {
|
|
|
|
|
|
|
+ putAddStaffForm () {
|
|
|
let that = this
|
|
let that = this
|
|
|
- that.$refs['adForm'].validate(valid => {
|
|
|
|
|
|
|
+ that.$refs['addStaffRef'].validate(valid => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
that.$service.shop.addStaff(that.addStaffForm).then(res => {
|
|
that.$service.shop.addStaff(that.addStaffForm).then(res => {
|
|
|
if(res.id && Number(res.id)>0){
|
|
if(res.id && Number(res.id)>0){
|
|
|
that.$message.success('操作成功')
|
|
that.$message.success('操作成功')
|
|
|
- that.addYgPop = false
|
|
|
|
|
|
|
+ that.addStaffPop = false
|
|
|
|
|
+ that.$refs['addStaffRef'].resetFields()
|
|
|
that.app.refresh()
|
|
that.app.refresh()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
- console.log('error submit!!');
|
|
|
|
|
|
|
+ console.log('出错了哦');
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
detailShowFn(item){
|
|
detailShowFn(item){
|
|
|
this.optionData = item;
|
|
this.optionData = item;
|
|
@@ -243,4 +270,4 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
-</script>
|
|
|
|
|
|
|
+</script>
|