detailPage.vue 100 KB

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