AddOrUpdate.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013
  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" :rules="rules" label-width="90px">
  11. <el-row>
  12. <el-col :span="6">
  13. <el-form-item label="客户名称" prop="fCorpId">
  14. <el-select
  15. v-model="form.fCorpId"
  16. placeholder="请输入客户名称"
  17. :clearable="true"
  18. filterable
  19. size="mini"
  20. style="width: 180px"
  21. :disabled="true"
  22. >
  23. <el-option
  24. v-for="(dict, index) in fMblnoOptions"
  25. :key="index.fId"
  26. :label="dict.fName"
  27. :value="dict.fId"
  28. />
  29. </el-select>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="6">
  33. <el-form-item label="业务类型" prop="billType">
  34. <el-select
  35. v-model="form.billType"
  36. placeholder="请选择业务类型"
  37. :disabled="true"
  38. size="mini"
  39. style="width: 180px"
  40. >
  41. <el-option
  42. v-for="(dict, index) in billTypeList"
  43. :key="index.dictSort"
  44. :label="dict.dictLabel"
  45. :value="dict.dictSort"
  46. />
  47. </el-select>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="6">
  51. <el-form-item label="运输方式" prop="transType">
  52. <el-select
  53. v-model="form.transType"
  54. placeholder="请选择运输方式"
  55. :disabled="true"
  56. size="mini"
  57. style="width: 180px"
  58. >
  59. <el-option
  60. v-for="(dict, index) in transTypeList"
  61. :key="index.dictValue"
  62. :label="dict.dictLabel"
  63. :value="dict.dictValue"
  64. />
  65. </el-select>
  66. </el-form-item>
  67. </el-col>
  68. <el-col :span="6">
  69. <el-form-item label="运输性质" prop="transProp">
  70. <el-select
  71. v-model="form.transProp"
  72. placeholder="请选择运输方式"
  73. :disabled="true"
  74. size="mini"
  75. style="width: 180px"
  76. >
  77. <el-option
  78. v-for="(dict, index) in transPropList"
  79. :key="index.dictValue"
  80. :label="dict.dictLabel"
  81. :value="dict.dictValue"
  82. />
  83. </el-select>
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <el-row>
  88. <el-col :span="6">
  89. <el-form-item label="提箱地点" prop="tLoadAddr">
  90. <el-input
  91. v-model="form.tLoadAddr"
  92. placeholder="请输入提箱地点"
  93. :disabled="true"
  94. size="mini"
  95. style="width: 180px"
  96. />
  97. </el-form-item>
  98. </el-col>
  99. <el-col :span="6">
  100. <el-form-item label="提箱时间" prop="loadDate">
  101. <el-date-picker
  102. clearable
  103. size="mini"
  104. style="width: 180px"
  105. v-model="form.loadDate"
  106. type="date"
  107. :disabled="true"
  108. value-format="yyyy-MM-dd"
  109. placeholder="选择卸箱时间"
  110. >
  111. </el-date-picker>
  112. </el-form-item>
  113. </el-col>
  114. <el-col :span="6">
  115. <el-form-item label="装货地点" prop="mdLoadAddr">
  116. <el-input
  117. v-model="form.tMdLoadAddr"
  118. placeholder="装货地点"
  119. :disabled="true"
  120. size="mini"
  121. style="width: 180px"
  122. />
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="6">
  126. <el-form-item label="装货时间" prop="mdLoadDate">
  127. <el-date-picker
  128. clearable
  129. size="mini"
  130. style="width: 180px"
  131. v-model="form.mdLoadDate"
  132. type="date"
  133. :disabled="true"
  134. value-format="yyyy-MM-dd"
  135. placeholder="选择装货时间"
  136. >
  137. </el-date-picker>
  138. </el-form-item>
  139. </el-col>
  140. <el-col :span="6">
  141. <el-form-item label="卸箱地点" prop="unLoadAddr">
  142. <el-input
  143. v-model="form.unLoadAddr"
  144. placeholder="请输入装卸箱地点"
  145. :disabled="true"
  146. size="mini"
  147. style="width: 180px"
  148. />
  149. </el-form-item>
  150. </el-col>
  151. <el-col :span="6">
  152. <el-form-item label="卸箱时间" prop="unLoadDate">
  153. <el-date-picker
  154. clearable
  155. size="mini"
  156. style="width: 180px"
  157. v-model="form.unLoadDate"
  158. type="date"
  159. :disabled="true"
  160. value-format="yyyy-MM-dd"
  161. placeholder="选择卸箱时间"
  162. >
  163. </el-date-picker>
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="6">
  167. <el-form-item label="接单时间" prop="acceptDate">
  168. <el-date-picker
  169. clearable
  170. size="mini"
  171. style="width: 180px"
  172. v-model="form.acceptDate"
  173. type="date"
  174. value-format="yyyy-MM-dd"
  175. placeholder="选择接单时间"
  176. :disabled="true"
  177. >
  178. </el-date-picker>
  179. </el-form-item>
  180. </el-col>
  181. <el-col :span="6">
  182. <el-form-item label="回单时间" prop="waybillDate">
  183. <el-date-picker
  184. clearable
  185. size="mini"
  186. style="width: 180px"
  187. v-model="form.waybillDate"
  188. type="date"
  189. value-format="yyyy-MM-dd"
  190. placeholder="选择回单时间"
  191. :disabled="true"
  192. >
  193. </el-date-picker>
  194. </el-form-item>
  195. </el-col>
  196. </el-row>
  197. <el-row>
  198. <el-col :span="6">
  199. <el-form-item label="提单号" prop="mblno">
  200. <el-input
  201. v-model="form.mblno"
  202. placeholder="请输入提单号"
  203. :disabled="true"
  204. size="mini"
  205. style="width: 180px"
  206. />
  207. </el-form-item>
  208. </el-col>
  209. <el-col :span="6">
  210. <el-form-item label="货品名称" prop="goodsId">
  211. <el-select
  212. v-model="form.goodsId"
  213. placeholder="请输入货品名称"
  214. :disabled="true"
  215. clearable
  216. filterable
  217. size="mini"
  218. style="width: 180px"
  219. >
  220. <el-option
  221. v-for="(dict, index) in goodsOptions"
  222. :key="index.fId"
  223. :label="dict.fName"
  224. :value="dict.fId"
  225. />
  226. </el-select>
  227. </el-form-item>
  228. </el-col>
  229. <el-col :span="6">
  230. <el-form-item label="计划件数" prop="qtyPlan">
  231. <el-input
  232. v-model="form.qtyPlan"
  233. placeholder="请输入计划件数"
  234. :disabled="true"
  235. v-input-limit="2"
  236. size="mini"
  237. style="width: 180px"
  238. />
  239. </el-form-item>
  240. </el-col>
  241. <el-col :span="6">
  242. <el-form-item label="重量(吨)" prop="weightPlan">
  243. <el-input
  244. v-model="form.weightPlan"
  245. placeholder="请输入计划重量"
  246. :disabled="true"
  247. v-input-limit="2"
  248. size="mini"
  249. style="width: 180px"
  250. />
  251. </el-form-item>
  252. </el-col>
  253. </el-row>
  254. <el-row>
  255. <el-col :span="6">
  256. <el-form-item label="船名" prop="ysl">
  257. <el-input
  258. v-model="form.ysl"
  259. placeholder="请输入船名"
  260. :disabled="true"
  261. size="mini"
  262. style="width: 180px"
  263. />
  264. </el-form-item>
  265. </el-col>
  266. <el-col :span="6">
  267. <el-form-item label="航次" prop="voy">
  268. <el-input
  269. v-model="form.voy"
  270. placeholder="请输入航次"
  271. :disabled="true"
  272. size="mini"
  273. style="width: 180px"
  274. />
  275. </el-form-item>
  276. </el-col>
  277. <el-col :span="6">
  278. <el-form-item label="起运港" prop="polId">
  279. <el-input
  280. v-model="form.polId"
  281. placeholder="请输入起运港"
  282. :disabled="true"
  283. size="mini"
  284. style="width: 180px"
  285. />
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="6">
  289. <el-form-item label="目的港" prop="podId">
  290. <el-input
  291. v-model="form.podId"
  292. placeholder="请输入目的港"
  293. :disabled="true"
  294. size="mini"
  295. style="width: 180px"
  296. />
  297. </el-form-item>
  298. </el-col>
  299. </el-row>
  300. <el-row>
  301. <el-col :span="6">
  302. <el-form-item label="油气费" prop="oilAmt">
  303. <el-input
  304. v-model="form.oilAmt"
  305. placeholder="请输入油气费"
  306. size="mini"
  307. style="width: 180px"
  308. v-input-limit="2"
  309. disabled
  310. />
  311. </el-form-item>
  312. </el-col>
  313. <el-col :span="6">
  314. <el-form-item label="单趟提成" prop="driverbonus">
  315. <el-input
  316. v-model="form.driverbonus"
  317. placeholder="请输入单趟提成"
  318. size="mini"
  319. style="width: 180px"
  320. v-input-limit="2"
  321. disabled
  322. />
  323. </el-form-item>
  324. </el-col>
  325. <el-col :span="6">
  326. <el-form-item label="其他费用" prop="costOth">
  327. <el-input
  328. v-model="form.costOth"
  329. placeholder="请输入其他费用"
  330. size="mini"
  331. style="width: 180px"
  332. v-input-limit="2"
  333. disabled
  334. />
  335. </el-form-item>
  336. </el-col>
  337. <el-col :span="6">
  338. <el-form-item label="备注" prop="costRemarks">
  339. <el-input
  340. v-model="form.costRemarks"
  341. placeholder="请输入备注"
  342. size="mini"
  343. style="width: 180px"
  344. disabled
  345. />
  346. </el-form-item>
  347. </el-col>
  348. </el-row>
  349. <el-row v-if="form.billType == 1">
  350. <el-col :span="6">
  351. <el-form-item label="修洗费" prop="costomAmt03">
  352. <el-input
  353. v-model="form.costomAmt03"
  354. placeholder="请输入修洗费"
  355. size="mini"
  356. style="width: 180px"
  357. v-input-limit="2"
  358. disabled
  359. />
  360. </el-form-item>
  361. </el-col>
  362. <el-col :span="6">
  363. <el-form-item label="吊装费" prop="costomAmt04">
  364. <el-input
  365. v-model="form.costomAmt04"
  366. placeholder="请输入吊装费"
  367. size="mini"
  368. style="width: 180px"
  369. v-input-limit="2"
  370. disabled
  371. />
  372. </el-form-item>
  373. </el-col>
  374. <el-col :span="6">
  375. <el-form-item label="其他费用" prop="costomAmt02">
  376. <el-input
  377. v-model="form.costomAmt02"
  378. placeholder="请输入其他费用"
  379. size="mini"
  380. style="width: 180px"
  381. v-input-limit="2"
  382. disabled
  383. />
  384. </el-form-item>
  385. </el-col>
  386. <el-col :span="6">
  387. <el-form-item label="费用备注" prop="costomStr02">
  388. <el-input
  389. v-model="form.costomStr02"
  390. placeholder="请输入备注"
  391. size="mini"
  392. style="width: 180px"
  393. disabled
  394. />
  395. </el-form-item>
  396. </el-col>
  397. </el-row>
  398. <el-row v-if="form.billType == 2">
  399. <el-col :span="6">
  400. <el-form-item label="港杂费" prop="costomAmt05">
  401. <el-input
  402. v-model="form.costomAmt05"
  403. placeholder="请输入港杂费"
  404. size="mini"
  405. style="width: 180px"
  406. v-input-limit="2"
  407. disabled
  408. />
  409. </el-form-item>
  410. </el-col>
  411. <el-col :span="6">
  412. <el-form-item label="提箱费" prop="costomAmt06">
  413. <el-input
  414. v-model="form.costomAmt06"
  415. placeholder="请输入提箱费"
  416. size="mini"
  417. style="width: 180px"
  418. v-input-limit="2"
  419. disabled
  420. />
  421. </el-form-item>
  422. </el-col>
  423. <el-col :span="6">
  424. <el-form-item label="其他费用" prop="costomAmt01">
  425. <el-input
  426. v-model="form.costomAmt01"
  427. placeholder="请输入其他费用"
  428. size="mini"
  429. style="width: 180px"
  430. v-input-limit="2"
  431. disabled
  432. />
  433. </el-form-item>
  434. </el-col>
  435. <el-col :span="6">
  436. <el-form-item label="费用备注" prop="costomStr01">
  437. <el-input
  438. v-model="form.costomStr01"
  439. placeholder="请输入备注"
  440. size="mini"
  441. style="width: 180px"
  442. disabled
  443. />
  444. </el-form-item>
  445. </el-col>
  446. </el-row>
  447. </el-form>
  448. <template slot="title">
  449. <i class="header-icon el-icon-circle-plus" style="font-size: 16px"
  450. ><span style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  451. >添加费用明细</span
  452. >
  453. </i>
  454. </template>
  455. <div>
  456. <div
  457. style="display: flex; justify-content: space-between; margin: 10px 0"
  458. >
  459. <div>
  460. <el-button
  461. type="primary"
  462. icon="el-icon-plus"
  463. size="mini"
  464. @click="addRelevt"
  465. :disabled="disabled"
  466. >添加费用</el-button
  467. >
  468. <el-button
  469. type="primary"
  470. icon="el-icon-plus"
  471. size="mini"
  472. @click="addRelevt2"
  473. :disabled="disabled"
  474. >导入费用</el-button
  475. >
  476. </div>
  477. </div>
  478. </div>
  479. <el-table :data="feesList" style="width: 100%">
  480. <el-table-column
  481. prop="fCorpid"
  482. label="结算单位"
  483. align="center"
  484. width="180"
  485. >
  486. <template slot-scope="scope">
  487. <el-select
  488. v-model="scope.row.fCorpid"
  489. placeholder="请输入客户名称"
  490. :clearable="true"
  491. filterable
  492. size="mini"
  493. style="width: 160px"
  494. :disabled="scope.row.actId != 1090 || disabled"
  495. >
  496. <el-option
  497. v-for="(dict, index) in fMblnoOptions"
  498. :key="index.fId"
  499. :label="dict.fName"
  500. :value="dict.fId"
  501. />
  502. </el-select>
  503. </template>
  504. </el-table-column>
  505. <el-table-column prop="fFeeid" label="费用名称" align="center" width="120">
  506. <template slot-scope="scope">
  507. <el-select
  508. v-model="scope.row.fFeeid"
  509. filterable
  510. :disabled="scope.row.actId != 1090 || disabled"
  511. remote
  512. placeholder="费用名称"
  513. >
  514. <el-option
  515. v-for="(dict, index) in fCNameOptions"
  516. :key="index.fId"
  517. :label="dict.fName"
  518. :value="dict.fId"
  519. ></el-option>
  520. </el-select>
  521. </template>
  522. </el-table-column>
  523. <el-table-column prop="fDc" label="收付" align="center" width="100">
  524. <template slot-scope="scope">
  525. <el-select
  526. v-model="scope.row.fDc"
  527. placeholder="请选择"
  528. :disabled="scope.row.actId != 1090 || disabled"
  529. >
  530. <el-option label="收" value="D"></el-option>
  531. <el-option label="付" value="C"></el-option>
  532. </el-select>
  533. </template>
  534. </el-table-column>
  535. <el-table-column prop="fFeeunitid" label="计费单位" align="center" width="100">
  536. <template slot-scope="scope">
  537. <el-select
  538. v-model="scope.row.fFeeunitid"
  539. placeholder="请选择计费单位"
  540. :disabled="scope.row.actId != 1090 || disabled"
  541. clearable
  542. >
  543. <el-option
  544. v-for="dict in jFeetunitOptions"
  545. :key="dict.dictValue"
  546. :label="dict.dictLabel"
  547. :value="dict.dictValue"
  548. />
  549. </el-select>
  550. </template>
  551. </el-table-column>
  552. <el-table-column prop="fBillingQty" label="计费数量" align="center" width="100">
  553. <template slot-scope="scope">
  554. <el-input
  555. v-model="scope.row.fBillingQty"
  556. :disabled="scope.row.actId != 1090 || disabled"
  557. placeholder="请输入内容"
  558. @input="total(scope.row)"
  559. v-input-limit="2"
  560. ></el-input>
  561. </template>
  562. </el-table-column>
  563. <el-table-column prop="fUnitprice" label="单价" align="center" width="100">
  564. <template slot-scope="scope">
  565. <el-input
  566. v-model="scope.row.fUnitprice"
  567. :disabled="scope.row.actId != 1090 || disabled"
  568. placeholder="请输入内容"
  569. @input="total(scope.row)"
  570. v-input-limit="2"
  571. ></el-input>
  572. </template>
  573. </el-table-column>
  574. <el-table-column prop="fCurrency" label="币种" align="center" width="100">
  575. <template slot-scope="scope">
  576. <el-input
  577. v-model="scope.row.fCurrency"
  578. :disabled="scope.row.actId != 1090 || disabled"
  579. placeholder="请输入内容"
  580. ></el-input>
  581. </template>
  582. </el-table-column>
  583. <el-table-column prop="fExrate" label="汇率" align="center" width="100">
  584. <template slot-scope="scope">
  585. <el-input
  586. v-model="scope.row.fExrate"
  587. :disabled="scope.row.actId != 1090 || disabled"
  588. placeholder="请输入内容"
  589. ></el-input>
  590. </template>
  591. </el-table-column>
  592. <el-table-column prop="fAmount" label="金额" align="center" width="100">
  593. <template slot-scope="scope">
  594. <el-input
  595. v-model="scope.row.fAmount"
  596. :disabled="scope.row.actId != 1090 || disabled"
  597. placeholder="请输入内容"
  598. ></el-input>
  599. </template>
  600. </el-table-column>
  601. <el-table-column prop="fTaxrate" label="税率" align="center" width="100">
  602. <template slot-scope="scope">
  603. <el-input
  604. v-model="scope.row.fTaxrate"
  605. :disabled="scope.row.actId != 1090 || disabled"
  606. placeholder="请输入内容"
  607. ></el-input>
  608. </template>
  609. </el-table-column>
  610. <el-table-column prop="remarks" label="备注" align="center" width="180">
  611. <template slot-scope="scope">
  612. <el-input
  613. v-model="scope.row.remarks"
  614. :disabled="scope.row.actId != 1090 || disabled"
  615. placeholder="请输入内容"
  616. ></el-input>
  617. </template>
  618. </el-table-column>
  619. <el-table-column prop="remarks" label="费用来源" align="center">
  620. <template slot-scope="scope">
  621. <span v-if="scope.row.actId == 1030">接单</span>
  622. <span v-if="scope.row.actId == 1040">提箱</span>
  623. <span v-if="scope.row.actId == 1050">装卸柜</span>
  624. <span v-if="scope.row.actId == 1060">还卸柜</span>
  625. <span v-if="scope.row.actId == 1070">回单</span>
  626. <span v-if="scope.row.actId == 1090">追加费用</span>
  627. </template>
  628. </el-table-column>
  629. <el-table-column
  630. label="操作"
  631. align="center"
  632. class-name="small-padding fixed-width"
  633. fixed="right"
  634. width="100px"
  635. >
  636. <template slot-scope="scope">
  637. <el-button
  638. size="mini"
  639. type="text"
  640. icon="el-icon-delete"
  641. :disabled="scope.row.actId != 1090 || disabled"
  642. @click.native.prevent="deleteRow(scope.$index)"
  643. >删除</el-button
  644. >
  645. </template>
  646. </el-table-column>
  647. </el-table>
  648. </span>
  649. <span slot="footer" class="dialog-footer">
  650. <el-button type="primary" :disabled="disabled" @click="submitForm"
  651. >提 交</el-button
  652. >
  653. <el-button type="success" @click="submitAllowChanges">修 改</el-button>
  654. <el-button type="info" :disabled="disabled" @click="submitSave"
  655. >保 存</el-button
  656. >
  657. <el-button type="warning" :disabled="disabled" @click="submitRetreat"
  658. >撤 回</el-button
  659. >
  660. <el-button @click="showDialog = false">取 消</el-button>
  661. </span>
  662. </el-dialog>
  663. </template>
  664. <script>
  665. import { removeFtmsorderbillscars } from "@/api/fleet/ftmsorderbillscars";
  666. import { query, submit } from "@/api/track/singleCost";
  667. import { listGoods } from "@/api/basicdata/goods";
  668. import { listCorps } from "@/api/basicdata/corps";
  669. import { listFees } from "@/api/basicdata/fees";
  670. import UploadFile from "@/components/Uploadfile";
  671. import Cookies from "js-cookie";
  672. export default {
  673. name: "plans",
  674. props: {
  675. addOrUpdateVisible: {
  676. type: Boolean,
  677. default: false,
  678. },
  679. title: {
  680. type: String,
  681. required: "",
  682. },
  683. fname: Object,
  684. },
  685. components: {
  686. UploadFile,
  687. },
  688. data() {
  689. return {
  690. jFeetunitOptions: [],
  691. form: {},
  692. feesList: [],
  693. // 控制弹出框显示隐藏
  694. showDialog: false,
  695. // 表单校验
  696. rules: {
  697. corpId: [
  698. { required: true, message: "请输入客户名称", trigger: "blur" },
  699. ],
  700. billType: [
  701. { required: true, message: "请选择业务类型", trigger: "blur" },
  702. ],
  703. transType: [
  704. { required: true, message: "请选择运输方式", trigger: "blur" },
  705. ],
  706. loadAddr: [
  707. { required: true, message: "请输入提箱地点", trigger: "blur" },
  708. ],
  709. loadAttntel: [
  710. {
  711. pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/,
  712. message: "请正确输入手机号",
  713. trigger: "blur",
  714. },
  715. ],
  716. mdLoadAttnTel: [
  717. {
  718. pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/,
  719. message: "请正确输入手机号",
  720. trigger: "blur",
  721. },
  722. ],
  723. unLoadAttnTel: [
  724. {
  725. pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/,
  726. message: "请正确输入手机号",
  727. trigger: "blur",
  728. },
  729. ],
  730. },
  731. billTypeList: [],
  732. transTypeList: [],
  733. transPropList: [],
  734. goodsLossTypeList: [],
  735. relevantAttachments: [],
  736. cntrIdList: [],
  737. priceTypeList: [],
  738. userType: null,
  739. username: null,
  740. collapses: [],
  741. fMblnoOptions: [],
  742. cntrId2List: [],
  743. goodsOptions: [],
  744. fWbuOptions: [],
  745. disabled: false,
  746. };
  747. },
  748. created() {
  749. this.getDicts("data_unitfees").then((response) => {
  750. if (response.data) {
  751. this.jFeetunitOptions = response.data;
  752. }
  753. });
  754. listFees().then((response) => {
  755. this.fCNameOptions = response.rows;
  756. });
  757. this.getDicts("data_billType").then((response) => {
  758. this.billTypeList = response.data;
  759. });
  760. this.getDicts("data_transType").then((response) => {
  761. this.transTypeList = response.data;
  762. });
  763. this.getDicts("data_transProp").then((response) => {
  764. this.transPropList = response.data;
  765. });
  766. this.getDicts("data_goodsLossType").then((response) => {
  767. this.goodsLossTypeList = response.data;
  768. });
  769. this.getDicts("data_cntrId").then((response) => {
  770. if (response.data) {
  771. response.data.map((e) => (e.noOption = false));
  772. this.cntrIdList = response.data;
  773. }
  774. });
  775. this.getDicts("data_priceType").then((response) => {
  776. this.priceTypeList = response.data;
  777. });
  778. listCorps().then((response) => {
  779. this.fMblnoOptions = response.rows;
  780. });
  781. listGoods().then((response) => {
  782. this.goodsOptions = response.rows;
  783. });
  784. listFees().then((response) => {
  785. this.fWbuOptions = response.rows;
  786. });
  787. this.userType = Cookies.get("userType");
  788. this.username = Cookies.get("userName");
  789. },
  790. methods: {
  791. deleteRow(index) {
  792. this.feesList.splice(index, 1);
  793. },
  794. init() {
  795. this.showDialog = true;
  796. query(this.fname.id).then((data) => {
  797. this.form = data.data;
  798. this.feesList = data.data.ftmsorderbillsfees;
  799. for (let item in this.feesList) {
  800. this.feesList[item].fFeeunitid = this.feesList[item].fFeeunitid + "";
  801. }
  802. if (this.feesList.length >= 0) {
  803. this.disabled = true;
  804. }
  805. });
  806. },
  807. //选中时赋值pid
  808. checkPid(row) {
  809. let arr = this.schedulingList;
  810. let arr2 = arr.filter((e) => e.cntrId == row.cntrId);
  811. row["pid"] = arr2[0].id;
  812. },
  813. noMorecntrId(e) {
  814. this.cntrIdList.forEach((item) => (item.noOption = false));
  815. let arrIds = e.map((item) => item.cntrId);
  816. this.cntrIdList
  817. .filter((item) => arrIds.indexOf(item.dictValue) > -1)
  818. .forEach((item) => (item.noOption = true));
  819. },
  820. showSure(val) {
  821. let pidList = val.filter((e) => e.pid != null);
  822. let arr1 = pidList;
  823. let arr1Ids = arr1.map((item) => item.cntrId);
  824. arr1Ids = [...new Set(arr1Ids)];
  825. let arr2 = this.cntrIdList;
  826. this.cntrId2List = arr2.filter(
  827. (item) => arr1Ids.indexOf(item.dictValue) > -1
  828. );
  829. },
  830. // 新增附件上传
  831. addRelevt() {
  832. this.feesList.push({
  833. actId: "1090",
  834. fCorpid: this.form.fCorpId,
  835. fFeeid: "",
  836. fDc: "",
  837. fFeeunitid: "1",
  838. fBillingQty: 0,
  839. fUnitprice: 0,
  840. fCurrency: "RMB",
  841. fTaxrate: null,
  842. fAmount: 0,
  843. fExrate: 1,
  844. remarks: "",
  845. });
  846. },
  847. addRelevt2() {
  848. // if(this.feesList.length){
  849. // }
  850. if (this.form.oilAmt > 0) {
  851. this.feesList.push({
  852. actId: "1090",
  853. fCorpid: this.form.fCorpId,
  854. fFeeid: 52,
  855. fDc: "C",
  856. fFeeunitid: "6",
  857. fBillingQty: 1,
  858. fUnitprice: this.form.oilAmt,
  859. fCurrency: "RMB",
  860. fTaxrate: 3,
  861. fAmount: this.form.oilAmt,
  862. fExrate: 1,
  863. remarks: "",
  864. });
  865. }
  866. if (this.form.costomAmt03 > 0) {
  867. this.feesList.push({
  868. actId: "1090",
  869. fCorpid: this.form.fCorpId,
  870. fFeeid: 55,
  871. fDc: "C",
  872. fFeeunitid: "6",
  873. fBillingQty: 1,
  874. fUnitprice: this.form.costomAmt03,
  875. fCurrency: "RMB",
  876. fTaxrate: 3,
  877. fAmount: this.form.costomAmt03,
  878. fExrate: 1,
  879. remarks: "",
  880. });
  881. }
  882. if (this.form.costomAmt05 > 0) {
  883. this.feesList.push({
  884. actId: "1090",
  885. fCorpid: this.form.fCorpId,
  886. fFeeid: 58,
  887. fDc: "C",
  888. fFeeunitid: "6",
  889. fBillingQty: 1,
  890. fUnitprice: this.form.costomAmt05,
  891. fCurrency: "RMB",
  892. fTaxrate: 3,
  893. fAmount: this.form.costomAmt05,
  894. fExrate: 1,
  895. remarks: "",
  896. });
  897. }
  898. },
  899. deleteplansRow(index, rows, row) {
  900. let arr = this.schedulingList;
  901. let arr2 = arr.filter((e) => e.cntrId == row.cntrId && e.cntrId != null);
  902. if (arr2.length != 0) {
  903. this.msgSuccess("调度安排已插入此箱型数据,不能删除");
  904. } else {
  905. this.cntrIdList
  906. .filter((item) => item.dictValue == row.cntrId)
  907. .forEach((item) => (item.noOption = false));
  908. rows.splice(index, 1);
  909. }
  910. },
  911. // 上传成功返回数据
  912. showFile(row) {
  913. for (let list in this.relevantAttachments) {
  914. this.$set(this.relevantAttachments[list], "attachUrl", row.url);
  915. this.$set(this.relevantAttachments[list], "attachName", row.fileName);
  916. }
  917. },
  918. // 弹出框关闭后触发
  919. handleClose() {
  920. // 子组件调用父组件方法,并传递参数
  921. this.$emit("changeShow", "false");
  922. this.cntrIdList.forEach((item) => (item.noOption = false));
  923. this.collapses = [];
  924. },
  925. /** 提交按钮 */
  926. submitForm() {
  927. this.$refs["form"].validate((valid) => {
  928. if (valid) {
  929. let formDatae = new window.FormData();
  930. formDatae.append("status", 6);
  931. formDatae.append("cars", JSON.stringify(this.form));
  932. formDatae.append("ftmsorderbillsfees", JSON.stringify(this.feesList));
  933. submit(formDatae).then((data) => {
  934. this.feesList = data.data.ftmsorderbillsfeesList;
  935. for (let item in this.feesList) {
  936. this.feesList[item].fFeeunitid =
  937. this.feesList[item].fFeeunitid + "";
  938. }
  939. this.$message.success("提交成功");
  940. this.$parent.getList();
  941. this.showDialog = false;
  942. });
  943. }
  944. });
  945. },
  946. //修改
  947. submitFix() {
  948. this.$refs["form"].validate((valid) => {
  949. if (valid) {
  950. }
  951. });
  952. },
  953. //保存
  954. submitSave() {
  955. let formDatae = new window.FormData();
  956. formDatae.append("status", 2);
  957. formDatae.append("cars", JSON.stringify(this.form));
  958. formDatae.append("ftmsorderbillsfees", JSON.stringify(this.feesList));
  959. submit(formDatae).then((data) => {
  960. this.feesList = data.data.ftmsorderbillsfeesList;
  961. for (let item in this.feesList) {
  962. this.feesList[item].fFeeunitid = this.feesList[item].fFeeunitid + "";
  963. }
  964. this.$message.success("保存成功");
  965. });
  966. },
  967. //撤回
  968. submitRetreat() {},
  969. //修改
  970. submitAllowChanges() {
  971. this.disabled = !this.disabled;
  972. },
  973. //单条订单调度提交
  974. addscarsRow(row) {},
  975. delscarsRow(index, rows, row) {
  976. if (row.billStatus != 6 && row.id != null) {
  977. removeFtmsorderbillscars(row).then((response) => {
  978. if (response.code == 200) {
  979. rows.splice(index, 1);
  980. this.msgSuccess("成功删除");
  981. }
  982. });
  983. } else {
  984. rows.splice(index, 1);
  985. }
  986. },
  987. revokescarsRow(index, rows, row) {},
  988. changescarsRow(row) {},
  989. total(row) {
  990. if (row.fBillingQty && row.fUnitprice) {
  991. console.log(row.fBillingQty);
  992. this.$set(
  993. row,
  994. "fAmount",
  995. (row.fBillingQty * row.fUnitprice).toFixed(2)
  996. );
  997. } else {
  998. this.$set(row, "fAmount", 0);
  999. }
  1000. },
  1001. },
  1002. watch: {
  1003. // 监听 addOrUpdateVisible 改变
  1004. addOrUpdateVisible(oldVal, newVal) {
  1005. this.showDialog = this.addOrUpdateVisible;
  1006. },
  1007. },
  1008. };
  1009. </script>