affirm.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="container">
  3. <view class="example">
  4. <uni-forms ref="form" :model="firm" labelWidth="80px">
  5. <uni-forms-item label="监测图斑" name="dkbh">
  6. {{obj.dkbh}}
  7. </uni-forms-item>
  8. <uni-forms-item label="监测面积" name="dkmj">
  9. {{obj.dkmj}}
  10. </uni-forms-item>
  11. <uni-forms-item v-if="firm.confirmState == '1' " label="退回原因" name="confirmType">
  12. <uni-data-select v-model="firm.confirmType" :localdata="options"></uni-data-select>
  13. </uni-forms-item>
  14. <uni-easyinput v-if="firm.confirmState == '1' " v-model=" firm.confirmNotse" type="textarea"
  15. placeholder="请输入其他原因" />
  16. </uni-forms>
  17. <button type="primary" @click="submit">提交</button>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import {
  23. confirm,
  24. } from "@/api/dkjbxx.js";
  25. export default {
  26. data() {
  27. return {
  28. tytitle: '',
  29. obj: {},
  30. firm: {
  31. "id": "",
  32. "confirmState": "",
  33. "confirmType": "",
  34. "confirmNotse": "",
  35. "auditflowStep": "WYQR"
  36. },
  37. options: [{
  38. text: '图斑位置无法到达',
  39. value: "0"
  40. }, {
  41. text: '任务期间处于离岗',
  42. value: "1"
  43. }, {
  44. text: '其它',
  45. value: "2"
  46. }],
  47. }
  48. },
  49. onLoad(option) {
  50. this.tytitle = option.confirmState == '1' ? '退回' : '确认'
  51. uni.setNavigationBarTitle({
  52. title: `${this.tytitle}图斑外业任务` // 这里的标题可以是变量或者计算结果
  53. });
  54. this.obj = uni.$globalData || {}
  55. this.firm.id = this.obj.id
  56. this.firm.confirmState = option.confirmState
  57. console.log(this.obj)
  58. },
  59. onReady() {
  60. // this.$refs.form.setRules(this.rules)
  61. },
  62. methods: {
  63. submit(ref) {
  64. this.$refs.form.validate().then(res => {
  65. confirm(this.firm).then(response => {
  66. this.$modal.msgSuccess("修改成功")
  67. })
  68. })
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss">
  74. page {
  75. background-color: #ffffff;
  76. }
  77. .example {
  78. padding: 15px;
  79. background-color: #fff;
  80. }
  81. .segmented-control {
  82. margin-bottom: 15px;
  83. }
  84. .button-group {
  85. margin-top: 15px;
  86. display: flex;
  87. justify-content: space-around;
  88. }
  89. .form-item {
  90. display: flex;
  91. align-items: center;
  92. flex: 1;
  93. }
  94. .button {
  95. display: flex;
  96. align-items: center;
  97. height: 35px;
  98. line-height: 35px;
  99. margin-left: 10px;
  100. }
  101. </style>