shopTourOver.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="shopTourOver-wrap">
  3. <!-- 店长签名 -->
  4. <view class="autograph-con">
  5. <text class="autograph-tit">店长签名:</text>
  6. <view class="autograph-main">
  7. <autograph-to-pic ref="dz" canvasId="handWriting-dz"/>
  8. </view>
  9. </view>
  10. <!-- 巡店人签名 -->
  11. <view class="autograph-con">
  12. <text class="autograph-tit">巡店人签名:</text>
  13. <view class="autograph-main">
  14. <autograph-to-pic ref="xdr" canvasId="handWriting-xd" />
  15. </view>
  16. </view>
  17. <u-button type="primary" shape="circle" class="submit-btn" @click="submitFun">提交</u-button>
  18. </view>
  19. </template>
  20. <script>
  21. import AutographToPic from '@/components/autograph-to-pic/autograph-to-pic.vue'
  22. import {submitTask} from '@/api/task'
  23. import { clzConfirm,saveBase64ToAliOss } from '@/libs/tools'
  24. export default{
  25. components: {
  26. AutographToPic
  27. },
  28. data(){
  29. return{
  30. taskId: '',
  31. inspectorSign:'', // 巡店人签名
  32. storeManagerSign:'', // 店长签名
  33. }
  34. },
  35. onLoad(opts) {
  36. this.taskId = opts.taskId
  37. },
  38. methods: {
  39. // 提交本次任务
  40. submitFun(){
  41. const _this = this
  42. console.log(_this.$refs.dz.isEmpty)
  43. const dzIsEmpty = _this.$refs.dz.isEmpty
  44. const xdrIsEmpty = _this.$refs.xdr.isEmpty
  45. if(dzIsEmpty){
  46. uni.showToast({
  47. icon:'none',
  48. title:'店长未签名'
  49. })
  50. return
  51. }
  52. if(xdrIsEmpty){
  53. uni.showToast({
  54. icon:'none',
  55. title:'巡店人未签名'
  56. })
  57. return
  58. }
  59. clzConfirm({
  60. title: '提示',
  61. content: '确定提交本次巡店?',
  62. success: function(res) {
  63. if (res.confirm || res.index == 0) {
  64. // 上传图片后提交代码
  65. //_this.submitTask()
  66. }
  67. }
  68. });
  69. },
  70. submitTask(){
  71. submitTask({
  72. id: _this.taskId,
  73. inspectorSign: _this.inspectorSign,
  74. storeManagerSign: _this.storeManagerSign
  75. }).then(ret=>{
  76. console.log(ret)
  77. if(ret.status == 200){
  78. // 关闭上页
  79. uni.$emit("closeTour",1)
  80. // 打开完成页面
  81. uni.redirectTo({
  82. url:"/pages/shopTourCompleted/shopTourCompleted?taskId="+_this.taskId
  83. })
  84. }
  85. uni.showToast({
  86. icon:'none',
  87. title: ret.message
  88. })
  89. })
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. page{
  96. background-color: #f8f8f8;
  97. height: calc(100vh - 44px);
  98. }
  99. .shopTourOver-wrap{
  100. height: 100%;
  101. .autograph-con{
  102. margin: 30upx 30upx 0;
  103. border-radius: 12upx;
  104. background-color: #fff;
  105. .autograph-tit{
  106. display: block;
  107. padding: 20upx 30upx;
  108. }
  109. }
  110. .submit-btn{
  111. width: 80%;
  112. margin: 60upx auto 40upx;
  113. }
  114. }
  115. </style>