index.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174
  1. <template>
  2. <view class="content">
  3. <u-sticky>
  4. <view class="head-no">
  5. <!-- <text>订单号: {{formData.orderNo}}</text> -->
  6. <view>
  7. <text>{{ formData.carRegNo == null ? '' : formData.carRegNo }}</text>
  8. </view>
  9. <view>
  10. <text>{{ formData.goodsCName == null ? '' : formData.goodsCName }}</text>
  11. </view>
  12. </view>
  13. <view class="head-no-addr">
  14. <view>
  15. <text>{{formData.loadAddr}}</text>
  16. </view>
  17. <!-- <span class="icon iconfont" style="font-size: 100rpx; color: #fcbd71; height: 80rpx;">&#xe6fb;</span> -->
  18. <view><text>【到】</text></view>
  19. <view>
  20. <text>{{formData.unLoadAddr}}</text>
  21. </view>
  22. </view>
  23. </u-sticky>
  24. <u-sticky>
  25. </u-sticky>
  26. <view class="striping"></view>
  27. <!-- <view class="head a-blue" @click="telFun">
  28. <text>驾驶员: {{formData.driver1Name == null ? '' : formData.driver1Name}}&nbsp;{{formData.driver1mobile == null ? '' : formData.driver1mobile}}</text>
  29. </view> -->
  30. <!-- <u-tabs :list="tabs" @change="change" :activeStyle="{
  31. width: '180rpx',
  32. height: '60rpx',
  33. color: '#fff',
  34. backgroundColor: '#3c9cff',
  35. borderRadius: '80rpx',
  36. lineHeight: '60rpx',
  37. textAlign: 'center'
  38. }" :inactiveStyle="{
  39. width: '180rpx',
  40. height: '60rpx',
  41. color: '#3c9cff',
  42. backgroundColor: '#f0f0f0f0',
  43. borderRadius: '80rpx',
  44. lineHeight: '60rpx',
  45. textAlign: 'center'
  46. }"></u-tabs> -->
  47. <view v-if="isTabs == '装卸确认'">
  48. <view class="box-box">
  49. <view class="box-two">
  50. <!-- <text style="color: red;">*</text> -->
  51. <text class="key">装车吨位</text>
  52. <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  53. @input="checkLoadQty" v-model="formData.loadQty" />
  54. </view>
  55. <view class="box-two">
  56. <text class="key">装车时间</text>
  57. <uni-datetime-picker class="value-two" :start="startDate" :end="end" :disabled="disabled"
  58. :hide-second="true" v-model="formData.loadDateString" :border="false"></uni-datetime-picker>
  59. <view class="today" @click="today('ZC')"><text>今天</text></view>
  60. </view>
  61. <view class="box-two">
  62. <text class="key">卸车吨位</text>
  63. <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  64. @input="checkUnLoadQty" v-model="formData.unLoadQty" />
  65. </view>
  66. <view class="box-two">
  67. <text class="key">卸车时间</text>
  68. <uni-datetime-picker class="value-two" :start="formData.loadDateString" :end="end"
  69. :hide-second="true" :disabled="disabled" v-model="formData.unLoadDateString" :border="false"></uni-datetime-picker>
  70. <view class="today" @click="today('XC')"><text>今天</text></view>
  71. </view>
  72. <!-- <view class="box">
  73. <view class="data">
  74. <text class="key">空载起点</text>
  75. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled"
  76. v-model="formData.emptyaddr1" />
  77. </view>
  78. <view class="data">
  79. <text class="key">空车里程</text>
  80. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  81. v-model="formData.odometerstart" />
  82. </view>
  83. </view>
  84. <view class="box">
  85. <view class="data">
  86. <text class="key">空载终点</text>
  87. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled"
  88. v-model="formData.emptyaddr2" />
  89. </view>
  90. <view class="data">
  91. <text class="key">空车里程</text>
  92. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  93. v-model="formData.odometerend" />
  94. </view>
  95. </view>
  96. <view class="box-two">
  97. <text class="key">重车里程</text>
  98. <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  99. @input="checkUnLoadmile" v-model="formData.loadmile" />
  100. </view> -->
  101. <!-- ORDER BILLS PLANS -->
  102. <!-- @change="checkboxChange" -->
  103. <u-checkbox-group v-model="detour" style="margin-left: 20rpx;" placement="column">
  104. <u-checkbox :customStyle="{marginBottom: '8px'}" key="1" label="行程绕路" name="行程绕路">
  105. </u-checkbox>
  106. </u-checkbox-group>
  107. <view v-if="detour.length > 0">
  108. <!-- <view class="box-two">
  109. <view style="width: 48%; display: flex;">
  110. <text class="key" style="width: 200rpx;">绕路里程空</text>
  111. <input class="value-two" style="width: 200rpx;" selection-start="0" selection-end="9999" :disabled="disabled"
  112. @input="checkUnDetourEmptyMile" v-model="formData.detourEmptyMile" />
  113. </view>
  114. <view style="width: 4%; height: 200rpx;"></view>
  115. <view style="width: 48%; display: flex;">
  116. <text class="key" style="width: 200rpx; margin: 0 10rpx;">绕路里程重</text>
  117. <input class="value-two" style="width: 200rpx;" selection-start="0" selection-end="9999" :disabled="disabled"
  118. @input="checkUnDetourLoadMile" v-model="formData.detourLoadMile" />
  119. </view>
  120. </view> -->
  121. <view class="box-two">
  122. <text class="key" style="width: 300rpx;">绕路里程空(公里)</text>
  123. <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled"
  124. @input="checkUnDetourEmptyMile" v-model="formData.detourEmptyMile" />
  125. </view>
  126. <view class="box-two">
  127. <text class="key" style="width: 300rpx;">绕路里程重(公里)</text>
  128. <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled"
  129. @input="checkUnDetourLoadMile" v-model="formData.detourLoadMile" />
  130. </view>
  131. <view class="box-two">
  132. <text class="key" style="width: 300rpx;">绕&nbsp;&nbsp;&nbsp;&nbsp;路&nbsp;&nbsp;&nbsp;&nbsp;原&nbsp;&nbsp;&nbsp;&nbsp;因</text>
  133. <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled"
  134. v-model="formData.detourDesc" />
  135. </view>
  136. </view>
  137. </view>
  138. <view class="box-box" style="margin-top: 40rpx;">
  139. <view style="margin-bottom: 20rpx;">
  140. <text style="color: #3c9cff;">单据拍照存档 (请上传图片大小为1MB以下的图片)</text>
  141. </view>
  142. <u-upload :fileList="fileList1" accept="image" :sizeType="['compressed']" capture="camera"
  143. @afterRead="imgUploading" :disabled="disabled" @delete="deletePic" name="1" multiple :previewFullImage="true"
  144. ></u-upload>
  145. </view>
  146. <view class="box-box">
  147. <view class="box-two">
  148. <text class="key">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</text>
  149. <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled"
  150. v-model="formData.driverassdesc" />
  151. </view>
  152. </view>
  153. <view class="attention">
  154. <view style="color: red;"><text>注意事项:</text></view>
  155. <!-- <text class="text-grey1">请查看</text>
  156. <text @click="attention()" class="text-blue">注意事项</text> -->
  157. {{this.formData.remarks ? this.formData.remarks:''}}
  158. </view>
  159. </view>
  160. <!-- <view v-if="isTabs == '订单信息'">
  161. <view class="box-two textAlign">
  162. <text class="key">货物名称</text>
  163. <text class="value">{{formData.goodsCName == null ? "" : formData.goodsCName}}</text>
  164. </view>
  165. <view class="box-two textAlign">
  166. <text class="key">装车地点</text>
  167. <text class="value">{{formData.loadAddr == null ? "" : formData.loadAddr}}</text>
  168. </view>
  169. <view class="box-two textAlign">
  170. <text class="key">装车厂家</text>
  171. <text class="value">{{formData.loadFactory == null ? "" : formData.loadFactory}}</text>
  172. </view>
  173. <view class="box-two textAlign">
  174. <text class="key">联系人电话</text>
  175. <text
  176. class="value">{{formData.loadAttn == null ? "" : formData.loadAttn}}&nbsp;{{formData.loadAttnTel == null ? "" : formData.loadAttnTel}}</text>
  177. </view>
  178. <view class="box-two textAlign">
  179. <text class="key">卸车地点</text>
  180. <text class="value">{{formData.unLoadAddr == null ? "" : formData.unLoadAddr}}</text>
  181. </view>
  182. <view class="box-two textAlign">
  183. <text class="key">卸车厂家</text>
  184. <text class="value">{{formData.unLoadFactory == null ? "" : formData.unLoadFactory}}</text>
  185. </view>
  186. <view class="box-two textAlign">
  187. <text class="key">联系人电话</text>
  188. <text
  189. class="value">{{formData.unLoadAttn == null ? "" : formData.unLoadAttn}}&nbsp;{{formData.unLoadAttnTel == null ? "" : formData.unLoadAttnTel}}</text>
  190. </view>
  191. <view class="attention">
  192. <text class="text-grey1">请查看</text>
  193. <text @click="attention()" class="text-blue">注意事项</text>
  194. </view>
  195. </view> -->
  196. <view class="cushion">
  197. </view>
  198. <view class="bottom" style="z-index: 4;">
  199. <view class="row" v-if="formData.ifLoaded == 'T' && (formData.ifUnLoaded == 'T' || formData.ifUnLoaded == 'F') && (formData.ifOrder2ed == 'T' || formData.ifOrder2ed == 'F')">
  200. <view class="button" style="width: 300rpx;">
  201. <u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="disabled"
  202. @click="disabledClick" text="保存数据"></u-button>
  203. </view>
  204. <view class="button" style="width: 300rpx;">
  205. <u-button iconColor="#fe8c00;" color="#fe8c00" shape="circle" type="primary" :disabled="disabled"
  206. @click="upDisabledClick" text="卸车确认"></u-button>
  207. </view>
  208. </view>
  209. <view class="row" v-else>
  210. <view class="button">
  211. <u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="disabled"
  212. @click="disabledClick" text="保存数据"></u-button>
  213. </view>
  214. </view>
  215. </view>
  216. <!-- <view class="bottom" style="z-index: 4;">
  217. <view class="row">
  218. <view class="button">
  219. <u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="disabled"
  220. @click="disabledClick" text="保存数据"></u-button>
  221. </view>
  222. <view class="button">
  223. <u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="disabled" @click=""
  224. @click="submitAudits" text="提交里程"></u-button>
  225. </view>
  226. </view>
  227. </view> -->
  228. <!-- 遮盖罩 -->
  229. <u-loading-page :loading="loading" style="z-index: 999;"></u-loading-page>
  230. <!-- 消息提示 -->
  231. <u-toast ref="uToast"></u-toast>
  232. <!-- 删除图片弹出框 -->
  233. <u-modal :show="deleteShow" title="提示" showCancelButton @confirm="deleteImg" @cancel="deleteShow = false">
  234. <view class="slot-content">
  235. <rich-text nodes="确定删除这张图片吗?"></rich-text>
  236. </view>
  237. </u-modal>
  238. <u-modal :show="submitShow" title="提示" showCancelButton @confirm="setOrderBillsPlansByid"
  239. @cancel="submitShow = false">
  240. <view class="slot-content">
  241. <rich-text nodes="确定要提交装卸信息吗?"></rich-text>
  242. </view>
  243. </u-modal>
  244. <u-modal :show="upCancel" title="提示" showCancelButton @confirm="upReceipts"
  245. @cancel="upCancel = false">
  246. <view class="slot-content">
  247. <rich-text nodes="确定要卸车吗?"></rich-text>
  248. </view>
  249. </u-modal>
  250. </view>
  251. </template>
  252. <script>
  253. import {
  254. getOrderBillsPlansByid,
  255. putOrderBillsPlansByid,
  256. insertTmsAttachMngs,
  257. pictureUploading,
  258. deleteTmsAttachMngs,
  259. audit,
  260. submitAudit,
  261. upReceipts
  262. } from "@/api/particulars"
  263. import {
  264. getGasStations,
  265. getItems,
  266. insertLoadFeeItems,
  267. getLoadFeeItems
  268. } from "@/api/reimbursement"
  269. import {
  270. login
  271. } from "../../api/login";
  272. export default {
  273. data() {
  274. return {
  275. // 遮盖罩
  276. loading: true,
  277. formData: {},
  278. // 表单验证
  279. rules: {
  280. loadQty: '',
  281. loadDateString: '',
  282. unLoadQty: '',
  283. unLoadDateString: '',
  284. // emptyaddr1: '',
  285. // odometerstart: '',
  286. // emptyaddr2: '',
  287. // odometerend: '',
  288. loadmile: '',
  289. remarks: ''
  290. },
  291. orderNo: '',
  292. // 照片
  293. fileList1: [],
  294. // 删除弹框
  295. deleteShow: false,
  296. // 提交里程弹窗
  297. submitShow: false,
  298. // 提交报账单弹窗
  299. upCancel: false,
  300. // 删除的图片
  301. event: {},
  302. // 输入框禁用
  303. disabled: false,
  304. status317: 0,
  305. status376: 0,
  306. // 当前时间的前60天
  307. startDate: '',
  308. tabs: [{
  309. name: '装卸确认'
  310. }, {
  311. name: '订单信息'
  312. }],
  313. isTabs: '装卸确认',
  314. // 绕路选项
  315. detour: [],
  316. end: new Date() + ''
  317. };
  318. },
  319. onLoad: function(option) {
  320. this.status317 = option.status;
  321. this.status376 = option.status;
  322. this.orderNo = option.orderNo;
  323. this.getData();
  324. },
  325. onUnload() {
  326. this.formData = {};
  327. this.loading = true;
  328. this.event = {};
  329. },
  330. methods: {
  331. // 查询数据
  332. getData() {
  333. getOrderBillsPlansByid(this.orderNo).then(res => {
  334. res.data.loadQty == 0 ? res.data.loadQty = null : res.data.loadQty
  335. res.data.unLoadQty == 0 ? res.data.unLoadQty = null : res.data.unLoadQty
  336. res.data.odometerstart == 0 ? res.data.odometerstart = null : res.data.odometerstart
  337. res.data.odometerend == 0 ? res.data.odometerend = null : res.data.odometerend
  338. res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
  339. res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
  340. if (res.data.ifDetour == "T") {
  341. this.detour.push("行程绕路")
  342. }
  343. for (let role of res.data.roleList) {
  344. if (role == 'DZ') {
  345. this.disabled = true;
  346. }
  347. if (role == 'JSY') {
  348. this.disabled = false;
  349. }
  350. }
  351. // // 审核中
  352. // if (res.data.ifStarted == "S") {
  353. // this.disabled = true;
  354. // }
  355. // // 审核完成
  356. // if (res.data.ifStarted == "A") {
  357. // this.disabled = true;
  358. // }
  359. // 提交报账单
  360. if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
  361. this.disabled = true;
  362. }
  363. this.formData = res.data;
  364. this.fileList1 = res.data.fileList1;
  365. this.loading = false;
  366. if (this.status317 == 6) {
  367. this.disabled = true;
  368. }
  369. this.startDate = this.GetTime(60)
  370. })
  371. },
  372. // 切换
  373. change(item) {
  374. this.isTabs = item.name;
  375. },
  376. // 当天日期
  377. today(type) {
  378. if (this.disabled) {
  379. return
  380. }
  381. if (type == "ZC") {
  382. this.formData.loadDateString = Date.parse(new Date());
  383. } else if (type == "XC") {
  384. this.formData.unLoadDateString = Date.parse(new Date());
  385. }
  386. },
  387. // 数据校验
  388. dataVerify() {
  389. if (this.formData.loadQty == '' || this.formData.loadQty == null || this.formData.loadQty == '0') {
  390. this.$refs.uToast.show({
  391. type: 'warning',
  392. icon: false,
  393. message: "请输入装车吨位!",
  394. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  395. })
  396. } else if (this.formData.loadDateString == '' || this.formData.loadDateString == null) {
  397. this.$refs.uToast.show({
  398. type: 'warning',
  399. icon: false,
  400. message: "请选择装车时间!",
  401. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  402. })
  403. } else if (this.formData.unLoadQty == '' || this.formData.unLoadQty == null || this.formData.unLoadQty == '0') {
  404. this.$refs.uToast.show({
  405. type: 'warning',
  406. icon: false,
  407. message: "请输入卸车吨位!",
  408. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  409. })
  410. } else if (this.formData.unLoadDateString == '' || this.formData.unLoadDateString == null) {
  411. this.$refs.uToast.show({
  412. type: 'warning',
  413. icon: false,
  414. message: "请选择卸车时间!",
  415. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  416. })
  417. }
  418. else if (this.fileList1.length < 2) {
  419. return this.$refs.uToast.show({
  420. type: 'warning',
  421. icon: false,
  422. message: "图片最少两张!",
  423. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  424. })
  425. }
  426. else {
  427. return 'ok';
  428. }
  429. },
  430. // 提交里程点击事件
  431. disabledClick() {
  432. // if (this.status317 == 2 && this.dataVerify() == 'ok') {
  433. // if (this.dataVerify() == 'ok') {
  434. this.submitShow = true
  435. // } else {
  436. // this.$refs.uToast.show({
  437. // type: 'warning',
  438. // icon: false,
  439. // message: "不允许保存!",
  440. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  441. // })
  442. // }
  443. },
  444. // 提交报账单数据校验
  445. upDisabledClick() {
  446. if(this.dataVerify() === 'ok') {
  447. this.upCancel = true
  448. }
  449. },
  450. // 保存订单
  451. setOrderBillsPlansByid(id) {
  452. this.formData.loadQty = this.formData.loadQty == null || this.formData.loadQty == '' ? 0 : this.formData.loadQty
  453. this.formData.unLoadQty = this.formData.unLoadQty == null || this.formData.unLoadQty == '' ? 0 : this.formData.unLoadQty
  454. if(this.formData.loadDateString != null && this.formData.loadDateString != '') {
  455. this.formData.loadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.loadDateString))
  456. } else {
  457. this.formData.loadDateString = null
  458. }
  459. //
  460. if(this.formData.unLoadDateString != null && this.formData.unLoadDateString != '') {
  461. this.formData.unLoadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.unLoadDateString))
  462. } else {
  463. this.formData.unLoadDateString = null
  464. }
  465. this.formData.odometerstart = this.formData.odometerstart == null || this.formData.odometerstart == '' ? 0 : this.formData.odometerstart
  466. this.formData.odometerend = this.formData.odometerend == null || this.formData.odometerend == '' ? 0 : this.formData.odometerend
  467. this.formData.loadmile = this.formData.loadmile == null || this.formData.loadmile == '' ? 0 : this.formData.loadmile
  468. // 行程绕路赋值
  469. if (this.detour.length > 0) {
  470. this.formData.ifDetour = "T"
  471. this.formData.detourEmptyMile = this.formData.detourEmptyMile == null || this.formData.detourEmptyMile == '' ? 0 : this.formData.detourEmptyMile
  472. this.formData.detourLoadMile = this.formData.detourLoadMile == null || this.formData.detourLoadMile == '' ? 0 : this.formData.detourLoadMile
  473. } else {
  474. this.formData.ifDetour = "F"
  475. }
  476. putOrderBillsPlansByid(this.formData).then(ress => {
  477. if (ress.code == 200) {
  478. getOrderBillsPlansByid(this.orderNo).then(res => {
  479. res.data.loadQty == 0 ? res.data.loadQty = null : res.data.loadQty
  480. res.data.unLoadQty == 0 ? res.data.unLoadQty = null : res.data.unLoadQty
  481. res.data.odometerstart == 0 ? res.data.odometerstart = null : res.data.odometerstart
  482. res.data.odometerend == 0 ? res.data.odometerend = null : res.data.odometerend
  483. res.data.loadmile == 0 ? res.data.loadmile = null : res.data.loadmile
  484. res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
  485. res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
  486. if (res.data.ifDetour == "T") {
  487. this.detour.push("行程绕路")
  488. }
  489. for (let role of res.data.roleList) {
  490. if (role.roleKey == 'DZ') {
  491. this.disabled = true;
  492. }
  493. }
  494. // // 审核中
  495. // if (res.data.ifStarted == "S") {
  496. // this.disabled = true;
  497. // }
  498. // // 审核完成
  499. // if (res.data.ifStarted == "A") {
  500. // this.disabled = true;
  501. // }
  502. // 提交报账单
  503. if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
  504. this.disabled = true;
  505. }
  506. this.formData = res.data;
  507. this.fileList1 = res.data.fileList1;
  508. this.loading = false;
  509. if (this.status317 == 6) {
  510. this.disabled = true;
  511. }
  512. this.startDate = this.GetTime(60)
  513. this.submitShow = false
  514. // 保存成功弹窗提示
  515. this.$refs.uToast.show({
  516. type: 'success',
  517. message: "保存成功!",
  518. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  519. })
  520. })
  521. } else {
  522. // 保存失败消息
  523. this.$refs.uToast.show({
  524. icon: false,
  525. message: "保存失败请重试!",
  526. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  527. })
  528. }
  529. })
  530. },
  531. // 提交单据
  532. upReceipts() {
  533. this.loading = true;
  534. this.formData.loadQty = this.formData.loadQty == null || this.formData.loadQty == '' ? 0 : this.formData.loadQty
  535. this.formData.unLoadQty = this.formData.unLoadQty == null || this.formData.unLoadQty == '' ? 0 : this.formData.unLoadQty
  536. if(this.formData.loadDateString != null && this.formData.loadDateString != '') {
  537. this.formData.loadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.loadDateString))
  538. } else {
  539. this.formData.loadDateString = null
  540. }
  541. //
  542. if(this.formData.unLoadDateString != null && this.formData.unLoadDateString != '') {
  543. this.formData.unLoadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.unLoadDateString))
  544. } else {
  545. this.formData.unLoadDateString = null
  546. }
  547. this.formData.odometerstart = this.formData.odometerstart == null || this.formData.odometerstart == '' ? 0 : this.formData.odometerstart
  548. this.formData.odometerend = this.formData.odometerend == null || this.formData.odometerend == '' ? 0 : this.formData.odometerend
  549. this.formData.loadmile = this.formData.loadmile == null || this.formData.loadmile == '' ? 0 : this.formData.loadmile
  550. // 行程绕路赋值
  551. if (this.detour.length > 0) {
  552. this.formData.ifDetour = "T"
  553. this.formData.detourEmptyMile = this.formData.detourEmptyMile == null || this.formData.detourEmptyMile == '' ? 0 : this.formData.detourEmptyMile
  554. this.formData.detourLoadMile = this.formData.detourLoadMile == null || this.formData.detourLoadMile == '' ? 0 : this.formData.detourLoadMile
  555. } else {
  556. this.formData.ifDetour = "F"
  557. }
  558. putOrderBillsPlansByid(this.formData).then(ress => {
  559. if (ress.code == 200) {
  560. // 提交订单
  561. // actId entityId
  562. upReceipts(this.orderNo,{actId:this.formData.actId,entityId:this.formData.entityId}).then(res => {
  563. // 提交报账单成功
  564. this.$refs.uToast.show({
  565. type: 'success',
  566. message: "提交报账单成功!",
  567. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  568. })
  569. })
  570. // 获取详情数据
  571. getOrderBillsPlansByid(this.orderNo).then(res => {
  572. res.data.loadQty == 0 ? res.data.loadQty = null : res.data.loadQty
  573. res.data.unLoadQty == 0 ? res.data.unLoadQty = null : res.data.unLoadQty
  574. res.data.odometerstart == 0 ? res.data.odometerstart = null : res.data.odometerstart
  575. res.data.odometerend == 0 ? res.data.odometerend = null : res.data.odometerend
  576. res.data.loadmile == 0 ? res.data.loadmile = null : res.data.loadmile
  577. res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
  578. res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
  579. if (res.data.ifDetour == "T") {
  580. this.detour.push("行程绕路")
  581. }
  582. for (let role of res.data.roleList) {
  583. if (role.roleKey == 'DZ') {
  584. this.disabled = true;
  585. }
  586. }
  587. // 审核中
  588. // if (res.data.ifStarted == "S") {
  589. // this.disabled = true;
  590. // }
  591. // // 审核完成
  592. // if (res.data.ifStarted == "A") {
  593. // this.disabled = true;
  594. // }
  595. // 提交报账单
  596. if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
  597. this.disabled = true;
  598. }
  599. this.formData = res.data;
  600. this.fileList1 = res.data.fileList1;
  601. this.loading = false;
  602. if (this.status317 == 6) {
  603. this.disabled = true;
  604. }
  605. this.startDate = this.GetTime(60)
  606. this.upCancel = false
  607. // upReceipts(this.orderNo).then(res => {
  608. // console.log(res,'662');
  609. // // 提交报账单成功
  610. // this.$refs.uToast.show({
  611. // type: 'success',
  612. // message: "提交报账单成功!",
  613. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  614. // })
  615. // })
  616. })
  617. } else {
  618. // 提交报账单失败
  619. this.$refs.uToast.show({
  620. icon: false,
  621. message: "提交失败请重试!",
  622. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  623. })
  624. }
  625. })
  626. this.loading = false;
  627. },
  628. // 点击拨打电话
  629. telFun() {
  630. if (this.formData.driver1mobile != null && this.formData.driver1mobile != '') {
  631. uni.makePhoneCall({
  632. phoneNumber: this.formData.driver1mobile, //电话号码
  633. success: function(e) {
  634. // console.log(e);
  635. },
  636. fail: function(e) {
  637. // console.log(e);
  638. }
  639. })
  640. }
  641. },
  642. // 时间计算
  643. GetTime(sky) {
  644. var date = new Date();
  645. var base = Date.parse(date); // 转换为时间戳
  646. var year = date.getFullYear(); //获取当前年份
  647. var mon = date.getMonth() + 1; //获取当前月份
  648. var day = date.getDate(); //获取当前日
  649. var oneDay = 24 * 3600 * 1000
  650. for (var i = 1; i < sky; i++) { //前sky天的时间
  651. var now = new Date(base -= oneDay);
  652. var myear = now.getFullYear();
  653. var month = now.getMonth() + 1;
  654. var mday = now.getDate()
  655. if (i == sky - 1) {
  656. var dataSky = [myear, month >= 10 ? month : '0' + month, mday >= 10 ? mday : '0' + mday]
  657. .join('-')
  658. return dataSky
  659. // + " 00:00:00"
  660. }
  661. }
  662. },
  663. // 删除图片
  664. deletePic(event) {
  665. if (this.formData.ifOrder2ed == 'S' || this.formData.ifOrder2ed == 'O') {
  666. this.$refs.uToast.show({
  667. type: 'warning',
  668. icon: false,
  669. message: "不允许修改!",
  670. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  671. })
  672. } else {
  673. this.event = event;
  674. this.deleteShow = true;
  675. }
  676. },
  677. deleteImg() {
  678. var event = this.event;
  679. var url = event.file.url;
  680. var index = url.lastIndexOf("\/");
  681. var attachId = url.substring(index + 1, url.length);
  682. deleteTmsAttachMngs(attachId).then(res => {
  683. if (res.code == 200) {
  684. this[`fileList${event.name}`].splice(event.index, 1)
  685. // 删除成功消息
  686. this.$refs.uToast.show({
  687. type: 'success',
  688. message: "删除成功!",
  689. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  690. })
  691. } else {
  692. // 删除失败消息
  693. this.$refs.uToast.show({
  694. icon: false,
  695. message: "删除失败请重试!",
  696. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  697. })
  698. }
  699. this.event = {};
  700. this.deleteShow = false;
  701. })
  702. },
  703. // 新增图片
  704. imgUploading(event) {
  705. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  706. let lists = [].concat(event.file)
  707. let fileListLen = this[`fileList${event.name}`].length
  708. lists.map((item) => {
  709. this[`fileList${event.name}`].push({
  710. ...item,
  711. status: 'uploading',
  712. message: '上传中'
  713. })
  714. })
  715. for (let i = 0; i < lists.length; i++) {
  716. let date = this.dateToString("yyyyMMdd");
  717. let dateHHmmss = this.dateToString("yyyy-MM-dd HH:mm:ss");
  718. this.formData.date = date;
  719. insertTmsAttachMngs(this.formData).then(res => {
  720. if (res.code == 200) {
  721. let data = {
  722. name: 'avatarfile',
  723. filePath: lists[i].url
  724. }
  725. // 获取经纬度
  726. let longitude = '';
  727. let latitude = '';
  728. uni.getLocation({
  729. type: 'wgs84',
  730. isHighAccuracy: true,
  731. geocode: true,
  732. success: (map) => {
  733. longitude = map.longitude
  734. latitude = map.latitude
  735. let dataForm = {
  736. attachId: res.data,
  737. longitude: longitude,
  738. latitude: latitude,
  739. updateDate: dateHHmmss,
  740. carRegNo:this.formData.carRegNo
  741. }
  742. // 上传图片
  743. pictureUploading(data, dataForm).then(res => {
  744. let item = this[`fileList${event.name}`][fileListLen]
  745. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(
  746. item, {
  747. status: 'success',
  748. message: '',
  749. url: res.data
  750. }))
  751. fileListLen++
  752. })
  753. },
  754. });
  755. }
  756. })
  757. }
  758. },
  759. dateToString(fmt) {
  760. var date = new Date();
  761. var o = {
  762. "M+": date.getMonth() + 1, //月份
  763. "d+": date.getDate(), //日
  764. "H+": date.getHours(), //小时
  765. "m+": date.getMinutes(), //分
  766. "s+": date.getSeconds(), //秒
  767. "q+": Math.floor((date.getMonth() + 3) / 3), //季度
  768. "S": date.getMilliseconds() //毫秒
  769. };
  770. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1
  771. .length));
  772. for (var k in o)
  773. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ?
  774. (o[
  775. k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  776. return fmt;
  777. },
  778. dateToStringS(fmt, date) {
  779. var o = {
  780. "M+": date.getMonth() + 1, //月份
  781. "d+": date.getDate(), //日
  782. "H+": date.getHours(), //小时
  783. "m+": date.getMinutes(), //分
  784. "s+": date.getSeconds(), //秒
  785. "q+": Math.floor((date.getMonth() + 3) / 3), //季度
  786. "S": date.getMilliseconds() //毫秒
  787. };
  788. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1
  789. .length));
  790. for (var k in o)
  791. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ?
  792. (o[
  793. k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  794. return fmt;
  795. },
  796. uploadFilePromise(url) {
  797. insertTmsAttachMngs(this.formData).then(res => {
  798. if (res.code != 200) {
  799. return null;
  800. }
  801. let data = {
  802. name: 'avatarfile',
  803. filePath: url
  804. }
  805. let dataForm = {
  806. attachId: res.data
  807. }
  808. pictureUploading(data, dataForm).then(res => {
  809. return res.data.data;
  810. })
  811. })
  812. },
  813. // 跳转报销费用页面
  814. skipClaimExpense() {
  815. uni.navigateTo({
  816. url: '/pages/particulars/claimExpense/index?orderNo=' + this.orderNo + '&status376=' +
  817. this
  818. .status376,
  819. });
  820. },
  821. // 跳转注意事项
  822. attention() {
  823. uni.navigateTo({
  824. url: '/pages/particulars/attention/index?remarks=' + this.formData.remarks,
  825. });
  826. },
  827. //输入框小数
  828. checkLoadQty(e) {
  829. //正则表达试
  830. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  831. //重新赋值给input
  832. this.$nextTick(() => {
  833. this.formData.loadQty = e.target.value
  834. })
  835. },
  836. checkUnLoadQty(e) {
  837. //正则表达试
  838. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  839. //重新赋值给input
  840. this.$nextTick(() => {
  841. this.formData.unLoadQty = e.target.value
  842. })
  843. },
  844. checkUnLoadmile(e) {
  845. //正则表达试
  846. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  847. //重新赋值给input
  848. this.$nextTick(() => {
  849. this.formData.loadmile = e.target.value
  850. })
  851. },
  852. checkUnDetourEmptyMile(e) {
  853. //正则表达试
  854. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  855. //重新赋值给input
  856. this.$nextTick(() => {
  857. this.formData.detourEmptyMile = e.target.value
  858. })
  859. },
  860. checkUnDetourLoadMile(e) {
  861. //正则表达试
  862. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  863. //重新赋值给input
  864. this.$nextTick(() => {
  865. this.formData.detourLoadMile = e.target.value
  866. })
  867. }
  868. }
  869. }
  870. </script>
  871. <style lang="scss">
  872. @import url("/font/iconfont.css");
  873. // 当天按钮样式
  874. .today {
  875. width: 80rpx;
  876. height: 60rpx;
  877. background-color: #3c9cff;
  878. color: #fff;
  879. border-radius: 80rpx;
  880. text-align: center;
  881. line-height: 60rpx;
  882. }
  883. // 修改布局方向为纵向布局
  884. .vertical-layout {
  885. display: flex;
  886. }
  887. .textAlign {
  888. text-align: right;
  889. // margin-left: 20rpx;
  890. }
  891. // 分割线
  892. .striping {
  893. width: 100%;
  894. height: 4rpx;
  895. background-color: #f0f0f0f0;
  896. }
  897. .box-box {
  898. padding-left: 30rpx;
  899. padding-right: 30rpx;
  900. }
  901. .a-blue {
  902. color: #3c9cff;
  903. }
  904. .content {
  905. // box-sizing: border-box;
  906. background-color: white;
  907. .head-no {
  908. // border-radius: 0 0 40rpx 40rpx;
  909. // width: 960rpx;
  910. // height: 100rpx;
  911. height: 40rpx;
  912. padding: 0 30rpx;
  913. color: #fff;
  914. vertical-align: middle;
  915. display: flex;
  916. // align-items: center;
  917. align-items: flex-end;
  918. justify-content: space-between;
  919. box-sizing: border-box;
  920. font-size: 34rpx;
  921. font-weight: 700;
  922. background-color: #3c9cff;
  923. }
  924. .head-no-addr {
  925. // width: 960rpx;
  926. height: 100rpx;
  927. // padding-left: 30rpx;
  928. padding: 0 30rpx;
  929. vertical-align: middle;
  930. color: #fff;
  931. font-size: 34rpx;
  932. font-weight: 700;
  933. display: flex;
  934. align-items: center;
  935. justify-content: space-between;
  936. box-sizing: border-box;
  937. background-color: #3c9cff;
  938. }
  939. .head {
  940. // width: 100%;
  941. height: 100rpx;
  942. padding-left: 30rpx;
  943. vertical-align: middle;
  944. display: table-cell;
  945. font-size: 34rpx;
  946. font-weight: 900;
  947. // background-color: red;
  948. }
  949. .box-two {
  950. color: #3b3b3b;
  951. overflow: hidden;
  952. height: 100rpx;
  953. // border-bottom: 2rpx solid #f0f0f0f0;
  954. padding-left: 20rpx;
  955. margin-right: 20rpx;
  956. // font-size: 30rpx;
  957. display: flex;
  958. align-items: center;
  959. .key {
  960. display: inline-block;
  961. width: 24%;
  962. color: #3c9cff;
  963. // font-weight: 700;
  964. }
  965. .value {
  966. margin-left: 20rpx;
  967. // color: #787878;
  968. color: #3b3b3b;
  969. margin-right: 20rpx;
  970. }
  971. .value-two {
  972. width: calc(100% - 24%);
  973. color: #3b3b3b;
  974. // margin-right: 20rpx;
  975. border-bottom: 2rpx dotted #000;
  976. }
  977. }
  978. .box {
  979. color: #3b3b3b;
  980. overflow: hidden;
  981. height: 100rpx;
  982. // border-bottom: 2rpx solid #f0f0f0f0;
  983. padding-left: 20rpx;
  984. // font-size: 30rpx;
  985. display: flex;
  986. align-items: center;
  987. .data {
  988. width: 50%;
  989. height: 100%;
  990. // background-color: pink;
  991. display: flex;
  992. align-items: center;
  993. .key {
  994. // background-color: indianred;
  995. width: 100%;
  996. color: #3c9cff;
  997. }
  998. .key-date {
  999. width: 40%;
  1000. }
  1001. .value {
  1002. margin-right: 20rpx;
  1003. border-bottom: 2rpx dotted #000;
  1004. // color: rgb(144, 147, 153);
  1005. color: #3b3b3b;
  1006. }
  1007. }
  1008. }
  1009. .bottom {
  1010. position: fixed;
  1011. bottom: calc(var(--window-bottom));
  1012. width: 100%;
  1013. height: 130rpx;
  1014. background-color: white;
  1015. .row {
  1016. display: flex;
  1017. justify-content: space-evenly;
  1018. height: 130rpx;
  1019. align-items: center;
  1020. .button {
  1021. // width: 300rpx;
  1022. width: 660rpx;
  1023. }
  1024. }
  1025. }
  1026. .attention {
  1027. padding: 30rpx;
  1028. padding-left: 50rpx;
  1029. padding-bottom: 40rpx;
  1030. background-color: #f0f0f0f0;
  1031. }
  1032. .cushion {
  1033. width: 100%;
  1034. height: 104rpx;
  1035. background-color: #f0f0f0f0;
  1036. }
  1037. }
  1038. </style>