Merge branch 'dev-scheduling' of http://42.192.7.176:3000/suojin/jonhon-mes-web into dev-scheduling

dev-scheduling
zhangdi 1 week ago
commit b6e3fc154e
  1. 4
      src/api/qualityManagement/inspectionArchiving/rbFilePreserve.js
  2. 227
      src/views/qualityManagement/inspectionArchiving/rbFilePreserve/checkLine.vue
  3. 61
      src/views/qualityManagement/inspectionArchiving/rbFilePreserve/index.vue

@ -110,11 +110,11 @@ export const updateStatus = (data) =>{
}
// 发布接口
export const release = (data) =>{
export const release = (params) =>{
return request({
url:'/api/blade-desk/QA/ProReTemplate/publish',
method:'post',
data
params
})
}

@ -0,0 +1,227 @@
<template>
<div class="approval-timeline">
<!-- 循环渲染每一个节点 -->
<div
v-for="(item, index) in timelineData"
:key="index"
class="timeline-item"
>
<!-- 左侧图标与线条区域 -->
<div class="timeline-node">
<!-- 垂直连接线 (CSS 处理上下连接) -->
<div class="line" v-if="timelineData.length > 1">
</div>
<!-- 状态圆点 -->
<div
class="dot"
:class="{
'is-blue': item.type === 'submit',
'is-green': item.type !== 'submit' && item.status === 'success',
'is-red': item.status === 'false' || item.remark,
'is-empty': item.status === 'pending'
}"
>
<!-- 如果是实心点这里可以放Icon如果是空心保持空白即可 -->
</div>
</div>
<!-- 右侧内容区域 -->
<div class="timeline-content">
<div class="content-header">
<span class="label">{{ item.label }}</span>
<span class="value">{{ item.value }}</span>
</div>
<div class="content-body">
<div class="time">审核时间{{ item.time }}</div>
<!-- 只有审核意见存在时才显示 -->
<div v-if="item.remark" class="comment">
审核意见{{ item.remark }}
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'ApprovalTimeline',
props:{
data:{
type: Array,
default: []
}
},
data() {
return {
//
timelineData: [
// {
// type: 'audit',
// label: '',
// value: '',
// time: '2015-09-01 11:13:21',
// status: 'pending' // 绿
// },
// {
// type: 'audit',
// label: '',
// value: '',
// time: '2015-09-01 11:13:21',
// status: 'pending' // 绿
// },
// {
// type: 'audit',
// label: '',
// value: '',
// time: '2015-09-01 11:13:21',
// status: 'pending' // 绿
// },
// {
// type: 'audit',
// label: '',
// value: '',
// time: '2015-09-01 11:10:21',
// status: 'success' // 绿
// },
// {
// type: 'submit',
// label: '',
// value: '',
// time: '2015-09-01 10:10:21',
// status: 'success' //
// },
]
};
},
created(){
this.timelineData = this.data
}
};
</script>
<style scoped>
/* 整体容器 */
.approval-timeline {
width: 100%;
margin: 20px auto;
font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
font-size: 14px;
color: #333;
}
/* 单个条目容器 */
.timeline-item {
display: flex;
position: relative;
margin-bottom: 20px; /* 节点间距 */
}
/* --- 左侧节点区域 --- */
.timeline-node {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 15px;
position: relative;
width: 20px; /* 固定宽度以对齐 */
}
/* 垂直连接线 */
.timeline-node .line {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 1px;
height: calc(100% + 20px);
background-color: #ccc;
z-index: 0;
margin-top: 5px;
}
/* 针对第一个元素,线条通常从圆点下方开始,或者上方留白 */
.timeline-item:first-child .timeline-node .line {
/* top: 12px; 线条从圆点中心开始向下 */
/* height: 100%; */
height: calc(100% + 20px);
}
/* 针对最后一个元素,线条在圆点上方结束 */
.timeline-item:last-child .timeline-node .line {
height: 0; /* 线条只在圆点上方 */
top: 0;
}
/* 如果最后一个节点是“进行中”,上方线条可以是虚线,下方无 */
/* 这里为了简化,统一处理,具体根据业务逻辑调整 */
/* 圆点样式 */
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
z-index: 1; /* 确保圆点盖住线条 */
background-color: #fff;
border: 3px solid #ccc;
margin-top: 4px; /* 微调垂直位置 */
}
/* 状态类:蓝色(提交) */
.dot.is-blue {
border-color: #1890ff;
/* background-color: #1890ff; */
}
/* 状态类:绿色(审核通过) */
.dot.is-green {
border-color: #52c41a;
/* background-color: #52c41a; */
}
/* 状态类:红色(审核驳回) */
.dot.is-red {
border-color: #ff4d4f;
/* background-color: #ff4d4f; */
}
/* 状态类:空心(待处理/结束) */
.dot.is-empty {
border-color: #52c41a; /* 图片中最后一个点是绿色的圈 */
background-color: #fff;
}
/* --- 右侧内容区域 --- */
.timeline-content {
flex: 1;
padding-top: 2px; /* 与圆点垂直居中对齐 */
}
.content-header {
margin-bottom: 4px;
}
.label {
color: #333;
font-weight: 500;
}
.value {
color: #333;
margin-left: 8px;
}
.content-body {
color: #333;
/* font-size: 12px; */
line-height: 1.6;
}
/* 审核意见特殊样式 */
.comment {
margin-top: 4px;
color: #333; /* 图片中意见颜色较深 */
}
</style>

@ -45,7 +45,7 @@
<el-button type="text" @click="releaseData(scope.row)" v-if="scope.row.status == 0 && permission.rbFilePreserve_issue"
>发布</el-button
>
<el-button type="text" @click="auditData(scope.row)" v-if="scope.row.status == 1"
<el-button type="text" @click="auditData(scope.row)" v-if="scope.row.status == 1 || scope.row.status == 2"
>审核</el-button
>
<el-button type="text" @click="updateStatus(scope.row, 3)" v-if="scope.row.status == 3 && permission.rbFilePreserve_cancellation"
@ -63,10 +63,10 @@
<template #status="{row}">
<span v-if="row.status == 0" style="cursor:pointer;">新建</span>
<span v-if="row.status == 1" style="cursor:pointer;" @click="hadleHistory(row)">待审核</span>
<span v-if="row.status == 2" style="cursor:pointer;">审核中</span>
<span v-if="row.status == 3" style="cursor:pointer;">使用中</span>
<span v-if="row.status == 4" style="cursor:pointer;">废弃</span>
<span v-if="row.status == 5" style="cursor:pointer;">审核不通过</span>
<span v-if="row.status == 2" style="cursor:pointer;" @click="hadleHistory(row)">审核中</span>
<span v-if="row.status == 3" style="cursor:pointer;" @click="hadleHistory(row)">使用中</span>
<span v-if="row.status == 4" style="cursor:pointer;" @click="hadleHistory(row)">废弃</span>
<span v-if="row.status == 5" style="cursor:pointer;" @click="hadleHistory(row)">审核不通过</span>
</template>
</avue-crud>
<detailRb
@ -122,13 +122,7 @@
</template>
</el-dialog>
<el-dialog width="30%" v-model="checkHistory" title="审核历史">
<div style="height: 300px;">
<el-steps direction="vertical" :active="1">
<el-step v-for="(item,index) in historyData" :key="item.id" :title="`${index == historyData.length -1 ? '提交人:' : '审核人:'} `"></el-step>
<!-- <el-step title="步骤 2"></el-step>
<el-step title="步骤 3" description="这是一段很长很长很长的描述性文字"></el-step> -->
</el-steps>
</div>
<checkLine v-if="checkHistory" :data="historyData"></checkLine>
</el-dialog>
</basic-container>
@ -142,7 +136,9 @@ import {
deleteRecords,
copyData,
updateStatus,
release
release,
audit,
auditHistory
} from '@/api/qualityManagement/inspectionArchiving/rbFilePreserve';
import { mapGetters } from 'vuex';
import detailRb from './detailRb2.vue';
@ -151,6 +147,7 @@ import approvalStandard from '@/views/oem/components/approval/index.vue';
import editTable from './editTable.vue';
import basicImport from '@/components/basic-import/main.vue';
import addPreserve from './addPreserve.vue';
import checkLine from "./checkLine.vue"
export default {
components: {
detailRb,
@ -159,6 +156,7 @@ export default {
editTable,
basicImport,
addPreserve,
checkLine
},
data() {
return {
@ -170,10 +168,6 @@ export default {
currentPage: 1,
total: 0,
},
historyData:[
{id:2,name:'张三',time:'2021-01-01',result:'审核通过'},
{id:1,name:'李四',time:'2021-01-01',result:'审核通过'},
],
form: {},
query: {},
loading: true,
@ -185,6 +179,7 @@ export default {
remark:[{ required: false, message: '请填写审核意见', trigger: 'blur' }]
},
checkHistory:false,
historyData:[],
option: {
tip: false,
height: 'auto',
@ -463,6 +458,25 @@ export default {
.catch(() => {});
},
//
releaseData(row){
this.$confirm('确定发布此模板?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
release({
id: row.id,
}).then((res) => {
this.$message({
message: '发布成功',
type: 'success',
});
this.onLoad(this.page, this.query);
});
})
},
auditData(row){
this.checkId = row.id
this.auditForm = {
@ -487,12 +501,25 @@ export default {
...this.auditForm,
id:this.checkId
}
audit(params).then(res =>{
if(res.data.code == 200){
this.$message.success('审核成功')
this.onLoad()
this.approveDialog = false
}
})
}
})
},
hadleHistory(row){
auditHistory({
id:row.id
}).then(res =>{
console.log('res----------------',res)
this.historyData = res.data.data
this.checkHistory = true
})
},
//

Loading…
Cancel
Save