confirmUnloading.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. <!-- 确认卸车 -->
  2. <template>
  3. <view class="content">
  4. <view class="content2">
  5. <view class="level2-title">基本信息</view>
  6. <view class='row-between'>
  7. <view class="row-left-text">订单编号</view>
  8. <view class="row-right-text">{{detailData.orderNo}}</view>
  9. </view>
  10. <view class='row-between'>
  11. <view class="row-left-text">货主</view>
  12. <view class="row-right-text">{{detailData.cargoOwner}}</view>
  13. </view>
  14. <view class='row-between'>
  15. <view class="row-left-text">货主单位</view>
  16. <view class="row-right-text">{{detailData.compName?detailData.compName:'个人货主'}}</view>
  17. </view>
  18. <view class='row-between'>
  19. <view class="row-left-text">发货地</view>
  20. <view class="row-right-text place">
  21. {{detailData.sendPrivate}}{{detailData.sendCity}}{{detailData.sendArea}}{{detailData.sendDetailedAddress}}
  22. </view>
  23. </view>
  24. <view class='row-between'>
  25. <view class="row-left-text">卸货地</view>
  26. <view class="row-right-text place">
  27. {{detailData.unloadPrivate}}{{detailData.unloadCity}}{{detailData.unloadArea}}{{detailData.unloadDetailedAddress}}
  28. </view>
  29. </view>
  30. <view class='row-between'>
  31. <view class="row-left-text">货名</view>
  32. <view class="row-right-text">{{detailData.goodsName}}</view>
  33. </view>
  34. <view class='row-between'>
  35. <view class="row-left-text">运费</view>
  36. <view class="row-right-text">{{detailData.freight}}{{detailData.billingMethod==0?'元/吨':'元/车'}}</view>
  37. </view>
  38. </view>
  39. <view class="content2">
  40. <view class="level2-title">卸车信息</view>
  41. <view class='row-between'>
  42. <view class="row-left-text">车牌号</view>
  43. <view class="row-right-text">{{detailData.carNumber}}</view>
  44. </view>
  45. <view class='row-between'>
  46. <view class="row-left-text">卸车净重(吨)</view>
  47. <view class="row-right-text">
  48. <u--input placeholder="请输入卸车净重" border="none" type="number" v-model="detailData.unloadingWeight" inputAlign='right'
  49. clearable></u--input></view>
  50. </view>
  51. <!-- <view class='row-between'>
  52. <view class="row-left-text">卸车日期</view>
  53. <view class="row-right-text">{{detailData.carrierInfo.unloadingDate}}</view>
  54. </view> -->
  55. <view class="row-between">
  56. <view class="left-text">卸车日期</view>
  57. <view class="row-right-text" @click="selectUnloadingDate">
  58. {{detailData.carrierInfo.unloadingDate?detailData.carrierInfo.unloadingDate:'选择卸车日期'}}
  59. </view>
  60. </view>
  61. <!-- <view class='row-between'>
  62. <view class="row-left-text">合计运费(元)</view>
  63. <view style='position:relative;'>
  64. <input :style="{color:this.detailData.freight!=detailData.totalFreight?'red':'#000'}" class="totalFreight-input" placeholder="输入合计运费" v-model="detailData.totalFreight"
  65. type="number" />
  66. <image @click='eliminate' class='close' v-if='detailData.totalFreight.length>0' src="../../static/images/order/guanbi.png" mode=""></image>
  67. </view>
  68. </view> -->
  69. <view class='row-between'>
  70. <view class="row-left-text">定位</view>
  71. <view style='font-size:14px;' class="flex align-center">
  72. {{detailData.carrierInfo.unloadCity}}{{detailData.carrierInfo.unloadArea}}
  73. <view class="sx-style" @click.stop="getLngLat()">刷新</view>
  74. </view>
  75. </view>
  76. <view class='s-flex'>
  77. <view class="row-left-text" style="margin:20rpx 0;">上传卸车照片(1-3张)</view>
  78. <u-upload class="uview-upload" :fileList="fileList1" @afterRead="afterRead($event)" @delete="deletePic"
  79. name="1" multiple :maxCount="3"></u-upload>
  80. </view>
  81. <view class='s-flex'>
  82. <view class="row-left-text" style="margin:20rpx 0;">上传回单照片(磅单)</view>
  83. <u-upload class="uview-upload" :fileList="fileList2" @afterRead="afterRead1($event)" @delete="deletePic1"
  84. name="2" multiple :maxCount="3"></u-upload>
  85. </view>
  86. </view>
  87. <view class="bottom-btn">
  88. <view class="store" @click="$u.throttle(submit(1), 1000)">暂存</view>
  89. <view class="submit" @click="$u.throttle(submit(3), 1000)">提交</view>
  90. </view>
  91. <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
  92. :showCancelButton='true' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
  93. @cancel="cancelClick"></u-modal>
  94. <!--<u- picker :show="isShowValidity" :defaultIndex='defaultIndex' ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
  95. :closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
  96. </u-picker> -->
  97. <!-- :endDate="array" -->
  98. <itmister-date-picker :dateStatus="0" ref="dateEl" :startYear="1999"
  99. :futureYear="30" @dateConfirm="confirmValidityPeriod"></itmister-date-picker>
  100. <u-toast ref="uToast"></u-toast>
  101. </view>
  102. </template>
  103. <script>
  104. let that;
  105. import uploadImage from '@/components/ossutil/uploadFile.js';
  106. //插件对象
  107. var sdkwx = uni.requireNativePlugin('Hdgq-LocSdkWX');
  108. export default {
  109. data() {
  110. return {
  111. imgList: [],
  112. fileList1: [],
  113. fileList2:[],
  114. validityPeriod: [],
  115. sourceType: ['camera'],
  116. imgList1:[],
  117. detailData: {
  118. addressUrl: '',
  119. hyCarrierInfo:{},
  120. totalFreight:''
  121. },
  122. defaultIndex:[],
  123. action: this.$helper.ossUploadUrl,
  124. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  125. isAdd: true,
  126. isShowAlert: false,
  127. alertContent: '',
  128. alertTitle: '',
  129. localtion:{},
  130. shippingNoteInfos: [{
  131. shippingNoteNumber: '',
  132. serialNumber: "",
  133. startCountrySubdivisionCode: "",
  134. endCountrySubdivisionCode: "",
  135. startLongitude: "",
  136. startLatitude: "",
  137. endLongitude: "",
  138. endLatitude: "",
  139. startLocationText: "",
  140. endLocationText: "",
  141. vehicleNumber: "",
  142. driverName: "",
  143. interval: "",
  144. }],
  145. }
  146. },
  147. onLoad(options) {
  148. this.detailData = JSON.parse(options.obj)
  149. console.log(this.detailData,"编号编号焦点方式规范化见到过")
  150. this.fileList1=[]
  151. this.fileList2=[]
  152. if(this.detailData.hyCarrierInfo.unloadingImg){
  153. this.imgList=this.detailData.hyCarrierInfo.unloadingImg.split(',')
  154. var data=this.detailData.hyCarrierInfo.unloadingImg.split(',')
  155. for (var i = 0; i < data.length; i++) {
  156. if(data[i]!=''){
  157. this.fileList1.push({url:data[i]})
  158. }
  159. }
  160. }
  161. if(this.detailData.hyCarrierInfo.receiptImg){
  162. this.imgList1=this.detailData.hyCarrierInfo.receiptImg.split(',')
  163. var data=this.detailData.hyCarrierInfo.receiptImg.split(',')
  164. for (var i = 0; i < data.length; i++) {
  165. if(data[i]!=''){
  166. this.fileList2.push({url:data[i]})
  167. }
  168. }
  169. }
  170. if(this.detailData.hyCarrierInfo.totalFreight){
  171. this.$set(this.detailData,'totalFreight',String(this.detailData.hyCarrierInfo.totalFreight))
  172. // this.detailData.totalFreight=String(this.detailData.hyCarrierInfo.totalFreight)
  173. }else{
  174. this.$set(this.detailData,'totalFreight',String(this.detailData.freight))
  175. // this.detailData.totalFreight=String(this.detailData.freight)
  176. }
  177. this.detailData.carrierInfo = {
  178. // unloadingDate: '',
  179. // estimatedFreight: '',
  180. // unloadingAreaLongitude: '',
  181. // unloadingAreaLatitude: '',
  182. // unloadCity: '',
  183. // unloadArea: '',
  184. // unloadingImg: '',
  185. // totalFreight: '',
  186. unloadingImg:this.detailData.hyCarrierInfo.unloadingImg,
  187. receiptImg:this.detailData.hyCarrierInfo.receiptImg,
  188. id: this.detailData.carrierId?this.detailData.carrierId:this.detailData.hyCarrierInfo.id,
  189. }
  190. // #ifdef APP-PLUS
  191. this.getLngLat();
  192. // #endif
  193. this.getNowTime()
  194. },
  195. methods: {
  196. stop(){//结束定位
  197. this.shippingNoteInfos[0].shippingNoteNumber = this.detailData.orderNo, //运单号
  198. this.shippingNoteInfos[0].serialNumber = "0000", //分单号
  199. this.shippingNoteInfos[0].startCountrySubdivisionCode = this.detailData.sendAdCode, //起点位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
  200. this.shippingNoteInfos[0].endCountrySubdivisionCode = this.detailData.unsendAdCode, //到达位置行政区划代码,调 用 start/stop/pause/restart 时 必填,调用 send 非必填
  201. this.shippingNoteInfos[0].startLongitude = this.detailData.sendLongitude, //起点位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
  202. this.shippingNoteInfos[0].startLatitude = this.detailData.sendLatitude, //起点位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
  203. this.shippingNoteInfos[0].endLongitude = this.detailData.unsendLongitude, //到达位置经度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
  204. this.shippingNoteInfos[0].endLatitude = this.detailData.unsendLatitude, //到达位置纬度,调用 start/stop/pause/restart 时必 填,调用 send 非必填
  205. this.shippingNoteInfos[0].startLocationText = this.detailData.sendCity, //起点地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
  206. this.shippingNoteInfos[0].endLocationText = this.detailData.unloadCity, //到达地址文字描述,调用 start/stop/pause/restart 时必 填,调用 send 非必填
  207. this.shippingNoteInfos[0].vehicleNumber = this.detailData.carNumber, //车牌号,SDK 回调返回,调 用 start/stop/pause/restart/必 填,send 时非必填
  208. this.shippingNoteInfos[0].driverName = this.detailData.driverName, //司机姓名,SDK 回调返回, 调用 start/stop/pause/restart/ 必填,send 时非必填
  209. this.shippingNoteInfos[0].interval = "5000" //请求时间间隔,SDK 回调返 回(单位 ms)
  210. // var shippingNoteInfos = this.shippingNoteInfos;//运单信息列表
  211. console.log("查看结束参数",this.shippingNoteInfos)
  212. let remark = ""
  213. sdkwx.stop(this.detailData.carNumber, this.detailData.driverName, remark, this.shippingNoteInfos, function(res) {
  214. if (res.type == "onSuccess") {
  215. console.log("结束成功!!!",res)
  216. //成功
  217. } else if (res.type == "onFailure"){
  218. console.log("结束成功!!!",res)
  219. //失败
  220. var errorCode = res.data.errorCode;//错误码
  221. var errorMsg = res.data.errorMsg;//错误描述
  222. this.$refs.uToast.show({
  223. type: 'error',
  224. message: errorMsg,
  225. })
  226. return
  227. }
  228. });
  229. },
  230. deletePic(event) {
  231. console.log(this[`fileList${event.name}`])
  232. this[`fileList${event.name}`].splice(event.index, 1)
  233. this.imgList.splice(event.index, 1)
  234. },
  235. deletePic1(event) {
  236. this[`fileList${event.name}`].splice(event.index, 1)
  237. this.imgList1.splice(event.index, 1)
  238. },
  239. getNowTime() {
  240. let now = new Date();
  241. let year = now.getFullYear(); //得到年份
  242. let month = now.getMonth(); //得到月份
  243. let date = now.getDate(); //得到日期
  244. month = month + 1;
  245. month = month.toString().padStart(2, "0");
  246. date = date.toString().padStart(2, "0");
  247. let defaultDate = `${year}-${month}-${date}`
  248. this.detailData.carrierInfo.unloadingDate = defaultDate
  249. // this.$forceUpdate()
  250. },
  251. eliminate(){
  252. this.$set(this.detailData,'totalFreight','')
  253. // t.totalFreight=''
  254. console.log(this.detailData.totalFreight)
  255. console.log(this.detailData.totalFreight.length)
  256. },
  257. selectUnloadingDate() {
  258. this.$refs.dateEl.show()
  259. },
  260. getLngLat() {
  261. let that = this
  262. uni.showLoading({
  263. title: '获取定位中',
  264. mask: true
  265. })
  266. // this.$helper.fUN_AmapLocation.start({
  267. // intervalTime: 1000 * 3,
  268. // isReport: false,
  269. // },
  270. // res => {
  271. // //见下方定位返回示例
  272. // console.log('====fUN_AmapLocation定位====', JSON.stringify(res));
  273. // if (res.latitude) {
  274. // this.detailData.carrierInfo.loadingAreaLongitude = res.longitude;
  275. // this.detailData.carrierInfo.loadingAreaLatitude = res.latitude;
  276. // this.detailData.carrierInfo.sendCity = this.$helper.filterUrban(res.city)
  277. // this.detailData.carrierInfo.sendArea = this.$helper.filterArea(res.district);
  278. // console.log(this.detailData.carrierInfo.sendCity)
  279. // console.log(this.detailData.carrierInfo.sendArea)
  280. // this.$forceUpdate()
  281. // }
  282. // this.$helper.fUN_AmapLocation.stop({}, result => {
  283. // uni.hideLoading()
  284. // console.log('====fUN_AmapLocation定位stop====', JSON.stringify(result));
  285. // });
  286. // }
  287. // );
  288. uni.getLocation({
  289. type: 'gcj02',
  290. geocode: true,
  291. success: res => {
  292. if (res.latitude) {
  293. // that.detailData.hyCarrierInfo.loadingAreaLongitude = res.longitude;
  294. // that.detailData.hyCarrierInfo.loadingAreaLatitude = res.latitude;
  295. that.detailData.carrierInfo.unloadingAreaLongitude = res.longitude;
  296. that.detailData.carrierInfo.unloadingAreaLatitude = res.latitude;
  297. console.log("1234567890")
  298. that.detailData.carrierInfo.unloadCity = that.$helper.filterUrban(res.address.city)
  299. that.detailData.carrierInfo.unloadArea = that.$helper.filterUrban(res.address.district)
  300. that.localtion.city = that.$helper.filterUrban(res.address.city)
  301. that.localtion.sendArea = that.$helper.filterUrban(res.address.district)
  302. that.detailData.carrierInfo.unloadingCity = that.$helper.filterUrban(res.address.city)
  303. that.detailData.carrierInfo.unloadingArea = that.$helper.filterUrban(res.address.district)
  304. that.detailData.carrierInfo.unloadingLongitude = res.longitude;
  305. that.detailData.carrierInfo.unloadingLatitude = res.latitude;
  306. that.$forceUpdate()
  307. uni.hideLoading()
  308. } else {
  309. if (uni.getSystemInfoSync().platform == 'android') {
  310. var context = plus.android.importClass("android.content.Context");
  311. var locationManager = plus.android.importClass(
  312. "android.location.LocationManager");
  313. var main = plus.android.runtimeMainActivity();
  314. var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
  315. that.bool = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)
  316. }
  317. if (that.bool === false) {
  318. uni.showModal({
  319. title: '提示',
  320. content: '请打开定位服务',
  321. success: ({
  322. confirm,
  323. cancel
  324. }) => {
  325. if (confirm) {
  326. if (uni.getSystemInfoSync().platform == 'android') {
  327. var Intent = plus.android.importClass(
  328. 'android.content.Intent');
  329. var Settings = plus.android.importClass(
  330. 'android.provider.Settings');
  331. var intent = new Intent(Settings
  332. .ACTION_LOCATION_SOURCE_SETTINGS);
  333. var main = plus.android.runtimeMainActivity();
  334. main.startActivity(intent); // 打开系统设置GPS服务页面
  335. }
  336. }
  337. }
  338. });
  339. uni.hideLoading()
  340. }
  341. }
  342. },
  343. fail: res => {
  344. console.log('定位失败')
  345. console.log(res)
  346. uni.hideLoading()
  347. }
  348. });
  349. },
  350. alertBtn() {
  351. // uni.navigateTo({
  352. // url: '/pages/public/login'
  353. // })
  354. },
  355. cancelClick() {
  356. this.isShowAlert = false
  357. },
  358. getImgUrl(res) {
  359. this.detailData.carrierInfo.unloadingImg += res + ','
  360. console.log(res)
  361. console.log('------------res-----------')
  362. },
  363. onError(error) {
  364. alert(error)
  365. console.log('------------error-----------')
  366. console.log(error)
  367. },
  368. onRemove(index) {},
  369. filterFileType(index, lists) {
  370. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  371. lists.splice(index, 1);
  372. // 当前文件不支持
  373. uni.showModal({
  374. title: '暂不支持当前图片类型',
  375. showCancel: false
  376. });
  377. } else {
  378. this.isAdd = false;
  379. }
  380. },
  381. // 新增图片
  382. async afterRead(event) {
  383. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  384. let lists = [].concat(event.file)
  385. let fileListLen = this[`fileList${event.name}`].length
  386. lists.map((item) => {
  387. this[`fileList${event.name}`].push({
  388. ...item,
  389. status: 'uploading',
  390. message: '上传中'
  391. })
  392. })
  393. for (let i = 0; i < lists.length; i++) {
  394. const result = await this.uploadFilePromise(lists[i].url)
  395. let item = this[`fileList${event.name}`][fileListLen]
  396. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  397. status: 'success',
  398. message: '',
  399. url: result
  400. }))
  401. fileListLen++
  402. }
  403. },
  404. // 新增图片
  405. async afterRead1(event) {
  406. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  407. let lists = [].concat(event.file)
  408. let fileListLen = this[`fileList${event.name}`].length
  409. lists.map((item) => {
  410. this[`fileList${event.name}`].push({
  411. ...item,
  412. status: 'uploading',
  413. message: '上传中'
  414. })
  415. })
  416. for (let i = 0; i < lists.length; i++) {
  417. const result = await this.uploadFilePromise1(lists[i].url)
  418. let item = this[`fileList${event.name}`][fileListLen]
  419. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  420. status: 'success',
  421. message: '',
  422. url: result
  423. }))
  424. fileListLen++
  425. }
  426. },
  427. uploadFilePromise(url) {
  428. uploadImage('image', url, 'appData/',
  429. result => {
  430. // 上传成功回调函数
  431. console.log('图片地址', result)
  432. this.imgList.push(result)
  433. }
  434. )
  435. },
  436. uploadFilePromise1(url) {
  437. uploadImage('image', url, 'appData/',
  438. result => {
  439. // 上传成功回调函数
  440. console.log('图片地址', result)
  441. this.imgList1.push(result)
  442. }
  443. )
  444. },
  445. onProgress(e) {
  446. console.log(e)
  447. },
  448. submit(type) {
  449. if (type == 1) {
  450. this.alertContent = '确定暂存卸车信息?'
  451. } else {
  452. if (!this.detailData.unloadingWeight) {
  453. this.$refs.uToast.show({
  454. type: 'error',
  455. message: "请输入卸车净重!",
  456. })
  457. return
  458. }
  459. if (this.fileList1.length == 0) {
  460. this.$refs.uToast.show({
  461. type: 'error',
  462. message: "卸车照片不能为空!",
  463. })
  464. return
  465. }
  466. if (this.fileList2.length == 0) {
  467. this.$refs.uToast.show({
  468. type: 'error',
  469. message: "请上传回单照片!",
  470. })
  471. return
  472. }
  473. this.alertContent = '确定提交卸车信息?'
  474. }
  475. // if(!this.detailData.totalFreight){
  476. // this.$refs.uToast.show({
  477. // type: 'error',
  478. // message: "请输入合计运费!",
  479. // })
  480. // return
  481. // }
  482. this.isShowAlert = true
  483. this.detailData.statusFlag = type
  484. },
  485. confirmClick() {
  486. var that=this
  487. if (this.detailData.statusFlag == 1) {
  488. delete this.detailData.carrierInfo.unloadingAreaLongitude;
  489. delete this.detailData.carrierInfo.unloadingAreaLatitude;
  490. delete this.detailData.carrierInfo.unloadCity;
  491. delete this.detailData.carrierInfo.unloadArea;
  492. }
  493. this.detailData.carrierInfo.statusFlag = this.detailData.statusFlag
  494. this.detailData.carrierInfo.unloadingImg = this.imgList.toString()
  495. this.detailData.carrierInfo.receiptImg = this.imgList1.toString()
  496. this.detailData.carrierInfo.unloadingWeight = this.detailData.unloadingWeight
  497. // if (!this.detailData.carrierInfo.totalFreight) {
  498. // uni.showToast({
  499. // title: '运费不能为空!',
  500. // duration: 2000,
  501. // icon: "none",
  502. // });
  503. // return
  504. // }
  505. // if (
  506. // this.detailData.carrierInfo.totalFreight < 0 || this.detailData.carrierInfo.totalFreight > 100000 || (
  507. // String(this.detailData.carrierInfo.totalFreight).indexOf('.') != -1 && String(this.detailData
  508. // .carrierInfo.totalFreight).length - (String(this.detailData.carrierInfo.totalFreight).indexOf(
  509. // '.') + 1) > 2)
  510. // ) {
  511. // uni.showToast({
  512. // title: '运费输入错误!',
  513. // duration: 2000,
  514. // icon: "none",
  515. // });
  516. // return
  517. // }
  518. this.isShowAlert = false
  519. uni.showLoading({
  520. title:'加载中'
  521. })
  522. let time = new Date() //卸车时间 去当前时间的时分秒
  523. let h = time.getHours();
  524. if (h < 10) {
  525. h = "0" + h
  526. }
  527. let f = time.getMinutes();
  528. if (f < 10) {
  529. f = "0" + f
  530. }
  531. let m = time.getSeconds();
  532. if (m < 10) {
  533. m = "0" + m
  534. }
  535. if(this.detailData.carrierInfo.unloadingDate){//卸车时间 去当前时间的时分秒
  536. this.detailData.carrierInfo.unloadingDate= this.detailData.carrierInfo.unloadingDate.split(" ")[0] + " " + h + ":" + f + ":" + m
  537. }
  538. // this.detailData.carrierInfo.totalFreight = this.detailData.totalFreight
  539. this.detailData.carrierInfo.carNo = this.detailData.carNumber
  540. this.$request.baseRequest('post', '/carrierInfo/unLoadingAdd', this.detailData.carrierInfo).then(res => {
  541. if (res.code == 200) {
  542. let _title = ''
  543. if (this.detailData.statusFlag == 1) {
  544. _title = '暂存成功!'
  545. } else {
  546. that.stop()
  547. _title = '提交成功!'
  548. }
  549. uni.hideLoading()
  550. this.$refs.uToast.show({
  551. type: 'success',
  552. message: _title,
  553. complete() {
  554. uni.hideLoading()
  555. uni.switchTab({
  556. url: '/pages/order/index'
  557. })
  558. if(that.$helper.fUN_AmapLocation){
  559. that.$helper.fUN_AmapLocation.stop({}, result => {
  560. console.log('====fUN_AmapLocation定位stop====', JSON.stringify(result));
  561. });
  562. }
  563. }
  564. })
  565. }
  566. })
  567. .catch(res => {
  568. uni.$u.toast(res.message);
  569. });
  570. },
  571. confirmValidityPeriod(date) {
  572. this.detailData.carrierInfo.unloadingDate = date.date
  573. },
  574. },
  575. }
  576. </script>
  577. <style scoped lang="scss">
  578. .content {
  579. .row-left-text {
  580. color: #333333;
  581. }
  582. }
  583. .level2-title {
  584. margin: 0 0 20rpx 0;
  585. }
  586. .content1,
  587. .content2 {
  588. background: white;
  589. margin: 20rpx;
  590. border-radius: 20rpx;
  591. padding: 20rpx;
  592. .place {
  593. width: 80%;
  594. text-align: right;
  595. }
  596. }
  597. .upload {}
  598. .bottom-btn {
  599. display: flex;
  600. justify-content: space-around;
  601. // margin-bottom: 50rpx;
  602. background: #FFFFFF;
  603. padding: 40rpx 0;
  604. }
  605. .store {
  606. padding: 20rpx 30rpx;
  607. color: #2772FB;
  608. width: 40%;
  609. background: #EEF4FF;
  610. border-radius: 40rpx;
  611. font-size: 36rpx;
  612. text-align: center;
  613. }
  614. .submit {
  615. font-size: 36rpx;
  616. padding: 20rpx 30rpx;
  617. color: white;
  618. width: 40%;
  619. background: #2772FB;
  620. border-radius: 40rpx;
  621. text-align: center;
  622. }
  623. .row-between {
  624. margin: 20rpx 0;
  625. }
  626. .sx-style {
  627. background: #2772FB;
  628. color: white;
  629. padding: 2rpx 16rpx;
  630. box-sizing: border-box;
  631. border-radius: 10rpx;
  632. margin-left: 20rpx;
  633. }
  634. .totalFreight-input {
  635. text-align: right;
  636. padding-right:18px;
  637. }
  638. .close{
  639. position:absolute;
  640. right:0;
  641. width:15px;height:15px;
  642. top:50%;
  643. transform: translateY(-50%);
  644. }
  645. </style>