| | |
| | | /** |
| | | * 根据巡查任务获取评分细则 |
| | | */ |
| | | |
| | | fetchItemEvaluation(subTaskId) { |
| | | const params = `?subTaskId=${subTaskId}`; |
| | | return $fysp.get(`evaluationsubrule/score${params}`).then((res) => res.data); |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 批量更新评分细则得分 |
| | | */ |
| | | updateItemEvaluation(param) { |
| | | return $fysp.post(`itemevaluation/uplist`, param).then((res) => res.data); |
| | | }, |
| | | |
| | | /** |
| | | * 查询评估总规则 |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import evaluateApi from '@/api/fysp/evaluateApi'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | |
| | | export default { |
| | | data() { |
| | | return {}; |
| | | setup() { |
| | | const { loading, fetchData } = useFetchData(); |
| | | return { loading, fetchData }; |
| | | }, |
| | | methods: {} |
| | | data() { |
| | | return { |
| | | evaluation: {} |
| | | }; |
| | | }, |
| | | created() { |
| | | // watch 路由的参数,以便再次获取数据 |
| | | this.$watch( |
| | | () => this.$route.params, |
| | | () => { |
| | | this.getScore(); |
| | | }, |
| | | // 组件创建完后获取数据, |
| | | // 此时 data 已经被 observed 了 |
| | | { immediate: true } |
| | | ); |
| | | }, |
| | | methods: { |
| | | // 获取评分 |
| | | getScore() { |
| | | this.fetchData(() => { |
| | | return evaluateApi.fetchItemEvaluation(this.$route.params.subTaskId).then((res) => { |
| | | this.evaluation = res; |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped></style> |