| | |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="{row}" slot="badCommentConfirm"> |
| | | <span v-if="row.status == 3 && !row.badCommentConfirm" style="color: red">差评类型未确认</span> |
| | | </template> |
| | | |
| | | |
| | | |
| | | <template slot-scope="{type,size,row,index}" slot="menu"> |
| | | <el-button v-if="row.status == 1" icon="el-icon-edit" :size="size" :type="type" @click="$refs.crud.rowEdit(row,index)">评 价</el-button> |
| | | <el-button v-if="row.status == 3 && !row.badCommentConfirm" icon="el-icon-warning-outline" :size="size" :type="type" @click="badCommentConfirm(row)">差评确认</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/evaluation/evaluation"; |
| | | import {getPage, getDetail, add, update, remove} from "@/api/evaluation/evaluation"; |
| | | import option from "@/const/evaluation/evaluation"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | |
| | | }, |
| | | selectionList: [], |
| | | option: option, |
| | | badConfirmOption:{ |
| | | height:'auto', |
| | | calcHeight: 30, |
| | | tip: false, |
| | | border: true, |
| | | index: true, |
| | | dialogClickModal: false, |
| | | group:[ |
| | | { |
| | | label: '评价信息', |
| | | collapse: true, |
| | | prop: 'info', |
| | | arrow:false, |
| | | column:[ |
| | | { |
| | | label: "申请单号", |
| | | prop: "no", |
| | | type: "input", |
| | | readonly:true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | }, |
| | | { |
| | | label: "评分", |
| | | prop: "score", |
| | | type: "rate", |
| | | disabled:true, |
| | | colors: ['#99A9BF', '#F7BA2A', '#FF9900'], |
| | | rules: [{required: true, trigger: ['blur','change'],message:"请评分"}] |
| | | }, |
| | | { |
| | | label: "评价", |
| | | prop: "comment", |
| | | readonly:true, |
| | | disabled:true, |
| | | span:24, |
| | | type: "select", |
| | | multiple:true, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=evaluation_comment", |
| | | props:{ |
| | | label:"dictValue", |
| | | value:"dictKey" |
| | | }, |
| | | }, |
| | | { |
| | | label: "建议与反馈", |
| | | prop: "feedback", |
| | | readonly:true, |
| | | span:24, |
| | | type: "textarea", |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '确认评价内容', |
| | | collapse: true, |
| | | prop: 'confirm', |
| | | arrow:false, |
| | | column:[ |
| | | { |
| | | label:'', |
| | | span:24, |
| | | gutter:18, |
| | | prop:'badCommentConfirm', |
| | | type:'radio', |
| | | props:{ |
| | | label:"dictValue", |
| | | value:"dictKey" |
| | | }, |
| | | dicUrl: '/api/blade-system/dict-biz/dictionary?code=evaluation_bad_comment_confirm', |
| | | rules: [{required: true, trigger: ['blur','change'],message:"请确认评价内容"}] |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | }, |
| | | data: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | ...mapGetters(["permission","userInfo"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.evaluation_add, true), |
| | |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | permit(){ |
| | | return this.userInfo.role_name == 'admin' || this.userInfo.role_name == 'administrator' ? true:false |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | |
| | | if (row.score<3){ |
| | | //评分小于3 差评 |
| | | row.status = 3 |
| | | }else { |
| | | row.status = 2 |
| | | } |
| | | |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | |
| | | if (!this.permit){ |
| | | params.userId = this.userInfo.user_id |
| | | } |
| | | |
| | | getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | } |
| | | }, |
| | | //差评确认 |
| | | badCommentConfirm(row){ |
| | | this.$DialogForm.show({ |
| | | title: '差评确认', |
| | | width: '70%', |
| | | data:row, |
| | | option: this.badConfirmOption, |
| | | callback:(res)=>{ |
| | | update(res.data).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | res.close() |
| | | }) |
| | | this.option.group.forEach(group=>{ |
| | | group.column.forEach(item=>{ |
| | | item.disabled = false |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | | </script> |