数字农机编码管理

This commit is contained in:
wangyan21 2023-11-13 16:09:36 +08:00
parent 3cec371963
commit 8fe5f2b0be
9 changed files with 907 additions and 3 deletions

View File

@ -0,0 +1,98 @@
package com.god.web.controller.machinery;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.god.common.annotation.Log;
import com.god.common.core.controller.BaseController;
import com.god.common.core.domain.AjaxResult;
import com.god.common.enums.BusinessType;
import com.god.passenger.machinery.domain.CqygMachineCodeInfo;
import com.god.passenger.machinery.service.ICqygMachineCodeInfoService;
import com.god.common.utils.poi.ExcelUtil;
import com.god.common.core.page.TableDataInfo;
/**
* 数字农机编码管理Controller
*
* @author wangyan
* @date 2023-11-13
*/
@RestController
@RequestMapping("/machinery/info")
public class CqygMachineCodeInfoController extends BaseController {
@Autowired
private ICqygMachineCodeInfoService cqygMachineCodeInfoService;
/**
* 查询数字农机编码管理列表
*/
@PreAuthorize("@ss.hasPermi('machinery:info:list')")
@GetMapping("/list")
public TableDataInfo list(CqygMachineCodeInfo cqygMachineCodeInfo) {
startPage();
List<CqygMachineCodeInfo> list = cqygMachineCodeInfoService.selectCqygMachineCodeInfoList(cqygMachineCodeInfo);
return getDataTable(list);
}
/**
* 导出数字农机编码管理列表
*/
@PreAuthorize("@ss.hasPermi('machinery:info:export')")
@Log(title = "数字农机编码管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CqygMachineCodeInfo cqygMachineCodeInfo) {
List<CqygMachineCodeInfo> list = cqygMachineCodeInfoService.selectCqygMachineCodeInfoList(cqygMachineCodeInfo);
ExcelUtil<CqygMachineCodeInfo> util = new ExcelUtil<CqygMachineCodeInfo>(CqygMachineCodeInfo.class);
util.exportExcel(response, list, "数字农机编码管理数据");
}
/**
* 获取数字农机编码管理详细信息
*/
@PreAuthorize("@ss.hasPermi('machinery:info:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
return success(cqygMachineCodeInfoService.selectCqygMachineCodeInfoById(id));
}
/**
* 新增数字农机编码管理
*/
@PreAuthorize("@ss.hasPermi('machinery:info:add')")
@Log(title = "数字农机编码管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CqygMachineCodeInfo cqygMachineCodeInfo) {
return toAjax(cqygMachineCodeInfoService.insertCqygMachineCodeInfo(cqygMachineCodeInfo));
}
/**
* 修改数字农机编码管理
*/
@PreAuthorize("@ss.hasPermi('machinery:info:edit')")
@Log(title = "数字农机编码管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CqygMachineCodeInfo cqygMachineCodeInfo) {
return toAjax(cqygMachineCodeInfoService.updateCqygMachineCodeInfo(cqygMachineCodeInfo));
}
/**
* 删除数字农机编码管理
*/
@PreAuthorize("@ss.hasPermi('machinery:info:remove')")
@Log(title = "数字农机编码管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(cqygMachineCodeInfoService.deleteCqygMachineCodeInfoByIds(ids));
}
}

View File

@ -0,0 +1,122 @@
package com.god.passenger.machinery.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.god.common.annotation.Excel;
import com.god.common.core.domain.BaseEntity;
/**
* 数字农机编码管理对象 cqyg_machine_code_info
*
* @author wangyan
* @date 2023-11-13
*/
public class CqygMachineCodeInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 机器编码 */
@Excel(name = "机器编码")
private String machineCode;
/** 出厂编号 */
@Excel(name = "出厂编号")
private String factoryNumber;
/** 农机型号 */
@Excel(name = "农机型号")
private String machineModel;
/** 农机名称 */
@Excel(name = "农机名称")
private String machineName;
/** 农机类型 */
@Excel(name = "农机类型")
private String machineTypeCode;
/** 发码时间 */
@Excel(name = "发码时间")
private String codeSendTime;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setMachineCode(String machineCode)
{
this.machineCode = machineCode;
}
public String getMachineCode()
{
return machineCode;
}
public void setFactoryNumber(String factoryNumber)
{
this.factoryNumber = factoryNumber;
}
public String getFactoryNumber()
{
return factoryNumber;
}
public void setMachineModel(String machineModel)
{
this.machineModel = machineModel;
}
public String getMachineModel()
{
return machineModel;
}
public void setMachineName(String machineName)
{
this.machineName = machineName;
}
public String getMachineName()
{
return machineName;
}
public void setMachineTypeCode(String machineTypeCode)
{
this.machineTypeCode = machineTypeCode;
}
public String getMachineTypeCode()
{
return machineTypeCode;
}
public void setCodeSendTime(String codeSendTime)
{
this.codeSendTime = codeSendTime;
}
public String getCodeSendTime()
{
return codeSendTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("machineCode", getMachineCode())
.append("factoryNumber", getFactoryNumber())
.append("machineModel", getMachineModel())
.append("machineName", getMachineName())
.append("machineTypeCode", getMachineTypeCode())
.append("codeSendTime", getCodeSendTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.god.passenger.machinery.mapper;
import java.util.List;
import com.god.passenger.machinery.domain.CqygMachineCodeInfo;
/**
* 数字农机编码管理Mapper接口
*
* @author wangyan
* @date 2023-11-13
*/
public interface CqygMachineCodeInfoMapper
{
/**
* 查询数字农机编码管理
*
* @param id 数字农机编码管理主键
* @return 数字农机编码管理
*/
public CqygMachineCodeInfo selectCqygMachineCodeInfoById(String id);
/**
* 查询数字农机编码管理列表
*
* @param cqygMachineCodeInfo 数字农机编码管理
* @return 数字农机编码管理集合
*/
public List<CqygMachineCodeInfo> selectCqygMachineCodeInfoList(CqygMachineCodeInfo cqygMachineCodeInfo);
/**
* 新增数字农机编码管理
*
* @param cqygMachineCodeInfo 数字农机编码管理
* @return 结果
*/
public int insertCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo);
/**
* 修改数字农机编码管理
*
* @param cqygMachineCodeInfo 数字农机编码管理
* @return 结果
*/
public int updateCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo);
/**
* 删除数字农机编码管理
*
* @param id 数字农机编码管理主键
* @return 结果
*/
public int deleteCqygMachineCodeInfoById(String id);
/**
* 批量删除数字农机编码管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteCqygMachineCodeInfoByIds(String[] ids);
}

View File

@ -0,0 +1,61 @@
package com.god.passenger.machinery.service;
import java.util.List;
import com.god.passenger.machinery.domain.CqygMachineCodeInfo;
/**
* 数字农机编码管理Service接口
*
* @author wangyan
* @date 2023-11-13
*/
public interface ICqygMachineCodeInfoService
{
/**
* 查询数字农机编码管理
*
* @param id 数字农机编码管理主键
* @return 数字农机编码管理
*/
public CqygMachineCodeInfo selectCqygMachineCodeInfoById(String id);
/**
* 查询数字农机编码管理列表
*
* @param cqygMachineCodeInfo 数字农机编码管理
* @return 数字农机编码管理集合
*/
public List<CqygMachineCodeInfo> selectCqygMachineCodeInfoList(CqygMachineCodeInfo cqygMachineCodeInfo);
/**
* 新增数字农机编码管理
*
* @param cqygMachineCodeInfo 数字农机编码管理
* @return 结果
*/
public int insertCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo);
/**
* 修改数字农机编码管理
*
* @param cqygMachineCodeInfo 数字农机编码管理
* @return 结果
*/
public int updateCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo);
/**
* 批量删除数字农机编码管理
*
* @param ids 需要删除的数字农机编码管理主键集合
* @return 结果
*/
public int deleteCqygMachineCodeInfoByIds(String[] ids);
/**
* 删除数字农机编码管理信息
*
* @param id 数字农机编码管理主键
* @return 结果
*/
public int deleteCqygMachineCodeInfoById(String id);
}

View File

@ -0,0 +1,92 @@
package com.god.passenger.machinery.service.impl;
import java.util.List;
import com.god.common.utils.StringUtils;
import com.god.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.god.passenger.machinery.mapper.CqygMachineCodeInfoMapper;
import com.god.passenger.machinery.domain.CqygMachineCodeInfo;
import com.god.passenger.machinery.service.ICqygMachineCodeInfoService;
/**
* 数字农机编码管理Service业务层处理
*
* @author wangyan
* @date 2023-11-13
*/
@Service
public class CqygMachineCodeInfoServiceImpl implements ICqygMachineCodeInfoService {
@Autowired
private CqygMachineCodeInfoMapper cqygMachineCodeInfoMapper;
/**
* 查询数字农机编码管理
*
* @param id 数字农机编码管理主键
* @return 数字农机编码管理
*/
@Override
public CqygMachineCodeInfo selectCqygMachineCodeInfoById(String id) {
return cqygMachineCodeInfoMapper.selectCqygMachineCodeInfoById(id);
}
/**
* 查询数字农机编码管理列表
*
* @param cqygMachineCodeInfo 数字农机编码管理
* @return 数字农机编码管理
*/
@Override
public List<CqygMachineCodeInfo> selectCqygMachineCodeInfoList(CqygMachineCodeInfo cqygMachineCodeInfo) {
return cqygMachineCodeInfoMapper.selectCqygMachineCodeInfoList(cqygMachineCodeInfo);
}
/**
* 新增数字农机编码管理
*
* @param cqygMachineCodeInfo 数字农机编码管理
* @return 结果
*/
@Override
public int insertCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo) {
if (StringUtils.isBlank(cqygMachineCodeInfo.getId())){
cqygMachineCodeInfo.setId(IdUtils.fastSimpleUUID());
}
return cqygMachineCodeInfoMapper.insertCqygMachineCodeInfo(cqygMachineCodeInfo);
}
/**
* 修改数字农机编码管理
*
* @param cqygMachineCodeInfo 数字农机编码管理
* @return 结果
*/
@Override
public int updateCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo) {
return cqygMachineCodeInfoMapper.updateCqygMachineCodeInfo(cqygMachineCodeInfo);
}
/**
* 批量删除数字农机编码管理
*
* @param ids 需要删除的数字农机编码管理主键
* @return 结果
*/
@Override
public int deleteCqygMachineCodeInfoByIds(String[] ids) {
return cqygMachineCodeInfoMapper.deleteCqygMachineCodeInfoByIds(ids);
}
/**
* 删除数字农机编码管理信息
*
* @param id 数字农机编码管理主键
* @return 结果
*/
@Override
public int deleteCqygMachineCodeInfoById(String id) {
return cqygMachineCodeInfoMapper.deleteCqygMachineCodeInfoById(id);
}
}

View File

@ -0,0 +1,87 @@
<?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.god.passenger.machinery.mapper.CqygMachineCodeInfoMapper">
<resultMap type="CqygMachineCodeInfo" id="CqygMachineCodeInfoResult">
<result property="id" column="id" />
<result property="machineCode" column="machine_code" />
<result property="factoryNumber" column="factory_number" />
<result property="machineModel" column="machine_model" />
<result property="machineName" column="machine_name" />
<result property="machineTypeCode" column="machine_type_code" />
<result property="codeSendTime" column="code_send_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectCqygMachineCodeInfoVo">
select id, machine_code, factory_number, machine_model, machine_name, machine_type_code, code_send_time, remark from cqyg_machine_code_info
</sql>
<select id="selectCqygMachineCodeInfoList" parameterType="CqygMachineCodeInfo" resultMap="CqygMachineCodeInfoResult">
<include refid="selectCqygMachineCodeInfoVo"/>
<where>
<if test="machineCode != null and machineCode != ''"> and machine_code = #{machineCode}</if>
<if test="factoryNumber != null and factoryNumber != ''"> and factory_number = #{factoryNumber}</if>
<if test="machineModel != null and machineModel != ''"> and machine_model like concat('%', #{machineModel}, '%')</if>
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
<if test="machineTypeCode != null and machineTypeCode != ''"> and machine_type_code like concat('%', #{machineTypeCode}, '%')</if>
<if test="params.beginCodeSendTime != null and params.beginCodeSendTime != '' and params.endCodeSendTime != null and params.endCodeSendTime != ''"> and code_send_time between #{params.beginCodeSendTime} and #{params.endCodeSendTime}</if>
</where>
</select>
<select id="selectCqygMachineCodeInfoById" parameterType="String" resultMap="CqygMachineCodeInfoResult">
<include refid="selectCqygMachineCodeInfoVo"/>
where id = #{id}
</select>
<insert id="insertCqygMachineCodeInfo" parameterType="CqygMachineCodeInfo">
insert into cqyg_machine_code_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="machineCode != null">machine_code,</if>
<if test="factoryNumber != null">factory_number,</if>
<if test="machineModel != null">machine_model,</if>
<if test="machineName != null">machine_name,</if>
<if test="machineTypeCode != null">machine_type_code,</if>
<if test="codeSendTime != null">code_send_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="machineCode != null">#{machineCode},</if>
<if test="factoryNumber != null">#{factoryNumber},</if>
<if test="machineModel != null">#{machineModel},</if>
<if test="machineName != null">#{machineName},</if>
<if test="machineTypeCode != null">#{machineTypeCode},</if>
<if test="codeSendTime != null">#{codeSendTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateCqygMachineCodeInfo" parameterType="CqygMachineCodeInfo">
update cqyg_machine_code_info
<trim prefix="SET" suffixOverrides=",">
<if test="machineCode != null">machine_code = #{machineCode},</if>
<if test="factoryNumber != null">factory_number = #{factoryNumber},</if>
<if test="machineModel != null">machine_model = #{machineModel},</if>
<if test="machineName != null">machine_name = #{machineName},</if>
<if test="machineTypeCode != null">machine_type_code = #{machineTypeCode},</if>
<if test="codeSendTime != null">code_send_time = #{codeSendTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCqygMachineCodeInfoById" parameterType="String">
delete from cqyg_machine_code_info where id = #{id}
</delete>
<delete id="deleteCqygMachineCodeInfoByIds" parameterType="String">
delete from cqyg_machine_code_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询数字农机编码管理列表
export function listInfo(query) {
return request({
url: '/machinery/info/list',
method: 'get',
params: query
})
}
// 查询数字农机编码管理详细
export function getInfo(id) {
return request({
url: '/machinery/info/' + id,
method: 'get'
})
}
// 新增数字农机编码管理
export function addInfo(data) {
return request({
url: '/machinery/info',
method: 'post',
data: data
})
}
// 修改数字农机编码管理
export function updateInfo(data) {
return request({
url: '/machinery/info',
method: 'put',
data: data
})
}
// 删除数字农机编码管理
export function delInfo(id) {
return request({
url: '/machinery/info/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,339 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="机器编码" prop="machineCode">
<el-input
v-model="queryParams.machineCode"
placeholder="请输入机器编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="出厂编号" prop="factoryNumber">
<el-input
v-model="queryParams.factoryNumber"
placeholder="请输入出厂编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="农机型号" prop="machineModel">
<el-input
v-model="queryParams.machineModel"
placeholder="请输入农机型号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="农机名称" prop="machineName">
<el-input
v-model="queryParams.machineName"
placeholder="请输入农机名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="农机类型" prop="machineTypeCode">
<el-input
v-model="queryParams.machineTypeCode"
placeholder="请输入农机类型"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="发码时间">
<el-date-picker
v-model="daterangeCodeSendTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></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="['machinery:info: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"
v-hasPermi="['machinery:info:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['machinery:info:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['machinery:info:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="机器编码" align="center" prop="machineCode" />
<el-table-column label="出厂编号" align="center" prop="factoryNumber" />
<el-table-column label="农机型号" align="center" prop="machineModel" />
<el-table-column label="农机名称" align="center" prop="machineName" />
<el-table-column label="农机类型" align="center" prop="machineTypeCode" />
<el-table-column label="发码时间" align="center" prop="codeSendTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.codeSendTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<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)"
v-hasPermi="['machinery:info:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['machinery:info:remove']"
>删除</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"
/>
<!-- 添加或修改数字农机编码管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="机器编码" prop="machineCode">
<el-input v-model="form.machineCode" placeholder="请输入机器编码" />
</el-form-item>
<el-form-item label="出厂编号" prop="factoryNumber">
<el-input v-model="form.factoryNumber" placeholder="请输入出厂编号" />
</el-form-item>
<el-form-item label="农机型号" prop="machineModel">
<el-input v-model="form.machineModel" placeholder="请输入农机型号" />
</el-form-item>
<el-form-item label="农机名称" prop="machineName">
<el-input v-model="form.machineName" placeholder="请输入农机名称" />
</el-form-item>
<el-form-item label="农机类型" prop="machineTypeCode">
<el-input v-model="form.machineTypeCode" placeholder="请输入农机类型" />
</el-form-item>
<el-form-item label="发码时间" prop="codeSendTime">
<el-date-picker clearable
v-model="form.codeSendTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择发码时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" 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>
</template>
<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/machinery/info";
export default {
name: "Info",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
infoList: [],
//
title: "",
//
open: false,
//
daterangeCodeSendTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
machineCode: null,
factoryNumber: null,
machineModel: null,
machineName: null,
machineTypeCode: null,
codeSendTime: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询数字农机编码管理列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeCodeSendTime && '' != this.daterangeCodeSendTime) {
this.queryParams.params["beginCodeSendTime"] = this.daterangeCodeSendTime[0];
this.queryParams.params["endCodeSendTime"] = this.daterangeCodeSendTime[1];
}
listInfo(this.queryParams).then(response => {
this.infoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
machineCode: null,
factoryNumber: null,
machineModel: null,
machineName: null,
machineTypeCode: null,
codeSendTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCodeSendTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加数字农机编码管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getInfo(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改数字农机编码管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除数字农机编码管理编号为"' + ids + '"的数据项?').then(function() {
return delInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('machinery/info/export', {
...this.queryParams
}, `info_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -109,7 +109,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ruleList" @selection-change="handleSelectionChange" border>
<el-table v-loading="loading" :data="ruleList" @selection-change="handleSelectionChange" border :span-method="objectSpanMethod">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="大类编码" align="center" prop="largeCategoryCode" />
<el-table-column label="大类名称" align="center" prop="largeCategoryName" />
@ -252,12 +252,12 @@ export default {
}
//
//row.ownerCode === prevRow.ownerCode
if (prevRow && prevRow[column.property] == cellValue && row.largeCategoryCode === prevRow.largeCategoryCode) {
if (prevRow && prevRow[column.property] == cellValue && row.codeInfo === prevRow.codeInfo) {
return {rowspan: 0, colspan: 0}
} else {
let rowspan = 1
//row.ownerCode === prevRow.ownerCode
while (nextRow && nextRow[column.property] == cellValue && row.largeCategoryCode === nextRow.largeCategoryCode) {
while (nextRow && nextRow[column.property] == cellValue && row.codeInfo === nextRow.codeInfo) {
rowspan++
nextRow = dataProvider[rowspan + rowIndex]