index.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733
  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 != '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-if="!button" 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: true,
  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. },
  365. methods: {
  366. change(item) {
  367. this.isTabs = item.name;
  368. },
  369. auditTClick() {
  370. this.formData.audit2Desc = "审核通过"
  371. this.auditTShow = true
  372. },
  373. auditFClick() {
  374. this.formData.audit2Desc = null
  375. this.auditFShow = true
  376. },
  377. getData() {
  378. // 报销费用下拉选
  379. getGasStations().then(res => {
  380. // this.gasStationList = res.data
  381. for (var item in res.data) {
  382. var data = {
  383. text: res.data[item].cname,
  384. value: res.data[item].cname
  385. };
  386. this.gasStationList.push(data);
  387. }
  388. getItems().then(res => {
  389. this.itemsList = res.data
  390. getLoadFeeItems(this.orderNo).then(res => {
  391. res.data.loadetc == 0 ? res.data.loadetc = null : res.data.loadetc
  392. res.data.loadtoll == 0 ? res.data.loadtoll = null : res.data.loadtoll
  393. res.data.oilhomeQty == 0 ? res.data.oilhomeQty = null : res.data.oilhomeQty
  394. res.data.oilhomeAmt == 0 ? res.data.oilhomeAmt = null : res.data.oilhomeAmt
  395. res.data.oilappoint1Qty == 0 ? res.data.oilappoint1Qty = null : res.data.oilappoint1Qty
  396. res.data.oilappoint1Amt == 0 ? res.data.oilappoint1Amt = null : res.data.oilappoint1Amt
  397. res.data.oilappoint2Qty == 0 ? res.data.oilappoint2Qty = null : res.data.oilappoint2Qty
  398. res.data.oilappoint2Amt == 0 ? res.data.oilappoint2Amt = null : res.data.oilappoint2Amt
  399. res.data.oilappoint3Qty == 0 ? res.data.oilappoint3Qty = null : res.data.oilappoint3Qty
  400. res.data.oilappoint3Amt == 0 ? res.data.oilappoint3Amt = null : res.data.oilappoint3Amt
  401. res.data.oilcash1Qty == 0 ? res.data.oilcash1Qty = null : res.data.oilcash1Qty
  402. res.data.oilcash1Amt == 0 ? res.data.oilcash1Amt = null : res.data.oilcash1Amt
  403. res.data.oilcardQty == 0 ? res.data.oilcardQty = null : res.data.oilcardQty
  404. res.data.oilcardAmt == 0 ? res.data.oilcardAmt = null : res.data.oilcardAmt
  405. for (let item of this.itemsList) {
  406. if (item == 0) {
  407. item.amt = null
  408. }
  409. }
  410. // 角色
  411. for (let role of res.data.roleList) {
  412. if (role == 'DZ') {
  413. this.button = false;
  414. this.disabled = true;
  415. }
  416. if (role == 'JSY') {
  417. this.disabled = false;
  418. }
  419. }
  420. // 审核中
  421. if (
  422. res.data.ifStarted == "S") {
  423. this.disabled = true;
  424. this.saveDisabled = true;
  425. this.upDisabled = true;
  426. this.sDisabled = false;
  427. }
  428. // 审核完成
  429. if (
  430. res.data.ifStarted == "A") {
  431. this.disabled = true;
  432. this.saveDisabled = true;
  433. this.upDisabled = true;
  434. }
  435. // 未提交
  436. // if (res.data.ifLoaded != "T" ||
  437. // res.data.ifUnLoaded != "T") {
  438. // this.disabled = false;
  439. // this.saveDisabled = false;
  440. // this.upDisabled = true;
  441. // }
  442. this.formData = res.data;
  443. var costBreakdownList = res.data.loadFeeItemsList;
  444. this.itemsList = costBreakdownList;
  445. for (const key in this.itemsList) {
  446. if (this.itemsList[key].amt == 0) {
  447. this.itemsList[key].amt = null;
  448. }
  449. }
  450. this.fileList1 = res.data.fileList1;
  451. this.loading = false;
  452. // isMileage(this.orderNo).then(res => {
  453. // if (res.msg == 410) {
  454. // // this.disabled = true;
  455. // // this.upDisabled = true;
  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. // }
  463. // })
  464. // this.calculatMoney();
  465. })
  466. })
  467. })
  468. },
  469. // 事件审核按钮
  470. upButtonClick(type) {
  471. if(this.formData.loadQty == null) {
  472. this.$refs.uToast.show({
  473. type: 'warning',
  474. icon: false,
  475. message: "没有装车吨位!",
  476. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  477. })
  478. } else if(this.formData.loadDate == null) {
  479. this.$refs.uToast.show({
  480. type: 'warning',
  481. icon: false,
  482. message: "没有装车时间!",
  483. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  484. })
  485. } else if(this.formData.unLoadQty == null) {
  486. this.$refs.uToast.show({
  487. type: 'warning',
  488. icon: false,
  489. message: "没有卸车吨位!",
  490. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  491. })
  492. } else if(this.formData.unLoadDate == null) {
  493. this.$refs.uToast.show({
  494. type: 'warning',
  495. icon: false,
  496. message: "没有卸车时间!",
  497. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  498. })
  499. } else if (this.formData.ifOrder2ed == 'F') {
  500. this.upAuditShow = false;
  501. this.$refs.uToast.show({
  502. type: 'warning',
  503. icon: false,
  504. message: "装卸信息提交后才能报账!",
  505. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  506. })
  507. } else if (this.formData.ifOrder2ed != 'O' && this.formData.ifOrder2ed != 'S') {
  508. this.upAuditShow = false;
  509. this.$refs.uToast.show({
  510. type: 'warning',
  511. icon: false,
  512. message: "请先提交报账单!",
  513. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  514. })
  515. } else {
  516. if (type == 'BX') {
  517. this.submitShow = true
  518. } else if (type == 'TJ') {
  519. this.upAuditShow = true
  520. }
  521. }
  522. },
  523. // 保存内容
  524. submit() {
  525. if (this.status376 == 6) {
  526. this.$refs.uToast.show({
  527. type: 'warning',
  528. icon: false,
  529. message: "不允许保存!",
  530. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  531. })
  532. } else if (this.status376 == 2 || this.status376 == 0) {
  533. let isMo = false;
  534. for (const key in this.itemsList) {
  535. if (this.itemsList[key].amt == null) {
  536. this.itemsList[key].amt = 0;
  537. }
  538. }
  539. if (this.formData.loadetc == null) {
  540. this.formData.loadetc = 0;
  541. }
  542. if (this.formData.loadtoll == null) {
  543. this.formData.loadtoll = 0;
  544. }
  545. if (this.formData.oilhomeQty == null) {
  546. this.formData.oilhomeQty = 0;
  547. }
  548. if (this.formData.oilhomeAmt == null) {
  549. this.formData.oilhomeAmt = 0;
  550. }
  551. if (this.formData.oilappoint1Qty == null) {
  552. this.formData.oilappoint1Qty = 0;
  553. }
  554. if (this.formData.oilappoint1Amt == null) {
  555. this.formData.oilappoint1Amt = 0;
  556. }
  557. if (this.formData.oilappoint2Qty == null) {
  558. this.formData.oilappoint2Qty = 0;
  559. }
  560. if (this.formData.oilappoint2Amt == null) {
  561. this.formData.oilappoint2Amt = 0;
  562. }
  563. if (this.formData.oilappoint3Qty == null) {
  564. this.formData.oilappoint3Qty = 0;
  565. }
  566. if (this.formData.oilappoint3Amt == null) {
  567. this.formData.oilappoint3Amt = 0;
  568. }
  569. if (this.formData.oilcash1Qty == null) {
  570. this.formData.oilcash1Qty = 0;
  571. }
  572. if (this.formData.oilcash1Amt == null) {
  573. this.formData.oilcash1Amt = 0;
  574. }
  575. if (this.formData.oilcardQty == null) {
  576. this.formData.oilcardQty = 0;
  577. }
  578. if (this.formData.oilcardAmt == null) {
  579. this.formData.oilcardAmt = 0;
  580. }
  581. if (this.formData.gasstation1 == null) {
  582. this.formData.gasstation1 = 0;
  583. }
  584. if (this.formData.gasstation2 == null) {
  585. this.formData.gasstation2 = 0;
  586. }
  587. if (this.formData.gasstation3 == null) {
  588. this.formData.gasstation3 = 0;
  589. }
  590. this.loading = true;
  591. // var list = [];
  592. // for (var item in this.itemsList) {
  593. // var amt = this.itemsList[item].amt;
  594. // if (amt != null) {
  595. // var items = this.itemsList[item];
  596. // list.push(items);
  597. // }
  598. // }
  599. // for (let item of this.itemsList) {
  600. // if (item == 0) {
  601. // item.amt = null
  602. // }
  603. // }
  604. // this.formData.itemsVoList = list;
  605. this.formData.itemsVoList = this.itemsList;
  606. insertLoadFeeItems(this.formData).then(res => {
  607. this.submitShow = false;
  608. if (res.code == 200) {
  609. // 报销费用下拉选
  610. getGasStations().then(res => {
  611. // this.gasStationList = res.data
  612. for (var item in res.data) {
  613. var data = {
  614. text: res.data[item].cname,
  615. value: res.data[item].cname
  616. };
  617. this.gasStationList.push(data);
  618. }
  619. getItems().then(res => {
  620. this.itemsList = res.data
  621. getLoadFeeItems(this.orderNo).then(res => {
  622. res.data.loadetc == 0 ? res.data.loadetc = null : res.data.loadetc
  623. res.data.loadtoll == 0 ? res.data.loadtoll = null : res.data.loadtoll
  624. res.data.oilhomeQty == 0 ? res.data.oilhomeQty = null : res.data.oilhomeQty
  625. res.data.oilhomeAmt == 0 ? res.data.oilhomeAmt = null : res.data.oilhomeAmt
  626. res.data.oilappoint1Qty == 0 ? res.data.oilappoint1Qty = null : res.data.oilappoint1Qty
  627. res.data.oilappoint1Amt == 0 ? res.data.oilappoint1Amt = null : res.data.oilappoint1Amt
  628. res.data.oilappoint2Qty == 0 ? res.data.oilappoint2Qty = null : res.data.oilappoint2Qty
  629. res.data.oilappoint2Amt == 0 ? res.data.oilappoint2Amt = null : res.data.oilappoint2Amt
  630. res.data.oilappoint3Qty == 0 ? res.data.oilappoint3Qty = null : res.data.oilappoint3Qty
  631. res.data.oilappoint3Amt == 0 ? res.data.oilappoint3Amt = null : res.data.oilappoint3Amt
  632. res.data.oilcash1Qty == 0 ? res.data.oilcash1Qty = null : res.data.oilcash1Qty
  633. res.data.oilcash1Amt == 0 ? res.data.oilcash1Amt = null : res.data.oilcash1Amt
  634. res.data.oilcardQty == 0 ? res.data.oilcardQty = null : res.data.oilcardQty
  635. res.data.oilcardAmt == 0 ? res.data.oilcardAmt = null : res.data.oilcardAmt
  636. for (let item of this.itemsList) {
  637. if (item == 0) {
  638. item.amt = null
  639. }
  640. }
  641. // 角色
  642. for (let role of res.data.roleList) {
  643. if (role == 'DZ') {
  644. this.button = false;
  645. }
  646. }
  647. // 审核中
  648. if (
  649. res.data.ifStarted == "S") {
  650. this.disabled = true;
  651. this.saveDisabled = true;
  652. this.upDisabled = true;
  653. this.sDisabled = false;
  654. }
  655. // 审核完成
  656. if (
  657. res.data.ifStarted == "A") {
  658. this.disabled = true;
  659. this.saveDisabled = true;
  660. this.upDisabled = true;
  661. }
  662. // 未提交
  663. // if (res.data.ifLoaded != "T" ||
  664. // res.data.ifUnLoaded != "T") {
  665. // this.disabled = false;
  666. // this.saveDisabled = false;
  667. // this.upDisabled = true;
  668. // }
  669. this.formData = res.data;
  670. var costBreakdownList = res.data.loadFeeItemsList;
  671. this.itemsList = costBreakdownList;
  672. for (const key in this.itemsList) {
  673. if (this.itemsList[key].amt == 0) {
  674. this.itemsList[key].amt = null;
  675. }
  676. }
  677. this.fileList1 = res.data.fileList1;
  678. this.$refs.uToast.show({
  679. type: 'success',
  680. message: "保存成功!",
  681. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  682. })
  683. this.loading = false;
  684. })
  685. })
  686. })
  687. // this.getData();
  688. // 保存成功弹窗提示
  689. // this.$refs.uToast.show({
  690. // type: 'success',
  691. // message: "保存成功!",
  692. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  693. // })
  694. } else {
  695. // 保存失败消息
  696. this.$refs.uToast.show({
  697. icon: false,
  698. message: "保存失败请重试!",
  699. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  700. })
  701. }
  702. })
  703. }
  704. },
  705. // 提交审核
  706. upReview() {
  707. // if (this.status376 == 6) {
  708. // this.upAuditShow = false;
  709. // this.$refs.uToast.show({
  710. // type: 'warning',
  711. // icon: false,
  712. // message: "不允许保存!",
  713. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  714. // })
  715. // } else if (this.status376 == 2 || this.status376 == 0) {
  716. if (this.formData.ifOrder2ed != 'O' && this.formData.ifOrder2ed != 'S') {
  717. this.upAuditShow = false;
  718. this.$refs.uToast.show({
  719. type: 'warning',
  720. icon: false,
  721. message: "请先提交报账单!",
  722. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  723. })
  724. } else if (this.formData.ifOrder2ed == 'O' || this.formData.ifOrder2ed == 'S') {
  725. let isMo = false;
  726. for (const key in this.itemsList) {
  727. if (this.itemsList[key].amt == null) {
  728. this.itemsList[key].amt = 0;
  729. }
  730. }
  731. if (this.formData.loadetc == null) {
  732. this.formData.loadetc = 0;
  733. }
  734. if (this.formData.loadtoll == null) {
  735. this.formData.loadtoll = 0;
  736. }
  737. if (this.formData.oilhomeQty == null) {
  738. this.formData.oilhomeQty = 0;
  739. }
  740. if (this.formData.oilhomeAmt == null) {
  741. this.formData.oilhomeAmt = 0;
  742. }
  743. if (this.formData.oilappoint1Qty == null) {
  744. this.formData.oilappoint1Qty = 0;
  745. }
  746. if (this.formData.oilappoint1Amt == null) {
  747. this.formData.oilappoint1Amt = 0;
  748. }
  749. if (this.formData.oilappoint2Qty == null) {
  750. this.formData.oilappoint2Qty = 0;
  751. }
  752. if (this.formData.oilappoint2Amt == null) {
  753. this.formData.oilappoint2Amt = 0;
  754. }
  755. if (this.formData.oilappoint3Qty == null) {
  756. this.formData.oilappoint3Qty = 0;
  757. }
  758. if (this.formData.oilappoint3Amt == null) {
  759. this.formData.oilappoint3Amt = 0;
  760. }
  761. if (this.formData.oilcash1Qty == null) {
  762. this.formData.oilcash1Qty = 0;
  763. }
  764. if (this.formData.oilcash1Amt == null) {
  765. this.formData.oilcash1Amt = 0;
  766. }
  767. if (this.formData.oilcardQty == null) {
  768. this.formData.oilcardQty = 0;
  769. }
  770. if (this.formData.oilcardAmt == null) {
  771. this.formData.oilcardAmt = 0;
  772. }
  773. if (this.formData.gasstation1 == null) {
  774. this.formData.gasstation1 = 0;
  775. }
  776. if (this.formData.gasstation2 == null) {
  777. this.formData.gasstation2 = 0;
  778. }
  779. if (this.formData.gasstation3 == null) {
  780. this.formData.gasstation3 = 0;
  781. }
  782. this.loading = true;
  783. // var list = [];
  784. // for (var item in this.itemsList) {
  785. // var amt = this.itemsList[item].amt;
  786. // if (amt != null) {
  787. // var items = this.itemsList[item];
  788. // list.push(items);
  789. // }
  790. // }
  791. this.formData.itemsVoList = this.itemsList;
  792. submitAudit(this.formData).then(res => {
  793. this.submitShow = false
  794. this.upAuditShow = false;
  795. if (res.msg == 'ok') {
  796. getGasStations().then(res => {
  797. for (var item in res.data) {
  798. var data = {
  799. text: res.data[item].cname,
  800. value: res.data[item].cname
  801. };
  802. this.gasStationList.push(data);
  803. }
  804. getItems().then(res => {
  805. this.itemsList = res.data
  806. getLoadFeeItems(this.orderNo).then(res => {
  807. res.data.loadetc == 0 ? res.data.loadetc = null : res.data.loadetc
  808. res.data.loadtoll == 0 ? res.data.loadtoll = null : res.data.loadtoll
  809. res.data.oilhomeQty == 0 ? res.data.oilhomeQty = null : res.data.oilhomeQty
  810. res.data.oilhomeAmt == 0 ? res.data.oilhomeAmt = null : res.data.oilhomeAmt
  811. res.data.oilappoint1Qty == 0 ? res.data.oilappoint1Qty = null : res.data.oilappoint1Qty
  812. res.data.oilappoint1Amt == 0 ? res.data.oilappoint1Amt = null : res.data.oilappoint1Amt
  813. res.data.oilappoint2Qty == 0 ? res.data.oilappoint2Qty = null : res.data.oilappoint2Qty
  814. res.data.oilappoint2Amt == 0 ? res.data.oilappoint2Amt = null : res.data.oilappoint2Amt
  815. res.data.oilappoint3Qty == 0 ? res.data.oilappoint3Qty = null : res.data.oilappoint3Qty
  816. res.data.oilappoint3Amt == 0 ? res.data.oilappoint3Amt = null : res.data.oilappoint3Amt
  817. res.data.oilcash1Qty == 0 ? res.data.oilcash1Qty = null : res.data.oilcash1Qty
  818. res.data.oilcash1Amt == 0 ? res.data.oilcash1Amt = null : res.data.oilcash1Amt
  819. res.data.oilcardQty == 0 ? res.data.oilcardQty = null : res.data.oilcardQty
  820. res.data.oilcardAmt == 0 ? res.data.oilcardAmt = null : res.data.oilcardAmt
  821. for (let item of this.itemsList) {
  822. if (item == 0) {
  823. item.amt = null
  824. }
  825. }
  826. // 角色
  827. for (let role of res.data.roleList) {
  828. if (role == 'DZ') {
  829. this.button = false;
  830. }
  831. }
  832. // 审核中
  833. if (
  834. res.data.ifStarted == "S") {
  835. this.disabled = true;
  836. this.saveDisabled = true;
  837. this.upDisabled = true;
  838. this.sDisabled = false;
  839. }
  840. // 审核完成
  841. if (
  842. res.data.ifStarted == "A") {
  843. this.disabled = true;
  844. this.saveDisabled = true;
  845. this.upDisabled = true;
  846. }
  847. // 未提交
  848. // if (res.data.ifLoaded != "T" ||
  849. // res.data.ifUnLoaded != "T") {
  850. // this.disabled = false;
  851. // this.saveDisabled = false;
  852. // this.upDisabled = true;
  853. // }
  854. this.formData = res.data;
  855. var costBreakdownList = res.data.loadFeeItemsList;
  856. this.itemsList = costBreakdownList;
  857. for (const key in this.itemsList) {
  858. if (this.itemsList[key].amt == 0) {
  859. this.itemsList[key].amt = null;
  860. }
  861. }
  862. this.fileList1 = res.data.fileList1;
  863. this.$refs.uToast.show({
  864. type: 'success',
  865. message: "提交审核成功!",
  866. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  867. })
  868. this.loading = false;
  869. })
  870. })
  871. })
  872. // this.getData();
  873. // // 保存成功弹窗提示
  874. // this.$refs.uToast.show({
  875. // type: 'success',
  876. // message: "提交审核成功!",
  877. // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  878. // })
  879. } else {
  880. // 保存失败消息
  881. this.$refs.uToast.show({
  882. icon: false,
  883. message: "提交审核失败请重试!",
  884. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  885. })
  886. }
  887. })
  888. }
  889. },
  890. // 审核
  891. check(type) {
  892. this.loading = true;
  893. var data = {
  894. orderNo: this.orderNo,
  895. entityId: this.formData.entityId,
  896. audit2Desc: this.formData.audit2Desc ? this.formData.audit2Desc : '',
  897. lineNo: this.formData.lineNo,
  898. auditType: type
  899. }
  900. audit(data).then(res => {
  901. if (res.msg == 'ok') {
  902. this.getData();
  903. this.sDisabled = false;
  904. if (type == 'T') {
  905. this.auditTShow = false;
  906. } else if (type == 'F') {
  907. this.auditFShow = false;
  908. }
  909. // 保存成功弹窗提示
  910. this.$refs.uToast.show({
  911. type: 'success',
  912. message: "审核成功!",
  913. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  914. })
  915. this.loading = false;
  916. } else {
  917. // 保存失败消息
  918. this.$refs.uToast.show({
  919. icon: false,
  920. message: "审核失败请重试!",
  921. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  922. })
  923. this.loading = false;
  924. }
  925. })
  926. },
  927. // 删除图片
  928. deletePic(event) {
  929. if (this.disabled) {
  930. this.$refs.uToast.show({
  931. type: 'warning',
  932. icon: false,
  933. message: "不允许修改!",
  934. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
  935. })
  936. } else {
  937. this.event = event;
  938. this.deleteShow = true;
  939. }
  940. },
  941. deleteImg() {
  942. var event = this.event;
  943. var url = event.file.url;
  944. var index = url.lastIndexOf("\/");
  945. var attachId = url.substring(index + 1, url.length);
  946. deleteTmsAttachMngs(attachId).then(res => {
  947. if (res.code == 200) {
  948. this[`fileList${event.name}`].splice(event.index, 1)
  949. // 删除成功消息
  950. this.$refs.uToast.show({
  951. type: 'success',
  952. message: "删除成功!",
  953. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  954. })
  955. } else {
  956. // 删除失败消息
  957. this.$refs.uToast.show({
  958. icon: false,
  959. message: "删除失败请重试!",
  960. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
  961. })
  962. }
  963. this.event = {};
  964. this.deleteShow = false;
  965. })
  966. },
  967. // 新增图片
  968. imgUploading(event) {
  969. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  970. let lists = [].concat(event.file)
  971. let fileListLen = this[`fileList${event.name}`].length
  972. lists.map((item) => {
  973. this[`fileList${event.name}`].push({
  974. ...item,
  975. status: 'uploading',
  976. message: '上传中'
  977. })
  978. })
  979. for (let i = 0; i < lists.length; i++) {
  980. let date = this.dateToString("yyyyMMdd");
  981. let dateHHmmss = this.dateToString("yyyy-MM-dd HH:mm:ss");
  982. this.formData.date = date;
  983. insertTmsAttachMngs(this.formData).then(res => {
  984. if (res.code == 200) {
  985. let data = {
  986. name: 'avatarfile',
  987. filePath: lists[i].url
  988. }
  989. // 获取经纬度
  990. let longitude = '';
  991. let latitude = '';
  992. // uni.getLocation({
  993. // type: 'wgs84',
  994. // success: function(res) {
  995. // console.log('当前位置的经度:' + res.longitude);
  996. // console.log('当前位置的纬度:' + res.latitude);
  997. // }
  998. // });
  999. uni.getLocation({
  1000. type: 'wgs84',
  1001. isHighAccuracy: true,
  1002. geocode: true,
  1003. success: (map) => {
  1004. longitude = map.longitude
  1005. latitude = map.latitude
  1006. let dataForm = {
  1007. attachId: res.data,
  1008. longitude: longitude,
  1009. latitude: latitude,
  1010. updateDate: dateHHmmss
  1011. }
  1012. // 上传图片
  1013. pictureUploading(data, dataForm).then(res => {
  1014. let item = this[`fileList${event.name}`][fileListLen]
  1015. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(
  1016. item, {
  1017. status: 'success',
  1018. message: '',
  1019. url: res.data
  1020. }))
  1021. fileListLen++
  1022. })
  1023. }
  1024. });
  1025. // let dataForm = {
  1026. // attachId: res.data,
  1027. // longitude: longitude,
  1028. // latitude: latitude,
  1029. // updateDate: dateHHmmss
  1030. // }
  1031. // console.log(dataForm);
  1032. // // 上传图片
  1033. // pictureUploading(data, dataForm).then(res => {
  1034. // let item = this[`fileList${event.name}`][fileListLen]
  1035. // this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(
  1036. // item, {
  1037. // status: 'success',
  1038. // message: '',
  1039. // url: res.data
  1040. // }))
  1041. // fileListLen++
  1042. // })
  1043. }
  1044. })
  1045. }
  1046. },
  1047. dateToString(fmt) {
  1048. var date = new Date();
  1049. var o = {
  1050. "M+": date.getMonth() + 1, //月份
  1051. "d+": date.getDate(), //日
  1052. "H+": date.getHours(), //小时
  1053. "m+": date.getMinutes(), //分
  1054. "s+": date.getSeconds(), //秒
  1055. "q+": Math.floor((date.getMonth() + 3) / 3), //季度
  1056. "S": date.getMilliseconds() //毫秒
  1057. };
  1058. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
  1059. for (var k in o)
  1060. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[
  1061. k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  1062. return fmt;
  1063. },
  1064. // 定点加油1清空
  1065. gasstation1Change() {
  1066. this.formData.oilappoint1Qty = 0;
  1067. this.formData.oilappoint1Amt = 0;
  1068. },
  1069. // 定点加油2清空
  1070. gasstation2Change() {
  1071. this.formData.oilappoint2Qty = 0;
  1072. this.formData.oilappoint2Amt = 0;
  1073. },
  1074. // 定点加油3清空
  1075. gasstation3Change() {
  1076. this.formData.oilappoint3Qty = 0;
  1077. this.formData.oilappoint3Amt = 0;
  1078. },
  1079. // 点击拨打电话
  1080. telFun() {
  1081. if (this.formData.driver1mobile != null && this.formData.driver1mobile != '') {
  1082. uni.makePhoneCall({
  1083. phoneNumber: this.formData.driver1mobile, //电话号码
  1084. success: function(e) {
  1085. // console.log(e);
  1086. },
  1087. fail: function(e) {
  1088. // console.log(e);
  1089. }
  1090. })
  1091. }
  1092. },
  1093. // 其他费用表格勾选事件
  1094. selectionChange(e) {
  1095. this.selectedIndexs = e.detail.index;
  1096. },
  1097. // 计算报销金额
  1098. // calculatMoney() {
  1099. // let loadetc = this.formData.loadetc == null ? 0 : this.formData.loadetc;
  1100. // let loadtoll = this.formData.loadtoll == null ? 0 : this.formData.loadtoll;
  1101. // let oilhomeAmt = this.formData.oilhomeAmt == null ? 0 : this.formData.oilhomeAmt;
  1102. // let oilappoint1Amt = this.formData.oilappoint1Amt == null ? 0 : this.formData.oilappoint1Amt;
  1103. // let oilappoint2Amt = this.formData.oilappoint2Amt == null ? 0 : this.formData.oilappoint2Amt;
  1104. // let oilappoint3Amt = this.formData.oilappoint3Amt == null ? 0 : this.formData.oilappoint3Amt;
  1105. // let oilcash1Amt = this.formData.oilcash1Amt == null ? 0 : this.formData.oilcash1Amt;
  1106. // let oilcardAmt = this.formData.oilcardAmt == null ? 0 : this.formData.oilcardAmt;
  1107. // let itemsMoney = 0;
  1108. // for (const key in this.itemsList) {
  1109. // let a = this.itemsList[key].amt == null ? 0 : this.itemsList[key].amt;
  1110. // itemsMoney += Number(a);
  1111. // }
  1112. // loadetc = Number(loadetc)
  1113. // loadtoll = Number(loadtoll)
  1114. // oilhomeAmt = Number(oilhomeAmt)
  1115. // oilappoint1Amt = Number(oilappoint1Amt)
  1116. // oilappoint2Amt = Number(oilappoint2Amt)
  1117. // oilappoint3Amt = Number(oilappoint3Amt)
  1118. // oilcash1Amt = Number(oilcash1Amt)
  1119. // oilcardAmt = Number(oilcardAmt)
  1120. // itemsMoney = Number(itemsMoney)
  1121. // this.money = loadetc + loadtoll + oilhomeAmt + oilappoint1Amt + oilappoint2Amt + oilcash1Amt + oilcardAmt +
  1122. // oilappoint3Amt + itemsMoney;
  1123. // },
  1124. checkUnLoadetc(e) {
  1125. //正则表达试
  1126. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1127. //重新赋值给input
  1128. this.$nextTick(() => {
  1129. this.formData.loadetc = e.target.value
  1130. })
  1131. this.calculatMoney();
  1132. },
  1133. checkUnLoadtoll(e) {
  1134. //正则表达试
  1135. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1136. //重新赋值给input
  1137. this.$nextTick(() => {
  1138. this.formData.loadtoll = e.target.value
  1139. })
  1140. this.calculatMoney();
  1141. },
  1142. checkUnOilhomeQty(e) {
  1143. //正则表达试
  1144. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1145. //重新赋值给input
  1146. this.$nextTick(() => {
  1147. this.formData.oilhomeQty = e.target.value
  1148. })
  1149. this.calculatMoney();
  1150. },
  1151. checkUnOilhomeAmt(e) {
  1152. //正则表达试
  1153. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1154. //重新赋值给input
  1155. this.$nextTick(() => {
  1156. this.formData.oilhomeAmt = e.target.value
  1157. })
  1158. this.calculatMoney();
  1159. },
  1160. checkUnOilappoint1Qty(e) {
  1161. //正则表达试
  1162. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1163. //重新赋值给input
  1164. this.$nextTick(() => {
  1165. this.formData.oilappoint1Qty = e.target.value
  1166. })
  1167. this.calculatMoney();
  1168. },
  1169. checkUnOilappoint1Amt(e) {
  1170. //正则表达试
  1171. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1172. //重新赋值给input
  1173. this.$nextTick(() => {
  1174. this.formData.oilappoint1Amt = e.target.value
  1175. })
  1176. this.calculatMoney();
  1177. },
  1178. checkUnOilappoint2Qty(e) {
  1179. //正则表达试
  1180. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1181. //重新赋值给input
  1182. this.$nextTick(() => {
  1183. this.formData.oilappoint2Qty = e.target.value
  1184. })
  1185. this.calculatMoney();
  1186. },
  1187. checkUnOilappoint2Amt(e) {
  1188. //正则表达试
  1189. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1190. //重新赋值给input
  1191. this.$nextTick(() => {
  1192. this.formData.oilappoint2Amt = e.target.value
  1193. })
  1194. this.calculatMoney();
  1195. },
  1196. checkUnOilappoint3Qty(e) {
  1197. //正则表达试
  1198. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1199. //重新赋值给input
  1200. this.$nextTick(() => {
  1201. this.formData.oilappoint3Qty = e.target.value
  1202. })
  1203. this.calculatMoney();
  1204. },
  1205. checkUnOilappoint3Amt(e) {
  1206. //正则表达试
  1207. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1208. //重新赋值给input
  1209. this.$nextTick(() => {
  1210. this.formData.oilappoint3Amt = e.target.value
  1211. })
  1212. this.calculatMoney();
  1213. },
  1214. checkUnOilcash1Qty(e) {
  1215. //正则表达试
  1216. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1217. //重新赋值给input
  1218. this.$nextTick(() => {
  1219. this.formData.oilcash1Qty = e.target.value
  1220. })
  1221. this.calculatMoney();
  1222. },
  1223. checkUnOilcash1Amt(e) {
  1224. //正则表达试
  1225. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1226. //重新赋值给input
  1227. this.$nextTick(() => {
  1228. this.formData.oilcash1Amt = e.target.value
  1229. })
  1230. this.calculatMoney();
  1231. },
  1232. checkUnOilcardQty(e) {
  1233. //正则表达试
  1234. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
  1235. //重新赋值给input
  1236. this.$nextTick(() => {
  1237. this.formData.oilcardQty = e.target.value
  1238. })
  1239. this.calculatMoney();
  1240. },
  1241. checkUnOilcardAmt(e) {
  1242. //正则表达试
  1243. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1244. //重新赋值给input
  1245. this.$nextTick(() => {
  1246. this.formData.oilcardAmt = e.target.value
  1247. })
  1248. this.calculatMoney();
  1249. },
  1250. checkUnAmt(amt, index) {
  1251. var amt = (amt.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  1252. //重新赋值给input
  1253. this.$nextTick(() => {
  1254. this.itemsList[index].amt = amt
  1255. })
  1256. this.calculatMoney();
  1257. },
  1258. inputHeight() {
  1259. // if (this.vHeight == 0) {
  1260. this.vHeight = 600;
  1261. // } else {
  1262. // this.vHeight = 0;
  1263. // }
  1264. }
  1265. }
  1266. }
  1267. </script>
  1268. <style lang="scss">
  1269. @import url("/font/iconfont.css");
  1270. // 修改布局方向为纵向布局
  1271. .vertical-layout {
  1272. display: flex;
  1273. }
  1274. .h {
  1275. margin-top: 20rpx;
  1276. height: 100rpx;
  1277. padding-left: 40rpx;
  1278. // font-weight: 900;
  1279. border-top: 2rpx solid #f0f0f0f0;
  1280. border-bottom: 2rpx solid #f0f0f0f0;
  1281. line-height: 100rpx;
  1282. font-size: 30rpx;
  1283. color: #3c9cff;
  1284. // background-color: pink;
  1285. }
  1286. // 分割线
  1287. .striping {
  1288. width: 100%;
  1289. height: 4rpx;
  1290. background-color: #f0f0f0f0;
  1291. }
  1292. .box-box {
  1293. padding-left: 30rpx;
  1294. padding-right: 30rpx;
  1295. }
  1296. .content {
  1297. box-sizing: border-box;
  1298. background-color: white;
  1299. .head {
  1300. color: #3c9cff;
  1301. // width: 100%;
  1302. height: 40rpx;
  1303. padding: 0 30rpx;
  1304. vertical-align: middle;
  1305. // display: table-cell;
  1306. display: flex;
  1307. align-items: flex-end;
  1308. justify-content: space-between;
  1309. box-sizing: border-box;
  1310. font-size: 34rpx;
  1311. font-weight: 700;
  1312. // background-color: red;
  1313. }
  1314. .head-no-addr {
  1315. // width: 960rpx;
  1316. height: 100rpx;
  1317. // padding-left: 30rpx;
  1318. padding: 0 30rpx;
  1319. vertical-align: middle;
  1320. color: #fff;
  1321. font-size: 34rpx;
  1322. font-weight: 700;
  1323. display: flex;
  1324. align-items: center;
  1325. justify-content: space-between;
  1326. box-sizing: border-box;
  1327. background-color: #3c9cff;
  1328. }
  1329. .box-list {
  1330. color: #3b3b3b;
  1331. width: 100%;
  1332. border-bottom: 2rpx solid #f0f0f0f0;
  1333. // padding-left: 50rpx;
  1334. // font-size: 30rpx;
  1335. color: #3b3b3b;
  1336. .icon {
  1337. // width: 100rpx;
  1338. margin-top: 50rpx;
  1339. // font-size: 50rpx;
  1340. // color: #4888ff;
  1341. }
  1342. .list {
  1343. margin-top: 30rpx;
  1344. margin-bottom: 20rpx;
  1345. width: 100%;
  1346. height: 100%;
  1347. // background-color: pink;
  1348. height: auto;
  1349. display: flex;
  1350. flex-wrap: wrap;
  1351. // font-size: 30rpx;
  1352. }
  1353. .quantity-aum {
  1354. margin-bottom: 25rpx;
  1355. .aaa {
  1356. width: 50%;
  1357. .key {
  1358. display: inline-block;
  1359. width: 50%;
  1360. margin-left: 20rpx;
  1361. // margin-right: 80rpx;
  1362. border-bottom: 2rpx dotted #000;
  1363. }
  1364. }
  1365. .bbb {
  1366. width: 50%;
  1367. .value {
  1368. width: 50%;
  1369. margin-left: 20rpx;
  1370. // margin-right: 20rpx;
  1371. border-bottom: 2rpx dotted #000;
  1372. }
  1373. }
  1374. }
  1375. }
  1376. .box {
  1377. color: #3b3b3b;
  1378. // overflow: hidden;
  1379. height: 100rpx;
  1380. // border-bottom: 2rpx solid #f0f0f0f0;
  1381. // font-size: 30rpx;
  1382. display: flex;
  1383. align-items: center;
  1384. .data {
  1385. width: 50%;
  1386. display: flex;
  1387. align-items: center;
  1388. .key {
  1389. width: 55%;
  1390. text-align: right;
  1391. color: #3c9cff;
  1392. }
  1393. .value {
  1394. margin-left: 20rpx;
  1395. width: 45%;
  1396. color: #3b3b3b;
  1397. border-bottom: 2rpx dotted #000;
  1398. }
  1399. }
  1400. .data-two {
  1401. width: 100%;
  1402. display: flex;
  1403. align-items: center;
  1404. .key {
  1405. width: 35%;
  1406. text-align: right;
  1407. color: #3c9cff;
  1408. }
  1409. .list {
  1410. margin-top: 30rpx;
  1411. margin-bottom: 20rpx;
  1412. width: 100%;
  1413. height: 100%;
  1414. // background-color: pink;
  1415. height: auto;
  1416. display: flex;
  1417. flex-wrap: wrap;
  1418. // font-size: 30rpx;
  1419. }
  1420. }
  1421. }
  1422. .box-two {
  1423. color: #3b3b3b;
  1424. overflow: hidden;
  1425. height: 100rpx;
  1426. padding-left: 20rpx;
  1427. // margin-right: 20rpx;
  1428. // font-size: 30rpx;
  1429. display: flex;
  1430. align-items: center;
  1431. .key {
  1432. display: inline-block;
  1433. width: 24%;
  1434. color: #3c9cff;
  1435. }
  1436. .value {
  1437. margin-left: 20rpx;
  1438. width: calc(100% - 24%);
  1439. color: #3b3b3b;
  1440. // margin-right: 20rpx;
  1441. border-bottom: 2rpx dotted #000;
  1442. }
  1443. }
  1444. .table {
  1445. // margin-top: 40rpx;
  1446. margin-left: 20rpx;
  1447. margin-right: 20rpx;
  1448. .data {
  1449. // font-size: 30rpx;
  1450. width: 100%;
  1451. height: 100rpx;
  1452. border-bottom: 2rpx solid #f0f0f0f0;
  1453. align-items: center;
  1454. .name {
  1455. text-align: right;
  1456. width: 25%;
  1457. margin-left: 20rpx;
  1458. color: #000;
  1459. }
  1460. .sum {
  1461. width: 20%;
  1462. margin-left: 20rpx;
  1463. margin-right: 40rpx;
  1464. border-bottom: 2rpx dotted #000;
  1465. }
  1466. .remarks {
  1467. width: 30%;
  1468. }
  1469. }
  1470. }
  1471. .primary {
  1472. background-color: #0b68ffff;
  1473. }
  1474. .attention {
  1475. padding: 30rpx;
  1476. padding-left: 50rpx;
  1477. padding-bottom: 40rpx;
  1478. }
  1479. // 底部提交按钮
  1480. // .bottom {
  1481. // height: 130rpx;
  1482. // display: block;
  1483. // position: fixed;
  1484. // bottom: calc(var(--window-bottom));
  1485. // width: 100%;
  1486. // // background-color: #f0f0f0f0;
  1487. // // background-color: pink;
  1488. // background-color: white;
  1489. // .bottom-bottom {
  1490. // width: 100%;
  1491. // height: 100%;
  1492. // position: relative;
  1493. // display: flex;
  1494. // // .submit {
  1495. // // width: 95%;
  1496. // // background-color: #0b68ffff;
  1497. // // }
  1498. // .money {
  1499. // font-size: 28rpx;
  1500. // height: 130rpx;
  1501. // margin-right: 80rpx;
  1502. // line-height: 130rpx;
  1503. // margin-left: 10%;
  1504. // }
  1505. // .button {
  1506. // width: 300rpx;
  1507. // position: absolute;
  1508. // right: 0;
  1509. // margin-right: 10%;
  1510. // .button-button {
  1511. // padding: 10% 0;
  1512. // background-clip: content-box;
  1513. // }
  1514. // }
  1515. // }
  1516. // }
  1517. .bottom {
  1518. position: fixed;
  1519. bottom: calc(var(--window-bottom));
  1520. width: 100%;
  1521. height: 130rpx;
  1522. background-color: white;
  1523. .row {
  1524. display: flex;
  1525. justify-content: space-evenly;
  1526. height: 130rpx;
  1527. align-items: center;
  1528. .button {
  1529. width: 300rpx;
  1530. // width: 660rpx;
  1531. }
  1532. }
  1533. }
  1534. .input {
  1535. width: 100%;
  1536. // height: 100rpx;
  1537. // background-color: red;
  1538. }
  1539. .cushion {
  1540. width: 100%;
  1541. height: 200rpx;
  1542. background-color: #f0f0f0f0;
  1543. }
  1544. }
  1545. </style>