repairConfirmation.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <zj-page-layout :hasFooter="true" :isScroll="false">
  3. <view class="card-container">
  4. <block v-if="defaultPath">
  5. <image :src="imageUrl + defaultPath" class="canvasImg" mode="widthFix"></image>
  6. </block>
  7. <block v-else>
  8. <image :src="path" class="canvasImg" mode="widthFix"></image>
  9. <l-painter
  10. isCanvasToTempFilePath
  11. pathType="url"
  12. @success="canvasSuccess($event)"
  13. hidden
  14. css="background: #ffffff; border-radius: 20rpx; padding: 0 30rpx;"
  15. >
  16. <template>
  17. <l-painter-view css="text-align: center; line-height: 140rpx;">
  18. <l-painter-text text="确认书" css="font-size: 40rpx; font-weight: 500;" />
  19. </l-painter-view>
  20. <template v-if="type == 'gz'">
  21. <l-painter-view css="text-align: left; line-height: 38rpx;text-indent: 2em;">
  22. <l-painter-text
  23. text="鉴于格力电器售后服务过程中存在用户未自行提供产品标配之外辅材配件(如:空气开关、铜管、支架、地架等格力指定专供辅材)需要用户额外付费配置的现象,按照珠海格力公司售后服务要求:为避免安装维修人员使用劣质辅材配件影响产品质量有损品牌名誉以及乱收费从而扰乱格力售后服务市场,本人承诺:本人务必在指定售后服务网点自行采购辅材配件以供备用,在从事安装工单或维修工单中涉及产品标配以外辅材配件按照指导价销售给用户并需要将应当收取用户的辅材配件费用录入系统内对应工单,并要用户扫码付款即“电子支付”后,再由广州嘉讯茂机电工程有限公司通过微信分账形式直接支付到本人微信钱包中。"
  24. css="font-size: 26rpx;text-indent: 2em;"
  25. />
  26. </l-painter-view>
  27. <l-painter-view css="text-align: left; line-height: 38rpx;text-indent: 2em;">
  28. <l-painter-text
  29. text="本人通过售卖自行购入的安装维修服务过程中需使用到非产品标配辅材配件,此费用由用户在格力售后系统平台结算后,平台通过微信分账形式返还给乙方,产生的微信支付手续费由乙方自行承担。本人已清楚知晓收到的微信分账结算费用属于辅材配件费用,不属于本人履行安装维修服务而获取的工资报酬组成。广州嘉讯茂机电工程有限公司不为本人向用户收取的辅材配件费用承担任何责任。"
  30. css="font-size: 26rpx;text-indent: 2em;"
  31. />
  32. </l-painter-view>
  33. </template>
  34. <template v-if="type == 'fs'">
  35. <l-painter-view css="text-align: left; line-height: 38rpx;text-indent: 2em;">
  36. <l-painter-text
  37. text="鉴于格力电器售后服务过程中存在用户未自行提供产品标配之外辅材配件(如:空气开关、铜管、支架、地架等格力指定专供辅材)需要用户额外付费配置的现象,按照珠海格力公司售后服务要求:为避免安装维修人员使用劣质辅材配件影响产品质量有损品牌名誉以及乱收费从而扰乱格力售后服务市场,本人承诺:本人务必在指定售后服务网点自行采购辅材配件以供备用,在从事安装工单或维修工单中涉及产品标配以外辅材配件按照指导价销售给用户并需要将应当收取用户的辅材配件费用录入系统内对应工单,并要用户扫码付款即“电子支付”后,再由佛山嘉讯茂机电工程有限公司通过微信分账形式直接支付到本人微信钱包中。"
  38. css="font-size: 26rpx;text-indent: 2em;"
  39. />
  40. </l-painter-view>
  41. <l-painter-view css="text-align: left; line-height: 38rpx;text-indent: 2em;">
  42. <l-painter-text
  43. text="本人通过售卖自行购入的安装维修服务过程中需使用到非产品标配辅材配件,此费用由用户在格力售后系统平台结算后,平台通过微信分账形式返还给乙方,产生的微信支付手续费由乙方自行承担。本人已清楚知晓收到的微信分账结算费用属于辅材配件费用,不属于本人履行安装维修服务而获取的工资报酬组成。佛山嘉讯茂机电工程有限公司不为本人向用户收取的辅材配件费用承担任何责任。"
  44. css="font-size: 26rpx;text-indent: 2em;"
  45. />
  46. </l-painter-view>
  47. </template>
  48. <l-painter-view>
  49. <l-painter-text text="服务人员:" css="font-size: 28rpx; color: #666666;margin-top:30rpx;" />
  50. <l-painter-text
  51. :text="`${userInfo.nickName || ''}(${userInfo.workerNumber || ''})`"
  52. css="font-size: 28rpx;"
  53. />
  54. </l-painter-view>
  55. <l-painter-view css="margin-top: 20rpx;">
  56. <l-painter-text text="签署日期:" css="font-size: 28rpx; color: #666666;" />
  57. <l-painter-text :text="getNowDate()" css="font-size: 28rpx;" />
  58. </l-painter-view>
  59. <l-painter-view css="margin-top: 20rpx;">
  60. <l-painter-text text="工程师签名:" css="font-size: 28rpx; color: #666666;" />
  61. </l-painter-view>
  62. <template v-if="signNameUrl">
  63. <l-painter-image
  64. :src="signNameUrl"
  65. css="transform:rotate(270deg); object-fit: contain; margin-top: 20rpx; width: 600rpx; height: 400rpx;"
  66. />
  67. </template>
  68. <template v-else>
  69. <l-painter-view css="height: 600rpx"></l-painter-view>
  70. </template>
  71. </template>
  72. </l-painter>
  73. </block>
  74. </view>
  75. <template slot="footer">
  76. <view class="footer-btn-group" v-if="!isFinishSign && !defaultPath">
  77. <u-button text="点击签名" type="primary" size="large" @click="navToPage(`/pages/signName`)"></u-button>
  78. </view>
  79. <view class="footer-btn-group" v-else>
  80. <u-button text="重新签名" type="primary" size="large" plain @click="navToPage(`/pages/signName`)"></u-button>
  81. <u-button text="确认提交" type="primary" size="large" @click="submitData"></u-button>
  82. </view>
  83. </template>
  84. </zj-page-layout>
  85. </template>
  86. <script>
  87. import lPainter from '@/components/lime-painter/components/l-painter/l-painter.vue'
  88. import lPainterView from '@/components/lime-painter/components/l-painter-view/l-painter-view.vue'
  89. import lPainterText from '@/components/lime-painter/components/l-painter-text/l-painter-text.vue'
  90. import lPainterImage from '@/components/lime-painter/components/l-painter-image/l-painter-image.vue'
  91. import store from '@/store/index.js'
  92. import { platform } from '@/common/utils/index'
  93. import { mini_env } from '@/common/utils/util'
  94. export default {
  95. components: {
  96. lPainter,
  97. lPainterView,
  98. lPainterText,
  99. lPainterImage
  100. },
  101. data() {
  102. return {
  103. imageUrl: this.$imageUrl,
  104. userInfo: {},
  105. signNameUrl: '',
  106. defaultPath: '',
  107. path: '',
  108. isFinishSign: false,
  109. type: ''
  110. }
  111. },
  112. async onLoad({ url, type }) {
  113. this.type = type
  114. this.userInfo = await this.$getUserInfo()
  115. if (url) {
  116. this.defaultPath = url
  117. }
  118. uni.$on('finishSign', async data => {
  119. this.defaultPath = ''
  120. this.signNameUrl = data
  121. })
  122. },
  123. onUnload() {
  124. uni.$off('finishSign')
  125. },
  126. methods: {
  127. getNowDate() {
  128. const date = new Date()
  129. let year = date.getFullYear()
  130. let month = date.getMonth() + 1
  131. let day = date.getDate()
  132. month = month > 9 ? month : '0' + month
  133. day = day > 9 ? day : '0' + day
  134. return `${year}年${month}月${day}日`
  135. },
  136. canvasSuccess(val) {
  137. if (this.signNameUrl) {
  138. this.isFinishSign = true
  139. }
  140. this.path = val
  141. },
  142. navToPage(url) {
  143. uni.navigateTo({
  144. url
  145. })
  146. },
  147. async submitData() {
  148. console.log(this.signNameUrl)
  149. mini_env(bool => {
  150. uni.uploadFile({
  151. header: {
  152. 'x-token': store.getters.token,
  153. APPID: store.getters.appId,
  154. Program: {
  155. H5: 'wap',
  156. APP: 'app',
  157. APPNVUE: 'app',
  158. WEIXIN: 'miniProgram'
  159. }[platform()],
  160. source: bool ? 'A' : 'B',
  161. miniOpenId: store.getters.miniOpenId,
  162. sharerOpenId: store.getters.sharerOpenId
  163. },
  164. url: `${process.env.VUE_APP_BASE_URL + process.env.VUE_APP_BASE_API}/worker/ocr/handwriting`,
  165. files: [
  166. {
  167. name: 'file',
  168. uri: this.path
  169. },
  170. {
  171. name: 'signFile',
  172. uri: this.signNameUrl
  173. }
  174. ],
  175. formData: {
  176. type: this.type,
  177. signFile2: this.signNameUrl
  178. },
  179. success: uploadFileRes => {
  180. if (JSON.parse(uploadFileRes.data)?.data) {
  181. this.$navToPage(
  182. {
  183. url: '/pages/index/index'
  184. },
  185. 'switchTab'
  186. )
  187. } else {
  188. uni.showModal({
  189. title: '提交失败',
  190. content: '您的签名不符合要求,请重新签署!',
  191. showCancel: false,
  192. confirmText: '知道了',
  193. success: function (res) {}
  194. })
  195. }
  196. }
  197. })
  198. })
  199. }
  200. }
  201. }
  202. </script>
  203. <style lang="scss" scoped>
  204. .card-container {
  205. @include zj-card;
  206. margin: 30rpx;
  207. .canvasImg {
  208. width: 100%;
  209. }
  210. .title {
  211. font-size: 40rpx;
  212. font-weight: 500;
  213. line-height: 140rpx;
  214. text-align: center;
  215. }
  216. .main {
  217. flex: 1;
  218. padding-bottom: 30rpx;
  219. .row {
  220. padding: 15rpx 0;
  221. display: flex;
  222. align-items: center;
  223. color: $reg-font;
  224. ::v-deep .u-button {
  225. width: 180rpx;
  226. height: 68rpx;
  227. }
  228. text {
  229. color: $main-font;
  230. font-weight: 500;
  231. }
  232. }
  233. }
  234. .bottom {
  235. padding-bottom: 60rpx;
  236. .text {
  237. color: $sec-font;
  238. }
  239. .info {
  240. margin-top: 30rpx;
  241. view {
  242. color: $minor-color;
  243. line-height: 36rpx;
  244. }
  245. }
  246. }
  247. }
  248. </style>