Commit 079c9b2a authored by 耿迪迪's avatar 耿迪迪

供需平衡气量监管-日历插件

parent b5547c89
package com.zehong.web.controller.supplybalance;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TSupBalGasSup;
import com.zehong.system.service.ITSupBalGasSupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 供需平衡-气量监管Controller
*
* @author zehong
* @date 2024-06-15
*/
@RestController
@RequestMapping("/supplyBalance/gas")
public class TSupBalGasSupController extends BaseController
{
@Autowired
private ITSupBalGasSupService tSupBalGasSupService;
/**
* 查询供需平衡-气量监管列表
*/
@GetMapping("/list")
public TableDataInfo list(TSupBalGasSup tSupBalGasSup)
{
startPage();
List<TSupBalGasSup> list = tSupBalGasSupService.selectTSupBalGasSupList(tSupBalGasSup);
return getDataTable(list);
}
/**
* 导出供需平衡-气量监管列表
*/
@Log(title = "供需平衡-气量监管", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TSupBalGasSup tSupBalGasSup)
{
List<TSupBalGasSup> list = tSupBalGasSupService.selectTSupBalGasSupList(tSupBalGasSup);
ExcelUtil<TSupBalGasSup> util = new ExcelUtil<TSupBalGasSup>(TSupBalGasSup.class);
return util.exportExcel(list, "供需平衡-气量监管数据");
}
/**
* 获取供需平衡-气量监管详细信息
*/
@GetMapping(value = "/{fGasSupId}")
public AjaxResult getInfo(@PathVariable("fGasSupId") Long fGasSupId)
{
return AjaxResult.success(tSupBalGasSupService.selectTSupBalGasSupById(fGasSupId));
}
/**
* 新增供需平衡-气量监管
*/
@Log(title = "供需平衡-气量监管", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSupBalGasSup tSupBalGasSup)
{
return toAjax(tSupBalGasSupService.insertTSupBalGasSup(tSupBalGasSup));
}
/**
* 修改供需平衡-气量监管
*/
@Log(title = "供需平衡-气量监管", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSupBalGasSup tSupBalGasSup)
{
return toAjax(tSupBalGasSupService.updateTSupBalGasSup(tSupBalGasSup));
}
/**
* 删除供需平衡-气量监管
*/
@Log(title = "供需平衡-气量监管", businessType = BusinessType.DELETE)
@DeleteMapping("/{fGasSupIds}")
public AjaxResult remove(@PathVariable Long[] fGasSupIds)
{
return toAjax(tSupBalGasSupService.deleteTSupBalGasSupByIds(fGasSupIds));
}
/**
* 获取上报信息
* @param companyId 企业id
* @param reportDate 上报时间
* @return
*/
@GetMapping(value = "/getReportInfoByCompany")
public AjaxResult getReportInfoByCompany(@RequestParam(value="companyId")String companyId,@RequestParam(value="reportDate")String reportDate){
return AjaxResult.success(tSupBalGasSupService.getReportInfoByCompany(companyId,reportDate));
}
@GetMapping("/reportInfoList")
public AjaxResult reportInfoList(TSupBalGasSup tSupBalGasSup){
List<TSupBalGasSup> list = tSupBalGasSupService.selectTSupBalGasSupList(tSupBalGasSup);
return AjaxResult.success(list);
}
}
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 供需平衡-气量监管对象 t_sup_bal_gas_sup
*
* @author zehong
* @date 2024-06-15
*/
public class TSupBalGasSup extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long fGasSupId;
/** 企业uuid */
private String fCompanyInfoId;
@Excel(name = "企业名称")
private String enterpriseName;
/** 计划量 */
@Excel(name = "计划量")
private Long fPlanQuan;
/** 批复量 */
@Excel(name = "批复量")
private Long fApprQuan;
/** 供气量 */
@Excel(name = "供气量")
private Long fSupGasVol;
/** 存储量 */
@Excel(name = "存储量")
private Long fStorageVol;
/** 监管气量日期 */
@Excel(name = "监管气量日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date fSupDate;
/** 上报状态 0-未上报,1-已上报 */
@Excel(name = "上报状态 0-未上报,1-已上报")
private String fRepStatus;
/** 上报日期 */
@Excel(name = "上报日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fRepDate;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date beginRepDate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endRepDate;
public void setfGasSupId(Long fGasSupId)
{
this.fGasSupId = fGasSupId;
}
public Long getfGasSupId()
{
return fGasSupId;
}
public void setfCompanyInfoId(String fCompanyInfoId)
{
this.fCompanyInfoId = fCompanyInfoId;
}
public String getfCompanyInfoId()
{
return fCompanyInfoId;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
public void setfPlanQuan(Long fPlanQuan)
{
this.fPlanQuan = fPlanQuan;
}
public Long getfPlanQuan()
{
return fPlanQuan;
}
public void setfApprQuan(Long fApprQuan)
{
this.fApprQuan = fApprQuan;
}
public Long getfApprQuan()
{
return fApprQuan;
}
public void setfSupGasVol(Long fSupGasVol)
{
this.fSupGasVol = fSupGasVol;
}
public Long getfSupGasVol()
{
return fSupGasVol;
}
public void setfStorageVol(Long fStorageVol)
{
this.fStorageVol = fStorageVol;
}
public Long getfStorageVol()
{
return fStorageVol;
}
public void setfSupDate(Date fSupDate)
{
this.fSupDate = fSupDate;
}
public Date getfSupDate()
{
return fSupDate;
}
public void setfRepStatus(String fRepStatus)
{
this.fRepStatus = fRepStatus;
}
public String getfRepStatus()
{
return fRepStatus;
}
public void setfRepDate(Date fRepDate)
{
this.fRepDate = fRepDate;
}
public Date getfRepDate()
{
return fRepDate;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
public Date getBeginRepDate() {
return beginRepDate;
}
public void setBeginRepDate(Date beginRepDate) {
this.beginRepDate = beginRepDate;
}
public Date getEndRepDate() {
return endRepDate;
}
public void setEndRepDate(Date endRepDate) {
this.endRepDate = endRepDate;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fGasSupId", getfGasSupId())
.append("fCompanyInfoId", getfCompanyInfoId())
.append("fPlanQuan", getfPlanQuan())
.append("fApprQuan", getfApprQuan())
.append("fSupGasVol", getfSupGasVol())
.append("fStorageVol", getfStorageVol())
.append("fSupDate", getfSupDate())
.append("fRepStatus", getfRepStatus())
.append("fRepDate", getfRepDate())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TSupBalGasSup;
/**
* 供需平衡-气量监管Mapper接口
*
* @author zehong
* @date 2024-06-15
*/
public interface TSupBalGasSupMapper
{
/**
* 查询供需平衡-气量监管
*
* @param fGasSupId 供需平衡-气量监管ID
* @return 供需平衡-气量监管
*/
public TSupBalGasSup selectTSupBalGasSupById(Long fGasSupId);
/**
* 查询供需平衡-气量监管列表
*
* @param tSupBalGasSup 供需平衡-气量监管
* @return 供需平衡-气量监管集合
*/
public List<TSupBalGasSup> selectTSupBalGasSupList(TSupBalGasSup tSupBalGasSup);
/**
* 新增供需平衡-气量监管
*
* @param tSupBalGasSup 供需平衡-气量监管
* @return 结果
*/
public int insertTSupBalGasSup(TSupBalGasSup tSupBalGasSup);
/**
* 修改供需平衡-气量监管
*
* @param tSupBalGasSup 供需平衡-气量监管
* @return 结果
*/
public int updateTSupBalGasSup(TSupBalGasSup tSupBalGasSup);
/**
* 删除供需平衡-气量监管
*
* @param fGasSupId 供需平衡-气量监管ID
* @return 结果
*/
public int deleteTSupBalGasSupById(Long fGasSupId);
/**
* 批量删除供需平衡-气量监管
*
* @param fGasSupIds 需要删除的数据ID
* @return 结果
*/
public int deleteTSupBalGasSupByIds(Long[] fGasSupIds);
/**
* 获取上报信息
*/
TSupBalGasSup getReportInfoByCompany(Map<String, String> param);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TSupBalGasSup;
/**
* 供需平衡-气量监管Service接口
*
* @author zehong
* @date 2024-06-15
*/
public interface ITSupBalGasSupService
{
/**
* 查询供需平衡-气量监管
*
* @param fGasSupId 供需平衡-气量监管ID
* @return 供需平衡-气量监管
*/
public TSupBalGasSup selectTSupBalGasSupById(Long fGasSupId);
/**
* 查询供需平衡-气量监管列表
*
* @param tSupBalGasSup 供需平衡-气量监管
* @return 供需平衡-气量监管集合
*/
public List<TSupBalGasSup> selectTSupBalGasSupList(TSupBalGasSup tSupBalGasSup);
/**
* 新增供需平衡-气量监管
*
* @param tSupBalGasSup 供需平衡-气量监管
* @return 结果
*/
public int insertTSupBalGasSup(TSupBalGasSup tSupBalGasSup);
/**
* 修改供需平衡-气量监管
*
* @param tSupBalGasSup 供需平衡-气量监管
* @return 结果
*/
public int updateTSupBalGasSup(TSupBalGasSup tSupBalGasSup);
/**
* 批量删除供需平衡-气量监管
*
* @param fGasSupIds 需要删除的供需平衡-气量监管ID
* @return 结果
*/
public int deleteTSupBalGasSupByIds(Long[] fGasSupIds);
/**
* 删除供需平衡-气量监管信息
*
* @param fGasSupId 供需平衡-气量监管ID
* @return 结果
*/
public int deleteTSupBalGasSupById(Long fGasSupId);
/**
* 获取上报信息
* @param companyId 企业id
* @param reportDate 上报时间
* @return
*/
TSupBalGasSup getReportInfoByCompany(String companyId, String reportDate);
}
package com.zehong.system.service.impl;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TSupBalGasSupMapper;
import com.zehong.system.domain.TSupBalGasSup;
import com.zehong.system.service.ITSupBalGasSupService;
/**
* 供需平衡-气量监管Service业务层处理
*
* @author zehong
* @date 2024-06-15
*/
@Service
public class TSupBalGasSupServiceImpl implements ITSupBalGasSupService
{
@Autowired
private TSupBalGasSupMapper tSupBalGasSupMapper;
/**
* 查询供需平衡-气量监管
*
* @param fGasSupId 供需平衡-气量监管ID
* @return 供需平衡-气量监管
*/
@Override
public TSupBalGasSup selectTSupBalGasSupById(Long fGasSupId)
{
return tSupBalGasSupMapper.selectTSupBalGasSupById(fGasSupId);
}
/**
* 查询供需平衡-气量监管列表
*
* @param tSupBalGasSup 供需平衡-气量监管
* @return 供需平衡-气量监管
*/
@Override
public List<TSupBalGasSup> selectTSupBalGasSupList(TSupBalGasSup tSupBalGasSup)
{
return tSupBalGasSupMapper.selectTSupBalGasSupList(tSupBalGasSup);
}
/**
* 新增供需平衡-气量监管
*
* @param tSupBalGasSup 供需平衡-气量监管
* @return 结果
*/
@Override
public int insertTSupBalGasSup(TSupBalGasSup tSupBalGasSup)
{
tSupBalGasSup.setCreateTime(DateUtils.getNowDate());
tSupBalGasSup.setfSupDate(new Date());
tSupBalGasSup.setfCompanyInfoId(SecurityUtils.getLoginUser().getUser().getDeptId());
return tSupBalGasSupMapper.insertTSupBalGasSup(tSupBalGasSup);
}
/**
* 修改供需平衡-气量监管
*
* @param tSupBalGasSup 供需平衡-气量监管
* @return 结果
*/
@Override
public int updateTSupBalGasSup(TSupBalGasSup tSupBalGasSup)
{
tSupBalGasSup.setUpdateTime(DateUtils.getNowDate());
return tSupBalGasSupMapper.updateTSupBalGasSup(tSupBalGasSup);
}
/**
* 批量删除供需平衡-气量监管
*
* @param fGasSupIds 需要删除的供需平衡-气量监管ID
* @return 结果
*/
@Override
public int deleteTSupBalGasSupByIds(Long[] fGasSupIds)
{
return tSupBalGasSupMapper.deleteTSupBalGasSupByIds(fGasSupIds);
}
/**
* 删除供需平衡-气量监管信息
*
* @param fGasSupId 供需平衡-气量监管ID
* @return 结果
*/
@Override
public int deleteTSupBalGasSupById(Long fGasSupId)
{
return tSupBalGasSupMapper.deleteTSupBalGasSupById(fGasSupId);
}
/**
* 获取上报信息
* @param companyId 企业id
* @param reportDate 上报时间
* @return
*/
@Override
public TSupBalGasSup getReportInfoByCompany(String companyId, String reportDate){
Map<String,String> param = new HashMap();
param.put("companyId",companyId);
param.put("reportDate",reportDate);
return tSupBalGasSupMapper.getReportInfoByCompany(param);
}
}
<?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.zehong.system.mapper.TSupBalGasSupMapper">
<resultMap type="TSupBalGasSup" id="TSupBalGasSupResult">
<result property="fGasSupId" column="f_gas_sup_id" />
<result property="fCompanyInfoId" column="f_company_info_id" />
<result property="fPlanQuan" column="f_plan_quan" />
<result property="fApprQuan" column="f_appr_quan" />
<result property="fSupGasVol" column="f_sup_gas_vol" />
<result property="fStorageVol" column="f_storage_vol" />
<result property="fSupDate" column="f_sup_date" />
<result property="fRepStatus" column="f_rep_status" />
<result property="fRepDate" column="f_rep_date" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTSupBalGasSupVo">
SELECT
sup.f_gas_sup_id,
sup.f_company_info_id,
sup.f_plan_quan,
sup.f_appr_quan,
sup.f_sup_gas_vol,
sup.f_storage_vol,
sup.f_sup_date,
sup.f_rep_status,
sup.f_rep_date,
sup.create_by,
sup.create_time,
sup.update_by,
sup.update_time,
sup.is_del,
sup.remarks,
en.enterprise_name as enterpriseName
FROM
t_sup_bal_gas_sup sup
LEFT JOIN t_enterprise_info en ON sup.f_company_info_id = en.enterprise_id
</sql>
<select id="selectTSupBalGasSupList" parameterType="TSupBalGasSup" resultMap="TSupBalGasSupResult">
<include refid="selectTSupBalGasSupVo"/>
<where>
<if test="fCompanyInfoId != null and fCompanyInfoId != ''"> and sup.f_company_info_id like concat('%', #{fCompanyInfoId}, '%')</if>
<if test="fPlanQuan != null "> and sup.f_plan_quan = #{fPlanQuan}</if>
<if test="fApprQuan != null "> and sup.f_appr_quan = #{fApprQuan}</if>
<if test="fSupGasVol != null "> and sup.f_sup_gas_vol = #{fSupGasVol}</if>
<if test="fStorageVol != null "> and sup.f_storage_vol = #{fStorageVol}</if>
<if test="fRepStatus != null and fRepStatus != ''"> and sup.f_rep_status = #{fRepStatus}</if>
<if test="beginRepDate != null and endRepDate != null">and sup.f_rep_date between #{beginRepDate} and #{endRepDate}</if>
<if test="enterpriseName != null and enterpriseName != ''"> and en.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
</where>
</select>
<select id="selectTSupBalGasSupById" parameterType="Long" resultMap="TSupBalGasSupResult">
<include refid="selectTSupBalGasSupVo"/>
where sup.f_gas_sup_id = #{fGasSupId}
</select>
<insert id="insertTSupBalGasSup" parameterType="TSupBalGasSup" useGeneratedKeys="true" keyProperty="fGasSupId">
insert into t_sup_bal_gas_sup
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fCompanyInfoId != null and fCompanyInfoId != ''">f_company_info_id,</if>
<if test="fPlanQuan != null">f_plan_quan,</if>
<if test="fApprQuan != null">f_appr_quan,</if>
<if test="fSupGasVol != null">f_sup_gas_vol,</if>
<if test="fStorageVol != null">f_storage_vol,</if>
<if test="fSupDate != null">f_sup_date,</if>
<if test="fRepStatus != null and fRepStatus != ''">f_rep_status,</if>
<if test="fRepDate != null">f_rep_date,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fCompanyInfoId != null and fCompanyInfoId != ''">#{fCompanyInfoId},</if>
<if test="fPlanQuan != null">#{fPlanQuan},</if>
<if test="fApprQuan != null">#{fApprQuan},</if>
<if test="fSupGasVol != null">#{fSupGasVol},</if>
<if test="fStorageVol != null">#{fStorageVol},</if>
<if test="fSupDate != null">#{fSupDate},</if>
<if test="fRepStatus != null and fRepStatus != ''">#{fRepStatus},</if>
<if test="fRepDate != null">#{fRepDate},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTSupBalGasSup" parameterType="TSupBalGasSup">
update t_sup_bal_gas_sup
<trim prefix="SET" suffixOverrides=",">
<if test="fCompanyInfoId != null and fCompanyInfoId != ''">f_company_info_id = #{fCompanyInfoId},</if>
<if test="fPlanQuan != null">f_plan_quan = #{fPlanQuan},</if>
<if test="fApprQuan != null">f_appr_quan = #{fApprQuan},</if>
<if test="fSupGasVol != null">f_sup_gas_vol = #{fSupGasVol},</if>
<if test="fStorageVol != null">f_storage_vol = #{fStorageVol},</if>
<if test="fSupDate != null">f_sup_date = #{fSupDate},</if>
<if test="fRepStatus != null and fRepStatus != ''">f_rep_status = #{fRepStatus},</if>
<if test="fRepDate != null">f_rep_date = #{fRepDate},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where f_gas_sup_id = #{fGasSupId}
</update>
<delete id="deleteTSupBalGasSupById" parameterType="Long">
delete from t_sup_bal_gas_sup where f_gas_sup_id = #{fGasSupId}
</delete>
<delete id="deleteTSupBalGasSupByIds" parameterType="String">
delete from t_sup_bal_gas_sup where f_gas_sup_id in
<foreach item="fGasSupId" collection="array" open="(" separator="," close=")">
#{fGasSupId}
</foreach>
</delete>
<select id="getReportInfoByCompany" parameterType="Map" resultMap="TSupBalGasSupResult">
<include refid="selectTSupBalGasSupVo"/>
where sup.f_company_info_id = #{companyId} and f_rep_date like concat('%', #{reportDate}, '%')
</select>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询供需平衡-气量监管列表
export function listSup(query) {
return request({
url: '/supplyBalance/gas/list',
method: 'get',
params: query
})
}
// 查询供需平衡-气量监管详细
export function getSup(fGasSupId) {
return request({
url: '/supplyBalance/gas/' + fGasSupId,
method: 'get'
})
}
// 新增供需平衡-气量监管
export function addSup(data) {
return request({
url: '/supplyBalance/gas',
method: 'post',
data: data
})
}
// 修改供需平衡-气量监管
export function updateSup(data) {
return request({
url: '/supplyBalance/gas',
method: 'put',
data: data
})
}
// 删除供需平衡-气量监管
export function delSup(fGasSupId) {
return request({
url: '/supplyBalance/gas/' + fGasSupId,
method: 'delete'
})
}
// 导出供需平衡-气量监管
export function exportSup(query) {
return request({
url: '/supplyBalance/gas/export',
method: 'get',
params: query
})
}
export function getReportInfoByCompany(query) {
return request({
url: '/supplyBalance/gas/getReportInfoByCompany',
method: 'get',
params: query
})
}
export function reportInfoList(query) {
return request({
url: '/supplyBalance/gas/reportInfoList',
method: 'get',
params: query
})
}
<!-- 日历组件 -->
<template>
<div class="calender-select" :style="{width: width}">
<el-date-picker
class="time-select"
v-model="selectDate"
type="month"
value-format="yyyy-MM"
:picker-options="pickerOptions"
popper-class='my-date-picker'
@change="timerChange"
>
</el-date-picker>
<el-calendar
v-model="selectCalender"
@input="dayChange"
>
<template slot="dateCell" slot-scope="{date, data}">
<div
class="day-tag"
>
{{ data.day.split('-')[2] }}
<div class="day-status">{{ getStatus(data.day) }}</div>
</div>
</template>
</el-calendar>
</div>
</template>
<script>
import moment from "moment";
export default {
name: "calender-index",
props:{
value: {
type: String,
default: "",
},
scheduleData: {
type: Array,
default: ()=>[],
},
width: {
type: [Number, String],
default: '30%'
}
},
data(){
return{
selectCalender: new Date(),
selectDate: new Date(),
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
}
},
}
},
mounted(){
this.setDisabledDayClass();
},
methods:{
timerChange(time){
this.selectCalender = time;
this.$emit("input", time + "-01");
this.$emit('dateChange',0);
this.$nextTick(()=>{
this.setDisabledDayClass();
})
},
dayChange(value){
this.selectDate = moment(value).format("YYYY-MM");
this.$emit("input", moment(value.getTime()).format("YYYY-MM-DD"));
this.$emit('dateChange',1);
this.$nextTick(()=>{
this.setDisabledDayClass();
})
},
getStatus(date){
const data = this.scheduleData.find(item => item.date == date);
return data ? data.content : "";
},
//限制今天后时间不可选
setDisabledDayClass() {
let disabledDayNode = document.getElementsByTagName('td');
const jArr=JSON.parse(JSON.stringify(disabledDayNode) );
const Array = [];
for(let item in jArr){
Array.push(disabledDayNode[item]);
}
let toIndex = Array.findIndex(item=>item.className&&item.className.includes('is-today'));
Array.forEach((element,index) => {
if( toIndex >= index || toIndex<0){
element.className =element.className&& element.className.replaceAll("is-pervDay","");
}else {
element.className += ' is-pervDay'
}
})
},
}
}
</script>
<style lang="scss">
.calender-select{
//width: 30%;
position: relative;
.time-select{
position: absolute;
right: 20px;
width: 190px;
}
.el-calendar__button-group{
display: none;
}
.el-calendar-table__row td {
// 去掉边框
border: none !important;
// 缩小高度
.el-calendar-day {
height: 50px;
width: 50px;
border-radius: 50%;
margin: 2px auto;
text-align: center;
display: flex;
}
}
// 自定义选中、悬浮颜色
.el-calendar-table .el-calendar-day:hover {
color: #fff;
background-color: #1890ff !important;
}
.el-calendar-table .is-today .el-calendar-day{
color: #1890ff;
//background-color: dodgerblue !important;
}
.el-calendar-table .is-selected{
background-color: transparent;
}
.el-calendar-table .is-selected .el-calendar-day{
color: #fff;
background-color: #1890ff;
}
/* .current .el-calendar-day{
background-color: rgba(255, 151, 10, 0.23);
//border: 1px solid;
}*/
.day-tag{
margin: auto auto;
}
.day-status{
font-size: 9px;
font-weight: 500;
}
.is-pervDay {
pointer-events: none;
background-color: #f5f5f5;
color: #00000040 !important;
/*.el-calendar-day{
background-color: transparent;
}*/
}
}
//时间选择器
.my-date-picker{
width: 220px !important;
.el-picker-panel__content{
width: 200px !important;
}
.el-month-table td .cell {
width: 40px !important;
}
}
</style>
<template>
<div class="app-container">
<div v-if="-2 == $store.state.user.enterpriseId">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="企业名称" prop="enterpriseName">
<el-input
v-model="queryParams.enterpriseName"
placeholder="请输入企业名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="上报时间">
<el-date-picker
v-model="dateRange"
size="small"
style="width: 240px"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
value-format="yyyy-MM-dd HH:mm:ss"
@change="timeChange"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!--<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:sup:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>-->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="supList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="企业名称" align="center" prop="enterpriseName" />
<el-table-column label="计划量" align="center" prop="fPlanQuan" />
<el-table-column label="批复量" align="center" prop="fApprQuan" />
<el-table-column label="供气量" align="center" prop="fSupGasVol" />
<el-table-column label="存储量" align="center" prop="fStorageVol" />
<el-table-column label="监管气量日期" align="center" prop="fSupDate" />
<el-table-column label="上报状态" align="center" prop="fRepStatus">
<template slot-scope="scope">
<span v-if="scope.row.fRepStatus == '0'">未上报</span>
<span v-else-if="scope.row.fRepStatus == '1'">已上报</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="上报日期" align="center" prop="fRepDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.fRepDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!--<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<!-- 添加或修改气量监管对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="企业uuid" prop="fCompanyInfoId">
<el-input v-model="form.fCompanyInfoId" placeholder="请输入企业uuid" />
</el-form-item>
<el-form-item label="计划量" prop="fPlanQuan">
<el-input v-model="form.fPlanQuan" placeholder="请输入计划量" />
</el-form-item>
<el-form-item label="批复量" prop="fApprQuan">
<el-input v-model="form.fApprQuan" placeholder="请输入批复量" />
</el-form-item>
<el-form-item label="供气量" prop="fSupGasVol">
<el-input v-model="form.fSupGasVol" placeholder="请输入供气量" />
</el-form-item>
<el-form-item label="存储量" prop="fStorageVol">
<el-input v-model="form.fStorageVol" placeholder="请输入存储量" />
</el-form-item>
<el-form-item label="监管气量日期" prop="fSupDate">
<el-input v-model="form.fSupDate" placeholder="请输入监管气量日期" />
</el-form-item>
<el-form-item label="上报状态 0-未上报,1-已上报" prop="fRepStatus">
<el-select v-model="form.fRepStatus" placeholder="请选择上报状态 0-未上报,1-已上报">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="上报日期" prop="fRepDate">
<el-date-picker clearable size="small"
v-model="form.fRepDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择上报日期">
</el-date-picker>
</el-form-item>
<el-form-item label="是否删除(0正常,1删除)" prop="isDel">
<el-input v-model="form.isDel" placeholder="请输入是否删除(0正常,1删除)" />
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<div v-if="-2 != $store.state.user.enterpriseId" class="report-content">
<el-row style="margin-left: -3.5px;margin-right: -3.5px">
<el-col :span="12" style="padding: 0px 3.5px 0px 3.5px">
<div class="report-title">
<div class="title">上报记录</div>
</div>
<div class="content">
<!-- 日历 -->
<Calendar
width="100%"
v-model="reportDate"
:scheduleData="scheduleData"
@dateChange="dateChange"
/>
</div>
</el-col>
<el-col :span="12" style="padding: 0px 3.5px 0px 3.5px">
<div class="report-title flex-between">
<div class="title">上报情况</div>
<el-button
type="primary"
size="small"
@click="reportInfo"
>
上报
</el-button>
</div>
<div class="content">
<div class="state-warp">
<el-row>
<el-col :span="13">
<div class="label-warp">状态</div>
<div class="value-warp">
<span v-if="reportForm.fRepStatus == '1'">已上报</span>
<span v-else>未上报</span>
</div>
</el-col>
<el-col :span="11" style="text-align: right">
<div class="label-warp">上报时间</div>
<div class="value-warp">
<span v-if="reportForm.fRepDate">{{ reportForm.fRepDate }}</span>
<span v-else>暂无</span>
</div>
</el-col>
</el-row>
<el-form label-position="top" label-width="80px" :model="reportForm" style="margin-top: 23px">
<el-form-item label="计划量">
<el-input v-model="reportForm.fPlanQuan">
<template slot="append">万立方</template>
</el-input>
</el-form-item>
<el-form-item label="批复量">
<el-input v-model="reportForm.fApprQuan">
<template slot="append">万立方</template>
</el-input>
</el-form-item>
<el-form-item label="供气量">
<el-input v-model="reportForm.fSupGasVol">
<template slot="append">万立方</template>
</el-input>
</el-form-item>
<el-form-item label="存储量">
<el-input v-model="reportForm.fStorageVol">
<template slot="append">万立方</template>
</el-input>
</el-form-item>
</el-form>
</div>
<!--<div style="border: 1px solid;height: 500px"></div>-->
</div>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import { listSup, getSup, delSup, addSup, updateSup, exportSup, getReportInfoByCompany, reportInfoList } from "@/api/supplybalance/gas";
import Calendar from "@/components/Calendar";
import moment from "moment";
export default {
name: "Sup",
components: {
Calendar
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 气量监管表格数据
supList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fCompanyInfoId: null,
fPlanQuan: null,
fApprQuan: null,
fSupGasVol: null,
fStorageVol: null,
fRepStatus: '1',
beginRepDate: null,
endRepDate: null,
enterpriseName: null
},
// 表单参数
form: {},
// 表单校验
rules: {
fCompanyInfoId: [
{ required: true, message: "企业uuid不能为空", trigger: "blur" }
],
fRepStatus: [
{ required: true, message: "上报状态 0-未上报,1-已上报不能为空", trigger: "change" }
],
},
reportDate: moment().format('YYYY-MM-DD'),
scheduleData:[
{date:'2024-06-19',content:'已上报'},
{date:'2024-06-17',content:'未上报'},
{date:'2024-06-15',content:'已上报'},
{date:'2024-06-14',content:'已上报'}
],
reportForm:{},
dateRange: []
};
},
created() {
this.getList();
const moment = require('moment');
// 获取当月开始时间
const startOfMonth = moment().startOf('month').format('YYYY-MM-DD HH:mm:ss');
// 获取当月结束时间
const endOfMonth = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
this.currentMonthReportInfo(startOfMonth,endOfMonth);
},
mounted(){
this.getReportInfo();
},
methods: {
/** 查询气量监管列表 */
getList() {
this.loading = true;
listSup(this.queryParams).then(response => {
this.supList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
fGasSupId: null,
fCompanyInfoId: null,
fPlanQuan: null,
fApprQuan: null,
fSupGasVol: null,
fStorageVol: null,
fSupDate: null,
fRepStatus: null,
fRepDate: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
this.resetForm("form");
},
// 表单重置
resetReportForm() {
this.reportForm = {
fGasSupId: null,
fCompanyInfoId: null,
fPlanQuan: null,
fApprQuan: null,
fSupGasVol: null,
fStorageVol: null,
fSupDate: null,
fRepStatus: null,
fRepDate: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.dateRange = [];
this.queryParams.beginRepDate = null;
this.queryParams.endRepDate = null;
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.fGasSupId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加气量监管";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const fGasSupId = row.fGasSupId || this.ids
getSup(fGasSupId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改气量监管";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.fGasSupId != null) {
updateSup(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSup(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const fGasSupIds = row.fGasSupId || this.ids;
this.$confirm('是否确认删除气量监管编号为"' + fGasSupIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delSup(fGasSupIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有气量监管数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportSup(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
//日期切换
dateChange(val){
this.resetReportForm();
this.getReportInfo();
if(val == 0){
const startOfMonth = moment(this.reportDate).startOf('month').format('YYYY-MM-DD HH:mm:ss');
// 获取当月结束时间
const endOfMonth = moment(this.reportDate).endOf('month').format('YYYY-MM-DD HH:mm:ss');
this.currentMonthReportInfo(startOfMonth,endOfMonth);
}
},
getReportInfo(){
getReportInfoByCompany({companyId:this.$store.state.user.enterpriseId,reportDate:this.reportDate}).then(res =>{
if(res.code && res.data){
this.reportForm = res.data;
}
})
},
//上报
reportInfo(){
this.reportForm.fRepDate = this.reportDate;
this.reportForm.fRepStatus = '1';
if (this.reportForm.fGasSupId != null) {
updateSup(this.reportForm).then(response => {
this.msgSuccess("上报成功");
});
} else {
addSup(this.reportForm).then(response => {
this.msgSuccess("上报成功");
});
}
},
currentMonthReportInfo(beginRepDate,endRepDate){
reportInfoList({fCompanyInfoId:this.$store.state.user.enterpriseId,beginRepDate:beginRepDate,endRepDate:endRepDate}).then(res =>{
if(res.code == 200 && res.data){
this.scheduleData = [];
res.data.forEach(item =>{
this.scheduleData.push({date:item.fRepDate,content:item.fRepStatus == '1'?"已上报":"未上报"})
})
}
})
},
timeChange(val){
this.queryParams.beginRepDate = val[0];
this.queryParams.endRepDate = val[1];
}
}
};
</script>
<style scoped lang="scss">
.report-content{
//border: 1px solid;
margin: auto;
max-width: 1200px;
padding: 30px
}
.report-title{
background: rgb(241, 241, 242);
padding: 20px 30px;
border-radius: 3px;
}
.report-title .title{
line-height: 32px;
font-weight: 500;
}
.content{
background: var(--custom-background-soft);
box-shadow: 0 3px 14px #a9aaab80;
border-radius: 3px;
padding: 32px 48px;
height: 525px;
}
.state-warp{
border-bottom: 1px solid #d4d4d4;
height: 54px;
margin-top: -10px;
padding-bottom: 8px;
margin-bottom: 24px;
color: var(--custom-main-text-color);
}
.label-warp{
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(24, 31, 67, .5);
line-height: 20px;
}
.value-warp{
font-weight: 500;
font-size: 18px;
line-height: 25px;
}
.flex-between{
display: flex;
justify-content: space-between;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment