AddOrUpdate.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481
  1. <template>
  2. <el-dialog
  3. :title="title"
  4. :visible.sync="showDialog"
  5. width="80%"
  6. @close="handleClose"
  7. :close-on-click-modal="false"
  8. >
  9. <span>
  10. <el-form ref="form" :model="form" label-width="110px">
  11. <!-- <span style="font-size: 20px" v-if="form.billKind == 'NN'"> 直单 </span>-->
  12. <!-- <span style="font-size: 20px" v-if="form.billKind == 'MM'"> 主单 </span>-->
  13. <!-- <span style="font-size: 20px" v-if="form.billKind == 'MH'"> 从单 </span>-->
  14. <el-row>
  15. <el-col :span="6">
  16. <el-form-item label="车号" prop="carregNo">
  17. <el-input
  18. v-model="form.carregNo"
  19. placeholder="请输入车号"
  20. :disabled="true"
  21. size="small"
  22. style="width: 100%"
  23. />
  24. </el-form-item>
  25. </el-col>
  26. <el-col :span="6">
  27. <el-form-item label="司机" prop="driverName">
  28. <el-input
  29. v-model="form.driverName"
  30. placeholder="请输入司机"
  31. :disabled="true"
  32. size="small"
  33. style="width: 100%"
  34. />
  35. </el-form-item>
  36. </el-col>
  37. <el-col :span="6">
  38. <el-form-item label="运输性质" prop="transProp">
  39. <el-select
  40. v-model="form.transProp"
  41. placeholder="请选择运输方式"
  42. :disabled="true"
  43. size="small"
  44. style="width: 100%"
  45. >
  46. <el-option
  47. v-for="(dict, index) in transPropList"
  48. :key="index.dictValue"
  49. :label="dict.dictLabel"
  50. :value="dict.dictValue"
  51. />
  52. </el-select>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :span="6">
  56. <el-form-item label="运单号" prop="orderNo">
  57. <el-input
  58. v-model="form.orderNo"
  59. placeholder="请输入运单号"
  60. size="small"
  61. style="width: 100%"
  62. v-input-limit="2"
  63. disabled
  64. />
  65. </el-form-item>
  66. </el-col>
  67. </el-row>
  68. <el-row>
  69. <el-col :span="6">
  70. <el-form-item label="客户名称" prop="fCorpId">
  71. <el-select
  72. v-model="form.fCorpId"
  73. placeholder="请输入客户名称"
  74. :clearable="true"
  75. filterable
  76. size="small"
  77. style="width: 100%"
  78. :disabled="true"
  79. >
  80. <el-option
  81. v-for="(dict, index) in fMblnoOptions"
  82. :key="index.fId"
  83. :label="dict.fName"
  84. :value="dict.fId"
  85. />
  86. </el-select>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="6">
  90. <el-form-item label="业务类型" prop="billType">
  91. <el-select
  92. v-model="form.billType"
  93. placeholder="请选择业务类型"
  94. :disabled="true"
  95. size="small"
  96. style="width: 100%"
  97. >
  98. <el-option
  99. v-for="(dict, index) in billTypeList"
  100. :key="index.dictValue"
  101. :label="dict.dictLabel"
  102. :value="dict.dictValue"
  103. />
  104. </el-select>
  105. </el-form-item>
  106. </el-col>
  107. <el-col :span="6">
  108. <el-form-item label="提单号" prop="mblno">
  109. <el-input
  110. v-model="form.mblno"
  111. placeholder="请输入提单号"
  112. :disabled="true"
  113. size="small"
  114. style="width: 100%"
  115. />
  116. </el-form-item>
  117. </el-col>
  118. <el-col :span="6">
  119. <el-form-item label="装车地点" prop="tLoadAddr">
  120. <el-input
  121. v-model="form.tLoadAddr"
  122. placeholder="请输入装车地点"
  123. :disabled="true"
  124. size="small"
  125. style="width: 100%"
  126. />
  127. </el-form-item>
  128. </el-col>
  129. <el-col :span="6">
  130. <el-form-item label="卸车地点" prop="unLoadAddr">
  131. <el-input
  132. v-model="form.tUnLoadAddr"
  133. placeholder="请输入卸车地点"
  134. :disabled="true"
  135. size="small"
  136. style="width: 100%"
  137. />
  138. </el-form-item>
  139. </el-col>
  140. </el-row>
  141. </el-form>
  142. <el-collapse v-model="collapselist">
  143. <el-collapse-item name="1">
  144. <template slot="title">
  145. <span style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  146. >原业务费用信息</span>
  147. </template>
  148. <el-table :data="feesList" style="width: 100%">
  149. <el-table-column
  150. prop="fCorpid"
  151. label="结算单位"
  152. align="center"
  153. width="180"
  154. >
  155. <template slot-scope="scope">
  156. <el-select
  157. v-model="scope.row.fCorpid"
  158. placeholder="请输入客户名称"
  159. :clearable="true"
  160. filterable
  161. size="mini"
  162. style="width: 160px"
  163. :disabled="true"
  164. >
  165. <el-option
  166. v-for="(dict, index) in fMblnoOptions"
  167. :key="index.fId"
  168. :label="dict.fName"
  169. :value="dict.fId"
  170. />
  171. </el-select>
  172. </template>
  173. </el-table-column>
  174. <el-table-column
  175. prop="fFeeid"
  176. label="费用名称"
  177. align="center"
  178. width="120"
  179. >
  180. <template slot-scope="scope">
  181. <el-select
  182. v-model="scope.row.fFeeid"
  183. filterable
  184. :disabled="true"
  185. remote
  186. placeholder="费用名称"
  187. >
  188. <el-option
  189. v-for="(dict, index) in fCNameOptions"
  190. :key="index.fId"
  191. :label="dict.fName"
  192. :value="dict.fId"
  193. ></el-option>
  194. </el-select>
  195. </template>
  196. </el-table-column>
  197. <el-table-column prop="fDc" label="收付" align="center" width="100">
  198. <template slot-scope="scope">
  199. <el-select
  200. v-model="scope.row.fDc"
  201. placeholder="请选择"
  202. :disabled="true"
  203. >
  204. <el-option label="收" value="D"></el-option>
  205. <el-option label="付" value="C"></el-option>
  206. </el-select>
  207. </template>
  208. </el-table-column>
  209. <el-table-column
  210. prop="fFeeunitid"
  211. label="计费单位"
  212. align="center"
  213. width="100"
  214. >
  215. <template slot-scope="scope">
  216. <el-select
  217. v-model="scope.row.fFeeunitid"
  218. placeholder="请选择计费单位"
  219. :disabled="true"
  220. clearable
  221. >
  222. <el-option
  223. v-for="dict in jFeetunitOptions"
  224. :key="dict.dictValue"
  225. :label="dict.dictLabel"
  226. :value="dict.dictValue"
  227. />
  228. </el-select>
  229. </template>
  230. </el-table-column>
  231. <el-table-column
  232. prop="fBillingQty"
  233. label="计费数量"
  234. align="center"
  235. width="100"
  236. >
  237. <template slot-scope="scope">
  238. <el-input
  239. v-model="scope.row.fBillingQty"
  240. :disabled="true"
  241. placeholder="请输入内容"
  242. @input="total(scope.row)"
  243. v-input-limit="2"
  244. ></el-input>
  245. </template>
  246. </el-table-column>
  247. <el-table-column
  248. prop="fUnitprice"
  249. label="单价"
  250. align="center"
  251. width="100"
  252. >
  253. <template slot-scope="scope">
  254. <el-input
  255. v-model="scope.row.fUnitprice"
  256. :disabled="true"
  257. placeholder="请输入内容"
  258. @input="total(scope.row)"
  259. v-input-limit="2"
  260. ></el-input>
  261. </template>
  262. </el-table-column>
  263. <el-table-column
  264. prop="fCurrency"
  265. label="币种"
  266. align="center"
  267. width="100"
  268. >
  269. <template slot-scope="scope">
  270. <el-input
  271. v-model="scope.row.fCurrency"
  272. :disabled="true"
  273. placeholder="请输入内容"
  274. ></el-input>
  275. </template>
  276. </el-table-column>
  277. <el-table-column prop="fExrate" label="汇率" align="center" width="100">
  278. <template slot-scope="scope">
  279. <el-input
  280. v-model="scope.row.fExrate"
  281. :disabled="true"
  282. placeholder="请输入内容"
  283. ></el-input>
  284. </template>
  285. </el-table-column>
  286. <el-table-column prop="fAmount" label="金额" align="center" width="100">
  287. <template slot-scope="scope">
  288. <el-input
  289. v-model="scope.row.fAmount"
  290. :disabled="true"
  291. placeholder="请输入内容"
  292. ></el-input>
  293. </template>
  294. </el-table-column>
  295. <el-table-column
  296. prop="fTaxrate"
  297. label="税率"
  298. align="center"
  299. width="100"
  300. >
  301. <template slot-scope="scope">
  302. <el-input
  303. v-model="scope.row.fTaxrate"
  304. :disabled="true"
  305. placeholder="请输入内容"
  306. ></el-input>
  307. </template>
  308. </el-table-column>
  309. <el-table-column prop="remarks" label="备注" align="center" width="180">
  310. <template slot-scope="scope">
  311. <el-input
  312. v-model="scope.row.remarks"
  313. :disabled="true"
  314. placeholder="请输入内容"
  315. ></el-input>
  316. </template>
  317. </el-table-column>
  318. <el-table-column prop="remarks" label="费用来源" align="center">
  319. <template slot-scope="scope">
  320. <span v-if="scope.row.actId == 1080">费用确认</span>
  321. <span v-if="scope.row.actId == 1090">追加费用</span>
  322. </template>
  323. </el-table-column>
  324. <el-table-column
  325. label="操作"
  326. align="center"
  327. class-name="small-padding fixed-width"
  328. fixed="right"
  329. width="100px"
  330. >
  331. <template slot-scope="scope">
  332. <el-button
  333. size="mini"
  334. type="text"
  335. icon="el-icon-delete"
  336. :disabled="disabled"
  337. @click.native.prevent="change(scope)"
  338. >变更</el-button>
  339. </template>
  340. </el-table-column>
  341. </el-table>
  342. </el-collapse-item>
  343. <el-collapse-item name="2">
  344. <template slot="title">
  345. <span style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  346. >更改费用信息</span>
  347. </template>
  348. <div>
  349. <div style="display: flex; justify-content: space-between; margin: 10px 0">
  350. <div>
  351. <el-button
  352. type="primary"
  353. icon="el-icon-plus"
  354. size="mini"
  355. @click="addRelevtTwo"
  356. :disabled="form.orderStatus < 80"
  357. >保存</el-button>
  358. <el-button
  359. type="primary"
  360. icon="el-icon-plus"
  361. size="mini"
  362. @click="addRelevt2"
  363. :disabled="form.orderStatus < 80"
  364. >提交请核</el-button>
  365. </div>
  366. </div>
  367. </div>
  368. <el-table :data="formfeesList" style="width: 100%">
  369. <el-table-column
  370. prop="fCorpid"
  371. label="结算单位"
  372. align="center"
  373. width="180"
  374. >
  375. <template slot-scope="scope">
  376. <el-select
  377. v-model="scope.row.fCorpid"
  378. placeholder="请输入客户名称"
  379. :clearable="true"
  380. filterable
  381. size="mini"
  382. style="width: 160px"
  383. :disabled="true"
  384. >
  385. <el-option
  386. v-for="(dict, index) in fMblnoOptions"
  387. :key="index.fId"
  388. :label="dict.fName"
  389. :value="dict.fId"
  390. />
  391. </el-select>
  392. </template>
  393. </el-table-column>
  394. <el-table-column
  395. prop="fFeeid"
  396. label="费用名称"
  397. align="center"
  398. width="120"
  399. >
  400. <template slot-scope="scope">
  401. <el-select
  402. v-model="scope.row.fFeeid"
  403. filterable
  404. :disabled="true"
  405. remote
  406. placeholder="费用名称"
  407. >
  408. <el-option
  409. v-for="(dict, index) in fCNameOptions"
  410. :key="index.fId"
  411. :label="dict.fName"
  412. :value="dict.fId"
  413. ></el-option>
  414. </el-select>
  415. </template>
  416. </el-table-column>
  417. <el-table-column prop="fDc" label="收付" align="center" width="100">
  418. <template slot-scope="scope">
  419. <el-select
  420. v-model="scope.row.fDc"
  421. placeholder="请选择"
  422. :disabled="true"
  423. >
  424. <el-option label="收" value="D"></el-option>
  425. <el-option label="付" value="C"></el-option>
  426. </el-select>
  427. </template>
  428. </el-table-column>
  429. <el-table-column
  430. prop="fFeeunitid"
  431. label="计费单位"
  432. align="center"
  433. width="100"
  434. >
  435. <template slot-scope="scope">
  436. <el-select
  437. v-model="scope.row.fFeeunitid"
  438. placeholder="请选择计费单位"
  439. :disabled="true"
  440. clearable
  441. >
  442. <el-option
  443. v-for="dict in jFeetunitOptions"
  444. :key="dict.dictValue"
  445. :label="dict.dictLabel"
  446. :value="dict.dictValue"
  447. />
  448. </el-select>
  449. </template>
  450. </el-table-column>
  451. <el-table-column
  452. prop="fBillingQty"
  453. label="计费数量"
  454. align="center"
  455. width="100"
  456. >
  457. <template slot-scope="scope">
  458. <el-input
  459. v-model="scope.row.fBillingQty"
  460. :disabled="true"
  461. placeholder="请输入内容"
  462. @input="total(scope.row)"
  463. v-input-limit="2"
  464. ></el-input>
  465. </template>
  466. </el-table-column>
  467. <el-table-column
  468. prop="fUnitprice"
  469. label="单价"
  470. align="center"
  471. width="100"
  472. >
  473. <template slot-scope="scope">
  474. <el-input
  475. v-model="scope.row.fUnitprice"
  476. :disabled="true"
  477. placeholder="请输入内容"
  478. @input="total(scope.row)"
  479. v-input-limit="2"
  480. ></el-input>
  481. </template>
  482. </el-table-column>
  483. <el-table-column
  484. prop="fCurrency"
  485. label="币种"
  486. align="center"
  487. width="100"
  488. >
  489. <template slot-scope="scope">
  490. <el-input
  491. v-model="scope.row.fCurrency"
  492. :disabled="true"
  493. placeholder="请输入内容"
  494. ></el-input>
  495. </template>
  496. </el-table-column>
  497. <el-table-column prop="fExrate" label="汇率" align="center" width="100">
  498. <template slot-scope="scope">
  499. <el-input
  500. v-model="scope.row.fExrate"
  501. :disabled="true"
  502. placeholder="请输入内容"
  503. ></el-input>
  504. </template>
  505. </el-table-column>
  506. <el-table-column prop="fAmount" label="金额" align="center" width="100">
  507. <template slot-scope="scope">
  508. <el-input
  509. v-model="scope.row.fAmount"
  510. :disabled="true"
  511. placeholder="请输入内容"
  512. ></el-input>
  513. </template>
  514. </el-table-column>
  515. <el-table-column
  516. prop="fTaxrate"
  517. label="税率"
  518. align="center"
  519. width="100"
  520. >
  521. <template slot-scope="scope">
  522. <el-input
  523. v-model="scope.row.fTaxrate"
  524. :disabled="true"
  525. placeholder="请输入内容"
  526. ></el-input>
  527. </template>
  528. </el-table-column>
  529. <el-table-column prop="remarks" label="费用来源" align="center">
  530. <template slot-scope="scope">
  531. <span v-if="scope.row.actId == 1080">费用确认</span>
  532. <span v-if="scope.row.actId == 1090">追加费用</span>
  533. </template>
  534. </el-table-column>
  535. <el-table-column prop="remarks" label="录入人" align="center"></el-table-column>
  536. <el-table-column prop="remarks" label="录入日期" align="center"></el-table-column>
  537. <el-table-column prop="remarks" label="审核人" align="center"></el-table-column>
  538. <el-table-column prop="remarks" label="审核日期" align="center"></el-table-column>
  539. <el-table-column prop="remarks" label="备注" align="center" width="180">
  540. <template slot-scope="scope">
  541. <el-input
  542. v-model="scope.row.remarks"
  543. :disabled="true"
  544. placeholder="请输入内容"
  545. ></el-input>
  546. </template>
  547. </el-table-column>
  548. <el-table-column
  549. label="操作"
  550. align="center"
  551. class-name="small-padding fixed-width"
  552. fixed="right"
  553. width="140px"
  554. >
  555. <template slot-scope="scope">
  556. <el-button
  557. size="mini"
  558. type="text"
  559. icon="el-icon-delete"
  560. :disabled="form.orderStatus < 80"
  561. @click.native.prevent="deleteRow(scope,scope.$index)"
  562. >删除</el-button>
  563. <el-button
  564. size="mini"
  565. type="text"
  566. icon="el-icon-delete"
  567. :disabled="form.orderStatus < 80"
  568. @click.native.prevent="deleteRow(scope,scope.$index)"
  569. >请核</el-button>
  570. </template>
  571. </el-table-column>
  572. </el-table>
  573. </el-collapse-item>
  574. </el-collapse>
  575. </span>
  576. <span slot="footer" class="dialog-footer">
  577. <!-- <el-button-->
  578. <!-- type="primary"-->
  579. <!-- @click="submitForm('acceptDate')"-->
  580. <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
  581. <!-- :disabled="form.billStatus == 7"-->
  582. <!-- >接 单</el-button-->
  583. <!-- >-->
  584. <!-- <el-button-->
  585. <!-- type="primary"-->
  586. <!-- @click="submitForm('loadDate')"-->
  587. <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
  588. <!-- :disabled="form.billStatus == 7"-->
  589. <!-- >提 箱</el-button-->
  590. <!-- >-->
  591. <!-- <el-button-->
  592. <!-- type="primary"-->
  593. <!-- @click="submitForm('mdLoadDate')"-->
  594. <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
  595. <!-- :disabled="form.billStatus == 7"-->
  596. <!-- >装卸货</el-button-->
  597. <!-- >-->
  598. <!-- <el-button-->
  599. <!-- type="primary"-->
  600. <!-- @click="submitForm('unLoadDate')"-->
  601. <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
  602. <!-- :disabled="form.billStatus == 7"-->
  603. <!-- >还卸柜</el-button-->
  604. <!-- >-->
  605. <!-- <el-button-->
  606. <!-- type="primary"-->
  607. <!-- @click="submitForm('waybillDate')"-->
  608. <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
  609. <!-- :disabled="form.billStatus == 7"-->
  610. <!-- >回 单</el-button-->
  611. <!-- >-->
  612. <!-- <el-button-->
  613. <!-- type="primary"-->
  614. <!-- @click="driversubmitForm"-->
  615. <!-- v-hasPermi="['fleet:vehicleStatus:edit']"-->
  616. <!-- :disabled="form.billStatus == 7"-->
  617. <!-- >提 交</el-button-->
  618. <!-- >-->
  619. <el-button
  620. type="success"
  621. @click="submitAllowChanges"
  622. v-hasPermi="['fleet:vehicleStatus:edit']"
  623. :disabled="form.orderStatus <= 80"
  624. >修 改</el-button
  625. >
  626. <el-button
  627. type="info"
  628. @click="addRelevtTwo"
  629. v-hasPermi="['fleet:vehicleStatus:edit']"
  630. :disabled="form.orderStatus <= 80"
  631. >保 存</el-button
  632. >
  633. <!-- <el-button type="warning" @click="submitRetreat">撤 回</el-button> -->
  634. <el-button @click="showDialog = false">取 消</el-button>
  635. </span>
  636. </el-dialog>
  637. </template>
  638. <script>
  639. import {
  640. removeFtmsorderbillscars,
  641. driverSaveFtmsorderbillscars,
  642. insertDriverFtmsorderbillscars,
  643. deleteList
  644. } from "@/api/fleet/ftmsorderbillscarstwo";
  645. import {getBasicInformation} from "@/api/kaihe/basicdata/container";
  646. import {listGoods} from "@/api/basicdata/goods";
  647. import {listCorps} from "@/api/basicdata/corps";
  648. import {listFees} from "@/api/basicdata/fees";
  649. import UploadFile from "@/components/Uploadfile";
  650. import {
  651. submit,
  652. changeFees,
  653. revokeFees,
  654. deleteFees,
  655. driverSubmit,
  656. } from "@/api/track/singleCost";
  657. import Cookies from "js-cookie";
  658. import {getToken} from "@/utils/auth";
  659. import {addStowageTwo} from "../../../api/fleet/ftmsorderbillscarstwo";
  660. export default {
  661. name: "plans",
  662. props: {
  663. addOrUpdateVisible: {
  664. type: Boolean,
  665. default: false,
  666. },
  667. title: {
  668. type: String,
  669. required: "",
  670. },
  671. form: Object,
  672. carsTable: Object,
  673. DList: {
  674. type: Array,
  675. default: [],
  676. },
  677. CList: {
  678. type: Array,
  679. default: [],
  680. },
  681. disabled: Boolean,
  682. relevantAttachments: {
  683. type: Array,
  684. default: [],
  685. },
  686. feesList: {
  687. type: Array,
  688. default: () => [],
  689. },
  690. formfeesList: {
  691. type: Array,
  692. default: () => [],
  693. },
  694. allfMblnoOptions: {
  695. type: Array,
  696. default: [],
  697. },
  698. },
  699. components: {
  700. UploadFile,
  701. },
  702. data() {
  703. return {
  704. chiFeesList: [],
  705. // 控制弹出框显示隐藏
  706. showDialog: false,
  707. billTypeList: [],
  708. transTypeList: [],
  709. transPropList: [],
  710. goodsLossTypeList: [],
  711. cntrIdList: [],
  712. priceTypeList: [],
  713. userType: null,
  714. username: null,
  715. collapses: [],
  716. fMblnoOptions: [],
  717. fMblnoOptions2: [],
  718. cntrId2List: [],
  719. goodsOptions: [],
  720. collapselist: ["1", "2"],
  721. fWbuOptions: [],
  722. ffeeunitidList: [],
  723. polList: [],
  724. podList: [],
  725. uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
  726. headers: {
  727. Authorization: "Bearer " + getToken(),
  728. },
  729. jFeetunitOptions: [],
  730. detailsHidden: false,
  731. fCNameOptions: []
  732. };
  733. },
  734. created() {
  735. this.getDicts("data_unitfees").then((response) => {
  736. if (response.data) {
  737. this.jFeetunitOptions = response.data;
  738. }
  739. });
  740. this.getDicts("data_billType").then((response) => {
  741. this.billTypeList = response.data;
  742. });
  743. this.getDicts("data_transType").then((response) => {
  744. this.transTypeList = response.data;
  745. });
  746. this.getDicts("data_transProp").then((response) => {
  747. this.transPropList = response.data;
  748. });
  749. this.getDicts("data_goodsLossType").then((response) => {
  750. this.goodsLossTypeList = response.data;
  751. });
  752. this.getDicts("data_cntrId").then((response) => {
  753. response.data.map((e) => (e.noOption = false));
  754. this.cntrIdList = response.data;
  755. });
  756. this.getDicts("data_priceType").then((response) => {
  757. this.priceTypeList = response.data;
  758. });
  759. this.getDicts("data_ffeeunitid").then((response) => {
  760. this.ffeeunitidList = response.data;
  761. });
  762. getBasicInformation({
  763. fTypes: 1,
  764. fStatus: "T",
  765. }).then((response) => {
  766. this.polList = response;
  767. this.podList = response;
  768. });
  769. listCorps().then((response) => {
  770. this.fMblnoOptions = response.rows;
  771. });
  772. listFees().then((response) => {
  773. this.fCNameOptions = response.rows;
  774. });
  775. listGoods().then((response) => {
  776. this.goodsOptions = response.rows;
  777. });
  778. listFees().then((response) => {
  779. this.fWbuOptions = response.rows;
  780. });
  781. this.userType = Cookies.get("userType");
  782. this.username = Cookies.get("userName");
  783. },
  784. methods: {
  785. //变更按钮
  786. change(scope){
  787. console.log(scope)
  788. for (let item in this.formfeesList){
  789. if (scope.row.fId === this.formfeesList[item].fId) return this.$message({
  790. showClose: true,
  791. message: '已有相同单据',
  792. type: 'error'
  793. });
  794. }
  795. this.formfeesList.push(scope.row)
  796. },
  797. // 新增附件上传
  798. addRelevt4() {
  799. this.chiFeesList.push({
  800. actId: "1090",
  801. fCorpid: this.form.fCorpId,
  802. fFeeid: "",
  803. fDc: "",
  804. fFeeunitid: "1",
  805. fBillingQty: 0,
  806. fUnitprice: 0,
  807. fCurrency: "RMB",
  808. fTaxrate: null,
  809. fAmount: 0,
  810. fExrate: 1,
  811. remarks: "",
  812. });
  813. },
  814. // 新增附件上传
  815. addRelevt() {
  816. this.relevantAttachments.push({
  817. attachUrl: null,
  818. attachName: null,
  819. createBy: this.username,
  820. createTime: Date.parse(new Date()),
  821. });
  822. },
  823. //附件删除
  824. deleteFile(scope) {
  825. this.relevantAttachments[scope.$index].attachName = "";
  826. this.relevantAttachments[scope.$index].attachUrl = "";
  827. if (this.relevantAttachments[scope.$index].attachUrl === "") {
  828. this.$message.success("删除成功");
  829. } else {
  830. this.$message.error("未知错误,删除失败");
  831. }
  832. },
  833. //附件查看
  834. checkFile(scope) {
  835. if (this.relevantAttachments[scope.$index].attachUrl) {
  836. window.open(this.relevantAttachments[scope.$index].attachUrl);
  837. } else {
  838. this.$message.error("请上传附件");
  839. }
  840. },
  841. //附件上传
  842. handleSucces(scope, res, file) {
  843. this.relevantAttachments[scope.$index].attachName = res.fileName;
  844. this.relevantAttachments[scope.$index].attachUrl = res.url;
  845. if (this.relevantAttachments[scope.$index].attachUrl === "") {
  846. this.$message.error("上传失败");
  847. } else {
  848. this.$message.success("上传成功");
  849. }
  850. },
  851. // 添加行
  852. addRow(tableData, event) {
  853. var obj = {};
  854. tableData.push(obj);
  855. },
  856. addDListRow(tableData, event) {
  857. var obj = {
  858. fcorpid: this.form.fCorpId,
  859. fcurrency: "RMB",
  860. fPid: this.form.id,
  861. fExrate: "1",
  862. };
  863. tableData.push(obj);
  864. },
  865. //內容删除
  866. deleteRow(rows,index) {
  867. deleteList(rows.row.fId).then(res =>{
  868. console.log(res);
  869. this.formfeesList.splice(index, 1);
  870. })
  871. },
  872. // 上传成功返回数据
  873. showFile(row) {
  874. for (let list in this.relevantAttachments) {
  875. this.$set(this.relevantAttachments[list], "attachUrl", row.url);
  876. this.$set(this.relevantAttachments[list], "attachName", row.fileName);
  877. }
  878. },
  879. addRelevtTwo(){
  880. let formData = new window.FormData();
  881. formData.append("status", "6");
  882. formData.append("cars", JSON.stringify(this.form));
  883. formData.append("ftmsorderbillsfees", JSON.stringify(this.formfeesList));
  884. addStowageTwo(formData).then((response) => {
  885. if (response.code == 200) {
  886. this.msgSuccess("保存成功");
  887. this.$parent.getList();
  888. // this.$parent.getSave(response);
  889. }
  890. });
  891. },
  892. addRelevt2() {
  893. let arr = this.chiFeesList;
  894. arr.filter((e) => e.actId == "1080");
  895. if (arr.length > 0) {
  896. this.$confirm("已生成费用信息, 是否重新生成?", "提示", {
  897. confirmButtonText: "确定",
  898. cancelButtonText: "取消",
  899. type: "warning",
  900. })
  901. .then(() => {
  902. this.chiFeesList = this.chiFeesList.filter(
  903. (e) => e.fBillstatus == 6 || e.actId != "1080"
  904. );
  905. console.log(this.chiFeesList);
  906. this.addRelevt3();
  907. })
  908. .catch(() => {
  909. this.$message({
  910. type: "info",
  911. message: "已取消",
  912. });
  913. });
  914. } else {
  915. this.addRelevt3();
  916. }
  917. },
  918. addRelevt3() {
  919. if (this.form.oilAmt > 0) {
  920. this.fFeeid52 = true;
  921. this.chiFeesList.map((e) => {
  922. if (e.fFeeid == 52 && e.actId == 1080) {
  923. this.fFeeid52 = false;
  924. }
  925. });
  926. if (this.fFeeid52) {
  927. this.chiFeesList.push({
  928. actId: "1080",
  929. fCorpid: this.form.driverUserId,
  930. fFeeid: 52,
  931. fDc: "C",
  932. fFeeunitid: "6",
  933. fBillingQty: 1,
  934. fUnitprice: this.form.oilAmt,
  935. fCurrency: "RMB",
  936. fTaxrate: 3,
  937. fAmount: this.form.oilAmt,
  938. fExrate: 1,
  939. remarks: null,
  940. });
  941. }
  942. }
  943. if (this.form.driverbonus > 0) {
  944. this.fFeeid53 = true;
  945. this.chiFeesList.map((e) => {
  946. if (e.fFeeid == 53 && e.actId == 1080) {
  947. this.fFeeid53 = false;
  948. }
  949. });
  950. if (this.fFeeid53) {
  951. this.chiFeesList.push({
  952. actId: "1080",
  953. fCorpid: this.form.driverUserId,
  954. fFeeid: 53,
  955. fDc: "C",
  956. fFeeunitid: "6",
  957. fBillingQty: 1,
  958. fUnitprice: this.form.driverbonus,
  959. fCurrency: "RMB",
  960. fTaxrate: 3,
  961. fAmount: this.form.driverbonus,
  962. fExrate: 1,
  963. remarks: null,
  964. });
  965. }
  966. }
  967. if (this.form.costOth > 0) {
  968. this.fFeeid54 = true;
  969. this.chiFeesList.map((e) => {
  970. if (e.fFeeid == 54 && e.actId == 1080) {
  971. this.fFeeid54 = false;
  972. }
  973. });
  974. if (this.fFeeid54) {
  975. this.chiFeesList.push({
  976. actId: "1080",
  977. fCorpid: this.form.driverUserId,
  978. fFeeid: 54,
  979. fDc: "C",
  980. fFeeunitid: "6",
  981. fBillingQty: 1,
  982. fUnitprice: this.form.costOth,
  983. fCurrency: "RMB",
  984. fTaxrate: 3,
  985. fAmount: this.form.costOth,
  986. fExrate: 1,
  987. remarks: null,
  988. });
  989. }
  990. }
  991. if (this.form.costomAmt03 > 0) {
  992. this.fFeeid55 = true;
  993. this.chiFeesList.map((e) => {
  994. if (e.fFeeid == 55 && e.actId == 1080) {
  995. this.fFeeid55 = false;
  996. }
  997. });
  998. if (this.fFeeid55) {
  999. this.chiFeesList.push(
  1000. {
  1001. actId: "1080",
  1002. fCorpid: this.form.fCorpId,
  1003. fFeeid: 55,
  1004. fDc: "D",
  1005. fFeeunitid: "6",
  1006. fBillingQty: 1,
  1007. fUnitprice: this.form.costomAmt03,
  1008. fCurrency: "RMB",
  1009. fTaxrate: 3,
  1010. fAmount: this.form.costomAmt03,
  1011. fExrate: 1,
  1012. remarks: null,
  1013. },
  1014. {
  1015. actId: "1080",
  1016. fCorpid: this.form.driverUserId,
  1017. fFeeid: 55,
  1018. fDc: "C",
  1019. fFeeunitid: "6",
  1020. fBillingQty: 1,
  1021. fUnitprice: this.form.costomAmt03,
  1022. fCurrency: "RMB",
  1023. fTaxrate: 3,
  1024. fAmount: this.form.costomAmt03,
  1025. fExrate: 1,
  1026. remarks: null,
  1027. }
  1028. );
  1029. }
  1030. }
  1031. if (this.form.costomAmt04 > 0) {
  1032. this.fFeeid56 = true;
  1033. this.chiFeesList.map((e) => {
  1034. if (e.fFeeid == 56 && e.actId == 1080) {
  1035. this.fFeeid56 = false;
  1036. }
  1037. });
  1038. if (this.fFeeid56) {
  1039. this.chiFeesList.push(
  1040. {
  1041. actId: "1080",
  1042. fCorpid: this.form.fCorpId,
  1043. fFeeid: 56,
  1044. fDc: "D",
  1045. fFeeunitid: "6",
  1046. fBillingQty: 1,
  1047. fUnitprice: this.form.costomAmt04,
  1048. fCurrency: "RMB",
  1049. fTaxrate: 3,
  1050. fAmount: this.form.costomAmt04,
  1051. fExrate: 1,
  1052. remarks: null,
  1053. },
  1054. {
  1055. actId: "1080",
  1056. fCorpid: this.form.driverUserId,
  1057. fFeeid: 56,
  1058. fDc: "C",
  1059. fFeeunitid: "6",
  1060. fBillingQty: 1,
  1061. fUnitprice: this.form.costomAmt04,
  1062. fCurrency: "RMB",
  1063. fTaxrate: 3,
  1064. fAmount: this.form.costomAmt04,
  1065. fExrate: 1,
  1066. remarks: null,
  1067. }
  1068. );
  1069. }
  1070. }
  1071. if (this.form.costomAmt02 > 0) {
  1072. this.chiFeesList.map((e) => {
  1073. this.fFeeid57 = true;
  1074. if (e.fFeeid == 57 && e.actId == 1080) {
  1075. this.fFeeid57 = false;
  1076. }
  1077. });
  1078. if (this.fFeeid57) {
  1079. this.chiFeesList.push(
  1080. {
  1081. actId: "1080",
  1082. fCorpid: this.form.fCorpId,
  1083. fFeeid: 57,
  1084. fDc: "D",
  1085. fFeeunitid: "6",
  1086. fBillingQty: 1,
  1087. fUnitprice: this.form.costomAmt02,
  1088. fCurrency: "RMB",
  1089. fTaxrate: 3,
  1090. fAmount: this.form.costomAmt02,
  1091. fExrate: 1,
  1092. remarks: null,
  1093. },
  1094. {
  1095. actId: "1080",
  1096. fCorpid: this.form.driverUserId,
  1097. fFeeid: 57,
  1098. fDc: "C",
  1099. fFeeunitid: "6",
  1100. fBillingQty: 1,
  1101. fUnitprice: this.form.costomAmt02,
  1102. fCurrency: "RMB",
  1103. fTaxrate: 3,
  1104. fAmount: this.form.costomAmt02,
  1105. fExrate: 1,
  1106. remarks: null,
  1107. }
  1108. );
  1109. }
  1110. }
  1111. if (this.form.costomAmt05 > 0) {
  1112. this.fFeeid58 = true;
  1113. this.chiFeesList.map((e) => {
  1114. if (e.fFeeid == 58 && e.actId == 1080) {
  1115. this.fFeeid58 = false;
  1116. }
  1117. });
  1118. if (this.fFeeid58) {
  1119. this.chiFeesList.push(
  1120. {
  1121. actId: "1080",
  1122. fCorpid: this.form.fCorpId,
  1123. fFeeid: 58,
  1124. fDc: "D",
  1125. fFeeunitid: "6",
  1126. fBillingQty: 1,
  1127. fUnitprice: this.form.costomAmt05,
  1128. fCurrency: "RMB",
  1129. fTaxrate: 3,
  1130. fAmount: this.form.costomAmt05,
  1131. fExrate: 1,
  1132. remarks: null,
  1133. },
  1134. {
  1135. actId: "1080",
  1136. fCorpid: this.form.driverUserId,
  1137. fFeeid: 58,
  1138. fDc: "C",
  1139. fFeeunitid: "6",
  1140. fBillingQty: 1,
  1141. fUnitprice: this.form.costomAmt05,
  1142. fCurrency: "RMB",
  1143. fTaxrate: 3,
  1144. fAmount: this.form.costomAmt05,
  1145. fExrate: 1,
  1146. remarks: null,
  1147. }
  1148. );
  1149. }
  1150. }
  1151. if (this.form.costomAmt06 > 0) {
  1152. this.fFeeid59 = true;
  1153. this.chiFeesList.map((e) => {
  1154. if (e.fFeeid == 59 && e.actId == 1080) {
  1155. this.fFeeid59 = false;
  1156. }
  1157. });
  1158. if (this.fFeeid59) {
  1159. this.chiFeesList.push(
  1160. {
  1161. actId: "1080",
  1162. fCorpid: this.form.fCorpId,
  1163. fFeeid: 59,
  1164. fDc: "D",
  1165. fFeeunitid: "6",
  1166. fBillingQty: 1,
  1167. fUnitprice: this.form.costomAmt06,
  1168. fCurrency: "RMB",
  1169. fTaxrate: 3,
  1170. fAmount: this.form.costomAmt06,
  1171. fExrate: 1,
  1172. remarks: null,
  1173. },
  1174. {
  1175. actId: "1080",
  1176. fCorpid: this.form.driverUserId,
  1177. fFeeid: 59,
  1178. fDc: "C",
  1179. fFeeunitid: "6",
  1180. fBillingQty: 1,
  1181. fUnitprice: this.form.costomAmt06,
  1182. fCurrency: "RMB",
  1183. fTaxrate: 3,
  1184. fAmount: this.form.costomAmt06,
  1185. fExrate: 1,
  1186. remarks: null,
  1187. }
  1188. );
  1189. }
  1190. }
  1191. if (this.form.costomAmt01 > 0) {
  1192. this.fFeeid60 = true;
  1193. this.chiFeesList.map((e) => {
  1194. if (e.fFeeid == 60 && e.actId == 1080) {
  1195. this.fFeeid60 = false;
  1196. }
  1197. });
  1198. if (this.fFeeid60) {
  1199. this.chiFeesList.push(
  1200. {
  1201. actId: "1080",
  1202. fCorpid: this.form.fCorpId,
  1203. fFeeid: 60,
  1204. fDc: "D",
  1205. fFeeunitid: "6",
  1206. fBillingQty: 1,
  1207. fUnitprice: this.form.costomAmt01,
  1208. fCurrency: "RMB",
  1209. fTaxrate: 3,
  1210. fAmount: this.form.costomAmt01,
  1211. fExrate: 1,
  1212. remarks: null,
  1213. },
  1214. {
  1215. actId: "1080",
  1216. fCorpid: this.form.driverUserId,
  1217. fFeeid: 60,
  1218. fDc: "C",
  1219. fFeeunitid: "6",
  1220. fBillingQty: 1,
  1221. fUnitprice: this.form.costomAmt01,
  1222. fCurrency: "RMB",
  1223. fTaxrate: 3,
  1224. fAmount: this.form.costomAmt01,
  1225. fExrate: 1,
  1226. remarks: null,
  1227. }
  1228. );
  1229. }
  1230. }
  1231. if (this.form.freightPriceCr > 0 || this.form.freightPriceDr > 0) {
  1232. this.fFeeid61 = true;
  1233. this.chiFeesList.map((e) => {
  1234. if (e.fFeeid == 61 && e.actId == 1080) {
  1235. this.fFeeid61 = false;
  1236. }
  1237. });
  1238. if (this.fFeeid61 && this.form.freightPriceDr > 0) {
  1239. this.chiFeesList.push({
  1240. actId: "1080",
  1241. fCorpid: this.form.fCorpId,
  1242. fFeeid: 61,
  1243. fDc: "D",
  1244. fFeeunitid: "6",
  1245. fBillingQty: 1,
  1246. fUnitprice: this.form.freightPriceDr,
  1247. fCurrency: "RMB",
  1248. fTaxrate: 3,
  1249. fAmount: this.form.freightPriceDr,
  1250. fExrate: 1,
  1251. remarks: null,
  1252. });
  1253. }
  1254. if (this.fFeeid61 && this.form.freightPriceCr > 0) {
  1255. this.chiFeesList.push({
  1256. actId: "1080",
  1257. fCorpid: this.form.carcorPid,
  1258. fFeeid: 61,
  1259. fDc: "C",
  1260. fFeeunitid: "6",
  1261. fBillingQty: 1,
  1262. fUnitprice: this.form.freightPriceCr,
  1263. fCurrency: "RMB",
  1264. fTaxrate: 3,
  1265. fAmount: this.form.freightPriceCr,
  1266. fExrate: 1,
  1267. remarks: null,
  1268. });
  1269. }
  1270. } else {
  1271. this.$message.error("未找到运输费用,请确认是否已添加");
  1272. }
  1273. },
  1274. // 弹出框关闭后触发
  1275. handleClose() {
  1276. // 子组件调用父组件方法,并传递参数
  1277. this.$emit("changeShow", "false");
  1278. this.cntrIdList.forEach((item) => (item.noOption = false));
  1279. this.collapses = [];
  1280. },
  1281. /** 提交按钮 */
  1282. submitForm(butType) {
  1283. this.$refs["form"].validate((valid) => {
  1284. if (valid) {
  1285. if (this.form.costOth > 0 && !this.form.costRemarks) {
  1286. return this.$message.error("请输入花销备注");
  1287. }
  1288. if (this.form.costomAmt02 > 0 && !this.form.costomStr02) {
  1289. return this.$message.error("请输入费用备注");
  1290. }
  1291. if (this.form.costomAmt01 > 0 && !this.form.costomStr01) {
  1292. return this.$message.error("请输入费用备注");
  1293. }
  1294. this.DList.map((e) => {
  1295. return (e.fDc = "D");
  1296. });
  1297. this.CList.map((e) => {
  1298. return (e.fDc = "C");
  1299. });
  1300. let formData = new window.FormData();
  1301. formData.append("cars", JSON.stringify(this.form));
  1302. formData.append("attachs", JSON.stringify(this.relevantAttachments));
  1303. formData.append("operationType", butType);
  1304. insertDriverFtmsorderbillscars(formData).then((response) => {
  1305. if (response.code == 200) {
  1306. this.$set(this.form, "orderStatus", response.data.orderStatus);
  1307. this.msgSuccess("提交成功");
  1308. this.$parent.getList();
  1309. }
  1310. });
  1311. }
  1312. });
  1313. },
  1314. //修改
  1315. submitFix() {
  1316. this.$refs["form"].validate((valid) => {
  1317. if (valid) {
  1318. }
  1319. });
  1320. },
  1321. //保存
  1322. submitSave() {
  1323. let formData = new window.FormData();
  1324. formData.append("cars", JSON.stringify(this.form));
  1325. formData.append("attachs", JSON.stringify(this.relevantAttachments));
  1326. formData.append("fees", JSON.stringify(this.chiFeesList));
  1327. formData.append("operationType", "unLoadDate");
  1328. driverSaveFtmsorderbillscars(formData).then((response) => {
  1329. if (response.code == 200) {
  1330. this.msgSuccess("保存成功");
  1331. this.$parent.getList();
  1332. // this.$parent.getSave(response);
  1333. }
  1334. });
  1335. },
  1336. //撤回
  1337. submitRetreat() {
  1338. },
  1339. //修改
  1340. submitAllowChanges() {
  1341. console.log(this.form.orderStatus)
  1342. if (this.form.orderStatus < 80) {
  1343. this.$emit("fixDisabled", "false");
  1344. this.msgSuccess("允许修改");
  1345. } else {
  1346. this.msgSuccess("不允许修改");
  1347. }
  1348. },
  1349. driversubmitForm() {
  1350. if (this.chiFeesList.length == 0) {
  1351. return this.$message.error("确认费用不能为空");
  1352. }
  1353. if (this.form.orderStatus < 60) {
  1354. return this.$message.error("该运单未回单,请先回单");
  1355. }
  1356. let formData = new window.FormData();
  1357. formData.append("cars", JSON.stringify(this.form));
  1358. formData.append("attachs", JSON.stringify(this.relevantAttachments));
  1359. formData.append("fees", JSON.stringify(this.chiFeesList));
  1360. driverSubmit(formData).then((response) => {
  1361. if (response.code == 200) {
  1362. this.msgSuccess("提交成功");
  1363. this.showDialog = false;
  1364. this.$parent.getList();
  1365. }
  1366. });
  1367. },
  1368. addFees(row) {
  1369. if (row.fBillstatus == 1) {
  1370. row.fBillstatus = 6;
  1371. }
  1372. if (row.fBillstatus == 6) {
  1373. return this.$message.error("已提交,请勿重复提交");
  1374. }
  1375. let formDatae = new window.FormData();
  1376. formDatae.append("status", 6);
  1377. formDatae.append("cars", JSON.stringify(this.form));
  1378. formDatae.append("ftmsorderbillsfees", JSON.stringify(row));
  1379. submit(formDatae).then((response) => {
  1380. if (response.code == 200) {
  1381. this.$message.success("提交成功");
  1382. this.$set(row, "fId", response.data.ftmsorderbillsfeesList.fId);
  1383. this.$set(
  1384. row,
  1385. "fBillstatus",
  1386. response.data.ftmsorderbillsfeesList.fBillstatus
  1387. );
  1388. }
  1389. });
  1390. },
  1391. fixFees(row) {
  1392. if (row.fBillstatus == 0) {
  1393. return this.$message.error("已进行变更,请勿重复点击");
  1394. }
  1395. if (row.fId) {
  1396. changeFees(row.fId).then((response) => {
  1397. if (response.code == 200) {
  1398. this.$message.success("允许修改");
  1399. this.$set(row, "fBillstatus", 1);
  1400. }
  1401. });
  1402. }
  1403. },
  1404. delFees(index, rows, row) {
  1405. if (row.fBillstatus == 2 || row.fBillstatus == 3) {
  1406. deleteFees(row.fId).then((response) => {
  1407. if (response.code == 200) {
  1408. rows.splice(index, 1);
  1409. this.$message.success("删除成功");
  1410. }
  1411. });
  1412. } else if (!row.fBillstatus) {
  1413. rows.splice(index, 1);
  1414. this.$message.success("删除成功");
  1415. } else {
  1416. this.$message.error("不允许删除");
  1417. }
  1418. },
  1419. revokeFees(row) {
  1420. revokeFees(row.fId).then((response) => {
  1421. if (response.code == 200) {
  1422. this.$message.success("撤销成功");
  1423. this.$set(row, "fBillstatus", 3);
  1424. }
  1425. });
  1426. },
  1427. //单条订单调度提交
  1428. addscarsRow(row) {
  1429. },
  1430. delscarsRow(index, rows, row) {
  1431. if (row.billStatus != 6 && row.id != null) {
  1432. removeFtmsorderbillscars(row).then((response) => {
  1433. if (response.code == 200) {
  1434. rows.splice(index, 1);
  1435. this.msgSuccess("成功删除");
  1436. }
  1437. });
  1438. } else {
  1439. rows.splice(index, 1);
  1440. }
  1441. },
  1442. revokescarsRow(index, rows, row) {
  1443. },
  1444. changescarsRow(row) {
  1445. },
  1446. total(row) {
  1447. console.log(row);
  1448. if (row.fQty && row.fUnitprice) {
  1449. this.$set(row, "fAmount", (row.fQty * row.fUnitprice).toFixed(2));
  1450. } else {
  1451. this.$set(row, "fAmount", 0);
  1452. }
  1453. },
  1454. },
  1455. watch: {
  1456. // 监听 addOrUpdateVisible 改变
  1457. addOrUpdateVisible(oldVal, newVal) {
  1458. this.showDialog = this.addOrUpdateVisible;
  1459. },
  1460. feesList(newVal, oldVal) {
  1461. console.log(newVal)
  1462. this.chiFeesList = newVal;
  1463. },
  1464. },
  1465. computed: {
  1466. sortchiFeesList() {
  1467. return sortByKey(this.chiFeesList, "fDc");
  1468. },
  1469. },
  1470. };
  1471. function sortByKey(array, key) {
  1472. return array.sort(function (a, b) {
  1473. var x = a[key];
  1474. var y = b[key];
  1475. return x > y ? -1 : x < y ? 1 : 0;
  1476. });
  1477. }
  1478. </script>