shopTourOver.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 canvasId="handWriting-dz" :isEmpty="isEmpty" />
  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 canvasId="handWriting-xd" :isEmpty="isEmpty" />
  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. isEmpty: [ // 是否为空判断
  31. {name: 'handWriting-dz', state: true},
  32. {name: 'handWriting-xd', state: true}
  33. ],
  34. taskId: '',
  35. inspectorSign:'', // 巡店人签名
  36. storeManagerSign:'', // 店长签名
  37. }
  38. },
  39. onLoad(opts) {
  40. this.taskId = opts.taskId
  41. },
  42. methods: {
  43. // 提交本次任务
  44. submitFun(){
  45. const _this = this;
  46. clzConfirm({
  47. title: '提示',
  48. content: '确定提交本次巡店?',
  49. success: function(res) {
  50. if (res.confirm || res.index == 0) {
  51. submitTask({
  52. id: _this.taskId,
  53. inspectorSign: _this.inspectorSign,
  54. storeManagerSign: _this.storeManagerSign
  55. }).then(ret=>{
  56. console.log(ret)
  57. if(ret.status == 200){
  58. // 关闭上页
  59. uni.$emit("closeTour",1)
  60. // 打开完成页面
  61. uni.redirectTo({
  62. url:"/pages/shopTourCompleted/shopTourCompleted?taskId="+_this.taskId
  63. })
  64. }
  65. uni.showToast({
  66. icon:'none',
  67. title: ret.message
  68. })
  69. })
  70. }
  71. }
  72. });
  73. },
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. page{
  79. background-color: #f8f8f8;
  80. height: calc(100vh - 44px);
  81. }
  82. .shopTourOver-wrap{
  83. height: 100%;
  84. .autograph-con{
  85. margin: 30upx 30upx 0;
  86. border-radius: 12upx;
  87. background-color: #fff;
  88. .autograph-tit{
  89. display: block;
  90. padding: 20upx 30upx;
  91. }
  92. }
  93. .submit-btn{
  94. width: 80%;
  95. margin: 60upx auto 40upx;
  96. }
  97. }
  98. </style>