开票管理,单条结算单开票
This commit is contained in:
parent
803102f206
commit
b5c134c960
@ -11,11 +11,14 @@ import com.ruoyi.common.enums.BusinessType;
|
|||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.fantang.domain.FtInvoiceDao;
|
import com.ruoyi.system.fantang.domain.FtInvoiceDao;
|
||||||
import com.ruoyi.system.fantang.domain.FtReturnDao;
|
import com.ruoyi.system.fantang.domain.FtReturnDao;
|
||||||
|
import com.ruoyi.system.fantang.domain.FtSettlementDao;
|
||||||
import com.ruoyi.system.fantang.service.IFtInvoiceDaoService;
|
import com.ruoyi.system.fantang.service.IFtInvoiceDaoService;
|
||||||
import com.ruoyi.system.fantang.service.IFtReturnDaoService;
|
import com.ruoyi.system.fantang.service.IFtReturnDaoService;
|
||||||
|
import com.ruoyi.system.fantang.service.IFtSettlementDaoService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -36,7 +39,7 @@ public class FtInvoiceDaoController extends BaseController {
|
|||||||
|
|
||||||
private final IFtInvoiceDaoService iFtInvoiceDaoService;
|
private final IFtInvoiceDaoService iFtInvoiceDaoService;
|
||||||
|
|
||||||
private final IFtReturnDaoService iFtReturnDaoService;
|
private final IFtSettlementDaoService settSettlementDaoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询财务收费开票列表
|
* 查询财务收费开票列表
|
||||||
@ -108,8 +111,8 @@ public class FtInvoiceDaoController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/addToInvoice")
|
@PostMapping("/addToInvoice")
|
||||||
|
@Transactional
|
||||||
public AjaxResult addToInvoice(@RequestBody JSONObject params) {
|
public AjaxResult addToInvoice(@RequestBody JSONObject params) {
|
||||||
System.out.println(params);
|
|
||||||
|
|
||||||
// 应收
|
// 应收
|
||||||
BigDecimal payable = params.getBigDecimal("payable");
|
BigDecimal payable = params.getBigDecimal("payable");
|
||||||
@ -136,13 +139,14 @@ public class FtInvoiceDaoController extends BaseController {
|
|||||||
invoiceDao.setInvoiceName(invoiceName);
|
invoiceDao.setInvoiceName(invoiceName);
|
||||||
invoiceDao.setTaxId(taxId);
|
invoiceDao.setTaxId(taxId);
|
||||||
invoiceDao.setInvoiceType(invoiceType);
|
invoiceDao.setInvoiceType(invoiceType);
|
||||||
|
invoiceDao.setInvoiceAmount(receipts);
|
||||||
iFtInvoiceDaoService.save(invoiceDao);
|
iFtInvoiceDaoService.save(invoiceDao);
|
||||||
//
|
|
||||||
// if (invoiceType == 2) {
|
FtSettlementDao settlementDao = new FtSettlementDao();
|
||||||
// FtReturnDao ftReturnDao = new FtReturnDao();
|
settlementDao.setSettleId(params.getLong("settleId"));
|
||||||
// ftReturnDao.setInvoiceId(invoiceDao.getId());
|
settlementDao.setInvoiceId(invoiceDao.getId());
|
||||||
// iFtReturnDaoService.save(ftReturnDao);
|
settlementDao.setInvoiceFlag(true);
|
||||||
// }
|
settSettlementDaoService.updateById(settlementDao);
|
||||||
|
|
||||||
return AjaxResult.success("已开票");
|
return AjaxResult.success("已开票");
|
||||||
}
|
}
|
||||||
|
@ -39,26 +39,6 @@ public class FtSettlementDaoController extends BaseController {
|
|||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(FtSettlementDao ftSettlementDao) {
|
public TableDataInfo list(FtSettlementDao ftSettlementDao) {
|
||||||
startPage();
|
startPage();
|
||||||
LambdaQueryWrapper<FtSettlementDao> lqw = Wrappers.lambdaQuery(ftSettlementDao);
|
|
||||||
if (ftSettlementDao.getSettleAt() != null) {
|
|
||||||
lqw.eq(FtSettlementDao::getSettleAt, ftSettlementDao.getSettleAt());
|
|
||||||
}
|
|
||||||
if (ftSettlementDao.getPrice() != null) {
|
|
||||||
lqw.eq(FtSettlementDao::getPrice, ftSettlementDao.getPrice());
|
|
||||||
}
|
|
||||||
if (ftSettlementDao.getPayable() != null) {
|
|
||||||
lqw.eq(FtSettlementDao::getPayable, ftSettlementDao.getPayable());
|
|
||||||
}
|
|
||||||
if (ftSettlementDao.getReceipts() != null) {
|
|
||||||
lqw.eq(FtSettlementDao::getReceipts, ftSettlementDao.getReceipts());
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(ftSettlementDao.getType())) {
|
|
||||||
lqw.eq(FtSettlementDao::getType, ftSettlementDao.getType());
|
|
||||||
}
|
|
||||||
if (ftSettlementDao.getRefund() != null) {
|
|
||||||
lqw.eq(FtSettlementDao::getRefund, ftSettlementDao.getRefund());
|
|
||||||
}
|
|
||||||
// List<FtSettlementDao> list = iFtSettlementDaoService.list(lqw);
|
|
||||||
List<FtSettlementDao> list = iFtSettlementDaoService.listWithPatient(ftSettlementDao);
|
List<FtSettlementDao> list = iFtSettlementDaoService.listWithPatient(ftSettlementDao);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.system.fantang.domain;
|
package com.ruoyi.system.fantang.domain;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
@ -98,4 +99,14 @@ public class FtSettlementDao implements Serializable {
|
|||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String beginOfDay;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String endOfDay;
|
||||||
|
|
||||||
|
private Long invoiceId;
|
||||||
|
|
||||||
|
private Boolean invoiceFlag;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
package com.ruoyi.system.fantang.service.impl;
|
package com.ruoyi.system.fantang.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ruoyi.system.fantang.domain.FtSettlementDao;
|
import com.ruoyi.system.fantang.domain.FtSettlementDao;
|
||||||
import com.ruoyi.system.fantang.mapper.FtSettlementDaoMapper;
|
import com.ruoyi.system.fantang.mapper.FtSettlementDaoMapper;
|
||||||
import com.ruoyi.system.fantang.service.IFtSettlementDaoService;
|
import com.ruoyi.system.fantang.service.IFtSettlementDaoService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -19,6 +23,16 @@ public class FtSettlementDaoServiceImpl extends ServiceImpl<FtSettlementDaoMappe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FtSettlementDao> listWithPatient(FtSettlementDao ftSettlementDao) {
|
public List<FtSettlementDao> listWithPatient(FtSettlementDao ftSettlementDao) {
|
||||||
|
|
||||||
|
Date settleAt = ftSettlementDao.getSettleAt();
|
||||||
|
if (settleAt != null) {
|
||||||
|
DateTime beginOfDay = DateUtil.beginOfDay(settleAt);
|
||||||
|
DateTime endOfDay = DateUtil.endOfDay(settleAt);
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
ftSettlementDao.setBeginOfDay(sdf.format(beginOfDay));
|
||||||
|
ftSettlementDao.setEndOfDay(sdf.format(endOfDay));
|
||||||
|
}
|
||||||
|
|
||||||
return this.baseMapper.listWithPatient(ftSettlementDao);
|
return this.baseMapper.listWithPatient(ftSettlementDao);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
<result property="type" column="type"/>
|
<result property="type" column="type"/>
|
||||||
<result property="flag" column="flag"/>
|
<result property="flag" column="flag"/>
|
||||||
<result property="refund" column="refund"/>
|
<result property="refund" column="refund"/>
|
||||||
|
<result property="invoiceId" column="invoice_id"/>
|
||||||
|
<result property="invoiceFlag" column="invoice_flag"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="listWithPatient" resultType="com.ruoyi.system.fantang.domain.FtSettlementDao">
|
<select id="listWithPatient" resultType="com.ruoyi.system.fantang.domain.FtSettlementDao">
|
||||||
@ -24,8 +26,10 @@
|
|||||||
FROM ft_settle a
|
FROM ft_settle a
|
||||||
LEFT JOIN ft_patient b ON b.patient_id = a.patient_id
|
LEFT JOIN ft_patient b ON b.patient_id = a.patient_id
|
||||||
<where>
|
<where>
|
||||||
<if test="settleAt != null and settleAt !=''">and a.settle_at = #{settleAt}</if>
|
<if test="beginOfDay != null and beginOfDay !=''">settle_at BETWEEN #{beginOfDay}</if>
|
||||||
|
<if test="endOfDay != null and endOfDay !=''">AND #{endOfDay}</if>
|
||||||
<if test="type != null and type !=''">and a.type = #{type}</if>
|
<if test="type != null and type !=''">and a.type = #{type}</if>
|
||||||
|
<if test="invoiceFlag != null and invoiceFlag !=''">and a.invoice_flag = #{invoiceFlag}</if>
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
@ -9,24 +9,6 @@
|
|||||||
placeholder="选择结算日期">
|
placeholder="选择结算日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="应收" prop="payable">-->
|
|
||||||
<!-- <el-input-->
|
|
||||||
<!-- v-model="queryParams.payable"-->
|
|
||||||
<!-- placeholder="请输入应收"-->
|
|
||||||
<!-- clearable-->
|
|
||||||
<!-- size="small"-->
|
|
||||||
<!-- @keyup.enter.native="handleQuery"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- <el-form-item label="实收" prop="receipts">-->
|
|
||||||
<!-- <el-input-->
|
|
||||||
<!-- v-model="queryParams.receipts"-->
|
|
||||||
<!-- placeholder="请输入实收"-->
|
|
||||||
<!-- clearable-->
|
|
||||||
<!-- size="small"-->
|
|
||||||
<!-- @keyup.enter.native="handleQuery"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<el-form-item label="结算类型" prop="type">
|
<el-form-item label="结算类型" prop="type">
|
||||||
<el-select v-model="queryParams.type" placeholder="请选择结算类型" clearable size="small">
|
<el-select v-model="queryParams.type" placeholder="请选择结算类型" clearable size="small">
|
||||||
<el-option
|
<el-option
|
||||||
@ -37,15 +19,16 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="退款总额" prop="refund">-->
|
<el-form-item label="已开票" prop="invoiceFlag">
|
||||||
<!-- <el-input-->
|
<el-select v-model="queryParams.invoiceFlag" placeholder="请选择已开票" clearable size="small">
|
||||||
<!-- v-model="queryParams.refund"-->
|
<el-option
|
||||||
<!-- placeholder="请输入退款总额"-->
|
v-for="item in invoiceFlagOptions"
|
||||||
<!-- clearable-->
|
:key="item.value"
|
||||||
<!-- size="small"-->
|
:label="item.label"
|
||||||
<!-- @keyup.enter.native="handleQuery"-->
|
:value="item.value">
|
||||||
<!-- />-->
|
</el-option>
|
||||||
<!-- </el-form-item>-->
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
@ -53,36 +36,15 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<!-- <el-col :span="1.5">-->
|
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- type="primary"-->
|
|
||||||
<!-- icon="el-icon-plus"-->
|
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- @click="handleAdd"-->
|
|
||||||
<!-- v-hasPermi="['fantang:settlement:add']"-->
|
|
||||||
<!-- >新增-->
|
|
||||||
<!-- </el-button>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['fantang:settlement:edit']"
|
|
||||||
>开票
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click=""
|
||||||
v-hasPermi="['fantang:settlement:remove']"
|
v-hasPermi="['fantang:settlement:edit']"
|
||||||
>删除
|
>组合开票
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@ -110,6 +72,7 @@
|
|||||||
<span>{{ parseTime(scope.row.settleAt, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.settleAt, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="已开票" align="center" prop="invoiceFlag" :formatter="formatInvoiceFlag"/>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@ -118,16 +81,9 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['fantang:settlement:edit']"
|
v-hasPermi="['fantang:settlement:edit']"
|
||||||
|
v-if="!scope.row.invoiceFlag"
|
||||||
>开票
|
>开票
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['fantang:settlement:remove']"
|
|
||||||
>删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -143,12 +99,6 @@
|
|||||||
<!-- 添加或修改结算管理对话框 -->
|
<!-- 添加或修改结算管理对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<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 ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<!-- <el-form-item label="记录清单" prop="list">-->
|
|
||||||
<!-- <el-input v-model="form.list" placeholder="请输入记录清单" />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- <el-form-item label="结算总价" prop="price">-->
|
|
||||||
<!-- <el-input v-model="form.price" placeholder="请输入结算总价" />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<el-form-item label="应收" prop="payable">
|
<el-form-item label="应收" prop="payable">
|
||||||
<el-input v-model="form.payable" placeholder="请输入应收" :disabled="true"/>
|
<el-input v-model="form.payable" placeholder="请输入应收" :disabled="true"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -177,9 +127,6 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="退款总额" prop="refund">-->
|
|
||||||
<!-- <el-input v-model="form.refund" placeholder="请输入退款总额"/>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
@ -190,8 +137,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {addSettlement, delSettlement, exportSettlement, listSettlement} from "@/api/fantang/settlement";
|
import {
|
||||||
import {getSettlement} from "../../../api/fantang/settlement";
|
addSettlement,
|
||||||
|
delSettlement,
|
||||||
|
exportSettlement,
|
||||||
|
getSettlement,
|
||||||
|
listSettlement
|
||||||
|
} from "../../../api/fantang/settlement";
|
||||||
import {addToInvoice} from "../../../api/fantang/invoice";
|
import {addToInvoice} from "../../../api/fantang/invoice";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -206,6 +158,13 @@ export default {
|
|||||||
value: 2,
|
value: 2,
|
||||||
label: '挂账'
|
label: '挂账'
|
||||||
}],
|
}],
|
||||||
|
invoiceFlagOptions: [{
|
||||||
|
value: true,
|
||||||
|
label: '是'
|
||||||
|
}, {
|
||||||
|
value: false,
|
||||||
|
label: '否'
|
||||||
|
}],
|
||||||
typeOptions: [{
|
typeOptions: [{
|
||||||
value: '现金',
|
value: '现金',
|
||||||
label: '现金'
|
label: '现金'
|
||||||
@ -249,7 +208,8 @@ export default {
|
|||||||
payable: undefined,
|
payable: undefined,
|
||||||
receipts: undefined,
|
receipts: undefined,
|
||||||
type: undefined,
|
type: undefined,
|
||||||
refund: undefined
|
refund: undefined,
|
||||||
|
invoiceFlag: undefined,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
@ -292,10 +252,18 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formatInvoiceFlag(row) {
|
||||||
|
if (row.invoiceFlag === true) {
|
||||||
|
return '是';
|
||||||
|
} else {
|
||||||
|
return '否';
|
||||||
|
}
|
||||||
|
},
|
||||||
/** 查询结算管理列表 */
|
/** 查询结算管理列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listSettlement(this.queryParams).then(response => {
|
listSettlement(this.queryParams).then(response => {
|
||||||
|
console.log(response)
|
||||||
this.settlementList = response.rows;
|
this.settlementList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user