confirmUnloading.vue 22 KB

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