liuxiaoxu
1 month ago
9 changed files with 0 additions and 3411 deletions
@ -1,244 +0,0 @@ |
|||||
package com.ruoyi.taxInvoice.controller; |
|
||||
|
|
||||
import com.alibaba.excel.EasyExcel; |
|
||||
import com.alibaba.excel.ExcelWriter; |
|
||||
import com.alibaba.excel.util.MapUtils; |
|
||||
import com.alibaba.excel.write.metadata.WriteSheet; |
|
||||
import com.alibaba.excel.write.metadata.fill.FillConfig; |
|
||||
import com.alibaba.fastjson.JSONArray; |
|
||||
import com.alibaba.fastjson.JSONObject; |
|
||||
import com.ruoyi.common.annotation.Log; |
|
||||
import com.ruoyi.common.core.controller.BaseController; |
|
||||
import com.ruoyi.common.core.domain.AjaxResult; |
|
||||
import com.ruoyi.common.core.page.TableDataInfo; |
|
||||
import com.ruoyi.common.enums.BusinessType; |
|
||||
import com.ruoyi.system.domain.SysCustomer; |
|
||||
import com.ruoyi.system.domain.SysCustomerVo; |
|
||||
import com.ruoyi.system.service.ISysCustomerService; |
|
||||
import com.ruoyi.taxInvoice.domain.TaxInvoiceInfo; |
|
||||
import com.ruoyi.taxInvoice.domain.TaxInvoiceProduct; |
|
||||
import com.ruoyi.taxInvoice.domain.exportDto.TaxInvoiceInfoDto; |
|
||||
import com.ruoyi.taxInvoice.domain.exportDto.TaxInvoiceProductDto; |
|
||||
import com.ruoyi.taxInvoice.service.ITaxInvoiceInfoService; |
|
||||
import com.ruoyi.taxInvoice.service.ITaxInvoiceProductService; |
|
||||
import com.ruoyi.taxInvoice.utils.CNNumberFormat; |
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
||||
import org.springframework.beans.BeanUtils; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.stereotype.Controller; |
|
||||
import org.springframework.ui.ModelMap; |
|
||||
import org.springframework.web.bind.annotation.*; |
|
||||
|
|
||||
import javax.servlet.http.HttpServletResponse; |
|
||||
import java.io.IOException; |
|
||||
import java.net.URLEncoder; |
|
||||
import java.util.ArrayList; |
|
||||
import java.util.Iterator; |
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
|
|
||||
import static com.ruoyi.common.config.datasource.DynamicDataSourceContextHolder.log; |
|
||||
|
|
||||
/** |
|
||||
* 国税发票Controller |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2023-02-09 |
|
||||
*/ |
|
||||
@Controller |
|
||||
@RequestMapping("/taxInvoice/taxInvoiceInfo") |
|
||||
public class TaxInvoiceInfoController extends BaseController |
|
||||
{ |
|
||||
private String prefix = "taxInvoice/taxInvoiceInfo"; |
|
||||
|
|
||||
@Autowired |
|
||||
private ITaxInvoiceInfoService taxInvoiceInfoService; |
|
||||
@Autowired |
|
||||
private ITaxInvoiceProductService taxInvoiceProductService; |
|
||||
|
|
||||
@Autowired |
|
||||
private ISysCustomerService customerService; |
|
||||
|
|
||||
@RequiresPermissions("taxInvoice:taxInvoiceInfo:view") |
|
||||
@GetMapping() |
|
||||
public String taxInvoiceInfo() |
|
||||
{ |
|
||||
return prefix + "/taxInvoiceInfo"; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 查询国税发票列表 |
|
||||
*/ |
|
||||
@RequiresPermissions("taxInvoice:taxInvoiceInfo:list") |
|
||||
@PostMapping("/list") |
|
||||
@ResponseBody |
|
||||
public TableDataInfo list(TaxInvoiceInfo taxInvoiceInfo) |
|
||||
{ |
|
||||
startPage(); |
|
||||
List<TaxInvoiceInfo> list = taxInvoiceInfoService.selectTaxInvoiceInfoList(taxInvoiceInfo); |
|
||||
return getDataTable(list); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 导出国税发票列表 |
|
||||
*/ |
|
||||
/*@RequiresPermissions("taxInvoice:taxInvoiceInfo:export") |
|
||||
@Log(title = "国税发票", businessType = BusinessType.EXPORT) |
|
||||
@PostMapping("/export") |
|
||||
@ResponseBody |
|
||||
public AjaxResult export(TaxInvoiceInfo taxInvoiceInfo) |
|
||||
{ |
|
||||
List<TaxInvoiceInfo> list = taxInvoiceInfoService.selectTaxInvoiceInfoList(taxInvoiceInfo); |
|
||||
ExcelUtil<TaxInvoiceInfo> util = new ExcelUtil<TaxInvoiceInfo>(TaxInvoiceInfo.class); |
|
||||
return util.exportExcel(list, "国税发票数据"); |
|
||||
}*/ |
|
||||
|
|
||||
/** |
|
||||
* 新增国税发票 |
|
||||
*/ |
|
||||
@GetMapping("/add") |
|
||||
public String add() |
|
||||
{ |
|
||||
return prefix + "/add"; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 新增保存国税发票 |
|
||||
*/ |
|
||||
@RequiresPermissions("taxInvoice:taxInvoiceInfo:add") |
|
||||
@Log(title = "国税发票", businessType = BusinessType.INSERT) |
|
||||
@PostMapping("/add") |
|
||||
@ResponseBody |
|
||||
public AjaxResult addSave(TaxInvoiceInfo taxInvoiceInfo) |
|
||||
{ |
|
||||
return toAjax(taxInvoiceInfoService.insertTaxInvoiceInfo(taxInvoiceInfo)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改国税发票 |
|
||||
*/ |
|
||||
@GetMapping("/edit/{taxInvoiceId}") |
|
||||
public String edit(@PathVariable("taxInvoiceId") Long taxInvoiceId, ModelMap mmap) |
|
||||
{ |
|
||||
TaxInvoiceInfo taxInvoiceInfo = taxInvoiceInfoService.selectTaxInvoiceInfoById(taxInvoiceId); |
|
||||
mmap.put("taxInvoiceInfo", taxInvoiceInfo); |
|
||||
return prefix + "/edit"; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改保存国税发票 |
|
||||
*/ |
|
||||
@RequiresPermissions("taxInvoice:taxInvoiceInfo:edit") |
|
||||
@Log(title = "国税发票", businessType = BusinessType.UPDATE) |
|
||||
@PostMapping("/edit") |
|
||||
@ResponseBody |
|
||||
public AjaxResult editSave(TaxInvoiceInfo taxInvoiceInfo) |
|
||||
{ |
|
||||
return toAjax(taxInvoiceInfoService.updateTaxInvoiceInfo(taxInvoiceInfo)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除国税发票 |
|
||||
*/ |
|
||||
@RequiresPermissions("taxInvoice:taxInvoiceInfo:removeSelectedInvoice") |
|
||||
@Log(title = "国税发票", businessType = BusinessType.DELETE) |
|
||||
@PostMapping( "/remove") |
|
||||
@ResponseBody |
|
||||
public AjaxResult remove(String ids) |
|
||||
{ |
|
||||
return toAjax(taxInvoiceInfoService.deleteTaxInvoiceInfoByIds(ids)); |
|
||||
} |
|
||||
|
|
||||
//获取客户信息
|
|
||||
@PostMapping("/getCustomerList") |
|
||||
@ResponseBody |
|
||||
public List<SysCustomerVo> getCustomerList(SysCustomerVo customer) { |
|
||||
List<SysCustomerVo> list = customerService.selectSysCustomerList(customer); |
|
||||
return list; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@RequiresPermissions("taxInvoice:taxInvoiceInfo:exportInvoice") |
|
||||
@Log(title = "国税发票", businessType = BusinessType.EXPORT) |
|
||||
@RequestMapping("/exportInvoice") |
|
||||
@ResponseBody |
|
||||
public void exportInvoice(@RequestBody String selectData, HttpServletResponse response) throws IOException { |
|
||||
|
|
||||
//数据处理
|
|
||||
JSONObject jsonObject = (JSONObject) JSONObject.parse(selectData); |
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("selectData"); |
|
||||
List<TaxInvoiceInfoDto> selectDataList = JSONObject.parseArray(String.valueOf(jsonArray), TaxInvoiceInfoDto.class); |
|
||||
|
|
||||
|
|
||||
//获取发票基础信息
|
|
||||
TaxInvoiceInfo taxInvoiceInfo = taxInvoiceInfoService.selectTaxInvoiceInfoById(selectDataList.get(0).getTaxInvoiceId()); |
|
||||
TaxInvoiceInfoDto taxInvoiceInfoDto = new TaxInvoiceInfoDto(); |
|
||||
BeanUtils.copyProperties(taxInvoiceInfo,taxInvoiceInfoDto); |
|
||||
|
|
||||
//发票内产品信息
|
|
||||
List<TaxInvoiceProduct> taxInvoiceProductList = taxInvoiceProductService.selectTaxInvoiceByCodeAndNumber(selectDataList.get(0).getTaxInvoiceCode(),selectDataList.get(0).getTaxInvoiceNumber()); |
|
||||
List<TaxInvoiceProductDto> taxInvoiceProductDtoList = new ArrayList<>(); |
|
||||
try { |
|
||||
Iterator values= taxInvoiceProductList.iterator(); |
|
||||
while(values.hasNext()) { |
|
||||
Object source = values.next(); |
|
||||
TaxInvoiceProductDto target = TaxInvoiceProductDto.class.newInstance(); |
|
||||
BeanUtils.copyProperties(source, target); |
|
||||
taxInvoiceProductDtoList.add(target); |
|
||||
} |
|
||||
}catch (Exception e) { |
|
||||
log.error(">>>>>>异常<<<<<<", e); |
|
||||
} |
|
||||
|
|
||||
//合计数量、金额
|
|
||||
int totalQuantity = 0; |
|
||||
double totalMoney = 0; |
|
||||
for (int i = 0;i<taxInvoiceProductDtoList.size();i++) { |
|
||||
totalQuantity = totalQuantity + Integer.parseInt(taxInvoiceProductDtoList.get(i).getQuantity()); |
|
||||
totalMoney = totalMoney + Double.parseDouble((taxInvoiceProductDtoList.get(i).getAmountOfMoney())); |
|
||||
} |
|
||||
|
|
||||
//大写转换
|
|
||||
CNNumberFormat cnFmt = new CNNumberFormat(true); |
|
||||
String moneyUpCase = cnFmt.format(totalMoney); |
|
||||
|
|
||||
//填充表格
|
|
||||
response.setCharacterEncoding("utf-8"); |
|
||||
String fileName = URLEncoder.encode("国税发票", "UTF-8").replaceAll("\\+", "%20"); |
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
|
||||
String templateFileName = "C:\\exportTemplates\\exportTaxInvoice.xlsx"; |
|
||||
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), TaxInvoiceProductDto.class).withTemplate(templateFileName).build()) { |
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet().build(); |
|
||||
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); |
|
||||
excelWriter.fill(taxInvoiceProductDtoList, fillConfig, writeSheet); |
|
||||
Map<String, Object> map = MapUtils.newHashMap(); |
|
||||
// map.put("date", DateTimeFormatter.ofPattern("yyyy/MM/dd").format(LocalDateTime.now()));
|
|
||||
map.put("deliveryNoteNumber", taxInvoiceInfoDto.getDeliveryNoteNumber()); |
|
||||
map.put("taxInvoiceNumber", taxInvoiceInfoDto.getTaxInvoiceNumber()); |
|
||||
map.put("contractNumber", taxInvoiceInfoDto.getContractNumber()); |
|
||||
map.put("enterpriseCode", taxInvoiceInfoDto.getEnterpriseCode()); |
|
||||
map.put("enterpriseName", taxInvoiceInfoDto.getEnterpriseName()); |
|
||||
map.put("arrivalArea", taxInvoiceInfoDto.getArrivalArea()); |
|
||||
map.put("paymentTerm", taxInvoiceInfoDto.getPaymentTerm()); |
|
||||
map.put("billingDate", taxInvoiceInfoDto.getBillingDate()); |
|
||||
map.put("totalQuantity", totalQuantity); |
|
||||
map.put("totalMoney", totalMoney); |
|
||||
map.put("moneyUpCase", moneyUpCase); |
|
||||
excelWriter.fill(map, writeSheet); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* |
|
||||
数字转大写 |
|
||||
*/ |
|
||||
@RequestMapping("/getMoneyUpCase") |
|
||||
@ResponseBody |
|
||||
public String getMoneyUpCase(@RequestParam("totalMoney") double totalMoney) { |
|
||||
CNNumberFormat cnFmt = new CNNumberFormat(true); |
|
||||
String moneyUpCase = cnFmt.format(totalMoney); |
|
||||
return moneyUpCase; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
@ -1,387 +0,0 @@ |
|||||
package com.ruoyi.taxInvoice.domain; |
|
||||
|
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|
||||
import org.apache.commons.lang3.builder.ToStringStyle; |
|
||||
import com.ruoyi.common.annotation.Excel; |
|
||||
import com.ruoyi.common.core.domain.BaseEntity; |
|
||||
|
|
||||
/** |
|
||||
* 国税发票对象 tax_invoice_info |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2023-02-09 |
|
||||
*/ |
|
||||
public class TaxInvoiceInfo extends BaseEntity |
|
||||
{ |
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
/** 国税发票id */ |
|
||||
private Long taxInvoiceId; |
|
||||
|
|
||||
/** 发票编号 */ |
|
||||
@Excel(name = "发票编号") |
|
||||
private String taxInvoiceCode; |
|
||||
|
|
||||
/** 发票号码 */ |
|
||||
@Excel(name = "发票号码") |
|
||||
private String taxInvoiceNumber; |
|
||||
|
|
||||
/** 送货单号 */ |
|
||||
@Excel(name = "送货单号") |
|
||||
private String deliveryNoteNumber; |
|
||||
|
|
||||
/** 客户代码 */ |
|
||||
@Excel(name = "客户代码") |
|
||||
private String enterpriseCode; |
|
||||
|
|
||||
/** 客户名称 */ |
|
||||
@Excel(name = "客户名称") |
|
||||
private String enterpriseName; |
|
||||
|
|
||||
/** 合同号码 */ |
|
||||
@Excel(name = "合同号码") |
|
||||
private String contractNumber; |
|
||||
|
|
||||
/** 付款条件 */ |
|
||||
@Excel(name = "付款条件") |
|
||||
private String paymentTerm; |
|
||||
|
|
||||
/** 开票日期 */ |
|
||||
@Excel(name = "开票日期") |
|
||||
private String billingDate; |
|
||||
|
|
||||
/** 运输方式 */ |
|
||||
@Excel(name = "运输方式") |
|
||||
private String transportWay; |
|
||||
|
|
||||
/** 运输工具 */ |
|
||||
@Excel(name = "运输工具") |
|
||||
private String transportMeans; |
|
||||
|
|
||||
/** 离境日期 */ |
|
||||
@Excel(name = "离境日期") |
|
||||
private String departureDate; |
|
||||
|
|
||||
/** 出口海关 */ |
|
||||
@Excel(name = "出口海关") |
|
||||
private String exportCustoms; |
|
||||
|
|
||||
/** 币别 */ |
|
||||
@Excel(name = "币别") |
|
||||
private String billCommonCurrency; |
|
||||
|
|
||||
/** 件数(箱数) */ |
|
||||
@Excel(name = "件数", readConverterExp = "箱=数") |
|
||||
private String packagesNumber; |
|
||||
|
|
||||
/** 抵运国(地区) */ |
|
||||
@Excel(name = "抵运国", readConverterExp = "地=区") |
|
||||
private String arrivalArea; |
|
||||
|
|
||||
/** 指运港 */ |
|
||||
@Excel(name = "指运港") |
|
||||
private String portOfDestination; |
|
||||
|
|
||||
/** 提运单号 */ |
|
||||
@Excel(name = "提运单号") |
|
||||
private String hoistingNumber; |
|
||||
|
|
||||
/** 发票印字版号 */ |
|
||||
@Excel(name = "发票印字版号") |
|
||||
private String printVersionNumber; |
|
||||
|
|
||||
/** 备注 */ |
|
||||
@Excel(name = "备注") |
|
||||
private String billRemarks; |
|
||||
|
|
||||
/** 国税发票编号 */ |
|
||||
@Excel(name = "国税发票编号") |
|
||||
private String taxInvoiceNo; |
|
||||
|
|
||||
/** 是否收到款 */ |
|
||||
@Excel(name = "是否收到款") |
|
||||
private String getmoneyFlag; |
|
||||
|
|
||||
|
|
||||
/** 录入时间 */ |
|
||||
@Excel(name = "录入时间") |
|
||||
private String firstAddTime; |
|
||||
|
|
||||
/** 修改时间 */ |
|
||||
@Excel(name = "修改时间") |
|
||||
private String updateInfoTime; |
|
||||
|
|
||||
|
|
||||
/** 备用一 */ |
|
||||
@Excel(name = "备用一") |
|
||||
private String standbyOne; |
|
||||
|
|
||||
/** 备用二 */ |
|
||||
@Excel(name = "备用二") |
|
||||
private String standbyTwo; |
|
||||
|
|
||||
public void setTaxInvoiceId(Long taxInvoiceId) |
|
||||
{ |
|
||||
this.taxInvoiceId = taxInvoiceId; |
|
||||
} |
|
||||
|
|
||||
public Long getTaxInvoiceId() |
|
||||
{ |
|
||||
return taxInvoiceId; |
|
||||
} |
|
||||
public void setTaxInvoiceCode(String taxInvoiceCode) |
|
||||
{ |
|
||||
this.taxInvoiceCode = taxInvoiceCode; |
|
||||
} |
|
||||
|
|
||||
public String getTaxInvoiceCode() |
|
||||
{ |
|
||||
return taxInvoiceCode; |
|
||||
} |
|
||||
public void setTaxInvoiceNumber(String taxInvoiceNumber) |
|
||||
{ |
|
||||
this.taxInvoiceNumber = taxInvoiceNumber; |
|
||||
} |
|
||||
|
|
||||
public String getTaxInvoiceNumber() |
|
||||
{ |
|
||||
return taxInvoiceNumber; |
|
||||
} |
|
||||
public void setDeliveryNoteNumber(String deliveryNoteNumber) |
|
||||
{ |
|
||||
this.deliveryNoteNumber = deliveryNoteNumber; |
|
||||
} |
|
||||
|
|
||||
public String getDeliveryNoteNumber() |
|
||||
{ |
|
||||
return deliveryNoteNumber; |
|
||||
} |
|
||||
public void setEnterpriseCode(String enterpriseCode) |
|
||||
{ |
|
||||
this.enterpriseCode = enterpriseCode; |
|
||||
} |
|
||||
|
|
||||
public String getEnterpriseCode() |
|
||||
{ |
|
||||
return enterpriseCode; |
|
||||
} |
|
||||
public void setEnterpriseName(String enterpriseName) |
|
||||
{ |
|
||||
this.enterpriseName = enterpriseName; |
|
||||
} |
|
||||
|
|
||||
public String getEnterpriseName() |
|
||||
{ |
|
||||
return enterpriseName; |
|
||||
} |
|
||||
public void setContractNumber(String contractNumber) |
|
||||
{ |
|
||||
this.contractNumber = contractNumber; |
|
||||
} |
|
||||
|
|
||||
public String getContractNumber() |
|
||||
{ |
|
||||
return contractNumber; |
|
||||
} |
|
||||
public void setPaymentTerm(String paymentTerm) |
|
||||
{ |
|
||||
this.paymentTerm = paymentTerm; |
|
||||
} |
|
||||
|
|
||||
public String getPaymentTerm() |
|
||||
{ |
|
||||
return paymentTerm; |
|
||||
} |
|
||||
public void setBillingDate(String billingDate) |
|
||||
{ |
|
||||
this.billingDate = billingDate; |
|
||||
} |
|
||||
|
|
||||
public String getBillingDate() |
|
||||
{ |
|
||||
return billingDate; |
|
||||
} |
|
||||
public void setTransportWay(String transportWay) |
|
||||
{ |
|
||||
this.transportWay = transportWay; |
|
||||
} |
|
||||
|
|
||||
public String getTransportWay() |
|
||||
{ |
|
||||
return transportWay; |
|
||||
} |
|
||||
public void setTransportMeans(String transportMeans) |
|
||||
{ |
|
||||
this.transportMeans = transportMeans; |
|
||||
} |
|
||||
|
|
||||
public String getTransportMeans() |
|
||||
{ |
|
||||
return transportMeans; |
|
||||
} |
|
||||
public void setDepartureDate(String departureDate) |
|
||||
{ |
|
||||
this.departureDate = departureDate; |
|
||||
} |
|
||||
|
|
||||
public String getDepartureDate() |
|
||||
{ |
|
||||
return departureDate; |
|
||||
} |
|
||||
public void setExportCustoms(String exportCustoms) |
|
||||
{ |
|
||||
this.exportCustoms = exportCustoms; |
|
||||
} |
|
||||
|
|
||||
public String getExportCustoms() |
|
||||
{ |
|
||||
return exportCustoms; |
|
||||
} |
|
||||
public void setBillCommonCurrency(String billCommonCurrency) |
|
||||
{ |
|
||||
this.billCommonCurrency = billCommonCurrency; |
|
||||
} |
|
||||
|
|
||||
public String getBillCommonCurrency() |
|
||||
{ |
|
||||
return billCommonCurrency; |
|
||||
} |
|
||||
public void setPackagesNumber(String packagesNumber) |
|
||||
{ |
|
||||
this.packagesNumber = packagesNumber; |
|
||||
} |
|
||||
|
|
||||
public String getPackagesNumber() |
|
||||
{ |
|
||||
return packagesNumber; |
|
||||
} |
|
||||
public void setArrivalArea(String arrivalArea) |
|
||||
{ |
|
||||
this.arrivalArea = arrivalArea; |
|
||||
} |
|
||||
|
|
||||
public String getArrivalArea() |
|
||||
{ |
|
||||
return arrivalArea; |
|
||||
} |
|
||||
public void setPortOfDestination(String portOfDestination) |
|
||||
{ |
|
||||
this.portOfDestination = portOfDestination; |
|
||||
} |
|
||||
|
|
||||
public String getPortOfDestination() |
|
||||
{ |
|
||||
return portOfDestination; |
|
||||
} |
|
||||
public void setHoistingNumber(String hoistingNumber) |
|
||||
{ |
|
||||
this.hoistingNumber = hoistingNumber; |
|
||||
} |
|
||||
|
|
||||
public String getHoistingNumber() |
|
||||
{ |
|
||||
return hoistingNumber; |
|
||||
} |
|
||||
public void setPrintVersionNumber(String printVersionNumber) |
|
||||
{ |
|
||||
this.printVersionNumber = printVersionNumber; |
|
||||
} |
|
||||
|
|
||||
public String getPrintVersionNumber() |
|
||||
{ |
|
||||
return printVersionNumber; |
|
||||
} |
|
||||
public void setBillRemarks(String billRemarks) |
|
||||
{ |
|
||||
this.billRemarks = billRemarks; |
|
||||
} |
|
||||
|
|
||||
public String getBillRemarks() |
|
||||
{ |
|
||||
return billRemarks; |
|
||||
} |
|
||||
public void setTaxInvoiceNo(String taxInvoiceNo) |
|
||||
{ |
|
||||
this.taxInvoiceNo = taxInvoiceNo; |
|
||||
} |
|
||||
|
|
||||
public String getTaxInvoiceNo() |
|
||||
{ |
|
||||
return taxInvoiceNo; |
|
||||
} |
|
||||
public void setGetmoneyFlag(String getmoneyFlag) |
|
||||
{ |
|
||||
this.getmoneyFlag = getmoneyFlag; |
|
||||
} |
|
||||
|
|
||||
public String getGetmoneyFlag() |
|
||||
{ |
|
||||
return getmoneyFlag; |
|
||||
} |
|
||||
public void setStandbyOne(String standbyOne) |
|
||||
{ |
|
||||
this.standbyOne = standbyOne; |
|
||||
} |
|
||||
|
|
||||
public String getStandbyOne() |
|
||||
{ |
|
||||
return standbyOne; |
|
||||
} |
|
||||
public void setStandbyTwo(String standbyTwo) |
|
||||
{ |
|
||||
this.standbyTwo = standbyTwo; |
|
||||
} |
|
||||
|
|
||||
public String getStandbyTwo() |
|
||||
{ |
|
||||
return standbyTwo; |
|
||||
} |
|
||||
|
|
||||
public String getFirstAddTime() { |
|
||||
return firstAddTime; |
|
||||
} |
|
||||
|
|
||||
public void setFirstAddTime(String firstAddTime) { |
|
||||
this.firstAddTime = firstAddTime; |
|
||||
} |
|
||||
|
|
||||
public String getUpdateInfoTime() { |
|
||||
return updateInfoTime; |
|
||||
} |
|
||||
|
|
||||
public void setUpdateInfoTime(String updateInfoTime) { |
|
||||
this.updateInfoTime = updateInfoTime; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|
||||
.append("taxInvoiceId", getTaxInvoiceId()) |
|
||||
.append("taxInvoiceCode", getTaxInvoiceCode()) |
|
||||
.append("taxInvoiceNumber", getTaxInvoiceNumber()) |
|
||||
.append("deliveryNoteNumber", getDeliveryNoteNumber()) |
|
||||
.append("enterpriseCode", getEnterpriseCode()) |
|
||||
.append("enterpriseName", getEnterpriseName()) |
|
||||
.append("contractNumber", getContractNumber()) |
|
||||
.append("paymentTerm", getPaymentTerm()) |
|
||||
.append("billingDate", getBillingDate()) |
|
||||
.append("transportWay", getTransportWay()) |
|
||||
.append("transportMeans", getTransportMeans()) |
|
||||
.append("departureDate", getDepartureDate()) |
|
||||
.append("exportCustoms", getExportCustoms()) |
|
||||
.append("billCommonCurrency", getBillCommonCurrency()) |
|
||||
.append("packagesNumber", getPackagesNumber()) |
|
||||
.append("arrivalArea", getArrivalArea()) |
|
||||
.append("portOfDestination", getPortOfDestination()) |
|
||||
.append("hoistingNumber", getHoistingNumber()) |
|
||||
.append("printVersionNumber", getPrintVersionNumber()) |
|
||||
.append("billRemarks", getBillRemarks()) |
|
||||
.append("taxInvoiceNo", getTaxInvoiceNo()) |
|
||||
.append("getmoneyFlag", getGetmoneyFlag()) |
|
||||
.append("firstAddTime", getFirstAddTime()) |
|
||||
.append("updateInfoTime", getUpdateInfoTime()) |
|
||||
.append("standbyOne", getStandbyOne()) |
|
||||
.append("standbyTwo", getStandbyTwo()) |
|
||||
.toString(); |
|
||||
} |
|
||||
} |
|
@ -1,61 +0,0 @@ |
|||||
package com.ruoyi.taxInvoice.mapper; |
|
||||
|
|
||||
import java.util.List; |
|
||||
import com.ruoyi.taxInvoice.domain.TaxInvoiceInfo; |
|
||||
|
|
||||
/** |
|
||||
* 国税发票Mapper接口 |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2023-02-09 |
|
||||
*/ |
|
||||
public interface TaxInvoiceInfoMapper |
|
||||
{ |
|
||||
/** |
|
||||
* 查询国税发票 |
|
||||
* |
|
||||
* @param taxInvoiceId 国税发票ID |
|
||||
* @return 国税发票 |
|
||||
*/ |
|
||||
public TaxInvoiceInfo selectTaxInvoiceInfoById(Long taxInvoiceId); |
|
||||
|
|
||||
/** |
|
||||
* 查询国税发票列表 |
|
||||
* |
|
||||
* @param taxInvoiceInfo 国税发票 |
|
||||
* @return 国税发票集合 |
|
||||
*/ |
|
||||
public List<TaxInvoiceInfo> selectTaxInvoiceInfoList(TaxInvoiceInfo taxInvoiceInfo); |
|
||||
|
|
||||
/** |
|
||||
* 新增国税发票 |
|
||||
* |
|
||||
* @param taxInvoiceInfo 国税发票 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int insertTaxInvoiceInfo(TaxInvoiceInfo taxInvoiceInfo); |
|
||||
|
|
||||
/** |
|
||||
* 修改国税发票 |
|
||||
* |
|
||||
* @param taxInvoiceInfo 国税发票 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int updateTaxInvoiceInfo(TaxInvoiceInfo taxInvoiceInfo); |
|
||||
|
|
||||
/** |
|
||||
* 删除国税发票 |
|
||||
* |
|
||||
* @param taxInvoiceId 国税发票ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int deleteTaxInvoiceInfoById(Long taxInvoiceId); |
|
||||
|
|
||||
/** |
|
||||
* 批量删除国税发票 |
|
||||
* |
|
||||
* @param taxInvoiceIds 需要删除的数据ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int deleteTaxInvoiceInfoByIds(String[] taxInvoiceIds); |
|
||||
} |
|
@ -1,61 +0,0 @@ |
|||||
package com.ruoyi.taxInvoice.service; |
|
||||
|
|
||||
import java.util.List; |
|
||||
import com.ruoyi.taxInvoice.domain.TaxInvoiceInfo; |
|
||||
|
|
||||
/** |
|
||||
* 国税发票Service接口 |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2023-02-09 |
|
||||
*/ |
|
||||
public interface ITaxInvoiceInfoService |
|
||||
{ |
|
||||
/** |
|
||||
* 查询国税发票 |
|
||||
* |
|
||||
* @param taxInvoiceId 国税发票ID |
|
||||
* @return 国税发票 |
|
||||
*/ |
|
||||
public TaxInvoiceInfo selectTaxInvoiceInfoById(Long taxInvoiceId); |
|
||||
|
|
||||
/** |
|
||||
* 查询国税发票列表 |
|
||||
* |
|
||||
* @param taxInvoiceInfo 国税发票 |
|
||||
* @return 国税发票集合 |
|
||||
*/ |
|
||||
public List<TaxInvoiceInfo> selectTaxInvoiceInfoList(TaxInvoiceInfo taxInvoiceInfo); |
|
||||
|
|
||||
/** |
|
||||
* 新增国税发票 |
|
||||
* |
|
||||
* @param taxInvoiceInfo 国税发票 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int insertTaxInvoiceInfo(TaxInvoiceInfo taxInvoiceInfo); |
|
||||
|
|
||||
/** |
|
||||
* 修改国税发票 |
|
||||
* |
|
||||
* @param taxInvoiceInfo 国税发票 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int updateTaxInvoiceInfo(TaxInvoiceInfo taxInvoiceInfo); |
|
||||
|
|
||||
/** |
|
||||
* 批量删除国税发票 |
|
||||
* |
|
||||
* @param ids 需要删除的数据ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int deleteTaxInvoiceInfoByIds(String ids); |
|
||||
|
|
||||
/** |
|
||||
* 删除国税发票信息 |
|
||||
* |
|
||||
* @param taxInvoiceId 国税发票ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
public int deleteTaxInvoiceInfoById(Long taxInvoiceId); |
|
||||
} |
|
@ -1,94 +0,0 @@ |
|||||
package com.ruoyi.taxInvoice.service.impl; |
|
||||
|
|
||||
import java.util.List; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
import com.ruoyi.taxInvoice.mapper.TaxInvoiceInfoMapper; |
|
||||
import com.ruoyi.taxInvoice.domain.TaxInvoiceInfo; |
|
||||
import com.ruoyi.taxInvoice.service.ITaxInvoiceInfoService; |
|
||||
import com.ruoyi.common.core.text.Convert; |
|
||||
|
|
||||
/** |
|
||||
* 国税发票Service业务层处理 |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2023-02-09 |
|
||||
*/ |
|
||||
@Service |
|
||||
public class TaxInvoiceInfoServiceImpl implements ITaxInvoiceInfoService |
|
||||
{ |
|
||||
@Autowired |
|
||||
private TaxInvoiceInfoMapper taxInvoiceInfoMapper; |
|
||||
|
|
||||
/** |
|
||||
* 查询国税发票 |
|
||||
* |
|
||||
* @param taxInvoiceId 国税发票ID |
|
||||
* @return 国税发票 |
|
||||
*/ |
|
||||
@Override |
|
||||
public TaxInvoiceInfo selectTaxInvoiceInfoById(Long taxInvoiceId) |
|
||||
{ |
|
||||
return taxInvoiceInfoMapper.selectTaxInvoiceInfoById(taxInvoiceId); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 查询国税发票列表 |
|
||||
* |
|
||||
* @param taxInvoiceInfo 国税发票 |
|
||||
* @return 国税发票 |
|
||||
*/ |
|
||||
@Override |
|
||||
public List<TaxInvoiceInfo> selectTaxInvoiceInfoList(TaxInvoiceInfo taxInvoiceInfo) |
|
||||
{ |
|
||||
return taxInvoiceInfoMapper.selectTaxInvoiceInfoList(taxInvoiceInfo); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 新增国税发票 |
|
||||
* |
|
||||
* @param taxInvoiceInfo 国税发票 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
@Override |
|
||||
public int insertTaxInvoiceInfo(TaxInvoiceInfo taxInvoiceInfo) |
|
||||
{ |
|
||||
return taxInvoiceInfoMapper.insertTaxInvoiceInfo(taxInvoiceInfo); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改国税发票 |
|
||||
* |
|
||||
* @param taxInvoiceInfo 国税发票 |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
@Override |
|
||||
public int updateTaxInvoiceInfo(TaxInvoiceInfo taxInvoiceInfo) |
|
||||
{ |
|
||||
return taxInvoiceInfoMapper.updateTaxInvoiceInfo(taxInvoiceInfo); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除国税发票对象 |
|
||||
* |
|
||||
* @param ids 需要删除的数据ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
@Override |
|
||||
public int deleteTaxInvoiceInfoByIds(String ids) |
|
||||
{ |
|
||||
return taxInvoiceInfoMapper.deleteTaxInvoiceInfoByIds(Convert.toStrArray(ids)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除国税发票信息 |
|
||||
* |
|
||||
* @param taxInvoiceId 国税发票ID |
|
||||
* @return 结果 |
|
||||
*/ |
|
||||
@Override |
|
||||
public int deleteTaxInvoiceInfoById(Long taxInvoiceId) |
|
||||
{ |
|
||||
return taxInvoiceInfoMapper.deleteTaxInvoiceInfoById(taxInvoiceId); |
|
||||
} |
|
||||
} |
|
@ -1,155 +0,0 @@ |
|||||
<?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.ruoyi.taxInvoice.mapper.TaxInvoiceInfoMapper"> |
|
||||
|
|
||||
<resultMap type="TaxInvoiceInfo" id="TaxInvoiceInfoResult"> |
|
||||
<result property="taxInvoiceId" column="tax_invoice_id" /> |
|
||||
<result property="taxInvoiceCode" column="tax_invoice_code" /> |
|
||||
<result property="taxInvoiceNumber" column="tax_invoice_number" /> |
|
||||
<result property="deliveryNoteNumber" column="delivery_note_number" /> |
|
||||
<result property="enterpriseCode" column="enterprise_code" /> |
|
||||
<result property="enterpriseName" column="enterprise_name" /> |
|
||||
<result property="contractNumber" column="contract_number" /> |
|
||||
<result property="paymentTerm" column="payment_term" /> |
|
||||
<result property="billingDate" column="billing_date" /> |
|
||||
<result property="transportWay" column="transport_way" /> |
|
||||
<result property="transportMeans" column="transport_means" /> |
|
||||
<result property="departureDate" column="departure_date" /> |
|
||||
<result property="exportCustoms" column="export_customs" /> |
|
||||
<result property="billCommonCurrency" column="bill_common_currency" /> |
|
||||
<result property="packagesNumber" column="packages_number" /> |
|
||||
<result property="arrivalArea" column="arrival_area" /> |
|
||||
<result property="portOfDestination" column="port_of_destination" /> |
|
||||
<result property="hoistingNumber" column="hoisting_number" /> |
|
||||
<result property="printVersionNumber" column="print_version_number" /> |
|
||||
<result property="billRemarks" column="bill_remarks" /> |
|
||||
<result property="taxInvoiceNo" column="tax_invoice_no" /> |
|
||||
<result property="getmoneyFlag" column="getMoney_flag" /> |
|
||||
<result property="firstAddTime" column="first_add_time" /> |
|
||||
<result property="updateInfoTime" column="update_info_time" /> |
|
||||
<result property="standbyOne" column="standby_one" /> |
|
||||
<result property="standbyTwo" column="standby_two" /> |
|
||||
</resultMap> |
|
||||
|
|
||||
<sql id="selectTaxInvoiceInfoVo"> |
|
||||
select tax_invoice_id, tax_invoice_code, tax_invoice_number, delivery_note_number, enterprise_code, enterprise_name, contract_number, payment_term, billing_date, transport_way, transport_means, departure_date, export_customs, bill_common_currency, packages_number, arrival_area, port_of_destination, hoisting_number, print_version_number, bill_remarks, tax_invoice_no, getMoney_flag, first_add_time, update_info_time, standby_one, standby_two from tax_invoice_info |
|
||||
</sql> |
|
||||
|
|
||||
<select id="selectTaxInvoiceInfoList" parameterType="TaxInvoiceInfo" resultMap="TaxInvoiceInfoResult"> |
|
||||
<include refid="selectTaxInvoiceInfoVo"/> |
|
||||
<where> |
|
||||
<if test="taxInvoiceNumber != null and taxInvoiceNumber != ''"> and tax_invoice_number like concat('%', #{taxInvoiceNumber}, '%')</if> |
|
||||
<if test="deliveryNoteNumber != null and deliveryNoteNumber != ''"> and delivery_note_number like concat('%', #{deliveryNoteNumber}, '%')</if> |
|
||||
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code like concat('%', #{enterpriseCode}, '%')</if> |
|
||||
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if> |
|
||||
<if test="taxInvoiceNo != null and taxInvoiceNo != ''"> and tax_invoice_no like concat('%', #{taxInvoiceNo}, '%')</if> |
|
||||
<if test="getmoneyFlag != null and getmoneyFlag != ''"> and getMoney_flag = #{getmoneyFlag}</if> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<select id="selectTaxInvoiceInfoById" parameterType="Long" resultMap="TaxInvoiceInfoResult"> |
|
||||
<include refid="selectTaxInvoiceInfoVo"/> |
|
||||
where tax_invoice_id = #{taxInvoiceId} |
|
||||
</select> |
|
||||
|
|
||||
<insert id="insertTaxInvoiceInfo" parameterType="TaxInvoiceInfo" useGeneratedKeys="true" keyProperty="taxInvoiceId"> |
|
||||
insert into tax_invoice_info |
|
||||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
||||
<if test="taxInvoiceCode != null">tax_invoice_code,</if> |
|
||||
<if test="taxInvoiceNumber != null">tax_invoice_number,</if> |
|
||||
<if test="deliveryNoteNumber != null">delivery_note_number,</if> |
|
||||
<if test="enterpriseCode != null">enterprise_code,</if> |
|
||||
<if test="enterpriseName != null">enterprise_name,</if> |
|
||||
<if test="contractNumber != null">contract_number,</if> |
|
||||
<if test="paymentTerm != null">payment_term,</if> |
|
||||
<if test="billingDate != null">billing_date,</if> |
|
||||
<if test="transportWay != null">transport_way,</if> |
|
||||
<if test="transportMeans != null">transport_means,</if> |
|
||||
<if test="departureDate != null">departure_date,</if> |
|
||||
<if test="exportCustoms != null">export_customs,</if> |
|
||||
<if test="billCommonCurrency != null">bill_common_currency,</if> |
|
||||
<if test="packagesNumber != null">packages_number,</if> |
|
||||
<if test="arrivalArea != null">arrival_area,</if> |
|
||||
<if test="portOfDestination != null">port_of_destination,</if> |
|
||||
<if test="hoistingNumber != null">hoisting_number,</if> |
|
||||
<if test="printVersionNumber != null">print_version_number,</if> |
|
||||
<if test="billRemarks != null">bill_remarks,</if> |
|
||||
<if test="taxInvoiceNo != null">tax_invoice_no,</if> |
|
||||
<if test="getmoneyFlag != null">getMoney_flag,</if> |
|
||||
<if test="standbyOne != null">standby_one,</if> |
|
||||
<if test="standbyTwo != null">standby_two,</if> |
|
||||
first_add_time, |
|
||||
</trim> |
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
||||
<if test="taxInvoiceCode != null">#{taxInvoiceCode},</if> |
|
||||
<if test="taxInvoiceNumber != null">#{taxInvoiceNumber},</if> |
|
||||
<if test="deliveryNoteNumber != null">#{deliveryNoteNumber},</if> |
|
||||
<if test="enterpriseCode != null">#{enterpriseCode},</if> |
|
||||
<if test="enterpriseName != null">#{enterpriseName},</if> |
|
||||
<if test="contractNumber != null">#{contractNumber},</if> |
|
||||
<if test="paymentTerm != null">#{paymentTerm},</if> |
|
||||
<if test="billingDate != null">#{billingDate},</if> |
|
||||
<if test="transportWay != null">#{transportWay},</if> |
|
||||
<if test="transportMeans != null">#{transportMeans},</if> |
|
||||
<if test="departureDate != null">#{departureDate},</if> |
|
||||
<if test="exportCustoms != null">#{exportCustoms},</if> |
|
||||
<if test="billCommonCurrency != null">#{billCommonCurrency},</if> |
|
||||
<if test="packagesNumber != null">#{packagesNumber},</if> |
|
||||
<if test="arrivalArea != null">#{arrivalArea},</if> |
|
||||
<if test="portOfDestination != null">#{portOfDestination},</if> |
|
||||
<if test="hoistingNumber != null">#{hoistingNumber},</if> |
|
||||
<if test="printVersionNumber != null">#{printVersionNumber},</if> |
|
||||
<if test="billRemarks != null">#{billRemarks},</if> |
|
||||
<if test="taxInvoiceNo != null">#{taxInvoiceNo},</if> |
|
||||
<if test="getmoneyFlag != null">#{getmoneyFlag},</if> |
|
||||
<if test="standbyOne != null">#{standbyOne},</if> |
|
||||
<if test="standbyTwo != null">#{standbyTwo},</if> |
|
||||
now(), |
|
||||
</trim> |
|
||||
</insert> |
|
||||
|
|
||||
<update id="updateTaxInvoiceInfo" parameterType="TaxInvoiceInfo"> |
|
||||
update tax_invoice_info |
|
||||
<trim prefix="SET" suffixOverrides=","> |
|
||||
<if test="taxInvoiceCode != null">tax_invoice_code = #{taxInvoiceCode},</if> |
|
||||
<if test="taxInvoiceNumber != null">tax_invoice_number = #{taxInvoiceNumber},</if> |
|
||||
<if test="deliveryNoteNumber != null">delivery_note_number = #{deliveryNoteNumber},</if> |
|
||||
<if test="enterpriseCode != null">enterprise_code = #{enterpriseCode},</if> |
|
||||
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if> |
|
||||
<if test="contractNumber != null">contract_number = #{contractNumber},</if> |
|
||||
<if test="paymentTerm != null">payment_term = #{paymentTerm},</if> |
|
||||
<if test="billingDate != null">billing_date = #{billingDate},</if> |
|
||||
<if test="transportWay != null">transport_way = #{transportWay},</if> |
|
||||
<if test="transportMeans != null">transport_means = #{transportMeans},</if> |
|
||||
<if test="departureDate != null">departure_date = #{departureDate},</if> |
|
||||
<if test="exportCustoms != null">export_customs = #{exportCustoms},</if> |
|
||||
<if test="billCommonCurrency != null">bill_common_currency = #{billCommonCurrency},</if> |
|
||||
<if test="packagesNumber != null">packages_number = #{packagesNumber},</if> |
|
||||
<if test="arrivalArea != null">arrival_area = #{arrivalArea},</if> |
|
||||
<if test="portOfDestination != null">port_of_destination = #{portOfDestination},</if> |
|
||||
<if test="hoistingNumber != null">hoisting_number = #{hoistingNumber},</if> |
|
||||
<if test="printVersionNumber != null">print_version_number = #{printVersionNumber},</if> |
|
||||
<if test="billRemarks != null">bill_remarks = #{billRemarks},</if> |
|
||||
<if test="taxInvoiceNo != null">tax_invoice_no = #{taxInvoiceNo},</if> |
|
||||
<if test="getmoneyFlag != null">getMoney_flag = #{getmoneyFlag},</if> |
|
||||
<if test="standbyOne != null">standby_one = #{standbyOne},</if> |
|
||||
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if> |
|
||||
update_info_time = CONCAT_WS(',',NOW(),update_info_time), |
|
||||
</trim> |
|
||||
where tax_invoice_id = #{taxInvoiceId} |
|
||||
</update> |
|
||||
|
|
||||
<delete id="deleteTaxInvoiceInfoById" parameterType="Long"> |
|
||||
delete from tax_invoice_info where tax_invoice_id = #{taxInvoiceId} |
|
||||
</delete> |
|
||||
|
|
||||
<delete id="deleteTaxInvoiceInfoByIds" parameterType="String"> |
|
||||
delete from tax_invoice_info where tax_invoice_id in |
|
||||
<foreach item="taxInvoiceId" collection="array" open="(" separator="," close=")"> |
|
||||
#{taxInvoiceId} |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
</mapper> |
|
@ -1,792 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('新增国税发票')" /> |
|
||||
<th:block th:include="include :: bootstrap-editable-css"/> |
|
||||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|
||||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|
||||
<th:block th:include="include :: datetimepicker-css" /> |
|
||||
<style> |
|
||||
.other-container { |
|
||||
width: 90%; |
|
||||
height: 200px; |
|
||||
margin: auto; |
|
||||
} |
|
||||
.other { |
|
||||
margin-top: 20px; |
|
||||
} |
|
||||
h4 { |
|
||||
display: inline-block; |
|
||||
margin-right: 20px; |
|
||||
} |
|
||||
.modal-body{ |
|
||||
height: 550px; |
|
||||
} |
|
||||
iframe{ |
|
||||
width: 100%; |
|
||||
height: 500px; |
|
||||
frameborder: 0; |
|
||||
border: 0; |
|
||||
display: inline-block; |
|
||||
} |
|
||||
</style> |
|
||||
</head> |
|
||||
|
|
||||
<body class="white-bg"> |
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
||||
<form class="form-horizontal m" id="form-taxInvoiceInfo-add"> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">发票编号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="taxInvoiceCode" class="form-control" type="text" required> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">发票号码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="taxInvoiceNumber" class="form-control" type="text" required> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">送货单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="deliveryNoteNumber" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required ">客户代码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="enterpriseCode" class="form-control m-b" required> |
|
||||
<option value="">所有</option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">客户名称:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="enterpriseName" class="form-control m-b" type="text" required readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">合同号码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="contractNumber" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">付款条件:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="paymentTerm" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">开票日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<div class="input-group date"> |
|
||||
<input name="billingDate" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">运输方式:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="transportWay" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">运输工具:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="transportMeans" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">离境日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<div class="input-group date"> |
|
||||
<input name="departureDate" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">出口海关:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="exportCustoms" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">币别:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="billCommonCurrency" class="form-control m-b" th:with="type=${@dict.getType('sys_coin_class')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">件数:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="packagesNumber" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">抵运国(地区):</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="arrivalArea" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">指运港:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="portOfDestination" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">提运单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="hoistingNumber" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">发票印字版号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="printVersionNumber" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">备注:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="billRemarks" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">国税发票编号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="taxInvoiceNo" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">是否收到款:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="getmoneyFlag" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div style="width:100%;height:1px;border-top:solid lightgrey 1px;margin-top:50px;padding:50px 0 0 0px;"> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">全部数量:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="totalQuantity" class="form-control" type="text" > |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">全部金额:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="totalMoney" class="form-control" type="text" > |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">全部金额(大写):</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="totalMoneyUpCase" class="form-control" type="text" > |
|
||||
</div> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="other-container"> |
|
||||
<div class="other"> |
|
||||
<h4>选择产品信息</h4> |
|
||||
<a class="btn btn-primary" onclick="showProductModal()"><i class="fa fa-plus"></i> 选择产品</a> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<table id="addProductTable" style="white-space:nowrap"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="modal inmodal" id="productInfoModal" role="dilog" aria-hidden="true"> |
|
||||
<!-- 查询成品资料--> |
|
||||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|
||||
<div class="modal-content" style="background-color: #FFFFFF"> |
|
||||
<div class="modal-body"> |
|
||||
<div class="container-div"> |
|
||||
<div class="row"> |
|
||||
<div class="col-sm-12 search-collapse"> |
|
||||
<form id="productFormId"> |
|
||||
<div class="select-list"> |
|
||||
<ul> |
|
||||
<li> |
|
||||
<label>成品代码:</label> |
|
||||
<input type="text" name="finishProductCode"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>成品名称:</label> |
|
||||
<input type="text" name="finishProductName"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<li> |
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('productFormId','productTable')"><i |
|
||||
class="fa fa-search"></i> 搜索</a> |
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('productFormId','productTable')"><i |
|
||||
class="fa fa-refresh"></i> 重置</a> |
|
||||
</li> |
|
||||
</ul> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<table id="productTable" style="white-space:nowrap"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="modal-footer"> |
|
||||
<a class="btn btn-warning btn-rounded" onclick="addProductToTable()">确认添加</a> |
|
||||
<a class="btn btn-primary btn-rounded" onclick="closeProductModal()">关闭</a> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<th:block th:include="include :: footer" /> |
|
||||
<th:block th:include="include :: datetimepicker-js" /> |
|
||||
<th:block th:include="include :: select2-js"/> |
|
||||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|
||||
<script th:inline="javascript"> |
|
||||
var prefix = ctx + "taxInvoice/taxInvoiceInfo" |
|
||||
var prefixTaxInvoiceProduct = ctx + "taxInvoice/taxInvoiceProduct" |
|
||||
var prefixfinishproduct = ctx + "system/finishproduct"; |
|
||||
|
|
||||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|
||||
var whetherStopDatas = [[${@dict.getType('sys_whether')}]]; |
|
||||
var productionCategoryDatas = [[${@dict.getType('sys_production_category')}]]; |
|
||||
var finishProductCategoryDatas = [[${@dict.getType('sys_finish_product_category')}]]; |
|
||||
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]]; |
|
||||
|
|
||||
let userName = [[${@permission.getPrincipalProperty('userName')}]]; |
|
||||
// console.log(userName) |
|
||||
|
|
||||
$("#form-taxInvoiceInfo-add").validate({ |
|
||||
focusCleanup: true |
|
||||
}); |
|
||||
|
|
||||
function submitHandler() { |
|
||||
let getData=$('#addProductTable').bootstrapTable('getData', true) |
|
||||
if(getData.length > 0){ |
|
||||
if ($.validate.form()) { |
|
||||
//确认添加选中的成品数据 |
|
||||
confirmProduct(); |
|
||||
$.operate.save(prefix + "/add", $('#form-taxInvoiceInfo-add').serialize()); |
|
||||
} |
|
||||
} else { |
|
||||
$.modal.alertWarning("未选择产品,请选择!") |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
$("input[name='billingDate']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true, |
|
||||
todayBtn: true, |
|
||||
todayHighlight: true, |
|
||||
startDate:new Date(), |
|
||||
initialDate: new Date() |
|
||||
}); |
|
||||
|
|
||||
$("input[name='departureDate']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true, |
|
||||
todayBtn: true, |
|
||||
todayHighlight: true, |
|
||||
startDate:new Date(), |
|
||||
initialDate: new Date() |
|
||||
}); |
|
||||
|
|
||||
$("input[name='billingDate']").datetimepicker("setDate", new Date()); |
|
||||
$("input[name='departureDate']").datetimepicker("setDate", new Date()); |
|
||||
|
|
||||
$(function () { |
|
||||
|
|
||||
//获取客户信息并自动填入数据 |
|
||||
getCustomerListToForm(); |
|
||||
|
|
||||
//初始化添加产品表 |
|
||||
$('#addProductTable').bootstrapTable({ |
|
||||
pagination: true, |
|
||||
pageNumber: 1, |
|
||||
pageSize: 10, |
|
||||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|
||||
cardView: false, // 是否显示详细视图 |
|
||||
detailView: false, // 是否显示父子表 |
|
||||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|
||||
showExport: false, // 是否显示导出按钮 |
|
||||
clickToSelect: true,//点击行选中 |
|
||||
paginationDetailHAlign: ' hiddenDetailInfo', |
|
||||
height: 250, |
|
||||
uniqueId: 'finishProductCode', |
|
||||
onEditableSave: function (field, row, oldValue, $el) { |
|
||||
$('#addProductTable').bootstrapTable('updateRow',{index: row.id, row: row}); |
|
||||
getTotal(); |
|
||||
}, |
|
||||
queryParams: function (params) { |
|
||||
//console.log("123"); |
|
||||
var curParams = { |
|
||||
// 传递参数查询参数 |
|
||||
pageSize: params.limit, |
|
||||
pageNum: params.offset / params.limit + 1, |
|
||||
// enterpriseCode: data[0].enterpriseCode |
|
||||
|
|
||||
}; |
|
||||
// console.log(data[0].enterpriseCode) |
|
||||
return curParams |
|
||||
}, |
|
||||
columns: [ |
|
||||
// { |
|
||||
// checkbox: true |
|
||||
// }, |
|
||||
{ |
|
||||
title: '操作', |
|
||||
align: 'center', |
|
||||
formatter: function (value, row, index) { |
|
||||
var actions = []; |
|
||||
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeProductData(\'' + row.finishProductCode + '\')" ><i class="fa fa-remove"></i>删除</a>'); |
|
||||
return actions.join(''); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductCode', |
|
||||
title: '成品代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductName', |
|
||||
title: '成品名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'specificationModel', |
|
||||
title: '规格型号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'inventoryUnit', |
|
||||
title: '单位', |
|
||||
formatter: function (value, row, index) { |
|
||||
return $.table.selectDictLabel(inventoryUnitDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'commonCurrency', |
|
||||
title: '币别', |
|
||||
editable: { |
|
||||
type: 'select', |
|
||||
title: '币别', |
|
||||
emptytext: '币别', |
|
||||
source: function() { |
|
||||
let result = []; |
|
||||
for (let i = 0;i<commonCurrencyDatas.length;i++) { |
|
||||
result.push({value: commonCurrencyDatas[i].dictValue,text: commonCurrencyDatas[i].dictLabel}) |
|
||||
} |
|
||||
return result; |
|
||||
}, |
|
||||
validate: function (value) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'processPrice', |
|
||||
title: '单价', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '单价', |
|
||||
emptytext: '单价', |
|
||||
validate: function (v) { |
|
||||
if (isNaN(v)) return '单价必须是数字'; |
|
||||
if (v<=0) return '单价必须是正数'; |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'quantity', |
|
||||
title: '数量', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '数量', |
|
||||
emptytext: '数量', |
|
||||
validate: function (v) { |
|
||||
if (isNaN(v)) return '数量必须是数字'; |
|
||||
var ex = /^[1-9]\d*$/; |
|
||||
if (!ex.test(v)) return '数量必须是正整数'; |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'amountOfMoney', |
|
||||
title: '金额', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '金额', |
|
||||
emptytext: '金额', |
|
||||
validate: function (value) { |
|
||||
|
|
||||
} |
|
||||
}, |
|
||||
formatter:function(value, row, index) { |
|
||||
let total = row.processPrice * row.quantity; |
|
||||
row.amountOfMoney = row.processPrice * row.quantity; |
|
||||
return total.toFixed(2); |
|
||||
} |
|
||||
}] |
|
||||
}) |
|
||||
|
|
||||
//显示产品信息 |
|
||||
showProductData(); |
|
||||
|
|
||||
}) |
|
||||
|
|
||||
//获取客户信息并自动填入数据 |
|
||||
function getCustomerListToForm() { |
|
||||
$.ajax({ |
|
||||
url: prefix + "/getCustomerList", |
|
||||
type: "POST", |
|
||||
success: function (res) { |
|
||||
//console.log(res) |
|
||||
if (res.length > 0) { |
|
||||
customerListData = res; |
|
||||
//alert(JSON.stringify(data)); |
|
||||
for (let i in customerListData) { |
|
||||
$("select[name='enterpriseCode']").append("<option value='" + customerListData[i].enterpriseCode + "'>" + customerListData[i].enterpriseCode + "</option>"); |
|
||||
} |
|
||||
$("select[name='enterpriseCode']").change(function () { |
|
||||
var code = $(this).val(); |
|
||||
for (let i=0;i<customerListData.length;i++) { |
|
||||
if (customerListData[i].enterpriseCode == code) { |
|
||||
$("input[name='enterpriseName']").val(customerListData[i].enterpriseName); |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
|
|
||||
} else { |
|
||||
$.modal.msgError(res.msg); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
$.modal.msgError("后台出错啦!"); |
|
||||
|
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//显示产品信息 |
|
||||
function showProductData() { |
|
||||
var options = { |
|
||||
id: 'productTable', |
|
||||
url: prefixfinishproduct + "/list", |
|
||||
showRefresh: false, |
|
||||
showToggle: false, |
|
||||
clickToSelect: true, |
|
||||
modalName: "产品资料", |
|
||||
columns: [{ |
|
||||
checkbox: true |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductId', |
|
||||
title: '成品id', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'customerNumber', |
|
||||
title: '客户料号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'typeMachine', |
|
||||
title: '机种' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductName', |
|
||||
title: '成品名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'enterpriseCode', |
|
||||
title: '客户代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'enterpriseName', |
|
||||
title: '客户名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'inventoryUnit', |
|
||||
title: '库存单位', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(inventoryUnitDatas, value); |
|
||||
}, |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'versionNumber', |
|
||||
title: '版本号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductCode', |
|
||||
title: '成品代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'safetyStock', |
|
||||
title: '安全库存', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'stockUnitWeight', |
|
||||
title: '单位重量', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'gpItemSelection', |
|
||||
title: 'GP项选择', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(gpItemSelectionDatas, value); |
|
||||
}, |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'inPlantCode', |
|
||||
title: '厂内编码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'whetherStop', |
|
||||
title: '料号是否停用', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(whetherStopDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'createrName', |
|
||||
title: '创建人', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'ordinalName', |
|
||||
title: '半成品对应完工工序名', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'originalNumber', |
|
||||
title: '原成品料号', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'customsName', |
|
||||
title: '海关名称', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'defaultWarehouse', |
|
||||
title: '默认仓库' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialCategory', |
|
||||
title: '类别', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(materialCategoryDatas, value); |
|
||||
}, |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'productionCategory', |
|
||||
title: '生产类别', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(productionCategoryDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductCategory', |
|
||||
title: '所属类别', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(finishProductCategoryDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'specificationModel', |
|
||||
title: '规格型号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'customerEngineer', |
|
||||
title: '客户工程师' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'productDescription', |
|
||||
title: '产品描述', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'maximumInventory', |
|
||||
title: '最高库存', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'productPrice', |
|
||||
title: '产品售价', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'componentName', |
|
||||
title: '组件名称', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'createrTime', |
|
||||
title: '创建日期', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'ordinalNumber', |
|
||||
title: '半成品对应完工工序号', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'defaultLocation', |
|
||||
title: '默认位置', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'hsNumber', |
|
||||
title: 'HS号', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'kesNumber', |
|
||||
title: '科恩仕料号' |
|
||||
}] |
|
||||
}; |
|
||||
$.table.init(options); |
|
||||
} |
|
||||
|
|
||||
/*产品内容*/ |
|
||||
//点击按钮显示产品信息模态框 |
|
||||
function showProductModal() { |
|
||||
if ($.validate.form()) { |
|
||||
$("#productInfoModal").modal("show"); |
|
||||
} else { |
|
||||
$.modal.alertWarning("请填写必填项"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//关闭产品信息模态框 |
|
||||
function closeProductModal() { |
|
||||
$("#productInfoModal").modal("hide"); |
|
||||
} |
|
||||
|
|
||||
//表中添加选中的产品信息 |
|
||||
function addProductToTable() { |
|
||||
var data = $("#productTable").bootstrapTable("getSelections"); |
|
||||
var count = $('#addProductTable').bootstrapTable('getData').length; |
|
||||
var taxInvoiceCode = $("input[name='taxInvoiceCode']").val(); |
|
||||
var taxInvoiceNumber = $("input[name='taxInvoiceNumber']").val(); |
|
||||
// console.log(data); |
|
||||
// console.log(count); |
|
||||
for (i = 0; i < data.length; i++) { |
|
||||
let finishProduct = $('#addProductTable').bootstrapTable('getRowByUniqueId', data[i].finishProductCode); |
|
||||
if (finishProduct != null) { |
|
||||
alert(finishProduct.finishProductName + "已存在,不可重复添加!"); |
|
||||
continue; |
|
||||
} |
|
||||
$("#addProductTable").bootstrapTable('insertRow', { |
|
||||
index: count + i, |
|
||||
row: { |
|
||||
taxInvoiceCode: taxInvoiceCode, |
|
||||
taxInvoiceNumber: taxInvoiceNumber, |
|
||||
finishProductCode: data[i].finishProductCode, |
|
||||
finishProductName: data[i].finishProductName, |
|
||||
specificationModel: data[i].specificationModel, |
|
||||
inventoryUnit: data[i].inventoryUnit, |
|
||||
commonCurrency: '', |
|
||||
quantity: '', |
|
||||
processPrice: '', |
|
||||
amountOfMoney: '' |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
$("#productTable").bootstrapTable("uncheckAll"); |
|
||||
closeProductModal(); |
|
||||
} |
|
||||
|
|
||||
//确认添加选中的产品数据 |
|
||||
function confirmProduct() { |
|
||||
let data = JSON.stringify($('#addProductTable').bootstrapTable('getData', true)); |
|
||||
|
|
||||
let datalist=$('#addProductTable').bootstrapTable('getData', true) |
|
||||
if (datalist.length > 0) { |
|
||||
$.ajax({ |
|
||||
url: prefixTaxInvoiceProduct + '/add', |
|
||||
type: "POST", |
|
||||
data: { |
|
||||
data: data |
|
||||
}, |
|
||||
dataType: "json", |
|
||||
success: function (resp) { |
|
||||
// console.log(data) |
|
||||
console.log(resp) |
|
||||
} |
|
||||
|
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//添加表格内删除产品信息 |
|
||||
function removeProductData(finishProductCode){ |
|
||||
var ids = []; |
|
||||
ids.push(finishProductCode); |
|
||||
$('#addProductTable').bootstrapTable("remove",{ |
|
||||
field:'finishProductCode', |
|
||||
values:ids |
|
||||
}) |
|
||||
$("#addProductTable").bootstrapTable('refresh'); |
|
||||
getTotal(); |
|
||||
} |
|
||||
|
|
||||
//计算全部数量、金额、大写 |
|
||||
function getTotal() { |
|
||||
let getDataAll = $('#addProductTable').bootstrapTable('getData', true); |
|
||||
// console.log(getDataAll) |
|
||||
var totalQuantity = 0; |
|
||||
var totalMoney = 0.00; |
|
||||
for (let i = 0;i<getDataAll.length;i++) { |
|
||||
// console.log(getDataAll[i]) |
|
||||
totalQuantity = Math.floor(totalQuantity + Number(getDataAll[i].quantity)); |
|
||||
totalMoney = totalMoney + getDataAll[i].amountOfMoney; |
|
||||
} |
|
||||
$("input[name='totalQuantity']").val(totalQuantity) |
|
||||
$("input[name='totalMoney']").val(totalMoney.toFixed(2)) |
|
||||
$.ajax({ |
|
||||
url: prefix + '/getMoneyUpCase', |
|
||||
type: 'post', |
|
||||
data: { |
|
||||
totalMoney: totalMoney |
|
||||
}, |
|
||||
success: function (res) { |
|
||||
// console.log(res) |
|
||||
$("input[name='totalMoneyUpCase']").val(res) |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
|
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
@ -1,864 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('修改国税发票')" /> |
|
||||
<th:block th:include="include :: datetimepicker-css" /> |
|
||||
<th:block th:include="include :: bootstrap-editable-css"/> |
|
||||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|
||||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|
||||
<style> |
|
||||
.other-container { |
|
||||
width: 90%; |
|
||||
height: 200px; |
|
||||
margin: auto; |
|
||||
} |
|
||||
.other { |
|
||||
margin-top: 20px; |
|
||||
} |
|
||||
h4 { |
|
||||
display: inline-block; |
|
||||
margin-right: 20px; |
|
||||
} |
|
||||
.modal-body{ |
|
||||
height: 550px; |
|
||||
} |
|
||||
iframe{ |
|
||||
width: 100%; |
|
||||
height: 500px; |
|
||||
frameborder: 0; |
|
||||
border: 0; |
|
||||
display: inline-block; |
|
||||
} |
|
||||
</style> |
|
||||
</head> |
|
||||
<body class="white-bg"> |
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
||||
<form class="form-horizontal m" id="form-taxInvoiceInfo-edit" th:object="${taxInvoiceInfo}"> |
|
||||
<input name="taxInvoiceId" th:field="*{taxInvoiceId}" type="hidden"> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label" is-required>发票编号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="taxInvoiceCode" th:field="*{taxInvoiceCode}" class="form-control" type="text" required> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label" is-required>发票号码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="taxInvoiceNumber" th:field="*{taxInvoiceNumber}" class="form-control" type="text" required> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">送货单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="deliveryNoteNumber" th:field="*{deliveryNoteNumber}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label" is-required>客户代码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="enterpriseCode" class="form-control m-b" th:field="*{enterpriseCode}" required> |
|
||||
<option value="">所有</option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label" is-required>客户名称:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="enterpriseName" class="form-control m-b" th:field="*{enterpriseName}" required> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">合同号码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="contractNumber" th:field="*{contractNumber}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">付款条件:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="paymentTerm" th:field="*{paymentTerm}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">开票日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<div class="input-group date"> |
|
||||
<input name="billingDate" th:value="*{billingDate}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">运输方式:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="transportWay" th:field="*{transportWay}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">运输工具:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="transportMeans" th:field="*{transportMeans}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">离境日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<div class="input-group date"> |
|
||||
<input name="departureDate" th:value="*{departureDate}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">出口海关:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="exportCustoms" th:field="*{exportCustoms}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">币别:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="billCommonCurrency" class="form-control m-b" th:with="type=${@dict.getType('sys_coin_class')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{billCommonCurrency}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">件数:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="packagesNumber" th:field="*{packagesNumber}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">抵运国:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="arrivalArea" th:field="*{arrivalArea}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">指运港:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="portOfDestination" th:field="*{portOfDestination}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">提运单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="hoistingNumber" th:field="*{hoistingNumber}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">发票印字版号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="printVersionNumber" th:field="*{printVersionNumber}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">备注:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="billRemarks" th:field="*{billRemarks}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">国税发票编号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="taxInvoiceNo" th:field="*{taxInvoiceNo}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">是否收到款:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="getmoneyFlag" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{getmoneyFlag}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div style="width:100%;height:1px;border-top:solid lightgrey 1px;margin-top:50px;padding:50px 0 0 0px;"> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">全部数量:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="totalQuantity" class="form-control" type="text" > |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">全部金额:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="totalMoney" class="form-control" type="text" > |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">全部金额(大写):</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="totalMoneyUpCase" class="form-control" type="text" > |
|
||||
</div> |
|
||||
</div> |
|
||||
<!--<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">备用一:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="standbyOne" th:field="*{standbyOne}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">备用二:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="standbyTwo" th:field="*{standbyTwo}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div>--> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="other-container"> |
|
||||
<div class="other"> |
|
||||
<h4>成品信息</h4> |
|
||||
<a class="btn btn-primary" onclick="showProductModal()"><i class="fa fa-plus"></i> 选择成品</a> |
|
||||
<a class="btn btn-danger" onclick="removeProduct()" ><i class="fa fa-plus"></i> 删除成品</a> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<table id="addProductTable" style="white-space:nowrap"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="modal inmodal" id="productInfoModal" |
|
||||
role="dilog" aria-hidden="true"> |
|
||||
|
|
||||
<!-- 查询成品资料--> |
|
||||
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
|
||||
|
|
||||
<div class="modal-content" style="background-color: #FFFFFF"> |
|
||||
|
|
||||
<div class="modal-body"> |
|
||||
<div class="container-div"> |
|
||||
<div class="row"> |
|
||||
<div class="col-sm-6 search-collapse"> |
|
||||
<form id="productFormId"> |
|
||||
<div class="select-list"> |
|
||||
<ul> |
|
||||
<li> |
|
||||
<label>成品代码:</label> |
|
||||
<input type="text" name="finishProductCode"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>成品名称:</label> |
|
||||
<input type="text" name="finishProductName"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>客户代码:</label> |
|
||||
<input type="text" name="enterpriseCode"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>客户名称:</label> |
|
||||
<input type="text" name="enterpriseName"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('productFormId','productTable')"><i |
|
||||
class="fa fa-search"></i> 搜索</a> |
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('productFormId','productTable')"><i |
|
||||
class="fa fa-refresh"></i> 重置</a> |
|
||||
</li> |
|
||||
</ul> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<table id="productTable" style="white-space:nowrap"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="modal-footer"> |
|
||||
<a class="btn btn-warning btn-rounded" onclick="addProductToTable()">确认添加</a> |
|
||||
<a class="btn btn-primary btn-rounded" onclick="closeProductModal()">关闭</a> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<th:block th:include="include :: footer" /> |
|
||||
<th:block th:include="include :: datetimepicker-js" /> |
|
||||
<th:block th:include="include :: select2-js"/> |
|
||||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|
||||
<script th:inline="javascript"> |
|
||||
|
|
||||
var getData = [[${taxInvoiceInfo}]]; |
|
||||
|
|
||||
var prefix = ctx + "taxInvoice/taxInvoiceInfo"; |
|
||||
var prefixTaxInvoiceProduct = ctx + "taxInvoice/taxInvoiceProduct" |
|
||||
var prefixfinishproduct = ctx + "system/finishproduct"; |
|
||||
|
|
||||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|
||||
var whetherStopDatas = [[${@dict.getType('sys_whether')}]]; |
|
||||
var productionCategoryDatas = [[${@dict.getType('sys_production_category')}]]; |
|
||||
var finishProductCategoryDatas = [[${@dict.getType('sys_finish_product_category')}]]; |
|
||||
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]]; |
|
||||
|
|
||||
$("#form-taxInvoiceInfo-edit").validate({ |
|
||||
focusCleanup: true |
|
||||
}); |
|
||||
|
|
||||
function submitHandler() { |
|
||||
if ($.validate.form()) { |
|
||||
$.modal.confirm("确认以上修改吗?", function (){ |
|
||||
//修改成品数据 |
|
||||
updateProduct(); |
|
||||
$.operate.save(prefix + "/edit", $('#form-taxInvoiceInfo-edit').serialize()); |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
$("input[name='billingDate']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true, |
|
||||
todayBtn: true, |
|
||||
todayHighlight: true |
|
||||
}); |
|
||||
|
|
||||
$("input[name='departureDate']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true, |
|
||||
todayBtn: true, |
|
||||
todayHighlight: true |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
$(function (){}) |
|
||||
|
|
||||
$(function () { |
|
||||
//获取客户信息并自动填入数据 |
|
||||
getCustomerListToForm(); |
|
||||
|
|
||||
$('#addProductTable').bootstrapTable("refresh") |
|
||||
//初始化添加产品表 |
|
||||
$('#addProductTable').bootstrapTable({ |
|
||||
url: prefixTaxInvoiceProduct + "/list", |
|
||||
pagination: true, |
|
||||
pageNumber: 1, |
|
||||
pageSize: 10, |
|
||||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|
||||
cardView: false, // 是否显示详细视图 |
|
||||
detailView: false, // 是否显示父子表 |
|
||||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|
||||
showExport: false, // 是否显示导出按钮 |
|
||||
clickToSelect: true,//点击行选中 |
|
||||
paginationDetailHAlign: ' hiddenDetailInfo', |
|
||||
height: 250, |
|
||||
uniqueId: 'finishProductCode', |
|
||||
onEditableSave: function (field, row, oldValue, $el) { |
|
||||
$('#addProductTable').bootstrapTable('updateRow',{index: row.id, row: row}); |
|
||||
getTotal(); |
|
||||
}, |
|
||||
onLoadSuccess: function (data) { |
|
||||
//计算全部数量、金额、大写 |
|
||||
getTotal(); |
|
||||
|
|
||||
}, |
|
||||
queryParams: function (params) { |
|
||||
//console.log("123"); |
|
||||
var curParams = { |
|
||||
// 传递参数查询参数 |
|
||||
pageSize: params.limit, |
|
||||
pageNum: params.offset / params.limit + 1, |
|
||||
// enterpriseCode: data[0].enterpriseCode |
|
||||
taxInvoiceCode: getData.taxInvoiceCode, |
|
||||
taxInvoiceNumber: getData.taxInvoiceNumber |
|
||||
}; |
|
||||
// console.log(data[0].enterpriseCode) |
|
||||
return curParams |
|
||||
}, |
|
||||
columns: [ |
|
||||
{ |
|
||||
checkbox: true |
|
||||
}, |
|
||||
{ |
|
||||
field: 'taxInvoiceProductId', |
|
||||
title: '发票产品id', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductCode', |
|
||||
title: '成品代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductName', |
|
||||
title: '成品名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'specificationModel', |
|
||||
title: '规格型号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'inventoryUnit', |
|
||||
title: '单位', |
|
||||
formatter: function (value, row, index) { |
|
||||
return $.table.selectDictLabel(inventoryUnitDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'commonCurrency', |
|
||||
title: '币别', |
|
||||
editable: { |
|
||||
type: 'select', |
|
||||
title: '币别', |
|
||||
emptytext: '币别', |
|
||||
source: function() { |
|
||||
let result = []; |
|
||||
for (let i = 0;i<commonCurrencyDatas.length;i++) { |
|
||||
result.push({value: commonCurrencyDatas[i].dictValue,text: commonCurrencyDatas[i].dictLabel}) |
|
||||
} |
|
||||
return result; |
|
||||
}, |
|
||||
validate: function (value) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'processPrice', |
|
||||
title: '单价', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '单价', |
|
||||
emptytext: '单价', |
|
||||
validate: function (v) { |
|
||||
if (isNaN(v)) return '单价必须是数字'; |
|
||||
if (v<=0) return '单价必须是正数'; |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'quantity', |
|
||||
title: '数量', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '数量', |
|
||||
emptytext: '数量', |
|
||||
validate: function (v) { |
|
||||
if (isNaN(v)) return '数量必须是数字'; |
|
||||
var ex = /^[1-9]\d*$/; |
|
||||
if (!ex.test(v)) return '数量必须是正整数'; |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'amountOfMoney', |
|
||||
title: '金额', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '金额', |
|
||||
emptytext: '金额', |
|
||||
validate: function (value) { |
|
||||
|
|
||||
} |
|
||||
}, |
|
||||
formatter:function(value, row, index) { |
|
||||
let total = row.processPrice * row.quantity; |
|
||||
row.amountOfMoney = row.processPrice * row.quantity; |
|
||||
return total.toFixed(2); |
|
||||
} |
|
||||
}] |
|
||||
}) |
|
||||
|
|
||||
//显示产品信息 |
|
||||
showProductData(); |
|
||||
|
|
||||
}) |
|
||||
|
|
||||
//获取客户信息并自动填入数据 |
|
||||
var customerListData = [] |
|
||||
function getCustomerListToForm() { |
|
||||
$.ajax({ |
|
||||
url: ctx + "system/customer/list", |
|
||||
type: "POST", |
|
||||
success: function (res) { |
|
||||
//console.log(res) |
|
||||
if (res.rows.length > 0) { |
|
||||
customerListData = res.rows; |
|
||||
//alert(JSON.stringify(data)); |
|
||||
for (let i in customerListData) { |
|
||||
$("select[name='enterpriseCode']").append("<option value='" + customerListData[i].enterpriseCode + "'>" + customerListData[i].enterpriseCode + "</option>"); |
|
||||
} |
|
||||
//选择元素的值时,触发变更事件 |
|
||||
$("select[name='enterpriseCode']").val(getData.enterpriseCode).trigger("change") |
|
||||
$("select[name='enterpriseCode']").change(function () { |
|
||||
var code = $(this).val(); |
|
||||
for (let i=0;i<customerListData.length;i++) { |
|
||||
if (customerListData[i].enterpriseCode == code) { |
|
||||
$("input[name='enterpriseName']").val(customerListData[i].enterpriseName); |
|
||||
$("input[name='contactNumber']").val(customerListData[i].contactNumber); |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
} else { |
|
||||
$.modal.msgError(res.msg); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
$.modal.msgError("后台出错啦!"); |
|
||||
|
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
/*成品内容*/ |
|
||||
//点击按钮显示成品信息模态框 |
|
||||
function showProductModal() { |
|
||||
if ($.validate.form()) { |
|
||||
$("#productInfoModal").modal("show"); |
|
||||
} else { |
|
||||
$.modal.alertWarning("请填写必填项"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//关闭成品信息模态框 |
|
||||
function closeProductModal() { |
|
||||
$("#productInfoModal").modal("hide"); |
|
||||
} |
|
||||
|
|
||||
//显示产品信息 |
|
||||
function showProductData() { |
|
||||
var options = { |
|
||||
id: 'productTable', |
|
||||
url: prefixfinishproduct + "/list", |
|
||||
showRefresh: false, |
|
||||
showToggle: false, |
|
||||
clickToSelect: true, |
|
||||
modalName: "产品资料", |
|
||||
columns: [{ |
|
||||
checkbox: true |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductId', |
|
||||
title: '成品id', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'customerNumber', |
|
||||
title: '客户料号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'typeMachine', |
|
||||
title: '机种' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductName', |
|
||||
title: '成品名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'enterpriseCode', |
|
||||
title: '客户代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'enterpriseName', |
|
||||
title: '客户名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'inventoryUnit', |
|
||||
title: '库存单位', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(inventoryUnitDatas, value); |
|
||||
}, |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'versionNumber', |
|
||||
title: '版本号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductCode', |
|
||||
title: '成品代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'safetyStock', |
|
||||
title: '安全库存', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'stockUnitWeight', |
|
||||
title: '单位重量', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'gpItemSelection', |
|
||||
title: 'GP项选择', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(gpItemSelectionDatas, value); |
|
||||
}, |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'inPlantCode', |
|
||||
title: '厂内编码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'whetherStop', |
|
||||
title: '料号是否停用', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(whetherStopDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'createrName', |
|
||||
title: '创建人', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'ordinalName', |
|
||||
title: '半成品对应完工工序名', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'originalNumber', |
|
||||
title: '原成品料号', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'customsName', |
|
||||
title: '海关名称', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'defaultWarehouse', |
|
||||
title: '默认仓库' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialCategory', |
|
||||
title: '类别', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(materialCategoryDatas, value); |
|
||||
}, |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'productionCategory', |
|
||||
title: '生产类别', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(productionCategoryDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductCategory', |
|
||||
title: '所属类别', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(finishProductCategoryDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'specificationModel', |
|
||||
title: '规格型号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'customerEngineer', |
|
||||
title: '客户工程师' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'productDescription', |
|
||||
title: '产品描述', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'maximumInventory', |
|
||||
title: '最高库存', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'productPrice', |
|
||||
title: '产品售价', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'componentName', |
|
||||
title: '组件名称', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'createrTime', |
|
||||
title: '创建日期', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'ordinalNumber', |
|
||||
title: '半成品对应完工工序号', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'defaultLocation', |
|
||||
title: '默认位置', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'hsNumber', |
|
||||
title: 'HS号', |
|
||||
visible: false |
|
||||
|
|
||||
}, |
|
||||
{ |
|
||||
field: 'kesNumber', |
|
||||
title: '科恩仕料号' |
|
||||
}] |
|
||||
}; |
|
||||
$.table.init(options); |
|
||||
} |
|
||||
|
|
||||
//表中添加选中的产品信息 |
|
||||
function addProductToTable() { |
|
||||
var data = $("#productTable").bootstrapTable("getSelections"); |
|
||||
var count = $('#addProductTable').bootstrapTable('getData').length; |
|
||||
var taxInvoiceCode = $("input[name='taxInvoiceCode']").val(); |
|
||||
var taxInvoiceNumber = $("input[name='taxInvoiceNumber']").val(); |
|
||||
// console.log(taxInvoiceCode); |
|
||||
// console.log(taxInvoiceNumber); |
|
||||
for (i = 0; i < data.length; i++) { |
|
||||
let finishProduct = $('#addProductTable').bootstrapTable('getRowByUniqueId', data[i].finishProductCode); |
|
||||
if (finishProduct != null) { |
|
||||
alert(finishProduct.finishProductName + "已存在,不可重复添加!"); |
|
||||
continue; |
|
||||
} |
|
||||
$("#addProductTable").bootstrapTable('insertRow', { |
|
||||
index: count + i, |
|
||||
row: { |
|
||||
taxInvoiceCode: taxInvoiceCode, |
|
||||
taxInvoiceNumber: taxInvoiceNumber, |
|
||||
finishProductCode: data[i].finishProductCode, |
|
||||
finishProductName: data[i].finishProductName, |
|
||||
specificationModel: data[i].specificationModel, |
|
||||
inventoryUnit: data[i].inventoryUnit, |
|
||||
commonCurrency: '', |
|
||||
quantity: '', |
|
||||
processPrice: '', |
|
||||
amountOfMoney: '' |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
$("#productTable").bootstrapTable("uncheckAll"); |
|
||||
closeProductModal(); |
|
||||
} |
|
||||
|
|
||||
//修改成品数据 |
|
||||
function updateProduct() { |
|
||||
|
|
||||
var list = $("#addProductTable").bootstrapTable('getData'); |
|
||||
// console.log(list); |
|
||||
for (let i = 0;i<list.length;i++) { |
|
||||
list[i].taxInvoiceCode = $("input[name='taxInvoiceCode']").val(); |
|
||||
list[i].taxInvoiceNumber = $("input[name='taxInvoiceNumber']").val(); |
|
||||
} |
|
||||
|
|
||||
let data = JSON.stringify($('#addProductTable').bootstrapTable('getData', true)); |
|
||||
let dataLength = $('#addProductTable').bootstrapTable('getData', true) |
|
||||
if (dataLength.length > 0) { |
|
||||
//添加 |
|
||||
$.ajax({ |
|
||||
url: prefixTaxInvoiceProduct + '/add', |
|
||||
type: "POST", |
|
||||
data: { |
|
||||
data: data |
|
||||
}, |
|
||||
dataType: "json", |
|
||||
success: function (resp) { |
|
||||
// console.log(resp) |
|
||||
$("#addProductTable").bootstrapTable('refresh'); |
|
||||
} |
|
||||
|
|
||||
}) |
|
||||
//修改 |
|
||||
$.ajax({ |
|
||||
url: prefixTaxInvoiceProduct + '/updateProduct', |
|
||||
type: "POST", |
|
||||
data: { |
|
||||
data: JSON.stringify(data) |
|
||||
}, |
|
||||
dataType: "json", |
|
||||
success: function (resp) { |
|
||||
// console.log(data) |
|
||||
// console.log(JSON.stringify(data)) |
|
||||
// console.log(resp) |
|
||||
$("#addProductTable").bootstrapTable('refresh'); |
|
||||
} |
|
||||
|
|
||||
}) |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// 删除成品 |
|
||||
function removeProduct() { |
|
||||
var addProductTableData = $("#addProductTable").bootstrapTable("getSelections"); |
|
||||
// console.log(addProductTableData) |
|
||||
var ids = []; |
|
||||
for (let i = 0;i < addProductTableData.length;i++) { |
|
||||
ids.push(addProductTableData[i].taxInvoiceProductId) |
|
||||
} |
|
||||
// console.log(ids) |
|
||||
// console.log(ids.toString()) |
|
||||
// console.log(JSON.stringify(ids)) |
|
||||
if (addProductTableData.length > 0) { |
|
||||
$.modal.confirm("是否确认要删除选中的产品?" + |
|
||||
"确认后将直接删除", function (){ |
|
||||
$.ajax({ |
|
||||
url: prefixTaxInvoiceProduct + "/remove", |
|
||||
type: "POST", |
|
||||
data: { |
|
||||
ids: ids.toString() |
|
||||
}, |
|
||||
success: function (res) { |
|
||||
// console.log(ids) |
|
||||
// console.log(res) |
|
||||
$.modal.msgSuccess("删除成功") |
|
||||
$("#addProductTable").bootstrapTable('refreshOptions', {pageNumber: 1}); // pageNumber:1, 指定页码为第1页 |
|
||||
$("#addProductTable").bootstrapTable('refresh'); |
|
||||
getTotal(); |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
|
|
||||
} else { |
|
||||
alert("请选择需要删除的数据") |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
//计算全部数量、金额、大写 |
|
||||
function getTotal() { |
|
||||
var getDataAll = $("#addProductTable").bootstrapTable('getData'); |
|
||||
// console.log(getDataAll) |
|
||||
var totalQuantity = 0; |
|
||||
var totalMoney = 0.00; |
|
||||
for (let i = 0;i<getDataAll.length;i++) { |
|
||||
// console.log(getDataAll[i]) |
|
||||
totalQuantity = Math.floor(totalQuantity + Number(getDataAll[i].quantity)); |
|
||||
totalMoney = totalMoney + getDataAll[i].amountOfMoney; |
|
||||
} |
|
||||
$("input[name='totalQuantity']").val(totalQuantity) |
|
||||
$("input[name='totalMoney']").val(totalMoney.toFixed(2)) |
|
||||
$.ajax({ |
|
||||
url: prefix + '/getMoneyUpCase', |
|
||||
type: 'post', |
|
||||
data: { |
|
||||
totalMoney: totalMoney |
|
||||
}, |
|
||||
success: function (res) { |
|
||||
// console.log(res) |
|
||||
$("input[name='totalMoneyUpCase']").val(res) |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
@ -1,753 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('国税发票列表')" /> |
|
||||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|
||||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|
||||
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script> |
|
||||
<!-- <script src="https://cdn.staticfile.org/axios/1.1.3/axios.min.js"></script>--> |
|
||||
|
|
||||
<style> |
|
||||
.table-striped{ |
|
||||
border: 0px!important; |
|
||||
white-space:nowrap; |
|
||||
} |
|
||||
|
|
||||
.base-taxInvoice-order { |
|
||||
display: flex; |
|
||||
flex-wrap: wrap; |
|
||||
justify-content: space-between; |
|
||||
} |
|
||||
|
|
||||
.base-taxInvoice-order .form-group { |
|
||||
width: 30%; |
|
||||
} |
|
||||
|
|
||||
.details-title { |
|
||||
width: 100%; |
|
||||
position: fixed; |
|
||||
font-size: 20px; |
|
||||
padding: 10px 0; |
|
||||
text-align: center; |
|
||||
background-color: #a7b1c2; |
|
||||
color: #FFFFFF; |
|
||||
z-index: 9999; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
.details-body { |
|
||||
padding-top: 80px; |
|
||||
overflow-y: auto; |
|
||||
max-height: 750px; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
</style> |
|
||||
</head> |
|
||||
<body class="gray-bg"> |
|
||||
<div class="container-div"> |
|
||||
<div class="row"> |
|
||||
<div class="col-sm-12 search-collapse"> |
|
||||
<form id="formId"> |
|
||||
<div class="select-list"> |
|
||||
<ul> |
|
||||
<li> |
|
||||
<label>发票号码:</label> |
|
||||
<input type="text" name="taxInvoiceNumber"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>送货单号:</label> |
|
||||
<input type="text" name="deliveryNoteNumber"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>客户代码:</label> |
|
||||
<select name="enterpriseCode"> |
|
||||
<option value="">所有</option> |
|
||||
</select> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>客户名称:</label> |
|
||||
<select name="enterpriseName"> |
|
||||
<option value="">所有</option> |
|
||||
</select> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>国税发票编号:</label> |
|
||||
<input type="text" name="taxInvoiceNo"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>是否收到款:</label> |
|
||||
<select name="getmoneyFlag" th:with="type=${@dict.getType('sys_whether')}"> |
|
||||
<option value="">所有</option> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
||||
</select> |
|
||||
</li> |
|
||||
<li> |
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> |
|
||||
</li> |
|
||||
</ul> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
|
|
||||
<div class="btn-group-sm" id="toolbar" role="group"> |
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="taxInvoice:taxInvoiceInfo:add"> |
|
||||
<i class="fa fa-plus"></i> 添加 |
|
||||
</a> |
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="taxInvoice:taxInvoiceInfo:edit"> |
|
||||
<i class="fa fa-edit"></i> 修改 |
|
||||
</a> |
|
||||
<a class="btn btn-danger single disabled" onclick="removeSelectedInvoice()" shiro:hasPermission="taxInvoice:taxInvoiceInfo:removeSelectedInvoice"> |
|
||||
<i class="fa fa-remove"></i> 删除 |
|
||||
</a> |
|
||||
<a class="btn btn-warning single disabled" onclick="exportInvoice()" shiro:hasPermission="taxInvoice:taxInvoiceInfo:exportInvoice"> |
|
||||
<i class="fa fa-download"></i> 导出 |
|
||||
</a> |
|
||||
<a class="btn btn-info single disabled" onclick="showTaxInvoiceDetail()" shiro:hasPermission="taxInvoice:taxInvoiceInfo:showTaxInvoiceDetail"> |
|
||||
<i class="fa fa-file-text"></i> 查看详情 |
|
||||
</a> |
|
||||
</div> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<table id="bootstrap-table" style="white-space:nowrap"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<!--详情信息模态框--> |
|
||||
<div class="modal inmodal" id="taxInvoiceDetailsModal" tabindex="-1" |
|
||||
role="dilog" aria-hidden="true"> |
|
||||
<div class="modal-dialog" style="width: 1400px;max-height: 800px; background-color: #FFFFFF"> |
|
||||
<div class="modal-content" style="background-color: #FFFFFF"> |
|
||||
<div class="details-title">订单详情</div> |
|
||||
<div class="modal-body details-body"> |
|
||||
<div class="row"> |
|
||||
<div class="base-taxInvoice-order"> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">发票编号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="taxInvoiceCode" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">发票号码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="taxInvoiceNumber" id="taxInvoiceNumberDetail" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">送货单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="deliveryNoteNumber" id="deliveryNoteNumberDetail" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">客户代码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="enterpriseCode" id="enterpriseCodeDetail" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">客户名称:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="enterpriseName" id="enterpriseNameDetail" class="form-control m-b" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">合同号码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="contractNumber" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">付款条件:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="paymentTerm" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">开票日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="billingDate" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">运输方式:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="transportWay" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">运输工具:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="transportMeans" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">离境日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="departureDate" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">出口海关:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="exportCustoms" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">币别:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="billCommonCurrency" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">件数:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="packagesNumber" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">抵运国(地区):</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="arrivalArea" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">指运港:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="portOfDestination" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">提运单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="hoistingNumber" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">发票印字版号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="printVersionNumber" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">备注:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="billRemarks" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">国税发票编号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="taxInvoiceNo" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">是否收到款:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="getmoneyFlag" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div style="width:100%;height:1px;border-top:solid lightgrey 1px;margin-top:50px;padding:50px 0 0 0px;"> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">全部数量:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="totalQuantity" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">全部金额:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="totalMoney" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">全部金额(大写):</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="totalMoneyUpCase" class="form-control" type="text" readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
</div> |
|
||||
<div class="taxInvoiceList" style="margin-top: 20px;"> |
|
||||
<div class="taxInvoiceProductList"> |
|
||||
<div class="col-sm-12 table-striped" style="margin-top: 20px;"> |
|
||||
<div class="details" style="font-size: 18px">产品信息</div> |
|
||||
<table id="taxInvoiceProductTable"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="modal-footer" style=" border-top: none;background-color: #a7b1c2"> |
|
||||
<!-- <button type="button" class="btn btn-success" onclick="btnAudit()">审核确认</button>--> |
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="closeTaxInvoiceDetailModal()">关闭</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<th:block th:include="include :: footer" /> |
|
||||
<th:block th:include="include :: select2-js"/> |
|
||||
<script th:inline="javascript"> |
|
||||
var editFlag = [[${@permission.hasPermi('taxInvoice:taxInvoiceInfo:edit')}]]; |
|
||||
var removeFlag = [[${@permission.hasPermi('taxInvoice:taxInvoiceInfo:remove')}]]; |
|
||||
var billCommonCurrencyDatas = [[${@dict.getType('sys_coin_class')}]]; |
|
||||
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]]; |
|
||||
var getmoneyFlagDatas = [[${@dict.getType('sys_whether')}]]; |
|
||||
var prefix = ctx + "taxInvoice/taxInvoiceInfo"; |
|
||||
var prefixProduct = ctx + "taxInvoice/taxInvoiceProduct"; |
|
||||
|
|
||||
$(function() { |
|
||||
var options = { |
|
||||
url: prefix + "/list", |
|
||||
createUrl: prefix + "/add", |
|
||||
updateUrl: prefix + "/edit/{id}", |
|
||||
removeUrl: prefix + "/remove", |
|
||||
exportUrl: prefix + "/export", |
|
||||
clickToSelect: true, |
|
||||
modalName: "国税发票", |
|
||||
columns: [{ |
|
||||
checkbox: true |
|
||||
}, |
|
||||
{ |
|
||||
field: 'taxInvoiceId', |
|
||||
title: '国税发票id', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'taxInvoiceCode', |
|
||||
title: '发票编号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'taxInvoiceNumber', |
|
||||
title: '发票号码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'deliveryNoteNumber', |
|
||||
title: '送货单号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'enterpriseCode', |
|
||||
title: '客户代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'enterpriseName', |
|
||||
title: '客户名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'contractNumber', |
|
||||
title: '合同号码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'paymentTerm', |
|
||||
title: '付款条件' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'billingDate', |
|
||||
title: '开票日期' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'transportWay', |
|
||||
title: '运输方式' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'transportMeans', |
|
||||
title: '运输工具' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'departureDate', |
|
||||
title: '离境日期' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'exportCustoms', |
|
||||
title: '出口海关' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'billCommonCurrency', |
|
||||
title: '币种', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(billCommonCurrencyDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'packagesNumber', |
|
||||
title: '件数' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'arrivalArea', |
|
||||
title: '抵运国' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'portOfDestination', |
|
||||
title: '指运港' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'hoistingNumber', |
|
||||
title: '提运单号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'printVersionNumber', |
|
||||
title: '发票印字版号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'billRemarks', |
|
||||
title: '备注' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'taxInvoiceNo', |
|
||||
title: '国税发票编号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'getmoneyFlag', |
|
||||
title: '是否收到款', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(getmoneyFlagDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'firstAddTime', |
|
||||
title: '录入时间', |
|
||||
formatter: function (value, row, index) { |
|
||||
if (value == null) { |
|
||||
return " "; |
|
||||
} else { |
|
||||
return value; |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'updateInfoTime', |
|
||||
title: '上次修改时间', |
|
||||
formatter: function (value, row, index) { |
|
||||
if (value == null) { |
|
||||
return " "; |
|
||||
} else { |
|
||||
var vArr = value.split(',') |
|
||||
return vArr[0]; |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'standbyOne', |
|
||||
title: '备用一', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'standbyTwo', |
|
||||
title: '备用二', |
|
||||
visible: false |
|
||||
}] |
|
||||
/*{ |
|
||||
title: '操作', |
|
||||
align: 'center', |
|
||||
formatter: function(value, row, index) { |
|
||||
var actions = []; |
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.taxInvoiceId + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|
||||
return actions.join(''); |
|
||||
} |
|
||||
}*/ |
|
||||
}; |
|
||||
$.table.init(options); |
|
||||
|
|
||||
//获取客户信息 |
|
||||
getCustomerList(); |
|
||||
}); |
|
||||
|
|
||||
/*获取客户信息*/ |
|
||||
function getCustomerList() { |
|
||||
$.ajax({ |
|
||||
url: prefix + "/getCustomerList", |
|
||||
type: "POST", |
|
||||
success: function (res) { |
|
||||
//console.log(res) |
|
||||
if (res.length > 0) { |
|
||||
customerListData = res; |
|
||||
//alert(JSON.stringify(data)); |
|
||||
for (let i in customerListData) { |
|
||||
$("select[name='enterpriseCode']").append("<option value='" + customerListData[i].enterpriseCode + "'>" + customerListData[i].enterpriseCode + "</option>"); |
|
||||
$("select[name='enterpriseName']").append("<option value='" + customerListData[i].enterpriseName + "'>" + customerListData[i].enterpriseName + "</option>"); |
|
||||
} |
|
||||
|
|
||||
} else { |
|
||||
$.modal.msgError(res.msg); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
$.modal.msgError("后台出错啦!"); |
|
||||
|
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
/*删除订单信息判断*/ |
|
||||
function removeSelectedInvoice() { |
|
||||
table.set(); |
|
||||
var invoiceId = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|
||||
var selectedData = $('#bootstrap-table').bootstrapTable("getSelections"); |
|
||||
if (selectedData.length === 1) { |
|
||||
$.ajax({ |
|
||||
url: prefixProduct + '/list?' + 'taxInvoiceCode=' + selectedData[0].taxInvoiceCode + '&taxInvoiceNumber=' + selectedData[0].taxInvoiceNumber, |
|
||||
type: "post", |
|
||||
data: {}, |
|
||||
success: function (res) { |
|
||||
var productIds = [] |
|
||||
for (let j=0;j<res.rows.length;j++) { |
|
||||
productIds.push(res.rows[j].taxInvoiceProductId) |
|
||||
} |
|
||||
// console.log(productIds) |
|
||||
if (res.rows.length > 0 ) { |
|
||||
$.modal.confirm("选中发票含有"+ res.rows.length +"条产品信息将一并删除,确认要删除选中的" + selectedData.length + "条数据吗?", function() { |
|
||||
removeData(invoiceId,productIds) |
|
||||
}) |
|
||||
} else { |
|
||||
$.modal.confirm("确认要删除选中的" + selectedData.length + "条数据吗?", function() { |
|
||||
removeData(invoiceId,productIds); |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
} else { |
|
||||
$.modal.alertWarning("请选择一条记录"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//删除发票数据和成品数据 |
|
||||
function removeData(invoiceId,productIds) { |
|
||||
$.ajax({ |
|
||||
url: prefix + '/remove', |
|
||||
type: "POST", |
|
||||
data: { |
|
||||
ids: invoiceId.join() |
|
||||
}, |
|
||||
dataType: "json", |
|
||||
success: function (resp) { |
|
||||
// console.log(resp) |
|
||||
$("#bootstrap-table").bootstrapTable('refresh'); |
|
||||
} |
|
||||
|
|
||||
}) |
|
||||
$.ajax({ |
|
||||
url: prefixProduct + '/remove', |
|
||||
type: "POST", |
|
||||
data: { |
|
||||
ids: productIds.join() |
|
||||
}, |
|
||||
dataType: "json", |
|
||||
success: function (resp) { |
|
||||
// console.log(data) |
|
||||
// console.log(JSON.stringify(data)) |
|
||||
// console.log(resp) |
|
||||
$("#bootstrap-table").bootstrapTable('refresh'); |
|
||||
} |
|
||||
|
|
||||
}) |
|
||||
$.modal.msgSuccess("删除成功") |
|
||||
} |
|
||||
|
|
||||
//导出发票信息 |
|
||||
function exportInvoice() { |
|
||||
// rows为选中行的id |
|
||||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|
||||
//选择的行数据 |
|
||||
var selectData = $("#bootstrap-table").bootstrapTable("getSelections") |
|
||||
// console.log(JSON.stringify(selectData)) |
|
||||
// console.log(selectData) |
|
||||
|
|
||||
if (rows.length !== 1) { |
|
||||
$.modal.alert("请选择一条记录"); |
|
||||
return; |
|
||||
} else { |
|
||||
$.modal.confirm("是否确认要导出本条信息?", function (){ |
|
||||
axios({ |
|
||||
// url: prefix + '/exportInvoice?taxInvoiceCode='+selectData[0].taxInvoiceCode+'&taxInvoiceNumber='+selectData[0].taxInvoiceNumber, |
|
||||
url: prefix + '/exportInvoice', |
|
||||
data:{ |
|
||||
selectData:JSON.stringify(selectData) |
|
||||
}, |
|
||||
method: 'POST', |
|
||||
responseType: 'blob' |
|
||||
}).then(response => { |
|
||||
// console.log(response) |
|
||||
// console.log(response.data) |
|
||||
const URL = window.URL.createObjectURL(response.data) |
|
||||
// 创建隐藏<a>标签进行下载 |
|
||||
const tempLink = document.createElement('a') |
|
||||
tempLink.style.display = 'none' |
|
||||
tempLink.href = URL |
|
||||
let time = new Date().toLocaleString() |
|
||||
tempLink.setAttribute('download', time + "国税发票.xlsx") |
|
||||
if (typeof tempLink.download === 'undefined') { |
|
||||
tempLink.setAttribute('target', '_blank') |
|
||||
} |
|
||||
document.body.appendChild(tempLink) |
|
||||
tempLink.click() |
|
||||
document.body.removeChild(tempLink)// 移除dom元素 |
|
||||
window.URL.revokeObjectURL(URL)//释放内存 |
|
||||
}) |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//详细信息页面 |
|
||||
function showTaxInvoiceDetail() { |
|
||||
$("#taxInvoiceDetailsModal").modal("show"); |
|
||||
let selectData = $("#bootstrap-table").bootstrapTable("getSelections") |
|
||||
$("input[name='taxInvoiceCode']").val(selectData[0].taxInvoiceCode) |
|
||||
$('#taxInvoiceNumberDetail').val(selectData[0].taxInvoiceNumber) |
|
||||
$('#deliveryNoteNumberDetail').val(selectData[0].deliveryNoteNumber) |
|
||||
$("input[name='enterpriseCode']").val(selectData[0].enterpriseCode) |
|
||||
$("input[name='enterpriseName']").val(selectData[0].enterpriseName) |
|
||||
$("input[name='contractNumber']").val(selectData[0].contractNumber) |
|
||||
$("input[name='paymentTerm']").val(selectData[0].paymentTerm) |
|
||||
$("input[name='billingDate']").val(selectData[0].billingDate) |
|
||||
$("input[name='transportWay']").val(selectData[0].transportWay) |
|
||||
$("input[name='transportMeans']").val(selectData[0].transportMeans) |
|
||||
$("input[name='departureDate']").val(selectData[0].departureDate) |
|
||||
$("input[name='exportCustoms']").val(selectData[0].exportCustoms) |
|
||||
$("input[name='billCommonCurrency']").val(selectData[0].billCommonCurrency) |
|
||||
$("input[name='packagesNumber']").val(selectData[0].packagesNumber) |
|
||||
$("input[name='arrivalArea']").val(selectData[0].arrivalArea) |
|
||||
$("input[name='portOfDestination']").val(selectData[0].portOfDestination) |
|
||||
$("input[name='hoistingNumber']").val(selectData[0].hoistingNumber) |
|
||||
$("input[name='printVersionNumber']").val(selectData[0].printVersionNumber) |
|
||||
$("input[name='billRemarks']").val(selectData[0].billRemarks) |
|
||||
$('#taxInvoiceNo').val(selectData[0].taxInvoiceNo) |
|
||||
if(selectData[0].getmoneyFlag == 1) { |
|
||||
$("input[name='getmoneyFlag']").val("是") |
|
||||
} else if(selectData[0].getmoneyFlag == 0){ |
|
||||
$("input[name='getmoneyFlag']").val("否") |
|
||||
} else { |
|
||||
$("input[name='getmoneyFlag']").val("") |
|
||||
} |
|
||||
|
|
||||
$('#taxInvoiceProductTable').bootstrapTable('destroy'); |
|
||||
$('#taxInvoiceProductTable').bootstrapTable({ |
|
||||
url: prefixProduct + '/list', |
|
||||
pagination: false, |
|
||||
// pageNumber: 1, |
|
||||
// pageSize: 10, |
|
||||
// pageList: [10, 25, 50, 100], |
|
||||
showRefresh: false, |
|
||||
method: "post", |
|
||||
contentType: "application/x-www-form-urlencoded", |
|
||||
striped: true, // 是否显示行间隔色 |
|
||||
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
|
||||
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*) |
|
||||
clickToSelect: true, // 是否启用点击选中行 |
|
||||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|
||||
cardView: false, // 是否显示详细视图 |
|
||||
detailView: false, // 是否显示父子表 |
|
||||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|
||||
showExport: false, // 是否显示导出按钮 |
|
||||
singleSelect: true, |
|
||||
paginationDetailHAlign: ' hiddenDetailInfo', |
|
||||
height: 150, |
|
||||
onLoadSuccess: function (data) { |
|
||||
//计算全部数量、金额、大写 |
|
||||
getTotal(); |
|
||||
|
|
||||
}, |
|
||||
queryParams: function (params) { |
|
||||
//console.log("123"); |
|
||||
var curParams = { |
|
||||
// 传递参数查询参数 |
|
||||
// pageSize: params.limit, |
|
||||
// pageNum: params.offset / params.limit + 1, |
|
||||
taxInvoiceCode: selectData[0].taxInvoiceCode, |
|
||||
taxInvoiceNumber: selectData[0].taxInvoiceNumber |
|
||||
}; |
|
||||
// console.log($("input[name='orderNumber']").val()); |
|
||||
return curParams |
|
||||
}, |
|
||||
columns: [ |
|
||||
{ |
|
||||
field: 'taxInvoiceProductId', |
|
||||
title: '国税产品id', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'taxInvoiceCode', |
|
||||
title: '发票编号', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'taxInvoiceNumber', |
|
||||
title: '发票号码', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductCode', |
|
||||
title: '成品代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'finishProductName', |
|
||||
title: '成品名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'specificationModel', |
|
||||
title: '规格型号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'inventoryUnit', |
|
||||
title: '单位' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'commonCurrency', |
|
||||
title: '币别', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(commonCurrencyDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'quantity', |
|
||||
title: '数量' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'processPrice', |
|
||||
title: '单价' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'amountOfMoney', |
|
||||
title: '金额' |
|
||||
}] |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//关闭详细信息页面 |
|
||||
function closeTaxInvoiceDetailModal() { |
|
||||
$("#taxInvoiceDetailsModal").modal("hide"); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
//计算全部数量、金额、大写 |
|
||||
function getTotal() { |
|
||||
var getDataAll = $("#taxInvoiceProductTable").bootstrapTable('getData'); |
|
||||
// console.log(getDataAll) |
|
||||
var totalQuantity = 0; |
|
||||
var totalMoney = 0.00; |
|
||||
for (let i = 0;i<getDataAll.length;i++) { |
|
||||
// console.log(getDataAll[i]) |
|
||||
totalQuantity = Math.floor(totalQuantity + Number(getDataAll[i].quantity)); |
|
||||
totalMoney = totalMoney + parseFloat(getDataAll[i].amountOfMoney); |
|
||||
} |
|
||||
$("input[name='totalQuantity']").val(totalQuantity) |
|
||||
$("input[name='totalMoney']").val(parseFloat(totalMoney).toFixed(2)) |
|
||||
$.ajax({ |
|
||||
url: prefix + '/getMoneyUpCase', |
|
||||
type: 'post', |
|
||||
data: { |
|
||||
totalMoney: totalMoney |
|
||||
}, |
|
||||
success: function (res) { |
|
||||
// console.log(res) |
|
||||
$("input[name='totalMoneyUpCase']").val(res) |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
Loading…
Reference in new issue