記一下公司的備注怎麼寫
首先是點選添加備注按鈕,會向背景發起一個請求,獲得目前角色的備注,然後循環到備注的區域,然後可以自己寫備注,點選确定按鈕也會向背景發送請求,添加備注.
data 裡面的資料
// 備注資訊模态框
notesModule: {
notesShow: false,
id: \'\',
taskName: \'\',
status: \'\',
info: \'\'
},
objdata: [], //備注容器
// 修改備注按鈕
<el-table-column label="備注" width="100">
<template slot-scope="scope">
<span class="action-btn" @click="notesEdit(scope.row)">
我是備注</span>
</template>
</el-table-column>
// 點選備注按鈕發送請求
notesEdit(obj) {
this.notesModule = {
notesShow: true,
name: obj.taskName,
id: obj.id,
info: \'\'
}
this.getTaskReMark()
},
// 擷取備注的清單
getTaskReMark() {
this.$http(this.GLOBALApi.commonBrandRemarkList(), {
sourceType: 8,
sourceId: this.notesModule.id,
personId: \'1\' //使用者的iD-或者管理者的id
}).then(res => {
if (res.status == 1) {
this.objdata = res.data
console.log(res.data)
} else {
}
})
this.initPage()
},
獲得了objdata就去循環渲染頁面咯
<!-- 您講給誰進行備注 -->
<p style="height:30px; line-height:30px;text-align: center;font-size: 22px;margin: 0;">
您将給
<span style="color: #ff4081;">{{ notesModule.name }}</span> 進行備注
</p>
<!-- 備注内容滾動條 -->
<div class="scrollarea">
<el-scrollbar style="height:100%;width: 100%;margin: 0 auto;">
<div style="height: 40px;line-height: 40px;" v-for="(item, index) in objdata" :key="index">
<span>{{ item.createTime }}</span>
<span>管理者名稱:{{ item.personName }}</span>
<span>備注内容:{{ item.description }}</span>
</div>
</el-scrollbar>
</div>
// 點選确定按鈕
<div>
<span>取 消</span>
<span @click="notesSubmit">确 定</span>
</div>
// 點選确定按鈕發送請求
// 發起請求送出備注的資訊
notesSubmit() {
this.$http(this.GLOBALApi.commonRemark(), {
sourceType: 8,
sourceId: this.notesModule.id,
description: this.notesModule.info,
personId: \'1\' //使用者的iD-或者管理者的id
}).then(res => {
if (res.status == 1) {
this.$message({
message: \'儲存成功\',
type: \'info\'
})
this.notesModule = {
notesShow: false,
name: \'\',
id: \'\',
info: \'\'
}
this.initPage()
} else {
this.$message({
message: \'請填寫備注\',
type: \'error\'
})
}
})
},
發表于
2020-05-19 19:37
huyadi
閱讀(392)
評論(0)
編輯
收藏
舉報
