123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- <!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="../../static/kj/element-ui/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>
- </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>
- <div class="c-item">
- <label class="c-label">开票状态:</label>
- <el-select v-model="p.status" placeholder="请选择">
- <el-option label="不限" value=""></el-option>
- <el-option label="未开票" :value="0"></el-option>
- <el-option label="已开票" :value="1"></el-option>
- </el-select>
- </div>
- <div class="c-item">
- <label class="c-label">开票时间:</label>
- <el-date-picker size="mini" v-model="selectTime" type="daterange" range-separator="至"
- start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy 年 MM 月 dd 日"
- value-format="yyyy-MM-dd">
- </el-date-picker>
- </div>
- <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
- <el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
- <br />
- </el-form>
- <!-- ------------- 快捷按钮 ------------- -->
- <!-- ------------- 数据列表 ------------- -->
- <el-table class="data-table" ref="data-table" :data="dataList">
- <sa-td type="selection"></sa-td>
- <sa-td name="编号" prop="no" width="129"></sa-td>
- <sa-td name="客户名称" prop="customerName" width="180"></sa-td>
- <sa-td name="账单金额" prop="totalMoney"></sa-td>
- <sa-td name="开票状态" prop="status" type="enum" :jv="{0: '未开票', 1: '已开票',2:'申请中',3:'红冲',6:'作废'}">
- </sa-td>
- <sa-td name="开票种类" prop="isElec" type="enum" :jv="{0: '纸质普票', 1: '电子普票', 2:'纸质专票'}"></sa-td>
- <sa-td name="开票时间" prop="invoiceTime"></sa-td>
- <sa-td name="发票号" prop="invoiceNo" width="150">
- <template slot-scope="s">
- <div>{{s.row.invoiceNo}}
- <i @click="updateInvoiceNo(s.row)" class="el-icon-edit"
- v-if="s.row.status===1&& currentCustomerId==1"
- style="cursor: pointer;padding-left: 10px;color: blue;"></i>
- </div>
- </template>
- </sa-td>
- <el-table-column label="主体名称">
- <template slot-scope="s">
- <span>{{s.row.entityName}}</span>
- </template>
- </el-table-column>
- <el-table-column label="税号" width="156">
- <template slot-scope="s">
- <span>{{s.row.taxIdNo}}</span>
- </template>
- </el-table-column>
- <!-- <sa-td name="地址" prop="address" ></sa-td>-->
- <!-- <sa-td name="电话" prop="phone" ></sa-td>-->
- <!-- <sa-td name="开户银行" prop="bank" ></sa-td>-->
- <!-- <sa-td name="银行账号" prop="bankNo" ></sa-td>-->
- <!-- <sa-td name="邮箱" prop="email" ></sa-td>-->
- <el-table-column label="操作" width="240px">
- <template slot-scope="s">
- <el-button v-if="s.row.isElec==1&¤tCustomerId==1&&s.row.status==0" class="c-btn"
- type="primary" @click="onlineFn(s.row)">线上开票</el-button>
- <el-button v-if="s.row.status==0 && currentCustomerId==1" class="c-btn" type="primary"
- @click="completeFn(s.row.id)">线下开票</el-button>
- <el-button v-if="s.row.isElec==1&&s.row.status==1" class="c-btn" type="primary"
- @click="onlineFn(s.row)">发票详情</el-button>
- <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
- </el-button>
- <el-button v-if="s.row.status==0" class="c-btn" type="primary" icon="el-icon-edit"
- @click="update(s.row)">修改</el-button>
- <el-button v-if="s.row.status==0 && currentCustomerId==1" class="c-btn" type="danger"
- icon="el-icon-delete" @click="del(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>
- <el-dialog title="完成开票" :visible.sync="completeDate.visible" width="38%">
- <div class="c-item">
- <label class="c-label">开票时间:</label>
- <el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
- v-model="completeDate.form.invoiceTime"></el-date-picker>
- </div>
- <br />
- <sa-item type="text" name="发票号" v-model="completeDate.form.invoiceNo"></sa-item>
- <span slot="footer" class="dialog-footer">
- <el-button @click="completeDate.visible = false">取 消</el-button>
- <el-button type="primary" @click="complete">确 定</el-button>
- </span>
- </el-dialog>
- </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: '', // 客户名称
- totalMoney: '', // 账单金额
- status: '', // 支付状态(0=未开票,1=已开票)
- invoiceTime: '', // 开票时间
- invoiceNo: '', // 发票号
- entityId: '', // 主体id
- entityName: '', // 主体名称
- taxIdNo: '', // 税号
- address: '', // 地址
- phone: '', // 电话
- bank: '', // 开户银行
- bankNo: '', // 银行账号
- email: '', // 邮箱
- createTime: '', // 创建时间
- beginTime: '', //查询开始时间
- endTime: '', //查询结束时间
- pageNo: 1, // 当前页
- pageSize: 10, // 页大小
- sortType: 0 // 排序方式
- },
- dataCount: 0,
- dataList: [], // 数据集合
- completeDate: {
- visible: false,
- form: {
- id: '',
- invoiceTime: '',
- invoiceNo: '',
- },
- },
- currentCustomerId: '1',
- selectTime: [],
- selectTimeRange: {
- beginTime: '', //查询开始时间
- endTime: '', //查询结束时间
- },
- },
- methods: {
- onlineFn(data) {
- sa.showIframe('线上开票', 'online-invioce.html?id=' + data.id, '1000px', '90%');
- },
- updateInvoiceNo(data) {
- layer.prompt({
- title: '修改发票号'
- }, function(pass, index) {
- layer.close(index);
- sa.ajax('/TbInvoiceInfo/updateInvoiceNo', {
- id: data.id,
- invoiceNo: pass
- }, function(res) {
- data.invoiceNo = pass;
- layer.msg('修改成功');
- }.bind(this))
- });
- },
- completeFn(id) {
- this.completeDate.visible = true;
- this.completeDate.form.id = id;
- },
- complete() {
- sa.checkNull(this.completeDate.form.invoiceTime, '请选择 [开票时间]');
- sa.checkNull(this.completeDate.form.invoiceNo, '输入 [发票号]');
- sa.ajax('/TbInvoiceInfo/complete?', this.completeDate.form, function(res) {
- this.completeDate.visible = false;
- sa.alert('开票成功', this.f5);
- }.bind(this))
- },
- getCustomer() {
- sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
- this.currentCustomerId = resp.data;
- }.bind(this));
- },
- // 刷新
- f5: function() {
- if (this.selectTime != null && this.selectTime.length != 0) {
- this.p.beginTime = this.selectTime[0];
- this.p.endTime = this.selectTime[1];
- }
- sa.ajax('/TbInvoiceInfo/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-invoice-info-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]);
- },
- // 修改
- update: function(data) {
- sa.showIframe('主体信息修改', 'tb-invoice-info-add.html?id=' + data.id, '550px', '80%');
- },
- // 新增
- add: function(data) {
- sa.showIframe('新增数据', 'tb-invoice-info-add.html?id=-1&customerId=' + this.currentCustomerId,
- '550px', '80%');
- },
- // 删除
- del: function(data) {
- sa.confirm('是否删除,此操作不可撤销', function() {
- sa.ajax('/TbInvoiceInfo/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('/TbInvoiceInfo/deleteByIds', {
- ids: ids.join(',')
- }, function(res) {
- sa.arrayDelete(this.dataList, selection);
- sa.ok('删除成功');
- sa.f5TableHeight(); // 刷新表格高度
- }.bind(this))
- }.bind(this));
- },
- },
- created: function() {
- this.f5();
- this.getCustomer();
- sa.onInputEnter();
- }
- })
- </script>
- </body>
- </html>
|