| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-collection-code',__DIR__ . '/');
- ComponentHelper::loadComponentView('com-export-dialog-syn');
- //ComponentHelper::loadComponentView('com-export-dialog');
- ?>
- <div id="app" v-cloak>
- <el-card v-loading="loading" style="border:0" shadow="never" body-style="background-color: #f3f3f3;padding: 0 0;">
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="店铺收款码" name="collection-code">
- <?php ComponentHelper::loadComponentView('collection-code', __DIR__ . '/'); ?>
- </el-tab-pane>
- <el-tab-pane label="收款明细" name="collection-log">
- <?php ComponentHelper::loadComponentView('collection-log', __DIR__ . '/'); ?>
- </el-tab-pane>
- </el-tabs>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- activeName: 'collection-code',
- basicForm:{
- store_id:0,
- scan_code_bind:0,
- cashier_url:'',
- score_give_setting:{
- type:0,
- coupon_id:'',
- score_give:{
- give_type:1,
- give_num:0,
- },
- },
- preferential_deduction:0,
- preferential_gift:0,
- score_deduct_setting:{
- type:0,
- coupon_id:'',
- score_deduct:{
- deduct_type:1,
- deduct_num:0,
- },
- },
- },
- exportList:{},
- export_url: '/index.php?r=store/client/cash/cashier-log',
- basicFormRules:{},
- loading:false,
- listLoading:false,
- submitLoading:false,
- dialogFormVisible:false,
- store_bank_form:{},
- formLabelWidth: '120px',
- list:[],
- pageCount: 0,
- pagination: null,
- page:1,
- searchData: {
- min: '',
- max: '',
- keyword: '',
- start: '',
- end: '',
- },
- datetime:'',
- dialogTableVisible_fenRun: false,
- activeNames: 'commission',
- fenRunData: [],
- coupon_list: [],
- user_level: {},
- preferential_deduction: 0,
- preferential_gift: 0,
- dialogVisible: false,
- applet_url:'',
- is_preferential_gift:0,
- };
- },
- mounted: function() {
- this.loadData();
- this.getCouponList();
- },
- methods: {
- loadData() {
- let self = this;
- request({
- params: {
- r: 'store/client/cash/index',
- },
- }).then(e => {
- self.loading = false;
- if (e.data.code === 0) {
- self.basicForm.store_id = e.data.data.store_id;
- self.basicForm.scan_code_bind = e.data.data.scan_code_bind;
- self.basicForm.preferential_deduction = e.data.data.preferential_deduction;
- self.basicForm.preferential_gift = e.data.data.preferential_gift;
- self.export_url = e.data.data.export_url;
- self.basicForm.cashier_url = e.data.data.cashier_url;
- self.is_preferential_gift = e.data.data.is_preferential_gift;
- if(e.data.data.score_give_setting) self.basicForm.score_give_setting = e.data.data.score_give_setting;
- if(e.data.data.score_deduct_setting) self.basicForm.score_deduct_setting = e.data.data.score_deduct_setting;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- self.$message.error('网络错误');
- });
- },
- submit(){
- request({
- params: {
- r: 'store/client/cash/index',
- },
- method: 'post',
- data: {
- form: this.basicForm
- }
- }).then(e => {
- this.loading = false;
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.$message.error('网络错误');
- });
- },
- showPromotionCode(id, fun) {
- setTimeout(() => {
- fun();
- }, 300)
- },
- showMiniPromotionCode(type){
- request({
- params: {
- r: 'store/client/cash/show-mini-promotion-code',
- },
- data: {
- type:type
- },
- method: 'post'
- }).then(e => {
- if (e.data.code == 0) {
- this.dialogVisible = true
- this.applet_url = e.data.data.applet_url;
- } else {
- this.$message.error('操作失败');
- }
- }).catch(e => {
- this.$message.error('网络错误');
- });
- },
- handleClick(tab, event){
- if(tab.name=='collection-log'){
- this.getCollectionLog();
- }
- },
- getCollectionLog(){
- request({
- params: {
- r: 'store/client/cash/cashier-log',
- page: this.page,
- withdraw_status: this.searchData.withdraw_status,
- start: this.searchData.start,
- end: this.searchData.end,
- min: this.searchData.min,
- max: this.searchData.max,
- keyword: this.searchData.keyword,
- },
- method: 'get',
- }).then(e => {
- this.loading = false;
- if (e.data.code === 0) {
- this.list = e.data.data.list;
- this.exportList = e.data.data.export_list;
- this.pagination = e.data.data.pagination;
- this.pageCount = e.data.data.page_count;
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.$message.error('网络错误');
- });
- },
- handle(data = null) {
- let id = data ? parseInt(data.id) : '';
- this.dialogTableVisible_fenRun = true;
- this.orderId = id;
- this.getCapitalLog(id, this.activeNames)
- },
- commissionHandleClick(tab, event) {
- console.log(this.activeNames);
- console.log(tab);
- console.log(event);
- this.getCapitalLog(this.orderId, this.activeNames)
- },
- getCapitalLog(orderId, wallet_type) {
- request({
- params: {
- r: 'store/client/cash/commission-and-score-list',
- order_id: orderId,
- wallet_type: wallet_type,
- },
- method: 'get',
- }).then(e => {
- if (e.data.code == 0) {
- this.fenRunData = e.data.data.list;
- this.user_level = e.data.data.user_level;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- },
- getCouponList(type=null) {
- request({
- params: {
- r: 'store/client/cash/get-coupon-list',
- type: type,
- },
- method: 'get',
- }).then(e => {
- if (e.data.code == 0) {
- this.coupon_list = e.data.data.coupon_list;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- },
- handleChange(){},
- deductTypeChange(arg){
- this.basicForm.score_deduct_setting.coupon_id = '';
- this.getCouponList(arg);
- },
- giveTypeChange(arg){
- this.basicForm.score_give_setting.coupon_id = '';
- this.getCouponList(arg);
- },
- handleCurrentChange(val) {
- this.basicForm.select_bank = val;
- },
- pageChange(currentPage) {
- this.page = currentPage;
- this.getCollectionLog();
- },
- search() {
- this.page = 1;
- if (this.date == null) {
- this.date = ''
- }
- this.getCollectionLog();
- },
- changeTime(e) {
- this.searchData.start = e[0]
- this.searchData.end = e[1]
- },
- },
- computed: {
- }
- });
- </script>
- <style>
- .el-tabs__header {
- font-size: 16px;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .input-item {
- width: 250px;
- margin: 0 0 20px;
- display: inline-block;
- }
- /*.input-item .el-input__inner {*/
- /* border-right: 0;*/
- /*}*/
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- /*border-right: 0;*/
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- /*border-right: 0;*/
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .batch {
- margin: 0 0 20px;
- display: inline-block;
- }
- .batch .el-button {
- padding: 9px 15px !important;
- }
- .el-table th>.cell{
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper, .el-table__header-wrapper{
- border-bottom: 1.4px solid #D6D6D6;
- }
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .table1 .el-table__footer-wrapper,
- .table1 .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- /* height: 50px;
- width: 50px; */
- }
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- margin-right: 8px;
- }
- .uer-nickname {
- flex: 1;
- }
- .value_input .el-form-item__content{
- display: flex;
- }
- .value_input .el-input-group input{
- width: 58px;
- border-right: 0;
- }
- .value_input .el-input-group{
- display: flex;
- width: 100px;
- }
- .value_input .el-input-group__append{
- display: flex;
- align-items: center;
- justify-content: center;
- background: #FFF;
- }
- </style>
|