Browse Source

收款页面展示

dev
nizongfeng 3 years ago
parent
commit
7b4142a610
6 changed files with 12312 additions and 66 deletions
  1. +1
    -1
      application/admin/service/AdminDao.php
  2. +7
    -1
      application/admin/service/ReceiptOrderService.php
  3. +47
    -32
      application/admin/view/payment_order/index.html
  4. +242
    -32
      application/admin/view/receipt_order/index.html
  5. +1
    -0
      public/assets/js/vue/index.js
  6. +12014
    -0
      public/assets/js/vue/vue.js

+ 1
- 1
application/admin/service/AdminDao.php View File

@@ -20,7 +20,7 @@ class AdminDao
* @param int $id
* @return array
*/
public function getInfoById(int $id) {
public function getInfoById($id) {
try{
$model = new Admin();
$info = $model->where(["id"=>$id])->find();


+ 7
- 1
application/admin/service/ReceiptOrderService.php View File

@@ -22,8 +22,14 @@ class ReceiptOrderService
* @return array
*/
public function save($param){
//保存
$dao = new ReceiptOrderDao();
return $dao->save($param);
$addRe = $dao->save($param);
if (!$addRe['flag']) {
return $addRe;
}
return Util::returnArrSu();

}

/**


+ 47
- 32
application/admin/view/payment_order/index.html View File

@@ -1,35 +1,50 @@
<div class="panel panel-default panel-intro">
{:build_heading()}

<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('payment_order/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('payment_order/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('payment_order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('payment_order/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>

<div class="dropdown btn-group {:$auth->check('payment_order/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>

</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('payment_order/edit')}"
data-operate-del="{:$auth->check('payment_order/del')}"
width="100%">
</table>
</div>
</div>

</div>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div id="app">
<div style="margin: 10px;">
<span>名称:</span>
<el-input v-model="search.name" style="width: 150px;" placeholder="请输入内容"></el-input>
<span>状态</span>
<el-select v-model="search.status" placeholder="请选择" clearable>
<el-option
v-for="item in status"
:key="item.id"
:label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-button type="primary"icon="el-icon-search" :disabled="isApi===true" >搜索</el-button>
</div>
</div>
</body>
<!-- import Vue before Element -->
<script src="/assets/js/vue/vue.js"></script>
<!-- import JavaScript -->
<script src="/assets/js/vue/index.js"></script>
<script>
new Vue({
el: '#app',
data: function() {
return {
isApi:false,
search: {
outRequestNo:"",
couponCode:""
},
status:[
{"id":0,'value':"未付款"},
{"id":1,'value':"付款中"},
{"id":2,'value':"已付款"}
]
}
}
})
</script>
</html>

+ 242
- 32
application/admin/view/receipt_order/index.html View File

@@ -1,35 +1,245 @@
<div class="panel panel-default panel-intro">
{:build_heading()}

<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('receipt_order/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('receipt_order/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('receipt_order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('receipt_order/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>

<div class="dropdown btn-group {:$auth->check('receipt_order/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>

</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('receipt_order/edit')}"
data-operate-del="{:$auth->check('receipt_order/del')}"
width="100%">
</table>
</div>
</div>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div id="app" class="table">
<div>
<div class="header-search">
<span>名称:</span>
<el-input v-model="search.name" style="width: 150px;" placeholder="请输入内容"></el-input>
<span>状态</span>
<el-select v-model="search.status" placeholder="请选择" clearable>
<el-option
v-for="item in status"
:key="item.id"
:label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-button type="primary" icon="el-icon-search" @click="getData(1)">搜索</el-button>
<el-button type="primary" icon="el-icon-plus" @click="edit(null)">新增收款单</el-button>
</div>

<el-table ref="multipleTable" :data="tableData" border tooltip-effect="dark"
style="font-size:12px;width: 100%;margin-top: 12px">
<el-table-column prop="create_id" label="创建人" min-width="70" :formatter="getUserName"></el-table-column>
<el-table-column prop="id" label="收款单号" min-width="50"></el-table-column>
<el-table-column prop="name" label="收款单名称" min-width="120"></el-table-column>
<el-table-column prop="status" label="收款单状态" :formatter="getStatusName" min-width="140">
<template slot-scope="scope">
<el-radio-group v-model="scope.row.status" size="mini">
<el-radio-button label="0">未收款</el-radio-button>
<el-radio-button label="1">收款中</el-radio-button>
<el-radio-button label="2">已收款</el-radio-button>
</el-radio-group>
</template>
</el-table-column>
<el-table-column prop="order_ids" label="关联订单" min-width="150"></el-table-column>
<el-table-column prop="total_amount" label="金额" min-width="60"></el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="80"></el-table-column>
<el-table-column prop="update_time" label="更新时间" min-width="80"></el-table-column>
<el-table-column label="操作" min-width="180">
<template slot-scope="scope">
<el-button-group>
<el-button type="primary" size="mini" @click="edit(scope.row)" icon="el-icon-edit">编辑</el-button>
<el-button type="primary" size="mini" icon="el-icon-delete">删除</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="search.pageSize"
:pager-count="11"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
:current-page="search.pageNum"
:page-sizes="[10, 20, 30, 40, 50]"
@size-change="sizeChange"
@current-change="getData"
@prev-click="getData"
@next-click="getData"
></el-pagination>
</div>


<transition name="bounce" v-if="editShow">
<el-dialog title="收款单详情" :visible.sync="editShow" width="90%" top="15px">
<el-form ref="form" label-width="100px" style="width: 100%;padding-bottom: 20px">
<div style="display: flex;width: 100%">
<el-form-item v-if="editType" label="收款单ID:" style="width: 80%">
<div v-html="editData.id"></div>
</el-form-item>
</div>
<div>
<el-form-item label="收款单名称:" style="width: 80%">
<el-input v-model="editData.name" style="width: 150px;" placeholder="请输入内容"></el-input>
</el-form-item>
</div>
<div>
<el-form-item v-if="editType" label="收款单状态:" style="width: 80%">
<el-radio-group v-model="editData.status" size="mini">
<el-radio-button label="0">未收款</el-radio-button>
<el-radio-button label="1">收款中</el-radio-button>
<el-radio-button label="2">已收款</el-radio-button>
</el-radio-group>
</el-form-item>
</div>
<div>
<el-button type="primary" @click="editDoing()" >保存</el-button>
</div>
</el-form>
</el-dialog>
</transition>

</div>
</body>
<!-- import Vue before Element -->
<script src="/assets/js/vue/vue.js"></script>
<!-- import JavaScript -->
<script src="/assets/js/vue/index.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
new Vue({
el: '#app',
data: function () {
return {
search: {
name: "",
status: "all",
pageSize: 10,
pageNum: 1
},
status: [
{"id": "all", "value": "请选择"},
{"id": 0, 'value': "未收款"},
{"id": 1, 'value': "收款中"},
{"id": 2, 'value': "已收款"}
],
total: 0,
tableData: [],
userList: [],
info: {
id: null,
name: "",
status: 0,
list: []
},
editShow: false,
editType: false,
editData: {}
}
},
created() {
this.getAdminUser();
this.getData(1)

},
methods: {
getStatusName(info) {
for (let i = 0; i < this.status.length; i++) {
if (this.status[i].id == info.status) {
return this.status[i].value
}
}
return "未知"
},
getUserName(info) {
for (let i = 0; i < this.userList.length; i++) {
if (this.userList[i].id == info.create_id) {
return this.userList[i].name
}
}
return "未知"
},
sizeChange(pageSize) {
this.search.pageSize = pageSize;
this.getData(this.search.pageNum)
},
//獲取列表
getData(page) {
this.search.pageNum = page;
axios.post("/hotel.php/receipt_order/getList", this.search).then((response) => {
let data = response.data;
console.log(this.tableData);
if (data.flag) {
this.tableData = data.data.list;
this.total = data.data.total;
console.log(this.tableData);
} else {
this.$message.error(response.msg);
}
}).catch(function (error) {
console.log(error);
});
},
getAdminUser() {
axios.post("/hotel.php/auth/admin/getList", this.search).then((response) => {
this.userList = response.data.list;
}).catch(function (error) {
console.log(error);
});
},
edit(info) {
if (info == null) {
this.editType = false;
this.editData = {
name: ""
}
} else {
this.editType = true;
this.editData = {
id:info.id,
name: info.name,
status:info.status
}
}
this.editShow = true;
},
editDoing(){
axios.post("/hotel.php/receipt_order/save", this.editData).then( (response)=> {
let data = response.data;
console.log(this.tableData);
if (data.flag) {
this.$message({
message: '保存成功!',
type: 'success'
});
this.editShow = false;
this.getData(1);
} else {
this.$message.error(response.msg);
}
}).catch(function (error) {
this.$message.error("保存失败");
console.log(error);
});
}
}
})
</script>
<style lang="scss" scoped>
.el-table thead {
background-color: #5a5e66 !important;
}

.header-search {
font-size: 14px;
font-weight: 900;
}

body {
background-color: white;
}

.table {
width: 100%;
font-size: 12px;
margin-top: 12px;
background-color: white;
}
</style>
</html>

+ 1
- 0
public/assets/js/vue/index.js
File diff suppressed because it is too large
View File


+ 12014
- 0
public/assets/js/vue/vue.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save