index.vue 24 KB

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