混凝土运输管理微信小程序、替班
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.

235 lines
7.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/one07.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/one11.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/one12.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/one13.png')">查看示例</view>
  38. </view>
  39. <input-image @success="(url) => from.d = url" :height="456"/>
  40. <view class="re-card-context">
  41. 需拍摄<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/one14.png')">查看示例</view>
  48. </view>
  49. <input-image @success="(url) => from.e = url" :height="456"/>
  50. <view class="re-card-context">
  51. 需拍摄<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/one05.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/one07.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="flex-sb">
  76. <view class="re-from-label">请拍摄液压油位</view>
  77. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one06.png')">查看示例</view>
  78. </view>
  79. <input-image @success="(url) => from.h = url" :height="456"/>
  80. <view class="re-card-context">
  81. 需拍摄<span>车辆液压油位</span>照片以保证车辆安全状况
  82. </view>
  83. </view>
  84. <view class="re-card-p32">
  85. <view class="flex-sb">
  86. <view class="re-from-label">请拍摄计时开始照片</view>
  87. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/one15.png')">查看示例</view>
  88. </view>
  89. <input-image @success="(url) => from.i = url" :height="456"/>
  90. <view class="re-card-context">
  91. 需拍摄<span>开始计时的照片</span>以保证您的利益
  92. </view>
  93. </view>
  94. <view class="re-card-p32">
  95. <view class="re-from-label">备注<span>选填</span></view>
  96. <textarea v-model="from.remark" class="re-card-textarea inpit" placeholder=" 如在施工过程中发现问题,请用文字描述。"/>
  97. </view>
  98. </view>
  99. <view class="re-end-pand">
  100. <button @click="clickSaveAndBack">提交保存</button>
  101. </view>
  102. <show-example ref="showe" :show="show" :url="url" @close="show=false"/>
  103. </view>
  104. </template>
  105. <script>
  106. import InputImage from "/components/input-image.vue"
  107. import ShowExample from "/components/show-example.vue"
  108. export default {
  109. components: {
  110. InputImage,
  111. ShowExample
  112. },
  113. data() {
  114. return {
  115. show: false,
  116. url: "",
  117. orderId: "",
  118. from: {
  119. a:"",
  120. b:"",
  121. c:"",
  122. d:"",
  123. e:"",
  124. f:"",
  125. g:"",
  126. h:"",
  127. i:"",
  128. j:"",
  129. k:"",
  130. remark: ""
  131. },
  132. }
  133. },
  134. onLoad(opn) {
  135. this.orderId = opn.id
  136. },
  137. methods: {
  138. clickShowExample(url){
  139. if(url){
  140. this.url = url
  141. } else {
  142. this.url = "https://relief.oss-cn-hangzhou.aliyuncs.com/yx.jpg"
  143. }
  144. this.show = true
  145. },
  146. clickSaveAndBack(){
  147. if(!this.from.a || !this.from.b || !this.from.c || !this.from.d
  148. ||!this.from.e || !this.from.f || !this.from.g || !this.from.h
  149. ||!this.from.i){
  150. uni.showToast({ icon: "none", title: "请按照要求拍摄上传照片" })
  151. return
  152. }
  153. //if(!this.from.remark){
  154. // uni.showToast({ icon: "none", title: "备注为必填" })
  155. // return
  156. //}
  157. this.doSubmit()
  158. },
  159. doSubmit(){
  160. const _this = this;
  161. this.from.id = this.$utils.generateUUID()
  162. this.from.status = 1
  163. this.from.step = 2
  164. this.from.orderId = this.orderId
  165. console.log(this.from);
  166. this.$httpPost("/api/order/image", this.from, function(res) {
  167. console.log('[/order/image]', res);
  168. if(res.data && res.data>0){
  169. _this.$httpPost("/api/order/status", _this.from, function(res) {
  170. console.log('[/order/status]', res);
  171. if(res.data){
  172. uni.showToast({ icon: "success", title: "提交成功" })
  173. setTimeout(()=>{
  174. uni.navigateBack({ delta: 1 });
  175. }, 1500)
  176. }
  177. })
  178. } else {
  179. uni.showModal({
  180. title: "提交失败",
  181. content: `本次提交失败,您可以停留在本页面,稍后再次尝试提交,错误码[${res.data}]`,
  182. success: (res) => {
  183. if(res.confirm === true){
  184. }
  185. }
  186. })
  187. }
  188. })
  189. }
  190. }
  191. }
  192. </script>
  193. <style>
  194. page {
  195. background-color: #F5F5F5;
  196. }
  197. .cr {
  198. min-height: calc(88vh);
  199. }
  200. /deep/ uni-radio .uni-radio-input{
  201. background-color: #F40000 !important;
  202. border-color: #F40000 !important;
  203. }
  204. /deep/ uni-radio .uni-radio-input:empty{
  205. background-color: #ffffff !important;
  206. border-color: #d1d1d1 !important;
  207. }
  208. .re-from-car{
  209. width: 72rpx;
  210. height: 60rpx;
  211. margin: 0 16rpx -20rpx 0;
  212. }
  213. </style>