index.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241
  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'}" @change="checkboxChange" :disabled="disabled" 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" :sizeType="['compressed']"
  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. tabName: '',
  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.tabName = option.tabName;
  325. this.getData();
  326. },
  327. onUnload() {
  328. this.formData = {};
  329. this.loading = true;
  330. this.event = {};
  331. },
  332. methods: {
  333. // 查询数据
  334. getData() {
  335. getOrderBillsPlansByid(this.orderNo).then(res => {
  336. res.data.loadQty == 0 ? res.data.loadQty = null : res.data.loadQty
  337. res.data.unLoadQty == 0 ? res.data.unLoadQty = null : res.data.unLoadQty
  338. res.data.odometerstart == 0 ? res.data.odometerstart = null : res.data.odometerstart
  339. res.data.odometerend == 0 ? res.data.odometerend = null : res.data.odometerend
  340. res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
  341. res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
  342. if (res.data.ifDetour == "T") {
  343. this.detour.push("行程绕路")
  344. }
  345. for (let role of res.data.roleList) {
  346. if (role == 'DZ') {
  347. this.disabled = true;
  348. }
  349. if (role == 'JSY') {
  350. this.disabled = false;
  351. }
  352. }
  353. // // 审核中
  354. // if (res.data.ifStarted == "S") {
  355. // this.disabled = true;
  356. // }
  357. // // 审核完成
  358. // if (res.data.ifStarted == "A") {
  359. // this.disabled = true;
  360. // }
  361. // 提交报账单
  362. if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
  363. this.disabled = true;
  364. }
  365. this.formData = res.data;
  366. this.fileList1 = res.data.fileList1;
  367. this.loading = false;
  368. if (this.status317 == 6) {
  369. this.disabled = true;
  370. }
  371. this.startDate = this.GetTime(60)
  372. })
  373. },
  374. // 切换
  375. change(item) {
  376. this.isTabs = item.name;
  377. },
  378. // 当天日期
  379. today(type) {
  380. if (this.disabled) {
  381. return
  382. }
  383. if (type == "ZC") {
  384. this.formData.loadDateString = Date.parse(new Date());
  385. } else if (type == "XC") {
  386. this.formData.unLoadDateString = Date.parse(new Date());
  387. }
  388. },
  389. // 数据校验
  390. dataVerify() {
  391. if (this.formData.loadQty == '' || this.formData.loadQty == null || this.formData.loadQty == '0') {
  392. this.$refs.uToast.show({
  393. type: 'warning',
  394. icon: false,
  395. message: "请输入装车吨位!",
  396. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  397. })
  398. } else if (this.formData.loadDateString == '' || this.formData.loadDateString == null) {
  399. this.$refs.uToast.show({
  400. type: 'warning',
  401. icon: false,
  402. message: "请选择装车时间!",
  403. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  404. })
  405. } else if (this.formData.unLoadQty == '' || this.formData.unLoadQty == null || this.formData.unLoadQty == '0') {
  406. this.$refs.uToast.show({
  407. type: 'warning',
  408. icon: false,
  409. message: "请输入卸车吨位!",
  410. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  411. })
  412. } else if (this.formData.unLoadDateString == '' || this.formData.unLoadDateString == null) {
  413. this.$refs.uToast.show({
  414. type: 'warning',
  415. icon: false,
  416. message: "请选择卸车时间!",
  417. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  418. })
  419. }
  420. else if (this.fileList1.length < 2) {
  421. return this.$refs.uToast.show({
  422. type: 'warning',
  423. icon: false,
  424. message: "图片最少两张!",
  425. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  426. })
  427. }
  428. else {
  429. return 'ok';
  430. }
  431. },
  432. // 提交里程点击事件
  433. disabledClick() {
  434. if(this.tabName == '未装车' && (this.formData.loadQty == null || this.formData.loadQty == 0)) {
  435. this.$refs.uToast.show({
  436. type: 'warning',
  437. icon: false,
  438. message: "请输入装车吨位!",
  439. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  440. })
  441. } else if(this.tabName == '未装车' && (this.formData.loadDateString == null)) {
  442. this.$refs.uToast.show({
  443. type: 'warning',
  444. icon: false,
  445. message: "请选择装车时间!",
  446. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  447. })
  448. } else if(this.tabName == '未卸车' && (this.formData.unLoadQty == null || this.formData.unLoadQty == 0)) {
  449. this.$refs.uToast.show({
  450. type: 'warning',
  451. icon: false,
  452. message: "请输入卸车吨位!",
  453. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  454. })
  455. } else if(this.tabName == '未卸车' && (this.formData.unLoadDateString == null)) {
  456. this.$refs.uToast.show({
  457. type: 'warning',
  458. icon: false,
  459. message: "请选择卸车时间!",
  460. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  461. })
  462. } else {
  463. this.submitShow = true
  464. }
  465. // if (this.status317 == 2 && this.dataVerify() == 'ok') {
  466. // if (this.dataVerify() == 'ok') {
  467. // this.submitShow = true
  468. // } else {
  469. // this.$refs.uToast.show({
  470. // type: 'warning',
  471. // icon: false,
  472. // message: "不允许保存!",
  473. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  474. // })
  475. // }
  476. },
  477. // 提交报账单数据校验
  478. upDisabledClick() {
  479. if(this.dataVerify() === 'ok') {
  480. this.upCancel = true
  481. }
  482. },
  483. // 行程绕路点击事件
  484. checkboxChange() {
  485. if (this.detour.length > 0) {
  486. this.formData.detourEmptyMile = null
  487. this.formData.detourLoadMile = null
  488. this.formData.detourDesc = ""
  489. }
  490. },
  491. // 保存订单
  492. setOrderBillsPlansByid(id) {
  493. this.formData.loadQty = this.formData.loadQty == null || this.formData.loadQty == '' ? 0 : this.formData.loadQty
  494. this.formData.unLoadQty = this.formData.unLoadQty == null || this.formData.unLoadQty == '' ? 0 : this.formData.unLoadQty
  495. if(this.formData.loadDateString != null && this.formData.loadDateString != '') {
  496. this.formData.loadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.loadDateString))
  497. } else {
  498. this.formData.loadDateString = null
  499. }
  500. if(this.formData.unLoadDateString != null && this.formData.unLoadDateString != '') {
  501. this.formData.unLoadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.unLoadDateString))
  502. } else {
  503. this.formData.unLoadDateString = null
  504. }
  505. this.formData.odometerstart = this.formData.odometerstart == null || this.formData.odometerstart == '' ? 0 : this.formData.odometerstart
  506. this.formData.odometerend = this.formData.odometerend == null || this.formData.odometerend == '' ? 0 : this.formData.odometerend
  507. this.formData.loadmile = this.formData.loadmile == null || this.formData.loadmile == '' ? 0 : this.formData.loadmile
  508. // 行程绕路赋值
  509. if (this.detour.length > 0) {
  510. this.formData.ifDetour = "T"
  511. } else {
  512. this.formData.ifDetour = "F"
  513. }
  514. this.formData.detourEmptyMile = this.formData.detourEmptyMile == null || this.formData.detourEmptyMile == '' ? 0 : this.formData.detourEmptyMile
  515. this.formData.detourLoadMile = this.formData.detourLoadMile == null || this.formData.detourLoadMile == '' ? 0 : this.formData.detourLoadMile
  516. this.formData.detourDesc = this.formData.detourDesc == null ? '' : this.formData.detourDesc
  517. putOrderBillsPlansByid(this.formData).then(ress => {
  518. if (ress.code == 200) {
  519. getOrderBillsPlansByid(this.orderNo).then(res => {
  520. res.data.loadQty == 0 ? res.data.loadQty = null : res.data.loadQty
  521. res.data.unLoadQty == 0 ? res.data.unLoadQty = null : res.data.unLoadQty
  522. res.data.odometerstart == 0 ? res.data.odometerstart = null : res.data.odometerstart
  523. res.data.odometerend == 0 ? res.data.odometerend = null : res.data.odometerend
  524. res.data.loadmile == 0 ? res.data.loadmile = null : res.data.loadmile
  525. res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
  526. res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
  527. if (res.data.ifDetour == "T") {
  528. this.detour.push("行程绕路")
  529. }
  530. for (let role of res.data.roleList) {
  531. if (role.roleKey == 'DZ') {
  532. this.disabled = true;
  533. }
  534. }
  535. // // 审核中
  536. // if (res.data.ifStarted == "S") {
  537. // this.disabled = true;
  538. // }
  539. // // 审核完成
  540. // if (res.data.ifStarted == "A") {
  541. // this.disabled = true;
  542. // }
  543. // 提交报账单
  544. if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
  545. this.disabled = true;
  546. }
  547. this.formData = res.data;
  548. this.fileList1 = res.data.fileList1;
  549. this.loading = false;
  550. if (this.status317 == 6) {
  551. this.disabled = true;
  552. }
  553. this.startDate = this.GetTime(60)
  554. this.submitShow = false
  555. // 保存成功弹窗提示
  556. this.$refs.uToast.show({
  557. type: 'success',
  558. message: "保存成功!",
  559. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  560. })
  561. })
  562. } else {
  563. // 保存失败消息
  564. this.$refs.uToast.show({
  565. icon: false,
  566. message: "保存失败请重试!",
  567. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  568. })
  569. }
  570. })
  571. },
  572. // 提交单据
  573. upReceipts() {
  574. this.loading = true;
  575. this.formData.loadQty = this.formData.loadQty == null || this.formData.loadQty == '' ? 0 : this.formData.loadQty
  576. this.formData.unLoadQty = this.formData.unLoadQty == null || this.formData.unLoadQty == '' ? 0 : this.formData.unLoadQty
  577. if(this.formData.loadDateString != null && this.formData.loadDateString != '') {
  578. this.formData.loadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.loadDateString))
  579. } else {
  580. this.formData.loadDateString = null
  581. }
  582. //
  583. if(this.formData.unLoadDateString != null && this.formData.unLoadDateString != '') {
  584. this.formData.unLoadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.unLoadDateString))
  585. } else {
  586. this.formData.unLoadDateString = null
  587. }
  588. this.formData.odometerstart = this.formData.odometerstart == null || this.formData.odometerstart == '' ? 0 : this.formData.odometerstart
  589. this.formData.odometerend = this.formData.odometerend == null || this.formData.odometerend == '' ? 0 : this.formData.odometerend
  590. this.formData.loadmile = this.formData.loadmile == null || this.formData.loadmile == '' ? 0 : this.formData.loadmile
  591. // 行程绕路赋值
  592. if (this.detour.length > 0) {
  593. this.formData.ifDetour = "T"
  594. this.formData.detourEmptyMile = this.formData.detourEmptyMile == null || this.formData.detourEmptyMile == '' ? 0 : this.formData.detourEmptyMile
  595. this.formData.detourLoadMile = this.formData.detourLoadMile == null || this.formData.detourLoadMile == '' ? 0 : this.formData.detourLoadMile
  596. } else {
  597. this.formData.ifDetour = "F"
  598. }
  599. putOrderBillsPlansByid(this.formData).then(ress => {
  600. if (ress.code == 200) {
  601. // 提交订单
  602. // actId entityId
  603. upReceipts(this.orderNo,{actId:this.formData.actId,entityId:this.formData.entityId}).then(res => {
  604. // 提交报账单成功
  605. this.$refs.uToast.show({
  606. type: 'success',
  607. message: "提交报账单成功!",
  608. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  609. })
  610. })
  611. // 获取详情数据
  612. getOrderBillsPlansByid(this.orderNo).then(res => {
  613. res.data.loadQty == 0 ? res.data.loadQty = null : res.data.loadQty
  614. res.data.unLoadQty == 0 ? res.data.unLoadQty = null : res.data.unLoadQty
  615. res.data.odometerstart == 0 ? res.data.odometerstart = null : res.data.odometerstart
  616. res.data.odometerend == 0 ? res.data.odometerend = null : res.data.odometerend
  617. res.data.loadmile == 0 ? res.data.loadmile = null : res.data.loadmile
  618. res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
  619. res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
  620. if (res.data.ifDetour == "T") {
  621. this.detour.push("行程绕路")
  622. }
  623. for (let role of res.data.roleList) {
  624. if (role.roleKey == 'DZ') {
  625. this.disabled = true;
  626. }
  627. }
  628. // 审核中
  629. // if (res.data.ifStarted == "S") {
  630. // this.disabled = true;
  631. // }
  632. // // 审核完成
  633. // if (res.data.ifStarted == "A") {
  634. // this.disabled = true;
  635. // }
  636. // 提交报账单
  637. if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
  638. this.disabled = true;
  639. }
  640. this.formData = res.data;
  641. this.fileList1 = res.data.fileList1;
  642. this.loading = false;
  643. if (this.status317 == 6) {
  644. this.disabled = true;
  645. }
  646. this.startDate = this.GetTime(60)
  647. this.upCancel = false
  648. // upReceipts(this.orderNo).then(res => {
  649. // console.log(res,'662');
  650. // // 提交报账单成功
  651. // this.$refs.uToast.show({
  652. // type: 'success',
  653. // message: "提交报账单成功!",
  654. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  655. // })
  656. // })
  657. })
  658. } else {
  659. // 提交报账单失败
  660. this.$refs.uToast.show({
  661. icon: false,
  662. message: "提交失败请重试!",
  663. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  664. })
  665. }
  666. })
  667. this.loading = false;
  668. },
  669. // 点击拨打电话
  670. telFun() {
  671. if (this.formData.driver1mobile != null && this.formData.driver1mobile != '') {
  672. uni.makePhoneCall({
  673. phoneNumber: this.formData.driver1mobile, //电话号码
  674. success: function(e) {
  675. // console.log(e);
  676. },
  677. fail: function(e) {
  678. // console.log(e);
  679. }
  680. })
  681. }
  682. },
  683. // 时间计算
  684. GetTime(sky) {
  685. var date = new Date();
  686. var base = Date.parse(date); // 转换为时间戳
  687. var year = date.getFullYear(); //获取当前年份
  688. var mon = date.getMonth() + 1; //获取当前月份
  689. var day = date.getDate(); //获取当前日
  690. var oneDay = 24 * 3600 * 1000
  691. for (var i = 1; i < sky; i++) { //前sky天的时间
  692. var now = new Date(base -= oneDay);
  693. var myear = now.getFullYear();
  694. var month = now.getMonth() + 1;
  695. var mday = now.getDate()
  696. if (i == sky - 1) {
  697. var dataSky = [myear, month >= 10 ? month : '0' + month, mday >= 10 ? mday : '0' + mday]
  698. .join('-')
  699. return dataSky
  700. // + " 00:00:00"
  701. }
  702. }
  703. },
  704. // 删除图片
  705. deletePic(event) {
  706. if (this.formData.ifOrder2ed == 'S' || this.formData.ifOrder2ed == 'O') {
  707. this.$refs.uToast.show({
  708. type: 'warning',
  709. icon: false,
  710. message: "不允许修改!",
  711. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  712. })
  713. } else {
  714. for (let role of this.formData.roleList) {
  715. if (role == 'JSY') {
  716. this.event = event;
  717. this.deleteShow = true;
  718. }
  719. }
  720. }
  721. },
  722. deleteImg() {
  723. var event = this.event;
  724. var url = event.file.url;
  725. var index = url.lastIndexOf("\/");
  726. var attachId = url.substring(index + 1, url.length);
  727. deleteTmsAttachMngs(attachId).then(res => {
  728. if (res.code == 200) {
  729. this[`fileList${event.name}`].splice(event.index, 1)
  730. // 删除成功消息
  731. this.$refs.uToast.show({
  732. type: 'success',
  733. message: "删除成功!",
  734. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  735. })
  736. } else {
  737. // 删除失败消息
  738. this.$refs.uToast.show({
  739. icon: false,
  740. message: "删除失败请重试!",
  741. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  742. })
  743. }
  744. this.event = {};
  745. this.deleteShow = false;
  746. })
  747. },
  748. // 新增图片
  749. imgUploading(event) {
  750. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  751. let lists = [].concat(event.file)
  752. let fileListLen = this[`fileList${event.name}`].length
  753. lists.map((item) => {
  754. this[`fileList${event.name}`].push({
  755. ...item,
  756. status: 'uploading',
  757. message: '上传中'
  758. })
  759. })
  760. for (let i = 0; i < lists.length; i++) {
  761. let date = this.dateToString("yyyyMMdd");
  762. let dateHHmmss = this.dateToString("yyyy-MM-dd HH:mm:ss");
  763. this.formData.date = date;
  764. insertTmsAttachMngs(this.formData).then(res => {
  765. if (res.code == 200) {
  766. uni.compressImage({
  767. src: lists[i].url,
  768. quality: 80,
  769. complete: ress => {
  770. let data = {
  771. name: 'avatarfile',
  772. filePath: ress.tempFilePath
  773. }
  774. // 获取经纬度
  775. let longitude = '';
  776. let latitude = '';
  777. uni.getLocation({
  778. type: 'wgs84',
  779. isHighAccuracy: true,
  780. geocode: true,
  781. fail: () => {
  782. this.fileList1.pop();
  783. this.$refs.uToast.show({
  784. type: 'warning',
  785. icon: false,
  786. message: "请打开定位!",
  787. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  788. })
  789. return
  790. },
  791. success: (map) => {
  792. longitude = map.longitude
  793. latitude = map.latitude
  794. let dataForm = {
  795. attachId: res.data,
  796. longitude: longitude,
  797. latitude: latitude,
  798. updateDate: dateHHmmss,
  799. carRegNo:this.formData.carRegNo
  800. }
  801. // 上传图片
  802. pictureUploading(data, dataForm).then(res => {
  803. let item = this[`fileList${event.name}`][fileListLen]
  804. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(
  805. item, {
  806. status: 'success',
  807. message: '',
  808. url: res.data
  809. }))
  810. fileListLen++
  811. })
  812. },
  813. });
  814. }
  815. })
  816. }
  817. })
  818. }
  819. },
  820. dateToString(fmt) {
  821. var date = new Date();
  822. var o = {
  823. "M+": date.getMonth() + 1, //月份
  824. "d+": date.getDate(), //日
  825. "H+": date.getHours(), //小时
  826. "m+": date.getMinutes(), //分
  827. "s+": date.getSeconds(), //秒
  828. "q+": Math.floor((date.getMonth() + 3) / 3), //季度
  829. "S": date.getMilliseconds() //毫秒
  830. };
  831. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1
  832. .length));
  833. for (var k in o)
  834. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ?
  835. (o[
  836. k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  837. return fmt;
  838. },
  839. dateToStringS(fmt, date) {
  840. var o = {
  841. "M+": date.getMonth() + 1, //月份
  842. "d+": date.getDate(), //日
  843. "H+": date.getHours(), //小时
  844. "m+": date.getMinutes(), //分
  845. "s+": date.getSeconds(), //秒
  846. "q+": Math.floor((date.getMonth() + 3) / 3), //季度
  847. "S": date.getMilliseconds() //毫秒
  848. };
  849. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1
  850. .length));
  851. for (var k in o)
  852. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ?
  853. (o[
  854. k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  855. return fmt;
  856. },
  857. uploadFilePromise(url) {
  858. insertTmsAttachMngs(this.formData).then(res => {
  859. if (res.code != 200) {
  860. return null;
  861. }
  862. let data = {
  863. name: 'avatarfile',
  864. filePath: url
  865. }
  866. let dataForm = {
  867. attachId: res.data
  868. }
  869. pictureUploading(data, dataForm).then(res => {
  870. return res.data.data;
  871. })
  872. })
  873. },
  874. // 跳转报销费用页面
  875. skipClaimExpense() {
  876. uni.navigateTo({
  877. url: '/pages/particulars/claimExpense/index?orderNo=' + this.orderNo + '&status376=' +
  878. this
  879. .status376,
  880. });
  881. },
  882. // 跳转注意事项
  883. attention() {
  884. uni.navigateTo({
  885. url: '/pages/particulars/attention/index?remarks=' + this.formData.remarks,
  886. });
  887. },
  888. //输入框小数
  889. checkLoadQty(e) {
  890. //正则表达试
  891. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  892. //重新赋值给input
  893. this.$nextTick(() => {
  894. this.formData.loadQty = e.target.value
  895. })
  896. },
  897. checkUnLoadQty(e) {
  898. //正则表达试
  899. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  900. //重新赋值给input
  901. this.$nextTick(() => {
  902. this.formData.unLoadQty = e.target.value
  903. })
  904. },
  905. checkUnLoadmile(e) {
  906. //正则表达试
  907. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  908. //重新赋值给input
  909. this.$nextTick(() => {
  910. this.formData.loadmile = e.target.value
  911. })
  912. },
  913. checkUnDetourEmptyMile(e) {
  914. //正则表达试
  915. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  916. //重新赋值给input
  917. this.$nextTick(() => {
  918. this.formData.detourEmptyMile = e.target.value
  919. })
  920. },
  921. checkUnDetourLoadMile(e) {
  922. //正则表达试
  923. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  924. //重新赋值给input
  925. this.$nextTick(() => {
  926. this.formData.detourLoadMile = e.target.value
  927. })
  928. }
  929. }
  930. }
  931. </script>
  932. <style lang="scss">
  933. @import url("/font/iconfont.css");
  934. // 当天按钮样式
  935. .today {
  936. width: 80rpx;
  937. height: 60rpx;
  938. background-color: #3c9cff;
  939. color: #fff;
  940. border-radius: 80rpx;
  941. text-align: center;
  942. line-height: 60rpx;
  943. }
  944. // 修改布局方向为纵向布局
  945. .vertical-layout {
  946. display: flex;
  947. }
  948. .textAlign {
  949. text-align: right;
  950. // margin-left: 20rpx;
  951. }
  952. // 分割线
  953. .striping {
  954. width: 100%;
  955. height: 4rpx;
  956. background-color: #f0f0f0f0;
  957. }
  958. .box-box {
  959. padding-left: 30rpx;
  960. padding-right: 30rpx;
  961. }
  962. .a-blue {
  963. color: #3c9cff;
  964. }
  965. .content {
  966. // box-sizing: border-box;
  967. background-color: white;
  968. .head-no {
  969. // border-radius: 0 0 40rpx 40rpx;
  970. // width: 960rpx;
  971. // height: 100rpx;
  972. height: 40rpx;
  973. padding: 0 30rpx;
  974. color: #fff;
  975. vertical-align: middle;
  976. display: flex;
  977. // align-items: center;
  978. align-items: flex-end;
  979. justify-content: space-between;
  980. box-sizing: border-box;
  981. font-size: 34rpx;
  982. font-weight: 700;
  983. background-color: #3c9cff;
  984. }
  985. .head-no-addr {
  986. // width: 960rpx;
  987. height: 100rpx;
  988. // padding-left: 30rpx;
  989. padding: 0 30rpx;
  990. vertical-align: middle;
  991. color: #fff;
  992. font-size: 34rpx;
  993. font-weight: 700;
  994. display: flex;
  995. align-items: center;
  996. justify-content: space-between;
  997. box-sizing: border-box;
  998. background-color: #3c9cff;
  999. }
  1000. .head {
  1001. // width: 100%;
  1002. height: 100rpx;
  1003. padding-left: 30rpx;
  1004. vertical-align: middle;
  1005. display: table-cell;
  1006. font-size: 34rpx;
  1007. font-weight: 900;
  1008. // background-color: red;
  1009. }
  1010. .box-two {
  1011. color: #3b3b3b;
  1012. overflow: hidden;
  1013. height: 100rpx;
  1014. // border-bottom: 2rpx solid #f0f0f0f0;
  1015. padding-left: 20rpx;
  1016. margin-right: 20rpx;
  1017. // font-size: 30rpx;
  1018. display: flex;
  1019. align-items: center;
  1020. .key {
  1021. display: inline-block;
  1022. width: 24%;
  1023. color: #3c9cff;
  1024. // font-weight: 700;
  1025. }
  1026. .value {
  1027. margin-left: 20rpx;
  1028. // color: #787878;
  1029. color: #3b3b3b;
  1030. margin-right: 20rpx;
  1031. }
  1032. .value-two {
  1033. width: calc(100% - 24%);
  1034. color: #3b3b3b;
  1035. // margin-right: 20rpx;
  1036. border-bottom: 2rpx dotted #000;
  1037. }
  1038. }
  1039. .box {
  1040. color: #3b3b3b;
  1041. overflow: hidden;
  1042. height: 100rpx;
  1043. // border-bottom: 2rpx solid #f0f0f0f0;
  1044. padding-left: 20rpx;
  1045. // font-size: 30rpx;
  1046. display: flex;
  1047. align-items: center;
  1048. .data {
  1049. width: 50%;
  1050. height: 100%;
  1051. // background-color: pink;
  1052. display: flex;
  1053. align-items: center;
  1054. .key {
  1055. // background-color: indianred;
  1056. width: 100%;
  1057. color: #3c9cff;
  1058. }
  1059. .key-date {
  1060. width: 40%;
  1061. }
  1062. .value {
  1063. margin-right: 20rpx;
  1064. border-bottom: 2rpx dotted #000;
  1065. // color: rgb(144, 147, 153);
  1066. color: #3b3b3b;
  1067. }
  1068. }
  1069. }
  1070. .bottom {
  1071. position: fixed;
  1072. bottom: calc(var(--window-bottom));
  1073. width: 100%;
  1074. height: 130rpx;
  1075. background-color: white;
  1076. .row {
  1077. display: flex;
  1078. justify-content: space-evenly;
  1079. height: 130rpx;
  1080. align-items: center;
  1081. .button {
  1082. // width: 300rpx;
  1083. width: 660rpx;
  1084. }
  1085. }
  1086. }
  1087. .attention {
  1088. padding: 30rpx;
  1089. padding-left: 50rpx;
  1090. padding-bottom: 40rpx;
  1091. background-color: #f0f0f0f0;
  1092. }
  1093. .cushion {
  1094. width: 100%;
  1095. height: 104rpx;
  1096. background-color: #f0f0f0f0;
  1097. }
  1098. }
  1099. </style>