pdca.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="pdca-page">
  3. <uni-segmented-control
  4. :current="current"
  5. :values="items"
  6. @clickItem="onClickItem"
  7. style-type="text"
  8. active-color="#3377FF" />
  9. <view class="content">
  10. <scroll-view class="scroll-y" scroll-y="true">
  11. <one-textarea
  12. v-if="current === 0"
  13. :defaultPlanValue="plan"
  14. :disabled="disabled"
  15. />
  16. <do-and-check
  17. v-if="current === 1"
  18. :disabled="disabled"
  19. />
  20. <view v-if="current === 2">
  21. 选项卡3的内容
  22. </view>
  23. <one-textarea
  24. v-if="current === 3"
  25. title="对策处置(Action)"
  26. label="对策处置"
  27. :defaultactionValue="'123'"
  28. :disabled="disabled"
  29. />
  30. </scroll-view>
  31. <view class="fixed-buttom-btn" v-if="!disabled">
  32. <view class="btn-text cancle">
  33. <text>暂存</text>
  34. </view>
  35. <view class="btn-text">
  36. <text>完成</text>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. // 改善任务PDCA
  44. import uniSegmentedControl from "@/components/uni-segmented-control/uni-segmented-control.vue"
  45. import oneTextarea from './pdca-components/one-textarea.vue'
  46. import doAndCheck from './pdca-components/do-and-check.vue'
  47. export default {
  48. props: {
  49. // 是否禁用
  50. disabled: {
  51. type: Boolean,
  52. default: false
  53. },
  54. // 详情回显的数据
  55. values: {
  56. type: Object,
  57. default: () => {
  58. return {}
  59. }
  60. },
  61. // 按钮信息 (包过请求的key)
  62. btnInfo: {
  63. type: Object,
  64. default: () => {
  65. return {}
  66. }
  67. },
  68. // 任务详情
  69. missionDetails: {
  70. type: Object,
  71. default: () => {
  72. return {}
  73. }
  74. }
  75. },
  76. data() {
  77. return {
  78. items: ['改善计划(P)', '执行过程(D)', '改善确认(C)', '对策处置(A)'],
  79. current: 0,
  80. // plan 改善计划
  81. plan: ''
  82. }
  83. },
  84. created() {
  85. uni.setNavigationBarTitle({
  86. title: '改善计划'
  87. });
  88. if(this.disabled) {
  89. this.plan = this.values['plan'];
  90. console.log(9, this.values)
  91. }
  92. },
  93. methods: {
  94. onClickItem(e) {
  95. if (this.current !== e.currentIndex) {
  96. this.current = e.currentIndex;
  97. }
  98. }
  99. },
  100. components: {
  101. uniSegmentedControl,
  102. oneTextarea,
  103. doAndCheck
  104. }
  105. }
  106. </script>
  107. <style lang="less">
  108. .pdca-page {
  109. height: 100%;
  110. .content {
  111. height: calc(100% - 141.5rpx);
  112. .scroll-y {
  113. height: 100%;
  114. }
  115. }
  116. }
  117. </style>