123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>预充值扣费绑定-列表</title>
- <meta charset="utf-8">
- <meta name="viewport"
- content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
- <!-- 所有的 css & js 资源 -->
- <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
- <link rel="stylesheet" href="../../static/sa.css">
- <script src="../../static/kj/vue.min.js"></script>
- <script src="../../static/kj/element-ui/index.js"></script>
- <script src="../../static/kj/httpVueLoader.js"></script>
- <script src="../../static/kj/jquery.min.js"></script>
- <script src="../../static/kj/layer/layer.js"></script>
- <script src="../../static/sa.js"></script>
- <style type="text/css">
- .data-table > .el-table__header-wrapper > table > thead > tr > th:first-child > div {
- display: none!important;
- }
- </style>
- </head>
- <body>
- <div class="vue-box" style="display: none;" :style="'display: block;'">
- <div class="c-panel">
- <!-- ------------- 检索参数 ------------- -->
- <div class="c-title">检索参数</div>
- <el-form ref="form" :model='p' @submit.native.prevent>
- <sa-item type="text" name="客户名称" v-model="p.customerName"></sa-item>
- <sa-item type="text" name="绑定操作人" v-model="p.createBy"></sa-item>
- <sa-item type="text" name="解绑操作人" v-model="p.updateBy"></sa-item>
- <sa-item type="text" name="绑定时间" >
- <el-date-picker
- v-model="p.bindTime"
- type="daterange"
- align="right"
- unlink-panels
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :picker-options="pickerOptions">
- </el-date-picker>
- </sa-item>
- <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
- <br/>
- </el-form>
- <!-- ------------- 快捷按钮 ------------- -->
- <sa-item type="fast-btn">
- <el-button type="primary" class="c-btn" icon="el-icon-plus"
- v-if="sa.isAuth('tb-deduction-bind-list-bind')" @click="add">绑定车辆</el-button>
- </sa-item>
- <!-- ------------- 数据列表 ------------- -->
- <el-table class="data-table" ref="data-table" :data="dataList" @select="selectRow" @row-click="handleRowClick">
- <sa-td type="selection"></sa-td>
- <sa-td name="主键" prop="id" v-if="false"></sa-td>
- <sa-td name="客户名称" prop="customerName"></sa-td>
- <sa-td name="扣除金额" prop="deductMoney"></sa-td>
- <sa-td name="绑定车辆" prop="bindCar"></sa-td>
- <sa-td name="绑定时间" prop="bindTime"></sa-td>
- <sa-td name="解绑时间" prop="unbindTime"></sa-td>
- <sa-td name="绑定创建人" prop="createBy"></sa-td>
- <sa-td name="创建时间" prop="createTime"></sa-td>
- <sa-td name="解绑更新人" prop="updateBy"></sa-td>
- <sa-td name="更新时间" prop="updateTime"></sa-td>
- <sa-td name="扣款失败提示" prop="feeFailRecord" width="200" height="20"></sa-td>
- <el-table-column label="操作" fixed="right" width="240px">
- <template slot-scope="s">
- <el-button class="c-btn" type="primary" icon="el-icon-edit" v-if="!s.row.unbindTime&&sa.isAuth('tb-deduction-bind-list-unbind')"
- @click="unbind(s.row)">手动解绑</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- ------------- 分页 ------------- -->
- <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
- </div>
- </div>
- <script>
- var app = new Vue({
- components: {
- "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
- "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
- },
- el: '.vue-box',
- data: {
- p: { // 查询参数
- id: '', // 主键
- customerId: '', // 客户id
- customerName: '', // 客户名称
- deductMoney: '', // 扣除金额
- bindCar: '', // 绑定车辆
- bindTime: undefined, // 绑定时间
- unbindTime: undefined, // 解绑时候
- createBy: '', // 创建人
- createTime: undefined, // 创建时间
- updateTime: undefined, // 更新时间
- updateBy: '', // 更新人
- pageNo: 1, // 当前页
- pageSize: 10, // 页大小
- sortType: 0 // 排序方式
- },
- pickerOptions: {
- shortcuts: [{
- text: '最近一周',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近一个月',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近三个月',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
- picker.$emit('pick', [start, end]);
- }
- }]
- },
- addCustomerId:'',
- dataCount: 0,
- dataList: [], // 数据集合
- },
- methods: {
- // 刷新
- f5: function () {
- sa.ajax('/TbDeductionBind/getList', sa.removeNull(this.p), function (res) {
- this.dataList = res.data; // 数据
- this.dataCount = res.dataCount; // 数据总数
- sa.f5TableHeight(); // 刷新表格高度
- }.bind(this));
- },
- // 查看
- get: function (data) {
- sa.showIframe('数据详情', 'tb-deduction-bind-info.html?id=' + data.id, '1050px', '90%');
- },
- // 查看 - 根据选中的
- getBySelect: function (data) {
- var selection = this.$refs['data-table'].selection;
- if (selection.length == 0) {
- return sa.msg('请选择一条数据')
- }
- this.get(selection[0]);
- },
- // 手动解绑
- unbind: function (data) {
- if(!data.id || data.id=="null" || data.id=="undefined"){
- sa.error2("没有车辆绑定信息!")
- return;
- }
- sa.showIframe('修改数据', 'tb-deduction-bind-unbind.html?id=' + data.id, '700px', '70%');
- },
- // 车辆绑定
- add: function (data) {
- sa.showIframe('车辆绑定', 'tb-deduction-bind-add.html', '1000px', '90%');
- },
- // 删除
- del: function (data) {
- sa.confirm('是否删除,此操作不可撤销', function () {
- sa.ajax('/TbDeductionBind/delete?id=' + data.id, function (res) {
- sa.arrayDelete(this.dataList, data);
- sa.ok('删除成功');
- sa.f5TableHeight(); // 刷新表格高度
- }.bind(this))
- }.bind(this));
- },
- // 批量删除
- deleteByIds: function () {
- // 获取选中元素的id列表
- let selection = this.$refs['data-table'].selection;
- let ids = sa.getArrayField(selection, 'id');
- if (selection.length == 0) {
- return sa.msg('请至少选择一条数据')
- }
- // 提交删除
- sa.confirm('是否批量删除选中数据?此操作不可撤销', function () {
- sa.ajax('/TbDeductionBind/deleteByIds', {ids: ids.join(',')}, function (res) {
- sa.arrayDelete(this.dataList, selection);
- sa.ok('删除成功');
- sa.f5TableHeight(); // 刷新表格高度
- }.bind(this))
- }.bind(this));
- },
- selectRow(val, row) {
- this.$refs['data-table'].clearSelection();
- this.$refs['data-table'].toggleRowSelection(row, true);
- this.addCustomerId = row.customerId;
- },
- handleRowClick(row, column, event) {
- this.selectRow(null,row);
- }
- },
- created: function () {
- this.f5();
- sa.onInputEnter();
- }
- })
- </script>
- </body>
- </html>
- <script>
- import Style from "../../../app/uview-ui/libs/mixin/style";
- export default {
- components: {Style}
- }
- </script>
|