evaluatePlan.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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" :defValue="value" 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(opts) {
  26. this.value[0]=opts.id
  27. // 查询方案
  28. findScheme({status:1}).then(res=>{
  29. console.log(res.data)
  30. if(res.status == 200){
  31. this.list = res.data
  32. }
  33. })
  34. },
  35. methods: {
  36. // 选中方案,item 返回的是数组
  37. chooseOk(item) {
  38. console.log(item)
  39. if(item.length==0){
  40. uni.showToast({
  41. icon:'none',
  42. title:'请选择考评方案'
  43. })
  44. }else{
  45. //关闭当前页面,这里处理数据逻辑
  46. uni.$emit("resetTaskKpItem",item[0])
  47. uni.navigateBack()
  48. }
  49. },
  50. // 查看详情
  51. viewDetail(item){
  52. uni.navigateTo({
  53. url:"/pages/evaluatePlan/planDetail?id="+item.id
  54. })
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. page{
  61. height: 100%;
  62. }
  63. </style>