add 代码生成标签记录
parent
da4f8dd8c9
commit
62af5a8f17
@ -1,7 +0,0 @@
|
||||
package hw.tagApi;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello, World!");
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package hw.tagApi.service.controller;
|
||||
|
||||
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 hw.tagApi.common.annotation.Log;
|
||||
import hw.tagApi.common.core.controller.BaseController;
|
||||
import hw.tagApi.common.core.domain.AjaxResult;
|
||||
import hw.tagApi.common.enums.BusinessType;
|
||||
import hw.tagApi.service.domain.HwTagRecord;
|
||||
import hw.tagApi.service.service.IHwTagRecordService;
|
||||
import hw.tagApi.common.utils.poi.ExcelUtil;
|
||||
import hw.tagApi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 标签记录Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-04-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/service/tagRecord")
|
||||
public class HwTagRecordController extends BaseController {
|
||||
@Autowired
|
||||
private IHwTagRecordService hwTagRecordService;
|
||||
|
||||
/**
|
||||
* 查询标签记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('service:tagRecord:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HwTagRecord hwTagRecord) {
|
||||
startPage();
|
||||
List<HwTagRecord> list = hwTagRecordService.selectHwTagRecordList(hwTagRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出标签记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('service:tagRecord:export')")
|
||||
@Log(title = "标签记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HwTagRecord hwTagRecord) {
|
||||
List<HwTagRecord> list = hwTagRecordService.selectHwTagRecordList(hwTagRecord);
|
||||
ExcelUtil<HwTagRecord> util = new ExcelUtil<HwTagRecord>(HwTagRecord.class);
|
||||
util.exportExcel(response, list, "标签记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取标签记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('service:tagRecord:query')")
|
||||
@GetMapping(value = "/{rId}")
|
||||
public AjaxResult getInfo(@PathVariable("rId") Long rId) {
|
||||
return success(hwTagRecordService.selectHwTagRecordByRId(rId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增标签记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('service:tagRecord:add')")
|
||||
@Log(title = "标签记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HwTagRecord hwTagRecord) {
|
||||
return toAjax(hwTagRecordService.insertHwTagRecord(hwTagRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改标签记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('service:tagRecord:edit')")
|
||||
@Log(title = "标签记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HwTagRecord hwTagRecord) {
|
||||
return toAjax(hwTagRecordService.updateHwTagRecord(hwTagRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标签记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('service:tagRecord:remove')")
|
||||
@Log(title = "标签记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{rIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] rIds) {
|
||||
return toAjax(hwTagRecordService.deleteHwTagRecordByRIds(rIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package hw.tagApi.service.controller;
|
||||
|
||||
import hw.tagApi.common.core.controller.BaseController;
|
||||
import hw.tagApi.service.service.IHwTagRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 标签记录Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-04-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/docs")
|
||||
public class KDocsApiController extends BaseController {
|
||||
@Autowired
|
||||
private IHwTagRecordService hwTagRecordService;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package hw.tagApi.service.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import hw.tagApi.service.domain.HwTagRecord;
|
||||
|
||||
/**
|
||||
* 标签记录Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-04-15
|
||||
*/
|
||||
public interface HwTagRecordMapper
|
||||
{
|
||||
/**
|
||||
* 查询标签记录
|
||||
*
|
||||
* @param rId 标签记录主键
|
||||
* @return 标签记录
|
||||
*/
|
||||
public HwTagRecord selectHwTagRecordByRId(Long rId);
|
||||
|
||||
/**
|
||||
* 查询标签记录列表
|
||||
*
|
||||
* @param hwTagRecord 标签记录
|
||||
* @return 标签记录集合
|
||||
*/
|
||||
public List<HwTagRecord> selectHwTagRecordList(HwTagRecord hwTagRecord);
|
||||
|
||||
/**
|
||||
* 新增标签记录
|
||||
*
|
||||
* @param hwTagRecord 标签记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwTagRecord(HwTagRecord hwTagRecord);
|
||||
|
||||
/**
|
||||
* 修改标签记录
|
||||
*
|
||||
* @param hwTagRecord 标签记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwTagRecord(HwTagRecord hwTagRecord);
|
||||
|
||||
/**
|
||||
* 删除标签记录
|
||||
*
|
||||
* @param rId 标签记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwTagRecordByRId(Long rId);
|
||||
|
||||
/**
|
||||
* 批量删除标签记录
|
||||
*
|
||||
* @param rIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwTagRecordByRIds(Long[] rIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package hw.tagApi.service.service;
|
||||
|
||||
import java.util.List;
|
||||
import hw.tagApi.service.domain.HwTagRecord;
|
||||
|
||||
/**
|
||||
* 标签记录Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-04-15
|
||||
*/
|
||||
public interface IHwTagRecordService
|
||||
{
|
||||
/**
|
||||
* 查询标签记录
|
||||
*
|
||||
* @param rId 标签记录主键
|
||||
* @return 标签记录
|
||||
*/
|
||||
public HwTagRecord selectHwTagRecordByRId(Long rId);
|
||||
|
||||
/**
|
||||
* 查询标签记录列表
|
||||
*
|
||||
* @param hwTagRecord 标签记录
|
||||
* @return 标签记录集合
|
||||
*/
|
||||
public List<HwTagRecord> selectHwTagRecordList(HwTagRecord hwTagRecord);
|
||||
|
||||
/**
|
||||
* 新增标签记录
|
||||
*
|
||||
* @param hwTagRecord 标签记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwTagRecord(HwTagRecord hwTagRecord);
|
||||
|
||||
/**
|
||||
* 修改标签记录
|
||||
*
|
||||
* @param hwTagRecord 标签记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwTagRecord(HwTagRecord hwTagRecord);
|
||||
|
||||
/**
|
||||
* 批量删除标签记录
|
||||
*
|
||||
* @param rIds 需要删除的标签记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwTagRecordByRIds(Long[] rIds);
|
||||
|
||||
/**
|
||||
* 删除标签记录信息
|
||||
*
|
||||
* @param rId 标签记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwTagRecordByRId(Long rId);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package hw.tagApi.service.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import hw.tagApi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import hw.tagApi.service.mapper.HwTagRecordMapper;
|
||||
import hw.tagApi.service.domain.HwTagRecord;
|
||||
import hw.tagApi.service.service.IHwTagRecordService;
|
||||
|
||||
/**
|
||||
* 标签记录Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-04-15
|
||||
*/
|
||||
@Service
|
||||
public class HwTagRecordServiceImpl implements IHwTagRecordService
|
||||
{
|
||||
@Autowired
|
||||
private HwTagRecordMapper hwTagRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询标签记录
|
||||
*
|
||||
* @param rId 标签记录主键
|
||||
* @return 标签记录
|
||||
*/
|
||||
@Override
|
||||
public HwTagRecord selectHwTagRecordByRId(Long rId)
|
||||
{
|
||||
return hwTagRecordMapper.selectHwTagRecordByRId(rId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标签记录列表
|
||||
*
|
||||
* @param hwTagRecord 标签记录
|
||||
* @return 标签记录
|
||||
*/
|
||||
@Override
|
||||
public List<HwTagRecord> selectHwTagRecordList(HwTagRecord hwTagRecord)
|
||||
{
|
||||
return hwTagRecordMapper.selectHwTagRecordList(hwTagRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增标签记录
|
||||
*
|
||||
* @param hwTagRecord 标签记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertHwTagRecord(HwTagRecord hwTagRecord)
|
||||
{
|
||||
hwTagRecord.setCreateTime(DateUtils.getNowDate());
|
||||
return hwTagRecordMapper.insertHwTagRecord(hwTagRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改标签记录
|
||||
*
|
||||
* @param hwTagRecord 标签记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateHwTagRecord(HwTagRecord hwTagRecord)
|
||||
{
|
||||
hwTagRecord.setUpdateTime(DateUtils.getNowDate());
|
||||
return hwTagRecordMapper.updateHwTagRecord(hwTagRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除标签记录
|
||||
*
|
||||
* @param rIds 需要删除的标签记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwTagRecordByRIds(Long[] rIds)
|
||||
{
|
||||
return hwTagRecordMapper.deleteHwTagRecordByRIds(rIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标签记录信息
|
||||
*
|
||||
* @param rId 标签记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwTagRecordByRId(Long rId)
|
||||
{
|
||||
return hwTagRecordMapper.deleteHwTagRecordByRId(rId);
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
<?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="hw.tagApi.service.mapper.HwTagRecordMapper">
|
||||
|
||||
<resultMap type="HwTagRecord" id="HwTagRecordResult">
|
||||
<result property="rId" column="r_id" />
|
||||
<result property="tId" column="t_id" />
|
||||
<result property="epc" column="epc" />
|
||||
<result property="password" column="password" />
|
||||
<result property="orderCode" column="order_code" />
|
||||
<result property="batchNumber" column="batch_number" />
|
||||
<result property="tagSequence" column="tag_sequence" />
|
||||
<result property="totalQuantity" column="total_quantity" />
|
||||
<result property="tagBatch" column="tag_batch" />
|
||||
<result property="modelCode" column="model_code" />
|
||||
<result property="processingTime" column="processing_time" />
|
||||
<result property="operatorId" column="operator_id" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="fields1" column="fields_1" />
|
||||
<result property="fields2" column="fields_2" />
|
||||
<result property="fields3" column="fields_3" />
|
||||
<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="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHwTagRecordVo">
|
||||
select r_id, t_id, epc, password, order_code, batch_number, tag_sequence, total_quantity, tag_batch, model_code, processing_time, operator_id, del_flag, fields_1, fields_2, fields_3, create_by, create_time, update_by, update_time, remark from hw_tag_record
|
||||
</sql>
|
||||
|
||||
<select id="selectHwTagRecordList" parameterType="HwTagRecord" resultMap="HwTagRecordResult">
|
||||
<include refid="selectHwTagRecordVo"/>
|
||||
<where>
|
||||
<if test="tId != null and tId != ''"> and t_id = #{tId}</if>
|
||||
<if test="epc != null and epc != ''"> and epc = #{epc}</if>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
|
||||
<if test="batchNumber != null and batchNumber != ''"> and batch_number = #{batchNumber}</if>
|
||||
<if test="tagSequence != null and tagSequence != ''"> and tag_sequence = #{tagSequence}</if>
|
||||
<if test="totalQuantity != null "> and total_quantity = #{totalQuantity}</if>
|
||||
<if test="tagBatch != null and tagBatch != ''"> and tag_batch = #{tagBatch}</if>
|
||||
<if test="modelCode != null and modelCode != ''"> and model_code = #{modelCode}</if>
|
||||
<if test="params.beginProcessingTime != null and params.beginProcessingTime != '' and params.endProcessingTime != null and params.endProcessingTime != ''"> and processing_time between #{params.beginProcessingTime} and #{params.endProcessingTime}</if>
|
||||
<if test="operatorId != null and operatorId != ''"> and operator_id = #{operatorId}</if>
|
||||
<if test="fields1 != null and fields1 != ''"> and fields_1 = #{fields1}</if>
|
||||
<if test="fields2 != null and fields2 != ''"> and fields_2 = #{fields2}</if>
|
||||
<if test="fields3 != null and fields3 != ''"> and fields_3 = #{fields3}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHwTagRecordByRId" parameterType="Long" resultMap="HwTagRecordResult">
|
||||
<include refid="selectHwTagRecordVo"/>
|
||||
where r_id = #{rId}
|
||||
</select>
|
||||
|
||||
<insert id="insertHwTagRecord" parameterType="HwTagRecord">
|
||||
insert into hw_tag_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="rId != null">r_id,</if>
|
||||
<if test="tId != null and tId != ''">t_id,</if>
|
||||
<if test="epc != null and epc != ''">epc,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="orderCode != null">order_code,</if>
|
||||
<if test="batchNumber != null">batch_number,</if>
|
||||
<if test="tagSequence != null">tag_sequence,</if>
|
||||
<if test="totalQuantity != null">total_quantity,</if>
|
||||
<if test="tagBatch != null">tag_batch,</if>
|
||||
<if test="modelCode != null">model_code,</if>
|
||||
<if test="processingTime != null">processing_time,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="fields1 != null">fields_1,</if>
|
||||
<if test="fields2 != null">fields_2,</if>
|
||||
<if test="fields3 != null">fields_3,</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="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="rId != null">#{rId},</if>
|
||||
<if test="tId != null and tId != ''">#{tId},</if>
|
||||
<if test="epc != null and epc != ''">#{epc},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="orderCode != null">#{orderCode},</if>
|
||||
<if test="batchNumber != null">#{batchNumber},</if>
|
||||
<if test="tagSequence != null">#{tagSequence},</if>
|
||||
<if test="totalQuantity != null">#{totalQuantity},</if>
|
||||
<if test="tagBatch != null">#{tagBatch},</if>
|
||||
<if test="modelCode != null">#{modelCode},</if>
|
||||
<if test="processingTime != null">#{processingTime},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="fields1 != null">#{fields1},</if>
|
||||
<if test="fields2 != null">#{fields2},</if>
|
||||
<if test="fields3 != null">#{fields3},</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="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHwTagRecord" parameterType="HwTagRecord">
|
||||
update hw_tag_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tId != null and tId != ''">t_id = #{tId},</if>
|
||||
<if test="epc != null and epc != ''">epc = #{epc},</if>
|
||||
<if test="password != null">password = #{password},</if>
|
||||
<if test="orderCode != null">order_code = #{orderCode},</if>
|
||||
<if test="batchNumber != null">batch_number = #{batchNumber},</if>
|
||||
<if test="tagSequence != null">tag_sequence = #{tagSequence},</if>
|
||||
<if test="totalQuantity != null">total_quantity = #{totalQuantity},</if>
|
||||
<if test="tagBatch != null">tag_batch = #{tagBatch},</if>
|
||||
<if test="modelCode != null">model_code = #{modelCode},</if>
|
||||
<if test="processingTime != null">processing_time = #{processingTime},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="fields1 != null">fields_1 = #{fields1},</if>
|
||||
<if test="fields2 != null">fields_2 = #{fields2},</if>
|
||||
<if test="fields3 != null">fields_3 = #{fields3},</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="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where r_id = #{rId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHwTagRecordByRId" parameterType="Long">
|
||||
delete from hw_tag_record where r_id = #{rId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHwTagRecordByRIds" parameterType="String">
|
||||
delete from hw_tag_record where r_id in
|
||||
<foreach item="rId" collection="array" open="(" separator="," close=")">
|
||||
#{rId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询标签记录列表
|
||||
export function listTagRecord(query) {
|
||||
return request({
|
||||
url: '/service/tagRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询标签记录详细
|
||||
export function getTagRecord(rId) {
|
||||
return request({
|
||||
url: '/service/tagRecord/' + rId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增标签记录
|
||||
export function addTagRecord(data) {
|
||||
return request({
|
||||
url: '/service/tagRecord',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改标签记录
|
||||
export function updateTagRecord(data) {
|
||||
return request({
|
||||
url: '/service/tagRecord',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除标签记录
|
||||
export function delTagRecord(rId) {
|
||||
return request({
|
||||
url: '/service/tagRecord/' + rId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -0,0 +1,434 @@
|
||||
<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="TID" prop="tId">
|
||||
<el-input
|
||||
v-model="queryParams.tId"
|
||||
placeholder="请输入TID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="EPC" prop="epc">
|
||||
<el-input
|
||||
v-model="queryParams.epc"
|
||||
placeholder="请输入EPC"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号" prop="orderCode">
|
||||
<el-input
|
||||
v-model="queryParams.orderCode"
|
||||
placeholder="请输入订单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次编号" prop="batchNumber">
|
||||
<el-input
|
||||
v-model="queryParams.batchNumber"
|
||||
placeholder="请输入批次编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签序号" prop="tagSequence">
|
||||
<el-input
|
||||
v-model="queryParams.tagSequence"
|
||||
placeholder="请输入标签序号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="总数量" prop="totalQuantity">
|
||||
<el-input
|
||||
v-model="queryParams.totalQuantity"
|
||||
placeholder="请输入总数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签批次号" prop="tagBatch">
|
||||
<el-input
|
||||
v-model="queryParams.tagBatch"
|
||||
placeholder="请输入标签批次号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="型号" prop="modelCode">
|
||||
<el-input
|
||||
v-model="queryParams.modelCode"
|
||||
placeholder="请输入型号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="加工时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeProcessingTime"
|
||||
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 label="操作人员编号" prop="operatorId">
|
||||
<el-input
|
||||
v-model="queryParams.operatorId"
|
||||
placeholder="请输入操作人员编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</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="['service:tagRecord: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="['service:tagRecord: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="['service:tagRecord: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="['service:tagRecord:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="tagRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键标识,RID" align="center" prop="rId" />
|
||||
<el-table-column label="TID" align="center" prop="tId" />
|
||||
<el-table-column label="EPC" align="center" prop="epc" />
|
||||
<el-table-column label="密码" align="center" prop="password" />
|
||||
<el-table-column label="订单号" align="center" prop="orderCode" />
|
||||
<el-table-column label="批次编号" align="center" prop="batchNumber" />
|
||||
<el-table-column label="标签序号" align="center" prop="tagSequence" />
|
||||
<el-table-column label="总数量" align="center" prop="totalQuantity" />
|
||||
<el-table-column label="标签批次号" align="center" prop="tagBatch" />
|
||||
<el-table-column label="型号" align="center" prop="modelCode" />
|
||||
<el-table-column label="加工时间" align="center" prop="processingTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.processingTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人员编号" align="center" prop="operatorId" />
|
||||
<el-table-column label="预览字段1" align="center" prop="fields1" />
|
||||
<el-table-column label="预览字段2" align="center" prop="fields2" />
|
||||
<el-table-column label="预览字段3" align="center" prop="fields3" />
|
||||
<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="['service:tagRecord:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['service:tagRecord: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="TID" prop="tId">
|
||||
<el-input v-model="form.tId" placeholder="请输入TID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="EPC" prop="epc">
|
||||
<el-input v-model="form.epc" placeholder="请输入EPC" />
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input v-model="form.password" placeholder="请输入密码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号" prop="orderCode">
|
||||
<el-input v-model="form.orderCode" placeholder="请输入订单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批次编号" prop="batchNumber">
|
||||
<el-input v-model="form.batchNumber" placeholder="请输入批次编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标签序号" prop="tagSequence">
|
||||
<el-input v-model="form.tagSequence" placeholder="请输入标签序号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总数量" prop="totalQuantity">
|
||||
<el-input v-model="form.totalQuantity" placeholder="请输入总数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标签批次号" prop="tagBatch">
|
||||
<el-input v-model="form.tagBatch" placeholder="请输入标签批次号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="型号" prop="modelCode">
|
||||
<el-input v-model="form.modelCode" placeholder="请输入型号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="加工时间" prop="processingTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.processingTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择加工时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作人员编号" prop="operatorId">
|
||||
<el-input v-model="form.operatorId" placeholder="请输入操作人员编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据状态标记" prop="delFlag">
|
||||
<el-input v-model="form.delFlag" placeholder="请输入数据状态标记" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预览字段1" prop="fields1">
|
||||
<el-input v-model="form.fields1" placeholder="请输入预览字段1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预览字段2" prop="fields2">
|
||||
<el-input v-model="form.fields2" placeholder="请输入预览字段2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预览字段3" prop="fields3">
|
||||
<el-input v-model="form.fields3" placeholder="请输入预览字段3" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" 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 { listTagRecord, getTagRecord, delTagRecord, addTagRecord, updateTagRecord } from "@/api/service/tagRecord";
|
||||
|
||||
export default {
|
||||
name: "TagRecord",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 标签记录表格数据
|
||||
tagRecordList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 备注时间范围
|
||||
daterangeProcessingTime: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
tId: null,
|
||||
epc: null,
|
||||
password: null,
|
||||
orderCode: null,
|
||||
batchNumber: null,
|
||||
tagSequence: null,
|
||||
totalQuantity: null,
|
||||
tagBatch: null,
|
||||
modelCode: null,
|
||||
processingTime: null,
|
||||
operatorId: null,
|
||||
fields1: null,
|
||||
fields2: null,
|
||||
fields3: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
tId: [
|
||||
{ required: true, message: "TID不能为空", trigger: "blur" }
|
||||
],
|
||||
epc: [
|
||||
{ required: true, message: "EPC不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询标签记录列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.params = {};
|
||||
if (null != this.daterangeProcessingTime && '' != this.daterangeProcessingTime) {
|
||||
this.queryParams.params["beginProcessingTime"] = this.daterangeProcessingTime[0];
|
||||
this.queryParams.params["endProcessingTime"] = this.daterangeProcessingTime[1];
|
||||
}
|
||||
listTagRecord(this.queryParams).then(response => {
|
||||
this.tagRecordList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
rId: null,
|
||||
tId: null,
|
||||
epc: null,
|
||||
password: null,
|
||||
orderCode: null,
|
||||
batchNumber: null,
|
||||
tagSequence: null,
|
||||
totalQuantity: null,
|
||||
tagBatch: null,
|
||||
modelCode: null,
|
||||
processingTime: null,
|
||||
operatorId: null,
|
||||
delFlag: null,
|
||||
fields1: null,
|
||||
fields2: null,
|
||||
fields3: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.daterangeProcessingTime = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.rId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加标签记录";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const rId = row.rId || this.ids
|
||||
getTagRecord(rId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改标签记录";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.rId != null) {
|
||||
updateTagRecord(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addTagRecord(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const rIds = row.rId || this.ids;
|
||||
this.$modal.confirm('是否确认删除标签记录编号为"' + rIds + '"的数据项?').then(function() {
|
||||
return delTagRecord(rIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('service/tagRecord/export', {
|
||||
...this.queryParams
|
||||
}, `tagRecord_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue