AddOrUpdate.vue 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903
  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="110px">
  11. <el-row>
  12. <el-col :span="6">
  13. <el-form-item label="客户名称" prop="corpId">
  14. <el-select
  15. v-model="form.corpId"
  16. placeholder="请输入客户名称"
  17. :clearable="true"
  18. filterable
  19. :disabled="disabled"
  20. size="mini"
  21. style="width:100%"
  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="disabled"
  38. size="mini"
  39. style="width:100%"
  40. >
  41. <el-option
  42. v-for="(dict, index) in billTypeList"
  43. :key="index.dictValue"
  44. :label="dict.dictLabel"
  45. :value="dict.dictValue"
  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="disabled"
  56. size="mini"
  57. style="width:100%"
  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="mblno">
  70. <el-input
  71. v-model="form.mblno"
  72. placeholder="请输入提单号"
  73. :disabled="disabled"
  74. size="mini"
  75. style="width:100%"
  76. />
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="6">
  80. <el-form-item label="装车地点" prop="loadAddr">
  81. <el-input
  82. v-model="form.loadAddr"
  83. placeholder="请输入装车地点"
  84. :disabled="disabled"
  85. size="mini"
  86. style="width:100%"
  87. />
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="6">
  91. <el-form-item
  92. v-if="form.billType == 1"
  93. label="卸货地点"
  94. prop="mdLoadAddr"
  95. >
  96. <el-input
  97. v-model="form.mdLoadAddr"
  98. placeholder="请输入装卸货地点"
  99. :disabled="disabled"
  100. size="mini"
  101. style="width:100%"
  102. />
  103. </el-form-item>
  104. <el-form-item
  105. v-if="form.billType == 2"
  106. label="装货地点"
  107. prop="mdLoadAddr"
  108. >
  109. <el-input
  110. v-model="form.mdLoadAddr"
  111. placeholder="请输入装货地点"
  112. :disabled="disabled"
  113. size="mini"
  114. style="width:100%"
  115. />
  116. </el-form-item>
  117. </el-col>
  118. <el-col :span="6">
  119. <el-form-item label="卸车地点" prop="unLoadAddr">
  120. <el-input
  121. v-model="form.unLoadAddr"
  122. placeholder="请输入卸车地点"
  123. :disabled="disabled"
  124. size="mini"
  125. style="width:100%"
  126. />
  127. </el-form-item>
  128. </el-col>
  129. <el-col :span="6">
  130. <el-form-item label="装车时间" prop="loadDate">
  131. <el-date-picker
  132. clearable
  133. size="mini"
  134. style="width:100%"
  135. v-model="form.loadDate"
  136. type="datetime"
  137. placeholder="选择计划装车时间"
  138. :disabled="disabled"
  139. >
  140. </el-date-picker>
  141. </el-form-item>
  142. </el-col>
  143. <el-col :span="6" v-if="form.billType == 1 || form.billType == 2">
  144. <el-form-item label="装卸货联系人" prop="mdLoadAttn">
  145. <el-input
  146. v-model="form.mdLoadAttn"
  147. placeholder="请输入装卸货联系人"
  148. :disabled="disabled"
  149. size="mini"
  150. style="width:100%"
  151. />
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="6" v-if="form.billType == 1 || form.billType == 2">
  155. <el-form-item label="装卸货联系电话" prop="mdLoadAttnTel">
  156. <el-input
  157. v-model="form.mdLoadAttnTel"
  158. placeholder="请输入装卸货联系电话"
  159. :disabled="disabled"
  160. v-input-limit="0"
  161. size="mini"
  162. style="width:100%"
  163. />
  164. </el-form-item>
  165. </el-col>
  166. </el-row>
  167. <el-row v-show="detailsHidden">
  168. <el-col :span="6">
  169. <el-form-item label="制单日期" prop="postDate">
  170. <el-date-picker
  171. v-model="form.postDate"
  172. type="datetime"
  173. :disabled="disabled"
  174. size="mini"
  175. style="width:100%"
  176. placeholder="制单日期"
  177. >
  178. </el-date-picker>
  179. </el-form-item>
  180. </el-col>
  181. <el-col :span="6">
  182. <el-form-item label="货品名称" prop="goodsId">
  183. <el-select
  184. v-model="form.goodsId"
  185. placeholder="请输入货品名称"
  186. :disabled="disabled"
  187. clearable
  188. filterable
  189. size="mini"
  190. style="width:100%"
  191. >
  192. <el-option
  193. v-for="(dict, index) in goodsOptions"
  194. :key="index.fId"
  195. :label="dict.fName"
  196. :value="dict.fId"
  197. />
  198. </el-select>
  199. </el-form-item>
  200. </el-col>
  201. <el-col :span="6">
  202. <el-form-item label="件数" prop="qtyPlan">
  203. <el-input
  204. v-model="form.qtyPlan"
  205. placeholder="请输入件数"
  206. :disabled="disabled"
  207. v-input-limit="2"
  208. size="mini"
  209. style="width:100%"
  210. />
  211. </el-form-item>
  212. </el-col>
  213. <el-col :span="6">
  214. <el-form-item label="重量(吨)" prop="weightPlan">
  215. <el-input
  216. v-model="form.weightPlan"
  217. placeholder="请输入重量"
  218. :disabled="disabled"
  219. v-input-limit="2"
  220. size="mini"
  221. style="width:100%"
  222. />
  223. </el-form-item>
  224. </el-col>
  225. <el-col :span="6">
  226. <el-form-item label="船名" prop="ysl">
  227. <el-input
  228. v-model="form.ysl"
  229. placeholder="请输入船名"
  230. :disabled="disabled"
  231. size="mini"
  232. style="width:100%"
  233. />
  234. </el-form-item>
  235. </el-col>
  236. <el-col :span="6">
  237. <el-form-item label="航次" prop="voy">
  238. <el-input
  239. v-model="form.voy"
  240. placeholder="请输入航次"
  241. :disabled="disabled"
  242. size="mini"
  243. style="width:100%"
  244. />
  245. </el-form-item>
  246. </el-col>
  247. <el-col :span="6">
  248. <el-form-item label="起运港" prop="polId">
  249. <el-select
  250. v-model="form.polId"
  251. placeholder="请输入起运港"
  252. :clearable="true"
  253. filterable
  254. :disabled="disabled"
  255. size="mini"
  256. style="width:100%"
  257. >
  258. <el-option
  259. v-for="(dict, index) in polList"
  260. :key="index.fId"
  261. :label="dict.fName"
  262. :value="dict.fId"
  263. />
  264. </el-select>
  265. </el-form-item>
  266. </el-col>
  267. <el-col :span="6">
  268. <el-form-item label="目的港" prop="podId">
  269. <el-select
  270. v-model="form.podId"
  271. placeholder="请输入目的港"
  272. :clearable="true"
  273. filterable
  274. :disabled="disabled"
  275. size="mini"
  276. style="width:100%"
  277. >
  278. <el-option
  279. v-for="(dict, index) in podList"
  280. :key="index.fId"
  281. :label="dict.fName"
  282. :value="dict.fId"
  283. />
  284. </el-select>
  285. </el-form-item>
  286. </el-col>
  287. <el-col :span="6">
  288. <el-form-item label="装车联系人" prop="loadAttn">
  289. <el-input
  290. v-model="form.loadAttn"
  291. placeholder="请输入装车联系人"
  292. :disabled="disabled"
  293. size="mini"
  294. style="width:100%"
  295. />
  296. </el-form-item>
  297. </el-col>
  298. <el-col :span="6">
  299. <el-form-item label="装车联系电话" prop="loadAttntel">
  300. <el-input
  301. v-model="form.loadAttntel"
  302. placeholder="请输入装车联系电话"
  303. :disabled="disabled"
  304. v-input-limit="0"
  305. size="mini"
  306. style="width:100%"
  307. />
  308. </el-form-item>
  309. </el-col>
  310. <el-col :span="6" v-if="form.billType == 1 || form.billType == 2">
  311. <el-form-item label="卸货时间" prop="mdLoadDate">
  312. <el-date-picker
  313. clearable
  314. size="mini"
  315. style="width:100%"
  316. v-model="form.mdLoadDate"
  317. type="datetime"
  318. placeholder="请选择卸货时间"
  319. :disabled="disabled"
  320. >
  321. </el-date-picker>
  322. </el-form-item>
  323. </el-col>
  324. <el-col :span="6">
  325. <el-form-item label="卸车时间" prop="unLoadDate">
  326. <el-date-picker
  327. clearable
  328. size="mini"
  329. style="width:100%"
  330. v-model="form.unLoadDate"
  331. type="datetime"
  332. placeholder="请选择卸车时间"
  333. :disabled="disabled"
  334. >
  335. </el-date-picker>
  336. </el-form-item>
  337. </el-col>
  338. <el-col :span="6">
  339. <el-form-item label="卸车联系人" prop="unLoadAttn">
  340. <el-input
  341. v-model="form.unLoadAttn"
  342. placeholder="请输入卸车联系人"
  343. :disabled="disabled"
  344. size="mini"
  345. style="width:100%"
  346. />
  347. </el-form-item>
  348. </el-col>
  349. <el-col :span="6">
  350. <el-form-item label="卸车联系电话" prop="unLoadAttnTel">
  351. <el-input
  352. v-model="form.unLoadAttnTel"
  353. placeholder="请输入卸车联系电话"
  354. :disabled="disabled"
  355. v-input-limit="0"
  356. size="mini"
  357. style="width:100%"
  358. />
  359. </el-form-item>
  360. </el-col>
  361. <el-col :span="6" v-if="form.transType == 3">
  362. <el-form-item label="损耗单位" prop="goodsLossType">
  363. <el-select
  364. v-model="form.goodsLossType"
  365. placeholder="请选择损耗单位"
  366. :disabled="disabled"
  367. size="mini"
  368. style="width:100%"
  369. >
  370. <el-option
  371. v-for="(dict, index) in goodsLossTypeList"
  372. :key="index.dictValue"
  373. :label="dict.dictLabel"
  374. :value="dict.dictValue"
  375. />
  376. </el-select>
  377. </el-form-item>
  378. </el-col>
  379. <el-col :span="6" v-if="form.transType == 3">
  380. <el-form-item label="耗损标准" prop="goodsLossStd">
  381. <el-input
  382. v-model="form.goodsLossStd"
  383. placeholder="请输入耗损标准"
  384. v-input-limit="2"
  385. :disabled="disabled"
  386. size="mini"
  387. style="width:100%"
  388. />
  389. </el-form-item>
  390. </el-col>
  391. <el-col>
  392. <el-form-item label="线路描述" prop="routeDesc">
  393. <el-input
  394. type="textarea"
  395. :rows="2"
  396. v-model="form.routeDesc"
  397. placeholder="请输入线路描述"
  398. :disabled="disabled"
  399. size="mini"
  400. />
  401. </el-form-item>
  402. </el-col>
  403. </el-row>
  404. <el-row>
  405. <el-col>
  406. <el-form-item label="备注" prop="remarks">
  407. <el-input
  408. type="textarea"
  409. :rows="2"
  410. v-model="form.remarks"
  411. placeholder="请输入备注"
  412. :disabled="disabled"
  413. size="mini"
  414. />
  415. </el-form-item>
  416. </el-col>
  417. </el-row>
  418. <div
  419. style="display: flex; justify-content: flex-end; margin-bottom: 10px"
  420. >
  421. <el-button
  422. @click="
  423. detailsHidden ? (detailsHidden = false) : (detailsHidden = true)
  424. "
  425. >{{ detailsHidden ? "隐藏" : "更多" }}
  426. </el-button>
  427. </div>
  428. <el-collapse v-model="collapses2">
  429. <el-collapse-item name="1">
  430. <template slot="title">
  431. <i class="header-icon el-icon-circle-plus" style="font-size: 16px"
  432. ><span
  433. style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  434. >计划货量</span
  435. >
  436. </i>
  437. </template>
  438. <div>
  439. <div
  440. style="
  441. display: flex;
  442. justify-content: space-between;
  443. margin: 10px 0;
  444. "
  445. >
  446. <div>
  447. <el-button
  448. type="primary"
  449. icon="el-icon-plus"
  450. size="mini"
  451. @click="addRow(planList)"
  452. :disabled="disabled"
  453. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  454. >添加</el-button
  455. >
  456. </div>
  457. </div>
  458. <el-table :data="planList">
  459. <el-table-column label="箱型" align="center" prop="cntrId">
  460. <template slot-scope="scope">
  461. <el-select
  462. v-model="scope.row.cntrId"
  463. placeholder="请选择箱型"
  464. :disabled="disabled"
  465. @visible-change="noMorecntrId(planList)"
  466. >
  467. <el-option
  468. v-for="(dict, index) in cntrIdList"
  469. :key="index.dictValue"
  470. :label="dict.dictLabel"
  471. :value="dict.dictValue"
  472. :disabled="dict.noOption"
  473. />
  474. </el-select>
  475. </template>
  476. </el-table-column>
  477. <el-table-column
  478. label="计价方式"
  479. align="center"
  480. prop="priceType"
  481. >
  482. <template slot-scope="scope">
  483. <el-select
  484. v-model="scope.row.priceType"
  485. placeholder="请输入计价方式"
  486. :disabled="disabled"
  487. >
  488. <el-option
  489. v-for="(dict, index) in priceTypeList"
  490. :key="index.dictValue"
  491. :label="dict.dictLabel"
  492. :value="dict.dictValue"
  493. />
  494. </el-select>
  495. </template>
  496. </el-table-column>
  497. <el-table-column label="应收运价" align="center" prop="priceDr">
  498. <template slot-scope="scope">
  499. <el-input
  500. v-model="scope.row.priceDr"
  501. placeholder="应收运价"
  502. :disabled="disabled"
  503. v-input-limit="2"
  504. />
  505. </template>
  506. </el-table-column>
  507. <el-table-column label="应付运价" align="center" prop="priceCr">
  508. <template slot-scope="scope">
  509. <el-input
  510. v-model="scope.row.priceCr"
  511. placeholder="应付运价"
  512. :disabled="disabled"
  513. v-input-limit="2"
  514. />
  515. </template>
  516. </el-table-column>
  517. <el-table-column label="计划货量" align="center" prop="cntrQty">
  518. <template slot-scope="scope">
  519. <el-input
  520. v-model="scope.row.cntrQty"
  521. placeholder="计划货量"
  522. :disabled="disabled"
  523. v-input-limit="2"
  524. />
  525. </template>
  526. </el-table-column>
  527. <el-table-column
  528. label="已调度货量"
  529. align="center"
  530. prop="cntrPlanQty"
  531. >
  532. <template slot-scope="scope">
  533. <el-input
  534. v-model="scope.row.cntrPlanQty"
  535. placeholder="已调度货量"
  536. :disabled="true"
  537. />
  538. </template>
  539. </el-table-column>
  540. <el-table-column
  541. label="已派车货量"
  542. align="center"
  543. prop="planQty"
  544. >
  545. <template slot-scope="scope">
  546. <el-input
  547. v-model="scope.row.planQty"
  548. placeholder="已派车货量"
  549. :disabled="true"
  550. />
  551. </template>
  552. </el-table-column>
  553. <el-table-column label="备注" align="center" prop="remarks">
  554. <template slot-scope="scope">
  555. <el-input
  556. v-model="scope.row.remarks"
  557. placeholder="备注"
  558. :disabled="disabled"
  559. />
  560. </template>
  561. </el-table-column>
  562. <el-table-column
  563. label="操作"
  564. align="center"
  565. class-name="small-padding fixed-width"
  566. width="100"
  567. >
  568. <template slot-scope="scope">
  569. <el-button
  570. size="mini"
  571. type="text"
  572. icon="el-icon-delete"
  573. @click.native.prevent="
  574. deleteplansRow(scope.$index, planList, scope.row)
  575. "
  576. :disabled="disabled"
  577. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  578. >删除</el-button
  579. >
  580. </template>
  581. </el-table-column>
  582. </el-table>
  583. </div>
  584. </el-collapse-item>
  585. <el-collapse-item name="2">
  586. <template slot="title">
  587. <i class="header-icon el-icon-circle-plus" style="font-size: 16px"
  588. ><span
  589. style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  590. >调度安排</span
  591. >
  592. </i>
  593. </template>
  594. <div>
  595. <div
  596. style="
  597. display: flex;
  598. justify-content: space-between;
  599. margin: 10px 0;
  600. "
  601. >
  602. <div>
  603. <el-button
  604. type="primary"
  605. icon="el-icon-plus"
  606. size="mini"
  607. @click="addschedulingRow(schedulingList)"
  608. :disabled="disabled2"
  609. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  610. >添加</el-button
  611. >
  612. </div>
  613. </div>
  614. <el-table :data="schedulingList">
  615. <el-table-column label="箱型" align="center" prop="cntrId">
  616. <template slot-scope="scope">
  617. <el-select
  618. v-model="scope.row.cntrId"
  619. placeholder="请选择箱型"
  620. :disabled="scope.row.disabled"
  621. @change="checkPid(scope.row)"
  622. >
  623. <el-option
  624. v-for="(dict, index) in cntrId2List"
  625. :key="index.dictValue"
  626. :label="dict.dictLabel"
  627. :value="dict.dictValue"
  628. />
  629. </el-select>
  630. </template>
  631. </el-table-column>
  632. <el-table-column
  633. label="车队名称"
  634. align="center"
  635. prop="carcorPid"
  636. >
  637. <template slot-scope="scope">
  638. <el-select
  639. v-model="scope.row.carcorPid"
  640. placeholder="请输入车队名称"
  641. :clearable="true"
  642. filterable
  643. :disabled="scope.row.disabled"
  644. >
  645. <el-option
  646. v-for="(dict, index) in companyList"
  647. :key="index.fId"
  648. :label="dict.fName"
  649. :value="dict.fId"
  650. />
  651. </el-select>
  652. </template>
  653. </el-table-column>
  654. <el-table-column
  655. label="调度安排货量"
  656. align="center"
  657. prop="cntrQty"
  658. >
  659. <template slot-scope="scope">
  660. <el-input
  661. v-model="scope.row.cntrQty"
  662. placeholder="调度安排货量"
  663. v-input-limit="2"
  664. :disabled="scope.row.disabled"
  665. />
  666. </template>
  667. </el-table-column>
  668. <el-table-column
  669. label="已派车货量"
  670. align="center"
  671. prop="carQty"
  672. >
  673. <template slot-scope="scope">
  674. <el-input
  675. v-model="scope.row.carQty"
  676. placeholder="已派车货量"
  677. :disabled="true"
  678. />
  679. </template>
  680. </el-table-column>
  681. <el-table-column
  682. label="应收运价"
  683. align="center"
  684. prop="freightPriceDr"
  685. >
  686. <template slot-scope="scope">
  687. <el-input
  688. v-model="scope.row.freightPriceDr"
  689. placeholder="应收运价"
  690. disabled
  691. />
  692. </template>
  693. </el-table-column>
  694. <el-table-column
  695. label="应付运价"
  696. align="center"
  697. prop="freightPriceCr"
  698. >
  699. <template slot-scope="scope">
  700. <el-input
  701. v-model="scope.row.freightPriceCr"
  702. placeholder="应付运价"
  703. :disabled="scope.row.disabled"
  704. />
  705. </template>
  706. </el-table-column>
  707. <el-table-column
  708. label="运输性质"
  709. align="center"
  710. prop="freightPriceCr"
  711. >
  712. <template slot-scope="scope">
  713. <el-select
  714. v-model="scope.row.transProp"
  715. placeholder="请选择运输性质"
  716. :disabled="scope.row.disabled"
  717. size="mini"
  718. >
  719. <el-option
  720. v-for="(dict, index) in transPropList"
  721. :key="index.dictValue"
  722. :label="dict.dictLabel"
  723. :value="dict.dictValue"
  724. />
  725. </el-select>
  726. </template>
  727. </el-table-column>
  728. <el-table-column label="状态" align="center" prop="billStatus">
  729. <template slot-scope="scope">
  730. <span v-if="scope.row.billStatus == 1">新建</span>
  731. <span v-if="scope.row.billStatus == 2">暂存</span>
  732. <span v-if="scope.row.billStatus == 3">撤销</span>
  733. <span v-if="scope.row.billStatus == 5">变更中</span>
  734. <span v-if="scope.row.billStatus == 6">提交</span>
  735. <span v-if="scope.row.billStatus == 20">派车暂存</span>
  736. <span v-if="scope.row.billStatus == 30">派车撤销</span>
  737. <span v-if="scope.row.billStatus == 60">派车提交</span>
  738. </template>
  739. </el-table-column>
  740. <el-table-column label="备注" align="center" prop="remarks">
  741. <template slot-scope="scope">
  742. <el-input
  743. v-model="scope.row.remarks"
  744. placeholder="备注"
  745. :disabled="scope.row.disabled"
  746. />
  747. </template>
  748. </el-table-column>
  749. <el-table-column
  750. label="操作"
  751. align="center"
  752. class-name="small-padding fixed-width"
  753. width="240"
  754. >
  755. <template slot-scope="scope">
  756. <el-button
  757. size="mini"
  758. type="text"
  759. icon="el-icon-delete"
  760. @click.native.prevent="
  761. delplansRow(scope.$index, schedulingList, scope.row)
  762. "
  763. :disabled="
  764. scope.row.billStatus == 5 || scope.row.billStatus == 6
  765. "
  766. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  767. >删除</el-button
  768. >
  769. <el-button
  770. size="mini"
  771. type="text"
  772. icon="el-icon-document-checked"
  773. @click.native.prevent="addplansRow(scope.row)"
  774. :disabled="
  775. scope.row.billStatus == 3 || scope.row.billStatus == 6
  776. "
  777. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  778. >提交</el-button
  779. >
  780. <el-button
  781. size="mini"
  782. type="text"
  783. icon="el-icon-document-delete"
  784. @click.native.prevent="
  785. revokeplansRow(scope.$index, schedulingList, scope.row)
  786. "
  787. :disabled="
  788. scope.row.billStatus < 6 || !scope.row.billStatus
  789. "
  790. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  791. >撤销</el-button
  792. >
  793. <el-button
  794. size="mini"
  795. type="text"
  796. icon="el-icon-refresh"
  797. @click.native.prevent="changeplansRow(scope.row)"
  798. :disabled="
  799. scope.row.billStatus < 6 || !scope.row.billStatus
  800. "
  801. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  802. >变更</el-button
  803. >
  804. </template>
  805. </el-table-column>
  806. </el-table>
  807. </div>
  808. </el-collapse-item>
  809. <el-collapse-item name="3">
  810. <template slot="title">
  811. <i class="header-icon el-icon-circle-plus" style="font-size: 16px"
  812. ><span
  813. style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  814. >收款信息</span
  815. >
  816. </i>
  817. </template>
  818. <div>
  819. <div
  820. style="
  821. display: flex;
  822. justify-content: space-between;
  823. margin: 10px 0;
  824. "
  825. >
  826. <div>
  827. <el-button
  828. type="primary"
  829. icon="el-icon-plus"
  830. size="mini"
  831. @click="addDListRow(DList)"
  832. :disabled="disabled2"
  833. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  834. >添加</el-button
  835. >
  836. </div>
  837. </div>
  838. <el-table :data="DList">
  839. <el-table-column label="结算单位" align="center" prop="fCorpid">
  840. <template slot-scope="scope">
  841. <el-select
  842. v-model="scope.row.fCorpid"
  843. placeholder="结算单位"
  844. :clearable="true"
  845. filterable
  846. :disabled="disabled2"
  847. >
  848. <el-option
  849. v-for="(dict, index) in fMblnoOptions"
  850. :key="index.fId"
  851. :label="dict.fName"
  852. :value="dict.fId"
  853. />
  854. </el-select>
  855. </template>
  856. </el-table-column>
  857. <el-table-column label="费用名称" align="center" prop="fFeeid">
  858. <template slot-scope="scope">
  859. <el-select
  860. v-model="scope.row.fFeeid"
  861. placeholder="费用名称"
  862. clearable
  863. filterable
  864. :disabled="disabled2"
  865. >
  866. <el-option
  867. v-for="(dict, index) in fWbuOptions"
  868. :key="index.fId"
  869. :label="dict.fName"
  870. :value="dict.fId"
  871. />
  872. </el-select>
  873. </template>
  874. </el-table-column>
  875. <el-table-column
  876. label="计费单位"
  877. align="center"
  878. prop="fFeeunitid"
  879. >
  880. <template slot-scope="scope">
  881. <el-select
  882. v-model="scope.row.fFeeunitid"
  883. placeholder="计费单位"
  884. :disabled="disabled2"
  885. >
  886. <el-option
  887. v-for="(dict, index) in ffeeunitidList"
  888. :key="index.dictValue"
  889. :label="dict.dictLabel"
  890. :value="dict.dictValue"
  891. />
  892. </el-select>
  893. </template>
  894. </el-table-column>
  895. <el-table-column label="计费数量" align="center" prop="fQty">
  896. <template slot-scope="scope">
  897. <el-input
  898. v-model="scope.row.fQty"
  899. placeholder="计费数量"
  900. v-input-limit="0"
  901. :disabled="disabled2"
  902. @input="total(scope.row)"
  903. />
  904. </template>
  905. </el-table-column>
  906. <el-table-column label="单价" align="center" prop="fUnitprice">
  907. <template slot-scope="scope">
  908. <el-input
  909. v-model="scope.row.fUnitprice"
  910. placeholder="单价"
  911. v-input-limit="2"
  912. :disabled="disabled2"
  913. @input="total(scope.row)"
  914. />
  915. </template>
  916. </el-table-column>
  917. <el-table-column label="币种" align="center" prop="fCurrency">
  918. <template slot-scope="scope">
  919. <el-input
  920. v-model="scope.row.fCurrency"
  921. placeholder="RMB"
  922. :disabled="true"
  923. />
  924. </template>
  925. </el-table-column>
  926. <el-table-column label="汇率" align="center" prop="fExrate">
  927. <template slot-scope="scope">
  928. <el-input
  929. v-model="scope.row.fExrate"
  930. placeholder="汇率"
  931. v-input-limit="2"
  932. :disabled="disabled2"
  933. />
  934. </template>
  935. </el-table-column>
  936. <el-table-column label="金额" align="center" prop="fAmount">
  937. <template slot-scope="scope">
  938. <el-input
  939. v-model="scope.row.fAmount"
  940. placeholder="金额"
  941. v-input-limit="2"
  942. :disabled="true"
  943. />
  944. </template>
  945. </el-table-column>
  946. <el-table-column label="税率" align="center" prop="fTaxrate">
  947. <template slot-scope="scope">
  948. <el-input
  949. v-model="scope.row.fTaxrate"
  950. placeholder="税率"
  951. v-input-limit="2"
  952. :disabled="disabled2"
  953. />
  954. </template>
  955. </el-table-column>
  956. <el-table-column label="备注" align="center" prop="remarks">
  957. <template slot-scope="scope">
  958. <el-input
  959. v-model="scope.row.remarks"
  960. placeholder="备注"
  961. :disabled="disabled2"
  962. />
  963. </template>
  964. </el-table-column>
  965. <el-table-column
  966. label="操作"
  967. align="center"
  968. class-name="small-padding fixed-width"
  969. width="100"
  970. >
  971. <template slot-scope="scope">
  972. <el-button
  973. size="mini"
  974. type="text"
  975. icon="el-icon-delete"
  976. @click.native.prevent="deleteRow(scope.$index, DList)"
  977. :disabled="disabled2"
  978. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  979. >删除</el-button
  980. >
  981. </template>
  982. </el-table-column>
  983. </el-table>
  984. </div>
  985. </el-collapse-item>
  986. <el-collapse-item name="4">
  987. <template slot="title">
  988. <i class="header-icon el-icon-circle-plus" style="font-size: 16px"
  989. ><span
  990. style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  991. >付款信息</span
  992. >
  993. </i>
  994. </template>
  995. <div>
  996. <div
  997. style="
  998. display: flex;
  999. justify-content: space-between;
  1000. margin: 10px 0;
  1001. "
  1002. >
  1003. <div>
  1004. <el-button
  1005. type="primary"
  1006. icon="el-icon-plus"
  1007. size="mini"
  1008. @click="addDListRow(CList)"
  1009. :disabled="disabled2"
  1010. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  1011. >添加</el-button
  1012. >
  1013. </div>
  1014. </div>
  1015. <el-table :data="CList">
  1016. <el-table-column label="结算单位" align="center" prop="fCorpid">
  1017. <template slot-scope="scope">
  1018. <el-select
  1019. v-model="scope.row.fCorpid"
  1020. placeholder="结算单位"
  1021. :clearable="true"
  1022. filterable
  1023. :disabled="disabled2"
  1024. >
  1025. <el-option
  1026. v-for="(dict, index) in fMblnoOptions"
  1027. :key="index.fId"
  1028. :label="dict.fName"
  1029. :value="dict.fId"
  1030. />
  1031. </el-select>
  1032. </template>
  1033. </el-table-column>
  1034. <el-table-column label="费用名称" align="center" prop="fFeeid">
  1035. <template slot-scope="scope">
  1036. <el-select
  1037. v-model="scope.row.fFeeid"
  1038. placeholder="费用名称"
  1039. clearable
  1040. filterable
  1041. :disabled="disabled2"
  1042. >
  1043. <el-option
  1044. v-for="(dict, index) in fWbuOptions"
  1045. :key="index.fId"
  1046. :label="dict.fName"
  1047. :value="dict.fId"
  1048. />
  1049. </el-select>
  1050. </template>
  1051. </el-table-column>
  1052. <el-table-column
  1053. label="计费单位"
  1054. align="center"
  1055. prop="fFeeunitid"
  1056. >
  1057. <template slot-scope="scope">
  1058. <el-select
  1059. v-model="scope.row.fFeeunitid"
  1060. placeholder="计费单位"
  1061. :disabled="disabled2"
  1062. >
  1063. <el-option
  1064. v-for="(dict, index) in ffeeunitidList"
  1065. :key="index.dictValue"
  1066. :label="dict.dictLabel"
  1067. :value="dict.dictValue"
  1068. />
  1069. </el-select>
  1070. </template>
  1071. </el-table-column>
  1072. <el-table-column label="计费数量" align="center" prop="fQty">
  1073. <template slot-scope="scope">
  1074. <el-input
  1075. v-model="scope.row.fQty"
  1076. placeholder="计费数量"
  1077. v-input-limit="0"
  1078. :disabled="disabled2"
  1079. @input="total(scope.row)"
  1080. />
  1081. </template>
  1082. </el-table-column>
  1083. <el-table-column label="单价" align="center" prop="fUnitprice">
  1084. <template slot-scope="scope">
  1085. <el-input
  1086. v-model="scope.row.fUnitprice"
  1087. placeholder="单价"
  1088. v-input-limit="2"
  1089. :disabled="disabled2"
  1090. @input="total(scope.row)"
  1091. />
  1092. </template>
  1093. </el-table-column>
  1094. <el-table-column label="币种" align="center" prop="fCurrency">
  1095. <template slot-scope="scope">
  1096. <el-input
  1097. v-model="scope.row.fCurrency"
  1098. placeholder="RMB"
  1099. :disabled="true"
  1100. />
  1101. </template>
  1102. </el-table-column>
  1103. <el-table-column label="汇率" align="center" prop="fExrate">
  1104. <template slot-scope="scope">
  1105. <el-input
  1106. v-model="scope.row.fExrate"
  1107. placeholder="汇率"
  1108. v-input-limit="2"
  1109. :disabled="disabled2"
  1110. />
  1111. </template>
  1112. </el-table-column>
  1113. <el-table-column label="金额" align="center" prop="fAmount">
  1114. <template slot-scope="scope">
  1115. <el-input
  1116. v-model="scope.row.fAmount"
  1117. placeholder="金额"
  1118. v-input-limit="2"
  1119. :disabled="true"
  1120. />
  1121. </template>
  1122. </el-table-column>
  1123. <el-table-column label="税率" align="center" prop="fTaxrate">
  1124. <template slot-scope="scope">
  1125. <el-input
  1126. v-model="scope.row.fTaxrate"
  1127. placeholder="税率"
  1128. v-input-limit="2"
  1129. :disabled="disabled2"
  1130. />
  1131. </template>
  1132. </el-table-column>
  1133. <el-table-column label="备注" align="center" prop="remarks">
  1134. <template slot-scope="scope">
  1135. <el-input
  1136. v-model="scope.row.remarks"
  1137. placeholder="备注"
  1138. :disabled="disabled2"
  1139. />
  1140. </template>
  1141. </el-table-column>
  1142. <el-table-column
  1143. label="操作"
  1144. align="center"
  1145. class-name="small-padding fixed-width"
  1146. width="100"
  1147. >
  1148. <template slot-scope="scope">
  1149. <el-button
  1150. size="mini"
  1151. type="text"
  1152. icon="el-icon-delete"
  1153. @click.native.prevent="deleteRow(scope.$index, DList)"
  1154. :disabled="disabled2"
  1155. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  1156. >删除</el-button
  1157. >
  1158. </template>
  1159. </el-table-column>
  1160. </el-table>
  1161. </div>
  1162. </el-collapse-item>
  1163. <el-collapse-item name="5">
  1164. <template slot="title">
  1165. <i class="header-icon el-icon-circle-plus" style="font-size: 16px"
  1166. ><span
  1167. style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  1168. >附件上传</span
  1169. >
  1170. </i>
  1171. </template>
  1172. <div>
  1173. <div
  1174. style="
  1175. display: flex;
  1176. justify-content: space-between;
  1177. margin: 10px 0;
  1178. "
  1179. >
  1180. <div>
  1181. <el-button
  1182. type="primary"
  1183. icon="el-icon-plus"
  1184. size="mini"
  1185. @click="addRelevt"
  1186. :disabled="disabled2"
  1187. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  1188. >添加</el-button
  1189. >
  1190. </div>
  1191. </div>
  1192. <el-table
  1193. :data="relevantAttachments"
  1194. tooltip-effect="dark"
  1195. border
  1196. stripe
  1197. style="width: 100%"
  1198. height="150"
  1199. >
  1200. <el-table-column label="序号" type="index" width="80">
  1201. </el-table-column>
  1202. <el-table-column
  1203. prop="attachName"
  1204. header-align="center"
  1205. align="center"
  1206. label="附件名称"
  1207. >
  1208. <template slot-scope="scope">
  1209. <el-input
  1210. v-model="scope.row.attachName"
  1211. placeholder="附件名称"
  1212. show-word-limit
  1213. :disabled="disabled2"
  1214. />
  1215. </template>
  1216. </el-table-column>
  1217. <el-table-column
  1218. prop="createBy "
  1219. header-align="center"
  1220. align="center"
  1221. label="上传人"
  1222. >
  1223. <template slot-scope="scope">
  1224. <el-input
  1225. v-model="scope.row.createBy"
  1226. placeholder="上传人"
  1227. show-word-limit
  1228. :disabled="disabled2"
  1229. />
  1230. </template>
  1231. </el-table-column>
  1232. <el-table-column
  1233. prop="createTime"
  1234. header-align="center"
  1235. align="center"
  1236. label="上传时间"
  1237. >
  1238. <template slot-scope="scope">
  1239. <el-date-picker
  1240. v-model="scope.row.createTime"
  1241. type="datetime"
  1242. placeholder="上传时间"
  1243. disabled
  1244. ></el-date-picker>
  1245. </template>
  1246. </el-table-column>
  1247. <el-table-column
  1248. prop="attachUrl"
  1249. header-align="center"
  1250. align="center"
  1251. label="上传附件"
  1252. >
  1253. <template slot-scope="scope">
  1254. <div style="display: flex; justify-content: center">
  1255. <el-upload
  1256. class="upload-demo"
  1257. :action="uploadImgUrl"
  1258. :on-success="
  1259. (res, file) => {
  1260. handleSucces(scope, res, file);
  1261. }
  1262. "
  1263. :headers="headers"
  1264. :disabled="disabled2"
  1265. :show-file-list="false"
  1266. :limit="1"
  1267. >
  1268. <el-button
  1269. size="small"
  1270. type="text"
  1271. :disabled="disabled2"
  1272. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  1273. >点击上传</el-button
  1274. >
  1275. </el-upload>
  1276. <el-button
  1277. size="small"
  1278. type="text"
  1279. @click="checkFile(scope)"
  1280. :disabled="disabled2"
  1281. style="margin-left: 10px"
  1282. >查看</el-button
  1283. >
  1284. <el-button
  1285. size="small"
  1286. type="text"
  1287. :disabled="disabled2"
  1288. @click="deleteFile(scope)"
  1289. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  1290. >删除</el-button
  1291. >
  1292. </div>
  1293. </template>
  1294. </el-table-column>
  1295. <el-table-column
  1296. header-align="center"
  1297. align="center"
  1298. label="操作"
  1299. width="130PX"
  1300. >
  1301. <template slot-scope="scope">
  1302. <el-button
  1303. size="mini"
  1304. type="text"
  1305. icon="el-icon-delete"
  1306. @click.native.prevent="
  1307. deleteRow(scope.$index, relevantAttachments)
  1308. "
  1309. :disabled="disabled2"
  1310. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  1311. >删除</el-button
  1312. >
  1313. </template>
  1314. </el-table-column>
  1315. </el-table>
  1316. </div>
  1317. </el-collapse-item>
  1318. </el-collapse>
  1319. </el-form>
  1320. </span>
  1321. <span slot="footer" class="dialog-footer">
  1322. <el-button
  1323. type="primary"
  1324. @click="submitForm"
  1325. :disabled="disabled2"
  1326. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  1327. >提 交</el-button
  1328. >
  1329. <el-button
  1330. type="success"
  1331. @click="submitAllowChanges"
  1332. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  1333. >修 改</el-button
  1334. >
  1335. <el-button
  1336. type="info"
  1337. @click="submitSave"
  1338. :disabled="disabled2"
  1339. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  1340. >保 存</el-button
  1341. >
  1342. <el-button
  1343. type="warning"
  1344. @click="submitRetreat"
  1345. :disabled="this.form.billStatus < 6"
  1346. v-hasPermi="['fleet:ftmsorderbillsplans:edit']"
  1347. >撤 回</el-button
  1348. >
  1349. <el-button @click="showDialog = false">取 消</el-button>
  1350. </span>
  1351. </el-dialog>
  1352. </template>
  1353. <script>
  1354. import {
  1355. RetreatFtmsorderbills,
  1356. allowChangesFtmsorderbills,
  1357. } from "@/api/fleet/ftmsorderbills";
  1358. import {
  1359. singleaddFtmsorderbillsplans,
  1360. revokeFtmsorderbillsplans,
  1361. addFtmsorderbillsplans,
  1362. removeFtmsorderbillsplans,
  1363. changeFtmsorderbillsplans,
  1364. updateFtmsorderbillsplans,
  1365. planChangeFtmsorderbillsplans,
  1366. saveFtmsorderbillsplans,
  1367. } from "@/api/fleet/ftmsorderbillsplans";
  1368. import { getBasicInformation } from "@/api/kaihe/basicdata/container";
  1369. import { company } from "@/api/fleet/carManage";
  1370. import { listGoods } from "@/api/basicdata/goods";
  1371. import { listCorps } from "@/api/basicdata/corps";
  1372. import { listFees } from "@/api/basicdata/fees";
  1373. import UploadFile from "@/components/Uploadfile";
  1374. import Cookies from "js-cookie";
  1375. import { getToken } from "@/utils/auth";
  1376. export default {
  1377. name: "plans",
  1378. props: {
  1379. addOrUpdateVisible: {
  1380. type: Boolean,
  1381. default: false,
  1382. },
  1383. title: {
  1384. type: String,
  1385. required: "",
  1386. },
  1387. form: Object,
  1388. disabled: {
  1389. type: Boolean,
  1390. default: false,
  1391. },
  1392. disabled2: {
  1393. type: Boolean,
  1394. default: false,
  1395. },
  1396. planList: {
  1397. type: Array,
  1398. default: [],
  1399. },
  1400. DList: {
  1401. type: Array,
  1402. default: [],
  1403. },
  1404. CList: {
  1405. type: Array,
  1406. default: [],
  1407. },
  1408. schedulingList: {
  1409. type: Array,
  1410. default: [],
  1411. },
  1412. collapses: {
  1413. type: Array,
  1414. default: [],
  1415. },
  1416. relevantAttachments: {
  1417. type: Array,
  1418. default: [],
  1419. },
  1420. },
  1421. components: {
  1422. UploadFile,
  1423. },
  1424. data() {
  1425. return {
  1426. dcList: [
  1427. {
  1428. value: "D",
  1429. label: "收款",
  1430. },
  1431. {
  1432. value: "C",
  1433. label: "付款",
  1434. },
  1435. ],
  1436. currencyList: [
  1437. {
  1438. value: "RMB",
  1439. label: "RMB",
  1440. },
  1441. ],
  1442. // 控制弹出框显示隐藏
  1443. showDialog: false,
  1444. // 表单校验
  1445. rules: {
  1446. corpId: [
  1447. { required: true, message: "请输入客户名称", trigger: "blur" },
  1448. ],
  1449. billType: [
  1450. { required: true, message: "请选择业务类型", trigger: "blur" },
  1451. ],
  1452. transType: [
  1453. { required: true, message: "请选择运输方式", trigger: "blur" },
  1454. ],
  1455. loadAddr: [
  1456. { required: true, message: "请输入提箱地点", trigger: "blur" },
  1457. ],
  1458. loadAttntel: [
  1459. {
  1460. pattern: /^((0\d{2,3}-\d{7,8})|(1[0123456789]\d{9}))$/,
  1461. message: "请正确输入手机号",
  1462. trigger: "blur",
  1463. },
  1464. ],
  1465. mdLoadAttnTel: [
  1466. {
  1467. pattern: /^((0\d{2,3}-\d{7,8})|(1[0123456789]\d{9}))$/,
  1468. message: "请正确输入手机号",
  1469. trigger: "blur",
  1470. },
  1471. ],
  1472. unLoadAttnTel: [
  1473. {
  1474. pattern: /^((0\d{2,3}-\d{7,8})|(1[0123456789]\d{9}))$/,
  1475. message: "请正确输入手机号",
  1476. trigger: "blur",
  1477. },
  1478. ],
  1479. },
  1480. billTypeList: [],
  1481. transTypeList: [],
  1482. transPropList: [],
  1483. goodsLossTypeList: [],
  1484. cntrIdList: [],
  1485. priceTypeList: [],
  1486. userType: null,
  1487. username: null,
  1488. fMblnoOptions: [],
  1489. cntrId2List: [],
  1490. goodsOptions: [],
  1491. fWbuOptions: [],
  1492. ffeeunitidList: [],
  1493. collapses2: [],
  1494. polList: [],
  1495. podList: [],
  1496. companyList: [],
  1497. uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
  1498. headers: {
  1499. Authorization: "Bearer " + getToken(),
  1500. },
  1501. detailsHidden: false,
  1502. };
  1503. },
  1504. created() {
  1505. this.getDicts("data_billType").then((response) => {
  1506. this.billTypeList = response.data;
  1507. });
  1508. this.getDicts("data_transType").then((response) => {
  1509. this.transTypeList = response.data;
  1510. });
  1511. this.getDicts("data_transProp").then((response) => {
  1512. this.transPropList = response.data;
  1513. });
  1514. this.getDicts("data_goodsLossType").then((response) => {
  1515. this.goodsLossTypeList = response.data;
  1516. });
  1517. this.getDicts("data_cntrId").then((response) => {
  1518. response.data.map((e) => (e.noOption = false));
  1519. this.cntrIdList = response.data;
  1520. });
  1521. this.getDicts("data_priceType").then((response) => {
  1522. this.priceTypeList = response.data;
  1523. });
  1524. this.getDicts("data_ffeeunitid").then((response) => {
  1525. this.ffeeunitidList = response.data;
  1526. });
  1527. getBasicInformation({
  1528. fTypes: 1,
  1529. fStatus: "T",
  1530. }).then((response) => {
  1531. this.polList = response;
  1532. this.podList = response;
  1533. });
  1534. listCorps().then((response) => {
  1535. this.fMblnoOptions = response.rows;
  1536. });
  1537. listGoods().then((response) => {
  1538. this.goodsOptions = response.rows;
  1539. });
  1540. listFees().then((response) => {
  1541. this.fWbuOptions = response.rows;
  1542. });
  1543. company({
  1544. fStatus: 0,
  1545. }).then((response) => {
  1546. this.companyList = response.rows;
  1547. });
  1548. this.userType = Cookies.get("userType");
  1549. this.username = Cookies.get("userName");
  1550. },
  1551. methods: {
  1552. //选中时赋值pid
  1553. checkPid(row) {
  1554. let arr = this.planList;
  1555. let arr2 = arr.filter((e) => e.cntrId == row.cntrId);
  1556. console.log(arr2);
  1557. row["pid"] = arr2[0].id;
  1558. this.$set(row, "freightPriceCr", arr2[0].priceCr);
  1559. this.$set(row, "freightPriceDr", arr2[0].priceDr);
  1560. // row["freightPriceCr"] = arr2[0].priceCr;
  1561. // row["freightPriceDr"] = arr2[0].priceDr;
  1562. },
  1563. noMorecntrId(e) {
  1564. this.cntrIdList.forEach((item) => (item.noOption = false));
  1565. let arrIds = e.map((item) => item.cntrId);
  1566. this.cntrIdList
  1567. .filter((item) => arrIds.indexOf(item.dictValue) > -1)
  1568. .forEach((item) => (item.noOption = true));
  1569. },
  1570. showSure(val) {
  1571. let pidList = val.filter((e) => e.pid != null);
  1572. let arr1 = pidList;
  1573. let arr1Ids = arr1.map((item) => item.cntrId);
  1574. arr1Ids = [...new Set(arr1Ids)];
  1575. let arr2 = this.cntrIdList;
  1576. this.cntrId2List = arr2.filter(
  1577. (item) => arr1Ids.indexOf(item.dictValue) > -1
  1578. );
  1579. },
  1580. // 新增附件上传
  1581. addRelevt() {
  1582. this.relevantAttachments.push({
  1583. attachUrl: null,
  1584. attachName: null,
  1585. createBy: this.username,
  1586. createTime: Date.parse(new Date()),
  1587. });
  1588. },
  1589. //附件删除
  1590. deleteFile(scope) {
  1591. this.relevantAttachments[scope.$index].attachName = "";
  1592. this.relevantAttachments[scope.$index].attachUrl = "";
  1593. if (this.relevantAttachments[scope.$index].attachUrl === "") {
  1594. this.$message.success("删除成功");
  1595. } else {
  1596. this.$message.error("未知错误,删除失败");
  1597. }
  1598. },
  1599. //附件查看
  1600. checkFile(scope) {
  1601. if (this.relevantAttachments[scope.$index].attachUrl) {
  1602. window.open(this.relevantAttachments[scope.$index].attachUrl);
  1603. } else {
  1604. this.$message.error("请上传附件");
  1605. }
  1606. },
  1607. //附件上传
  1608. handleSucces(scope, res, file) {
  1609. this.relevantAttachments[scope.$index].attachName = res.fileName;
  1610. this.relevantAttachments[scope.$index].attachUrl = res.url;
  1611. if (this.relevantAttachments[scope.$index].attachUrl === "") {
  1612. this.$message.error("上传失败");
  1613. } else {
  1614. this.$message.success("上传成功");
  1615. }
  1616. },
  1617. // 添加行
  1618. addRow(tableData, event) {
  1619. var obj = {};
  1620. tableData.push(obj);
  1621. },
  1622. addDListRow(tableData, event) {
  1623. var obj = { fcorpid: this.form.corpId, fcurrency: "RMB", fExrate: "1" };
  1624. tableData.push(obj);
  1625. },
  1626. //删除行
  1627. deleteRow(index, rows) {
  1628. rows.splice(index, 1);
  1629. },
  1630. deleteplansRow(index, rows, row) {
  1631. let arr = this.schedulingList;
  1632. let arr2 = arr.filter((e) => e.cntrId == row.cntrId && e.cntrId != null);
  1633. if (arr2.length != 0) {
  1634. this.$message.error("调度安排已插入此箱型数据,不能删除");
  1635. } else {
  1636. this.cntrIdList
  1637. .filter((item) => item.dictValue == row.cntrId)
  1638. .forEach((item) => (item.noOption = false));
  1639. rows.splice(index, 1);
  1640. }
  1641. },
  1642. // 上传成功返回数据
  1643. showFile(row) {
  1644. for (let list in this.relevantAttachments) {
  1645. this.$set(this.relevantAttachments[list], "attachUrl", row.url);
  1646. this.$set(this.relevantAttachments[list], "attachName", row.fileName);
  1647. }
  1648. },
  1649. // 弹出框关闭后触发
  1650. handleClose() {
  1651. // 子组件调用父组件方法,并传递参数
  1652. this.$emit("changeShow", "false");
  1653. this.cntrIdList.forEach((item) => (item.noOption = false));
  1654. },
  1655. /** 提交按钮 */
  1656. submitForm() {
  1657. this.$refs["form"].validate((valid) => {
  1658. if (valid) {
  1659. let arr = this.schedulingList.filter((e) => e.billStatus >= 6);
  1660. if (this.schedulingList.length == arr.length) {
  1661. this.DList.map((e) => {
  1662. return (e.fDc = "D");
  1663. });
  1664. this.CList.map((e) => {
  1665. return (e.fDc = "C");
  1666. });
  1667. for (let item in this.planList) {
  1668. if (
  1669. this.planList[item].cntrQty != this.planList[item].cntrPlanQty
  1670. ) {
  1671. return this.$message.error("计划货量存在未安排的货量");
  1672. }
  1673. }
  1674. let formData = new window.FormData();
  1675. formData.append("tmsorder", JSON.stringify(this.form));
  1676. formData.append(
  1677. "attachs",
  1678. JSON.stringify(this.relevantAttachments)
  1679. );
  1680. formData.append("scntrs", JSON.stringify(this.planList));
  1681. formData.append(
  1682. "fees",
  1683. JSON.stringify(this.DList.concat(this.CList))
  1684. );
  1685. formData.append("plans", JSON.stringify(this.schedulingList));
  1686. addFtmsorderbillsplans(formData).then((response) => {
  1687. this.msgSuccess("提交成功");
  1688. this.$parent.getList();
  1689. this.showDialog = false;
  1690. });
  1691. } else {
  1692. //this.msgSuccess("调度安排中有未提交的数据");
  1693. this.$message.error("请先提交调度安排的派车信息");
  1694. }
  1695. }
  1696. });
  1697. },
  1698. //保存
  1699. submitSave() {
  1700. this.DList.map((e) => {
  1701. return (e.fDc = "D");
  1702. });
  1703. this.CList.map((e) => {
  1704. return (e.fDc = "C");
  1705. });
  1706. let formData = new window.FormData();
  1707. formData.append("tmsorder", JSON.stringify(this.form));
  1708. formData.append("attachs", JSON.stringify(this.relevantAttachments));
  1709. formData.append("scntrs", JSON.stringify(this.planList));
  1710. formData.append("fees", JSON.stringify(this.DList.concat(this.CList)));
  1711. formData.append("plans", JSON.stringify(this.schedulingList));
  1712. saveFtmsorderbillsplans(formData).then((response) => {
  1713. if (response.code == 200) {
  1714. console.log(response);
  1715. this.msgSuccess("保存成功");
  1716. this.$parent.getList();
  1717. this.$parent.getSave(response);
  1718. }
  1719. });
  1720. },
  1721. //撤回
  1722. submitRetreat() {
  1723. const id = { id: this.form.id, actId: 1010 };
  1724. RetreatFtmsorderbills(id).then((response) => {
  1725. if (response.code == 200) {
  1726. this.msgSuccess("撤回成功");
  1727. this.$parent.getList();
  1728. // this.$emit("fixDisabled", "false");
  1729. this.$emit("fixDisabled2", "false");
  1730. }
  1731. });
  1732. },
  1733. //修改
  1734. submitAllowChanges() {
  1735. if (this.form.billStatus < 60) {
  1736. // this.$emit("fixDisabled", "false");
  1737. this.$emit("fixDisabled2", "false");
  1738. this.msgSuccess("允许修改");
  1739. } else {
  1740. this.$confirm("该单据已经提交,是否进行变更操作?", "提示", {
  1741. confirmButtonText: "确定",
  1742. cancelButtonText: "取消",
  1743. type: "warning",
  1744. })
  1745. .then(() => {
  1746. console.log("111");
  1747. const data = { id: this.form.id, actId: 1010 };
  1748. allowChangesFtmsorderbills(data).then((response) => {
  1749. if (response.code == 200) {
  1750. // this.$emit("fixDisabled", "false");
  1751. this.$emit("fixDisabled2", "false");
  1752. this.msgSuccess("允许修改");
  1753. this.$set(this.form, "billStatus", 5);
  1754. } else {
  1755. this.$message.error("不允许修改");
  1756. }
  1757. });
  1758. })
  1759. .catch(() => {
  1760. console.log("111");
  1761. this.$message({
  1762. type: "info",
  1763. message: "已取消",
  1764. });
  1765. });
  1766. }
  1767. },
  1768. //调度安排新增
  1769. addschedulingRow(tableData, event) {
  1770. const pidList = this.planList.filter((e) => e.pid != null);
  1771. if (
  1772. this.planList.length == 0 ||
  1773. Object.keys(this.planList[0]).length == 0
  1774. ) {
  1775. this.$message.error("至少添加一条计划货量");
  1776. } else if (pidList.length != this.planList.length) {
  1777. this.$confirm("计划货量存在未保存数据,是否保存?", "提示", {
  1778. confirmButtonText: "确定",
  1779. cancelButtonText: "取消",
  1780. type: "warning",
  1781. })
  1782. .then(() => {
  1783. this.submitSave();
  1784. })
  1785. .catch(() => {
  1786. this.$message({
  1787. type: "info",
  1788. message: "已取消保存",
  1789. });
  1790. });
  1791. } else {
  1792. var obj = {};
  1793. tableData.push(obj);
  1794. this.showSure(this.planList);
  1795. }
  1796. },
  1797. //单条订单调度提交
  1798. addplansRow(row) {
  1799. if (row.billStatus == 5) {
  1800. let formData = new window.FormData();
  1801. formData.append("tmsorder", JSON.stringify(this.form));
  1802. formData.append("plans", JSON.stringify(row));
  1803. planChangeFtmsorderbillsplans(formData).then((response) => {
  1804. this.msgSuccess("成功提交");
  1805. if (response.code == 200) {
  1806. this.$set(row, "billStatus", 6);
  1807. this.$set(row, "disabled", true);
  1808. this.$set(row, "id", response.data.plan.id);
  1809. this.$set(row, "orgId", response.data.plan.orgId);
  1810. this.$parent.getSave2(response.data.cntrs);
  1811. }
  1812. });
  1813. } else if (row.billStatus != 6) {
  1814. let formData = new window.FormData();
  1815. formData.append("tmsorder", JSON.stringify(this.form));
  1816. formData.append("plans", JSON.stringify(row));
  1817. singleaddFtmsorderbillsplans(formData).then((response) => {
  1818. this.msgSuccess("成功提交");
  1819. if (response.code == 200) {
  1820. this.$set(row, "billStatus", 6);
  1821. this.$set(row, "disabled", true);
  1822. this.$set(row, "id", response.data.plan.id);
  1823. this.$set(row, "orgId", response.data.plan.orgId);
  1824. this.$parent.getSave2(response.data.cntrs);
  1825. }
  1826. });
  1827. } else {
  1828. this.$message.error("请勿重复提交");
  1829. }
  1830. },
  1831. delplansRow(index, rows, row) {
  1832. if (row.billStatus != 6 && row.id != null) {
  1833. removeFtmsorderbillsplans(row).then((response) => {
  1834. if (response.code == 200) {
  1835. rows.splice(index, 1);
  1836. this.msgSuccess("成功删除");
  1837. }
  1838. });
  1839. } else {
  1840. rows.splice(index, 1);
  1841. }
  1842. },
  1843. revokeplansRow(index, rows, row) {
  1844. if (row.billStatus == 6) {
  1845. revokeFtmsorderbillsplans(row).then((response) => {
  1846. if (response.code == 200) {
  1847. this.msgSuccess("成功撤回");
  1848. this.$set(row, "billStatus", 3);
  1849. this.$parent.getSave2(response.data.cntrs);
  1850. }
  1851. });
  1852. } else {
  1853. this.$message.error("此条数据没有提交,不能申请撤回");
  1854. }
  1855. },
  1856. changeplansRow(row) {
  1857. if (row.billStatus != 5) {
  1858. changeFtmsorderbillsplans(row).then((response) => {
  1859. if (response.code == 200) {
  1860. this.msgSuccess("允许变更");
  1861. this.$set(row, "billStatus", 5);
  1862. this.$set(row, "disabled", false);
  1863. }
  1864. });
  1865. } else {
  1866. this.$message.error("请勿重复变更");
  1867. }
  1868. },
  1869. total(row) {
  1870. if (row.fQty && row.fUnitprice) {
  1871. this.$set(row, "fAmount", (row.fQty * row.fUnitprice).toFixed(2));
  1872. } else {
  1873. this.$set(row, "fAmount", 0);
  1874. }
  1875. },
  1876. },
  1877. watch: {
  1878. // 监听 addOrUpdateVisible 改变
  1879. addOrUpdateVisible(oldVal, newVal) {
  1880. this.showDialog = this.addOrUpdateVisible;
  1881. },
  1882. planList(val) {
  1883. this.showSure(val);
  1884. },
  1885. collapses() {
  1886. this.collapses2 = this.collapses;
  1887. },
  1888. },
  1889. };
  1890. </script>