|
@@ -24,7 +24,7 @@
|
|
|
<div class="moduleList wrap">
|
|
|
<redTipword v-if="!edit" title="检查项" :isedit="edit" />
|
|
|
<div v-for="(item, index) in data.templates" :key="item.id" class="item">
|
|
|
- <div v-if="item.content.indexOf('s') > -1">
|
|
|
+ <div v-if="item.type === 1">
|
|
|
<p :id="`s${item.id}`" class="title">
|
|
|
<el-checkbox v-if="!edit" v-model="item.isCheck" :label="item.name" @change="updateCheckItemHandle(item.isCheck, item)">{{ item.name }}</el-checkbox>
|
|
|
<span v-else>{{ item.name }}</span>
|
|
@@ -69,7 +69,7 @@
|
|
|
<div>
|
|
|
<headTitle title="动态" />
|
|
|
</div>
|
|
|
- <actionDynamic :comments="commentlist" @addComment="createCommentHandle" />
|
|
|
+ <actionDynamic :comments="commentlist" :change-record="changeRecordList" @addComment="createCommentHandle" />
|
|
|
</section>
|
|
|
<div v-if="!showEmpty" class="step">
|
|
|
<step :data="data.templates" :type-list="data.templates" @goto="scrollToHandle" />
|
|
@@ -98,7 +98,8 @@ import {
|
|
|
createChecklist,
|
|
|
updateTemplateCheckStatus,
|
|
|
getCommentList,
|
|
|
- createComment
|
|
|
+ createComment,
|
|
|
+ getRecordList
|
|
|
} from '@/api/publishTask'
|
|
|
export default {
|
|
|
components: {
|
|
@@ -141,7 +142,8 @@ export default {
|
|
|
openEdit: true,
|
|
|
data: {},
|
|
|
temList: [],
|
|
|
- commentlist: [] // 评价列表
|
|
|
+ commentlist: [], // 评价列表
|
|
|
+ changeRecordList: [] // 变更记录列表
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -151,6 +153,8 @@ export default {
|
|
|
this.getList()
|
|
|
// 获取评论列表
|
|
|
this.getCommentList()
|
|
|
+ // 获取变更记录
|
|
|
+ this.getRecordList()
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取checklist详情
|
|
@@ -172,18 +176,25 @@ export default {
|
|
|
// 获取业务线下绑定的可以选checklist列表
|
|
|
async getBizBindTemList() {
|
|
|
const { bizId = null } = store.state.global || {}
|
|
|
- const res = await getBizBindTemList({ name: '', bizId, belongType: 2 })
|
|
|
+ const res = await getBizBindTemList({ name: '', bizId })
|
|
|
this.temList = res.data
|
|
|
},
|
|
|
|
|
|
async getCommentList() {
|
|
|
const res = await getCommentList({ type: 5, joinId: this.taskId })
|
|
|
- this.commentList = res.data
|
|
|
if (res.code === 200) {
|
|
|
- this.comments = res.data
|
|
|
+ this.commentlist = res.data
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ // 获取变更记录
|
|
|
+ async getRecordList() {
|
|
|
+ const res = await getRecordList({ taskId: this.taskId })
|
|
|
+ console.log(res)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.changeRecordList = res.data
|
|
|
+ }
|
|
|
+ },
|
|
|
// 添加评论
|
|
|
async createCommentHandle(content, callback) {
|
|
|
const commentInfo = {
|
|
@@ -268,6 +279,8 @@ export default {
|
|
|
if (res.code === 200) {
|
|
|
this.edit = false
|
|
|
this.openEdit = true
|
|
|
+ // 保存更新变更记录
|
|
|
+ this.getRecordList()
|
|
|
this.$message({
|
|
|
message: '保存成功',
|
|
|
type: 'success'
|
|
@@ -286,6 +299,10 @@ export default {
|
|
|
},
|
|
|
// 点击添加
|
|
|
addAction() {
|
|
|
+ // 校验是否绑定过checklist模板
|
|
|
+ if (!this.RegHasCheckListTem()) {
|
|
|
+ return
|
|
|
+ }
|
|
|
// 复制一份数据,以便取消时复原
|
|
|
this.copyData = this.data
|
|
|
// 编辑按钮隐藏
|
|
@@ -307,6 +324,10 @@ export default {
|
|
|
|
|
|
// 编辑
|
|
|
editHandle() {
|
|
|
+ // 校验是否绑定过checklist模板
|
|
|
+ if (!this.RegHasCheckListTem()) {
|
|
|
+ return
|
|
|
+ }
|
|
|
// 复制一份数据,以便取消时复原
|
|
|
this.copyData = this.data
|
|
|
// 编辑状态打开
|
|
@@ -327,6 +348,19 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ // 校验是否该业务线有绑定checklist模板
|
|
|
+ RegHasCheckListTem() {
|
|
|
+ if (!this.temList || this.temList.length < 1) {
|
|
|
+ this.$message({
|
|
|
+ message: '该业务线暂无绑定checklist模板,请先绑定checklist模板',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 修改checklist绑定模版列表
|
|
|
updateSelectedTemHandle(checkedIds) {
|
|
|
console.log(checkedIds)
|