Browse Source

[fix]

财务管理 公司固定资产
修改公司固定资产列表页面搜索栏字段,部门输入框改为下拉框,添加初始化方法;
修改mapper查询方法,添加对应搜索字段,修改新增编辑方法,补全字段,调整字段对应顺序;
新增列表页面导出按钮及其绑定方法;
修改公司固定资产实体类,调整导出字段及顺序;
新增公司固定资产详情调整controller接口、导出controller接口,实现多选和全部导出;
新增根据id集合查找公司固定资产集合mapper、service方法;
dev
王晓迪 3 months ago
parent
commit
49701255d2
  1. 22
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialCompantFixedAssetsController.java
  2. 74
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialCompantFixedAssets.java
  3. 3
      ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialCompantFixedAssetsMapper.java
  4. 3
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialCompantFixedAssetsService.java
  5. 7
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialCompantFixedAssetsServiceImpl.java
  6. 27
      ruoyi-admin/src/main/resources/mapper/financial/FinancialCompantFixedAssetsMapper.xml
  7. 140
      ruoyi-admin/src/main/resources/templates/financial/compantFixedAssets/compantFixedAssets.html

22
ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialCompantFixedAssetsController.java

@ -1,10 +1,13 @@
package com.ruoyi.financial.controller; package com.ruoyi.financial.controller;
import java.util.List; import java.util.List;
import com.ruoyi.quality.domain.VO.QualityOrderReportVO;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -61,11 +64,18 @@ public class FinancialCompantFixedAssetsController extends BaseController
@Log(title = "公司固定资产", businessType = BusinessType.EXPORT) @Log(title = "公司固定资产", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
public AjaxResult export(FinancialCompantFixedAssets financialCompantFixedAssets) public AjaxResult export(FinancialCompantFixedAssets financialCompantFixedAssets, String ids)
{ {
if (StringUtils.isEmpty(ids)){
List<FinancialCompantFixedAssets> list = financialCompantFixedAssetsService.selectFinancialCompantFixedAssetsList(financialCompantFixedAssets); List<FinancialCompantFixedAssets> list = financialCompantFixedAssetsService.selectFinancialCompantFixedAssetsList(financialCompantFixedAssets);
ExcelUtil<FinancialCompantFixedAssets> util = new ExcelUtil<FinancialCompantFixedAssets>(FinancialCompantFixedAssets.class); ExcelUtil<FinancialCompantFixedAssets> util = new ExcelUtil<FinancialCompantFixedAssets>(FinancialCompantFixedAssets.class);
return util.exportExcel(list, "公司固定资产数据"); return util.exportExcel(list, "公司固定资产数据");
}else {
String[] assetsIds = ids.split(",");
List<FinancialCompantFixedAssets> list = financialCompantFixedAssetsService.selectFinancialCompantFixedAssetsByIds(assetsIds);
ExcelUtil<FinancialCompantFixedAssets> util = new ExcelUtil<FinancialCompantFixedAssets>(FinancialCompantFixedAssets.class);
return util.exportExcel(list, "公司固定资产数据");
}
} }
/** /**
@ -147,5 +157,15 @@ public class FinancialCompantFixedAssetsController extends BaseController
return toAjax(financialCompantFixedAssetsService.restoreFinancialCompantFixedAssetsById(id)); return toAjax(financialCompantFixedAssetsService.restoreFinancialCompantFixedAssetsById(id));
} }
/**
* 公司固定资产详情
*/
@GetMapping("/detail/{compantFixedAssetsId}")
public String detail(@PathVariable("compantFixedAssetsId") Long compantFixedAssetsId, ModelMap mmap)
{
FinancialCompantFixedAssets financialCompantFixedAssets = financialCompantFixedAssetsService.selectFinancialCompantFixedAssetsById(compantFixedAssetsId);
mmap.put("financialCompantFixedAssets", financialCompantFixedAssets);
return prefix + "/detail";
}
} }

74
ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialCompantFixedAssets.java

@ -1,10 +1,13 @@
package com.ruoyi.financial.domain; package com.ruoyi.financial.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
/** /**
* 公司固定资产对象 financial_compant_fixed_assets * 公司固定资产对象 financial_compant_fixed_assets
* *
@ -19,98 +22,102 @@ public class FinancialCompantFixedAssets extends BaseEntity
private Long compantFixedAssetsId; private Long compantFixedAssetsId;
/** 料号 */ /** 料号 */
@Excel(name = "料号") @Excel(name = "料号",sort = 1)
private String materialCode; private String materialCode;
/** 物料名称 */ /** 物料名称 */
@Excel(name = "物料名称") @Excel(name = "物料名称",sort = 2)
private String materialName; private String materialName;
/** 设备编号 */ /** 设备编号 */
@Excel(name = "设备编号") @Excel(name = "设备编号",sort = 3)
private String equipCode; private String equipCode;
/** 设备名称 */ /** 设备名称 */
@Excel(name = "设备名称") @Excel(name = "设备名称",sort = 4)
private String equipName; private String equipName;
/** 设备型号 */ /** 设备型号 */
@Excel(name = "设备型号") @Excel(name = "型号",sort = 5)
private String equipModel; private String equipModel;
/** 设备重量 */ /** 设备重量 */
@Excel(name = "设备重量")
private String equipWeight; private String equipWeight;
/** 设备状态 */ /** 设备状态 */
@Excel(name = "设备状态") @Excel(name = "设备状态",sort = 9,dictType = "equipStatus")
private String equipStatus; private String equipStatus;
/** 计量单位 */ /** 计量单位 */
@Excel(name = "计量单位") @Excel(name = "单位",sort = 7)
private String equipUnit; private String equipUnit;
/** 设备类别 */ /** 设备类别 */
@Excel(name = "设备类别") // @Excel(name = "设备类别")
private String equipCategory; private String equipCategory;
/** 出厂编号 */ /** 出厂编号 */
@Excel(name = "出厂编号") // @Excel(name = "出厂编号")
private String factoryCode; private String factoryCode;
/** 设备价格 */ /** 设备价格 */
@Excel(name = "设备价格") @Excel(name = "金额",sort = 11)
private Long equipPrice; private Long equipPrice;
/** 厂家代码 */ /** 厂家代码 */
@Excel(name = "厂家代码") // @Excel(name = "厂家代码")
private String manufacturerCode; private String manufacturerCode;
/** 设备生产日期 */ /** 设备生产日期 */
@Excel(name = "设备生产日期") // @Excel(name = "设备生产日期")
private String equipProductionDate; private Date equipProductionDate;
/** 所在部门 */ /** 所在部门 */
@Excel(name = "所在部门") @Excel(name = "所在部门",sort = 8)
private String department; private String department;
/** 设备厂家名称 */ /** 设备厂家名称 */
@Excel(name = "设备厂家名称") @Excel(name = "供应商/品牌",sort = 10)
private String equipManufacturerName; private String equipManufacturerName;
/** 设备使用日期 */ /** 设备使用日期 */
@Excel(name = "设备使用日期") @Excel(name = "领用日期",sort = 12,dateFormat = "yyyy-MM-dd")
private String equipUsageDate; @JsonFormat(pattern = "yyyy-MM-dd")
private Date equipUsageDate;
/** 折旧年数 */ /** 折旧年数 */
@Excel(name = "折旧年数") @Excel(name = "折旧月数",sort = 13)
private String depreciationYears; private String depreciationYears;
/** 年折旧率 */ /** 年折旧率 */
@Excel(name = "年折旧率") // @Excel(name = "年折旧率")
private String annualDepreciationRate; private String annualDepreciationRate;
/** 设备存放位置 */ /** 设备存放位置 */
@Excel(name = "设备存放位置") // @Excel(name = "设备存放位置")
private String equipStorageLocation; private String equipStorageLocation;
/** 完成工序 */ /** 完成工序 */
@Excel(name = "完成工序") // @Excel(name = "完成工序")
private String completeTheProcess; private String completeTheProcess;
/** 负责人 */ /** 负责人 */
@Excel(name = "负责人") // @Excel(name = "负责人")
private String esponsiblePerson; private String esponsiblePerson;
/** 使用状态 */ /** 使用状态 */
@Excel(name = "使用状态") // @Excel(name = "使用状态")
private String useStatus; private String useStatus;
/** 审核状态 */ /** 审核状态 */
@Excel(name = "审核状态")
private String auditStatus; private String auditStatus;
/** 删除标志 */ /** 删除标志 */
private String delFlag; private String delFlag;
/** 描述 */
@Excel(name = "描述",sort = 6)
private String description;
public void setCompantFixedAssetsId(Long compantFixedAssetsId) public void setCompantFixedAssetsId(Long compantFixedAssetsId)
{ {
@ -227,12 +234,12 @@ public class FinancialCompantFixedAssets extends BaseEntity
{ {
return manufacturerCode; return manufacturerCode;
} }
public void setEquipProductionDate(String equipProductionDate) public void setEquipProductionDate(Date equipProductionDate)
{ {
this.equipProductionDate = equipProductionDate; this.equipProductionDate = equipProductionDate;
} }
public String getEquipProductionDate() public Date getEquipProductionDate()
{ {
return equipProductionDate; return equipProductionDate;
} }
@ -254,12 +261,12 @@ public class FinancialCompantFixedAssets extends BaseEntity
{ {
return equipManufacturerName; return equipManufacturerName;
} }
public void setEquipUsageDate(String equipUsageDate) public void setEquipUsageDate(Date equipUsageDate)
{ {
this.equipUsageDate = equipUsageDate; this.equipUsageDate = equipUsageDate;
} }
public String getEquipUsageDate() public Date getEquipUsageDate()
{ {
return equipUsageDate; return equipUsageDate;
} }
@ -335,6 +342,15 @@ public class FinancialCompantFixedAssets extends BaseEntity
{ {
return delFlag; return delFlag;
} }
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

3
ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialCompantFixedAssetsMapper.java

@ -74,4 +74,7 @@ public interface FinancialCompantFixedAssetsMapper
* @return 结果 * @return 结果
*/ */
public int restoreFinancialCompantFixedAssetsById(Long compantFixedAssetsId); public int restoreFinancialCompantFixedAssetsById(Long compantFixedAssetsId);
/*根据id集合查询公司固定资产集合*/
public List<FinancialCompantFixedAssets> selectFinancialCompantFixedAssetsByIds(String[] ids);
} }

3
ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialCompantFixedAssetsService.java

@ -27,6 +27,9 @@ public interface IFinancialCompantFixedAssetsService
*/ */
public List<FinancialCompantFixedAssets> selectFinancialCompantFixedAssetsList(FinancialCompantFixedAssets financialCompantFixedAssets); public List<FinancialCompantFixedAssets> selectFinancialCompantFixedAssetsList(FinancialCompantFixedAssets financialCompantFixedAssets);
/*根据id集合查找公司固定资产集合*/
List<FinancialCompantFixedAssets> selectFinancialCompantFixedAssetsByIds(String[] ids);
/** /**
* 新增公司固定资产 * 新增公司固定资产
* *

7
ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialCompantFixedAssetsServiceImpl.java

@ -46,6 +46,13 @@ public class FinancialCompantFixedAssetsServiceImpl implements IFinancialCompant
return financialCompantFixedAssetsMapper.selectFinancialCompantFixedAssetsList(financialCompantFixedAssets); return financialCompantFixedAssetsMapper.selectFinancialCompantFixedAssetsList(financialCompantFixedAssets);
} }
/*根据id集合查找公司固定资产集合*/
@Override
public List<FinancialCompantFixedAssets> selectFinancialCompantFixedAssetsByIds(String[] ids)
{
return financialCompantFixedAssetsMapper.selectFinancialCompantFixedAssetsByIds(ids);
}
/** /**
* 新增公司固定资产 * 新增公司固定资产
* *

27
ruoyi-admin/src/main/resources/mapper/financial/FinancialCompantFixedAssetsMapper.xml

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="useStatus" column="use_status" /> <result property="useStatus" column="use_status" />
<result property="auditStatus" column="audit_status" /> <result property="auditStatus" column="audit_status" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
<result property="description" column="description" />
</resultMap> </resultMap>
<sql id="selectFinancialCompantFixedAssetsVo"> <sql id="selectFinancialCompantFixedAssetsVo">
@ -43,21 +44,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
equip_price, manufacturer_code, equip_production_date, department, equip_manufacturer_name, equip_price, manufacturer_code, equip_production_date, department, equip_manufacturer_name,
equip_usage_date, depreciation_years, annual_depreciation_rate, equip_storage_location, equip_usage_date, depreciation_years, annual_depreciation_rate, equip_storage_location,
complete_the_process, esponsible_person, remark, create_by, create_time, update_by, complete_the_process, esponsible_person, remark, create_by, create_time, update_by,
update_time, use_status, audit_status, del_flag update_time, use_status, audit_status, del_flag,description
from financial_compant_fixed_assets from financial_compant_fixed_assets
</sql> </sql>
<select id="selectFinancialCompantFixedAssetsList" parameterType="FinancialCompantFixedAssets" resultMap="FinancialCompantFixedAssetsResult"> <select id="selectFinancialCompantFixedAssetsList" parameterType="FinancialCompantFixedAssets" resultMap="FinancialCompantFixedAssetsResult">
<include refid="selectFinancialCompantFixedAssetsVo"/> <include refid="selectFinancialCompantFixedAssetsVo"/>
<where> <where>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if> <if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and material_name = #{materialName}</if> <if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="equipCode != null and equipCode != ''"> and equip_code = #{equipCode}</if> <if test="equipCode != null and equipCode != ''"> and equip_code like concat('%', #{equipCode}, '%')</if>
<if test="equipName != null and equipName != ''"> and equip_name = #{equipName}</if> <if test="equipName != null and equipName != ''"> and equip_name like concat('%', #{equipName}, '%')</if>
<if test="equipModel != null and equipModel != ''"> and equip_model = #{equipModel}</if> <if test="equipModel != null and equipModel != ''"> and equip_model concat('%', #{equipModel}, '%')</if>
<if test="params.beginEquipStatus != null and params.beginEquipStatus != '' and params.endEquipStatus != null and params.endEquipStatus != ''"> and equip_status between #{params.beginEquipStatus} and #{params.endEquipStatus}</if> <if test="params.beginEquipStatus != null and params.beginEquipStatus != '' and params.endEquipStatus != null and params.endEquipStatus != ''"> and equip_status between #{params.beginEquipStatus} and #{params.endEquipStatus}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="equipPrice != null "> and equip_price = #{equipPrice}</if> <if test="equipPrice != null "> and equip_price = #{equipPrice}</if>
<if test="equipStatus != null and equipStatus != ''"> and equip_status = #{equipStatus}</if>
<if test="manufacturerCode != null and manufacturerCode != ''"> and manufacturer_code = #{manufacturerCode}</if> <if test="manufacturerCode != null and manufacturerCode != ''"> and manufacturer_code = #{manufacturerCode}</if>
<if test="params.beginEquipProductionDate != null and params.beginEquipProductionDate != '' and params.endEquipProductionDate != null and params.endEquipProductionDate != ''"> and equip_production_date between #{params.beginEquipProductionDate} and #{params.endEquipProductionDate}</if> <if test="params.beginEquipProductionDate != null and params.beginEquipProductionDate != '' and params.endEquipProductionDate != null and params.endEquipProductionDate != ''"> and equip_production_date between #{params.beginEquipProductionDate} and #{params.endEquipProductionDate}</if>
<if test="department != null and department != ''"> and department = #{department}</if> <if test="department != null and department != ''"> and department = #{department}</if>
@ -106,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="useStatus != null">use_status,</if> <if test="useStatus != null">use_status,</if>
<if test="auditStatus != null">audit_status,</if> <if test="auditStatus != null">audit_status,</if>
<if test="delFlag != null">del_flag,</if> <if test="delFlag != null">del_flag,</if>
<if test="description != null">description,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialCode != null">#{materialCode},</if> <if test="materialCode != null">#{materialCode},</if>
@ -137,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="useStatus != null">#{useStatus},</if> <if test="useStatus != null">#{useStatus},</if>
<if test="auditStatus != null">#{auditStatus},</if> <if test="auditStatus != null">#{auditStatus},</if>
<if test="delFlag != null">#{delFlag},</if> <if test="delFlag != null">#{delFlag},</if>
<if test="description != null">#{description},</if>
</trim> </trim>
</insert> </insert>
@ -156,7 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="equipPrice != null">equip_price = #{equipPrice},</if> <if test="equipPrice != null">equip_price = #{equipPrice},</if>
<if test="manufacturerCode != null">manufacturer_code = #{manufacturerCode},</if> <if test="manufacturerCode != null">manufacturer_code = #{manufacturerCode},</if>
<if test="equipProductionDate != null">equip_production_date = #{equipProductionDate},</if> <if test="equipProductionDate != null">equip_production_date = #{equipProductionDate},</if>
<if test="department != null">department = #{department},</if> <if test="department != null and department != ''">department = #{department},</if>
<if test="equipManufacturerName != null">equip_manufacturer_name = #{equipManufacturerName},</if> <if test="equipManufacturerName != null">equip_manufacturer_name = #{equipManufacturerName},</if>
<if test="equipUsageDate != null">equip_usage_date = #{equipUsageDate},</if> <if test="equipUsageDate != null">equip_usage_date = #{equipUsageDate},</if>
<if test="depreciationYears != null">depreciation_years = #{depreciationYears},</if> <if test="depreciationYears != null">depreciation_years = #{depreciationYears},</if>
@ -172,6 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="useStatus != null">use_status = #{useStatus},</if> <if test="useStatus != null">use_status = #{useStatus},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if> <if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if> <if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="description != null">description = #{description},</if>
</trim> </trim>
where compant_fixed_assets_id = #{compantFixedAssetsId} where compant_fixed_assets_id = #{compantFixedAssetsId}
</update> </update>
@ -195,4 +200,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update financial_compant_fixed_assets set del_flag = '0' where compant_fixed_assets_id = #{compantFixedAssetsId} update financial_compant_fixed_assets set del_flag = '0' where compant_fixed_assets_id = #{compantFixedAssetsId}
</update> </update>
<select id="selectFinancialCompantFixedAssetsByIds" parameterType="String" resultMap="FinancialCompantFixedAssetsResult">
<include refid="selectFinancialCompantFixedAssetsVo"/>
where compant_fixed_assets_id in
<foreach item="compantFixedAssetsId" collection="array" open="(" separator="," close=")">
#{compantFixedAssetsId}
</foreach>
</select>
</mapper> </mapper>

140
ruoyi-admin/src/main/resources/templates/financial/compantFixedAssets/compantFixedAssets.html

@ -15,26 +15,28 @@
<input type="text" name="equipCode" /> <input type="text" name="equipCode" />
</li> </li>
<li> <li>
<label>设备名称</label> <label>料号</label>
<input type="text" name="equipName" /> <input type="text" name="materialCode" />
</li> </li>
<li> <li>
<label>出厂编号</label> <label>物料名称</label>
<input type="text" name="factoryCode"/> <input type="text" name="materialName"/>
</li> </li>
<li> <li>
<label>厂家代码</label> <label>型号</label>
<input type="text" name="manufacturerCode"/> <input type="text" name="equipModel"/>
</li> </li>
<li> <li>
<label>设备厂家名称:</label> <label>设备状态:</label>
<input type="text" name="equipManufacturerName"/> <select name="equipStatus" th:attr="dict=${@dict.getType('equipStatus')}">
<option value="">所有</option>
<option th:each="dict : ${@dict.getType('equipStatus')}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li> </li>
<li> <li>
<label>设备状态:</label> <label>所在部门</label>
<select name="equipStatus" th:attr="dict=${@dict.getType('equipment_state')}"> <select type="text" id="department" name="department">
<option value="">所有</option> <option value="">所有</option>
<option th:each="dict : ${@dict.getType('sys_equip_status')}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</li> </li>
<li> <li>
@ -50,11 +52,8 @@
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="financial:CompantFixedAssets:add"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="financial:CompantFixedAssets:add">
<i class="fa fa-plus"></i> 添加 <i class="fa fa-plus"></i> 添加
</a> </a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="financial:CompantFixedAssets:edit"> <a class="btn btn-success" onclick="exportExcel()" shiro:hasPermission="quality:qualityReport:export">
<i class="fa fa-edit"></i> 修改 <i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="financial:CompantFixedAssets:remove">
<i class="fa fa-remove"></i> 删除
</a> </a>
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
@ -68,56 +67,64 @@
var removeFlag = [[${@permission.hasPermi('financial:CompantFixedAssets:remove')}]]; var removeFlag = [[${@permission.hasPermi('financial:CompantFixedAssets:remove')}]];
var cancelFlag = [[${@permission.hasPermi('financial:CompantFixedAssets:cancel')}]]; var cancelFlag = [[${@permission.hasPermi('financial:CompantFixedAssets:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('financial:CompantFixedAssets:restore')}]]; var restoreFlag = [[${@permission.hasPermi('financial:CompantFixedAssets:restore')}]];
var equipUnitDatas = [[${@dict.getType('ck_liangci')}]]; var equipUnitDatas = [[${@dict.getType('sys_unit_class')}]];
var equipStatusDatas = [[${@dict.getType('equipStatus')}]];
var useStatusDatas = [[${@dict.getType('useStatus')}]]; var useStatusDatas = [[${@dict.getType('useStatus')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var prefix = ctx + "financial/compantFixedAssets"; var prefix = ctx + "financial/compantFixedAssets";
$(function() { $(function() {
getSelections();
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
createUrl: prefix + "/add", createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}", updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove", removeUrl: prefix + "/remove",
cancelUrl: prefix + "/cancel/{id}", detailUrl: prefix + "/detail/{id}",
restoreUrl: prefix + "/restore/{id}", restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
modalName: "公司固定资产", modalName: "公司固定资产",
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{title: '设备档案id',field: 'compantFixedAssetsId',visible: false}, {title: '设备档案id',field: 'compantFixedAssetsId',visible: false},
{title: '料号',field: 'materialCode',sort: true}, {title: '料号',field: 'materialCode',sort: true,align: 'center'},
{title: '物料名称',field: 'materialName',sort: true}, {title: '物料名称',field: 'materialName',sort: true,align: 'center'},
{title: '设备编号',field: 'equipCode',sort: true}, {title: '设备编号',field: 'equipCode',sort: true,align: 'center'},
{title: '设备名称',field: 'equipName',sort: true}, {title: '设备名称',field: 'equipName',sort: true,align: 'center'},
{title: '设备型号',field: 'equipModel',sort: true}, {title: '型号',field: 'equipModel',sort: true,align: 'center'},
{title: '设备重量',field: 'equipWeight',sort: true}, {title: '描述',field: 'description',sort: true,align: 'center'},
{title: '设备状态',field: 'equipStatus',sort: true}, {title: '单位',field: 'equipUnit',align: 'center',
{title: '计量单位',field: 'equipUnit',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(equipUnitDatas, value); return $.table.selectDictLabel(equipUnitDatas, value);
} }
}, },
{title: '设备类别',field: 'equipCategory',sort: true}, {title: '所在部门',field: 'department',sort: true,align: 'center'},
{title: '出厂编号',field: 'factoryCode',sort: true}, {title: '设备状态',field: 'equipStatus',sort: true,align: 'center',
{title: '设备价格',field: 'equipPrice',sort: true}, formatter: function(value, row, index) {
{title: '厂家代码',field: 'manufacturerCode',sort: true}, return $.table.selectDictLabel(equipStatusDatas, value);
{title: '设备生产日期',field: 'equipProductionDate',sort: true}, }
{title: '所在部门',field: 'department',sort: true}, },
{title: '设备厂家名称',field: 'equipManufacturerName',sort: true}, {title: '供应商/品牌',field: 'equipManufacturerName',sort: true,align: 'center'},
{title: '设备使用日期',field: 'equipUsageDate',sort: true}, {title: '金额',field: 'equipPrice',sort: true,align: 'center'},
{title: '折旧年数',field: 'depreciationYears',sort: true}, {title: '领用日期',field: 'equipUsageDate',sort: true,align: 'center'},
{title: '年折旧率',field: 'annualDepreciationRate',sort: true}, {title: '折旧月数',field: 'depreciationYears',sort: true,align: 'center'},
{title: '设备存放位置',field: 'equipStorageLocation',sort: true},
{title: '完成工序',field: 'completeTheProcess',sort: true}, {title: '设备重量',field: 'equipWeight',sort: true,visible: false,},
{title: '负责人',field: 'esponsiblePerson',sort: true}, {title: '设备类别',field: 'equipCategory',sort: true,visible: false,},
{title: '备注',field: 'remark',sort: true}, {title: '出厂编号',field: 'factoryCode',sort: true,visible: false,},
{title: '使用状态',field: 'useStatus', {title: '厂家代码',field: 'manufacturerCode',sort: true,visible: false,},
{title: '设备生产日期',field: 'equipProductionDate',sort: true,visible: false,},
{title: '年折旧率',field: 'annualDepreciationRate',sort: true,visible: false,},
{title: '设备存放位置',field: 'equipStorageLocation',sort: true,visible: false,},
{title: '完成工序',field: 'completeTheProcess',sort: true,visible: false,},
{title: '负责人',field: 'esponsiblePerson',sort: true,visible: false,},
{title: '备注',field: 'remark',sort: true,visible: false,},
{title: '使用状态',field: 'useStatus',visible: false,
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value); return $.table.selectDictLabel(useStatusDatas, value);
} }
}, },
{title: '审核状态',field: 'auditStatus', {title: '审核状态',field: 'auditStatus',visible: false,
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value); return $.table.selectDictLabel(auditStatusDatas, value);
} }
@ -126,12 +133,8 @@
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.compantFixedAssetsId + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.compantFixedAssetsId + '\')"><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.compantFixedAssetsId + '\')"><i class="fa fa-remove"></i>删除</a> '); actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.detail(\'' + row.compantFixedAssetsId + '\')"><i class="fa fa-eye"></i>详情</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
}
return actions.join(''); return actions.join('');
} }
} }
@ -139,6 +142,47 @@
}; };
$.table.init(options); $.table.init(options);
}); });
function getSelections(){
$.ajax({
url: ctx + "system/dept/selectDeptList",
type: "get",
dataType: "json",
success: function (result) {
var deptDatas = result.data;
console.log(deptDatas);
deptDatas.forEach(function (dept){
$('#department').append($('<option>', {
value: dept.deptName,
text: dept.deptName
}));
})
}
});
}
// 导出
function exportExcel() {
var ids = $.table.selectColumns("compantFixedAssetsId");
var dataParam = $("#formId").serializeArray();
let tipMsg = "确定导出当前所有数据吗?";
if ($.common.isNotEmpty(ids)) {
tipMsg = `确定导出选中数据吗?`;
dataParam.push({ "name": "ids", "value": ids });
}
$.modal.confirm(tipMsg, function () {
$.modal.loading("正在导出数据,请稍后...");
$.post( prefix + "/export", dataParam, function (result) {
if (result.code === web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName="+ encodeURI(result.msg) + "&delete=" + true;
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save