detailPage.vue 94 KB

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