|
@@ -23,14 +23,14 @@
|
|
</div>
|
|
</div>
|
|
<div class="moduleList wrap">
|
|
<div class="moduleList wrap">
|
|
<redTipword v-if="!edit" title="检查项" :isedit="edit" />
|
|
<redTipword v-if="!edit" title="检查项" :isedit="edit" />
|
|
- <div v-for="(item, index) in data.templates" :key="item.id" class="item">
|
|
|
|
|
|
+ <div v-for="(item, index) in data.templates" :key="item.parentTemplateId" class="item">
|
|
<div v-if="item.type === 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>
|
|
|
|
|
|
+ <p :id="`s${item.parentTemplateId}`" class="title">
|
|
|
|
+ <el-checkbox v-if="!edit" v-model="item.isCheck" :label="item.name" @change="updateCheckItemHandle(item)">{{ item.name }}</el-checkbox>
|
|
<span v-else>{{ item.name }}</span>
|
|
<span v-else>{{ item.name }}</span>
|
|
</p>
|
|
</p>
|
|
<onlineCheckList
|
|
<onlineCheckList
|
|
- :module-id="item.id"
|
|
|
|
|
|
+ :module-id="item.parentTemplateId"
|
|
:isedit="edit"
|
|
:isedit="edit"
|
|
:data="item.onlineModule"
|
|
:data="item.onlineModule"
|
|
:task-id="taskId"
|
|
:task-id="taskId"
|
|
@@ -40,13 +40,13 @@
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div v-else>
|
|
<div v-else>
|
|
- <p :id="`s${item.id}`" class="title">
|
|
|
|
|
|
+ <p :id="`s${item.parentTemplateId}`" class="title">
|
|
<el-checkbox v-if="!edit" v-model="item.isCheck" :label="item.name" @change="updateCheckItemHandle(item)">{{ item.name }}</el-checkbox>
|
|
<el-checkbox v-if="!edit" v-model="item.isCheck" :label="item.name" @change="updateCheckItemHandle(item)">{{ item.name }}</el-checkbox>
|
|
<span v-else>{{ item.name }}</span>
|
|
<span v-else>{{ item.name }}</span>
|
|
</p>
|
|
</p>
|
|
<normal-area
|
|
<normal-area
|
|
v-if="edit"
|
|
v-if="edit"
|
|
- :id="'tem'+item.id"
|
|
|
|
|
|
+ :id="'tem'+item.parentTemplateId"
|
|
:value.sync="item.content"
|
|
:value.sync="item.content"
|
|
:empty-text="'点击'"
|
|
:empty-text="'点击'"
|
|
:input-button="'修改模板'"
|
|
:input-button="'修改模板'"
|
|
@@ -159,7 +159,6 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 获取checklist详情
|
|
// 获取checklist详情
|
|
async getList() {
|
|
async getList() {
|
|
- console.log(this.taskId)
|
|
|
|
if (this.taskId) {
|
|
if (this.taskId) {
|
|
const res = await getCheckListBytask({ taskId: this.taskId })
|
|
const res = await getCheckListBytask({ taskId: this.taskId })
|
|
// res.data = null
|
|
// res.data = null
|
|
@@ -175,6 +174,7 @@ export default {
|
|
|
|
|
|
// 获取业务线下绑定的可以选checklist列表
|
|
// 获取业务线下绑定的可以选checklist列表
|
|
async getBizBindTemList() {
|
|
async getBizBindTemList() {
|
|
|
|
+ console.log(1111)
|
|
const { bizId = null } = store.state.global || {}
|
|
const { bizId = null } = store.state.global || {}
|
|
const res = await getBizBindTemList({ name: '', bizId })
|
|
const res = await getBizBindTemList({ name: '', bizId })
|
|
this.temList = res.data
|
|
this.temList = res.data
|
|
@@ -217,7 +217,7 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
// 添加或者删除线上模板的模版名
|
|
// 添加或者删除线上模板的模版名
|
|
- changeOnlineSelectedHandle(id, name, value, type) {
|
|
|
|
|
|
+ changeOnlineSelectedHandle(id, subIdx, value, type) {
|
|
/**
|
|
/**
|
|
* id: 模块id
|
|
* id: 模块id
|
|
* name: 线上模块中哪个模块下的模块名称
|
|
* name: 线上模块中哪个模块下的模块名称
|
|
@@ -225,24 +225,28 @@ export default {
|
|
* type: 是添加还是删除
|
|
* type: 是添加还是删除
|
|
**/
|
|
**/
|
|
// const tem = this.data.templates
|
|
// const tem = this.data.templates
|
|
|
|
+ console.log(this.data, id, subIdx, value, type)
|
|
this.data.templates.map(t => {
|
|
this.data.templates.map(t => {
|
|
- if (t.id === id) {
|
|
|
|
|
|
+ if (t.parentTemplateId === id) {
|
|
if (type === 'del') {
|
|
if (type === 'del') {
|
|
t.onlineModule.onlineOrder = t.onlineModule.onlineOrder.filter(g => g !== value)
|
|
t.onlineModule.onlineOrder = t.onlineModule.onlineOrder.filter(g => g !== value)
|
|
- t.onlineModule.tableContent.map(t => {
|
|
|
|
- if (t.module === name) {
|
|
|
|
|
|
+ t.onlineModule.tableContent.map((t, i) => {
|
|
|
|
+ if (i === subIdx) {
|
|
t.moduleNames = t.moduleNames.filter(g => g !== value)
|
|
t.moduleNames = t.moduleNames.filter(g => g !== value)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else if (!t.onlineModule.onlineOrder.includes(value)) {
|
|
} else if (!t.onlineModule.onlineOrder.includes(value)) {
|
|
t.onlineModule.onlineOrder.push(value)
|
|
t.onlineModule.onlineOrder.push(value)
|
|
- t.onlineModule.tableContent.map(t => {
|
|
|
|
- if (t.module === name) {
|
|
|
|
|
|
+ t.onlineModule.tableContent.map((t, i) => {
|
|
|
|
+ if (i === subIdx) {
|
|
t.moduleNames.push(value)
|
|
t.moduleNames.push(value)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- console.log('已经添加过该模块名称')
|
|
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '已经添加过该模块名称',
|
|
|
|
+ type: 'error'
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -251,11 +255,19 @@ export default {
|
|
changeOnlineModuleRow(type, mId, index) {
|
|
changeOnlineModuleRow(type, mId, index) {
|
|
console.log(type, mId, index, this.data.templates)
|
|
console.log(type, mId, index, this.data.templates)
|
|
this.data.templates.map(t => {
|
|
this.data.templates.map(t => {
|
|
- if (t.id === mId) {
|
|
|
|
|
|
+ if (t.parentTemplateId === mId) {
|
|
if (type === 'del') {
|
|
if (type === 'del') {
|
|
|
|
+ console.log(t.onlineModule)
|
|
|
|
+ const delModuleNames = t.onlineModule.tableContent[index].moduleNames
|
|
|
|
+ const test = t.onlineModule.onlineOrder.filter(t => !delModuleNames.includes(t))
|
|
|
|
+ console.log(delModuleNames, test)
|
|
|
|
+ t.onlineModule.onlineOrder = t.onlineModule.onlineOrder.filter(t => !delModuleNames.includes(t))
|
|
t.onlineModule.tableContent.splice(index, 1)
|
|
t.onlineModule.tableContent.splice(index, 1)
|
|
} else {
|
|
} else {
|
|
- t.onlineModule.tableContent.splice(index + 1, 0, {})
|
|
|
|
|
|
+ t.onlineModule.tableContent.splice(index + 1, 0, {
|
|
|
|
+ module: `模块${index + 1}`,
|
|
|
|
+ moduleNames: []
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -343,7 +355,16 @@ export default {
|
|
if (!selectedBizTemplateIds || selectedBizTemplateIds.length < 1) {
|
|
if (!selectedBizTemplateIds || selectedBizTemplateIds.length < 1) {
|
|
this.temList.map(t => {
|
|
this.temList.map(t => {
|
|
this.data.selectedBizTemplateIds.push(t.id)
|
|
this.data.selectedBizTemplateIds.push(t.id)
|
|
- this.data.templates.push(t)
|
|
|
|
|
|
+ const { content, isCheck, name, onlineModule, type, id: parentTemplateId } = t
|
|
|
|
+ this.data.templates.push({
|
|
|
|
+ content,
|
|
|
|
+ isCheck,
|
|
|
|
+ name,
|
|
|
|
+ onlineModule,
|
|
|
|
+ type,
|
|
|
|
+ parentTemplateId,
|
|
|
|
+ belongType: 2 // checklist的模板
|
|
|
|
+ })
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -370,7 +391,16 @@ export default {
|
|
this.temList.map(t => {
|
|
this.temList.map(t => {
|
|
if (t.id === checkedId) {
|
|
if (t.id === checkedId) {
|
|
selectedBizTemplateIds.push(t.id)
|
|
selectedBizTemplateIds.push(t.id)
|
|
- templates.push(t)
|
|
|
|
|
|
+ const { content, isCheck, name, onlineModule, type, id: parentTemplateId } = t
|
|
|
|
+ templates.push({
|
|
|
|
+ content,
|
|
|
|
+ isCheck,
|
|
|
|
+ name,
|
|
|
|
+ onlineModule,
|
|
|
|
+ type,
|
|
|
|
+ parentTemplateId,
|
|
|
|
+ belongType: 2 // checklist的模板
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -408,8 +438,9 @@ export default {
|
|
async updateCheckItemHandle(item) {
|
|
async updateCheckItemHandle(item) {
|
|
console.log(item)
|
|
console.log(item)
|
|
const { id: templateId, isCheck } = item
|
|
const { id: templateId, isCheck } = item
|
|
- const res = await updateTemplateCheckStatus({ templateId, isCheck })
|
|
|
|
|
|
+ const res = await updateTemplateCheckStatus({ templateId, isCheck, taskId: this.taskId })
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
|
+ this.getRecordList()
|
|
this.$message({
|
|
this.$message({
|
|
message: '检查项状态更新成功',
|
|
message: '检查项状态更新成功',
|
|
type: 'success'
|
|
type: 'success'
|