detailPage.vue 94 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back" v-if="!home">
  5. <el-button
  6. type="danger"
  7. style="border: none;background: none;color: red"
  8. icon="el-icon-arrow-left"
  9. @click="backToList(0)"
  10. >返回列表
  11. </el-button>
  12. </div>
  13. <div class="customer-back" v-else>
  14. <el-button
  15. type="danger"
  16. style="border: none;background: none;color: red"
  17. icon="el-icon-arrow-left"
  18. @click="backToList(1)"
  19. >返回列表
  20. </el-button>
  21. <el-button
  22. type="danger"
  23. style="border: none;background: none;color: red"
  24. icon="el-icon-arrow-left"
  25. @click="backToList(2)"
  26. >返回台账
  27. </el-button>
  28. </div>
  29. <div>
  30. <div class="el-button&#45;&#45;small-yh add-customer-btn">
  31. <el-button
  32. class="el-icon-printer"
  33. type="info"
  34. size="small"
  35. @click="openReport">打印运单
  36. </el-button>
  37. <el-button
  38. type="primary"
  39. size="small"
  40. @click="diaodubaocun"
  41. >保存</el-button>
  42. <el-button
  43. type="warning"
  44. size="small"
  45. @click="updateFee"
  46. >更新账单</el-button>
  47. </div>
  48. </div>
  49. </div>
  50. <containerTitle title="委托信息" style="margin-top: 50px"></containerTitle>
  51. <basic-container>
  52. <avue-form :option="goodsOptionForm" v-model="goodsForm">
  53. <template slot-scope="scope" slot="corpId">
  54. <crop-select
  55. v-model="goodsForm.corpId"
  56. disabled
  57. ></crop-select>
  58. </template>
  59. <template slot-scope="scope" slot="station">
  60. <port-info
  61. v-model="goodsForm.station"
  62. :disabled="goodsForm.status >= 1"
  63. />
  64. </template>
  65. <template slot-scope="scope" slot="agentId">
  66. <crop-select
  67. :disabled="goodsForm.status >= 1"
  68. v-model="goodsForm.agentId"
  69. ></crop-select>
  70. </template>
  71. <template slot-scope="scope" slot="polId">
  72. <port-info
  73. v-model="goodsForm.polId"
  74. :disabled="goodsForm.status >= 1"
  75. />
  76. </template>
  77. <template slot-scope="scope" slot="podId">
  78. <port-info
  79. v-model="goodsForm.podId"
  80. :disabled="goodsForm.status >= 1"
  81. />
  82. </template>
  83. </avue-form>
  84. </basic-container>
  85. <containerTitle title="其他信息"></containerTitle>
  86. <basic-container :showBtn="true" ref="other">
  87. <avue-form :option="goodsOptionFormTwo" v-model="goodsForm">
  88. <template slot-scope="scope" slot="corpId">
  89. <crop-select
  90. v-model="goodsForm.corpId"
  91. disabled
  92. ></crop-select>
  93. </template>
  94. <template slot-scope="scope" slot="station">
  95. <port-info
  96. v-model="goodsForm.station"
  97. :disabled="goodsForm.status >= 1"
  98. />
  99. </template>
  100. <template slot-scope="scope" slot="agentId">
  101. <crop-select
  102. :disabled="goodsForm.status >= 1"
  103. v-model="goodsForm.agentId"
  104. ></crop-select>
  105. </template>
  106. <template slot-scope="scope" slot="polId">
  107. <port-info
  108. v-model="goodsForm.polId"
  109. type="id"
  110. :disabled="goodsForm.status >= 1"
  111. />
  112. </template>
  113. <template slot-scope="scope" slot="podId">
  114. <port-info
  115. v-model="goodsForm.podId"
  116. type="id"
  117. :disabled="goodsForm.status >= 1"
  118. />
  119. </template>
  120. </avue-form>
  121. </basic-container>
  122. <containerTitle
  123. title="预估费用"></containerTitle>
  124. <basic-container>
  125. <avue-crud :data="yugudata" :option="yuguoptionpz" ref="yugoref"
  126. @row-update="yuguupdate" @row-del="yugurowDel"
  127. >
  128. <!--<template slot-scope="{row,index}" slot="menu">-->
  129. <!-- <el-button-->
  130. <!-- type="text"-->
  131. <!-- size="small"-->
  132. <!-- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"-->
  133. <!-- @click="rowCell(row,index)"-->
  134. <!-- >保存-->
  135. <!-- </el-button>-->
  136. <!-- <el-button type="text"-->
  137. <!-- icon="el-icon-delete"-->
  138. <!-- size="small"-->
  139. <!-- >删除-->
  140. <!-- </el-button>-->
  141. <!--</template>-->
  142. <template slot="menuLeft">
  143. <el-button
  144. type="primary" icon="el-icon-plus" @click="addyugofun"
  145. size="small">新增
  146. </el-button>
  147. </template>
  148. </avue-crud>
  149. </basic-container>
  150. <containerTitle
  151. title="起止地信息"></containerTitle>
  152. <basic-container>
  153. <el-table
  154. ref="singleTable"
  155. :data="tableData"
  156. size="mini"
  157. :header-cell-style="{color:'#000',background:'#fafafa'}"
  158. style="width: 100%">
  159. <el-table-column
  160. property="date"
  161. align="center"
  162. width="40">
  163. <template slot-scope="scope">
  164. <span v-if="scope.$index == 0">
  165. <el-button type="primary" size="mini" circle>起</el-button>
  166. </span>
  167. <span v-else-if="scope.$index === tableData.length-1">
  168. <el-button type="success" size="mini" circle>止</el-button>
  169. </span>
  170. <span v-else>
  171. <el-button type="warning" size="mini" circle>途</el-button>
  172. <!-- <el-button v-if="goodsForm.status === 2" type="warning" size="mini" circle>途</el-button>-->
  173. <!-- <el-tooltip v-else class="item" effect="dark" content="删除" placement="right">-->
  174. <!-- <el-button type="danger" icon="el-icon-delete" size="mini" circle-->
  175. <!-- @click="deleteAddress(scope)"></el-button>-->
  176. <!-- </el-tooltip>-->
  177. </span>
  178. </template>
  179. </el-table-column>
  180. <el-table-column
  181. type="index"
  182. label="序号"
  183. align="center"
  184. width="60">
  185. </el-table-column>
  186. <el-table-column
  187. property="corpName"
  188. label="货运地点"
  189. align="center"
  190. show-overflow-tooltip
  191. width="200">
  192. </el-table-column>
  193. <!-- <el-table-column-->
  194. <!-- property="province"-->
  195. <!-- label="省市区"-->
  196. <!-- align="center"-->
  197. <!-- width="280">-->
  198. <!-- <template slot-scope="scope">-->
  199. <!-- <el-cascader-->
  200. <!-- size="small"-->
  201. <!-- style="width: 100%;"-->
  202. <!-- v-model="scope.row.region"-->
  203. <!-- disabled-->
  204. <!-- :props="treeOption"></el-cascader>-->
  205. <!-- </template>-->
  206. <!-- </el-table-column>-->
  207. <el-table-column
  208. property="contacts"
  209. align="center"
  210. width="150"
  211. show-overflow-tooltip
  212. label="联系人">
  213. </el-table-column>
  214. <el-table-column
  215. property="tel"
  216. align="center"
  217. width="180"
  218. show-overflow-tooltip
  219. label="电话">
  220. </el-table-column>
  221. <el-table-column
  222. property="address"
  223. align="center"
  224. show-overflow-tooltip
  225. label="详细地址">
  226. </el-table-column>
  227. <el-table-column
  228. property="remarks"
  229. align="center"
  230. show-overflow-tooltip
  231. label="备注">
  232. </el-table-column>
  233. </el-table>
  234. </basic-container>
  235. <containerTitle title="车辆信息"></containerTitle>
  236. <basic-container>
  237. <avue-crud
  238. :data="entrustList"
  239. @selection-change="selectionChange"
  240. :option="entrustOptionTwoT"
  241. ref="crudBoxTwo"
  242. :key="KeyBoxTwo"
  243. @resetColumn="resetColumnBoxTwo"
  244. @saveColumn="saveColumnBoxTwo"
  245. @row-save="(row,done,loading)=>{rowSaveT(row,0,done,loading)}"
  246. @row-update="rowSaveWell">
  247. <template slot="menuLeft" slot-scope="{size}">
  248. <el-button type="success" icon="el-icon-check" :size="size" @click="batchScheduling"
  249. :disabled="batchDuling" v-if="roleNameTwo.indexOf('总调度') === -1">批量调度
  250. </el-button>
  251. </template>
  252. <template slot="plateNo" slot-scope="{row}" v-if="!row.$cellEdit">
  253. <span class="el-button--text" style="cursor: pointer" @click="openTrack(row)">{{ row.plateNo }}</span>
  254. </template>
  255. <!-- <template slot-scope="{row}" slot="fleetId">-->
  256. <!-- <crop-select-->
  257. <!-- v-if="row.$cellEdit"-->
  258. <!-- v-model="row.fleetId"-->
  259. <!-- @getCorpData="(data)=>{getfleetIdT(data,row)}"-->
  260. <!-- corpType="CD"-->
  261. <!-- ></crop-select>-->
  262. <!-- <span v-else>{{ row.fleetName }}</span>-->
  263. <!-- </template>-->
  264. <template slot-scope="{row,index}" slot="menu">
  265. <el-button
  266. type="text"
  267. size="small"
  268. v-if="row.status===0"
  269. @click="rowSaveT(row,index)"
  270. >{{ row.$cellEdit ? '保 存' : '修 改' }}
  271. </el-button>
  272. <el-button
  273. size="small"
  274. type="text"
  275. @click="designate(row, index)"
  276. v-if="row.status === 0"
  277. >调 度
  278. </el-button>
  279. <el-button
  280. size="small"
  281. type="text"
  282. @click="cancelDesignate(row, index)"
  283. v-if="row.status===1"
  284. >取消调度
  285. </el-button>
  286. <el-button
  287. size="small"
  288. type="text"
  289. @click="changeFleetT(row, index)"
  290. v-if="row.status !== 0 || row.status !==1 || row.status !==4"
  291. >变 更
  292. </el-button>
  293. <el-button
  294. size="small"
  295. type="text"
  296. @click="recordsOfChanges(row, index)"
  297. v-if="row.status > 1"
  298. >变更记录
  299. </el-button>
  300. <el-button
  301. size="small"
  302. type="text"
  303. @click="annexOpen(row, index)"
  304. >附 件
  305. </el-button>
  306. <el-button
  307. type="text"
  308. size="small"
  309. v-if="row.status===0"
  310. @click="rowSaveThree(row,index)"
  311. >{{ row.$cellEdit ? '确认调度派车' : '调度派车' }}
  312. </el-button>
  313. </template>
  314. </avue-crud>
  315. </basic-container>
  316. <span>
  317. <!-- <containerTitle title="费用明细"></containerTitle>-->
  318. <!-- <basic-container>-->
  319. <!-- <el-tabs v-model="activeIndex" @tab-click="handleSelect">-->
  320. <!-- <el-tab-pane label="应收" name="1"></el-tab-pane>-->
  321. <!-- <el-tab-pane label="应付" name="2"></el-tab-pane>-->
  322. <!-- </el-tabs>-->
  323. <!-- <avue-crud-->
  324. <!-- v-if="activeIndex === '1'"-->
  325. <!-- :data="collectionList"-->
  326. <!-- :option="collectionOption"-->
  327. <!-- ref="collection"-->
  328. <!-- @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"-->
  329. <!-- @row-update="rowSave"-->
  330. <!-- @row-del="makeDel">-->
  331. <!-- <template slot-scope="{row}" slot="corpId">-->
  332. <!-- <crop-select-->
  333. <!-- v-if="row.$cellEdit"-->
  334. <!-- v-model="row.corpId"-->
  335. <!-- @getCorpData="(data)=>{getfleetId(data,row)}"-->
  336. <!-- ></crop-select>-->
  337. <!-- <span v-else>{{row.corpName}}</span>-->
  338. <!-- </template>-->
  339. <!-- <template slot-scope="{row}" slot="feeId">-->
  340. <!-- <breakdown-select-->
  341. <!-- v-if="row.$cellEdit"-->
  342. <!-- v-model="row.feeId"-->
  343. <!-- @selectValue="(value) => selectValue(value,row)"-->
  344. <!-- :configuration="breakConfiguration"-->
  345. <!-- >-->
  346. <!-- </breakdown-select>-->
  347. <!-- <span v-else>{{ row.feeName }}</span>-->
  348. <!-- </template>-->
  349. <!-- <template slot-scope="{row,index}" slot="menu">-->
  350. <!-- <el-button-->
  351. <!-- type="text"-->
  352. <!-- size="small"-->
  353. <!-- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"-->
  354. <!-- @click="rowCell(row,index)"-->
  355. <!-- >{{row.$cellEdit?'保存':'编辑'}}</el-button>-->
  356. <!-- <el-button type="text"-->
  357. <!-- icon="el-icon-delete"-->
  358. <!-- size="small"-->
  359. <!-- @click="$refs.collection.rowDel(row,index)"-->
  360. <!-- >删除</el-button>-->
  361. <!-- </template>-->
  362. <!-- <template slot="menuLeft">-->
  363. <!-- <el-button type="primary" icon="el-icon-plus" @click="addRowCollection" size="small">录入明细</el-button>-->
  364. <!-- </template>-->
  365. <!-- </avue-crud>-->
  366. <!-- <avue-crud-->
  367. <!-- v-if="activeIndex === '2'"-->
  368. <!-- :data="paymentList"-->
  369. <!-- :option="paymentOption"-->
  370. <!-- ref="payment"-->
  371. <!-- @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"-->
  372. <!-- @row-update="rowSave"-->
  373. <!-- @row-del="feeDel"-->
  374. <!-- >-->
  375. <!-- <template slot-scope="{row}" slot="corpId">-->
  376. <!-- <crop-select-->
  377. <!-- v-if="row.$cellEdit"-->
  378. <!-- v-model="row.corpId"-->
  379. <!-- @getCorpData="(data)=>{getfleetId(data,row)}"-->
  380. <!-- ></crop-select>-->
  381. <!-- <span v-else>{{row.corpName}}</span>-->
  382. <!-- </template>-->
  383. <!-- <template slot-scope="{row}" slot="feeId">-->
  384. <!-- <breakdown-select-->
  385. <!-- v-if="row.$cellEdit"-->
  386. <!-- v-model="row.feeId"-->
  387. <!-- @selectValue="(value) => selectValue(value,row)"-->
  388. <!-- :configuration="breakConfiguration"-->
  389. <!-- >-->
  390. <!-- </breakdown-select>-->
  391. <!-- <span v-else>{{ row.feeName }}</span>-->
  392. <!-- </template>-->
  393. <!-- <template slot-scope="{row,index}" slot="menu">-->
  394. <!-- <el-button-->
  395. <!-- type="text"-->
  396. <!-- size="small"-->
  397. <!-- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"-->
  398. <!-- @click="paymentRowCell(row,index)"-->
  399. <!-- >{{row.$cellEdit?'保存':'编辑'}}</el-button>-->
  400. <!-- <el-button type="text"-->
  401. <!-- icon="el-icon-delete"-->
  402. <!-- size="small"-->
  403. <!-- @click="$refs.payment.rowDel(row,index)"-->
  404. <!-- >删除</el-button>-->
  405. <!-- </template>-->
  406. <!-- <template slot="menuLeft">-->
  407. <!-- <el-button type="primary" icon="el-icon-plus" @click="addRowPayment" size="small">录入明细</el-button>-->
  408. <!-- </template>-->
  409. <!-- </avue-crud>-->
  410. <!-- </basic-container>-->
  411. </span>
  412. <containerTitle title="杂费明细"></containerTitle>
  413. <basic-container>
  414. <el-tabs v-model="activeIndex" @tab-click="handleSelect">
  415. <el-tab-pane label="应收" name="1" v-if="!(roleNameTwo.indexOf('调度中心业务员') !== -1 || roleNameTwo.indexOf('调度中心经理') !== -1)"></el-tab-pane>
  416. <el-tab-pane label="应付" name="2"></el-tab-pane>
  417. </el-tabs>
  418. <avue-crud
  419. v-if="activeIndex === '1'"
  420. :data="collectionList"
  421. :key="key"
  422. :option="collectionOption"
  423. ref="collection"
  424. @resetColumn="resetColumnCollection"
  425. @saveColumn="saveColumnCollection"
  426. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  427. @row-update="rowSave"
  428. @row-del="makeDel">
  429. <template slot-scope="{row}" slot="corpId">
  430. <crop-select
  431. v-if="row.$cellEdit"
  432. v-model="row.corpId"
  433. @getCorpData="(data)=>{getfleetId(data,row)}"
  434. ></crop-select>
  435. <span v-else>{{ row.corpName }}</span>
  436. </template>
  437. <template slot="plateNoHeader" slot-scope="{column}">
  438. {{ column.label }}<span style="color:#F56C6C">*</span>
  439. </template>
  440. <template slot="feeIdHeader" slot-scope="{column}">
  441. {{ column.label }}<span style="color:#F56C6C">*</span>
  442. </template>
  443. <template slot-scope="{row}" slot="feeId">
  444. <breakdown-select
  445. v-if="row.$cellEdit"
  446. v-model="row.feeId"
  447. @selectValue="(value) => selectValue(value,row)"
  448. :configuration="breakConfiguration"
  449. >
  450. </breakdown-select>
  451. <span v-else>{{ row.feeName }}</span>
  452. </template>
  453. <template slot-scope="{row,index}" slot="menu">
  454. <el-button
  455. type="text"
  456. size="small"
  457. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  458. @click="rowCell(row,index)"
  459. >{{ row.$cellEdit ? '保存' : '编辑' }}
  460. </el-button>
  461. <el-button type="text"
  462. icon="el-icon-delete"
  463. size="small"
  464. @click="$refs.collection.rowDel(row,index)"
  465. >删除
  466. </el-button>
  467. <el-button
  468. size="small"
  469. type="text"
  470. icon="el-icon-s-order"
  471. @click="annexOpen(row, index)"
  472. >附 件
  473. </el-button>
  474. </template>
  475. <template slot="menuLeft">
  476. <el-button
  477. v-if="roleNameTwo.indexOf('总调度') === -1"
  478. type="primary" icon="el-icon-plus" @click="addRowCollection"
  479. size="small">录入明细
  480. </el-button>
  481. </template>
  482. </avue-crud>
  483. <avue-crud
  484. v-if="activeIndex === '2'"
  485. :data="paymentList"
  486. :option="paymentOption"
  487. ref="payment"
  488. @resetColumn="resetColumnPayment"
  489. @saveColumn="saveColumnPayment"
  490. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  491. @row-update="rowSave"
  492. @row-del="feeDel"
  493. >
  494. <template slot-scope="{row}" slot="corpId">
  495. <crop-select
  496. v-if="row.$cellEdit"
  497. v-model="row.corpId"
  498. @getCorpData="(data)=>{getfleetId(data,row)}"
  499. ></crop-select>
  500. <span v-else>{{ row.corpName }}</span>
  501. </template>
  502. <template slot="plateNoHeader" slot-scope="{column}">
  503. {{ column.label }}<span style="color:#F56C6C">*</span>
  504. </template>
  505. <template slot="feeIdHeader" slot-scope="{column}">
  506. {{ column.label }}<span style="color:#F56C6C">*</span>
  507. </template>
  508. <template slot-scope="{row}" slot="feeId">
  509. <breakdown-select
  510. v-if="row.$cellEdit"
  511. v-model="row.feeId"
  512. @selectValue="(value) => selectValue(value,row)"
  513. :configuration="breakConfiguration"
  514. >
  515. </breakdown-select>
  516. <span v-else>{{ row.feeName }}</span>
  517. </template>
  518. <template slot-scope="{row,index}" slot="menu">
  519. <el-button
  520. type="text"
  521. size="small"
  522. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  523. @click="paymentRowCell(row,index)"
  524. >{{ row.$cellEdit ? '保存' : '编辑' }}
  525. </el-button>
  526. <el-button type="text"
  527. icon="el-icon-delete"
  528. size="small"
  529. :disabled="goodsForm.status === 1"
  530. @click="$refs.payment.rowDel(row,index)"
  531. >删除
  532. </el-button>
  533. <el-button
  534. size="small"
  535. type="text"
  536. icon="el-icon-s-order"
  537. @click="annexOpen(row, index)"
  538. >附 件
  539. </el-button>
  540. </template>
  541. <template slot="menuLeft">
  542. <el-button
  543. v-if="roleNameTwo.indexOf('总调度') === -1"
  544. v-show="!(roleNameTwo.indexOf('调度中心业务员') !== -1 || roleNameTwo.indexOf('调度中心经理') !== -1)"
  545. type="primary" icon="el-icon-plus" @click="addRowPayment"
  546. size="small">录入明细
  547. </el-button>
  548. </template>
  549. </avue-crud>
  550. </basic-container>
  551. <containerTitle title="上传附件"></containerTitle>
  552. <c-upload
  553. typeUpload="CD"
  554. :data="orderFilesList"
  555. display
  556. deleteUrl="/api/blade-client/common-file/remove"
  557. :enumerationValue="86.2"
  558. >
  559. <template slot="c_button">
  560. <el-button
  561. type="primary"
  562. size="small"
  563. :loading="c_button"
  564. @click="schedulingFileSaving"
  565. >保存附件
  566. </el-button>
  567. </template>
  568. </c-upload>
  569. <el-dialog
  570. title="批量调度"
  571. :visible.sync="dialogVisible"
  572. append-to-body
  573. width="70%">
  574. <avue-form :option="option" v-model="form" ref="form">
  575. <template slot="fleetId">
  576. <crop-select
  577. v-model="form.fleetId"
  578. corpType="CD"
  579. ></crop-select>
  580. </template>
  581. </avue-form>
  582. <span slot="footer" class="dialog-footer">
  583. <el-button @click="dialogVisible = false" size="small">取 消</el-button>
  584. <el-button type="primary" @click="saveScheduling" size="small">调 度</el-button>
  585. </span>
  586. </el-dialog>
  587. <el-dialog
  588. title="变更"
  589. :visible.sync="dialogChange"
  590. append-to-body
  591. width="70%">
  592. <avue-form :option="optionData" v-model="formData" ref="saveForm">
  593. <template slot="fleetId">
  594. <crop-select
  595. v-model="formData.fleetId"
  596. corpType="CD"
  597. :disabled="formData === 4"
  598. @getCorpData="getCorpData"
  599. ></crop-select>
  600. </template>
  601. </avue-form>
  602. <span slot="footer" class="dialog-footer">
  603. <el-button @click="dialogChange = false" size="small">关 闭</el-button>
  604. <el-button type="primary" @click="confirmChange" size="small">确 定</el-button>
  605. </span>
  606. </el-dialog>
  607. <el-dialog
  608. title="变更记录"
  609. :visible.sync="dialogRecord"
  610. append-to-body
  611. width="70%">
  612. <avue-crud :data="dataRecord" :option="optionRecord" style="margin-top: -43px"></avue-crud>
  613. <span slot="footer" class="dialog-footer">
  614. <el-button @click="dialogRecord = false" size="small">关 闭</el-button>
  615. </span>
  616. </el-dialog>
  617. <el-dialog
  618. title="附件"
  619. :visible.sync="enclosure"
  620. append-to-body
  621. width="70%">
  622. <c-upload
  623. typeUpload="GZ"
  624. :basic="true"
  625. deleteUrl="/api/blade-client/common-file/remove"
  626. :data="orderList"
  627. :enumerationValue="76"
  628. ></c-upload>
  629. <span slot="footer" class="dialog-footer">
  630. <el-button @click="enclosure = false" size="small">取 消</el-button>
  631. <el-button type="primary" @click="saveAnnex" size="small">保 存</el-button>
  632. </span>
  633. </el-dialog>
  634. <track-playback :dialogVisible="dialogVisibleTwo" :lineArr="lineArr" ref="playback"></track-playback>
  635. <report-dialog
  636. :switchDialog="switchDialog"
  637. :reportId="id"
  638. :reportName="reportName"
  639. @onClose="onClose()"
  640. />
  641. </div>
  642. </template>
  643. <script>
  644. import {getLazyTree} from "@/api/base/region";
  645. import {
  646. saveDelegationList,
  647. detailDelegationList,
  648. removeCollection,
  649. dispatchCollection,
  650. queryVehicle,
  651. cancelDispatchCollection,
  652. dispatchBatch,
  653. fleetDriverSave,
  654. recordingDetails,
  655. changeFleet,
  656. incidentalSubmit, saveFile, getFee, fleetList, conserveDispatch,
  657. checkAttachment, sendACarCollection, generateBill, saveSaveList
  658. } from "@/api/landTransportation";
  659. import website from "@/config/website";
  660. import {getDeptTree} from "@/api/system/dept";
  661. import {customerList} from "@/api/basicData/basicFeesDesc";
  662. import {gaude, location} from "@/api/gaude";
  663. import reportDialog from "@/components/report-dialog/main.vue";
  664. export default {
  665. components: {reportDialog},
  666. props: {
  667. id: {
  668. type: String
  669. },
  670. home: {
  671. type: Boolean
  672. }
  673. },
  674. data() {
  675. return {
  676. // 打印组件
  677. switchDialog: false,
  678. reportName: '',
  679. // 预估费用参数
  680. yugudata:[],
  681. yuguoption:{},
  682. yuguoptionpz:{
  683. addBtn: false,
  684. menu: true,
  685. addRowBtn: false,
  686. cellBtn: true,
  687. // 编辑按钮
  688. editBtn:false,
  689. // 保存按钮
  690. saveBtn:false,
  691. column:[{
  692. label: '车队',
  693. search: false,
  694. index: 1,
  695. showColumn: false,
  696. filterable: true,
  697. type: 'select',
  698. overHidden: true,
  699. prop: 'fleetId',
  700. dicUrl: "/api/blade-client/corpsdesc/fleetList",
  701. props: {
  702. label: "cname",
  703. value: "id"
  704. },
  705. cell: true
  706. },{
  707. label:'预估运费',
  708. prop:'freightAmount',
  709. index: 2,
  710. cell: true,
  711. },{
  712. label:'杂费',
  713. prop:'miscellaneousAmount',
  714. index:3,
  715. slot: true,
  716. cell: true,
  717. },{
  718. label:'利润',
  719. prop:'profitAmount',
  720. index:4,
  721. disabled:true,
  722. cell: true,
  723. }]
  724. },
  725. formData: {},
  726. enclosure: false,
  727. dialogVisibleTwo: false,
  728. lineArr: [],
  729. formAnnex: {},
  730. key: 0,
  731. formDataList: {},
  732. orderList: [],
  733. dialogChange: false,
  734. optionData: {
  735. span: 12,
  736. menuBtn: false,
  737. column: [{
  738. label: "车队",
  739. prop: "fleetId",
  740. }, {
  741. label: "应付陆运费",
  742. prop: "landAmountC",
  743. precision: 2,
  744. controls: false,
  745. type: 'number',
  746. }]
  747. },
  748. form: {},
  749. dataRecord: [],
  750. dialogRecord: false,
  751. optionRecord: {
  752. stripe: true,
  753. refreshBtn: false,
  754. columnBtn: false,
  755. menu: false,
  756. addBtn: false,
  757. align: 'center',
  758. column: [
  759. {
  760. label: '变更内容',
  761. prop: 'content'
  762. }, {
  763. label: '变更人',
  764. prop: 'changeUserName'
  765. }, {
  766. label: '变更时间',
  767. prop: 'changeTime'
  768. }
  769. ]
  770. },
  771. option: {
  772. span: 12,
  773. menuBtn: false,
  774. column: [{
  775. label: "车队",
  776. prop: "fleetId",
  777. rules: [{
  778. required: true,
  779. message: " ",
  780. trigger: "blur"
  781. }]
  782. }, {
  783. label: "应付陆运费",
  784. prop: "landAmountC",
  785. precision: 2,
  786. controls: false,
  787. type: 'number',
  788. }]
  789. },
  790. dialogVisible: false,
  791. c_button: false,
  792. goodsForm: {},
  793. orderFilesList: [],
  794. selectionList: [],
  795. roleName: localStorage.getItem("roleName").split(',')[0],
  796. roleNameTwo: localStorage.getItem("roleName").split(','),
  797. activeIndex: '1',
  798. batchDuling: true,
  799. breakConfiguration: {
  800. multipleChoices: false,
  801. multiple: false,
  802. disabled: false,
  803. searchShow: true,
  804. collapseTags: false,
  805. clearable: true,
  806. placeholder: '请点击右边按钮选择',
  807. dicData: []
  808. },
  809. advantageProjectData: [],
  810. treeOption: {
  811. label: 'title',
  812. value: 'id',
  813. lazy: true,
  814. lazyLoad(node, resolve) {
  815. const parentId = node.level === 0 ? '00' : node.data.id;
  816. getLazyTree(parentId).then(res => {
  817. resolve(
  818. res.data.data.map(item => {
  819. return {
  820. ...item,
  821. leaf: !item.hasChildren
  822. };
  823. })
  824. );
  825. });
  826. }
  827. },
  828. tableData: [],
  829. entrustListT: [],
  830. KeyBoxTwo: 0,
  831. entrustOptionTwoTBackup: {
  832. selectable: (row, index) => {
  833. return row.status === 0
  834. },
  835. align: 'center',
  836. menuAlign: 'center',
  837. index: true,
  838. cellBtn: false,
  839. refreshBtn: false,
  840. selection: true,
  841. selectionWidth: 55,
  842. menu: true,
  843. tip: false,
  844. addBtn: false,
  845. cancelBtn: false,
  846. editBtn: false,
  847. addRowBtn: false,
  848. delBtn: false,
  849. showSummary: true,
  850. // editBtn:false,
  851. summaryText: "合计",
  852. sumColumnList: [
  853. {
  854. name: 'landWeight',
  855. type: 'sum',
  856. decimals: 2
  857. }, {
  858. name: 'landAmountC',
  859. type: 'sum',
  860. decimals: 2
  861. }, {
  862. name: 'landAmountD',
  863. type: 'sum',
  864. decimals: 2
  865. }, {
  866. name: 'oneFeeD',
  867. type: 'sum',
  868. decimals: 2
  869. }, {
  870. name: 'twoFeeD',
  871. type: 'sum',
  872. decimals: 2
  873. }, {
  874. name: 'threeFeeD',
  875. type: 'sum',
  876. decimals: 2
  877. }, {
  878. name: 'fourFeeD',
  879. type: 'sum',
  880. decimals: 2
  881. }, {
  882. name: 'fiveFeeD',
  883. type: 'sum',
  884. decimals: 2
  885. }, {
  886. name: 'oneFeeC',
  887. type: 'sum',
  888. decimals: 2
  889. }, {
  890. name: 'twoFeeC',
  891. type: 'sum',
  892. decimals: 2
  893. }, {
  894. name: 'threeFeeC',
  895. type: 'sum',
  896. decimals: 2
  897. }, {
  898. name: 'fourFeeC',
  899. type: 'sum',
  900. decimals: 2
  901. }, {
  902. name: 'fiveFeeC',
  903. type: 'sum',
  904. decimals: 2
  905. }, {
  906. name: 'landAmountD',
  907. type: 'sum',
  908. decimals: 2
  909. }, {
  910. name: 'ctnQuantity',
  911. type: 'sum',
  912. decimals: 0
  913. }],
  914. column: [{
  915. label: '货运日期',
  916. type: "datetime",
  917. cell: true,
  918. format: 'yyyy-MM-dd HH:mm',
  919. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  920. width: 200,
  921. index: 1,
  922. prop: 'arrivalTime'
  923. }, {
  924. label: '实际到厂时间',
  925. prop: 'realArrivalTime',
  926. overHidden: true,
  927. type: "date",
  928. searchRange: true,
  929. defaultTime: ['00:00:00', '23:59:59'],
  930. format: "yyyy-MM-dd HH:mm",
  931. valueFormat: "yyyy-MM-dd HH:mm:ss",
  932. index: 2,
  933. width: 140,
  934. },
  935. {
  936. label: '车型',
  937. width: 100,
  938. slot: true,
  939. index: 3,
  940. prop: 'ctnType'
  941. }, {
  942. label: '车辆数',
  943. width: 50,
  944. index: 4,
  945. prop: 'ctnQuantity'
  946. },
  947. {
  948. label: '车队',
  949. width: 200,
  950. index: 5,
  951. type: 'select',
  952. cascader: ['plateNo'],
  953. overHidden: true,
  954. cell: true,
  955. prop: 'fleetId',
  956. dicUrl: "/api/blade-client/corpsdesc/list?size=1000&current=1&&corpType=CD",
  957. props: {
  958. label: "cname",
  959. value: "id",
  960. res: "data.records"
  961. }
  962. }, {
  963. label: '车号',
  964. width: 150,
  965. index: 6,
  966. cell: false,
  967. prop: 'plateNo',
  968. type: "select",
  969. dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
  970. props: {
  971. label: "plateNo",
  972. value: "plateNo"
  973. },
  974. }, {
  975. label: '司机',
  976. width: 115,
  977. index: 7,
  978. prop: 'driverName'
  979. }, {
  980. label: '电话',
  981. width: 160,
  982. index: 8,
  983. prop: 'tel'
  984. }, {
  985. label: '完工日期',
  986. prop: 'finishedTime',
  987. overHidden: true,
  988. type: "date",
  989. searchRange: true,
  990. defaultTime: ['00:00:00', '23:59:59'],
  991. format: "yyyy-MM-dd HH:mm",
  992. valueFormat: "yyyy-MM-dd HH:mm:ss",
  993. index: 9,
  994. width: 140,
  995. }, {
  996. label: '货物名称',
  997. overHidden: true,
  998. width: 160,
  999. index: 10,
  1000. prop: 'goods'
  1001. }, {
  1002. label: '件数',
  1003. width: 100,
  1004. overHidden: true,
  1005. controls: false,
  1006. cell: true,
  1007. index: 11,
  1008. prop: 'quantity',
  1009. type: 'number',
  1010. precision: 0
  1011. }
  1012. // , {
  1013. // label: '包装',
  1014. // width: 100,
  1015. // overHidden: true,
  1016. // cell: true,
  1017. // prop: 'packing',
  1018. // type: 'select',
  1019. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  1020. // props: {
  1021. // label: "dictValue",
  1022. // value: "dictValue"
  1023. // },
  1024. // }
  1025. , {
  1026. label: '重量',
  1027. width: 160,
  1028. prop: 'landWeight',
  1029. controls: false,
  1030. precision: 2,
  1031. index: 12,
  1032. type: 'number'
  1033. }, {
  1034. label: '尺码',
  1035. width: 100,
  1036. overHidden: true,
  1037. cell: true,
  1038. index: 13,
  1039. prop: 'size',
  1040. }, {
  1041. label: '运费',
  1042. index: 14,
  1043. prop: 'landAmountD'
  1044. },
  1045. {
  1046. label: '状态',
  1047. width: 100,
  1048. index: 15,
  1049. type: 'select',
  1050. dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
  1051. props: {
  1052. label: "dictValue",
  1053. value: "dictKey"
  1054. },
  1055. dataType: "string",
  1056. prop: 'status'
  1057. }, {
  1058. label: '应付陆运费',
  1059. cell: true,
  1060. index: 16,
  1061. prop: 'landAmountC'
  1062. }, {
  1063. label: '委托备注',
  1064. width: 245,
  1065. index: 17,
  1066. prop: 'remarks'
  1067. }, {
  1068. label: '车队备注',
  1069. width: 245,
  1070. index: 18,
  1071. prop: 'fleetRemarks'
  1072. }, {
  1073. label: '司机备注',
  1074. width: 245,
  1075. index: 19,
  1076. prop: 'driverRemarks'
  1077. },
  1078. // {
  1079. // label: '应收场站费',
  1080. // width: 100,
  1081. // precision: 2,
  1082. // index: 20,
  1083. // controls: false,
  1084. // cell: true,
  1085. // type: 'number',
  1086. // prop: 'oneFeeD'
  1087. // }, {
  1088. // label: '应收港杂费',
  1089. // width: 100,
  1090. // precision: 2,
  1091. // cell: true,
  1092. // index: 21,
  1093. // controls: false,
  1094. // type: 'number',
  1095. // prop: 'twoFeeD'
  1096. // }, {
  1097. // label: '应收扣款',
  1098. // width: 100,
  1099. // index: 22,
  1100. // precision: 2,
  1101. // cell: true,
  1102. // controls: false,
  1103. // type: 'number',
  1104. // prop: 'threeFeeD'
  1105. // }, {
  1106. // label: '应收待时费',
  1107. // width: 100,
  1108. // precision: 2,
  1109. // index: 23,
  1110. // cell: true,
  1111. // controls: false,
  1112. // type: 'number',
  1113. // prop: 'fourFeeD'
  1114. // }, {
  1115. // label: '应收其他',
  1116. // width: 100,
  1117. // index: 24,
  1118. // precision: 2,
  1119. // cell: true,
  1120. // type: 'number',
  1121. // controls: false,
  1122. // prop: 'fiveFeeD'
  1123. // }, {
  1124. // label: '应收费用备注',
  1125. // width: 245,
  1126. // index: 25,
  1127. // cell: true,
  1128. // prop: 'feeRemarksD'
  1129. // }, {
  1130. // label: '应付场站费',
  1131. // width: 100,
  1132. // index: 26,
  1133. // precision: 2,
  1134. // cell: true,
  1135. // controls: false,
  1136. // type: 'number',
  1137. // prop: 'oneFeeC'
  1138. // }, {
  1139. // label: '应付港杂费',
  1140. // width: 100,
  1141. // precision: 2,
  1142. // index: 27,
  1143. // cell: true,
  1144. // controls: false,
  1145. // type: 'number',
  1146. // prop: 'twoFeeC'
  1147. // }, {
  1148. // label: '应付扣款',
  1149. // width: 100,
  1150. // index: 28,
  1151. // precision: 2,
  1152. // controls: false,
  1153. // type: 'number',
  1154. // cell: true,
  1155. // prop: 'threeFeeC'
  1156. // }, {
  1157. // label: '应付待时费',
  1158. // width: 100,
  1159. // precision: 2,
  1160. // index: 29,
  1161. // controls: false,
  1162. // cell: true,
  1163. // type: 'number',
  1164. // prop: 'fourFeeC'
  1165. // }, {
  1166. // label: '应付其他',
  1167. // width: 100,
  1168. // precision: 2,
  1169. // index: 30,
  1170. // type: 'number',
  1171. // cell: true,
  1172. // controls: false,
  1173. // prop: 'fiveFeeC'
  1174. // }, {
  1175. // label: '应付费用备注',
  1176. // width: 245,
  1177. // index: 31,
  1178. // cell: true,
  1179. // prop: 'feeRemarksC'
  1180. // }
  1181. ]
  1182. },
  1183. entrustOptionTwoT: {},
  1184. entrustList: [],
  1185. goodsOptionForm: {
  1186. menuBtn: false,
  1187. disabled: true,
  1188. span: 8,
  1189. column: [{
  1190. label: '公司名称',
  1191. formslot: true,
  1192. prop: 'corpId',
  1193. rules: [{
  1194. required: true,
  1195. message: " ",
  1196. trigger: "change"
  1197. }],
  1198. }, {
  1199. label: '所属部门',
  1200. prop: 'salesmanDept',
  1201. type: "tree",
  1202. filter: false,
  1203. dicData: [],
  1204. props: {
  1205. label: "title"
  1206. }
  1207. }, {
  1208. label: '业务员',
  1209. prop: 'salesman',
  1210. type: "select",
  1211. dicUrl: "/api/blade-user/userList",
  1212. props: {
  1213. label: "realName",
  1214. value: "id"
  1215. },
  1216. rules: [{
  1217. required: true,
  1218. message: " ",
  1219. trigger: "blur"
  1220. }]
  1221. }, {
  1222. label: '物流运输',
  1223. prop: 'dispatchDept',
  1224. cascader: ['dispatcher'],
  1225. dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
  1226. type: "select",
  1227. props: {
  1228. label: "deptName",
  1229. value: "id"
  1230. },
  1231. rules: [{
  1232. required: true,
  1233. message: " ",
  1234. trigger: "blur"
  1235. }]
  1236. }, {
  1237. label: '运输调度',
  1238. prop: 'dispatcher',
  1239. type: "select",
  1240. dicUrl: "/api/blade-user/deptUserList?deptPid={{key}}",
  1241. props: {
  1242. label: "realName",
  1243. value: "id"
  1244. }
  1245. }, {
  1246. label: '委托日期',
  1247. prop: 'bsDate',
  1248. type: "datetime",
  1249. format: 'yyyy-MM-dd HH:mm',
  1250. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1251. }, {
  1252. label: '票据号',
  1253. prop: 'receiptNo'
  1254. }, {
  1255. label: '联系电话',
  1256. prop: 'tel'
  1257. }, {
  1258. label: '业务号',
  1259. prop: 'billNo',
  1260. rules: [{
  1261. required: true,
  1262. message: " ",
  1263. trigger: "blur"
  1264. }],
  1265. }, {
  1266. label: '场站',
  1267. prop: 'station',
  1268. // rules: [{
  1269. // required: true,
  1270. // message: " ",
  1271. // trigger: "blur"
  1272. // }],
  1273. },
  1274. // {
  1275. // label: '货运日期',
  1276. // type: "datetime",
  1277. // format: 'yyyy-MM-dd HH:mm:ss',
  1278. // valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1279. // prop: 'arrivalTime',
  1280. // rules: [{
  1281. // required: true,
  1282. // message: " ",
  1283. // trigger: "blur"
  1284. // }],
  1285. // },
  1286. {
  1287. label: '风险等级',
  1288. prop: 'riskLevel',
  1289. type: "select",
  1290. dicUrl: "/api/blade-system/dict-biz/dictionary?code=level",
  1291. props: {
  1292. label: "dictValue",
  1293. value: "dictKey"
  1294. }
  1295. },{
  1296. label: '难度等级',
  1297. prop: 'difficultyLevel',
  1298. type: "select",
  1299. dicUrl: "/api/blade-system/dict-biz/dictionary?code=level",
  1300. props: {
  1301. label: "dictValue",
  1302. value: "dictKey"
  1303. }
  1304. }, {
  1305. label: '货物',
  1306. span: 24,
  1307. minRows: 2,
  1308. prop: 'goods',
  1309. type: 'textarea'
  1310. },
  1311. {
  1312. label: '备注',
  1313. span: 24,
  1314. minRows: 2,
  1315. prop: 'remarks',
  1316. type: 'textarea'
  1317. }]
  1318. },
  1319. goodsOptionFormTwo: {
  1320. menuBtn: false,
  1321. disabled: true,
  1322. span: 8,
  1323. column: [
  1324. // {
  1325. // label: '所属公司',
  1326. // formslot: true,
  1327. // prop: 'belongCompany',
  1328. // rules: [{
  1329. // required: false,
  1330. // message: " ",
  1331. // trigger: "blur"
  1332. // }],
  1333. // },
  1334. {
  1335. label: '船名航次',
  1336. prop: 'factory',
  1337. rules: [{
  1338. required: false,
  1339. message: " ",
  1340. trigger: "blur"
  1341. }],
  1342. }
  1343. // , {
  1344. // label: '货物名称',
  1345. // prop: 'goods',
  1346. // rules: [{
  1347. // required: false,
  1348. // message: " ",
  1349. // trigger: "blur"
  1350. // }],
  1351. // }
  1352. , {
  1353. label: '开船日期',
  1354. prop: 'etd',
  1355. type: 'date'
  1356. }, {
  1357. label: '预配箱量',
  1358. prop: 'expectCtnQty',
  1359. }, {
  1360. label: '起运港',
  1361. prop: 'polId'
  1362. }, {
  1363. label: '目的港',
  1364. prop: 'podId'
  1365. }, {
  1366. label: '截港日期',
  1367. prop: 'etc',
  1368. type: 'date'
  1369. }, {
  1370. label: '截单日期',
  1371. prop: 'siCutoffDate',
  1372. type: 'date'
  1373. }, {
  1374. label: '订舱代理',
  1375. prop: 'agentId'
  1376. }]
  1377. },
  1378. entrustOptionTwo: {
  1379. align: 'center',
  1380. menuAlign: 'center',
  1381. addBtnText: '录入箱信息',
  1382. index: true,
  1383. cellBtn: true,
  1384. addBtn: false,
  1385. addRowBtn: true,
  1386. showSummary: true,
  1387. summaryText: "合计",
  1388. sumColumnList: [
  1389. {
  1390. name: 'landWeight',
  1391. type: 'sum',
  1392. decimals: 2
  1393. }, {
  1394. name: 'landAmountD',
  1395. type: 'sum',
  1396. decimals: 2
  1397. }, {
  1398. name: 'ctnQuantity',
  1399. type: 'sum',
  1400. decimals: 7
  1401. }],
  1402. column: [{
  1403. label: '尺寸箱型',
  1404. cell: true,
  1405. prop: 'ctnType',
  1406. type: 'select',
  1407. width: 100,
  1408. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  1409. props: {
  1410. label: "dictValue",
  1411. value: "dictKey"
  1412. }
  1413. }, {
  1414. label: '箱量',
  1415. cell: true,
  1416. prop: 'ctnQuantity',
  1417. controls: false,
  1418. precision: 0,
  1419. width: 100,
  1420. type: 'number'
  1421. }, {
  1422. label: '总重量(吨)',
  1423. cell: true,
  1424. prop: 'landWeight',
  1425. controls: false,
  1426. width: 200,
  1427. precision: 2,
  1428. type: 'number'
  1429. }, {
  1430. label: '单柜运费',
  1431. cell: true,
  1432. prop: 'landAmountD',
  1433. controls: false,
  1434. width: 200,
  1435. precision: 2,
  1436. type: 'number'
  1437. }, {
  1438. label: '备注',
  1439. cell: true,
  1440. width: 200,
  1441. prop: 'remarks'
  1442. }
  1443. ]
  1444. },
  1445. collectionList: [],
  1446. collectionOption: {},
  1447. collectionOptionBackup: {
  1448. align: 'center',
  1449. menuAlign: 'center',
  1450. index: true,
  1451. cancelBtn: false,
  1452. editBtn: false,
  1453. delBtn: false,
  1454. cellBtn: false,
  1455. addBtn: false,
  1456. addRowBtn: false,
  1457. showSummary: true,
  1458. addBtnText: '录入明细',
  1459. summaryText: "合计",
  1460. sumColumnList: [{
  1461. name: 'price',
  1462. type: 'sum',
  1463. decimals: 2
  1464. }, {
  1465. name: 'amount',
  1466. type: 'sum',
  1467. decimals: 2
  1468. }, {
  1469. name: 'quantity',
  1470. type: 'sum',
  1471. decimals: 1
  1472. }],
  1473. column: [{
  1474. label: '客户名称',
  1475. slot: true,
  1476. width: 300,
  1477. prop: 'corpId'
  1478. }, {
  1479. label: '车号',
  1480. cell: true,
  1481. prop: 'plateNo',
  1482. type: "select",
  1483. props: {
  1484. label: "label",
  1485. value: "label"
  1486. },
  1487. }, {
  1488. label: '费用名称',
  1489. slot: true,
  1490. width: 200,
  1491. prop: 'feeId'
  1492. }, {
  1493. label: '计价单位',
  1494. cell: true,
  1495. prop: 'unit',
  1496. type: "select",
  1497. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  1498. props: {
  1499. label: "dictValue",
  1500. value: "dictKey"
  1501. }
  1502. }, {
  1503. label: '单价',
  1504. cell: true,
  1505. type: 'number',
  1506. controls: false,
  1507. prop: 'price'
  1508. }, {
  1509. label: '数量',
  1510. cell: true,
  1511. controls: false,
  1512. type: 'number',
  1513. prop: 'quantity'
  1514. }, {
  1515. label: '金额',
  1516. cell: true,
  1517. type: 'number',
  1518. controls: false,
  1519. prop: 'amount'
  1520. }, {
  1521. label: '税率',
  1522. cell: true,
  1523. prop: 'taxRate'
  1524. }, {
  1525. label: '币别',
  1526. cell: true,
  1527. prop: 'currency',
  1528. type: "select",
  1529. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  1530. props: {
  1531. label: "dictValue",
  1532. value: "dictKey"
  1533. },
  1534. }
  1535. ]
  1536. },
  1537. paymentList: [],
  1538. paymentOption: {},
  1539. paymentOptionBackup: {
  1540. align: 'center',
  1541. menuAlign: 'center',
  1542. index: true,
  1543. cancelBtn: false,
  1544. editBtn: false,
  1545. delBtn: false,
  1546. cellBtn: false,
  1547. addBtn: false,
  1548. addRowBtn: false,
  1549. showSummary: true,
  1550. addBtnText: '录入明细',
  1551. summaryText: "合计",
  1552. sumColumnList: [{
  1553. name: 'price',
  1554. type: 'sum',
  1555. decimals: 2
  1556. }, {
  1557. name: 'amount',
  1558. type: 'sum',
  1559. decimals: 2
  1560. }, {
  1561. name: 'quantity',
  1562. type: 'sum',
  1563. decimals: 1
  1564. }],
  1565. column: [{
  1566. label: '客户名称',
  1567. cell: true,
  1568. width: 300,
  1569. prop: 'fleetId',
  1570. type: "select",
  1571. cascader: ['plateNo'],
  1572. props: {
  1573. label: "fleetName",
  1574. value: "fleetId"
  1575. },
  1576. change: (data) => {
  1577. data.row.plateNo = ''
  1578. }
  1579. },
  1580. // {
  1581. // label: '客户名称',
  1582. // slot: true,
  1583. // width: 300,
  1584. // prop: 'corpId'
  1585. // },
  1586. {
  1587. label: '车号',
  1588. cell: true,
  1589. prop: 'plateNo',
  1590. type: "select",
  1591. props: {
  1592. label: "label",
  1593. value: "label"
  1594. }
  1595. }, {
  1596. label: '费用名称',
  1597. slot: true,
  1598. width: 200,
  1599. prop: 'feeId'
  1600. }, {
  1601. label: '计价单位',
  1602. cell: true,
  1603. prop: 'unit',
  1604. type: "select",
  1605. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  1606. props: {
  1607. label: "dictValue",
  1608. value: "dictKey"
  1609. }
  1610. }, {
  1611. label: '单价',
  1612. cell: true,
  1613. controls: false,
  1614. type: 'number',
  1615. prop: 'price',
  1616. }, {
  1617. label: '数量',
  1618. cell: true,
  1619. controls: false,
  1620. type: 'number',
  1621. prop: 'quantity'
  1622. }, {
  1623. label: '金额',
  1624. cell: true,
  1625. controls: false,
  1626. type: 'number',
  1627. prop: 'amount'
  1628. }, {
  1629. label: '税率',
  1630. cell: true,
  1631. prop: 'taxRate'
  1632. }, {
  1633. label: '币别',
  1634. cell: true,
  1635. prop: 'currency',
  1636. type: "select",
  1637. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  1638. props: {
  1639. label: "dictValue",
  1640. value: "dictKey"
  1641. },
  1642. },
  1643. ]
  1644. }
  1645. };
  1646. },
  1647. watch: {
  1648. goodsForm: {
  1649. handler(newValue, oldValue) {
  1650. if (this.roleNameTwo.indexOf('调度中心业务员') !== -1 || this.roleNameTwo.indexOf('调度中心经理') !== -1){
  1651. this.paymentOption.menu = false
  1652. this.findObject(this.entrustOptionTwoT.column, "landAmountD").hide = true
  1653. this.findObject(this.entrustOptionTwoT.column, "landAmountD").showColumn = false
  1654. }
  1655. }
  1656. },
  1657. entrustOptionTwoT: {
  1658. handler(newValue, oldValue) {
  1659. if (this.roleNameTwo.indexOf('调度中心业务员') !== -1 || this.roleNameTwo.indexOf('调度中心经理') !== -1){
  1660. this.paymentOption.menu = false
  1661. this.findObject(this.entrustOptionTwoT.column, "landAmountD").hide = true
  1662. this.findObject(this.entrustOptionTwoT.column, "landAmountD").showColumn = false
  1663. }
  1664. }
  1665. }
  1666. },
  1667. async created() {
  1668. this.refreshData()
  1669. this.activeIndex = this.roleNameTwo.indexOf('调度中心业务员') !== -1?'2':this.roleNameTwo.indexOf('调度中心经理') !== -1?'2':'1'
  1670. this.entrustOptionTwoT = await this.getColumnData(this.getColumnName(86.1), this.entrustOptionTwoTBackup);
  1671. this.collectionOption = await this.getColumnData(this.getColumnName(86.4), this.collectionOptionBackup);
  1672. this.paymentOption = await this.getColumnData(this.getColumnName(86.5), this.paymentOptionBackup);
  1673. // 预估费用
  1674. // this.yuguoption = await this.getColumnData(this.getColumnName(86.6), this.yuguoptionpz);
  1675. this.KeyBoxTwo++
  1676. this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.id
  1677. this.findObject(this.paymentOption.column, "plateNo").dicUrl = "api/blade-land/order-fee/plate-no?orderId=" + this.id + '&fleetId={{key}}'
  1678. this.findObject(this.paymentOption.column, "plateNo").dicFormatter = (data) => {
  1679. let list = []
  1680. data.data.forEach(ele => {
  1681. list.push({label: ele})
  1682. })
  1683. return list
  1684. }
  1685. if (this.findObject(this.collectionOption.column, "price") != -1) {
  1686. this.findObject(this.collectionOption.column, "price").change = (data) => {
  1687. if (data.row.price && data.row.quantity) {
  1688. data.row.amount = Number(data.row.price) * Number(data.row.quantity)
  1689. }
  1690. }
  1691. this.findObject(this.collectionOption.column, "quantity").change = (data) => {
  1692. if (data.row.price && data.row.quantity) {
  1693. data.row.amount = Number(data.row.price) * Number(data.row.quantity)
  1694. }
  1695. }
  1696. this.findObject(this.paymentOption.column, "price").change = (data) => {
  1697. console.log(data)
  1698. if (data.row.price && data.row.quantity) {
  1699. data.row.amount = Number(data.row.price) * Number(data.row.quantity)
  1700. }
  1701. }
  1702. this.findObject(this.paymentOption.column, "quantity").change = (data) => {
  1703. if (data.row.price && data.row.quantity) {
  1704. data.row.amount = Number(data.row.price) * Number(data.row.quantity)
  1705. }
  1706. }
  1707. }
  1708. this.KeyBoxTwo++
  1709. if (this.id) {
  1710. detailDelegationList({id: this.id, kind: '2'}).then(res => {
  1711. this.goodsForm = res.data.data
  1712. this.tableData = res.data.data.orderAddressList
  1713. this.entrustList = res.data.data.orderItemList
  1714. this.goodsList = res.data.data.orderItemList
  1715. this.orderFilesList = res.data.data.fileList
  1716. if (res.data.data.orderFeeList.length > 0) {
  1717. res.data.data.orderFeeList.forEach(item => {
  1718. if (item.type == 1) {
  1719. this.collectionList.push(item)
  1720. } else {
  1721. this.paymentList.push(item)
  1722. }
  1723. })
  1724. }
  1725. delete this.goodsForm.orderAddressList
  1726. delete this.goodsForm.orderItemList
  1727. delete this.goodsForm.orderFeeList
  1728. // this.tableData.forEach(item => {
  1729. // if (item.region) item.region = item.region.split(',')
  1730. // })
  1731. if (this.roleNameTwo.indexOf('总调度') !== -1) {
  1732. this.entrustOptionTwoT.menu = false
  1733. this.collectionOption.menu = false
  1734. this.paymentOption.menu = false
  1735. }
  1736. })
  1737. }
  1738. this.KeyBoxTwo++
  1739. this.findObject(this.entrustOptionTwoT.column, "plateNo").change = (data) => {
  1740. fleetList({fleetId: data.row.fleetId}).then(res => {
  1741. for (let item in res.data.data) {
  1742. if (data.value === res.data.data[item].plateNo) {
  1743. this.entrustList[data.index].driverId = res.data.data[item].driverId
  1744. this.entrustList[data.index].driverName = res.data.data[item].driverName
  1745. this.entrustList[data.index].tel = res.data.data[item].tel
  1746. }
  1747. }
  1748. })
  1749. }
  1750. queryVehicle({orderId: this.id}).then(res => {
  1751. const column = this.findObject(this.collectionOption.column, "plateNo");
  1752. column.dicData = []
  1753. res.data.data.forEach(item => {
  1754. column.dicData.push({label: item})
  1755. })
  1756. this.key++
  1757. });
  1758. // this.findObject(this.paymentOption.column, "plateNo").change = (data) => {
  1759. // const columnTwo = this.findObject(this.paymentOption.column, "plateNo");
  1760. // columnTwo.dicData = []
  1761. // queryVehicle({orderId: this.id,fleetId:data.row.fleetId}).then(res => {
  1762. // res.data.data.forEach(item => {
  1763. // columnTwo.dicData.push({label: item})
  1764. // })
  1765. // });
  1766. // this.key++
  1767. // }
  1768. this.$refs.other.show = false
  1769. // 非租户模式默认加载管理组数据
  1770. if (!website.tenantMode) {
  1771. this.initData(website.tenantId);
  1772. } else {
  1773. this.initData();
  1774. }
  1775. this.KeyBoxTwo++
  1776. },
  1777. methods: {
  1778. // 保存按钮事件
  1779. diaodubaocun(){
  1780. let data = JSON.parse(JSON.stringify(this.tableData))
  1781. // data.forEach((item, index) => {
  1782. // item.sort = index + 1
  1783. // })
  1784. const orderEstimateList = this.yugudata.map(item=>{
  1785. return {
  1786. id:item.id,
  1787. fleetId:item.fleetId,
  1788. fleetName:item.fleetName,
  1789. freightAmount:item.freightAmount,
  1790. miscellaneousAmount:item.miscellaneousAmount,
  1791. profitAmount:item.profitAmount
  1792. }
  1793. })
  1794. console.log(orderEstimateList)
  1795. // this.type = true
  1796. saveSaveList({
  1797. ...this.goodsForm,
  1798. // kind: '2',
  1799. orderAddressList: data,
  1800. // 预估信息
  1801. orderEstimateList:orderEstimateList,
  1802. // 车辆信息
  1803. orderItemList: this.entrustList,
  1804. orderFeeList: this.collectionList.concat(this.paymentList)
  1805. }).then(res => {
  1806. this.$message.success('保存成功');
  1807. console.log(res)
  1808. if (!this.goodsForm.id) {
  1809. this.id = res.data.data
  1810. this.refreshData()
  1811. } else {
  1812. this.refreshData()
  1813. }
  1814. })
  1815. },
  1816. // 更新账单
  1817. updateFee(){
  1818. const loading = this.$loading({
  1819. lock: true,
  1820. text: '加载中',
  1821. spinner: 'el-icon-loading',
  1822. background: 'rgba(255,255,255,0.7)'
  1823. });
  1824. generateBill({id:this.goodsForm.id}).then(res=>{
  1825. this.$message.success("更新账单成功")
  1826. loading.close();
  1827. }).catch(()=>{
  1828. loading.close();
  1829. })
  1830. },
  1831. // 打印
  1832. openReport(){
  1833. if (this.id) {
  1834. this.$confirm("是否打印数据?", {
  1835. confirmButtonText: "确定",
  1836. cancelButtonText: "取消",
  1837. type: "warning"
  1838. }).then(() => {
  1839. this.reportName = "陆运-大件运输"
  1840. this.switchDialog = true
  1841. })
  1842. }
  1843. },
  1844. // 打印报表关闭
  1845. onClose(val) {
  1846. this.switchDialog = val;
  1847. },
  1848. schedulingFileSaving() {
  1849. this.c_button = true
  1850. conserveDispatch({
  1851. fileList: this.orderFilesList,
  1852. id: this.goodsForm.id
  1853. }).then(res => {
  1854. checkAttachment({id: this.goodsForm.id}).then(res => {
  1855. this.orderFilesList = res.data.data
  1856. this.c_button = false
  1857. })
  1858. })
  1859. },
  1860. openTrack(row) {
  1861. gaude({itemId: row.id, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
  1862. this.lineArr = res.data.data.trackArray
  1863. this.dialogVisibleTwo = true
  1864. let this_ = this
  1865. setTimeout(function () {
  1866. this_.$refs.playback.initMap();
  1867. }, 100)
  1868. })
  1869. // location({itemId: row.id,plateNo:'陕YH0008'}).then(res => {
  1870. // // console.log(res.data.data)
  1871. // // console.log(this.lineArr[this.lineArr.length - 1])
  1872. // })
  1873. },
  1874. //自定义列保存
  1875. async saveColumnBoxTwo() {
  1876. /**
  1877. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1878. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1879. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1880. */
  1881. const inSave = await this.saveColumnData(this.getColumnName(86.1), this.entrustOptionTwoT);
  1882. if (inSave) {
  1883. this.$message.success("保存成功");
  1884. //关闭窗口
  1885. this.$refs.crudBoxTwo.$refs.dialogColumn.columnBox = false;
  1886. }
  1887. },
  1888. //自定义列重置
  1889. async resetColumnBoxTwo() {
  1890. this.entrustOptionTwoT = this.entrustOptionTwoTBackup;
  1891. const inSave = await this.delColumnData(this.getColumnName(86.1), this.entrustOptionTwoTBackup);
  1892. if (inSave) {
  1893. this.$message.success("重置成功");
  1894. this.$refs.crudBoxTwo.$refs.dialogColumn.columnBox = false;
  1895. }
  1896. if (this.roleNameTwo.indexOf('总调度') !== -1) {
  1897. this.entrustOptionTwoT.menu = false
  1898. this.collectionOption.menu = false
  1899. this.paymentOption.menu = false
  1900. }
  1901. },
  1902. //自定义列保存
  1903. async saveColumnCollection() {
  1904. /**
  1905. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1906. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1907. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1908. */
  1909. const inSave = await this.saveColumnData(this.getColumnName(86.4), this.collectionOption);
  1910. if (inSave) {
  1911. this.$message.success("保存成功");
  1912. //关闭窗口
  1913. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  1914. }
  1915. },
  1916. //自定义列重置
  1917. async resetColumnCollection() {
  1918. this.collectionOption = this.collectionOptionBackup;
  1919. const inSave = await this.delColumnData(this.getColumnName(86.4), this.collectionOptionBackup);
  1920. if (inSave) {
  1921. this.$message.success("重置成功");
  1922. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  1923. }
  1924. },
  1925. //自定义列保存
  1926. async saveColumnPayment() {
  1927. /**
  1928. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1929. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1930. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1931. */
  1932. const inSave = await this.saveColumnData(this.getColumnName(86.5), this.paymentOption);
  1933. if (inSave) {
  1934. this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.id
  1935. this.findObject(this.paymentOption.column, "plateNo").dicUrl = "api/blade-land/order-fee/plate-no?orderId=" + this.id + '&fleetId={{key}}'
  1936. this.$message.success("保存成功");
  1937. //关闭窗口
  1938. this.$refs.payment.$refs.dialogColumn.columnBox = false;
  1939. }
  1940. },
  1941. //自定义列重置
  1942. async resetColumnPayment() {
  1943. this.paymentOption = this.paymentOptionBackup;
  1944. const inSave = await this.delColumnData(this.getColumnName(86.5), this.paymentOptionBackup);
  1945. if (inSave) {
  1946. this.$message.success("重置成功");
  1947. this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.id
  1948. this.findObject(this.paymentOption.column, "plateNo").dicUrl = "api/blade-land/order-fee/plate-no?orderId=" + this.id + '&fleetId={{key}}'
  1949. this.$refs.payment.$refs.dialogColumn.columnBox = false;
  1950. }
  1951. },
  1952. //打开附件
  1953. annexOpen(row, index) {
  1954. if (row.id) {
  1955. this.enclosure = true
  1956. this.formAnnex = row
  1957. getFee({id: row.id}).then(res => {
  1958. this.orderList = res.data.data
  1959. })
  1960. } else {
  1961. this.$message.error('请保存后再上传附件');
  1962. }
  1963. },
  1964. //保存
  1965. saveAnnex() {
  1966. saveFile({
  1967. id: this.formAnnex.id,
  1968. fileList: this.orderList
  1969. }).then(res => {
  1970. this.$message.success("保存成功");
  1971. this.annexOpen(this.formAnnex)
  1972. })
  1973. },
  1974. getCorpData(val) {
  1975. this.formData.fleetName = val.cname
  1976. },
  1977. confirmChange() {
  1978. changeFleet({
  1979. ...this.formData,
  1980. id: this.formDataList.id,
  1981. orderId: this.goodsForm.id,
  1982. originalFleetName: this.formDataList.fleetName
  1983. }).then(res => {
  1984. this.$refs.saveForm.resetForm()
  1985. this.entrustList = res.data.data
  1986. this.dialogChange = false
  1987. this.$message.success("变更成功");
  1988. })
  1989. },
  1990. //查询业务部门
  1991. initData(tenantId) {
  1992. getDeptTree(tenantId).then(res => {
  1993. const column = this.findObject(this.goodsOptionForm.column, "salesmanDept");
  1994. column.dicData = res.data.data;
  1995. });
  1996. },
  1997. //多选触发
  1998. selectionChange(list) {
  1999. this.selectionList = list
  2000. if (this.selectionList.length === 0) {
  2001. return this.batchDuling = true
  2002. } else {
  2003. for (let item in this.selectionList) {
  2004. if (this.selectionList[item].status > 0) {
  2005. return this.batchDuling = true
  2006. }
  2007. }
  2008. return this.batchDuling = false
  2009. }
  2010. },
  2011. //批量调度
  2012. batchScheduling() {
  2013. this.form = {}
  2014. this.dialogVisible = true
  2015. },
  2016. //提交调度
  2017. saveScheduling() {
  2018. this.$refs['form'].validate((valid, done) => {
  2019. done()
  2020. if (valid) {
  2021. let data = []
  2022. this.$confirm('是否确认调度?', '提示', {
  2023. confirmButtonText: '确定',
  2024. cancelButtonText: '取消',
  2025. type: 'warning'
  2026. }).then(() => {
  2027. this.selectionList.forEach(item => data.push(item.id))
  2028. dispatchBatch({
  2029. ...this.form,
  2030. idList: data,
  2031. orderId: this.goodsForm.id
  2032. }).then(res => {
  2033. this.entrustList = res.data.data
  2034. this.dialogVisible = false
  2035. })
  2036. }).catch(() => {
  2037. this.$message({
  2038. type: 'info',
  2039. message: '已取消'
  2040. });
  2041. });
  2042. } else {
  2043. return false
  2044. }
  2045. })
  2046. },
  2047. //刷新数据
  2048. refreshData() {
  2049. detailDelegationList({id: this.id, kind: '2'}).then(res => {
  2050. this.goodsForm = res.data.data
  2051. this.tableData = res.data.data.orderAddressList
  2052. this.entrustList = res.data.data.orderItemList
  2053. this.goodsList = res.data.data.orderItemList
  2054. this.orderFilesList = res.data.data.fileList
  2055. // 预估信息
  2056. res.data.data.orderEstimateList.map(item=>{
  2057. item.$cellEdit = true
  2058. })
  2059. this.yugudata = res.data.data.orderEstimateList?res.data.data.orderEstimateList:[]
  2060. if (res.data.data.orderFeeList.length > 0) {
  2061. res.data.data.orderFeeList.forEach(item => {
  2062. if (item.type == 1) {
  2063. this.collectionList.push(item)
  2064. } else {
  2065. this.paymentList.push(item)
  2066. }
  2067. })
  2068. }
  2069. delete this.goodsForm.orderAddressList
  2070. delete this.goodsForm.orderItemList
  2071. delete this.goodsForm.orderFeeList
  2072. // this.tableData.forEach(item => {
  2073. // if (item.region) item.region = item.region.split(',')
  2074. // })
  2075. })
  2076. },
  2077. //切换收付费
  2078. handleSelect(tab, event) {
  2079. this.activeIndex = tab.name
  2080. },
  2081. //箱信息保存
  2082. rowSaveT(row, index, done, loading) {
  2083. if (row.$cellEdit) {
  2084. fleetDriverSave(row).then(res => {
  2085. this.$message.success("保存成功");
  2086. })
  2087. }
  2088. this.$refs.crudBoxTwo.rowCell(row, index)
  2089. },
  2090. //调度并且派车
  2091. rowSaveThree(row, index, done, loading) {
  2092. if (row.$cellEdit) {
  2093. if (!row.plateNo) {
  2094. return this.$message.warning('未选择车号,请选择');
  2095. }
  2096. if (!row.fleetId) {
  2097. return this.$message.warning('请选择车队');
  2098. }
  2099. this.$confirm('是否确定调度派车', '提示', {
  2100. confirmButtonText: '确定',
  2101. cancelButtonText: '取消',
  2102. type: 'warning'
  2103. }).then(() => {
  2104. sendACarCollection(row).then(res => {
  2105. this.$message.success('操作成功');
  2106. this.$refs.crudBoxTwo.rowCell(row, index)
  2107. this.refreshData()
  2108. })
  2109. }).catch(() => {
  2110. this.$message({
  2111. type: 'info',
  2112. message: '已取消'
  2113. });
  2114. this.$refs.crudBoxTwo.rowCell(row, index)
  2115. });
  2116. } else {
  2117. this.entrustOptionTwoT.column.forEach(item => {
  2118. if (item.prop === 'plateNo') {
  2119. item.cell = true
  2120. }
  2121. if (item.prop === 'driverName') {
  2122. item.cell = true
  2123. }
  2124. if (item.prop === 'tel') {
  2125. item.cell = true
  2126. }
  2127. })
  2128. this.$refs.crudBoxTwo.rowCell(row, index)
  2129. }
  2130. },
  2131. rowSaveWell(row, index, done, loading) {
  2132. done()
  2133. },
  2134. //箱信息调度
  2135. designate(row, index) {
  2136. if (row.fleetId) {
  2137. this.$confirm('是否确定调度', '提示', {
  2138. confirmButtonText: '确定',
  2139. cancelButtonText: '取消',
  2140. type: 'warning'
  2141. }).then(() => {
  2142. dispatchCollection(row).then(res => {
  2143. this.$message.success('操作成功');
  2144. this.entrustList[index].status = res.data.data.status
  2145. })
  2146. }).catch(() => {
  2147. this.$message({
  2148. type: 'info',
  2149. message: '已取消'
  2150. });
  2151. });
  2152. } else {
  2153. this.$message.warning('请选择车队');
  2154. }
  2155. },
  2156. //变更车队
  2157. changeFleetT(row, index) {
  2158. this.formDataList = row
  2159. this.dialogChange = true
  2160. this.formData = row
  2161. },
  2162. //打开变更记录
  2163. recordsOfChanges(row, index) {
  2164. this.dialogRecord = true
  2165. recordingDetails({itemId: row.id, kind: 2}).then(res => {
  2166. this.dataRecord = res.data.data
  2167. })
  2168. },
  2169. //取消调度
  2170. cancelDesignate(row, index) {
  2171. this.$confirm('是否确定取消调度', '提示', {
  2172. confirmButtonText: '确定',
  2173. cancelButtonText: '取消',
  2174. type: 'warning'
  2175. }).then(() => {
  2176. cancelDispatchCollection({id: row.id}).then(res => {
  2177. this.$message.success('操作成功');
  2178. this.entrustList[index].status = res.data.data.status
  2179. })
  2180. }).catch(() => {
  2181. this.$message({
  2182. type: 'info',
  2183. message: '已取消'
  2184. });
  2185. });
  2186. },
  2187. //箱信息选择车队
  2188. getfleetIdT(data, row) {
  2189. this.$set(row, 'fleetName', data.cname)
  2190. console.log(this.$refs.crudBoxTwo)
  2191. // this.$refs.crudBoxTwo.handleChange({
  2192. // label: '车队',
  2193. // width: 200,
  2194. // index: 5,
  2195. // prop: 'fleetId',
  2196. // cascader: ['plateNo'],
  2197. // },row)
  2198. },
  2199. //地址新增
  2200. addAddress() {
  2201. this.tableData.splice(this.tableData.length - 1, 0, {leas: 1111})
  2202. },
  2203. //返回主列表
  2204. backToList(value) {
  2205. if (value === 0) {
  2206. this.$emit('backToList')
  2207. } else if (value === 1) {
  2208. this.$emit('backToList', true)
  2209. } else if (value === 2) {
  2210. this.$router.push({
  2211. path: '/SpecialTrade/reportAnalysis/index'
  2212. });
  2213. }
  2214. },
  2215. //删除途径地址
  2216. deleteAddress(scope) {
  2217. this.tableData.splice(scope.$index, 1);
  2218. },
  2219. //箱信息保存
  2220. rowSave(row, index, done, loading) {
  2221. row.$cellEdit = false
  2222. done()
  2223. },
  2224. rowCell(row, index) {
  2225. if (row.$cellEdit) {
  2226. if (row.plateNo) {
  2227. if (row.feeId) {
  2228. incidentalSubmit(row).then(res => {
  2229. this.$refs.collection.rowCell(row, index)
  2230. row = res.data.data
  2231. this.$message.success("保存成功");
  2232. })
  2233. } else {
  2234. this.$message.error("请选择费用名称");
  2235. }
  2236. } else {
  2237. this.$message.error("请选择车号");
  2238. }
  2239. } else {
  2240. this.$refs.collection.rowCell(row, index)
  2241. }
  2242. },
  2243. paymentRowCell(row, index) {
  2244. if (row.$cellEdit) {
  2245. if (row.plateNo) {
  2246. if (row.feeId) {
  2247. incidentalSubmit(row).then(res => {
  2248. row = {
  2249. ...res.data.data,
  2250. $cellEdit: true
  2251. }
  2252. this.$message.success("保存成功");
  2253. this.$refs.payment.rowCell(row, index)
  2254. })
  2255. } else {
  2256. this.$message.error("请选择费用名称");
  2257. }
  2258. } else {
  2259. this.$message.error("请选择车号");
  2260. }
  2261. } else {
  2262. this.$refs.payment.rowCell(row, index)
  2263. }
  2264. },
  2265. //箱信息移除
  2266. rowDel(row, index) {
  2267. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  2268. confirmButtonText: '确定',
  2269. cancelButtonText: '取消',
  2270. type: 'warning'
  2271. }).then(() => {
  2272. this.entrustList.splice(index, 1);
  2273. }).catch(() => {
  2274. this.$message({
  2275. type: 'info',
  2276. message: '已取消删除'
  2277. });
  2278. });
  2279. },
  2280. //保存
  2281. editCustomer() {
  2282. let data = JSON.parse(JSON.stringify(this.tableData))
  2283. // data.forEach(item => {
  2284. // if (item.region.length !== 0) item.region = item.region.join(',')
  2285. // })
  2286. saveDelegationList({
  2287. ...this.goodsForm,
  2288. kind: '2',
  2289. orderAddressList: data,
  2290. orderItemList: this.entrustList,
  2291. orderFeeList: this.collectionList.concat(this.paymentList)
  2292. }).then(res => {
  2293. this.$message.success('保存成功');
  2294. })
  2295. },
  2296. // 预估费用保存
  2297. yuguupdate(row,index,done,loading) {
  2298. console.log(row,index,done,loading)
  2299. },
  2300. // 预估费用 取消
  2301. yugurowDel(row,done,loading) {
  2302. },
  2303. // 预估费用新增
  2304. addyugofun() {
  2305. this.$refs.yugoref.rowCellAdd({
  2306. id:'',
  2307. fleetId:'',
  2308. fleetName:'',
  2309. freightAmount:'',
  2310. miscellaneousAmount:'',
  2311. profitAmount:'',
  2312. $cellEdit: true
  2313. });
  2314. },
  2315. //收费新增
  2316. addRowCollection() {
  2317. if (this.selectionList.length == 1) {
  2318. customerList({size: 10, current: 1}).then(res => {
  2319. this.$refs.collection.rowCellAdd({
  2320. currency: '1',
  2321. type: '1',
  2322. itemId: this.selectionList[0].id,
  2323. // feeId: res.data.data.records.length > 0 ? res.data.data.records[0].id : '',
  2324. // unit: '件数',
  2325. // corpId: this.goodsForm.corpId,
  2326. // corpName: this.goodsForm.corpName,
  2327. // quantity: 1,
  2328. orderId: this.id,
  2329. $cellEdit: true
  2330. });
  2331. })
  2332. } else if (this.selectionList.length == 0) {
  2333. this.$message.warning('请选择一条车辆信息')
  2334. } else if (this.selectionList.length > 0) {
  2335. this.$message.warning('请选择一条车辆信息')
  2336. }
  2337. },
  2338. //付费新增
  2339. addRowPayment() {
  2340. if (this.selectionList.length == 1) {
  2341. customerList({size: 10, current: 1}).then(res => {
  2342. this.$refs.payment.rowCellAdd({
  2343. currency: '1',
  2344. type: '2',
  2345. itemId: this.selectionList[0].id,
  2346. // feeId: res.data.data.records.length > 0 ? res.data.data.records[0].id : '',
  2347. // unit: '件数',
  2348. // quantity: 1,
  2349. // corpId: '1526835847238901762',
  2350. orderId: this.id,
  2351. $cellEdit: true
  2352. });
  2353. })
  2354. } else if (this.selectionList.length == 0) {
  2355. this.$message.warning('请选择一条车辆信息')
  2356. } else if (this.selectionList.length > 0) {
  2357. this.$message.warning('请选择一条车辆信息')
  2358. }
  2359. },
  2360. //选择费用
  2361. selectValue(value, row) {
  2362. this.$set(row, 'feeName', value.cname)
  2363. },
  2364. //选择客户信息触发
  2365. getfleetId(data, row) {
  2366. this.$set(row, 'corpName', data.cname)
  2367. },
  2368. //收款信息移除
  2369. makeDel(row, index) {
  2370. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  2371. confirmButtonText: '确定',
  2372. cancelButtonText: '取消',
  2373. type: 'warning'
  2374. }).then(() => {
  2375. if (row.id) removeCollection(row.id)
  2376. this.collectionList.splice(index, 1);
  2377. }).catch(() => {
  2378. this.$message({
  2379. type: 'info',
  2380. message: '已取消删除'
  2381. });
  2382. });
  2383. },
  2384. //付款信息移除
  2385. feeDel(row, index) {
  2386. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  2387. confirmButtonText: '确定',
  2388. cancelButtonText: '取消',
  2389. type: 'warning'
  2390. }).then(() => {
  2391. if (row.id) removeCollection(row.id)
  2392. this.paymentList.splice(index, 1);
  2393. }).catch(() => {
  2394. this.$message({
  2395. type: 'info',
  2396. message: '已取消删除'
  2397. });
  2398. });
  2399. },
  2400. //自定义表头
  2401. renderHeader(h) {
  2402. return (
  2403. <div>
  2404. <el-tooltip className="item" effect="dark" content="增加途径地址" placement="top">
  2405. <el-button type="primary" icon="el-icon-plus" size="mini" circle onClick={() => this.addAddress()}
  2406. style="margin-right: 1.25rem;"></el-button>
  2407. </el-tooltip>
  2408. </div>
  2409. )
  2410. }
  2411. }
  2412. }
  2413. </script>
  2414. <style scoped lang="scss">
  2415. ::v-deep .el-form-item {
  2416. margin-bottom: 8px;
  2417. }
  2418. ::v-deep .el-form-item__content {
  2419. line-height: 32px;
  2420. }
  2421. ::v-deep .el-card__body {
  2422. padding: 10px 15px;
  2423. font-size: 14px;
  2424. }
  2425. </style>