index.vue 34 KB

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