index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view>
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="受理巡点检工单" @clickLeft="back"></uni-nav-bar>
  4. <view class="page-bottom-padding">
  5. <template v-if="worksheetInfo">
  6. <CellTip title="基本信息"> </CellTip>
  7. <DetailMain :detailsInfo="tourTallyDetailFn(worksheetInfo)"></DetailMain>
  8. </template>
  9. </view>
  10. <button class="btn-submit" @click="bindSubmit" :loading="loading">
  11. 受理
  12. </button>
  13. <!-- <view class="btn-submit" @click="bindSubmit">
  14. 受 理
  15. </view> -->
  16. </view>
  17. </template>
  18. <script>
  19. import {
  20. get,
  21. postJ
  22. } from "@/utils/api.js"
  23. import {
  24. tourTallyDetailFn
  25. } from '@/utils/common.js'
  26. import DetailMain from '@/components/DetailMain.vue'
  27. import TurnSendList from '@/components/TurnSendList.vue'
  28. import CellTip from '@/components/CellTip.vue'
  29. import CellInfo from '@/components/CellInfo.vue'
  30. export default {
  31. components: {
  32. DetailMain,
  33. TurnSendList,
  34. CellTip,
  35. CellInfo
  36. },
  37. data() {
  38. return {
  39. pageId: '',
  40. loading: false,
  41. worksheetInfo: null,
  42. tourTallyDetailFn,
  43. executorInfo: null,
  44. redeployCause: ''
  45. }
  46. },
  47. onLoad(options) {
  48. this.pageId = options.id;
  49. this.getInfo();
  50. },
  51. methods: {
  52. getInfo() {
  53. get(this.apiUrl + "/patrol/order/getDetail/" + this.pageId).then(res => {
  54. this.worksheetInfo = res.data;
  55. })
  56. },
  57. bindSubmit() {
  58. this.loading = true
  59. get(this.apiUrl + "/patrol/order/receiveOrder/" + this.pageId).then(res => {
  60. uni.showToast({
  61. title: "受理成功",
  62. icon: "none"
  63. })
  64. setTimeout(() => {
  65. this.loading = false
  66. uni.redirectTo({
  67. url: "../order/order"
  68. })
  69. }, 2000)
  70. })
  71. // if(!this.executorInfo || !this.executorInfo.executorId){
  72. // uni.showToast({
  73. // title:'请选择转派人员',
  74. // icon:'none'
  75. // })
  76. // return
  77. // }
  78. // if(!this.redeployCause){
  79. // uni.showToast({
  80. // title:'请输入转派原因',
  81. // icon:'none'
  82. // })
  83. // return
  84. // }
  85. // let data = {
  86. // recipient: {id:this.executorInfo.executorId,name:this.executorInfo.executorName},
  87. // redeployCause: this.redeployCause,
  88. // worksheetId: this.worksheetInfo.code,
  89. // }
  90. // postJ(this.apiUrl+ "/api/feature/worksheet/redeploy",data).then(res=>{
  91. // setTimeout(()=>{
  92. // this.back(2)
  93. // },2000)
  94. // uni.showToast({
  95. // title:'转派成功',
  96. // })
  97. // }).catch(err=>{
  98. // uni.showToast({
  99. // title:err.message || '转派失败',
  100. // icon:'none'
  101. // })
  102. // })
  103. },
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. input {
  109. text-align: right;
  110. color: $uni-text-color-grey;
  111. font-size: $uni-font-size-base;
  112. }
  113. </style>