submission.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar background-color="#157A2C" color="#fff" fixed="true" statusBar="true" left-icon="back" title="需求审核"
  4. @clickLeft="back">
  5. </uni-nav-bar>
  6. <u-cell-group>
  7. <u-cell title="审核结果" arrow-direction="down">
  8. <uni-data-picker v-model="examForm.approvalResult" slot="value" placeholder="请选择"
  9. :localdata="auditResultOptions" @change="handleAuditResultChange">
  10. </uni-data-picker>
  11. </u-cell>
  12. <u-cell title="审核意见" arrow-direction="down">
  13. <u--textarea slot="value" placeholder="请输入" border="surround"
  14. v-model="examForm.rejectCause"></u--textarea>
  15. </u-cell>
  16. <view class="footerButton">
  17. <u-button type="default" text="返回" @click="back"></u-button>
  18. <u-button type="primary" @click="save" text="">确认</u-button>
  19. </view>
  20. </u-cell-group>
  21. <u-toast ref="uToast"></u-toast>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. auditSalesDemand
  27. } from '@/api/salesServiceManagement/demandList/index.js'
  28. export default {
  29. components: {},
  30. data() {
  31. return {
  32. examForm: {
  33. approvalResult: '',
  34. rejectCause: '',
  35. id: ''
  36. },
  37. auditResultOptions: [{
  38. value: 0,
  39. text: '驳回'
  40. },
  41. {
  42. value: 1,
  43. text: '同意'
  44. }
  45. ],
  46. }
  47. },
  48. onLoad(data) {
  49. this.examForm.id = data.id;
  50. console.log(data, '00')
  51. },
  52. methods: {
  53. handleAuditResultChange(e) {
  54. console.log(e, 'e')
  55. },
  56. async save() {
  57. if (!this.examForm.approvalResult) {
  58. if (this.examForm.approvalResult != '0') {
  59. this.$refs.uToast.show({
  60. type: "warning",
  61. message: "请选择审核结果",
  62. })
  63. return
  64. }
  65. }
  66. const data = uni.getStorageSync('userInfo');
  67. let pdata = {
  68. ...this.examForm,
  69. approvalUserId: data.userId,
  70. approvalUserName: data.name
  71. };
  72. console.log(pdata, 'pdata')
  73. const res = await auditSalesDemand(pdata);
  74. if (res) {
  75. this.back()
  76. }
  77. // this.back()
  78. },
  79. },
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. /deep/.u-cell__body__content {
  84. flex: none;
  85. margin-right: 16rpx;
  86. }
  87. .mainBox {
  88. padding-bottom: 84rpx;
  89. }
  90. .footerButton {
  91. width: 100%;
  92. height: 84rpx;
  93. display: flex;
  94. position: fixed;
  95. bottom: 0;
  96. /deep/.u-button {
  97. height: 100%;
  98. }
  99. >view {
  100. flex: 1;
  101. }
  102. }
  103. // /deep/.u-button {
  104. // height: 100%;
  105. // }
  106. /deep/.u-subsection__item__text {
  107. font-size: 28rpx !important;
  108. }
  109. </style>