shopTourOver.vue 2.3 KB

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