Commit 9c4fb6dd authored by 耿迪迪's avatar 耿迪迪

产品详情

parent 3ae8e162
package com.zehong.web.controller.track;
import java.util.List;
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.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.track.TProductDeviceTest;
import com.zehong.system.service.track.ITProductDeviceTestService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 设备检测Controller
*
* @author zehong
* @date 2024-08-29
*/
@RestController
@RequestMapping("/track/test")
public class TProductDeviceTestController extends BaseController
{
@Autowired
private ITProductDeviceTestService tProductDeviceTestService;
/**
* 查询设备检测列表
*/
// @PreAuthorize("@ss.hasPermi('system:test:list')")
@GetMapping("/list")
public TableDataInfo list(TProductDeviceTest tProductDeviceTest)
{
startPage();
List<TProductDeviceTest> list = tProductDeviceTestService.selectTProductDeviceTestList(tProductDeviceTest);
return getDataTable(list);
}
/**
* 导出设备检测列表
*/
//@PreAuthorize("@ss.hasPermi('system:test:export')")
@Log(title = "设备检测", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TProductDeviceTest tProductDeviceTest)
{
List<TProductDeviceTest> list = tProductDeviceTestService.selectTProductDeviceTestList(tProductDeviceTest);
ExcelUtil<TProductDeviceTest> util = new ExcelUtil<TProductDeviceTest>(TProductDeviceTest.class);
return util.exportExcel(list, "设备检测数据");
}
/**
* 获取设备检测详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:test:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(tProductDeviceTestService.selectTProductDeviceTestById(id));
}
/**
* 新增设备检测
*/
//@PreAuthorize("@ss.hasPermi('system:test:add')")
@Log(title = "设备检测", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TProductDeviceTest tProductDeviceTest)
{
return toAjax(tProductDeviceTestService.insertTProductDeviceTest(tProductDeviceTest));
}
/**
* 修改设备检测
*/
//@PreAuthorize("@ss.hasPermi('system:test:edit')")
@Log(title = "设备检测", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TProductDeviceTest tProductDeviceTest)
{
return toAjax(tProductDeviceTestService.updateTProductDeviceTest(tProductDeviceTest));
}
/**
* 删除设备检测
*/
//@PreAuthorize("@ss.hasPermi('system:test:remove')")
@Log(title = "设备检测", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tProductDeviceTestService.deleteTProductDeviceTestByIds(ids));
}
}
......@@ -107,4 +107,15 @@ public class TProductDrawingController extends BaseController
{
return toAjax(tProductDrawingService.deleteTProductDrawingByIds(ids));
}
/**
* 根据产品主键获取图纸信息
* @param drawing
* @return
*/
@GetMapping("/getDrawInfoByDeviceId")
public TableDataInfo getDrawInfoByDeviceId(TProductDrawing drawing){
startPage();
return getDataTable(tProductDrawingService.getDrawInfoByDeviceId(drawing));
}
}
......@@ -129,4 +129,15 @@ public class TProductStoreController extends BaseController
public AjaxResult outHouse(@RequestBody List<HouseVo> storeInfo){
return toAjax(tProductStoreService.computeStock(storeInfo,true,"subtract"));
}
/**
* 根据产品主键获取配件信息
* @param store
* @return
*/
@GetMapping("/getStoreInfoByDeviceId")
public TableDataInfo getStoreInfoByDeviceId(TProductStore store){
startPage();
return getDataTable(tProductStoreService.getStoreInfoByDeviceId(store));
}
}
package com.zehong.system.domain.track;
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_product_device_test
*
* @author zehong
* @date 2024-08-29
*/
public class TProductDeviceTest extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 设备编号 */
@Excel(name = "设备编号")
private Long deviceId;
/** 检测项 */
@Excel(name = "检测项",dictType = "device_test_item")
private String title;
/** 检测状态 */
@Excel(name = "检测状态",dictType = "device_test_status")
private String status;
/** 创建人 */
private Long createId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setCreateId(Long createId)
{
this.createId = createId;
}
public Long getCreateId()
{
return createId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deviceId", getDeviceId())
.append("title", getTitle())
.append("status", getStatus())
.append("remark", getRemark())
.append("createTime", getCreateTime())
.append("createId", getCreateId())
.toString();
}
}
......@@ -56,6 +56,8 @@ public class TProductDrawing extends BaseEntity
/** 删除状态:0否,1是 */
private String isDel;
private Long deviceId;
public void setId(Long id)
{
this.id = id;
......@@ -155,6 +157,14 @@ public class TProductDrawing extends BaseEntity
this.isDel = isDel;
}
public Long getDeviceId() {
return deviceId;
}
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -51,6 +51,8 @@ public class TProductInspect extends BaseEntity
/** 创建人 */
private Long createId;
private String isDel;
public void setId(Long id)
{
this.id = id;
......@@ -133,6 +135,14 @@ public class TProductInspect extends BaseEntity
return createId;
}
public String getIsDel() {
return isDel;
}
public void setIsDel(String isDel) {
this.isDel = isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -59,6 +59,10 @@ public class TProductStore extends BaseEntity
private String isDel;
private Long deviceId;
private String useNum;
public void setId(Long id)
{
this.id = id;
......@@ -167,6 +171,22 @@ public class TProductStore extends BaseEntity
this.isDel = isDel;
}
public Long getDeviceId() {
return deviceId;
}
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
public String getUseNum() {
return useNum;
}
public void setUseNum(String useNum) {
this.useNum = useNum;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.zehong.system.mapper.track;
import java.util.List;
import com.zehong.system.domain.track.TProductDeviceTest;
/**
* 设备检测Mapper接口
*
* @author zehong
* @date 2024-08-29
*/
public interface TProductDeviceTestMapper
{
/**
* 查询设备检测
*
* @param id 设备检测ID
* @return 设备检测
*/
public TProductDeviceTest selectTProductDeviceTestById(Long id);
/**
* 查询设备检测列表
*
* @param tProductDeviceTest 设备检测
* @return 设备检测集合
*/
public List<TProductDeviceTest> selectTProductDeviceTestList(TProductDeviceTest tProductDeviceTest);
/**
* 新增设备检测
*
* @param tProductDeviceTest 设备检测
* @return 结果
*/
public int insertTProductDeviceTest(TProductDeviceTest tProductDeviceTest);
/**
* 修改设备检测
*
* @param tProductDeviceTest 设备检测
* @return 结果
*/
public int updateTProductDeviceTest(TProductDeviceTest tProductDeviceTest);
/**
* 删除设备检测
*
* @param id 设备检测ID
* @return 结果
*/
public int deleteTProductDeviceTestById(Long id);
/**
* 批量删除设备检测
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteTProductDeviceTestByIds(Long[] ids);
}
......@@ -58,4 +58,11 @@ public interface TProductDrawingMapper
* @return 结果
*/
public int deleteTProductDrawingByIds(Long[] ids);
/**
* 根据产品主键获取图纸信息
* @param drawing
* @return
*/
List<TProductDrawing> getDrawInfoByDeviceId(TProductDrawing drawing);
}
......@@ -58,4 +58,11 @@ public interface TProductStoreMapper
* @return 结果
*/
public int deleteTProductStoreByIds(Long[] ids);
/**
* 根据产品主键获取配件信息
* @param store
* @return
*/
List<TProductStore> getStoreInfoByDeviceId(TProductStore store);
}
package com.zehong.system.service.impl.track;
import java.util.List;
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.track.TProductDeviceTestMapper;
import com.zehong.system.domain.track.TProductDeviceTest;
import com.zehong.system.service.track.ITProductDeviceTestService;
/**
* 设备检测Service业务层处理
*
* @author zehong
* @date 2024-08-29
*/
@Service
public class TProductDeviceTestServiceImpl implements ITProductDeviceTestService
{
@Autowired
private TProductDeviceTestMapper tProductDeviceTestMapper;
/**
* 查询设备检测
*
* @param id 设备检测ID
* @return 设备检测
*/
@Override
public TProductDeviceTest selectTProductDeviceTestById(Long id)
{
return tProductDeviceTestMapper.selectTProductDeviceTestById(id);
}
/**
* 查询设备检测列表
*
* @param tProductDeviceTest 设备检测
* @return 设备检测
*/
@Override
public List<TProductDeviceTest> selectTProductDeviceTestList(TProductDeviceTest tProductDeviceTest)
{
return tProductDeviceTestMapper.selectTProductDeviceTestList(tProductDeviceTest);
}
/**
* 新增设备检测
*
* @param tProductDeviceTest 设备检测
* @return 结果
*/
@Override
public int insertTProductDeviceTest(TProductDeviceTest tProductDeviceTest)
{
tProductDeviceTest.setCreateTime(DateUtils.getNowDate());
tProductDeviceTest.setCreateId(SecurityUtils.getLoginUser().getUser().getUserId());
return tProductDeviceTestMapper.insertTProductDeviceTest(tProductDeviceTest);
}
/**
* 修改设备检测
*
* @param tProductDeviceTest 设备检测
* @return 结果
*/
@Override
public int updateTProductDeviceTest(TProductDeviceTest tProductDeviceTest)
{
return tProductDeviceTestMapper.updateTProductDeviceTest(tProductDeviceTest);
}
/**
* 批量删除设备检测
*
* @param ids 需要删除的设备检测ID
* @return 结果
*/
@Override
public int deleteTProductDeviceTestByIds(Long[] ids)
{
return tProductDeviceTestMapper.deleteTProductDeviceTestByIds(ids);
}
/**
* 删除设备检测信息
*
* @param id 设备检测ID
* @return 结果
*/
@Override
public int deleteTProductDeviceTestById(Long id)
{
return tProductDeviceTestMapper.deleteTProductDeviceTestById(id);
}
}
......@@ -94,4 +94,15 @@ public class TProductDrawingServiceImpl implements ITProductDrawingService
{
return tProductDrawingMapper.deleteTProductDrawingById(id);
}
/**
* 根据产品主键获取图纸信息
* @param drawing
* @return
*/
@Override
public List<TProductDrawing> getDrawInfoByDeviceId(TProductDrawing drawing){
return tProductDrawingMapper.getDrawInfoByDeviceId(drawing);
}
}
......@@ -166,4 +166,14 @@ public class TProductStoreServiceImpl implements ITProductStoreService
tProductStoreMapper.updateTProductStore(store);
}
}
/**
* 根据产品主键获取配件信息
* @param store
* @return
*/
@Override
public List<TProductStore> getStoreInfoByDeviceId(TProductStore store){
return tProductStoreMapper.getStoreInfoByDeviceId(store);
}
}
package com.zehong.system.service.track;
import java.util.List;
import com.zehong.system.domain.track.TProductDeviceTest;
/**
* 设备检测Service接口
*
* @author zehong
* @date 2024-08-29
*/
public interface ITProductDeviceTestService
{
/**
* 查询设备检测
*
* @param id 设备检测ID
* @return 设备检测
*/
public TProductDeviceTest selectTProductDeviceTestById(Long id);
/**
* 查询设备检测列表
*
* @param tProductDeviceTest 设备检测
* @return 设备检测集合
*/
public List<TProductDeviceTest> selectTProductDeviceTestList(TProductDeviceTest tProductDeviceTest);
/**
* 新增设备检测
*
* @param tProductDeviceTest 设备检测
* @return 结果
*/
public int insertTProductDeviceTest(TProductDeviceTest tProductDeviceTest);
/**
* 修改设备检测
*
* @param tProductDeviceTest 设备检测
* @return 结果
*/
public int updateTProductDeviceTest(TProductDeviceTest tProductDeviceTest);
/**
* 批量删除设备检测
*
* @param ids 需要删除的设备检测ID
* @return 结果
*/
public int deleteTProductDeviceTestByIds(Long[] ids);
/**
* 删除设备检测信息
*
* @param id 设备检测ID
* @return 结果
*/
public int deleteTProductDeviceTestById(Long id);
}
......@@ -58,4 +58,11 @@ public interface ITProductDrawingService
* @return 结果
*/
public int deleteTProductDrawingById(Long id);
/**
* 根据产品主键获取图纸信息
* @param drawing
* @return
*/
List<TProductDrawing> getDrawInfoByDeviceId(TProductDrawing drawing);
}
......@@ -71,4 +71,11 @@ public interface ITProductStoreService
*/
int computeStock(List<HouseVo> storeInfo,boolean isAddLog,String type);
/**
* 根据产品主键获取配件信息
* @param store
* @return
*/
List<TProductStore> getStoreInfoByDeviceId(TProductStore store);
}
<?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.track.TProductDeviceTestMapper">
<resultMap type="TProductDeviceTest" id="TProductDeviceTestResult">
<result property="id" column="id" />
<result property="deviceId" column="device_id" />
<result property="title" column="title" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createId" column="create_id" />
</resultMap>
<sql id="selectTProductDeviceTestVo">
select id, device_id, title, status, remark, create_time, create_id, <include refid="Common.createBy"/> from t_product_device_test
</sql>
<select id="selectTProductDeviceTestList" parameterType="TProductDeviceTest" resultMap="TProductDeviceTestResult">
<include refid="selectTProductDeviceTestVo"/>
<where>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="title != null and title != ''"> and title = #{title}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
order by create_time desc
</select>
<select id="selectTProductDeviceTestById" parameterType="Long" resultMap="TProductDeviceTestResult">
<include refid="selectTProductDeviceTestVo"/>
where id = #{id}
</select>
<insert id="insertTProductDeviceTest" parameterType="TProductDeviceTest" useGeneratedKeys="true" keyProperty="id">
insert into t_product_device_test
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceId != null">device_id,</if>
<if test="title != null and title != ''">title,</if>
<if test="status != null and status != ''">status,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="createId != null">create_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceId != null">#{deviceId},</if>
<if test="title != null and title != ''">#{title},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createId != null">#{createId},</if>
</trim>
</insert>
<update id="updateTProductDeviceTest" parameterType="TProductDeviceTest">
update t_product_device_test
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="title != null and title != ''">title = #{title},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTProductDeviceTestById" parameterType="Long">
delete from t_product_device_test where id = #{id}
</delete>
<delete id="deleteTProductDeviceTestByIds" parameterType="String">
delete from t_product_device_test where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -103,4 +103,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getDrawInfoByDeviceId" parameterType="TProductDrawing" resultMap="TProductDrawingResult">
SELECT
draw.*,
(select nick_name from sys_user us where us.user_id = draw.create_id) as createBy
FROM
t_product_inspect_detail detail
LEFT JOIN t_product_device dev ON dev.inspect_id = detail.inspect_id
LEFT JOIN t_product_drawing draw ON draw.id = detail.type_id
<where>
dev.id = #{deviceId} AND detail.type = '1'
<if test="title != null and title != ''"> and draw.title like concat('%', #{title}, '%')</if>
<if test="drawingNo != null and drawingNo != ''"> and draw.drawing_no like concat('%', #{drawingNo}, '%')</if>
<if test="cateId != null and cateId != ''"> and cate_id = #{cateId}</if>
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -100,4 +100,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getStoreInfoByDeviceId" parameterType="TProductStore" resultMap="TProductStoreResult">
SELECT
store.*,
sum(detail.number) AS useNum,
(select nick_name from sys_user us where us.user_id = store.create_id) as createBy
FROM
t_product_inspect_detail detail
LEFT JOIN t_product_device dev ON dev.inspect_id = detail.inspect_id
LEFT JOIN t_product_store store ON store.id = detail.type_id
<where>
dev.id = '1' AND detail.type = '2'
<if test="title != null and title != ''"> and store.title like concat('%', #{title}, '%')</if>
<if test="planNo != null and planNo != ''"> and store.plan_no like concat('%', #{planNo}, '%')</if>
and is_del = '0'
</where>
GROUP BY detail.type_id
</select>
</mapper>
\ No newline at end of file
......@@ -60,3 +60,12 @@ export function drawInfoList(query) {
params: query
})
}
//根据产品主键获取图纸信息
export function getDrawInfoByDeviceId(query) {
return request({
url: '/track/drawing/getDrawInfoByDeviceId',
method: 'get',
params: query
})
}
......@@ -69,3 +69,12 @@ export function inHouse(data) {
data: data
})
}
//根据产品主键获取配件信息
export function getStoreInfoByDeviceId(query) {
return request({
url: '/track/store/getStoreInfoByDeviceId',
method: 'get',
params: query
})
}
import request from '@/utils/request'
// 查询设备检测列表
export function listTest(query) {
return request({
url: '/track/test/list',
method: 'get',
params: query
})
}
// 查询设备检测详细
export function getTest(id) {
return request({
url: '/track/test/' + id,
method: 'get'
})
}
// 新增设备检测
export function addTest(data) {
return request({
url: '/track/test',
method: 'post',
data: data
})
}
// 修改设备检测
export function updateTest(data) {
return request({
url: '/track/test',
method: 'put',
data: data
})
}
// 删除设备检测
export function delTest(id) {
return request({
url: '/track/test/' + id,
method: 'delete'
})
}
// 导出设备检测
export function exportTest(query) {
return request({
url: '/track/test/export',
method: 'get',
params: query
})
}
<template>
<el-dialog title="详情" :visible.sync="detailOpen" width="800px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="90px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="批次号">
<span v-if="detailInfo.batchNo">{{ detailInfo.batchNo }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编号">
<span v-if="detailInfo.deviceNo">{{ detailInfo.deviceNo }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称">
<span v-if="detailInfo.title">{{ detailInfo.title }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备状态">
<span v-if="detailInfo.title">{{ $parent.statusFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间">
<span v-if="detailInfo.createTime">{{ detailInfo.createTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建人">
<span v-if="detailInfo.createBy">{{ detailInfo.createBy }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="设备备注">
<span v-if="detailInfo.remark">{{ detailInfo.remark }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-dialog title="详情" :visible.sync="detailOpen" width="1000px" append-to-body :close-on-click-modal="false">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="设备详情" name="deviceInfo">
<DeviceInfo v-if="'deviceInfo' == activeName" :deviceId="deviceId"/>
</el-tab-pane>
<el-tab-pane label="图纸信息" name="draw">
<DrawInfo v-if="'draw' == activeName" :deviceId="deviceId"/>
</el-tab-pane>
<el-tab-pane label="配件信息" name="store">
<StoreInfo v-if="'store' == activeName" :deviceId="deviceId"/>
</el-tab-pane>
<el-tab-pane label="模版信息" name="mark">
<MarkInfo v-if="'mark' == activeName" :inspectId="inspectId"/>
</el-tab-pane>
</el-tabs>
</el-dialog>
</template>
<script>
import { getDevice } from "@/api/track/device";
import DeviceInfo from "./DeviceInfo";
import DrawInfo from "./DrawInfo";
import StoreInfo from "./StoreInfo";
import MarkInfo from "./MarkInfo";
export default {
name: "detail-info",
components:{
DeviceInfo,
DrawInfo,
StoreInfo,
MarkInfo
},
data(){
return{
detailOpen: false,
detailInfo: {}
activeName: 'deviceInfo',
deviceId: null,
inspectId: null
}
},
methods:{
getDetailInfo(id){
getDevice(id).then(res =>{
if(res.code == 200){
this.detailInfo = res.data;
this.detailOpen = true;
}
})
handleClick(tab, event) {
console.log(tab, event);
},
getDetailInfo(row){
this.deviceId = row.id;
this.inspectId = row.inspectId;
this.activeName = "deviceInfo";
this.detailOpen = true;
}
}
}
......
<template>
<el-form label-width="90px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="批次号">
<span v-if="detailInfo.batchNo">{{ detailInfo.batchNo }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编号">
<span v-if="detailInfo.deviceNo">{{ detailInfo.deviceNo }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称">
<span v-if="detailInfo.title">{{ detailInfo.title }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备状态">
<span v-if="detailInfo.title">{{ statusFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间">
<span v-if="detailInfo.createTime">{{ detailInfo.createTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建人">
<span v-if="detailInfo.createBy">{{ detailInfo.createBy }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="设备备注">
<span v-if="detailInfo.remark">{{ detailInfo.remark }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { getDevice } from "@/api/track/device";
export default {
name: "device-info",
props:{
deviceId:{
type: Number
}
},
data(){
return{
detailOpen: false,
detailInfo: {},
statusOptions: []
}
},
created(){
this.getDeviceInfo();
this.getDicts("t_produce_device_status").then(response => {
this.statusOptions = response.data;
});
},
methods:{
// 设备状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
getDeviceInfo(){
getDevice(this.deviceId).then(res =>{
if(res.code == 200){
this.detailInfo = res.data;
}
})
}
}
}
</script>
<style scoped>
</style>
<template>
<div style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="图纸名称" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入图纸名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="图纸编号" prop="drawingNo">
<el-input
v-model="queryParams.drawingNo"
placeholder="请输入图纸编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="图纸分类" prop="cateId">
<el-select v-model="queryParams.cateId" placeholder="请选择图纸分类" clearable size="small">
<el-option
v-for="dict in cateIdOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</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-table v-loading="loading" :data="drawingList">
<el-table-column label="图纸名称" align="center" prop="title" show-overflow-tooltip/>
<el-table-column label="图纸编号" align="center" prop="drawingNo" show-overflow-tooltip/>
<el-table-column label="图纸型号" align="center" prop="model">
<template slot-scope="scope">
<span v-if="scope.row.source">{{ scope.row.source }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="图纸分类" align="center" prop="cateId" :formatter="cateIdFormat" />
<el-table-column label="图纸来源" align="center" prop="source">
<template slot-scope="scope">
<span v-if="scope.row.source">{{ scope.row.source }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="图纸附件" align="center" prop="fileUrl">
<template slot-scope="scope">
<span v-if="scope.row.fileUrl">
<a style="color: #1c84c6" :href="JSON.parse(scope.row.fileUrl).url" target="_blank">查看/下载</a>
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" show-overflow-tooltip/>
<el-table-column label="创建人" align="center" prop="createBy" />
<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-document"
@click="handleDetail(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"
/>
<!-- 详情 -->
<DetailInfo ref="detail"/>
</div>
</template>
<script>
import { getDrawInfoByDeviceId } from "@/api/track/drawing";
import DetailInfo from "../../draw/components/DetailInfo";
export default {
name: "draw-info",
props:{
deviceId:{
type: Number
}
},
components:{
DetailInfo
},
data(){
return{
// 总条数
total: 0,
loading: false,
queryParams: {
pageNum: 1,
pageSize: 10,
title: null,
drawingNo: null,
cateId: null,
},
drawingList:[],
cateIdOptions: []
}
},
created(){
this.getDicts("t_draw_type").then(response => {
this.cateIdOptions = response.data;
});
this.queryParams.deviceId = this.deviceId;
this.getList();
},
methods:{
getList() {
this.loading = true;
getDrawInfoByDeviceId(this.queryParams).then(response => {
this.drawingList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 图纸分类字典翻译
cateIdFormat(row, column) {
return this.selectDictLabel(this.cateIdOptions, row.cateId);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//详情
handleDetail(row){
this.$refs.detail.getDetailInfo(row.id);
}
}
}
</script>
<style scoped>
</style>
<template>
<div style="margin-bottom: 20px">
<div class="title">模版信息</div>
<el-form label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="模板名称">
<span v-if="markInfo.title">{{ markInfo.title }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="模板描述">
<span v-if="markInfo.content">{{ markInfo.content }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间">
<span v-if="markInfo.createTime">{{ markInfo.createTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建人">
<span v-if="markInfo.createBy">{{ markInfo.createBy }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="title">模版详情</div>
<el-form :model="queryParams" ref="queryForm" :inline="true"label-width="68px">
<el-form-item label="装配标题" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入装配标题"
clearable
size="small"
@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-table v-loading="loading" :data="detailList">
<el-table-column label="装配标题" align="center" prop="title" />
<el-table-column label="装配序号" align="center" prop="orders" />
<el-table-column label="装配描述" align="center" prop="content" show-overflow-tooltip/>
<el-table-column label="装配图片" align="center" prop="imgUrl">
<template slot-scope="scope">
<el-image
v-if="scope.row.imgUrl"
:src="scope.row.imgUrl"
:preview-src-list="[scope.row.imgUrl]"
:z-index="9999"
style="width: 30px;height: 30px;"
></el-image>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" show-overflow-tooltip/>
<el-table-column label="创建人" align="center" prop="createBy" />
<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-document"
@click="handleDetail(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="getMarkDetail"
/>
<!-- 详情 -->
<DetailInfo ref="detail"/>
</div>
</template>
<script>
import { listDetail } from "@/api/track/executeDetail";
import { getMark } from "@/api/track/mark";
import { listDetail as markDetailList } from "@/api/track/detail";
import DetailInfo from "../../mark/detail/components/DetailInfo";
export default {
name: "mark-info",
props:{
inspectId: {
type: Number
}
},
components:{
DetailInfo
},
created(){
this.getExecuteDetail();
},
data(){
return{
total: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
markId: null,
orders: null,
title: null,
},
markInfo: {},
loading: false,
detailList: []
}
},
methods:{
getExecuteDetail(){
listDetail({inspectId:this.inspectId,type:3}).then(res =>{
this.getMarkInfo(res.rows[0].typeId);
this.queryParams.markId = res.rows[0].typeId;
this.getMarkDetail();
})
},
//模版信息
getMarkInfo(typeId){
getMark(typeId).then(res =>{
this.markInfo = res.data;
})
},
//模版步骤
getMarkDetail(){
this.loading = true;
markDetailList(this.queryParams).then(res =>{
this.detailList = res.rows;
this.total = res.total;
this.loading = false;
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getMarkDetail();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//详情
handleDetail(row){
this.$refs.detail.getDetailInfo(row.id);
},
}
}
</script>
<style scoped lang="scss">
.title{
margin-bottom: 15px;
font-size: 18px;
font-weight: bold;
}
</style>
<template>
<div style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="配件名称" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入配件名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="配件编号" prop="planNo">
<el-input
v-model="queryParams.planNo"
placeholder="请输入配件编号"
clearable
size="small"
@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-table v-loading="loading" :data="storeList">
<el-table-column label="配件名称" align="center" prop="title" />
<el-table-column label="配件编号" align="center" prop="planNo" />
<el-table-column label="规格参数" align="center" prop="specs" />
<el-table-column label="库存数量" align="center" prop="total" />
<el-table-column label="产品用量" align="center" prop="useNum" />
<el-table-column label="供货商" align="center" prop="supplier">
<template slot-scope="scope">
<span v-if="scope.row.supplier">{{ scope.row.supplier }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="联系人" align="center" prop="username">
<template slot-scope="scope">
<span v-if="scope.row.username">{{ scope.row.username }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="联系电话" align="center" prop="tel" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.tel">{{ scope.row.tel }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" show-overflow-tooltip/>
<el-table-column label="创建人" align="center" prop="createBy" show-overflow-tooltip/>
<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-document"
@click="handleDetail(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"
/>
<!-- 详情 -->
<DetailInfo ref="detail"/>
</div>
</template>
<script>
import { getStoreInfoByDeviceId } from "@/api/track/store";
import DetailInfo from "../../store/components/DetailInfo";
export default {
name: "store-info",
props:{
deviceId:{
type: Number
}
},
components:{
DetailInfo
},
data(){
return{
// 总条数
total: 0,
// 遮罩层
loading: true,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
title: null,
planNo: null,
},
storeList: []
}
},
created(){
this.queryParams.deviceId = this.deviceId;
this.getList();
},
methods:{
/** 查询配件列表 */
getList() {
this.loading = true;
getStoreInfoByDeviceId(this.queryParams).then(response => {
this.storeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//详情
handleDetail(row){
this.$refs.detail.getDetailInfo(row.id);
},
}
}
</script>
<style scoped>
</style>
......@@ -124,6 +124,11 @@
type="text"
@click="handleAssemble(scope.row)"
>装配</el-button>
<el-button
size="mini"
type="text"
@click="handleTest(scope.row)"
>检测</el-button>
</template>
</el-table-column>
</el-table>
......@@ -142,7 +147,13 @@
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="批次号" prop="inspectId">
<el-select style="width:100%" v-model="form.inspectId" placeholder="请选择批次号" clearable size="small">
<el-select
style="width:100%"
v-model="form.inspectId"
placeholder="请选择批次号"
clearable size="small"
@change="batchNoChange"
>
<el-option
v-for="execute in executeData"
:key="execute.id"
......@@ -196,7 +207,7 @@
<DetailInfo ref="detail"/>
<!-- 操作 -->
<el-dialog title="装配详情" :visible.sync="operateOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-dialog :title="operateTitle" :visible.sync="operateOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
<components
:param="operateParam"
v-if="operateOpen"
......@@ -212,11 +223,13 @@ import { listDevice, getDevice, delDevice, addDevice, updateDevice, exportDevice
import { executeInfoList } from "@/api/track/execute";
import DetailInfo from "./components/DetailInfo";
import Assemble from "./components/Assemble";
import DeviceTest from "./components/DeviceTest";
export default {
name: "Device",
components: {
DetailInfo,
Assemble
Assemble,
DeviceTest
},
data() {
return {
......@@ -269,7 +282,8 @@ export default {
executeData: [],
operateComponent: null,
operateOpen: false,
operateParam: {}
operateParam: {},
operateTitle: ""
};
},
created() {
......@@ -407,14 +421,26 @@ export default {
},
//详情
handleDetail(row){
this.$refs.detail.getDetailInfo(row.id);
this.$refs.detail.getDetailInfo(row);
},
//装配
handleAssemble(row){
this.operateTitle = "装配详情";
this.operateParam = {deviceId: row.id};
this.operateComponent = Assemble;
this.operateOpen = true;
},
handleTest(row){
this.operateTitle = "测试详情";
this.operateParam = {deviceId: row.id};
this.operateComponent = DeviceTest;
this.operateOpen = true;
},
batchNoChange(){
let info = this.executeData.find(item => item.id == this.form.inspectId);
if(info){
this.form.planId = info.planId
}
}
}
};
......
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