Commit 3ae8e162 authored by 耿迪迪's avatar 耿迪迪

产品装配

parent 386cc251
......@@ -100,4 +100,15 @@ public class TProductDeviceMarkController extends BaseController
{
return toAjax(tProductDeviceMarkService.deleteTProductDeviceMarkByIds(ids));
}
/**
* 根据产品获取设备详情
* @param deviceId 产品主键
* @return
*/
@GetMapping("/selectDeviceMarkInfoByDeviceId")
public TableDataInfo selectDeviceMarkInfoByDeviceId(TProductDeviceMark mark){
startPage();
return getDataTable(tProductDeviceMarkService.selectDeviceMarkInfoByDeviceId(mark));
}
}
......@@ -42,6 +42,14 @@ public class TProductDeviceMark extends BaseEntity
@Excel(name = "装配视频")
private Long createId;
private Long markDetailId;
private Long preMarkId;
private Long orders;
private String title;
public void setId(Long id)
{
this.id = id;
......@@ -106,6 +114,38 @@ public class TProductDeviceMark extends BaseEntity
return createId;
}
public Long getMarkDetailId() {
return markDetailId;
}
public void setMarkDetailId(Long markDetailId) {
this.markDetailId = markDetailId;
}
public Long getPreMarkId() {
return preMarkId;
}
public void setPreMarkId(Long preMarkId) {
this.preMarkId = preMarkId;
}
public Long getOrders() {
return orders;
}
public void setOrders(Long orders) {
this.orders = orders;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -58,4 +58,11 @@ public interface TProductDeviceMarkMapper
* @return 结果
*/
public int deleteTProductDeviceMarkByIds(Long[] ids);
/**
* 根据产品获取设备详情
* @param mark
* @return
*/
List<TProductDeviceMark> selectDeviceMarkInfoByDeviceId(TProductDeviceMark mark);
}
......@@ -94,4 +94,13 @@ public class TProductDeviceMarkServiceImpl implements ITProductDeviceMarkService
{
return tProductDeviceMarkMapper.deleteTProductDeviceMarkById(id);
}
/**
* 根据产品获取设备详情
* @param mark
* @return
*/
public List<TProductDeviceMark> selectDeviceMarkInfoByDeviceId(TProductDeviceMark mark){
return tProductDeviceMarkMapper.selectDeviceMarkInfoByDeviceId(mark);
}
}
......@@ -147,6 +147,7 @@ public class TProductInspectDetailServiceImpl implements ITProductInspectDetailS
tProductInspectDetail.setTypeId(detail.getTypeId());
tProductInspectDetail.setType(detail.getType());
List<TProductInspectDetail> detailInfo = tProductInspectDetailMapper.selectTProductInspectDetailList(tProductInspectDetail);
if(3 == detail.getType() && detailInfo.size() > 0) throw new CustomException("装配模版已存在不能添加多个");
if(!CollectionUtils.isEmpty(detailInfo)){
throw new CustomException((1 == detailInfo.get(0).getType() ? "图纸" : "装配模版") + detailInfo.get(0).getTypeName() + "已存在");
}
......
......@@ -58,4 +58,11 @@ public interface ITProductDeviceMarkService
* @return 结果
*/
public int deleteTProductDeviceMarkById(Long id);
/**
* 根据产品获取设备详情
* @param mark
* @return
*/
List<TProductDeviceMark> selectDeviceMarkInfoByDeviceId(TProductDeviceMark mark);
}
......@@ -86,4 +86,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="selectDeviceMarkInfoByDeviceId" parameterType="Long" resultMap="TProductDeviceMarkResult">
SELECT
md.id AS markDetailId,
md.mark_id AS preMarkId,
md.orders,
md.title,
deviceMark.*,
(select nick_name from sys_user us where us.user_id = deviceMark.create_id) as createBy
FROM
t_product_mark_detail md
INNER JOIN t_product_inspect_detail detail ON detail.type_id = md.mark_id AND detail.type = 3
INNER JOIN t_product_device dev ON dev.inspect_id = detail.inspect_id
LEFT JOIN t_product_device_mark deviceMark ON deviceMark.device_id = dev.id
<where>
dev.id = #{deviceId}
<if test="title != null and title != ''"> and md.title like concat('%', #{title}, '%')</if>
</where>
ORDER BY md.orders ASC
</select>
</mapper>
\ No newline at end of file
......@@ -51,3 +51,12 @@ export function exportMark(query) {
params: query
})
}
//根据产品获取装配信息
export function selectDeviceMarkInfoByDeviceId(query) {
return request({
url: '/track/deviceMark/selectDeviceMarkInfoByDeviceId',
method: 'get',
params: query
})
}
<template>
<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="executeDetailList">
<el-table-column label="模版序号" align="center" prop="orders" />
<el-table-column label="模版标题" align="center" prop="title" 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="videoUrl">
<template slot-scope="scope">
<el-popover
v-if="scope.row.videoUrl"
placement="top"
width="400"
trigger="click">
<video style="width: 100%;height: auto;object-fit: contain; " controls :src="scope.row.videoUrl"/>
<el-button type="text" slot="reference">装配视频</el-button>
</el-popover>
<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"
@click="handleMarkDetail(scope.row)"
>模版详情</el-button>
<el-button
size="mini"
type="text"
@click="handleUpload(scope.row,'img')"
>上传图片</el-button>
<el-button
size="mini"
type="text"
@click="handleUpload(scope.row,'video')"
>上传视频</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getExecuteDetailInfo"
/>
<!-- 模版详情 -->
<DetailInfo ref="detail"/>
<!-- 上传图片 -->
<Upload ref="upload"/>
</div>
</template>
<script>
import { selectDeviceMarkInfoByDeviceId } from "@/api/track/deviceMark";
import DetailInfo from "../../mark/detail/components/DetailInfo";
import Upload from "./Upload";
export default {
name: "assemble",
props:{
param:{
type:Object
}
},
components:{
DetailInfo,
Upload
},
data(){
return{
executeDetailList: [],
total: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
title: null
},
loading: false
}
},
created(){
this.queryParams.deviceId = this.param.deviceId;
this.getExecuteDetailInfo();
},
methods:{
getExecuteDetailInfo(){
this.loading = true;
selectDeviceMarkInfoByDeviceId(this.queryParams).then(res =>{
this.loading = false;
if(res.code == 200){
this.total = res.total;
this.executeDetailList = res.rows;
}
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getExecuteDetailInfo();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
handleMarkDetail(row){
this.$refs.detail.getDetailInfo(row.markDetailId);
},
handleUpload(row,type){
row.deviceId = this.param.deviceId;
this.$refs.upload.initUploadInfo(row,type);
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<el-dialog :title="title" :visible.sync="uploadOpen" width="800px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form ref="form" :model="form" label-width="80px">
<el-row class="el-row-table">
<el-col :span="24" v-if="uploadType == 'video'">
<el-form-item
label="装配视频"
:rules="[{ required: true, message: '装配视频不能为空', trigger: 'blur' }]"
prop="videoUrl"
>
<FileUpload
listType="picture"
@resFun="getFileInfoVideo"
@remove="listRemoveVideo"
:fileArr="fileListVideo"
:fileSize="50"
:fileType="['mp4']"
/>
<el-input v-show="false" disabled v-model="form.videoUrl"></el-input>
</el-form-item>
</el-col>
<el-col :span="24" v-if="uploadType == 'img'">
<el-form-item
:rules="[{ required: true, message: '装配图片不能为空', trigger: 'blur' }]"
label="装配图片"
prop="imgUrl"
>
<imageUpload v-model="form.imgUrl"/>
</el-form-item>
</el-col>
</el-row>
</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 ImageUpload from '@/components/ImageUpload';
import FileUpload from "@/components/FileUpload";
import uploadfile from "@/assets/uploadfile.png";
import { addMark, updateMark } from "@/api/track/deviceMark";
export default {
name: "upload",
components:{
ImageUpload,
FileUpload
},
data(){
return{
uploadOpen: false,
title: "上传图片",
form: {},
fileListVideo: [],
uploadType: "img"
}
},
methods:{
initUploadInfo(row,uploadType){
this.uploadType = uploadType;
this.form = {...row};
this.title = this.uploadType == "img" ? "上传图片" : "上传视频";
this.fileListVideo = [];
this.uploadOpen = true;
},
submitForm(){
this.$refs["form"].validate(valid => {
if (valid) {
if(this.form.id){
updateMark(this.form).then(res => {
this.msgSuccess("上传成功");
this.uploadOpen = false;
this.$parent.getExecuteDetailInfo();
})
}else{
this.form.markId = this.form.preMarkId;
this.form.detailId = this.form.markDetailId;
addMark(this.form).then(res =>{
this.msgSuccess("上传成功");
this.uploadOpen = false;
this.$parent.getExecuteDetailInfo();
})
}
}
})
},
cancel(){
this.uploadOpen = false;
this.form = {};
},
getFileInfoVideo(res) {
this.form.videoUrl = res.url;
this.fileListVideo = [
{
name: res.fileName,
url: uploadfile,
},
];
},
listRemoveVideo(e) {
this.fileListVideo = [];
this.form.videoUrl = "";
},
}
}
</script>
<style scoped>
</style>
......@@ -119,6 +119,11 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button
size="mini"
type="text"
@click="handleAssemble(scope.row)"
>装配</el-button>
</template>
</el-table-column>
</el-table>
......@@ -190,6 +195,15 @@
<!-- 详情 -->
<DetailInfo ref="detail"/>
<!-- 操作 -->
<el-dialog title="装配详情" :visible.sync="operateOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
<components
:param="operateParam"
v-if="operateOpen"
:is="operateComponent"
/>
</el-dialog>
</div>
</template>
......@@ -197,10 +211,12 @@
import { listDevice, getDevice, delDevice, addDevice, updateDevice, exportDevice } from "@/api/track/device";
import { executeInfoList } from "@/api/track/execute";
import DetailInfo from "./components/DetailInfo";
import Assemble from "./components/Assemble";
export default {
name: "Device",
components: {
DetailInfo
DetailInfo,
Assemble
},
data() {
return {
......@@ -250,7 +266,10 @@ export default {
{ required: true, message: "设备名称不能为空", trigger: "blur" }
],
},
executeData: []
executeData: [],
operateComponent: null,
operateOpen: false,
operateParam: {}
};
},
created() {
......@@ -389,6 +408,13 @@ export default {
//详情
handleDetail(row){
this.$refs.detail.getDetailInfo(row.id);
},
//装配
handleAssemble(row){
this.operateParam = {deviceId: row.id};
this.operateComponent = Assemble;
this.operateOpen = true;
}
}
};
......
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