index.vue 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735
  1. <template>
  2. <view class="content">
  3. <u-sticky>
  4. <view class="head" style="background-color: #3c9cff; color: #fff;">
  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. <view class="striping"></view>
  25. <!-- <view class="head" @click="telFun">
  26. <text>驾驶员: {{formData.driver1Name == null ? '' : formData.driver1Name}}&nbsp;电话:&nbsp;{{formData.driver1mobile == null ? '' : formData.driver1mobile}}</text>
  27. </view> -->
  28. <u-tabs :list="tabs" @change="change" :activeStyle="{
  29. width: '180rpx',
  30. height: '60rpx',
  31. color: '#fff',
  32. backgroundColor: '#3c9cff',
  33. borderRadius: '80rpx',
  34. lineHeight: '60rpx',
  35. textAlign: 'center'
  36. }" :inactiveStyle="{
  37. width: '180rpx',
  38. height: '60rpx',
  39. color: '#3c9cff',
  40. backgroundColor: '#f0f0f0f0',
  41. borderRadius: '80rpx',
  42. lineHeight: '60rpx',
  43. textAlign: 'center'
  44. }"></u-tabs>
  45. <view v-if="isTabs == '行程费用'">
  46. <view class="box-box">
  47. <view class="box">
  48. <view class="data">
  49. <text class="key">ETC金额</text>
  50. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  51. @input="checkUnLoadetc" v-model="formData.loadetc" />
  52. </view>
  53. <view class="data">
  54. <text class="key">现金过路费</text>
  55. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  56. @input="checkUnLoadtoll" v-model="formData.loadtoll" />
  57. </view>
  58. </view>
  59. <view class="box">
  60. <view class="data">
  61. <text class="key">公司加油(升)</text>
  62. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  63. @input="checkUnOilhomeQty" v-model="formData.oilhomeQty" />
  64. </view>
  65. <view class="data">
  66. <text class="key">加油金额</text>
  67. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  68. @input="checkUnOilhomeAmt" v-model="formData.oilhomeAmt" />
  69. </view>
  70. </view>
  71. <view class="box">
  72. <view class="data-two">
  73. <text class="key">定点加油1</text>
  74. <view class="list">
  75. <uni-data-select :disabled="disabled" :localdata="gasStationList"
  76. v-model="formData.gasstation1" @change="gasstation1Change"></uni-data-select>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="box">
  81. <view class="data">
  82. <text class="key">升&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;数</text>
  83. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  84. @input="checkUnOilappoint1Qty" placeholder-style="font-size:24rpx" placeholder="请输入升数" v-model="formData.oilappoint1Qty" />
  85. </view>
  86. <view class="data">
  87. <text class="key">金&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额</text>
  88. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  89. @input="checkUnOilappoint1Amt" placeholder-style="font-size:24rpx" placeholder="请输入金额" v-model="formData.oilappoint1Amt" />
  90. </view>
  91. </view>
  92. <view class="box">
  93. <view class="data-two">
  94. <text class="key">定点加油2</text>
  95. <view class="list">
  96. <uni-data-select :disabled="disabled" :localdata="gasStationList"
  97. v-model="formData.gasstation2" @change="gasstation2Change"></uni-data-select>
  98. </view>
  99. </view>
  100. </view>
  101. <view class="box">
  102. <view class="data">
  103. <text class="key">升&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;数</text>
  104. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  105. @input="checkUnOilappoint2Qty" placeholder-style="font-size:24rpx" placeholder="请输入升数" v-model="formData.oilappoint2Qty" />
  106. </view>
  107. <view class="data">
  108. <text class="key">金&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额</text>
  109. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  110. @input="checkUnOilappoint2Amt" placeholder-style="font-size:24rpx" placeholder="请输入金额" v-model="formData.oilappoint2Amt" />
  111. </view>
  112. </view>
  113. <view class="box">
  114. <view class="data-two">
  115. <text class="key">定点加油3</text>
  116. <view class="list">
  117. <uni-data-select :disabled="disabled" :localdata="gasStationList"
  118. v-model="formData.gasstation3" @change="gasstation3Change"></uni-data-select>
  119. </view>
  120. </view>
  121. </view>
  122. <view class="box">
  123. <view class="data">
  124. <text class="key">升&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;数</text>
  125. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  126. @input="checkUnOilappoint3Qty" placeholder-style="font-size:24rpx" placeholder="请输入升数" v-model="formData.oilappoint3Qty" />
  127. </view>
  128. <view class="data">
  129. <text class="key">金&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额</text>
  130. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  131. @input="checkUnOilappoint3Amt" placeholder-style="font-size:24rpx" placeholder="请输入金额" v-model="formData.oilappoint3Amt" />
  132. </view>
  133. </view>
  134. <view class="box">
  135. <view class="data">
  136. <text class="key">现金加油(升)</text>
  137. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  138. @input="checkUnOilcash1Qty" v-model="formData.oilcash1Qty" />
  139. </view>
  140. <view class="data">
  141. <text class="key">加油金额</text>
  142. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  143. @input="checkUnOilcash1Amt" v-model="formData.oilcash1Amt" />
  144. </view>
  145. </view>
  146. <view class="box">
  147. <view class="data">
  148. <text class="key">油卡加油(升)</text>
  149. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  150. @input="checkUnOilcardQty" v-model="formData.oilcardQty" />
  151. </view>
  152. <view class="data">
  153. <text class="key">加油金额</text>
  154. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  155. @input="checkUnOilcardAmt" v-model="formData.oilcardAmt" />
  156. </view>
  157. </view>
  158. <view class="box-two">
  159. <text class="key">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</text>
  160. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled"
  161. v-model="formData.driverassdesc" />
  162. </view>
  163. <!-- </u-collapse-item> -->
  164. </view>
  165. <view class="box-box" style="margin-top: 40rpx;">
  166. <view style="margin-bottom: 20rpx;">
  167. <text style="color: #3c9cff;">单据拍照存档</text>
  168. </view>
  169. <u-upload :fileList="fileList1" accept="image" :sizeType="['compressed']" capture="camera"
  170. @afterRead="imgUploading" @delete="deletePic" name="1" multiple :disabled="disabled"
  171. :previewFullImage="true"></u-upload>
  172. </view>
  173. </view>
  174. <view v-if="isTabs == '其他费用'">
  175. <view class="table">
  176. <view class="data vertical-layout" v-for="(item, index) in itemsList" :key="index">
  177. <view class="name">
  178. <text style="color: #3c9cff;">{{ item.cname }}</text>
  179. </view>
  180. <view class="sum">
  181. <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
  182. @input="checkUnAmt(item.amt, index)" @click="inputHeight" cursor-spacing="30"
  183. :always-embed="true" :adjust-position="true" v-model="item.amt" />
  184. </view>
  185. <view class="remarks" style="border-bottom: 2rpx dotted #000;">
  186. <input v-model="item.remarks" placeholder-style="font-size:24rpx" placeholder="请输入备注">
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. <view class="cushion">
  192. </view>
  193. <!-- <view class="bottom vertical-layout" style="z-index: 4;" v-if="status376 == 2 || status376 == 0">
  194. <view class="bottom-bottom">
  195. <view class="money">
  196. <text>报销:</text> {{' '}}
  197. <text style="color: #ff9f1c;">¥ {{money}}</text>
  198. </view>
  199. <view class="button">
  200. <view class="button-button">
  201. <u-button iconColor="#3c9cff" shape="circle" type="primary" @click="submitShow = true"
  202. :disabled="disabled" text="提交费用"></u-button>
  203. </view>
  204. </view>
  205. </view>
  206. </view> -->
  207. <view v-if="formData.ifStarted && formData.ifStarted != 'A'">
  208. <!-- 驾驶员 -->
  209. <view v-if="button" class="bottom" style="z-index: 4;">
  210. <view class="row">
  211. <view class="button">
  212. <u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="saveDisabled"
  213. @click="submitShow = true" text="保存数据"></u-button>
  214. </view>
  215. <view class="button">
  216. <u-button iconColor="#fe8c00;" color="#fe8c00" shape="circle" type="primary" :disabled="upDisabled"
  217. @click="upButtonClick('TJ')" text="提交报账单"></u-button>
  218. </view>
  219. </view>
  220. </view>
  221. <!-- 队长 -->
  222. <view v-else class="bottom" style="z-index: 4;">
  223. <view class="row">
  224. <view class="button">
  225. <u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="sDisabled"
  226. @click="auditTClick" text="通过"></u-button>
  227. </view>
  228. <view class="button">
  229. <u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="sDisabled"
  230. @click="auditFClick" text="驳回"></u-button>
  231. </view>
  232. </view>
  233. </view>
  234. </view>
  235. <!-- 遮盖罩 -->
  236. <u-loading-page :loading="loading" style="z-index: 20000;"></u-loading-page>
  237. <!-- 消息提示 -->
  238. <u-toast ref="uToast"></u-toast>
  239. <u-modal :show="submitShow" title="提示" showCancelButton @confirm="submit" @cancel="submitShow = false">
  240. <view class="slot-content">
  241. <rich-text nodes="确定要保存数据吗?"></rich-text>
  242. </view>
  243. </u-modal>
  244. <u-modal :show="upAuditShow" confirmColor="#fe8c00" title="提示" showCancelButton @confirm="upReview" @cancel="upAuditShow = false">
  245. <view class="slot-content">
  246. <rich-text nodes="点击确认后该业务将锁定,无法添加修改费用报销!确定要提交吗?"></rich-text>
  247. </view>
  248. </u-modal>
  249. <u-modal :show="deleteShow" title="提示" showCancelButton @confirm="deleteImg" @cancel="deleteShow = false">
  250. <view class="slot-content">
  251. <rich-text nodes="确定删除这张图片吗?"></rich-text>
  252. </view>
  253. </u-modal>
  254. <u-modal :show="auditTShow" title="提示" showCancelButton @confirm="check('T')" @cancel="auditTShow = false">
  255. <view class="slot-content" style="display: flex; flex-direction: column; align-items: center;">
  256. <rich-text nodes="确定要审核通过吗?"></rich-text>
  257. <input style="margin-top: 20rpx;"
  258. selection-start="0"
  259. selection-end="9999"
  260. placeholder="请输入通过意见"
  261. placeholder-style="font-size: 28rpx"
  262. v-model="formData.audit2Desc"
  263. />
  264. </view>
  265. </u-modal>
  266. <u-modal :show="auditFShow" title="提示" showCancelButton @confirm="check('F')" @cancel="auditFShow = false">
  267. <view class="slot-content" style="display: flex; flex-direction: column; align-items: center;">
  268. <rich-text nodes="确定要驳回吗?"></rich-text>
  269. <input style="margin-top: 20rpx;"
  270. selection-start="0"
  271. selection-end="9999"
  272. placeholder="请输入驳回意见"
  273. placeholder-style="font-size: 28rpx"
  274. v-model="formData.audit2Desc"
  275. />
  276. </view>
  277. </u-modal>
  278. </view>
  279. </template>
  280. <script>
  281. import {
  282. getGasStations,
  283. getItems,
  284. insertLoadFeeItems,
  285. getLoadFeeItems,
  286. isMileage
  287. } from "@/api/reimbursement"
  288. import {
  289. getOrderBillsPlansByid,
  290. putOrderBillsPlansByid,
  291. insertTmsAttachMngs,
  292. pictureUploading,
  293. deleteTmsAttachMngs,
  294. submitAudit,
  295. audit
  296. } from "@/api/particulars"
  297. export default {
  298. data() {
  299. return {
  300. orderNo: '',
  301. // 遮盖罩
  302. loading: true,
  303. formData: {
  304. // itemsVoList: [],
  305. // oilappoint1Qty: 1,
  306. // oilappoint2Qty: 1
  307. },
  308. // 报销费用list
  309. gasStationList: [],
  310. // 其他费用list
  311. itemsList: [],
  312. // 其他费用被选中
  313. selectedIndexs: [],
  314. radioValueOne: '', // 当前 radio 的值
  315. numOne: 0, //用于区分是否是重复选中
  316. radioValueTwo: '', // 当前 radio 的值
  317. numTwo: 0, //用于区分是否是重复选中
  318. // 输入框禁用
  319. disabled: false,
  320. // 保存数据按钮
  321. saveDisabled: false,
  322. // 提交数据按钮
  323. upDisabled: false,
  324. // 审核按钮禁用
  325. sDisabled: true,
  326. // 底部按钮
  327. button: null,
  328. status376: 0,
  329. selectionLength: 0,
  330. fileList1: [],
  331. // 删除弹框
  332. deleteShow: false,
  333. // 提交费用弹窗
  334. submitShow: false,
  335. // 提交审核弹框
  336. upAuditShow: false,
  337. // 审核通过弹框
  338. auditTShow: false,
  339. // 审核驳回弹框
  340. auditFShow: false,
  341. event: {},
  342. vHeight: 0,
  343. tabs: [{
  344. name: '行程费用'
  345. }, {
  346. name: '其他费用'
  347. }],
  348. isTabs: '行程费用',
  349. // 报销金额
  350. money: 0
  351. }
  352. },
  353. onUnload() {
  354. this.formData = {};
  355. this.loading = true;
  356. },
  357. onLoad: function(option) {
  358. this.status376 = option.status;
  359. this.orderNo = option.orderNo;
  360. if (this.status376 == 6) {
  361. this.disabled = true;
  362. }
  363. this.getData();
  364. this.getLoadFeeItemsfun()
  365. },
  366. methods: {
  367. change(item) {
  368. this.isTabs = item.name;
  369. },
  370. auditTClick() {
  371. this.formData.audit2Desc = "审核通过"
  372. this.auditTShow = true
  373. },
  374. auditFClick() {
  375. this.formData.audit2Desc = null
  376. this.auditFShow = true
  377. },
  378. getData() {
  379. // 报销费用下拉选
  380. getGasStations().then(res => {
  381. // this.gasStationList = res.data
  382. for (var item in res.data) {
  383. var data = {
  384. text: res.data[item].cname,
  385. value: res.data[item].cname
  386. };
  387. this.gasStationList.push(data);
  388. }
  389. getItems().then(res => {
  390. this.itemsList = res.data
  391. })
  392. })
  393. },
  394. getLoadFeeItemsfun(){
  395. getLoadFeeItems(this.orderNo).then(res => {
  396. res.data.loadetc == 0 ? res.data.loadetc = null : res.data.loadetc
  397. res.data.loadtoll == 0 ? res.data.loadtoll = null : res.data.loadtoll
  398. res.data.oilhomeQty == 0 ? res.data.oilhomeQty = null : res.data.oilhomeQty
  399. res.data.oilhomeAmt == 0 ? res.data.oilhomeAmt = null : res.data.oilhomeAmt
  400. res.data.oilappoint1Qty == 0 ? res.data.oilappoint1Qty = null : res.data.oilappoint1Qty
  401. res.data.oilappoint1Amt == 0 ? res.data.oilappoint1Amt = null : res.data.oilappoint1Amt
  402. res.data.oilappoint2Qty == 0 ? res.data.oilappoint2Qty = null : res.data.oilappoint2Qty
  403. res.data.oilappoint2Amt == 0 ? res.data.oilappoint2Amt = null : res.data.oilappoint2Amt
  404. res.data.oilappoint3Qty == 0 ? res.data.oilappoint3Qty = null : res.data.oilappoint3Qty
  405. res.data.oilappoint3Amt == 0 ? res.data.oilappoint3Amt = null : res.data.oilappoint3Amt
  406. res.data.oilcash1Qty == 0 ? res.data.oilcash1Qty = null : res.data.oilcash1Qty
  407. res.data.oilcash1Amt == 0 ? res.data.oilcash1Amt = null : res.data.oilcash1Amt
  408. res.data.oilcardQty == 0 ? res.data.oilcardQty = null : res.data.oilcardQty
  409. res.data.oilcardAmt == 0 ? res.data.oilcardAmt = null : res.data.oilcardAmt
  410. for (let item of this.itemsList) {
  411. if (item == 0) {
  412. item.amt = null
  413. }
  414. }
  415. // // 角色
  416. for (let role of res.data.roleList) {
  417. if (role == 'DZ') {
  418. this.button = false;
  419. this.disabled = true;
  420. }
  421. if (role == 'JSY') {
  422. this.button = true;
  423. this.disabled = false;
  424. }
  425. }
  426. // 审核中
  427. if (
  428. res.data.ifStarted == "S") {
  429. this.disabled = true;
  430. this.saveDisabled = true;
  431. this.upDisabled = true;
  432. this.sDisabled = false;
  433. }
  434. // 审核完成
  435. if (
  436. res.data.ifStarted == "A") {
  437. this.disabled = true;
  438. this.saveDisabled = true;
  439. this.upDisabled = true;
  440. }
  441. // 未提交
  442. // if (res.data.ifLoaded != "T" ||
  443. // res.data.ifUnLoaded != "T") {
  444. // this.disabled = false;
  445. // this.saveDisabled = false;
  446. // this.upDisabled = true;
  447. // }
  448. this.formData = res.data;
  449. var costBreakdownList = res.data.loadFeeItemsList;
  450. this.itemsList = costBreakdownList;
  451. for (const key in this.itemsList) {
  452. if (this.itemsList[key].amt == 0) {
  453. this.itemsList[key].amt = null;
  454. }
  455. }
  456. this.fileList1 = res.data.fileList1;
  457. this.loading = false;
  458. // isMileage(this.orderNo).then(res => {
  459. // if (res.msg == 410) {
  460. // // this.disabled = true;
  461. // // this.upDisabled = true;
  462. // // this.$refs.uToast.show({
  463. // // type: 'warning',
  464. // // icon: false,
  465. // // message: "当前报单有待提交里程!",
  466. // // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  467. // // })
  468. // }
  469. // })
  470. // this.calculatMoney();
  471. })
  472. },
  473. // 事件审核按钮
  474. upButtonClick(type) {
  475. if(this.formData.loadQty == null) {
  476. this.$refs.uToast.show({
  477. type: 'warning',
  478. icon: false,
  479. message: "没有装车吨位!",
  480. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  481. })
  482. } else if(this.formData.loadDate == null) {
  483. this.$refs.uToast.show({
  484. type: 'warning',
  485. icon: false,
  486. message: "没有装车时间!",
  487. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  488. })
  489. } else if(this.formData.unLoadQty == null) {
  490. this.$refs.uToast.show({
  491. type: 'warning',
  492. icon: false,
  493. message: "没有卸车吨位!",
  494. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  495. })
  496. } else if(this.formData.unLoadDate == null) {
  497. this.$refs.uToast.show({
  498. type: 'warning',
  499. icon: false,
  500. message: "没有卸车时间!",
  501. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  502. })
  503. } else if (this.formData.ifOrder2ed == 'F') {
  504. this.upAuditShow = false;
  505. this.$refs.uToast.show({
  506. type: 'warning',
  507. icon: false,
  508. message: "装卸信息提交后才能报账!",
  509. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  510. })
  511. } else if (this.formData.ifOrder2ed != 'O' && this.formData.ifOrder2ed != 'S') {
  512. this.upAuditShow = false;
  513. this.$refs.uToast.show({
  514. type: 'warning',
  515. icon: false,
  516. message: "请先提交卸车信息!",
  517. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  518. })
  519. } else {
  520. if (type == 'BX') {
  521. this.submitShow = true
  522. } else if (type == 'TJ') {
  523. this.upAuditShow = true
  524. }
  525. }
  526. },
  527. // 保存内容
  528. submit() {
  529. if (this.status376 == 6) {
  530. this.$refs.uToast.show({
  531. type: 'warning',
  532. icon: false,
  533. message: "不允许保存!",
  534. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  535. })
  536. } else if (this.status376 == 2 || this.status376 == 0) {
  537. let isMo = false;
  538. for (const key in this.itemsList) {
  539. if (this.itemsList[key].amt == null) {
  540. this.itemsList[key].amt = 0;
  541. }
  542. }
  543. if (this.formData.loadetc == null) {
  544. this.formData.loadetc = 0;
  545. }
  546. if (this.formData.loadtoll == null) {
  547. this.formData.loadtoll = 0;
  548. }
  549. if (this.formData.oilhomeQty == null) {
  550. this.formData.oilhomeQty = 0;
  551. }
  552. if (this.formData.oilhomeAmt == null) {
  553. this.formData.oilhomeAmt = 0;
  554. }
  555. if (this.formData.oilappoint1Qty == null) {
  556. this.formData.oilappoint1Qty = 0;
  557. }
  558. if (this.formData.oilappoint1Amt == null) {
  559. this.formData.oilappoint1Amt = 0;
  560. }
  561. if (this.formData.oilappoint2Qty == null) {
  562. this.formData.oilappoint2Qty = 0;
  563. }
  564. if (this.formData.oilappoint2Amt == null) {
  565. this.formData.oilappoint2Amt = 0;
  566. }
  567. if (this.formData.oilappoint3Qty == null) {
  568. this.formData.oilappoint3Qty = 0;
  569. }
  570. if (this.formData.oilappoint3Amt == null) {
  571. this.formData.oilappoint3Amt = 0;
  572. }
  573. if (this.formData.oilcash1Qty == null) {
  574. this.formData.oilcash1Qty = 0;
  575. }
  576. if (this.formData.oilcash1Amt == null) {
  577. this.formData.oilcash1Amt = 0;
  578. }
  579. if (this.formData.oilcardQty == null) {
  580. this.formData.oilcardQty = 0;
  581. }
  582. if (this.formData.oilcardAmt == null) {
  583. this.formData.oilcardAmt = 0;
  584. }
  585. if (this.formData.gasstation1 == null) {
  586. this.formData.gasstation1 = 0;
  587. }
  588. if (this.formData.gasstation2 == null) {
  589. this.formData.gasstation2 = 0;
  590. }
  591. if (this.formData.gasstation3 == null) {
  592. this.formData.gasstation3 = 0;
  593. }
  594. this.loading = true;
  595. // var list = [];
  596. // for (var item in this.itemsList) {
  597. // var amt = this.itemsList[item].amt;
  598. // if (amt != null) {
  599. // var items = this.itemsList[item];
  600. // list.push(items);
  601. // }
  602. // }
  603. // for (let item of this.itemsList) {
  604. // if (item == 0) {
  605. // item.amt = null
  606. // }
  607. // }
  608. // this.formData.itemsVoList = list;
  609. this.formData.itemsVoList = this.itemsList;
  610. insertLoadFeeItems(this.formData).then(res => {
  611. this.submitShow = false;
  612. if (res.code == 200) {
  613. // 报销费用下拉选
  614. getGasStations().then(res => {
  615. // this.gasStationList = res.data
  616. for (var item in res.data) {
  617. var data = {
  618. text: res.data[item].cname,
  619. value: res.data[item].cname
  620. };
  621. this.gasStationList.push(data);
  622. }
  623. getItems().then(res => {
  624. this.itemsList = res.data
  625. getLoadFeeItems(this.orderNo).then(res => {
  626. res.data.loadetc == 0 ? res.data.loadetc = null : res.data.loadetc
  627. res.data.loadtoll == 0 ? res.data.loadtoll = null : res.data.loadtoll
  628. res.data.oilhomeQty == 0 ? res.data.oilhomeQty = null : res.data.oilhomeQty
  629. res.data.oilhomeAmt == 0 ? res.data.oilhomeAmt = null : res.data.oilhomeAmt
  630. res.data.oilappoint1Qty == 0 ? res.data.oilappoint1Qty = null : res.data.oilappoint1Qty
  631. res.data.oilappoint1Amt == 0 ? res.data.oilappoint1Amt = null : res.data.oilappoint1Amt
  632. res.data.oilappoint2Qty == 0 ? res.data.oilappoint2Qty = null : res.data.oilappoint2Qty
  633. res.data.oilappoint2Amt == 0 ? res.data.oilappoint2Amt = null : res.data.oilappoint2Amt
  634. res.data.oilappoint3Qty == 0 ? res.data.oilappoint3Qty = null : res.data.oilappoint3Qty
  635. res.data.oilappoint3Amt == 0 ? res.data.oilappoint3Amt = null : res.data.oilappoint3Amt
  636. res.data.oilcash1Qty == 0 ? res.data.oilcash1Qty = null : res.data.oilcash1Qty
  637. res.data.oilcash1Amt == 0 ? res.data.oilcash1Amt = null : res.data.oilcash1Amt
  638. res.data.oilcardQty == 0 ? res.data.oilcardQty = null : res.data.oilcardQty
  639. res.data.oilcardAmt == 0 ? res.data.oilcardAmt = null : res.data.oilcardAmt
  640. for (let item of this.itemsList) {
  641. if (item == 0) {
  642. item.amt = null
  643. }
  644. }
  645. // 角色
  646. for (let role of res.data.roleList) {
  647. if (role == 'DZ') {
  648. this.button = false;
  649. }
  650. }
  651. // 审核中
  652. if (
  653. res.data.ifStarted == "S") {
  654. this.disabled = true;
  655. this.saveDisabled = true;
  656. this.upDisabled = true;
  657. this.sDisabled = false;
  658. }
  659. // 审核完成
  660. if (
  661. res.data.ifStarted == "A") {
  662. this.disabled = true;
  663. this.saveDisabled = true;
  664. this.upDisabled = true;
  665. }
  666. // 未提交
  667. // if (res.data.ifLoaded != "T" ||
  668. // res.data.ifUnLoaded != "T") {
  669. // this.disabled = false;
  670. // this.saveDisabled = false;
  671. // this.upDisabled = true;
  672. // }
  673. this.formData = res.data;
  674. var costBreakdownList = res.data.loadFeeItemsList;
  675. this.itemsList = costBreakdownList;
  676. for (const key in this.itemsList) {
  677. if (this.itemsList[key].amt == 0) {
  678. this.itemsList[key].amt = null;
  679. }
  680. }
  681. this.fileList1 = res.data.fileList1;
  682. this.$refs.uToast.show({
  683. type: 'success',
  684. message: "保存成功!",
  685. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  686. })
  687. this.loading = false;
  688. })
  689. })
  690. })
  691. // this.getData();
  692. // 保存成功弹窗提示
  693. // this.$refs.uToast.show({
  694. // type: 'success',
  695. // message: "保存成功!",
  696. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  697. // })
  698. } else {
  699. // 保存失败消息
  700. this.$refs.uToast.show({
  701. icon: false,
  702. message: "保存失败请重试!",
  703. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  704. })
  705. }
  706. })
  707. }
  708. },
  709. // 提交审核
  710. upReview() {
  711. // if (this.status376 == 6) {
  712. // this.upAuditShow = false;
  713. // this.$refs.uToast.show({
  714. // type: 'warning',
  715. // icon: false,
  716. // message: "不允许保存!",
  717. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  718. // })
  719. // } else if (this.status376 == 2 || this.status376 == 0) {
  720. if (this.formData.ifOrder2ed != 'O' && this.formData.ifOrder2ed != 'S') {
  721. this.upAuditShow = false;
  722. this.$refs.uToast.show({
  723. type: 'warning',
  724. icon: false,
  725. message: "请先提交报账单!",
  726. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  727. })
  728. } else if (this.formData.ifOrder2ed == 'O' || this.formData.ifOrder2ed == 'S') {
  729. let isMo = false;
  730. for (const key in this.itemsList) {
  731. if (this.itemsList[key].amt == null) {
  732. this.itemsList[key].amt = 0;
  733. }
  734. }
  735. if (this.formData.loadetc == null) {
  736. this.formData.loadetc = 0;
  737. }
  738. if (this.formData.loadtoll == null) {
  739. this.formData.loadtoll = 0;
  740. }
  741. if (this.formData.oilhomeQty == null) {
  742. this.formData.oilhomeQty = 0;
  743. }
  744. if (this.formData.oilhomeAmt == null) {
  745. this.formData.oilhomeAmt = 0;
  746. }
  747. if (this.formData.oilappoint1Qty == null) {
  748. this.formData.oilappoint1Qty = 0;
  749. }
  750. if (this.formData.oilappoint1Amt == null) {
  751. this.formData.oilappoint1Amt = 0;
  752. }
  753. if (this.formData.oilappoint2Qty == null) {
  754. this.formData.oilappoint2Qty = 0;
  755. }
  756. if (this.formData.oilappoint2Amt == null) {
  757. this.formData.oilappoint2Amt = 0;
  758. }
  759. if (this.formData.oilappoint3Qty == null) {
  760. this.formData.oilappoint3Qty = 0;
  761. }
  762. if (this.formData.oilappoint3Amt == null) {
  763. this.formData.oilappoint3Amt = 0;
  764. }
  765. if (this.formData.oilcash1Qty == null) {
  766. this.formData.oilcash1Qty = 0;
  767. }
  768. if (this.formData.oilcash1Amt == null) {
  769. this.formData.oilcash1Amt = 0;
  770. }
  771. if (this.formData.oilcardQty == null) {
  772. this.formData.oilcardQty = 0;
  773. }
  774. if (this.formData.oilcardAmt == null) {
  775. this.formData.oilcardAmt = 0;
  776. }
  777. if (this.formData.gasstation1 == null) {
  778. this.formData.gasstation1 = 0;
  779. }
  780. if (this.formData.gasstation2 == null) {
  781. this.formData.gasstation2 = 0;
  782. }
  783. if (this.formData.gasstation3 == null) {
  784. this.formData.gasstation3 = 0;
  785. }
  786. this.loading = true;
  787. // var list = [];
  788. // for (var item in this.itemsList) {
  789. // var amt = this.itemsList[item].amt;
  790. // if (amt != null) {
  791. // var items = this.itemsList[item];
  792. // list.push(items);
  793. // }
  794. // }
  795. this.formData.itemsVoList = this.itemsList;
  796. submitAudit(this.formData).then(res => {
  797. this.submitShow = false
  798. this.upAuditShow = false;
  799. if (res.msg == 'ok') {
  800. getGasStations().then(res => {
  801. for (var item in res.data) {
  802. var data = {
  803. text: res.data[item].cname,
  804. value: res.data[item].cname
  805. };
  806. this.gasStationList.push(data);
  807. }
  808. getItems().then(res => {
  809. this.itemsList = res.data
  810. getLoadFeeItems(this.orderNo).then(res => {
  811. res.data.loadetc == 0 ? res.data.loadetc = null : res.data.loadetc
  812. res.data.loadtoll == 0 ? res.data.loadtoll = null : res.data.loadtoll
  813. res.data.oilhomeQty == 0 ? res.data.oilhomeQty = null : res.data.oilhomeQty
  814. res.data.oilhomeAmt == 0 ? res.data.oilhomeAmt = null : res.data.oilhomeAmt
  815. res.data.oilappoint1Qty == 0 ? res.data.oilappoint1Qty = null : res.data.oilappoint1Qty
  816. res.data.oilappoint1Amt == 0 ? res.data.oilappoint1Amt = null : res.data.oilappoint1Amt
  817. res.data.oilappoint2Qty == 0 ? res.data.oilappoint2Qty = null : res.data.oilappoint2Qty
  818. res.data.oilappoint2Amt == 0 ? res.data.oilappoint2Amt = null : res.data.oilappoint2Amt
  819. res.data.oilappoint3Qty == 0 ? res.data.oilappoint3Qty = null : res.data.oilappoint3Qty
  820. res.data.oilappoint3Amt == 0 ? res.data.oilappoint3Amt = null : res.data.oilappoint3Amt
  821. res.data.oilcash1Qty == 0 ? res.data.oilcash1Qty = null : res.data.oilcash1Qty
  822. res.data.oilcash1Amt == 0 ? res.data.oilcash1Amt = null : res.data.oilcash1Amt
  823. res.data.oilcardQty == 0 ? res.data.oilcardQty = null : res.data.oilcardQty
  824. res.data.oilcardAmt == 0 ? res.data.oilcardAmt = null : res.data.oilcardAmt
  825. for (let item of this.itemsList) {
  826. if (item == 0) {
  827. item.amt = null
  828. }
  829. }
  830. // 角色
  831. for (let role of res.data.roleList) {
  832. if (role == 'DZ') {
  833. this.button = false;
  834. }
  835. }
  836. // 审核中
  837. if (
  838. res.data.ifStarted == "S") {
  839. this.disabled = true;
  840. this.saveDisabled = true;
  841. this.upDisabled = true;
  842. this.sDisabled = false;
  843. }
  844. // 审核完成
  845. if (
  846. res.data.ifStarted == "A") {
  847. this.disabled = true;
  848. this.saveDisabled = true;
  849. this.upDisabled = true;
  850. }
  851. // 未提交
  852. // if (res.data.ifLoaded != "T" ||
  853. // res.data.ifUnLoaded != "T") {
  854. // this.disabled = false;
  855. // this.saveDisabled = false;
  856. // this.upDisabled = true;
  857. // }
  858. this.formData = res.data;
  859. var costBreakdownList = res.data.loadFeeItemsList;
  860. this.itemsList = costBreakdownList;
  861. for (const key in this.itemsList) {
  862. if (this.itemsList[key].amt == 0) {
  863. this.itemsList[key].amt = null;
  864. }
  865. }
  866. this.fileList1 = res.data.fileList1;
  867. this.$refs.uToast.show({
  868. type: 'success',
  869. message: "提交审核成功!",
  870. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  871. })
  872. this.loading = false;
  873. })
  874. })
  875. })
  876. // this.getData();
  877. // // 保存成功弹窗提示
  878. // this.$refs.uToast.show({
  879. // type: 'success',
  880. // message: "提交审核成功!",
  881. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  882. // })
  883. } else {
  884. // 保存失败消息
  885. this.$refs.uToast.show({
  886. icon: false,
  887. message: "提交审核失败请重试!",
  888. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  889. })
  890. }
  891. })
  892. }
  893. },
  894. // 审核
  895. check(type) {
  896. this.loading = true;
  897. var data = {
  898. orderNo: this.orderNo,
  899. entityId: this.formData.entityId,
  900. audit2Desc: this.formData.audit2Desc ? this.formData.audit2Desc : '',
  901. lineNo: this.formData.lineNo,
  902. auditType: type
  903. }
  904. audit(data).then(res => {
  905. if (res.msg == 'ok') {
  906. this.getData();
  907. this.sDisabled = false;
  908. if (type == 'T') {
  909. this.auditTShow = false;
  910. } else if (type == 'F') {
  911. this.auditFShow = false;
  912. }
  913. // 保存成功弹窗提示
  914. this.$refs.uToast.show({
  915. type: 'success',
  916. message: "审核成功!",
  917. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  918. })
  919. this.loading = false;
  920. } else {
  921. // 保存失败消息
  922. this.$refs.uToast.show({
  923. icon: false,
  924. message: "审核失败请重试!",
  925. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  926. })
  927. this.loading = false;
  928. }
  929. })
  930. },
  931. // 删除图片
  932. deletePic(event) {
  933. if (this.disabled) {
  934. this.$refs.uToast.show({
  935. type: 'warning',
  936. icon: false,
  937. message: "不允许修改!",
  938. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  939. })
  940. } else {
  941. this.event = event;
  942. this.deleteShow = true;
  943. }
  944. },
  945. deleteImg() {
  946. var event = this.event;
  947. var url = event.file.url;
  948. var index = url.lastIndexOf("\/");
  949. var attachId = url.substring(index + 1, url.length);
  950. deleteTmsAttachMngs(attachId).then(res => {
  951. if (res.code == 200) {
  952. this[`fileList${event.name}`].splice(event.index, 1)
  953. // 删除成功消息
  954. this.$refs.uToast.show({
  955. type: 'success',
  956. message: "删除成功!",
  957. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  958. })
  959. } else {
  960. // 删除失败消息
  961. this.$refs.uToast.show({
  962. icon: false,
  963. message: "删除失败请重试!",
  964. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  965. })
  966. }
  967. this.event = {};
  968. this.deleteShow = false;
  969. })
  970. },
  971. // 新增图片
  972. imgUploading(event) {
  973. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  974. let lists = [].concat(event.file)
  975. let fileListLen = this[`fileList${event.name}`].length
  976. lists.map((item) => {
  977. this[`fileList${event.name}`].push({
  978. ...item,
  979. status: 'uploading',
  980. message: '上传中'
  981. })
  982. })
  983. for (let i = 0; i < lists.length; i++) {
  984. let date = this.dateToString("yyyyMMdd");
  985. let dateHHmmss = this.dateToString("yyyy-MM-dd HH:mm:ss");
  986. this.formData.date = date;
  987. insertTmsAttachMngs(this.formData).then(res => {
  988. if (res.code == 200) {
  989. let data = {
  990. name: 'avatarfile',
  991. filePath: lists[i].url
  992. }
  993. // 获取经纬度
  994. let longitude = '';
  995. let latitude = '';
  996. // uni.getLocation({
  997. // type: 'wgs84',
  998. // success: function(res) {
  999. // console.log('当前位置的经度:' + res.longitude);
  1000. // console.log('当前位置的纬度:' + res.latitude);
  1001. // }
  1002. // });
  1003. uni.getLocation({
  1004. type: 'wgs84',
  1005. isHighAccuracy: true,
  1006. geocode: true,
  1007. success: (map) => {
  1008. longitude = map.longitude
  1009. latitude = map.latitude
  1010. let dataForm = {
  1011. attachId: res.data,
  1012. longitude: longitude,
  1013. latitude: latitude,
  1014. updateDate: dateHHmmss
  1015. }
  1016. // 上传图片
  1017. pictureUploading(data, dataForm).then(res => {
  1018. let item = this[`fileList${event.name}`][fileListLen]
  1019. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(
  1020. item, {
  1021. status: 'success',
  1022. message: '',
  1023. url: res.data
  1024. }))
  1025. fileListLen++
  1026. })
  1027. }
  1028. });
  1029. // let dataForm = {
  1030. // attachId: res.data,
  1031. // longitude: longitude,
  1032. // latitude: latitude,
  1033. // updateDate: dateHHmmss
  1034. // }
  1035. // console.log(dataForm);
  1036. // // 上传图片
  1037. // pictureUploading(data, dataForm).then(res => {
  1038. // let item = this[`fileList${event.name}`][fileListLen]
  1039. // this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(
  1040. // item, {
  1041. // status: 'success',
  1042. // message: '',
  1043. // url: res.data
  1044. // }))
  1045. // fileListLen++
  1046. // })
  1047. }
  1048. })
  1049. }
  1050. },
  1051. dateToString(fmt) {
  1052. var date = new Date();
  1053. var o = {
  1054. "M+": date.getMonth() + 1, //月份
  1055. "d+": date.getDate(), //日
  1056. "H+": date.getHours(), //小时
  1057. "m+": date.getMinutes(), //分
  1058. "s+": date.getSeconds(), //秒
  1059. "q+": Math.floor((date.getMonth() + 3) / 3), //季度
  1060. "S": date.getMilliseconds() //毫秒
  1061. };
  1062. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
  1063. for (var k in o)
  1064. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[
  1065. k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  1066. return fmt;
  1067. },
  1068. // 定点加油1清空
  1069. gasstation1Change() {
  1070. this.formData.oilappoint1Qty = '';
  1071. this.formData.oilappoint1Amt = 0;
  1072. },
  1073. // 定点加油2清空
  1074. gasstation2Change() {
  1075. this.formData.oilappoint2Qty = '';
  1076. this.formData.oilappoint2Amt = 0;
  1077. },
  1078. // 定点加油3清空
  1079. gasstation3Change() {
  1080. this.formData.oilappoint3Qty = '';
  1081. this.formData.oilappoint3Amt = 0;
  1082. },
  1083. // 点击拨打电话
  1084. telFun() {
  1085. if (this.formData.driver1mobile != null && this.formData.driver1mobile != '') {
  1086. uni.makePhoneCall({
  1087. phoneNumber: this.formData.driver1mobile, //电话号码
  1088. success: function(e) {
  1089. // console.log(e);
  1090. },
  1091. fail: function(e) {
  1092. // console.log(e);
  1093. }
  1094. })
  1095. }
  1096. },
  1097. // 其他费用表格勾选事件
  1098. selectionChange(e) {
  1099. this.selectedIndexs = e.detail.index;
  1100. },
  1101. // 计算报销金额
  1102. // calculatMoney() {
  1103. // let loadetc = this.formData.loadetc == null ? 0 : this.formData.loadetc;
  1104. // let loadtoll = this.formData.loadtoll == null ? 0 : this.formData.loadtoll;
  1105. // let oilhomeAmt = this.formData.oilhomeAmt == null ? 0 : this.formData.oilhomeAmt;
  1106. // let oilappoint1Amt = this.formData.oilappoint1Amt == null ? 0 : this.formData.oilappoint1Amt;
  1107. // let oilappoint2Amt = this.formData.oilappoint2Amt == null ? 0 : this.formData.oilappoint2Amt;
  1108. // let oilappoint3Amt = this.formData.oilappoint3Amt == null ? 0 : this.formData.oilappoint3Amt;
  1109. // let oilcash1Amt = this.formData.oilcash1Amt == null ? 0 : this.formData.oilcash1Amt;
  1110. // let oilcardAmt = this.formData.oilcardAmt == null ? 0 : this.formData.oilcardAmt;
  1111. // let itemsMoney = 0;
  1112. // for (const key in this.itemsList) {
  1113. // let a = this.itemsList[key].amt == null ? 0 : this.itemsList[key].amt;
  1114. // itemsMoney += Number(a);
  1115. // }
  1116. // loadetc = Number(loadetc)
  1117. // loadtoll = Number(loadtoll)
  1118. // oilhomeAmt = Number(oilhomeAmt)
  1119. // oilappoint1Amt = Number(oilappoint1Amt)
  1120. // oilappoint2Amt = Number(oilappoint2Amt)
  1121. // oilappoint3Amt = Number(oilappoint3Amt)
  1122. // oilcash1Amt = Number(oilcash1Amt)
  1123. // oilcardAmt = Number(oilcardAmt)
  1124. // itemsMoney = Number(itemsMoney)
  1125. // this.money = loadetc + loadtoll + oilhomeAmt + oilappoint1Amt + oilappoint2Amt + oilcash1Amt + oilcardAmt +
  1126. // oilappoint3Amt + itemsMoney;
  1127. // },
  1128. checkUnLoadetc(e) {
  1129. //正则表达试
  1130. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1131. //重新赋值给input
  1132. this.$nextTick(() => {
  1133. this.formData.loadetc = e.target.value
  1134. })
  1135. this.calculatMoney();
  1136. },
  1137. checkUnLoadtoll(e) {
  1138. //正则表达试
  1139. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1140. //重新赋值给input
  1141. this.$nextTick(() => {
  1142. this.formData.loadtoll = e.target.value
  1143. })
  1144. this.calculatMoney();
  1145. },
  1146. checkUnOilhomeQty(e) {
  1147. //正则表达试
  1148. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1149. //重新赋值给input
  1150. this.$nextTick(() => {
  1151. this.formData.oilhomeQty = e.target.value
  1152. })
  1153. this.calculatMoney();
  1154. },
  1155. checkUnOilhomeAmt(e) {
  1156. //正则表达试
  1157. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1158. //重新赋值给input
  1159. this.$nextTick(() => {
  1160. this.formData.oilhomeAmt = e.target.value
  1161. })
  1162. this.calculatMoney();
  1163. },
  1164. checkUnOilappoint1Qty(e) {
  1165. //正则表达试
  1166. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1167. //重新赋值给input
  1168. this.$nextTick(() => {
  1169. this.formData.oilappoint1Qty = e.target.value
  1170. })
  1171. this.calculatMoney();
  1172. },
  1173. checkUnOilappoint1Amt(e) {
  1174. //正则表达试
  1175. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1176. //重新赋值给input
  1177. this.$nextTick(() => {
  1178. this.formData.oilappoint1Amt = e.target.value
  1179. })
  1180. this.calculatMoney();
  1181. },
  1182. checkUnOilappoint2Qty(e) {
  1183. //正则表达试
  1184. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1185. //重新赋值给input
  1186. this.$nextTick(() => {
  1187. this.formData.oilappoint2Qty = e.target.value
  1188. })
  1189. this.calculatMoney();
  1190. },
  1191. checkUnOilappoint2Amt(e) {
  1192. //正则表达试
  1193. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1194. //重新赋值给input
  1195. this.$nextTick(() => {
  1196. this.formData.oilappoint2Amt = e.target.value
  1197. })
  1198. this.calculatMoney();
  1199. },
  1200. checkUnOilappoint3Qty(e) {
  1201. //正则表达试
  1202. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1203. //重新赋值给input
  1204. this.$nextTick(() => {
  1205. this.formData.oilappoint3Qty = e.target.value
  1206. })
  1207. this.calculatMoney();
  1208. },
  1209. checkUnOilappoint3Amt(e) {
  1210. //正则表达试
  1211. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1212. //重新赋值给input
  1213. this.$nextTick(() => {
  1214. this.formData.oilappoint3Amt = e.target.value
  1215. })
  1216. this.calculatMoney();
  1217. },
  1218. checkUnOilcash1Qty(e) {
  1219. //正则表达试
  1220. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1221. //重新赋值给input
  1222. this.$nextTick(() => {
  1223. this.formData.oilcash1Qty = e.target.value
  1224. })
  1225. this.calculatMoney();
  1226. },
  1227. checkUnOilcash1Amt(e) {
  1228. //正则表达试
  1229. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1230. //重新赋值给input
  1231. this.$nextTick(() => {
  1232. this.formData.oilcash1Amt = e.target.value
  1233. })
  1234. this.calculatMoney();
  1235. },
  1236. checkUnOilcardQty(e) {
  1237. //正则表达试
  1238. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1239. //重新赋值给input
  1240. this.$nextTick(() => {
  1241. this.formData.oilcardQty = e.target.value
  1242. })
  1243. this.calculatMoney();
  1244. },
  1245. checkUnOilcardAmt(e) {
  1246. //正则表达试
  1247. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1248. //重新赋值给input
  1249. this.$nextTick(() => {
  1250. this.formData.oilcardAmt = e.target.value
  1251. })
  1252. this.calculatMoney();
  1253. },
  1254. checkUnAmt(amt, index) {
  1255. var amt = (amt.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1256. //重新赋值给input
  1257. this.$nextTick(() => {
  1258. this.itemsList[index].amt = amt
  1259. })
  1260. this.calculatMoney();
  1261. },
  1262. inputHeight() {
  1263. // if (this.vHeight == 0) {
  1264. this.vHeight = 600;
  1265. // } else {
  1266. // this.vHeight = 0;
  1267. // }
  1268. }
  1269. }
  1270. }
  1271. </script>
  1272. <style lang="scss">
  1273. @import url("/font/iconfont.css");
  1274. // 修改布局方向为纵向布局
  1275. .vertical-layout {
  1276. display: flex;
  1277. }
  1278. .h {
  1279. margin-top: 20rpx;
  1280. height: 100rpx;
  1281. padding-left: 40rpx;
  1282. // font-weight: 900;
  1283. border-top: 2rpx solid #f0f0f0f0;
  1284. border-bottom: 2rpx solid #f0f0f0f0;
  1285. line-height: 100rpx;
  1286. font-size: 30rpx;
  1287. color: #3c9cff;
  1288. // background-color: pink;
  1289. }
  1290. // 分割线
  1291. .striping {
  1292. width: 100%;
  1293. height: 4rpx;
  1294. background-color: #f0f0f0f0;
  1295. }
  1296. .box-box {
  1297. padding-left: 30rpx;
  1298. padding-right: 30rpx;
  1299. }
  1300. .content {
  1301. box-sizing: border-box;
  1302. background-color: white;
  1303. .head {
  1304. color: #3c9cff;
  1305. // width: 100%;
  1306. height: 40rpx;
  1307. padding: 0 30rpx;
  1308. vertical-align: middle;
  1309. // display: table-cell;
  1310. display: flex;
  1311. align-items: flex-end;
  1312. justify-content: space-between;
  1313. box-sizing: border-box;
  1314. font-size: 34rpx;
  1315. font-weight: 700;
  1316. // background-color: red;
  1317. }
  1318. .head-no-addr {
  1319. // width: 960rpx;
  1320. height: 100rpx;
  1321. // padding-left: 30rpx;
  1322. padding: 0 30rpx;
  1323. vertical-align: middle;
  1324. color: #fff;
  1325. font-size: 34rpx;
  1326. font-weight: 700;
  1327. display: flex;
  1328. align-items: center;
  1329. justify-content: space-between;
  1330. box-sizing: border-box;
  1331. background-color: #3c9cff;
  1332. }
  1333. .box-list {
  1334. color: #3b3b3b;
  1335. width: 100%;
  1336. border-bottom: 2rpx solid #f0f0f0f0;
  1337. // padding-left: 50rpx;
  1338. // font-size: 30rpx;
  1339. color: #3b3b3b;
  1340. .icon {
  1341. // width: 100rpx;
  1342. margin-top: 50rpx;
  1343. // font-size: 50rpx;
  1344. // color: #4888ff;
  1345. }
  1346. .list {
  1347. margin-top: 30rpx;
  1348. margin-bottom: 20rpx;
  1349. width: 100%;
  1350. height: 100%;
  1351. // background-color: pink;
  1352. height: auto;
  1353. display: flex;
  1354. flex-wrap: wrap;
  1355. // font-size: 30rpx;
  1356. }
  1357. .quantity-aum {
  1358. margin-bottom: 25rpx;
  1359. .aaa {
  1360. width: 50%;
  1361. .key {
  1362. display: inline-block;
  1363. width: 50%;
  1364. margin-left: 20rpx;
  1365. // margin-right: 80rpx;
  1366. border-bottom: 2rpx dotted #000;
  1367. }
  1368. }
  1369. .bbb {
  1370. width: 50%;
  1371. .value {
  1372. width: 50%;
  1373. margin-left: 20rpx;
  1374. // margin-right: 20rpx;
  1375. border-bottom: 2rpx dotted #000;
  1376. }
  1377. }
  1378. }
  1379. }
  1380. .box {
  1381. color: #3b3b3b;
  1382. // overflow: hidden;
  1383. height: 100rpx;
  1384. // border-bottom: 2rpx solid #f0f0f0f0;
  1385. // font-size: 30rpx;
  1386. display: flex;
  1387. align-items: center;
  1388. .data {
  1389. width: 50%;
  1390. display: flex;
  1391. align-items: center;
  1392. .key {
  1393. width: 55%;
  1394. text-align: right;
  1395. color: #3c9cff;
  1396. }
  1397. .value {
  1398. margin-left: 20rpx;
  1399. width: 45%;
  1400. color: #3b3b3b;
  1401. border-bottom: 2rpx dotted #000;
  1402. }
  1403. }
  1404. .data-two {
  1405. width: 100%;
  1406. display: flex;
  1407. align-items: center;
  1408. .key {
  1409. width: 35%;
  1410. text-align: right;
  1411. color: #3c9cff;
  1412. }
  1413. .list {
  1414. margin-top: 30rpx;
  1415. margin-bottom: 20rpx;
  1416. width: 100%;
  1417. height: 100%;
  1418. // background-color: pink;
  1419. height: auto;
  1420. display: flex;
  1421. flex-wrap: wrap;
  1422. // font-size: 30rpx;
  1423. }
  1424. }
  1425. }
  1426. .box-two {
  1427. color: #3b3b3b;
  1428. overflow: hidden;
  1429. height: 100rpx;
  1430. padding-left: 20rpx;
  1431. // margin-right: 20rpx;
  1432. // font-size: 30rpx;
  1433. display: flex;
  1434. align-items: center;
  1435. .key {
  1436. display: inline-block;
  1437. width: 24%;
  1438. color: #3c9cff;
  1439. }
  1440. .value {
  1441. margin-left: 20rpx;
  1442. width: calc(100% - 24%);
  1443. color: #3b3b3b;
  1444. // margin-right: 20rpx;
  1445. border-bottom: 2rpx dotted #000;
  1446. }
  1447. }
  1448. .table {
  1449. // margin-top: 40rpx;
  1450. margin-left: 20rpx;
  1451. margin-right: 20rpx;
  1452. .data {
  1453. // font-size: 30rpx;
  1454. width: 100%;
  1455. height: 100rpx;
  1456. border-bottom: 2rpx solid #f0f0f0f0;
  1457. align-items: center;
  1458. .name {
  1459. text-align: right;
  1460. width: 25%;
  1461. margin-left: 20rpx;
  1462. color: #000;
  1463. }
  1464. .sum {
  1465. width: 20%;
  1466. margin-left: 20rpx;
  1467. margin-right: 40rpx;
  1468. border-bottom: 2rpx dotted #000;
  1469. }
  1470. .remarks {
  1471. width: 30%;
  1472. }
  1473. }
  1474. }
  1475. .primary {
  1476. background-color: #0b68ffff;
  1477. }
  1478. .attention {
  1479. padding: 30rpx;
  1480. padding-left: 50rpx;
  1481. padding-bottom: 40rpx;
  1482. }
  1483. // 底部提交按钮
  1484. // .bottom {
  1485. // height: 130rpx;
  1486. // display: block;
  1487. // position: fixed;
  1488. // bottom: calc(var(--window-bottom));
  1489. // width: 100%;
  1490. // // background-color: #f0f0f0f0;
  1491. // // background-color: pink;
  1492. // background-color: white;
  1493. // .bottom-bottom {
  1494. // width: 100%;
  1495. // height: 100%;
  1496. // position: relative;
  1497. // display: flex;
  1498. // // .submit {
  1499. // // width: 95%;
  1500. // // background-color: #0b68ffff;
  1501. // // }
  1502. // .money {
  1503. // font-size: 28rpx;
  1504. // height: 130rpx;
  1505. // margin-right: 80rpx;
  1506. // line-height: 130rpx;
  1507. // margin-left: 10%;
  1508. // }
  1509. // .button {
  1510. // width: 300rpx;
  1511. // position: absolute;
  1512. // right: 0;
  1513. // margin-right: 10%;
  1514. // .button-button {
  1515. // padding: 10% 0;
  1516. // background-clip: content-box;
  1517. // }
  1518. // }
  1519. // }
  1520. // }
  1521. .bottom {
  1522. position: fixed;
  1523. bottom: calc(var(--window-bottom));
  1524. width: 100%;
  1525. height: 130rpx;
  1526. background-color: white;
  1527. .row {
  1528. display: flex;
  1529. justify-content: space-evenly;
  1530. height: 130rpx;
  1531. align-items: center;
  1532. .button {
  1533. width: 300rpx;
  1534. // width: 660rpx;
  1535. }
  1536. }
  1537. }
  1538. .input {
  1539. width: 100%;
  1540. // height: 100rpx;
  1541. // background-color: red;
  1542. }
  1543. .cushion {
  1544. width: 100%;
  1545. height: 200rpx;
  1546. background-color: #f0f0f0f0;
  1547. }
  1548. }
  1549. </style>