工程预付款统计功能开发
This commit is contained in:
parent
d482185e2a
commit
11086496c9
|
|
@ -0,0 +1,171 @@
|
|||
package com.bonus.boot.manager.ca.bm.controller;
|
||||
|
||||
import com.bonus.boot.manager.ca.bm.entity.GoodsInfoBean;
|
||||
import com.bonus.boot.manager.ca.bm.entity.OperationsBean;
|
||||
import com.bonus.boot.manager.ca.bm.entity.PrepaymentBean;
|
||||
import com.bonus.boot.manager.ca.bm.service.PrepaymentService;
|
||||
import com.bonus.boot.manager.manager.annotation.LogAnnotation;
|
||||
import com.bonus.boot.manager.manager.entity.R;
|
||||
import com.bonus.boot.manager.manager.model.SysUser;
|
||||
import com.bonus.boot.manager.manager.table.PageTableRequest;
|
||||
import com.bonus.boot.manager.manager.utils.AjaxRes;
|
||||
import com.bonus.boot.manager.manager.utils.GlobalConst;
|
||||
import com.bonus.boot.manager.manager.utils.UserUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* packageName com.bonus.boot.manager.ca.bm.controller
|
||||
*
|
||||
* @author lsun
|
||||
* @version 1.0.0
|
||||
* @className ProController (此处以class为例)
|
||||
* @date 2025/4/15
|
||||
*/
|
||||
|
||||
@Api(tags = "工程预付款统计")
|
||||
@RestController
|
||||
@RequestMapping(value = "/prepayment")
|
||||
public class PrepaymentController {
|
||||
|
||||
@Resource(name = "PrepaymentService")
|
||||
private PrepaymentService service;
|
||||
|
||||
@PostMapping("/getList")
|
||||
@ApiOperation(value = "查询")
|
||||
// @PreAuthorize("hasAuthority('sys:prepayment:query')")
|
||||
public R getList(PageTableRequest request) {
|
||||
List<PrepaymentBean> list = service.getList(request.getParams(), request.getOffset(), request.getLimit());
|
||||
return list.size() > 0 ? R.okTable(list, list.size()):R.failTable("暂无数据");
|
||||
}
|
||||
|
||||
@RequestMapping(value = "addPrepayment", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "工程预付款统计-新增")
|
||||
// @PreAuthorize("hasAuthority('sys:payable:add')")
|
||||
public AjaxRes addPrepayment(@RequestBody PrepaymentBean prepaymentBean) {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int i = service.addPrepayment(prepaymentBean);
|
||||
if(i>0){
|
||||
ar.setFailMsg(GlobalConst.SAVE_SUCCEED);
|
||||
}else{
|
||||
ar.setFailMsg(GlobalConst.SAVE_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getListById", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "工程预付款统计-查询信息")
|
||||
public AjaxRes getListById(String id){
|
||||
AjaxRes ar = new AjaxRes();
|
||||
PrepaymentBean bean = service.getListById(id);
|
||||
bean.setUserId(UserUtil.getLoginUser().getId().toString());
|
||||
bean.setUserName(UserUtil.getLoginUser().getUsername());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if(bean !=null){
|
||||
map.put("prepaymentBean",bean);
|
||||
}
|
||||
ar.setSucceed(map,GlobalConst.DATA_SUCCEED);
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "updatePrepayment", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "工程预付款统计-修改")
|
||||
// @PreAuthorize("hasAuthority('sys:payable:add')")
|
||||
public AjaxRes updatePrepayment(@RequestBody PrepaymentBean bean) {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int i = service.updatePrepayment(bean);
|
||||
if(i>0){
|
||||
ar.setFailMsg(GlobalConst.SAVE_SUCCEED);
|
||||
}else{
|
||||
ar.setFailMsg(GlobalConst.SAVE_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@LogAnnotation
|
||||
@DeleteMapping("/delPrepayment/{id}")
|
||||
@ApiOperation(value = "工程预付款统计-删除")
|
||||
// @PreAuthorize("hasAuthority('sys:goods:del')")
|
||||
public void delPrepayment(@PathVariable Long id) {
|
||||
service.delPrepayment(id);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "addOperations", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "工程预付款统计-数据更新-新增")
|
||||
// @PreAuthorize("hasAuthority('sys:payable:add')")
|
||||
public AjaxRes addOperations(@RequestBody OperationsBean bean) {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int i = service.addOperations(bean);
|
||||
if(i>0){
|
||||
ar.setFailMsg(GlobalConst.SAVE_SUCCEED);
|
||||
}else if(i==-1){
|
||||
ar.setFailMsg("当前月份已经存在");
|
||||
} else{
|
||||
ar.setFailMsg(GlobalConst.SAVE_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "updateOperations", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "工程预付款统计-数据更新-修改")
|
||||
// @PreAuthorize("hasAuthority('sys:payable:add')")
|
||||
public AjaxRes updateOperations(@RequestBody OperationsBean bean) {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int i = service.updateOperations(bean);
|
||||
if(i>0){
|
||||
ar.setFailMsg(GlobalConst.SAVE_SUCCEED);
|
||||
}else if(i==-1){
|
||||
ar.setFailMsg("当前月份已经存在");
|
||||
} else{
|
||||
ar.setFailMsg(GlobalConst.SAVE_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getOperationsById", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "工程预付款统计-数据更新-查询信息")
|
||||
public AjaxRes getOperationsById(String id){
|
||||
AjaxRes ar = new AjaxRes();
|
||||
OperationsBean bean = service.getOperationsById(id);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if(bean !=null){
|
||||
map.put("operationsBean",bean);
|
||||
}
|
||||
ar.setSucceed(map,GlobalConst.DATA_SUCCEED);
|
||||
return ar;
|
||||
}
|
||||
|
||||
@LogAnnotation
|
||||
@DeleteMapping("/delOperations/{id}")
|
||||
@ApiOperation(value = "工程预付款统计-数据更新-删除")
|
||||
// @PreAuthorize("hasAuthority('sys:goods:del')")
|
||||
public void delOperations(@PathVariable Long id) {
|
||||
service.delOperations(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/getOperationsList")
|
||||
@ApiOperation(value = "数据更新-查询")
|
||||
// @PreAuthorize("hasAuthority('sys:prepayment:query')")
|
||||
public R getOperationsList(PageTableRequest request) {
|
||||
List<OperationsBean> list = service.getOperationsList(request.getParams(), request.getOffset(), request.getLimit());
|
||||
return list.size() > 0 ? R.okTable(list, list.size()):R.failTable("暂无数据");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.bonus.boot.manager.ca.bm.dao;
|
||||
|
||||
import com.bonus.boot.manager.ca.bm.entity.OperationsBean;
|
||||
import com.bonus.boot.manager.ca.bm.entity.PrepaymentBean;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* packageName com.bonus.boot.manager.ca.bm.dao
|
||||
*
|
||||
* @author lsun
|
||||
* @version 1.0.0
|
||||
* @className ProDao (此处以class为例)
|
||||
* @date 2025/4/15
|
||||
*/
|
||||
@Repository(value = "PrepaymentDao")
|
||||
public interface PrepaymentDao {
|
||||
|
||||
List<PrepaymentBean> getList(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
|
||||
|
||||
int addPrepayment(PrepaymentBean prepaymentBean);
|
||||
|
||||
int addOperations(OperationsBean bean);
|
||||
|
||||
void updatePrepaymentId(OperationsBean bean);
|
||||
|
||||
PrepaymentBean getListById(String id);
|
||||
|
||||
List<OperationsBean> getOperationsList(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
|
||||
|
||||
int updatePrepayment(PrepaymentBean bean);
|
||||
|
||||
void delPrepayment(@Param("id")Long id, @Param("userId")String userId);
|
||||
|
||||
int getMath(OperationsBean bean);
|
||||
|
||||
int updateOperations(OperationsBean bean);
|
||||
|
||||
void delOperations(@Param("id")Long id, @Param("userId")String userId);
|
||||
|
||||
/**
|
||||
* 查询工程预付款统计数据更新id
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
OperationsBean getOperationsById(String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.bonus.boot.manager.ca.bm.entity;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class OperationsBean {
|
||||
private String id;
|
||||
private String prepaymentId;//关联的预付款记录ID
|
||||
private String month;//月份
|
||||
private String operationType;//1:冲销,2:新增
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private BigDecimal amount;//调整金额
|
||||
|
||||
private String executor;//经办人
|
||||
private String remarks;//备注
|
||||
private String nextMonth;//下月工作计划,月度冲销计划及措施
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private BigDecimal proposedAmount;//拟冲销金额或新增金额
|
||||
|
||||
private String handler;//负责人
|
||||
private String nextRemarks;//下月备注
|
||||
private String createdTime;//创建时间
|
||||
private String updatedTime;//更新时间
|
||||
private String keyword; //关键字
|
||||
|
||||
private String operator;//更新人
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private BigDecimal currentBalance;//当前余额
|
||||
|
||||
private String userId; //用户id
|
||||
private String userName; //用户名
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.bonus.boot.manager.ca.bm.entity;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class PrepaymentBean {
|
||||
private String id;
|
||||
private String projectCode;//承揽合同编码
|
||||
private String projectName;//承揽合同名称(工程名称)
|
||||
private String businessUnit;//责任单位
|
||||
private String contactUnit;//往来单位
|
||||
private String type;//预付款类型
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private BigDecimal initialAmount;//初始金额
|
||||
|
||||
private String firstPaymentDate;//首次支付日期
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private BigDecimal currentBalance;//当前余额
|
||||
|
||||
private String remarks;//备注
|
||||
private String operator;//更新人
|
||||
private String createdTime;//创建时间
|
||||
private String updatedTime;//更新时间
|
||||
private String keyword; //关键字
|
||||
|
||||
private String agingMonths; //账龄(月)
|
||||
private String state; //状态
|
||||
|
||||
private String userId; //用户id
|
||||
private String userName; //用户名
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
package com.bonus.boot.manager.ca.bm.service;
|
||||
|
||||
import com.bonus.boot.manager.ca.bm.entity.OperationsBean;
|
||||
import com.bonus.boot.manager.ca.bm.entity.PrepaymentBean;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* packageName com.bonus.boot.manager.ca.bm.service
|
||||
*
|
||||
* @author lsun
|
||||
* @version 1.0.0
|
||||
* @className ProService (此处以class为例)
|
||||
* @date 2025/4/15
|
||||
*/
|
||||
public interface PrepaymentService {
|
||||
/**
|
||||
* 查询工程预付款统计
|
||||
* @param params
|
||||
* @param offset
|
||||
* @param limit
|
||||
* @return
|
||||
*/
|
||||
List<PrepaymentBean> getList(Map<String, Object> params, Integer offset, Integer limit);
|
||||
|
||||
/**
|
||||
* 新增工程预付款统计
|
||||
* @param prepaymentBean
|
||||
* @return
|
||||
*/
|
||||
int addPrepayment(PrepaymentBean prepaymentBean);
|
||||
|
||||
/**
|
||||
* 查询工程预付款统计id
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
PrepaymentBean getListById(String id);
|
||||
|
||||
/**
|
||||
* 修改工程预付款统计
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
int updatePrepayment(PrepaymentBean bean);
|
||||
|
||||
/**
|
||||
* 删除工程预付款统计
|
||||
* @param id
|
||||
*/
|
||||
void delPrepayment(Long id);
|
||||
|
||||
/**
|
||||
* 查询工程预付款统计数据更新
|
||||
* @param params
|
||||
* @param offset
|
||||
* @param limit
|
||||
* @return
|
||||
*/
|
||||
List<OperationsBean> getOperationsList(Map<String, Object> params, Integer offset, Integer limit);
|
||||
|
||||
/**
|
||||
* 新增工程预付款统计数据更新
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
int addOperations(OperationsBean bean);
|
||||
|
||||
/**
|
||||
* 修改工程预付款统计数据更新
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
int updateOperations(OperationsBean bean);
|
||||
|
||||
/**
|
||||
* 删除工程预付款统计数据更新
|
||||
* @param id
|
||||
*/
|
||||
void delOperations(Long id);
|
||||
|
||||
/**
|
||||
* 查询工程预付款统计数据更新id
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
OperationsBean getOperationsById(String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
package com.bonus.boot.manager.ca.bm.service.impl;
|
||||
|
||||
import com.bonus.boot.manager.ca.bm.dao.PrepaymentDao;
|
||||
import com.bonus.boot.manager.ca.bm.entity.OperationsBean;
|
||||
import com.bonus.boot.manager.ca.bm.entity.PrepaymentBean;
|
||||
import com.bonus.boot.manager.ca.bm.service.PrepaymentService;
|
||||
import com.bonus.boot.manager.ca.im.dao.PayableDao;
|
||||
import com.bonus.boot.manager.manager.entity.LoginUser;
|
||||
import com.bonus.boot.manager.manager.utils.UserUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* packageName com.bonus.boot.manager.ca.bm.service.impl
|
||||
*
|
||||
* @author lsun
|
||||
* @version 1.0.0
|
||||
* @className ProServiceImpl (此处以class为例)
|
||||
* @date 2025/4/15
|
||||
*/
|
||||
@Service(value = "PrepaymentService")
|
||||
public class PrepaymentServiceImpl implements PrepaymentService {
|
||||
|
||||
@Resource(name = "PrepaymentDao")
|
||||
private PrepaymentDao dao;
|
||||
|
||||
@Override
|
||||
public List<PrepaymentBean> getList(Map<String, Object> params, Integer offset, Integer limit) {
|
||||
return dao.getList(params,offset,limit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addPrepayment(PrepaymentBean prepaymentBean) {
|
||||
prepaymentBean.setOperator(UserUtil.getLoginUser().getId().toString());
|
||||
int i = dao.addPrepayment(prepaymentBean);
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addOperations(OperationsBean bean) {
|
||||
bean.setOperator(UserUtil.getLoginUser().getId().toString());
|
||||
int i = 0;
|
||||
int j = dao.getMath(bean);
|
||||
if(j>0){
|
||||
i = -1;
|
||||
}else{
|
||||
int k = dao.addOperations(bean);
|
||||
if(k>0){
|
||||
dao.updatePrepaymentId(bean);
|
||||
i = 1;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrepaymentBean getListById(String id) {
|
||||
return dao.getListById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OperationsBean> getOperationsList(Map<String, Object> params, Integer offset, Integer limit) {
|
||||
return dao.getOperationsList(params,offset,limit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePrepayment(PrepaymentBean bean) {
|
||||
bean.setOperator(UserUtil.getLoginUser().getId().toString());
|
||||
return dao.updatePrepayment(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delPrepayment(Long id) {
|
||||
String userId =UserUtil.getLoginUser().getId().toString();
|
||||
dao.delPrepayment(id,userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateOperations(OperationsBean bean) {
|
||||
bean.setOperator(UserUtil.getLoginUser().getId().toString());
|
||||
int i = 0;
|
||||
int j = dao.getMath(bean);
|
||||
if(j>0){
|
||||
i = -1;
|
||||
}else{
|
||||
int k = dao.updateOperations(bean);
|
||||
if(k>0){
|
||||
dao.updatePrepaymentId(bean);
|
||||
i = 1;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delOperations(Long id) {
|
||||
String userId =UserUtil.getLoginUser().getId().toString();
|
||||
dao.delOperations(id,userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工程预付款统计数据更新id
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public OperationsBean getOperationsById(String id) {
|
||||
return dao.getOperationsById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,210 @@
|
|||
<?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.bonus.boot.manager.ca.bm.dao.PrepaymentDao">
|
||||
|
||||
<insert id="addPrepayment">
|
||||
INSERT INTO `bm_project_prepayment` (`project_code`, `project_name`, `business_unit`, `contact_unit`, `type`,
|
||||
`initial_amount`, `first_payment_date`, `current_balance`, `remarks`,`operator`,`is_active`)
|
||||
VALUES (#{projectCode},#{projectName},#{businessUnit},#{contactUnit},#{type},
|
||||
#{initialAmount},#{firstPaymentDate},#{initialAmount},#{remarks},#{operator},'1')
|
||||
</insert>
|
||||
|
||||
<insert id="addOperations">
|
||||
INSERT INTO `bm_monthly_operations` ( `p_id`, `month`, `operation_type`, `amount`, `executor`, `remarks`,
|
||||
`next_month`, `proposed_amount`, `handler`, `next_remarks`,`is_active`,`operator` )
|
||||
VALUES
|
||||
(
|
||||
#{prepaymentId},
|
||||
#{month},
|
||||
#{operationType},
|
||||
#{amount},
|
||||
#{executor},
|
||||
#{remarks},
|
||||
#{nextMonth},
|
||||
#{proposedAmount},
|
||||
#{handler},
|
||||
#{nextRemarks},'1',#{operator})
|
||||
</insert>
|
||||
<update id="updatePrepaymentId">
|
||||
UPDATE `bm_project_prepayment` SET `current_balance` = #{currentBalance}, `operator` = #{operator} WHERE `id` = #{prepaymentId}
|
||||
</update>
|
||||
<update id="updatePrepayment">
|
||||
UPDATE `bm_project_prepayment` SET `operator` = #{operator}
|
||||
<if test="projectCode != null">
|
||||
,project_code = #{projectCode}
|
||||
</if>
|
||||
<if test="projectName != null">
|
||||
,project_name = #{projectName}
|
||||
</if>
|
||||
<if test="businessUnit != null">
|
||||
,business_unit = #{businessUnit}
|
||||
</if>
|
||||
<if test="contactUnit != null">
|
||||
,contact_unit = #{contactUnit}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
,type = #{type}
|
||||
</if>
|
||||
<if test="initialAmount != null">
|
||||
,initial_amount = #{initialAmount}
|
||||
</if>
|
||||
<if test="firstPaymentDate != null">
|
||||
,first_payment_date = #{firstPaymentDate}
|
||||
</if>
|
||||
<if test="currentBalance != null">
|
||||
,current_balance = #{currentBalance}
|
||||
</if>
|
||||
<if test="remarks != null">
|
||||
,remarks = #{remarks}
|
||||
</if>
|
||||
WHERE `id` = #{id}
|
||||
</update>
|
||||
<update id="updateOperations">
|
||||
UPDATE `bm_monthly_operations` SET `month` = #{month}, `operation_type` = #{operationType},
|
||||
`amount` = #{amount}, `executor` = #{executor},operator = #{operator},
|
||||
<if test="remarks != null">
|
||||
,remarks = #{remarks}
|
||||
</if>
|
||||
<if test="nextMonth != null">
|
||||
,next_month = #{nextMonth}
|
||||
</if>
|
||||
<if test="proposedAmount != null">
|
||||
,proposed_amount = #{proposedAmount}
|
||||
</if>
|
||||
<if test="handler != null">
|
||||
,handler = #{handler}
|
||||
</if>
|
||||
<if test="nextRemarks != null">
|
||||
,next_remarks = #{nextRemarks}
|
||||
</if>
|
||||
WHERE `id` = #{id} and is_active = '1'
|
||||
</update>
|
||||
|
||||
<delete id="delPrepayment">
|
||||
UPDATE `bm_project_prepayment` SET `is_active` = '0' , operator = #{userId} WHERE `id` = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="delOperations">
|
||||
UPDATE `bm_monthly_operations` SET `is_active` = '0' , operator = #{userId} WHERE `id` = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getList" resultType="com.bonus.boot.manager.ca.bm.entity.PrepaymentBean">
|
||||
SELECT
|
||||
id,
|
||||
project_code as projectCode,
|
||||
project_name as projectName,
|
||||
business_unit as businessUnit,
|
||||
contact_unit as contactUnit,
|
||||
type,
|
||||
initial_amount as initialAmount,
|
||||
first_payment_date as firstPaymentDate,
|
||||
current_balance as currentBalance,
|
||||
remarks,
|
||||
operator,
|
||||
created_time as createdTime,
|
||||
updated_time as updatedTime,
|
||||
GREATEST(PERIOD_DIFF(DATE_FORMAT(CURDATE(), '%Y%m'), DATE_FORMAT(first_payment_date, '%Y%m')), 0) AS agingMonths,
|
||||
CASE
|
||||
WHEN current_balance = 0 THEN 0
|
||||
ELSE 1
|
||||
END AS state
|
||||
FROM
|
||||
`bm_project_prepayment`
|
||||
WHERE is_active = '1'
|
||||
<if test="params.keyword != null and params.keyword != ''">
|
||||
AND (
|
||||
project_code LIKE CONCAT('%', #{params.keyword}, '%')
|
||||
OR project_name LIKE CONCAT('%', #{params.keyword}, '%')
|
||||
OR business_unit LIKE CONCAT('%', #{params.keyword}, '%')
|
||||
OR contact_unit LIKE CONCAT('%', #{params.keyword}, '%')
|
||||
OR type LIKE CONCAT('%', #{params.keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="params.state =='1' || params.state ==1">
|
||||
AND current_balance>0
|
||||
</if>
|
||||
<if test="params.state =='2' || params.state ==2">
|
||||
AND current_balance=0
|
||||
</if>
|
||||
ORDER BY updated_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getListById" resultType="com.bonus.boot.manager.ca.bm.entity.PrepaymentBean">
|
||||
SELECT
|
||||
id,
|
||||
project_code as projectCode,
|
||||
project_name as projectName,
|
||||
business_unit as businessUnit,
|
||||
contact_unit as contactUnit,
|
||||
type,
|
||||
initial_amount as initialAmount,
|
||||
first_payment_date as firstPaymentDate,
|
||||
current_balance as currentBalance,
|
||||
remarks,
|
||||
operator,
|
||||
created_time as createdTime,
|
||||
updated_time as updatedTime,
|
||||
GREATEST(PERIOD_DIFF(DATE_FORMAT(CURDATE(), '%Y%m'), DATE_FORMAT(first_payment_date, '%Y%m')), 0) AS agingMonths,
|
||||
CASE
|
||||
WHEN current_balance = 0 THEN 0
|
||||
ELSE 1
|
||||
END AS state
|
||||
FROM
|
||||
`bm_project_prepayment`
|
||||
WHERE is_active = '1' and id= #{id}
|
||||
</select>
|
||||
|
||||
<select id="getOperationsList" resultType="com.bonus.boot.manager.ca.bm.entity.OperationsBean">
|
||||
SELECT
|
||||
id,
|
||||
p_id as prepaymentId,
|
||||
month,
|
||||
operation_type as operationType,
|
||||
amount,
|
||||
executor,
|
||||
remarks,
|
||||
next_month as nextMonth,
|
||||
proposed_amount as proposedAmount,
|
||||
handler,
|
||||
next_remarks as nextRemarks,
|
||||
operator,
|
||||
created_time as createdTime,
|
||||
updated_time as updatedTime
|
||||
FROM `bm_monthly_operations`
|
||||
WHERE is_active = '1' AND p_id = #{params.prepaymentId}
|
||||
ORDER BY updated_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getMath" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) FROM `bm_monthly_operations`
|
||||
WHERE p_id = #{prepaymentId} and `month` = #{month} AND is_active = '1'
|
||||
<if test="id !=null ">
|
||||
and id != #{id}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getOperationsById" resultType="com.bonus.boot.manager.ca.bm.entity.OperationsBean">
|
||||
SELECT
|
||||
bm.id,
|
||||
p_id as prepaymentId,
|
||||
month,
|
||||
operation_type as operationType,
|
||||
amount,
|
||||
executor,
|
||||
remarks,
|
||||
next_month as nextMonth,
|
||||
proposed_amount as proposedAmount,
|
||||
handler,
|
||||
next_remarks as nextRemarks,
|
||||
u.username as operator,
|
||||
created_time as createdTime,
|
||||
updated_time as updatedTime,
|
||||
u.id as userId,
|
||||
u.username as userName
|
||||
FROM `bm_monthly_operations` bm
|
||||
LEFT JOIN sys_user u ON u.id = bm.operator
|
||||
WHERE bm.is_active = '1' AND bm.id= #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -31,4 +31,11 @@ function getUrlParam(key) {
|
|||
return param[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getCurrentMonth() {
|
||||
var now = new Date();
|
||||
var year = now.getFullYear();
|
||||
var month = now.getMonth() + 1; // 月份从 0 开始
|
||||
return year + '-' + (month < 10 ? '0' + month : month);
|
||||
}
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
var id = localStorage.getItem("id");
|
||||
var prepaymentId = localStorage.getItem("prepaymentId");
|
||||
var currentBalance = localStorage.getItem("currentBalance");
|
||||
|
||||
var prepaymentUserId = localStorage.getItem("prepaymentUserId");
|
||||
var prepaymentUserName = localStorage.getItem("prepaymentUserName");
|
||||
let form;
|
||||
layui.use(['table', 'layer', 'laydate', 'jquery', 'form'], function(){
|
||||
var layer = layui.layer;
|
||||
form = layui.form;
|
||||
laydate = layui.laydate;
|
||||
|
||||
// 获取当前月份
|
||||
var currentDate = getCurrentMonth();
|
||||
// 渲染
|
||||
laydate.render({
|
||||
elem: '#month',
|
||||
type: 'month',
|
||||
format: 'yyyy-MM',
|
||||
value: currentDate,
|
||||
max: currentDate,
|
||||
});
|
||||
$("#executor").val(prepaymentUserName);
|
||||
$("#prepaymentUserId").val(prepaymentUserId);
|
||||
$('.radio-button').on('click', function() {
|
||||
$('.radio-button').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
$('#operationType').val($(this).data('value'));
|
||||
});
|
||||
|
||||
initData();
|
||||
form.render();
|
||||
// 自定义验证规则
|
||||
form.verify({
|
||||
// 金额验证:必须是数字且最多两位小数
|
||||
amount: function(value, item) {
|
||||
if (value === '') {
|
||||
return '请输入金额';
|
||||
}
|
||||
|
||||
// 检查是否为数字且最多两位小数
|
||||
if (!/^[0-9]+(\.[0-9]{1,2})?$/.test(value)) {
|
||||
return '金额必须为数字且最多保留两位小数';
|
||||
}
|
||||
|
||||
// 如果是冲销,检查是否超过当前余额
|
||||
if ($('#operationType').val() === 'offset') {
|
||||
if (parseFloat(value) > currentBalance) {
|
||||
return '冲销金额不能大于当前余额' + currentBalance;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 拟冲销金额验证:如果填写,必须是数字且最多两位小数
|
||||
proposedAmount: function(value, item) {
|
||||
if (value === '') {
|
||||
return; // 允许为空
|
||||
}
|
||||
|
||||
// 检查是否为数字且最多两位小数
|
||||
if (!/^[0-9]+(\.[0-9]{1,2})?$/.test(value)) {
|
||||
return '拟冲销金额必须为数字且最多保留两位小数';
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
form.on('submit(formDemo)', function (data) {
|
||||
add(data);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function initData(){
|
||||
if(id != ""){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: ctxPath + '/prepayment/getOperationsById',// 请求地址
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
data: {'id': id}, //获取提交的表单字段
|
||||
success: function (data) {
|
||||
var resMsg = data.resMsg;
|
||||
console.log("data",data);
|
||||
if ("数据获取成功" === resMsg) {
|
||||
let info = data.obj.operationsBean;
|
||||
|
||||
$("#prepaymentUserId").val(info.userId);
|
||||
$("#month").val(info.month);
|
||||
|
||||
// 动态设置 operationType 的值
|
||||
let operationType = info.operationType;
|
||||
$("#operationType").val(operationType);
|
||||
|
||||
// 根据 operationType 设置对应的 radio-button 样式
|
||||
$(".radio-button").removeClass("active");
|
||||
$(`.radio-button[data-value="${operationType}"]`).addClass("active");
|
||||
|
||||
$("#amount").val(info.amount);
|
||||
$("#executor").val(info.userName);
|
||||
$("#remarks").val(info.remarks);
|
||||
|
||||
$("#nextMonth").val(info.nextMonth);
|
||||
$("#proposedAmount").val(info.proposedAmount);
|
||||
$("#handler").val(info.handler);
|
||||
$("#nextRemarks").val(info.nextRemarks);
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, e) {
|
||||
// layer.close(loadingMsg);
|
||||
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 计算更新后的余额
|
||||
function calculateNewBalance() {
|
||||
var amount = parseFloat($('#amount').val()) || 0;
|
||||
var operationType = $('#operationType').val();
|
||||
if (operationType === '1') {
|
||||
// 冲销是减少余额
|
||||
currentBalance = currentBalance - amount;
|
||||
} else {
|
||||
// 新增是增加余额
|
||||
currentBalance = currentBalance + amount;
|
||||
}
|
||||
return currentBalance.toFixed(2);
|
||||
}
|
||||
|
||||
function add(formData) {
|
||||
// 计算更新后的余额
|
||||
var currentBalance = calculateNewBalance();
|
||||
// 添加更新后的余额到表单数据
|
||||
formData.field.currentBalance = currentBalance;
|
||||
formData.field.prepaymentId = prepaymentId;
|
||||
|
||||
formData.field.executor = $("#prepaymentUserId").val();
|
||||
console.log("formData",formData)
|
||||
var tip = '保存';
|
||||
var formUrl = ctxPath + "/prepayment/addOperations";
|
||||
if (id != '') {
|
||||
formUrl = ctxPath + "/prepayment/updateOperations";
|
||||
tip = '修改';
|
||||
}
|
||||
formData.field.id = id;
|
||||
|
||||
// 加载提示
|
||||
let addLoadingMsg = top.layer.msg('数据上传中,请稍候...', {
|
||||
icon: 16,
|
||||
scrollbar: false,
|
||||
time: 0,
|
||||
shade: [0.8, '#393D49']
|
||||
});
|
||||
console.log("formData",formData.field)
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: formUrl, // 请求地址
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
data: JSON.stringify(formData.field), //获取提交的表单字段
|
||||
success: function (data) {
|
||||
if (data.resMsg === "保存成功") {
|
||||
parent.layer.closeAll();
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
parent.layer.msg(tip + '成功', { icon: 1, time: 2000 });
|
||||
parent.table.reload('menuTable');
|
||||
} else {
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
if(data.resMsg ==="当前月份已经存在"){
|
||||
parent.layer.msg(data.resMsg, {icon: 2, time: 2000});
|
||||
}else{
|
||||
parent.layer.msg(tip + '失败', {icon: 2, time: 2000});
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, e) {
|
||||
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
var prepaymentId = localStorage.getItem("prepaymentId");
|
||||
let form;
|
||||
layui.use(['table', 'layer', 'laydate', 'jquery', 'form'], function(){
|
||||
var layer = layui.layer;
|
||||
form = layui.form;
|
||||
laydate = layui.laydate;
|
||||
// 渲染
|
||||
laydate.render({
|
||||
elem: '#firstPaymentDate'
|
||||
});
|
||||
initData();
|
||||
form.render();
|
||||
// 自定义验证规则
|
||||
form.verify({
|
||||
je: [/(^$)|^[0-9]+(\.[0-9]{1,2})?$/,'请输入正确初始金额,小数点后二位'],
|
||||
});
|
||||
form.on('submit(formDemo)', function (data) {
|
||||
add(data);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function initData(){
|
||||
if(prepaymentId != ""){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: ctxPath + '/prepayment/getListById',// 请求地址
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
data: {'id': prepaymentId}, //获取提交的表单字段
|
||||
success: function (data) {
|
||||
var resMsg = data.resMsg;
|
||||
console.log("data",data);
|
||||
if ("数据获取成功" === resMsg) {
|
||||
let info = data.obj.prepaymentBean;
|
||||
$("#id").val(info.id);
|
||||
$("#projectCode").val(info.projectCode);
|
||||
$("#projectName").val(info.projectName);
|
||||
$("#businessUnit").val(info.businessUnit);
|
||||
$("#contactUnit").val(info.contactUnit);
|
||||
$("#type").val(info.type);
|
||||
|
||||
|
||||
$("#initialAmount").val(info.initialAmount);
|
||||
$("#initialAmount").prop("readonly", true).addClass("readonly-input");
|
||||
$("#firstPaymentDate").val(info.firstPaymentDate);
|
||||
$("#firstPaymentDate").css("pointer-events", "none").addClass("readonly-input");
|
||||
$("#remarks").val(info.remarks);
|
||||
|
||||
let button = document.getElementById("my-button");
|
||||
button.style.position = "absolute";
|
||||
button.style.top = "700px";
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, e) {
|
||||
// layer.close(loadingMsg);
|
||||
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function add(formData) {
|
||||
var tip = '保存';
|
||||
var formUrl = ctxPath + "/prepayment/addPrepayment";
|
||||
if (prepaymentId != '') {
|
||||
formUrl = ctxPath + "/prepayment/updatePrepayment";
|
||||
tip = '修改';
|
||||
}
|
||||
formData.field.id = prepaymentId;
|
||||
// 加载提示
|
||||
let addLoadingMsg = top.layer.msg('数据上传中,请稍候...', {
|
||||
icon: 16,
|
||||
scrollbar: false,
|
||||
time: 0,
|
||||
shade: [0.8, '#393D49']
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: formUrl, // 请求地址
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
data: JSON.stringify(formData.field), //获取提交的表单字段
|
||||
success: function (data) {
|
||||
if (data.resMsg === "保存成功") {
|
||||
parent.layer.closeAll();
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
parent.layer.msg(tip + '成功', { icon: 1, time: 2000 });
|
||||
parent.table.reload('menuTable-pro');
|
||||
if(prepaymentId != ''){
|
||||
localStorage.setItem("prepaymentId", prepaymentId);
|
||||
parent.initData()
|
||||
parent.parent.table.reload('menuTable-pro');
|
||||
}
|
||||
} else {
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
parent.layer.msg(tip + '失败', {icon: 2, time: 2000});
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, e) {
|
||||
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
var pers = checkPermission();
|
||||
|
||||
var example;
|
||||
var table,form,laydate;
|
||||
var layuiForm;
|
||||
var prepaymentId = localStorage.getItem("prepaymentId");
|
||||
var userId,userName;
|
||||
var currentBalance;
|
||||
layui.use(['table', 'form', 'laydate'], function(){
|
||||
table = layui.table;
|
||||
form = layui.form;
|
||||
laydate = layui.laydate;
|
||||
initData();
|
||||
table.render({
|
||||
elem: '#demo'
|
||||
, url: ctxPath + '/prepayment/getOperationsList' //数据接口
|
||||
, method: 'post' //方式默认是get
|
||||
, toolbar: true //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
|
||||
, defaultToolbar: []
|
||||
, where: {
|
||||
prepaymentId: prepaymentId
|
||||
} //post请求必须加where ,post请求需要的参数
|
||||
, cellMinWidth: 80
|
||||
, cols: [
|
||||
[
|
||||
{field: 'number', width: 100, title: '序号', align: 'center', type: 'numbers', fixed: 'left', rowspan: 2},
|
||||
{field: 'month', title: '月份', width: 100, align: 'center', rowspan: 2},
|
||||
{title: '当月执行情况', align: 'center', colspan: 4},
|
||||
{title: '下月工作计划', align: 'center', colspan: 4},
|
||||
{field: 'updatedTime', title: '数据更新时间', width: 260, align: 'center', rowspan: 2},
|
||||
// {field: 'operation', title: '操作', width: 220, align: 'center', fixed: 'right', rowspan: 2}
|
||||
{ field: 'operation', title: '操作', width: 220, align: 'center', fixed: 'right', rowspan: 2, templet: function (d) {
|
||||
if (d.LAY_INDEX === 0) {
|
||||
return `<a class="layui-btn layui-btn-xs" onclick="edit('${d.id}')">修改</a> <a class="layui-btn layui-btn-danger layui-btn-xs" onclick="del('${d.id}')">删除</a>`;
|
||||
} else {
|
||||
return `禁止操作`;
|
||||
}
|
||||
}}
|
||||
],
|
||||
[
|
||||
{field: '', title: '冲销或新增情况', width: 240, align: 'center',
|
||||
templet: function (d) {
|
||||
let operationType = d.operationType;
|
||||
if (operationType == 1) {
|
||||
return '冲销';
|
||||
} else if (operationType == 2) {
|
||||
return '新增';
|
||||
}
|
||||
}
|
||||
},
|
||||
{field: 'amount', title: '冲销或新增金额', width: 240, align: 'center'},
|
||||
{field: 'executor', title: '经办人', width: 200, align: 'center'},
|
||||
{field: 'remarks', title: '备注', width: 280, align: 'center'},
|
||||
{field: 'nextMonth', title: '月度冲销计划及措施', width: 220, align: 'center'},
|
||||
{field: 'proposedAmount', title: '拟冲销金额', width: 140, align: 'center'},
|
||||
{field: 'handler', title: '责任人', width: 100, align: 'center'},
|
||||
{field: 'nextRemarks', title: '备注', width: 100, align: 'center'}
|
||||
]
|
||||
]
|
||||
, id: 'menuTable'
|
||||
, page: true //开启分页
|
||||
, loading: true //数据加载中。。。
|
||||
, limits: [10, 20, 50] //一页选择显示10,20或50条数据
|
||||
, limit: 10 //一页显示10条数据
|
||||
, response: {
|
||||
statusCode: 200 //规定成功的状态码,默认:0
|
||||
}
|
||||
, parseData: function (res) { //将原始数据解析成 table 组件所规定的数据,res为从url中get到的数据
|
||||
let result;
|
||||
if (res.data !== '' && res.data != null && res.data !== "null") {
|
||||
if (this.page.curr) {
|
||||
result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr);
|
||||
} else {
|
||||
result = res.data.slice(0, this.limit);
|
||||
}
|
||||
}
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.msg, //解析提示文本
|
||||
"count": res.count, //解析数据长度
|
||||
"data": result, //解析数据列表
|
||||
};
|
||||
}
|
||||
, scroll: { // Enable horizontal scrolling
|
||||
x: true,
|
||||
y: true
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function initData(){
|
||||
if(prepaymentId != ""){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: ctxPath + '/prepayment/getListById',// 请求地址
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
data: {'id': prepaymentId}, //获取提交的表单字段
|
||||
success: function (data) {
|
||||
var resMsg = data.resMsg;
|
||||
console.log("data",data);
|
||||
if ("数据获取成功" === resMsg) {
|
||||
let info = data.obj.prepaymentBean;
|
||||
document.getElementById('projectName').textContent = info.projectName;
|
||||
document.getElementById('projectCode').textContent = info.projectCode;
|
||||
if(info.state == "1"){
|
||||
document.getElementById('state').textContent ="未完成"
|
||||
}else{
|
||||
document.getElementById('state').textContent ="已冲销"
|
||||
}
|
||||
document.getElementById('businessUnit').textContent = info.businessUnit;
|
||||
document.getElementById('contactUnit').textContent = info.contactUnit;
|
||||
document.getElementById('type').textContent = info.type;
|
||||
document.getElementById('initialAmount').textContent = info.initialAmount;
|
||||
document.getElementById('firstPaymentDate').textContent = info.firstPaymentDate;
|
||||
|
||||
currentBalance = info.currentBalance;
|
||||
userId = info.userId;
|
||||
userName = info.userName;
|
||||
document.getElementById('currentBalance').textContent = currentBalance;
|
||||
document.getElementById('agingMonths').textContent = info.agingMonths;
|
||||
document.getElementById('updatedTime').textContent = info.updatedTime;
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, e) {
|
||||
// layer.close(loadingMsg);
|
||||
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function addForm(){
|
||||
localStorage.setItem("prepaymentId", prepaymentId);
|
||||
localStorage.setItem("currentBalance", currentBalance);
|
||||
localStorage.setItem("prepaymentUserId", userId);
|
||||
localStorage.setItem("prepaymentUserName", userName);
|
||||
openForm("","新增");
|
||||
}
|
||||
|
||||
function updateForm() {
|
||||
localStorage.setItem("prepaymentId", prepaymentId);
|
||||
var index = layer.open({
|
||||
title: ["修改", 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
||||
type: 2,
|
||||
content: "./addPro.html",
|
||||
area: ["60%", "80%"],
|
||||
maxmin: false,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增-修改功能
|
||||
*/
|
||||
function openForm(id,title){
|
||||
localStorage.setItem("id",id);
|
||||
var index = layer.open({
|
||||
title: [title, 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
||||
type: 2,
|
||||
content: "./addOperations.html",
|
||||
area: ["60%","80%"],
|
||||
maxmin: false,
|
||||
});
|
||||
}
|
||||
|
||||
function edit(id){
|
||||
openForm(id,"修改")
|
||||
}
|
||||
|
||||
function del(id) {
|
||||
layer.confirm('确定要删除吗?', {
|
||||
btn: ['确定', '取消']
|
||||
}, function () {
|
||||
$.ajax({
|
||||
type: 'delete',
|
||||
url: ctxPath + '/prepayment/delOperations/' + id,
|
||||
success: function (data) {
|
||||
table.reload('menuTable');
|
||||
layer.msg("删除成功");
|
||||
}
|
||||
});
|
||||
|
||||
layer.close(1);
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,165 @@
|
|||
var pers = checkPermission();
|
||||
|
||||
var example;
|
||||
var form;
|
||||
var layuiForm;
|
||||
layui.use(['form', 'laydate', 'upload'], function () {
|
||||
table = layui.table;
|
||||
form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
|
||||
layuiForm = form;
|
||||
form.render();
|
||||
form.verify({});
|
||||
|
||||
table.render({
|
||||
elem: '#demo'
|
||||
, url: ctxPath + '/prepayment/getList' //数据接口
|
||||
, method: 'post' //方式默认是get
|
||||
, toolbar: true //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
|
||||
, defaultToolbar: []
|
||||
, where: {
|
||||
keyword: $('#keyword').val(),
|
||||
state: $('#state').val()
|
||||
} //post请求必须加where ,post请求需要的参数
|
||||
, cellMinWidth: 80
|
||||
, cols: [[ //表头
|
||||
{field: 'number', width: 100, title: '序号', align: 'center', type: 'numbers'}
|
||||
, {field: 'projectCode', width: 220, align: 'center', title: '承揽合同编码'}
|
||||
, {field: 'projectName', width: 280, align: 'center', title: '承揽合同名称(工程名称)'}
|
||||
, {field: 'businessUnit', width: 220, align: 'center', title: '责任单位'}
|
||||
, {field: 'contactUnit', width: 220, align: 'center', title: '往来单位'}
|
||||
, {field: 'type', width: 200, align: 'center', title: '预付款类型'}
|
||||
, {field: 'initialAmount', width: 200, align: 'center', title: '初始金额'}
|
||||
, {field: 'firstPaymentDate', width: 200, align: 'center', title: '首次支付日期'}
|
||||
, {field: 'currentBalance', width: 200, align: 'center', title: '当前余额'}
|
||||
, {
|
||||
field: '', width: 200, align: 'center', title: '状态',
|
||||
templet: function (d) {
|
||||
let state = d.state;
|
||||
if (state == 0) {
|
||||
return '已冲销';
|
||||
} else if (state == 1) {
|
||||
return '未完成';
|
||||
}
|
||||
}
|
||||
}
|
||||
, {field: 'agingMonths', width: 200, align: 'center', title: '账龄(月)'}
|
||||
, {field: 'remarks', width: 200, align: 'center', title: '备注'}
|
||||
, {field: 'operator', width: 200, align: 'center', title: '更新人'}
|
||||
, {field: 'updatedTime', width: 200, align: 'center', title: '更新时间'}
|
||||
, {fixed: 'right', title: '操作', width: 150, align: 'center', toolbar: '#toolsBar'}
|
||||
]]
|
||||
, id: 'menuTable-pro'
|
||||
, page: true //开启分页
|
||||
, loading: true //数据加载中。。。
|
||||
, limits: [5, 10, 20] //一页选择显示3,5或10条数据
|
||||
, limit: 10 //一页显示5条数据
|
||||
, response: {
|
||||
statusCode: 200 //规定成功的状态码,默认:0
|
||||
}, parseData: function (res) { //将原始数据解析成 table 组件所规定的数据,res为从url中get到的数据
|
||||
let result;
|
||||
if (res.data !== '' && res.data != null && res.data !== "null") {
|
||||
if (this.page.curr) {
|
||||
result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr);
|
||||
} else {
|
||||
result = res.data.slice(0, this.limit);
|
||||
}
|
||||
}
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.msg, //解析提示文本
|
||||
"count": res.count, //解析数据长度
|
||||
"data": result, //解析数据列表
|
||||
};
|
||||
},
|
||||
toolbar: "#toolbar"
|
||||
});
|
||||
});
|
||||
|
||||
function addForm() {
|
||||
openForm("", "新增");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增-修改功能
|
||||
*/
|
||||
function openForm(id, title) {
|
||||
localStorage.setItem("prepaymentId", "");
|
||||
var index = layer.open({
|
||||
title: [title, 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
||||
type: 2,
|
||||
content: "./addPro.html",
|
||||
area: ["60%", "80%"],
|
||||
maxmin: false,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新功能
|
||||
* @param id
|
||||
*/
|
||||
function openQuery(id, title) {
|
||||
localStorage.setItem("prepaymentId", id);
|
||||
var index = layer.open({
|
||||
title: [title, 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
||||
type: 2,
|
||||
content: 'proForm.html',
|
||||
area: ["95%", "90%"],
|
||||
maxmin: false,
|
||||
});
|
||||
}
|
||||
|
||||
function del(id) {
|
||||
layer.confirm('确定要删除吗?', {
|
||||
btn: ['确定', '取消']
|
||||
}, function () {
|
||||
$.ajax({
|
||||
type: 'delete',
|
||||
url: ctxPath + '/prepayment/delPrepayment/' + id,
|
||||
success: function (data) {
|
||||
table.reload('menuTable-pro');
|
||||
layer.msg("删除成功");
|
||||
}
|
||||
});
|
||||
|
||||
layer.close(1);
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBt").click(function () {
|
||||
table.reload('menuTable-pro', {
|
||||
url: ctxPath + '/prepayment/getList'
|
||||
, method: 'post' //方式默认是get
|
||||
, page: {
|
||||
curr: 1 // 强制重置分页到第一页
|
||||
}
|
||||
, where: {
|
||||
keyword: $('#keyword').val(),
|
||||
state: $('#state').val()
|
||||
} //设定异步数据接口的额外参数
|
||||
});
|
||||
});
|
||||
|
||||
$("#exportBt").click(function () {
|
||||
var token = localStorage.getItem("token");
|
||||
var loadingMsg = layer.msg('下载中,请稍候...', {icon: 16, scrollbar: false, time: 0});
|
||||
var url = ctxPath + "/supplierInfo/exp?state=" + $("#state").val().trim() + "&keyword=" + $("#keyword").val().trim() + "&token=" + token;
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("get", url, true);
|
||||
xhr.responseType = "blob"; // 转换流
|
||||
xhr.onload = function () {
|
||||
layer.close(loadingMsg);
|
||||
if (this.status === 200) {
|
||||
var blob = this.response;
|
||||
var a = document.createElement("a");
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = "供应商信息.xlsx"; // 文件名
|
||||
} else {
|
||||
layer.msg('导出发生异常,请稍后重试', {icon: 16, scrollbar: false, time: 2000});
|
||||
}
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
};
|
||||
xhr.send();
|
||||
});
|
||||
|
|
@ -0,0 +1,193 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>工程预付款统计-数据更新-新增</title>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../layui-v2.8.3/layui/css/layui.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/work/publicStyles.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../../css/ztree/3.5/zTreeStyle.css" type="text/css">
|
||||
<style>
|
||||
body {
|
||||
background-color: #f5f5f5;
|
||||
padding: 20px;
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
.form-section {
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 20px;
|
||||
padding: 15px 20px;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
border-left: 4px solid #1E9FFF;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 20px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
margin-bottom: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
width: 170px;
|
||||
text-align: right;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.required:before {
|
||||
content: "*";
|
||||
color: #FF5722;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.layui-input {
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: #1E9FFF;
|
||||
border-color: #1E9FFF;
|
||||
}
|
||||
|
||||
.radio-group {
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.radio-button {
|
||||
display: inline-block;
|
||||
padding: 8px 20px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 20px;
|
||||
cursor: pointer;
|
||||
background-color: #f5f5f5;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.radio-button.active {
|
||||
background-color: #1E9FFF;
|
||||
color: white;
|
||||
border-color: #1E9FFF;
|
||||
}
|
||||
|
||||
textarea.layui-input {
|
||||
min-height: 100px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 30px;
|
||||
gap: 15px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="" method="post" onsubmit="return false">
|
||||
<input type="hidden" id="id" name="id">
|
||||
<input type="hidden" id="prepaymentUserId" name="prepaymentUserId">
|
||||
<div class="form-section">
|
||||
<div class="section-header">执行月份</div>
|
||||
<div class="form-row">
|
||||
<div class="form-label required">执行月份:</div>
|
||||
<div class="form-input">
|
||||
<input type="text" class="layui-input" id="month" name="month" lay-verify="required" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-section">
|
||||
<div class="section-header">当月执行情况</div>
|
||||
<div class="form-row">
|
||||
<div class="form-label required">冲销或新增情况:</div>
|
||||
<div class="form-input radio-group">
|
||||
<div class="radio-button active" data-value="1">冲销</div>
|
||||
<div class="radio-button" data-value="2">新增</div>
|
||||
<input type="hidden" name="operationType" id="operationType" value="1">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-label required">冲销或新增金额:</div>
|
||||
<div class="form-input">
|
||||
<input type="text" class="layui-input" name="amount" id="amount" lay-verify="required|amount" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-label required">经办人:</div>
|
||||
<div class="form-input">
|
||||
<input type="text" class="layui-input" name="executor" id="executor" style="background-color: #eeeeee;" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-label">备注:</div>
|
||||
<div class="form-input">
|
||||
<textarea class="layui-input" name="remarks" id="remarks" ></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-section">
|
||||
<div class="section-header">下月工作计划</div>
|
||||
<div class="form-row">
|
||||
<div class="form-label">月度冲销计划及措施:</div>
|
||||
<div class="form-input">
|
||||
<textarea class="layui-input" name="nextMonth" id="nextMonth" ></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-label">拟冲销金额:</div>
|
||||
<div class="form-input">
|
||||
<input type="text" class="layui-input" name="proposedAmount" id="proposedAmount" lay-verify="proposedAmount">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-label ">责任人:</div>
|
||||
<div class="form-input">
|
||||
<input type="text" class="layui-input" name="handler" id="handler" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-label">备注:</div>
|
||||
<div class="form-input">
|
||||
<textarea class="layui-input" name="nextRemarks" id="nextRemarks"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary" id="my-button" type="submit" style="width: 100px" lay-submit lay-filter="formDemo">
|
||||
<i class="fa fa-save"></i> 保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript" src="../../js/libs/jquery-3.6.0.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/common.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script type="text/javascript" src="../../layui-v2.8.3/layui/layui.js"></script>
|
||||
<script src="../../css/ztree/3.5/jquery.ztree.all.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/prepayment/addOperations.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>工程预付款统计-新增</title>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../layui-v2.8.3/layui/css/layui.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/work/publicStyles.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../../css/ztree/3.5/zTreeStyle.css" type="text/css">
|
||||
<style>
|
||||
/* CSS样式 */
|
||||
#my-button {
|
||||
position: absolute; /* 绝对定位 */
|
||||
top: 99%; /* 距离底部 20px */
|
||||
left: 50%; /* 水平居中 */
|
||||
transform: translateX(-50%); /* 调整水平居中 */
|
||||
width: 100px; /* 按钮宽度 */
|
||||
}
|
||||
|
||||
.readonly-input {
|
||||
background-color: #eeeeee; /* 白色背景 */
|
||||
color: #333; /* 字体颜色 */
|
||||
border-color: #ddd; /* 边框颜色 */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="" method="post" onsubmit="return false">
|
||||
<input type="hidden" id="id" name="id">
|
||||
<div class="layui-input-inline"style="float: left;width: 50%;margin-top: 2%;margin-left: 20%" >
|
||||
<label class="layui-form-label" style="width: 30%">承揽合同编码:</label>
|
||||
<div class="layui-input-block">
|
||||
<input style="width: 85%" type="text" name="projectCode" id="projectCode" maxlength="50" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline"style="float: left;width: 50%;margin-top: 2%;margin-left: 20%" >
|
||||
<label class="layui-form-label" style="width: 30%"><i class="tip-required" style="color: red;font-size: 20px">*</i> 承揽合同名称(工程名称):</label>
|
||||
<div class="layui-input-block">
|
||||
<input style="width: 85%" type="text" name="projectName" id="projectName" maxlength="50" lay-verify="required" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline"style="float: left;width: 50%;margin-top: 2%;margin-left: 20%" >
|
||||
<label class="layui-form-label" style="width: 30%"> <i class="tip-required" style="color: red;font-size: 20px">*</i> 责任单位:</label>
|
||||
<div class="layui-input-block">
|
||||
<input style="width: 85%" type="text" name="businessUnit" id="businessUnit" maxlength="50" lay-verify="required" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-inline"style="float: left;width: 50%;margin-top: 2%;margin-left: 20%" >
|
||||
<label class="layui-form-label" style="width: 30%"><i class="tip-required" style="color: red;font-size: 20px">*</i>往来单位:</label>
|
||||
<div class="layui-input-block">
|
||||
<input style="width: 85%" type="text" name="contactUnit" id="contactUnit" maxlength="50" lay-verify="required" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-inline"style="float: left;width: 50%;margin-top: 2%;margin-left: 20%" >
|
||||
<label class="layui-form-label" style="width: 30%"><i class="tip-required" style="color: red;font-size: 20px">*</i>预付款类型:</label>
|
||||
<div class="layui-input-block">
|
||||
<input style="width: 85%" type="text" name="type" id="type" maxlength="50" lay-verify="required" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline"style="float: left;width: 50%;margin-top: 2%;margin-left: 20%" >
|
||||
<label class="layui-form-label" style="width: 30%"><i class="tip-required" style="color: red;font-size: 20px">*</i> 初始金额:</label>
|
||||
<div class="layui-input-block">
|
||||
<input style="width: 85%" type="text" name="initialAmount" id="initialAmount" maxlength="50" lay-verify="required|je" class="layui-input" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline"style="float: left;width: 50%;margin-top: 2%;margin-left: 20%">
|
||||
<label class="layui-form-label" style="width: 30%"><i class="tip-required" style="color: red;font-size: 20px">*</i>首次支付日期:</label>
|
||||
<div class="layui-input-block">
|
||||
<input style="width: 85%" type="text" class="layui-input" id="firstPaymentDate" name="firstPaymentDate" lay-verify="required" placeholder="yyyy-MM-dd" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline"style="float: left;width: 50%;margin-top: 2%;margin-left: 20%">
|
||||
<label class="layui-form-label" style="width: 30%">备注:</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea type="text" name="remarks" id="remarks" style="height: 186px; width: 85%; box-sizing: border-box; padding: 10px; font-size: 16px; border-color: #d2d2d2; resize: vertical" autocomplete="off"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary" id="my-button" type="submit" style="width: 100px" lay-submit lay-filter="formDemo">
|
||||
<i class="fa fa-save"></i> 保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript" src="../../js/libs/jquery-3.6.0.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/common.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script type="text/javascript" src="../../layui-v2.8.3/layui/layui.js"></script>
|
||||
<script src="../../css/ztree/3.5/jquery.ztree.all.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/prepayment/addPro.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,222 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>工程预付款统计-数据更新-子页面</title>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/dataTables.bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../layui-v2.8.3/layui/css/layui.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/work/publicStyles.css">
|
||||
<style>
|
||||
.project-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.project-icon {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
background-color: #FF5722;
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 20px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.project-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.project-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.project-id {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.project-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.project-details {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 20px;
|
||||
background-color: #fff;
|
||||
padding: 15px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
width: 20%;
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.status-incomplete {
|
||||
background-color: #FF5722;
|
||||
}
|
||||
|
||||
.status-new {
|
||||
color: #5FB878;
|
||||
}
|
||||
|
||||
.status-offset {
|
||||
color: #1E9FFF;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
background-color: #fff;
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.main-container {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.layui-table-page {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.operation-link {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.disabled-operation {
|
||||
color: #d2d2d2;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
#addBtn {
|
||||
background-color: #f59a23 !important;
|
||||
}
|
||||
|
||||
#exportBtn {
|
||||
background-color: #f2f2f2 !important;
|
||||
color: #000000 !important;
|
||||
border: 1px solid #ababab !important;
|
||||
}
|
||||
|
||||
/* Add these styles for horizontal scrolling */
|
||||
.widget-body {
|
||||
overflow-x: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.layui-table-view {
|
||||
width: auto !important;
|
||||
min-width: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="layui-layout-body" style="background-color: #f2f2f2;">
|
||||
<div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<header style="height: 100%">
|
||||
<div class="main-container">
|
||||
<div class="project-header">
|
||||
<div class="project-icon">项</div>
|
||||
<div class="project-info">
|
||||
<div class="project-title" id="projectName"></div>
|
||||
<div class="project-id" id="projectCode"></div>
|
||||
</div>
|
||||
<div class="project-actions">
|
||||
<button class="layui-btn layui-btn-normal" onclick="addForm()">
|
||||
更新项目
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="updateForm()">
|
||||
修改
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-primary">
|
||||
导出
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-primary">
|
||||
删除
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="project-details">
|
||||
<div class="detail-item">
|
||||
<span>当前状态</span>
|
||||
<span ><span class="status-dot status-incomplete" ></span> <span id="state"></span></span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span>责任单位:</span>
|
||||
<span id="businessUnit"></span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span>往来单位:</span>
|
||||
<span id="contactUnit"></span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span>预付款类型:</span>
|
||||
<span id="type"></span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span>初始金额:</span>
|
||||
<span id="initialAmount"></span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span>首次支付日期:</span>
|
||||
<span id="firstPaymentDate"></span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span>当前余额:</span>
|
||||
<span id="currentBalance"></span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span>账龄(月):</span>
|
||||
<span id="agingMonths"></span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span>最后更新:</span>
|
||||
<span id="updatedTime"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div style="margin-left: 15px;margin-right: 15px;">
|
||||
<div class="widget-body">
|
||||
<table id="demo" lay-filter="test" class="layui-table" lay-size="lg">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script type="text/javascript" src="../../js/libs/jquery-3.6.0.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script type="text/javascript" src="../../js/plugin/datatables/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/plugin/datatables/dataTables.bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../../layui-v2.8.3/layui/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/my/permission.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script type="text/javascript" src="../../js/common_methon.js"></script>
|
||||
<script type="text/html" id="gysmcView">
|
||||
<a style="color: #35B3F1;cursor:pointer;" onclick="buttonquery('{{d.htmcid}}')">{{d.gysmc}}</a>
|
||||
</script>
|
||||
<script type="text/javascript" src="../../js/prepayment/proForm.js"></script>
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>工程预付款统计-列表信息</title>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/dataTables.bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../layui-v2.8.3/layui/css/layui.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/work/publicStyles.css">
|
||||
<style>
|
||||
button{
|
||||
border-radius: 7px !important;
|
||||
}
|
||||
#addBtn{
|
||||
background-color: #f59a23 !important;
|
||||
}
|
||||
#exportBt{
|
||||
background-color: #f2f2f2 !important;
|
||||
color: #000000 !important;
|
||||
border: 1px solid #ababab !important;
|
||||
}
|
||||
|
||||
.layui-input, .layui-textarea {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding-left: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" >
|
||||
<header style="height: 100%">
|
||||
<div align="left">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form class="form-inline layui-form" onsubmit="return false">
|
||||
<div class="form-group">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input id="keyword" name="keyword" type="text" class="layui-input" style="width: 200px" placeholder="请输入关键字查询">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<select id="state" name="state" style="width: 100%;">
|
||||
<option value="">请选择状态</option>
|
||||
<option value="1">未完成</option>
|
||||
<option value="2">已冲销</option>
|
||||
</select>
|
||||
</div>
|
||||
<button id="searchBt" class="layui-btn" style="margin-top: -0.3%; margin-left: 15px;">
|
||||
搜索
|
||||
</button>
|
||||
<button id="addBtn" class="layui-btn" onclick="addForm()" style="margin-top: -0.3%;">
|
||||
添加
|
||||
</button>
|
||||
<button id="exportBt" class="layui-btn" >
|
||||
下载
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div style="margin-left: 15px;margin-right: 15px;">
|
||||
<div class="widget-body">
|
||||
<table id="demo" lay-filter="test" class="layui-table" lay-size="lg">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script type="text/javascript" src="../../js/libs/jquery-3.6.0.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script type="text/javascript" src="../../js/plugin/datatables/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/plugin/datatables/dataTables.bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../../layui-v2.8.3/layui/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/my/permission.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script type="text/javascript" src="../../js/common_methon.js"></script>
|
||||
<script type="text/javascript" src="../../js/prepayment/proList.js"></script>
|
||||
|
||||
<script type="text/html" id="toolsBar">
|
||||
<a style="color: #009688;font-size: 16px;cursor:pointer;" onclick="openQuery('{{d.id}}', '数据更新')">更新</a>
|
||||
<span> | </span>
|
||||
<a style="color: #009688;font-size: 16px;cursor:pointer;" onclick="del('{{d.id}}')">删除</a>
|
||||
</script>
|
||||
Loading…
Reference in New Issue