申请开票管理

This commit is contained in:
2023-04-10 16:56:06 +08:00
parent ecd1e94fcf
commit e518cacad3
9 changed files with 913 additions and 0 deletions

View File

@@ -0,0 +1,98 @@
package com.jsowell.web.controller.pile;
import com.jsowell.common.annotation.Log;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.core.page.TableDataInfo;
import com.jsowell.common.enums.BusinessType;
import com.jsowell.common.util.poi.ExcelUtil;
import com.jsowell.pile.domain.OrderInvoiceRecord;
import com.jsowell.pile.service.IOrderInvoiceRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 申请开票Controller
*
* @author jsowell
* @date 2023-04-10
*/
@RestController
@RequestMapping("/order/invoice")
public class OrderInvoiceRecordController extends BaseController {
@Autowired
private IOrderInvoiceRecordService orderInvoiceRecordService;
/**
* 查询申请开票列表
*/
@PreAuthorize("@ss.hasPermi('order:invoice:list')")
@GetMapping("/list")
public TableDataInfo list(OrderInvoiceRecord orderInvoiceRecord) {
startPage();
List<OrderInvoiceRecord> list = orderInvoiceRecordService.selectOrderInvoiceRecordList(orderInvoiceRecord);
return getDataTable(list);
}
/**
* 导出申请开票列表
*/
@PreAuthorize("@ss.hasPermi('order:invoice:export')")
@Log(title = "申请开票", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, OrderInvoiceRecord orderInvoiceRecord) {
List<OrderInvoiceRecord> list = orderInvoiceRecordService.selectOrderInvoiceRecordList(orderInvoiceRecord);
ExcelUtil<OrderInvoiceRecord> util = new ExcelUtil<OrderInvoiceRecord>(OrderInvoiceRecord.class);
util.exportExcel(response, list, "申请开票数据");
}
/**
* 获取申请开票详细信息
*/
@PreAuthorize("@ss.hasPermi('order:invoice:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Integer id) {
return AjaxResult.success(orderInvoiceRecordService.selectOrderInvoiceRecordById(id));
}
/**
* 新增申请开票
*/
@PreAuthorize("@ss.hasPermi('order:invoice:add')")
@Log(title = "申请开票", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody OrderInvoiceRecord orderInvoiceRecord) {
return toAjax(orderInvoiceRecordService.insertOrderInvoiceRecord(orderInvoiceRecord));
}
/**
* 修改申请开票
*/
@PreAuthorize("@ss.hasPermi('order:invoice:edit')")
@Log(title = "申请开票", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody OrderInvoiceRecord orderInvoiceRecord) {
return toAjax(orderInvoiceRecordService.updateOrderInvoiceRecord(orderInvoiceRecord));
}
/**
* 删除申请开票
*/
@PreAuthorize("@ss.hasPermi('order:invoice:remove')")
@Log(title = "申请开票", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Integer[] ids) {
return toAjax(orderInvoiceRecordService.deleteOrderInvoiceRecordByIds(ids));
}
}

View File

@@ -0,0 +1,146 @@
package com.jsowell.pile.domain;
import com.jsowell.common.annotation.Excel;
import com.jsowell.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 申请开票对象 order_invoice_record
*
* @author jsowell
* @date 2023-04-10
*/
public class OrderInvoiceRecord extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
* 会员id
*/
@Excel(name = "会员id")
private String memberId;
/**
* 申请订单编号(逗号分割)
*/
@Excel(name = "申请订单编号", readConverterExp = "逗=号分割")
private String orderCodes;
/**
* 状态0-未开发票1-已开发票)
*/
@Excel(name = "状态", readConverterExp = "0=-未开发票1-已开发票")
private String status;
/**
* 开票总金额
*/
@Excel(name = "开票总金额")
private BigDecimal totalAmount;
/**
* 总服务费金额
*/
@Excel(name = "总服务费金额")
private BigDecimal totalServiceAmount;
/**
* 总电费金额
*/
@Excel(name = "总电费金额")
private BigDecimal totalElecAmount;
/**
* 删除标识0-正常1-删除)
*/
private String delFlag;
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getMemberId() {
return memberId;
}
public void setOrderCodes(String orderCodes) {
this.orderCodes = orderCodes;
}
public String getOrderCodes() {
return orderCodes;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setTotalAmount(BigDecimal totalAmount) {
this.totalAmount = totalAmount;
}
public BigDecimal getTotalAmount() {
return totalAmount;
}
public void setTotalServiceAmount(BigDecimal totalServiceAmount) {
this.totalServiceAmount = totalServiceAmount;
}
public BigDecimal getTotalServiceAmount() {
return totalServiceAmount;
}
public void setTotalElecAmount(BigDecimal totalElecAmount) {
this.totalElecAmount = totalElecAmount;
}
public BigDecimal getTotalElecAmount() {
return totalElecAmount;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
.append("id", getId())
.append("memberId", getMemberId())
.append("orderCodes", getOrderCodes())
.append("status", getStatus())
.append("totalAmount", getTotalAmount())
.append("totalServiceAmount", getTotalServiceAmount())
.append("totalElecAmount", getTotalElecAmount())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("delFlag", getDelFlag())
.toString();
}
}

View File

@@ -0,0 +1,61 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.OrderInvoiceRecord;
import java.util.List;
/**
* 申请开票Mapper接口
*
* @author jsowell
* @date 2023-04-10
*/
public interface OrderInvoiceRecordMapper {
/**
* 查询申请开票
*
* @param id 申请开票主键
* @return 申请开票
*/
public OrderInvoiceRecord selectOrderInvoiceRecordById(Integer id);
/**
* 查询申请开票列表
*
* @param orderInvoiceRecord 申请开票
* @return 申请开票集合
*/
public List<OrderInvoiceRecord> selectOrderInvoiceRecordList(OrderInvoiceRecord orderInvoiceRecord);
/**
* 新增申请开票
*
* @param orderInvoiceRecord 申请开票
* @return 结果
*/
public int insertOrderInvoiceRecord(OrderInvoiceRecord orderInvoiceRecord);
/**
* 修改申请开票
*
* @param orderInvoiceRecord 申请开票
* @return 结果
*/
public int updateOrderInvoiceRecord(OrderInvoiceRecord orderInvoiceRecord);
/**
* 删除申请开票
*
* @param id 申请开票主键
* @return 结果
*/
public int deleteOrderInvoiceRecordById(Integer id);
/**
* 批量删除申请开票
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteOrderInvoiceRecordByIds(Integer[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.jsowell.pile.service;
import com.jsowell.pile.domain.OrderInvoiceRecord;
import java.util.List;
/**
* 申请开票Service接口
*
* @author jsowell
* @date 2023-04-10
*/
public interface IOrderInvoiceRecordService {
/**
* 查询申请开票
*
* @param id 申请开票主键
* @return 申请开票
*/
public OrderInvoiceRecord selectOrderInvoiceRecordById(Integer id);
/**
* 查询申请开票列表
*
* @param orderInvoiceRecord 申请开票
* @return 申请开票集合
*/
public List<OrderInvoiceRecord> selectOrderInvoiceRecordList(OrderInvoiceRecord orderInvoiceRecord);
/**
* 新增申请开票
*
* @param orderInvoiceRecord 申请开票
* @return 结果
*/
public int insertOrderInvoiceRecord(OrderInvoiceRecord orderInvoiceRecord);
/**
* 修改申请开票
*
* @param orderInvoiceRecord 申请开票
* @return 结果
*/
public int updateOrderInvoiceRecord(OrderInvoiceRecord orderInvoiceRecord);
/**
* 批量删除申请开票
*
* @param ids 需要删除的申请开票主键集合
* @return 结果
*/
public int deleteOrderInvoiceRecordByIds(Integer[] ids);
/**
* 删除申请开票信息
*
* @param id 申请开票主键
* @return 结果
*/
public int deleteOrderInvoiceRecordById(Integer id);
}

View File

@@ -0,0 +1,90 @@
package com.jsowell.pile.service.impl;
import com.jsowell.common.util.DateUtils;
import com.jsowell.pile.domain.OrderInvoiceRecord;
import com.jsowell.pile.mapper.OrderInvoiceRecordMapper;
import com.jsowell.pile.service.IOrderInvoiceRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 申请开票Service业务层处理
*
* @author jsowell
* @date 2023-04-10
*/
@Service
public class OrderInvoiceRecordServiceImpl implements IOrderInvoiceRecordService {
@Autowired
private OrderInvoiceRecordMapper orderInvoiceRecordMapper;
/**
* 查询申请开票
*
* @param id 申请开票主键
* @return 申请开票
*/
@Override
public OrderInvoiceRecord selectOrderInvoiceRecordById(Integer id) {
return orderInvoiceRecordMapper.selectOrderInvoiceRecordById(id);
}
/**
* 查询申请开票列表
*
* @param orderInvoiceRecord 申请开票
* @return 申请开票
*/
@Override
public List<OrderInvoiceRecord> selectOrderInvoiceRecordList(OrderInvoiceRecord orderInvoiceRecord) {
return orderInvoiceRecordMapper.selectOrderInvoiceRecordList(orderInvoiceRecord);
}
/**
* 新增申请开票
*
* @param orderInvoiceRecord 申请开票
* @return 结果
*/
@Override
public int insertOrderInvoiceRecord(OrderInvoiceRecord orderInvoiceRecord) {
orderInvoiceRecord.setCreateTime(DateUtils.getNowDate());
return orderInvoiceRecordMapper.insertOrderInvoiceRecord(orderInvoiceRecord);
}
/**
* 修改申请开票
*
* @param orderInvoiceRecord 申请开票
* @return 结果
*/
@Override
public int updateOrderInvoiceRecord(OrderInvoiceRecord orderInvoiceRecord) {
orderInvoiceRecord.setUpdateTime(DateUtils.getNowDate());
return orderInvoiceRecordMapper.updateOrderInvoiceRecord(orderInvoiceRecord);
}
/**
* 批量删除申请开票
*
* @param ids 需要删除的申请开票主键
* @return 结果
*/
@Override
public int deleteOrderInvoiceRecordByIds(Integer[] ids) {
return orderInvoiceRecordMapper.deleteOrderInvoiceRecordByIds(ids);
}
/**
* 删除申请开票信息
*
* @param id 申请开票主键
* @return 结果
*/
@Override
public int deleteOrderInvoiceRecordById(Integer id) {
return orderInvoiceRecordMapper.deleteOrderInvoiceRecordById(id);
}
}

View File

@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsowell.pile.mapper.OrderInvoiceRecordMapper">
<resultMap type="OrderInvoiceRecord" id="OrderInvoiceRecordResult">
<result property="id" column="id" />
<result property="memberId" column="member_id" />
<result property="orderCodes" column="order_codes" />
<result property="status" column="status" />
<result property="totalAmount" column="total_amount" />
<result property="totalServiceAmount" column="total_service_amount" />
<result property="totalElecAmount" column="total_elec_amount" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectOrderInvoiceRecordVo">
select id, member_id, order_codes, status, total_amount, total_service_amount, total_elec_amount, create_by, create_time, update_by, update_time, del_flag from order_invoice_record
</sql>
<select id="selectOrderInvoiceRecordList" parameterType="OrderInvoiceRecord" resultMap="OrderInvoiceRecordResult">
<include refid="selectOrderInvoiceRecordVo"/>
<where>
<if test="memberId != null and memberId != ''"> and member_id = #{memberId}</if>
<if test="orderCodes != null and orderCodes != ''"> and order_codes like concat('%', #{orderCodes}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
<if test="totalServiceAmount != null "> and total_service_amount = #{totalServiceAmount}</if>
<if test="totalElecAmount != null "> and total_elec_amount = #{totalElecAmount}</if>
</where>
</select>
<select id="selectOrderInvoiceRecordById" parameterType="Integer" resultMap="OrderInvoiceRecordResult">
<include refid="selectOrderInvoiceRecordVo"/>
where id = #{id}
</select>
<insert id="insertOrderInvoiceRecord" parameterType="OrderInvoiceRecord" useGeneratedKeys="true" keyProperty="id">
insert into order_invoice_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="memberId != null">member_id,</if>
<if test="orderCodes != null">order_codes,</if>
<if test="status != null">status,</if>
<if test="totalAmount != null">total_amount,</if>
<if test="totalServiceAmount != null">total_service_amount,</if>
<if test="totalElecAmount != null">total_elec_amount,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="memberId != null">#{memberId},</if>
<if test="orderCodes != null">#{orderCodes},</if>
<if test="status != null">#{status},</if>
<if test="totalAmount != null">#{totalAmount},</if>
<if test="totalServiceAmount != null">#{totalServiceAmount},</if>
<if test="totalElecAmount != null">#{totalElecAmount},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateOrderInvoiceRecord" parameterType="OrderInvoiceRecord">
update order_invoice_record
<trim prefix="SET" suffixOverrides=",">
<if test="memberId != null">member_id = #{memberId},</if>
<if test="orderCodes != null">order_codes = #{orderCodes},</if>
<if test="status != null">status = #{status},</if>
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
<if test="totalServiceAmount != null">total_service_amount = #{totalServiceAmount},</if>
<if test="totalElecAmount != null">total_elec_amount = #{totalElecAmount},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOrderInvoiceRecordById" parameterType="Integer">
delete from order_invoice_record where id = #{id}
</delete>
<delete id="deleteOrderInvoiceRecordByIds" parameterType="String">
delete from order_invoice_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询申请开票列表
export function listInvoice(query) {
return request({
url: '/order/invoice/list',
method: 'get',
params: query
})
}
// 查询申请开票详细
export function getInvoice(id) {
return request({
url: '/order/invoice/' + id,
method: 'get'
})
}
// 新增申请开票
export function addInvoice(data) {
return request({
url: '/order/invoice',
method: 'post',
data: data
})
}
// 修改申请开票
export function updateInvoice(data) {
return request({
url: '/order/invoice',
method: 'put',
data: data
})
}
// 删除申请开票
export function delInvoice(id) {
return request({
url: '/order/invoice/' + id,
method: 'delete'
})
}

View File

@@ -0,0 +1,312 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="会员id" prop="memberId">
<el-input
v-model="queryParams.memberId"
placeholder="请输入会员id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="申请订单编号" prop="orderCodes">
<el-input
v-model="queryParams.orderCodes"
placeholder="请输入申请订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开票总金额" prop="totalAmount">
<el-input
v-model="queryParams.totalAmount"
placeholder="请输入开票总金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="总服务费金额" prop="totalServiceAmount">
<el-input
v-model="queryParams.totalServiceAmount"
placeholder="请输入总服务费金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="总电费金额" prop="totalElecAmount">
<el-input
v-model="queryParams.totalElecAmount"
placeholder="请输入总电费金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['order:invoice:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['order:invoice:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['order:invoice:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['order:invoice:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="invoiceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="" align="center" prop="id" />
<el-table-column label="会员id" align="center" prop="memberId" />
<el-table-column label="申请订单编号" align="center" prop="orderCodes" />
<el-table-column label="状态" align="center" prop="status" />
<el-table-column label="开票总金额" align="center" prop="totalAmount" />
<el-table-column label="总服务费金额" align="center" prop="totalServiceAmount" />
<el-table-column label="总电费金额" align="center" prop="totalElecAmount" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['order:invoice:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['order:invoice:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改申请开票对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="会员id" prop="memberId">
<el-input v-model="form.memberId" placeholder="请输入会员id" />
</el-form-item>
<el-form-item label="申请订单编号" prop="orderCodes">
<el-input v-model="form.orderCodes" placeholder="请输入申请订单编号" />
</el-form-item>
<el-form-item label="开票总金额" prop="totalAmount">
<el-input v-model="form.totalAmount" placeholder="请输入开票总金额" />
</el-form-item>
<el-form-item label="总服务费金额" prop="totalServiceAmount">
<el-input v-model="form.totalServiceAmount" placeholder="请输入总服务费金额" />
</el-form-item>
<el-form-item label="总电费金额" prop="totalElecAmount">
<el-input v-model="form.totalElecAmount" placeholder="请输入总电费金额" />
</el-form-item>
<el-form-item label="删除标识" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入删除标识" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listInvoice, getInvoice, delInvoice, addInvoice, updateInvoice } from "@/api/order/invoice";
export default {
name: "Invoice",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 申请开票表格数据
invoiceList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
memberId: null,
orderCodes: null,
status: null,
totalAmount: null,
totalServiceAmount: null,
totalElecAmount: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询申请开票列表 */
getList() {
this.loading = true;
listInvoice(this.queryParams).then(response => {
this.invoiceList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
memberId: null,
orderCodes: null,
status: "0",
totalAmount: null,
totalServiceAmount: null,
totalElecAmount: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加申请开票";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getInvoice(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改申请开票";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateInvoice(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInvoice(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除申请开票编号为"' + ids + '"的数据项?').then(function() {
return delInvoice(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('order/invoice/export', {
...this.queryParams
}, `invoice_${new Date().getTime()}.xlsx`)
}
}
};
</script>