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

201 lines
6.0 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 m10">
  6. <view class="re-from-label">车辆类型</view>
  7. <picker class="flex re-from-label" style="color: #9E9E9E;" :range="types" @change="typeSelect(car, $event)">
  8. <span v-if="!car.type">请选择</span>
  9. <view style="color: #0d0d0d;" v-if="car.type">{{ car.type }}</view>
  10. <uni-icons v-if="!car.type" type="down" size="28rpx" color="#9E9E9E"></uni-icons>
  11. </picker>
  12. </view>
  13. <view class="flex-sb">
  14. <view class="re-from-label">设备轴数</view>
  15. <picker class="flex re-from-label" style="color: #9E9E9E;" :range="mis" @change="miSelect(car, $event)">
  16. <span v-if="!car.mi">请选择</span>
  17. <view style="color: #0d0d0d;" v-if="car.mi">{{ car.mi }}</view>
  18. <uni-icons v-if="!car.mi" type="down" size="28rpx" color="#9E9E9E"></uni-icons>
  19. </picker>
  20. </view>
  21. </view>
  22. <view class="re-card-p32">
  23. <view class="flex-sb">
  24. <view class="re-from-label">请点击下方图片上传车辆照片</view>
  25. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/car1.png')">查看示例</view>
  26. </view>
  27. <input-image @success="(url) => car.carimage = url" :height="456"/>
  28. <view class="re-card-context">
  29. 请在<span>支腿收起状态下在左前方45度角</span>进行拍摄
  30. </view>
  31. </view>
  32. <view class="re-card-p32">
  33. <view class="flex-sb">
  34. <view class="re-from-label">请点击下方图片上传车辆行驶证</view>
  35. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/car2.png')">查看示例</view>
  36. </view>
  37. <input-image @success="(url) => car.xszaimage = url" :height="342"/>
  38. <input-image @success="(url) => car.xszbimage = url" :height="342"/>
  39. <view class="re-card-context">
  40. <p>中华人民共和国机动车<span>行驶证</span>正反面</p>
  41. <p>拍摄时确保行驶证<span>边框完整字迹清晰亮度均匀无遮挡涂鸦</span></p>
  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/car4.png')">查看示例</view>
  48. </view>
  49. <input-image @success="(url) => car.jqximage = url" :height="800"/>
  50. <view class="re-card-context">
  51. <p>您需要提供有效期内<span>机动车交通事故责任强制保险单</span>的纸质保单正面或电子保单截图</p>
  52. <p>上传时需确保截图内包含<span>车牌号车架号以及有效期</span>等关键信息</p>
  53. </view>
  54. </view>
  55. <view class="re-card-p32">
  56. <view class="flex-sb">
  57. <view class="re-from-label">请点击下方图片上传车辆商业险截图</view>
  58. <view class="re-card-show" @click="clickShowExample('https://relief.oss-cn-hangzhou.aliyuncs.com/car5.png')">查看示例</view>
  59. </view>
  60. <input-image @success="(url) => car.syximage = url" :height="800"/>
  61. <view class="re-card-context">
  62. <p>您需要提供有效期内<span>机动车商业保险保险单</span>的纸质保单正面或电子保单截图</p>
  63. <p>上传时需确保截图内包含<span>车牌号车架号以及有效期</span>等关键信息</p>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="re-end-pand">
  68. <button @click="clickSaveAndBack">上传保存</button>
  69. </view>
  70. <show-example ref="showe" :show="show" :url="url" @close="show=false"/>
  71. </view>
  72. </template>
  73. <script>
  74. import InputImage from "/components/input-image.vue"
  75. import ShowExample from "/components/show-example.vue"
  76. export default {
  77. components: {
  78. InputImage,
  79. ShowExample
  80. },
  81. data() {
  82. return {
  83. show: false,
  84. url: "",
  85. idx: "",
  86. car: {
  87. carimage:"",
  88. xszaimage:"",
  89. xszbimage:"",
  90. jqximage:"",
  91. syximage:""
  92. },
  93. mis: [],
  94. mia: [{mi: '43米', price: '1.2'}],
  95. types: ['泵车','搅拌车'],
  96. }
  97. },
  98. onLoad() {
  99. this.loadmi()
  100. },
  101. methods: {
  102. loadmi(){
  103. this.mis = []
  104. this.$httpGet("/api/mis", {}, (res) => {
  105. if(res.data){
  106. this.mia = this.$utils.toArray(res.data)
  107. this.mia.forEach(ele => {
  108. this.mis.push(ele.mi)
  109. })
  110. }
  111. })
  112. },
  113. miSelect(car, event){
  114. car.mi = this.mis[event.detail.value]
  115. },
  116. typeSelect(car, event){
  117. car.type = this.types[event.detail.value]
  118. },
  119. clickShowExample(url){
  120. if(url){
  121. this.url = url
  122. } else {
  123. this.url = "https://relief.oss-cn-hangzhou.aliyuncs.com/yx.jpg"
  124. }
  125. this.show = true
  126. },
  127. clickSaveAndBack(){
  128. if(!this.car.carimage){
  129. uni.showToast({ icon: "none", title: "车辆照片缺失" })
  130. return
  131. }
  132. if(!this.car.xszaimage || !this.car.xszbimage){
  133. uni.showToast({ icon: "none", title: "行驶证照片缺失" })
  134. return
  135. }
  136. if(!this.car.jqximage){
  137. uni.showToast({ icon: "none", title: "交强险照片缺失" })
  138. return
  139. }
  140. if(!this.car.syximage){
  141. uni.showToast({ icon: "none", title: "商业险照片缺失" })
  142. return
  143. }
  144. this.clickSubmit()
  145. },
  146. clickSubmit(){
  147. let car = this.car
  148. car.id = this.$utils.generateUUID()
  149. car.enterId = uni.getStorageSync("enter_id")
  150. car.status = 0
  151. car.mi = "2轴泵车"
  152. car.type = "泵车"
  153. car.area = uni.getStorageSync("area")
  154. this.$httpPost("/api/register/car", car, (resp) => {
  155. uni.showToast({
  156. icon:'none', title:"保存成功"
  157. })
  158. uni.navigateBack({ delta: 1 })
  159. })
  160. }
  161. }
  162. }
  163. </script>
  164. <style>
  165. page {
  166. background-color: #F5F5F5;
  167. }
  168. .cr {
  169. min-height: calc(88vh);
  170. }
  171. /deep/ uni-radio .uni-radio-input{
  172. background-color: #F40000 !important;
  173. border-color: #F40000 !important;
  174. }
  175. /deep/ uni-radio .uni-radio-input:empty{
  176. background-color: #ffffff !important;
  177. border-color: #d1d1d1 !important;
  178. }
  179. .re-from-car{
  180. width: 72rpx;
  181. height: 60rpx;
  182. margin: 0 16rpx -20rpx 0;
  183. }
  184. </style>