flowSubmit.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view>
  3. <u-gap height="70" bgColor="#ffffff"></u-gap>
  4. <view class="bottim_view">
  5. <view>
  6. <u-row>
  7. <u-col span="11">
  8. <u-button :disabled="isDisabled" class="btnDoPay" shape="circle" @click="verify"
  9. color="rgb(55,186,189)" text="提交"></u-button>
  10. </u-col>
  11. </u-row>
  12. </view>
  13. </view>
  14. <!-- 下一步选择人员弹窗 -->
  15. <uni-popup ref="popup" background-color="#fff">
  16. <view style="height: 800rpx;">
  17. <view class="desc">
  18. <uni-row>
  19. <uni-col :span="10">
  20. <view style="font-size: 40rpx;color: rgb(145, 145, 145);">
  21. </view>
  22. </uni-col>
  23. <uni-col :span="11">
  24. <view style="font-size: 40rpx;color: rgb(98, 98, 98);">
  25. 下一步
  26. </view>
  27. </uni-col>
  28. <uni-col :span="3">
  29. <view @click="submitPass" style="font-size: 40rpx;color: rgb(55,186,189);">
  30. 确认
  31. </view>
  32. </uni-col>
  33. </uni-row>
  34. </view>
  35. <view>
  36. <!-- -->
  37. <uni-row>
  38. <uni-col>
  39. <view style="padding: 15rpx 20rpx;">
  40. <uni-data-picker ref="picker" placeholder="请选择" :popup-title="selectTitle"
  41. :localdata="dataTree" v-model="hxForm.candidate" @change="nextApprovalChange">
  42. </uni-data-picker>
  43. </view>
  44. </uni-col>
  45. </uni-row>
  46. </view>
  47. </view>
  48. </uni-popup>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. props: {
  54. api: {
  55. type: String,
  56. default: null
  57. },
  58. data: {}
  59. },
  60. data() {
  61. return {
  62. isDisabled: false,
  63. selectTitle: '',
  64. hxForm: {},
  65. pageType: '',
  66. searchGoodsName: '',
  67. dataTree: [],
  68. index: 0,
  69. defaultDept: '',
  70. form: {}
  71. }
  72. },
  73. onLoad() {
  74. },
  75. methods: {
  76. /**字段验证方法*/
  77. verify() {
  78. this.$emit('verify')
  79. },
  80. async submit() {
  81. this.isDisabled = true
  82. setTimeout(() => {
  83. this.isDisabled = false
  84. }, 1000)
  85. const {
  86. data: res
  87. } = await this.$httpRequest({
  88. url: '/app/submitApply/' + this.api,
  89. method: 'post',
  90. data: this.data,
  91. urlType: this.$getUrlType()
  92. });
  93. if (res.code === 200) {
  94. this.dataTree = res.data.tree
  95. this.hxForm.taskId = res.data.taskId
  96. this.$refs.popup.open('bottom')
  97. this.selectTitle = "请选择" + this.dataTree[0].text
  98. this.isDisabled = false
  99. } else {
  100. this.$showModal(res.msg)
  101. }
  102. this.isDisabled = false
  103. },
  104. async submitPass() {
  105. if (!this.hxForm.candidate) {
  106. uni.showModal({
  107. content: '请选择' + this.dataTree[0].text,
  108. title: '提交失败',
  109. showCancel: false,
  110. })
  111. }
  112. const {
  113. data: res
  114. } = await this.$httpRequest({
  115. url: '/app/task/submit/candidate?taskId=' + this.hxForm.taskId +
  116. '&candidate=' + this.hxForm.candidate + '&applyUserName=' + this.hxForm.applyUserName,
  117. method: 'get',
  118. urlType: this.$getUrlType()
  119. });
  120. if (res.code === 200) {
  121. uni.showModal({
  122. content: '已提交给审批人员',
  123. title: '提交成功',
  124. showCancel: false,
  125. success() {
  126. uni.navigateBack()
  127. }
  128. })
  129. } else {
  130. uni.showModal({
  131. content: res.msg,
  132. title: '提交失败',
  133. showCancel: false,
  134. success() {
  135. uni.navigateBack()
  136. }
  137. })
  138. }
  139. },
  140. nextApprovalChange(e) {
  141. // console.log('onchange:', e.detail.value[1].text);
  142. this.hxForm.applyUserName = e.detail.value[1].text
  143. this.hxForm.candidate = e.detail.value[1].value
  144. },
  145. maskClick(e) {},
  146. bindPickerChange: function(e) {
  147. this.index = e.detail.value
  148. },
  149. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. .desc {
  154. padding: 10rpx 5rpx;
  155. color: #818181;
  156. font-size: 20rpx;
  157. }
  158. .pickerView {
  159. // align-items: flex-end;
  160. padding: 10rpx 20rpx;
  161. border: 1rpx #eeeeee solid;
  162. }
  163. .pickerText {
  164. font-size: 26rpx;
  165. color: #b1b1b1;
  166. }
  167. .bottim_view {
  168. padding: 5px 20px 30px;
  169. position: fixed;
  170. left: 0px;
  171. bottom: 0px;
  172. width: 100%;
  173. height: 40px;
  174. background-color: #ffffff;
  175. }
  176. </style>