混凝土运输管理微信小程序、替班
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

213 lines
6.2 KiB

1 week ago
  1. <template>
  2. <view class="content">
  3. <view class="cr mt40">
  4. <view class="re-card-p32">
  5. <view class="flex-sb">
  6. <view class="re-from-label">请拍摄计时结束照片</view>
  7. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one19.png')">查看示例</view>
  8. </view>
  9. <input-image @success="(url) => from.a = url" :height="456"/>
  10. <view class="re-card-context">
  11. 需拍摄<span>计时结束计时</span>照片以保证您的利益
  12. </view>
  13. </view>
  14. <view class="re-card-p32">
  15. <view class="flex-sb">
  16. <view class="re-from-label">请拍摄抖料清洗照片</view>
  17. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one17.png')">查看示例</view>
  18. </view>
  19. <input-image @success="(url) => from.b = url" :height="456"/>
  20. <view class="re-card-context">
  21. 需拍摄<span>抖料清洗</span>照片
  22. </view>
  23. </view>
  24. <view class="re-card-p32">
  25. <view class="flex-sb">
  26. <view class="re-from-label">请拍摄车身照片</view>
  27. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one19.png')">查看示例</view>
  28. </view>
  29. <input-image @success="(url) => from.c = url" :height="456"/>
  30. <view class="re-card-context">
  31. 需拍摄<span>车身照片</span>照片以保证您的利益
  32. </view>
  33. </view>
  34. <view class="re-card-p32">
  35. <view class="flex-sb">
  36. <view class="re-from-label">请拍摄仪表盘照片</view>
  37. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one01.png')">查看示例</view>
  38. </view>
  39. <input-image @success="(url) => from.d = url" :height="456"/>
  40. <view class="re-card-context">
  41. 需拍摄<span>仪表盘</span>照片<span>数值清晰无倾斜</span>以保证您的利益
  42. </view>
  43. </view>
  44. <view class="re-card-p32">
  45. <view class="flex-sb">
  46. <view class="re-from-label">请拍摄签单照片</view>
  47. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one16.png')">查看示例</view>
  48. </view>
  49. <input-image @success="(url) => from.e = url" :height="456"/>
  50. <view class="re-card-context">
  51. 需拍摄<span>签单</span>照片尽量保证<span>字体不倾斜文字清晰</span>以保证您的后续利益
  52. </view>
  53. </view>
  54. <view class="re-card-p32">
  55. <view class="flex-sb">
  56. <view class="re-from-label">请拍摄补方小票照片</view>
  57. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one16.png')">查看示例</view>
  58. </view>
  59. <input-image @success="(url) => from.f = url" :height="456"/>
  60. <view class="re-card-context">
  61. 需拍摄补方小票照片<span>请保证字迹清晰图片完整</span>照片以保证您的利益
  62. </view>
  63. </view>
  64. <view class="re-card-p32">
  65. <view class="flex-sb">
  66. <view class="re-from-label">请拍摄车辆入库交车照片</view>
  67. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one18.png')">查看示例</view>
  68. </view>
  69. <input-image @success="(url) => from.g = url" :height="456"/>
  70. <view class="re-card-context">
  71. 需拍摄<span>车辆入库交车照片</span>以保证您的利益
  72. </view>
  73. </view>
  74. <view class="re-card-p32">
  75. <view class="re-from-label">备注<span>选填</span></view>
  76. <textarea v-model="from.remark" class="re-card-textarea inpit" placeholder=" 如在施工过程中发现问题,请用文字描述。"/>
  77. </view>
  78. </view>
  79. <view class="re-end-pand">
  80. <button @click="clickSaveAndBack">提交保存</button>
  81. </view>
  82. <show-example ref="showe" :show="show" :url="url" @close="show=false"/>
  83. </view>
  84. </template>
  85. <script>
  86. import InputImage from "/components/input-image.vue"
  87. import ShowExample from "/components/show-example.vue"
  88. export default {
  89. components: {
  90. InputImage,
  91. ShowExample
  92. },
  93. data() {
  94. return {
  95. show: false,
  96. url: "",
  97. orderId: "",
  98. from: {
  99. a:"",
  100. b:"",
  101. c:"",
  102. d:"",
  103. e:"",
  104. f:"",
  105. g:"",
  106. h:"",
  107. i:"",
  108. j:"",
  109. k:"",
  110. remark: ""
  111. },
  112. }
  113. },
  114. onLoad(opn) {
  115. this.orderId = opn.id
  116. },
  117. methods: {
  118. clickShowExample(url){
  119. if(url){
  120. this.url = url
  121. } else {
  122. this.url = "https://relief.oss-cn-hangzhou.aliyuncs.com/yx.jpg"
  123. }
  124. this.show = true
  125. },
  126. clickSaveAndBack(){
  127. if(!this.from.a || !this.from.b || !this.from.c || !this.from.d
  128. ||!this.from.e || !this.from.f || !this.from.g){
  129. uni.showToast({ icon: "none", title: "请按照要求拍摄上传照片" })
  130. return
  131. }
  132. //if(!this.from.remark){
  133. // uni.showToast({ icon: "none", title: "备注为必填" })
  134. // return
  135. //}
  136. this.doSubmit()
  137. },
  138. doSubmit(){
  139. const _this = this;
  140. this.from.id = this.$utils.generateUUID()
  141. this.from.status = 2
  142. this.from.step = 3
  143. this.from.orderId = this.orderId
  144. console.log(this.from);
  145. this.$httpPost("/api/order/image", this.from, function(res) {
  146. console.log('[/order/image]', res);
  147. if(res.data && res.data>0){
  148. _this.$httpPost("/api/order/status", _this.from, function(res) {
  149. console.log('[/order/status]', res);
  150. if(res.data){
  151. uni.showToast({ icon: "success", title: "提交成功" })
  152. setTimeout(()=>{
  153. uni.navigateBack({ delta: 1 });
  154. }, 1500)
  155. }
  156. })
  157. } else {
  158. uni.showModal({
  159. title: "提交失败",
  160. content: `本次提交失败,您可以停留在本页面,稍后再次尝试提交,错误码[${res.data}]`,
  161. success: (res) => {
  162. if(res.confirm === true){
  163. }
  164. }
  165. })
  166. }
  167. })
  168. }
  169. }
  170. }
  171. </script>
  172. <style>
  173. page {
  174. background-color: #F5F5F5;
  175. }
  176. .cr {
  177. min-height: calc(88vh);
  178. }
  179. /deep/ uni-radio .uni-radio-input{
  180. background-color: #F40000 !important;
  181. border-color: #F40000 !important;
  182. }
  183. /deep/ uni-radio .uni-radio-input:empty{
  184. background-color: #ffffff !important;
  185. border-color: #d1d1d1 !important;
  186. }
  187. .re-from-car{
  188. width: 72rpx;
  189. height: 60rpx;
  190. margin: 0 16rpx -20rpx 0;
  191. }
  192. </style>