evaluatePlan.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <!-- @rightClick 只有有右边部分的情况下才使用,
  3. 右边默认为空,可以使用slot="right" 自定义右边内容
  4. @ok 是单选或多选最终返回的结果
  5. types 类型 radio或checkbox
  6. titleKeys 标题对应的字段名称key,默认是name
  7. listData 是数据
  8. showArrow 是否显示右边箭头
  9. -->
  10. <uni-check-list :listData="list" types="radio" @ok="chooseOk" @rightClick="viewDetail">
  11. <view slot="right">
  12. 详情
  13. </view>
  14. </uni-check-list>
  15. </template>
  16. <script>
  17. import {findScheme} from '@/api/assess'
  18. export default {
  19. data() {
  20. return {
  21. list: [],
  22. value: '',
  23. }
  24. },
  25. onLoad() {
  26. // 查询方案
  27. findScheme({status:1}).then(res=>{
  28. console.log(res.data)
  29. if(res.status == 200){
  30. this.list = res.data
  31. }
  32. })
  33. },
  34. methods: {
  35. // 选中方案,item 返回的是数组
  36. chooseOk(item) {
  37. console.log(item)
  38. if(item.length==0){
  39. uni.showToast({
  40. icon:'none',
  41. title:'请选择考评方案'
  42. })
  43. }else{
  44. //关闭当前页面,这里处理数据逻辑
  45. }
  46. },
  47. // 查看详情
  48. viewDetail(item){
  49. uni.navigateTo({
  50. url:"/pages/evaluatePlan/planDetail?id="+item.id
  51. })
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss">
  57. page{
  58. height: 100%;
  59. }
  60. </style>