|
|
@@ -0,0 +1,267 @@
|
|
|
+<!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="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
|
|
|
+ <script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
|
|
|
+ <script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
|
|
|
+ <script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
|
|
|
+ <script src="https://www.layuicdn.com/layer-v3.1.1/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;}
|
|
|
+ </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.transactionId"></el-input>
|
|
|
+ </div>
|
|
|
+ <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-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 />
|
|
|
+ </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" ></sa-td>
|
|
|
+ <el-table-column label="业务订单号" width="150px">
|
|
|
+ <template slot-scope="s">
|
|
|
+ <el-tooltip :content="s.row.businessNo"placement="bottom"effect="light">
|
|
|
+ <el-button class="keyButton">{{ s.row.businessNo }}</el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+<!-- <sa-td name="业务订单号" prop="businessNo" width="150" ></sa-td>-->
|
|
|
+
|
|
|
+ <sa-td name="微信支付订单号" prop="transactionId" width="210px"></sa-td>
|
|
|
+ <sa-td name="账单金额" prop="billMoney" ></sa-td>
|
|
|
+ <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" ></sa-td>
|
|
|
+ <sa-td name="开票信息" prop="infoNo" width="130"></sa-td>
|
|
|
+ <el-table-column label="操作" fixed="right" width="240px">
|
|
|
+ <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: '否'}"></sa-item>
|
|
|
+ <div class="c-item">
|
|
|
+ <label class="c-label">开票主体:</label>
|
|
|
+ <el-select 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="emodel.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: '', // 主键 、
|
|
|
+
|
|
|
+ customerId: '', // 客户id
|
|
|
+ businessId: '', // 业务订单id
|
|
|
+ businessName: '', // 业务名称
|
|
|
+ businessNo: '', // 业务订单号
|
|
|
+ transactionId: '', // 微信支付订单号
|
|
|
+ billMoney: '', // 账单金额
|
|
|
+ status: '', // 支付状态(0=未开票,1=已开票)
|
|
|
+ invoiceTime: '', // 开票时间
|
|
|
+ createTime: '', // 创建时间
|
|
|
+ infoId: '', // 开票信息id
|
|
|
+ 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: '',
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ apply(){
|
|
|
+ sa.checkNull(this.applyDate.form.entityId, '请选择 [主体信息]');
|
|
|
+ sa.checkNull(this.applyDate.form.isElec, '请选择 [电子发票]');
|
|
|
+
|
|
|
+ sa.ajax('/TbInvoiceInfo/generate', this.applyDate.form, function(res){
|
|
|
+ sa.alert('成功生成开票信息');
|
|
|
+ this.applyDate.visible = false;
|
|
|
+ this.f5();
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ applyFn(){
|
|
|
+ let selection = this.$refs['data-table'].selection;
|
|
|
+ if(selection.length == 0) {
|
|
|
+ return sa.msg('请至少选择一条数据')
|
|
|
+ }
|
|
|
+ var ids = sa.getArrayField(selection, 'id');
|
|
|
+ for(var i=0; i<ids.length; i++){
|
|
|
+ if(this.dataList[i].status == 1){
|
|
|
+ return sa.msg('请选择未开票的订单')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let billMoneys = sa.getArrayField(selection, 'billMoney');
|
|
|
+ var totalMoney = 0;
|
|
|
+ for (var i=billMoneys.length-1; i>=0; i--) {
|
|
|
+ totalMoney += billMoneys[i];
|
|
|
+ }
|
|
|
+ this.applyDate.form.totalMoney = totalMoney;
|
|
|
+ this.applyDate.visible = true;
|
|
|
+ this.applyDate.form.ids = ids.join(',');
|
|
|
+ this.getEntityList();
|
|
|
+ },
|
|
|
+ changeEntity(value){
|
|
|
+ let entity = this.entityList.filter(obj => obj.id == value).pop();
|
|
|
+ this.applyDate.entity = entity;
|
|
|
+ },
|
|
|
+ getEntityList(){
|
|
|
+ sa.ajax('/TbEntity/getList', 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;
|
|
|
+ console.log(resp.data)
|
|
|
+ console.log(this.currentCustomerId)
|
|
|
+ console.log(this.currentCustomerName)
|
|
|
+ console.log(this.applyDate.form.customerId)
|
|
|
+ console.log(this.applyDate.form.customerName)
|
|
|
+ }.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, '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-order-add.html?id=' + data.id, '550px', '80%');
|
|
|
+ },
|
|
|
+ // 新增
|
|
|
+ add: function(data) {
|
|
|
+ sa.showIframe('新增数据', 'tb-invoice-order-add.html?id=-1&customerId=' + this.currentCustomerId, '550px', '80%');
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ 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();
|
|
|
+ sa.onInputEnter();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ </script>
|
|
|
+ </body>
|
|
|
+</html>
|