123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
- <!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>
- <style>
- .c1-label {
- width: 7em;
- color: #333;
- padding-right: 4px;
- display: inline-block;
- text-align: right;
- vertical-align: top;
- }
- .el-tooltip__popper {
- font-size: 14px;
- max-width: 40%
- }
- /* 设置显示隐藏部分内容,按40%显示 */
- </style>
- <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>
- <div class="c-item">
- <label class="c1-label">开票信息编号:</label>
- <el-input type="text" v-model="p.infoNo"></el-input>
- </div>
- <div class="c-item">
- <label class="c1-label">车牌号:</label>
- <el-input type="text" v-model="p.carNo"></el-input>
- </div>
- <div class="c-item">
- <label class="c1-label">客户名称:</label>
- <el-input type="text" v-model="p.customerName"></el-input>
- </div>
- <div class="c-item">
- <label class="c1-label">主体名称:</label>
- <el-input type="text" v-model="p.entityName"></el-input>
- </div>
- <div class="c-item">
- <label class="c-label">付款类型:</label>
- <el-select v-model="p.payType" placeholder="请选择" @change="f5()">
- <el-option label="全部" :value="0"></el-option>
- <el-option label="微信支付" :value="1"></el-option>
- <el-option label="预存款支付" :value="2"></el-option>
- </el-select>
- </div>
- <div class="c-item">
- <label class="c1-label">微信支付订单:</label>
- <el-input type="text" v-model="p.transactionId"></el-input>
- </div>
- <div class="c-item">
- <label class="c-label">开票状态:</label>
- <el-select v-model="p.status" placeholder="请选择" @change="f5()">
- <el-option label="不限" value=""></el-option>
- <el-option label="待申请" :value="0"></el-option>
- <el-option label="已申请" :value="1"></el-option>
- <el-option label="已开票" :value="2"></el-option>
- </el-select>
- </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 /><br />
- </el-form>
- <!-- ------------- 快捷按钮 ------------- -->
- <el-form ref="form" :model='p' @submit.native.prevent>
- <el-button style="display: inline;" type="primary" @click="add()">上传账单截图</el-button>
- <el-button style="display: inline;" type="primary" @click="applyFn()">申请开票</el-button>
- </el-form>
- <!-- ------------- 数据列表 ------------- -->
- <el-table class="data-table" ref="data-table" :data="dataList">
- <sa-td type="selection"></sa-td>
- <sa-td name="业务名称" prop="businessName" width="210px"></sa-td>
- <sa-td name="车牌号" prop="carNo" width="150px"></sa-td>
- <el-table-column label="业务订单号" width="150px">
- <template slot-scope="s">
- <el-tooltip :content="s.row.businessNo" placement="top" effect="light">
- <el-button class="keyButton">{{ s.row.businessNo }}</el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column label="客户名称" width="190px">
- <template slot-scope="s">
- <el-tooltip :content="s.row.customerName" placement="top" effect="light">
- <el-button class="keyButton">{{ s.row.customerName }}</el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column label="主体名称" width="190px">
- <template slot-scope="s">
- <el-tooltip v-if="s.row.entityName" :content="s.row.entityName" placement="top"
- effect="light">
- <el-button class="keyButton">{{ s.row.entityName }}</el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- <sa-td name="微信支付订单号" prop="transactionId" width="210px" v-if="p.payType==0||p.payType==1"></sa-td>
- <sa-td name="账单金额" prop="billMoney"></sa-td>
- <el-table-column label="支付方式" width="100px">
- <template slot-scope="s">
- <label v-if="s.row.transactionId">微信支付</label>
- <label v-else>预存款支付</label>
- </template>
- </el-table-column>
- <sa-td name="账单截图" prop="billImage" type="img"></sa-td>
- <sa-td name="开票状态" prop="status" type="enum" :jv="{0: '待申请', 1: '已申请', 2: '已开票'}"></sa-td>
- <sa-td name="开票时间" prop="invoiceTime" width="100px"></sa-td>
- <sa-td name="开票信息" prop="infoNo" width="130"></sa-td>
- <el-table-column label="操作" fixed="right" width="140px">
- <template slot-scope="s">
- <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="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="applyDate.visible" width="38%">
- <sa-item name="发票总额" v-model="applyDate.form.totalMoney" type="num" :disabled="true"></sa-item>
- <sa-item name="开票种类" v-model="applyDate.form.isElec" type="enum"
- :jv="{1: '电子普票', 0: '纸质普票', 2:'纸质专票'}"></sa-item>
- <div class="c-item">
- <label class="c-label">开票主体:</label>
- <el-select :disabled="selectDisabled" v-model="applyDate.form.entityId" placeholder="请选择" filterable @change="changeEntity">
- <el-option v-for="item in entityList" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </div>
- <sa-item type="text" name="企业名称" v-model="applyDate.entity.name" :disabled="true"></sa-item>
- <sa-item type="text" name="税号" v-model="applyDate.entity.taxIdNo" :disabled="true"></sa-item>
- <sa-item type="text" name="地址" v-model="applyDate.entity.address" :disabled="true"></sa-item>
- <sa-item type="text" name="电话" v-model="applyDate.entity.phone" :disabled="true"></sa-item>
- <sa-item type="text" name="开户银行" v-model="applyDate.entity.bank" :disabled="true"></sa-item>
- <sa-item type="text" name="银行账号" v-model="applyDate.entity.bankNo" :disabled="true"></sa-item>
- <span slot="footer" class="dialog-footer">
- <el-button @click="applyDate.visible = false">取 消</el-button>
- <el-button type="primary" @click="apply">确 定</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: '', // 主键 、
- payType: 0,
- customerId: '', // 客户id
- businessId: '', // 业务订单id
- businessName: '', // 业务名称
- customerName: '',
- entityName: '',
- businessNo: '', // 业务订单号
- carNo: '', //车牌号
- transactionId: '', // 微信支付订单号
- status: '', // 支付状态(0=未开票,1=已开票)
- invoiceTime: '', // 开票时间
- infoNo: '', // 开票信息no
- pageNo: 1, // 当前页
- pageSize: 10, // 页大小
- sortType: 0 // 排序方式
- },
- dataCount: 0,
- dataList: [], // 数据集合
- entityList: [],
- applyDate: {
- visible: false,
- form: {
- ids: '',
- entityId: '',
- isElec: 1,
- totalMoney: 0,
- customerId: '',
- customerName: '',
- },
- entity: {},
- },
- currentCustomerId: '1',
- currentCustomerName: '',
- selectDisabled:false
- },
- methods: {
- apply() {
- sa.checkNull(this.applyDate.form.entityId, '请选择 [主体信息]');
- sa.checkNull(this.applyDate.form.isElec, '请选择 [电子发票]');
- sa.ajax('/TbInvoiceInfo/generate', this.applyDate.form, function(res) {
- this.applyDate.visible = false;
- sa.alert('成功生成开票信息', this.f5);
- }.bind(this));
- },
- applyFn() {
- this.selectDisabled=false;
- this.applyDate.form={
- ids: '',
- entityId: '',
- isElec: 1,
- totalMoney: 0,
- customerId: this.applyDate.form.customerId,
- customerName: this.applyDate.form.customerName
- }
- let selection = this.$refs['data-table'].selection;
- if (selection.length == 0) {
- return sa.msg('请至少选择一条数据')
- }
- let ids = sa.getArrayField(selection, 'id');
- let entityName=selection[0].entityName;
- for (var i = 0; i < selection.length; i++) {
- if (selection[i].status == 1 || selection[i].status == 2) {
- return sa.msg('请选择待申请的订单')
- }
- if(selection[i].entityName!=entityName){
- return sa.msg('请选择同一个主体的订单进行开票');
- }
- }
- let billMoneys = sa.getArrayField(selection, 'billMoney');
- var totalMoney = 0;
- for (var i = billMoneys.length - 1; i >= 0; i--) {
- totalMoney += billMoneys[i];
- }
- if(selection[0].entityName){
- let entityArry=this.entityList.filter(obj=>obj.name==selection[0].entityName);
- if(entityArry.length==0){
- return sa.msg('开票主体缺少【'+selection[0].entityName+'】信息,请先录入主体信息');
- }
- this.applyDate.entity = entityArry[0];
- this.applyDate.form.entityId=entityArry[0].id;
- this.selectDisabled=true;
- }
- this.applyDate.form.totalMoney = totalMoney;
- this.applyDate.visible = true;
- this.applyDate.form.ids = ids.join(',');
-
- },
- changeEntity(value) {
- let entity = this.entityList.filter(obj => obj.id == value).pop();
- this.applyDate.entity = entity;
- },
- getEntityList() {
- sa.ajax('/TbEntity/getList',{pageNo:1,pageSize:100}, function(res) {
- this.entityList = res.data; // 数据
- }.bind(this));
- },
- getCustomer() {
- sa.ajax('/TbCostomer/getCurrentCustomer', function(resp) {
- this.currentCustomerId = resp.data.id;
- this.currentCustomerName = resp.data.name;
- this.applyDate.form.customerId = resp.data.id;
- this.applyDate.form.customerName = resp.data.name;
- }.bind(this));
- },
- // 刷新
- f5: function() {
- sa.ajax('/TbInvoiceOrder/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-order-info.html?id=' + data.id, '1200px', '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-order-add.html?id=' + data.id, '550px', '80%');
- },
- // 新增
- add: function(data) {
- sa.showIframe('新增数据', 'tb-invoice-order-add.html?id=-1&customerId=' + this.currentCustomerId,
- '550px', '60%');
- },
- // 删除
- del: function(data) {
- sa.confirm('是否删除,此操作不可撤销', function() {
- sa.ajax('/TbInvoiceOrder/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('/TbInvoiceOrder/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();
- this.getEntityList();
- sa.onInputEnter();
- }
- })
- </script>
- </body>
- </html>
|