This commit is contained in:
hjc 2019-11-23 18:11:43 +08:00
parent ff25047310
commit 8ac6000605
3 changed files with 35 additions and 33 deletions

View File

@ -124,19 +124,22 @@ public class BssVatInvoiceController {
if (bssVatInvoice.getId() != null) {
BssVatInvoice beBssVatInvoice = bssVatInvoiceService.getById(bssVatInvoice.getId());
EntityBeanUtil.copyProperties(beBssVatInvoice, bssVatInvoice);
}
bssVatInvoice.setSalerTaxInfo(beBssVatInvoice.getSalerTaxInfo());
bssVatInvoice.setBuyTaxInfo(beBssVatInvoice.getBuyTaxInfo());
}else {
if(!StringUtil.isBlank(String.valueOf(bssVatInvoice.getSalerTaxInfoId()))){
bssVatInvoice.setSalerTaxInfo(bssTaxinfoService.getById(bssVatInvoice.getSalerTaxInfoId()));
}
if(!StringUtil.isBlank(String.valueOf(bssVatInvoice.getBuyTaxInfoId()))) {
bssVatInvoice.setBuyTaxInfo(bssTaxinfoService.getById(bssVatInvoice.getBuyTaxInfoId()));
}
List<BssGoods> bssGoods = bssVatInvoice.getBssGoods();
if(bssGoods != null && bssGoods.size() > 0){
bssGoods.stream().forEach(good ->{
good.setVatInvoice(bssVatInvoice);
});
}
}
// 保存数据
bssVatInvoiceService.save(bssVatInvoice);
return ResultVoUtil.SAVE_SUCCESS;

View File

@ -135,8 +135,8 @@ layui.use(['element', 'form', 'layer', 'upload'], function () {
var serializeArray = form.serializeArray();
var _newData = null;
var from = false; // from = true 代表增值税页面请求用设置content-type的请求
for(var i=0; i<serializeArray.length; i++){
if(serializeArray[i].name == 'salerTaxInfoId'){
console.info("本次请求的url是---", url);
if(url == '/bss/vatInvoice/add'){//增值税add页面请求
from = true;
_newData = trans.serialize( serializeArray );
var goods = createGoodsParams();
@ -149,10 +149,9 @@ layui.use(['element', 'form', 'layer', 'upload'], function () {
delete _newData.detailAmount;
delete _newData.taxRate;
delete _newData.goodTaxAmount;
break;
}else {
continue;
}
}else if(url == '/bss/vatInvoice/edit'){//增值税edit页面请求
from = true;
_newData = trans.serialize( serializeArray );
}
if(from){
@ -169,7 +168,7 @@ layui.use(['element', 'form', 'layer', 'upload'], function () {
}
});
}else {
$.post(url, _newData, function(result) {
$.post(url, serializeArray, function(result) {
if (result.data == null) {
result.data = 'submit[refresh]';
}

View File

@ -46,9 +46,9 @@
</tr>
<tr>
<th>购买方纳税人信息</th>
<td th:text="${bssVatInvoice.buyTaxInfo.name}"></td>
<td th:text="${bssVatInvoice.buyTaxInfo?.name}"></td>
<th>销售方纳税人信息</th>
<td th:text="${bssVatInvoice.salerTaxInfo.name}"></td>
<td th:text="${bssVatInvoice.salerTaxInfo?.name}"></td>
</tr>
<tr>
<th>创建时间</th>