confirmUnloading.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  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. console.log(11111)
  253. this.$set(this.detailData,'totalFreight','')
  254. // t.totalFreight=''
  255. console.log(this.detailData.totalFreight)
  256. console.log(this.detailData.totalFreight.length)
  257. },
  258. selectUnloadingDate() {
  259. this.$refs.dateEl.show()
  260. },
  261. getLngLat() {
  262. let that = this
  263. uni.showLoading({
  264. title: '获取定位中',
  265. mask: true
  266. })
  267. // this.$helper.fUN_AmapLocation.start({
  268. // intervalTime: 1000 * 3,
  269. // isReport: false,
  270. // },
  271. // res => {
  272. // //见下方定位返回示例
  273. // console.log('====fUN_AmapLocation定位====', JSON.stringify(res));
  274. // if (res.latitude) {
  275. // this.detailData.carrierInfo.loadingAreaLongitude = res.longitude;
  276. // this.detailData.carrierInfo.loadingAreaLatitude = res.latitude;
  277. // this.detailData.carrierInfo.sendCity = this.$helper.filterUrban(res.city)
  278. // this.detailData.carrierInfo.sendArea = this.$helper.filterArea(res.district);
  279. // console.log(this.detailData.carrierInfo.sendCity)
  280. // console.log(this.detailData.carrierInfo.sendArea)
  281. // this.$forceUpdate()
  282. // }
  283. // this.$helper.fUN_AmapLocation.stop({}, result => {
  284. // uni.hideLoading()
  285. // console.log('====fUN_AmapLocation定位stop====', JSON.stringify(result));
  286. // });
  287. // }
  288. // );
  289. uni.getLocation({
  290. type: 'gcj02',
  291. geocode: true,
  292. success: res => {
  293. if (res.latitude) {
  294. // that.detailData.hyCarrierInfo.loadingAreaLongitude = res.longitude;
  295. // that.detailData.hyCarrierInfo.loadingAreaLatitude = res.latitude;
  296. that.detailData.carrierInfo.unloadingAreaLongitude = res.longitude;
  297. that.detailData.carrierInfo.unloadingAreaLatitude = res.latitude;
  298. console.log("1234567890")
  299. that.detailData.carrierInfo.unloadCity = that.$helper.filterUrban(res.address.city)
  300. that.detailData.carrierInfo.unloadArea = that.$helper.filterUrban(res.address.district)
  301. that.localtion.city = that.$helper.filterUrban(res.address.city)
  302. that.localtion.sendArea = that.$helper.filterUrban(res.address.district)
  303. that.detailData.carrierInfo.unloadingCity = that.$helper.filterUrban(res.address.city)
  304. that.detailData.carrierInfo.unloadingArea = that.$helper.filterUrban(res.address.district)
  305. that.detailData.carrierInfo.unloadingLongitude = res.longitude;
  306. that.detailData.carrierInfo.unloadingLatitude = res.latitude;
  307. that.$forceUpdate()
  308. uni.hideLoading()
  309. } else {
  310. if (uni.getSystemInfoSync().platform == 'android') {
  311. var context = plus.android.importClass("android.content.Context");
  312. var locationManager = plus.android.importClass(
  313. "android.location.LocationManager");
  314. var main = plus.android.runtimeMainActivity();
  315. var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
  316. that.bool = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)
  317. }
  318. if (that.bool === false) {
  319. uni.showModal({
  320. title: '提示',
  321. content: '请打开定位服务',
  322. success: ({
  323. confirm,
  324. cancel
  325. }) => {
  326. if (confirm) {
  327. if (uni.getSystemInfoSync().platform == 'android') {
  328. var Intent = plus.android.importClass(
  329. 'android.content.Intent');
  330. var Settings = plus.android.importClass(
  331. 'android.provider.Settings');
  332. var intent = new Intent(Settings
  333. .ACTION_LOCATION_SOURCE_SETTINGS);
  334. var main = plus.android.runtimeMainActivity();
  335. main.startActivity(intent); // 打开系统设置GPS服务页面
  336. }
  337. }
  338. }
  339. });
  340. uni.hideLoading()
  341. }
  342. }
  343. },
  344. fail: res => {
  345. console.log('定位失败')
  346. console.log(res)
  347. uni.hideLoading()
  348. }
  349. });
  350. },
  351. alertBtn() {
  352. // uni.navigateTo({
  353. // url: '/pages/public/login'
  354. // })
  355. },
  356. cancelClick() {
  357. this.isShowAlert = false
  358. },
  359. getImgUrl(res) {
  360. this.detailData.carrierInfo.unloadingImg += res + ','
  361. console.log(res)
  362. console.log('------------res-----------')
  363. },
  364. onError(error) {
  365. alert(error)
  366. console.log('------------error-----------')
  367. console.log(error)
  368. },
  369. onRemove(index) {},
  370. filterFileType(index, lists) {
  371. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  372. lists.splice(index, 1);
  373. // 当前文件不支持
  374. uni.showModal({
  375. title: '暂不支持当前图片类型',
  376. showCancel: false
  377. });
  378. } else {
  379. this.isAdd = false;
  380. }
  381. },
  382. // 新增图片
  383. async afterRead(event) {
  384. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  385. let lists = [].concat(event.file)
  386. let fileListLen = this[`fileList${event.name}`].length
  387. lists.map((item) => {
  388. this[`fileList${event.name}`].push({
  389. ...item,
  390. status: 'uploading',
  391. message: '上传中'
  392. })
  393. })
  394. for (let i = 0; i < lists.length; i++) {
  395. const result = await this.uploadFilePromise(lists[i].url)
  396. let item = this[`fileList${event.name}`][fileListLen]
  397. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  398. status: 'success',
  399. message: '',
  400. url: result
  401. }))
  402. fileListLen++
  403. }
  404. },
  405. // 新增图片
  406. async afterRead1(event) {
  407. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  408. let lists = [].concat(event.file)
  409. let fileListLen = this[`fileList${event.name}`].length
  410. lists.map((item) => {
  411. this[`fileList${event.name}`].push({
  412. ...item,
  413. status: 'uploading',
  414. message: '上传中'
  415. })
  416. })
  417. for (let i = 0; i < lists.length; i++) {
  418. const result = await this.uploadFilePromise1(lists[i].url)
  419. let item = this[`fileList${event.name}`][fileListLen]
  420. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  421. status: 'success',
  422. message: '',
  423. url: result
  424. }))
  425. fileListLen++
  426. }
  427. },
  428. uploadFilePromise(url) {
  429. uploadImage('image', url, 'appData/',
  430. result => {
  431. // 上传成功回调函数
  432. console.log('图片地址', result)
  433. this.imgList.push(result)
  434. }
  435. )
  436. },
  437. uploadFilePromise1(url) {
  438. uploadImage('image', url, 'appData/',
  439. result => {
  440. // 上传成功回调函数
  441. console.log('图片地址', result)
  442. this.imgList1.push(result)
  443. }
  444. )
  445. },
  446. onProgress(e) {
  447. console.log(e)
  448. },
  449. submit(type) {
  450. if (type == 1) {
  451. this.alertContent = '确定暂存卸车信息?'
  452. } else {
  453. if (!this.detailData.unloadingWeight) {
  454. this.$refs.uToast.show({
  455. type: 'error',
  456. message: "请输入卸车净重!",
  457. })
  458. return
  459. }
  460. if (this.fileList1.length == 0) {
  461. this.$refs.uToast.show({
  462. type: 'error',
  463. message: "卸车照片不能为空!",
  464. })
  465. return
  466. }
  467. if (this.fileList2.length == 0) {
  468. this.$refs.uToast.show({
  469. type: 'error',
  470. message: "请上传回单照片!",
  471. })
  472. return
  473. }
  474. this.alertContent = '确定提交卸车信息?'
  475. }
  476. // if(!this.detailData.totalFreight){
  477. // this.$refs.uToast.show({
  478. // type: 'error',
  479. // message: "请输入合计运费!",
  480. // })
  481. // return
  482. // }
  483. this.isShowAlert = true
  484. this.detailData.statusFlag = type
  485. },
  486. confirmClick() {
  487. var that=this
  488. if (this.detailData.statusFlag == 1) {
  489. delete this.detailData.carrierInfo.unloadingAreaLongitude;
  490. delete this.detailData.carrierInfo.unloadingAreaLatitude;
  491. delete this.detailData.carrierInfo.unloadCity;
  492. delete this.detailData.carrierInfo.unloadArea;
  493. }
  494. this.detailData.carrierInfo.statusFlag = this.detailData.statusFlag
  495. this.detailData.carrierInfo.unloadingImg = this.imgList.toString()
  496. this.detailData.carrierInfo.receiptImg = this.imgList1.toString()
  497. this.detailData.carrierInfo.unloadingWeight = this.detailData.unloadingWeight
  498. // if (!this.detailData.carrierInfo.totalFreight) {
  499. // uni.showToast({
  500. // title: '运费不能为空!',
  501. // duration: 2000,
  502. // icon: "none",
  503. // });
  504. // return
  505. // }
  506. // if (
  507. // this.detailData.carrierInfo.totalFreight < 0 || this.detailData.carrierInfo.totalFreight > 100000 || (
  508. // String(this.detailData.carrierInfo.totalFreight).indexOf('.') != -1 && String(this.detailData
  509. // .carrierInfo.totalFreight).length - (String(this.detailData.carrierInfo.totalFreight).indexOf(
  510. // '.') + 1) > 2)
  511. // ) {
  512. // uni.showToast({
  513. // title: '运费输入错误!',
  514. // duration: 2000,
  515. // icon: "none",
  516. // });
  517. // return
  518. // }
  519. this.isShowAlert = false
  520. uni.showLoading({
  521. title:'加载中'
  522. })
  523. let time = new Date() //卸车时间 去当前时间的时分秒
  524. let h = time.getHours();
  525. if (h < 10) {
  526. h = "0" + h
  527. }
  528. let f = time.getMinutes();
  529. if (f < 10) {
  530. f = "0" + f
  531. }
  532. let m = time.getSeconds();
  533. if (m < 10) {
  534. m = "0" + m
  535. }
  536. if(this.detailData.carrierInfo.unloadingDate){//卸车时间 去当前时间的时分秒
  537. this.detailData.carrierInfo.unloadingDate= this.detailData.carrierInfo.unloadingDate.split(" ")[0] + " " + h + ":" + f + ":" + m
  538. }
  539. // this.detailData.carrierInfo.totalFreight = this.detailData.totalFreight
  540. this.detailData.carrierInfo.carNo = this.detailData.carNumber
  541. this.$request.baseRequest('post', '/carrierInfo/unLoadingAdd', this.detailData.carrierInfo).then(res => {
  542. if (res.code == 200) {
  543. let _title = ''
  544. if (this.detailData.statusFlag == 1) {
  545. _title = '暂存成功!'
  546. } else {
  547. that.stop()
  548. _title = '提交成功!'
  549. }
  550. uni.hideLoading()
  551. this.$refs.uToast.show({
  552. type: 'success',
  553. message: _title,
  554. complete() {
  555. uni.hideLoading()
  556. uni.switchTab({
  557. url: '/pages/order/index'
  558. })
  559. if(that.$helper.fUN_AmapLocation){
  560. that.$helper.fUN_AmapLocation.stop({}, result => {
  561. console.log('====fUN_AmapLocation定位stop====', JSON.stringify(result));
  562. });
  563. }
  564. }
  565. })
  566. }
  567. })
  568. .catch(res => {
  569. uni.$u.toast(res.message);
  570. });
  571. },
  572. confirmValidityPeriod(date) {
  573. this.detailData.carrierInfo.unloadingDate = date.date
  574. },
  575. },
  576. }
  577. </script>
  578. <style scoped lang="scss">
  579. .content {
  580. .row-left-text {
  581. color: #333333;
  582. }
  583. }
  584. .level2-title {
  585. margin: 0 0 20rpx 0;
  586. }
  587. .content1,
  588. .content2 {
  589. background: white;
  590. margin: 20rpx;
  591. border-radius: 20rpx;
  592. padding: 20rpx;
  593. .place {
  594. width: 80%;
  595. text-align: right;
  596. }
  597. }
  598. .upload {}
  599. .bottom-btn {
  600. display: flex;
  601. justify-content: space-around;
  602. // margin-bottom: 50rpx;
  603. background: #FFFFFF;
  604. padding: 40rpx 0;
  605. }
  606. .store {
  607. padding: 20rpx 30rpx;
  608. color: #2772FB;
  609. width: 40%;
  610. background: #EEF4FF;
  611. border-radius: 40rpx;
  612. font-size: 36rpx;
  613. text-align: center;
  614. }
  615. .submit {
  616. font-size: 36rpx;
  617. padding: 20rpx 30rpx;
  618. color: white;
  619. width: 40%;
  620. background: #2772FB;
  621. border-radius: 40rpx;
  622. text-align: center;
  623. }
  624. .row-between {
  625. margin: 20rpx 0;
  626. }
  627. .sx-style {
  628. background: #2772FB;
  629. color: white;
  630. padding: 2rpx 16rpx;
  631. box-sizing: border-box;
  632. border-radius: 10rpx;
  633. margin-left: 20rpx;
  634. }
  635. .totalFreight-input {
  636. text-align: right;
  637. padding-right:18px;
  638. }
  639. .close{
  640. position:absolute;
  641. right:0;
  642. width:15px;height:15px;
  643. top:50%;
  644. transform: translateY(-50%);
  645. }
  646. </style>