index.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403
  1. <template>
  2. <div>
  3. <basic-container v-if="key>0">
  4. <avue-crud
  5. :data="goodsList"
  6. :option="goodsOptionCrud"
  7. :table-loading="loading"
  8. :page.sync="page"
  9. ref="crud"
  10. @on-load="onLoad"
  11. @resetColumn="resetColumn"
  12. @saveColumn="saveColumn"
  13. @search-change="searchChange"
  14. @search-reset="query = {}"
  15. :search.sync="query"
  16. @search-criteria-switch="searchCriteriaSwitch"
  17. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  18. @row-update="rowSave">
  19. <template slot="plateNo" slot-scope="{row}">
  20. <span class="el-button--text" style="cursor: pointer"
  21. @click="openTrack(row)">{{ row.plateNo }}</span>
  22. </template>
  23. <template slot="menuLeft">
  24. <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
  25. </template>
  26. <template slot="corpShortNameSearch" slot-scope="{ row,index}">
  27. <crop-select
  28. v-model="row.corpId"
  29. :corpType="'KH'"
  30. :label="'shortName'"
  31. ></crop-select>
  32. </template>
  33. <template slot-scope="{row}" slot="fleetId">
  34. <span>{{ row.fleetName }}</span>
  35. </template>
  36. <template slot="billNo" slot-scope="{row,index}">
  37. <span v-if="roleName.indexOf('车队') !== -1" style="cursor: pointer">{{ row.billNo }}</span>
  38. <span class="el-button--text" v-else style="cursor: pointer" @click.stop="celJump(row,index)">{{row.billNo}}</span>
  39. </template>
  40. <template slot="corpShortName" slot-scope="{row,index}">
  41. <span class="el-button--text" style="cursor: pointer"
  42. @click.stop="celJump(row,index)">{{ row.corpShortName }}</span>
  43. </template>
  44. <template slot="dispatchNumber" slot-scope="{row,index}">
  45. <span class="el-button--text" style="cursor: pointer"
  46. @click.stop="celJump(row,index)">{{ row.dispatchNumber }}</span>
  47. </template>
  48. <template slot-scope="{row}" slot="fleetIdSearch">
  49. <crop-select
  50. v-model="row.fleetId"
  51. corpType="CD"
  52. ></crop-select>
  53. </template>
  54. <template slot-scope="{row,index}" slot="menu">
  55. <span v-if="row.extraAmountD>0">
  56. <el-button
  57. size="small"
  58. type="text"
  59. >{{ row.confirmStatus !== 0 ? '已确认' : '' }}
  60. </el-button>
  61. <el-button
  62. size="small"
  63. type="text"
  64. @click="incidentalConfirm(row)"
  65. >{{ row.confirmStatus == 0 ? '杂费确认' : '杂费取消' }}
  66. </el-button>
  67. </span>
  68. </template>
  69. <template slot="addressDetail" slot-scope="{ row,index}">
  70. <el-tooltip class="item" effect="dark" placement="top">
  71. <div v-html="ToBreak(row.addressDetail)" slot="content"></div>
  72. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.addressDetail }}</div>
  73. </el-tooltip>
  74. </template>
  75. <template slot="unloadingPlace" slot-scope="{ row,index}">
  76. <el-tooltip class="item" effect="dark" placement="top">
  77. <div v-html="ToBreak(row.unloadingPlace)" slot="content"></div>
  78. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.unloadingPlace }}</div>
  79. </el-tooltip>
  80. </template>
  81. <template slot="extraAmountItemC" slot-scope="{ row,index}">
  82. <el-tooltip class="item" effect="dark" placement="top">
  83. <div v-html="ToBreak(row.extraAmountItemC)" slot="content"></div>
  84. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.extraAmountItemC }}</div>
  85. </el-tooltip>
  86. </template>
  87. <template slot="extraAmountItemD" slot-scope="{ row,index}">
  88. <el-tooltip class="item" effect="dark" placement="top">
  89. <div v-html="ToBreak(row.extraAmountItemD)" slot="content"></div>
  90. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ row.extraAmountItemD }}</div>
  91. </el-tooltip>
  92. </template>
  93. </avue-crud>
  94. <el-dialog
  95. title="杂费明细"
  96. :visible.sync="incidentalType"
  97. append-to-body
  98. width="50%">
  99. <avue-crud
  100. :data="collectionList"
  101. :option="collectionOption"
  102. ref="collection"
  103. @resetColumn="resetColumnCollection"
  104. @saveColumn="saveColumnCollection"
  105. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  106. @row-update="rowSave">
  107. <template slot-scope="{row,index}" slot="menu">
  108. <!-- <el-button-->
  109. <!-- type="text"-->
  110. <!-- size="small"-->
  111. <!-- :disabled="goodsForm.status === 1"-->
  112. <!-- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"-->
  113. <!-- @click="rowCell(row,index)"-->
  114. <!-- >{{ row.$cellEdit ? '保存' : '编辑' }}-->
  115. <!-- </el-button>-->
  116. <!-- <el-button type="text"-->
  117. <!-- icon="el-icon-delete"-->
  118. <!-- size="small"-->
  119. <!-- :disabled="goodsForm.status === 1"-->
  120. <!-- @click="$refs.collection.rowDel(row,index)"-->
  121. <!-- >删除-->
  122. <!-- </el-button>-->
  123. <el-button
  124. size="small"
  125. type="text"
  126. icon="el-icon-s-order"
  127. @click="annexOpen(row, index)"
  128. >附 件
  129. </el-button>
  130. </template>
  131. <template slot="menuLeft">
  132. <!-- <el-button-->
  133. <!-- type="primary"-->
  134. <!-- icon="el-icon-plus"-->
  135. <!-- :disabled="goodsForm.status !== 0"-->
  136. <!-- @click="addRowCollection"-->
  137. <!-- size="small">录入明细</el-button>-->
  138. </template>
  139. </avue-crud>
  140. <span slot="footer" class="dialog-footer">
  141. <el-button @click="incidentalType = false" size="small">取 消</el-button>
  142. <el-button type="primary" size="small" v-if="collectionList.length>0"
  143. @click="incidentalClick">{{ confirmStatus == 0 ? '杂费确认' : '杂费取消' }}</el-button>
  144. </span>
  145. </el-dialog>
  146. <el-dialog
  147. title="附件"
  148. :visible.sync="enclosure"
  149. append-to-body
  150. width="70%">
  151. <c-upload
  152. typeUpload="GZ"
  153. :basic="true"
  154. disabled
  155. deleteUrl="/api/blade-client/common-file/remove"
  156. :data="orderList"
  157. :enumerationValue="76"
  158. ></c-upload>
  159. <span slot="footer" class="dialog-footer">
  160. <el-button @click="enclosure = false" size="small">取 消</el-button>
  161. </span>
  162. </el-dialog>
  163. <track-playback :dialogVisible="dialogVisibleTwo" v-loading="loadingDialog" :parkingPoint="parkingPoint"
  164. :lineArr="lineArr"
  165. ref="playback"></track-playback>
  166. </basic-container>
  167. </div>
  168. </template>
  169. <script>
  170. import {
  171. acceptanceCollection,
  172. acceptanceDispatchCollection,
  173. confirmCompletion,
  174. fleetList,
  175. motorcadeDriver,
  176. fleetDriverSave,
  177. getAttachment,
  178. saveAttached,
  179. incidental,
  180. getFee,
  181. incidentalConfirm,
  182. cancelConfirm, standingBookCollection
  183. } from "@/api/landTransportation";
  184. import {getToken} from "@/util/auth";
  185. import {gaude} from "@/api/gaude";
  186. import {getSalesman} from "@/api/landTransportation/bulkCargo";
  187. export default {
  188. name: "index",
  189. data() {
  190. return {
  191. key: 0,
  192. form: {},
  193. enclosure: false,
  194. dialogVisibleTwo: false,
  195. loadingDialog: false,
  196. lineArr: [],
  197. parkingPoint: [],
  198. orderList: [],
  199. collectionOptionBackup: {
  200. align: 'center',
  201. menuAlign: 'center',
  202. refreshBtn: false,
  203. index: true,
  204. // menu:false,
  205. cancelBtn: false,
  206. editBtn: false,
  207. delBtn: false,
  208. cellBtn: false,
  209. addBtn: false,
  210. addRowBtn: false,
  211. showSummary: true,
  212. addBtnText: '录入明细',
  213. summaryText: "合计",
  214. sumColumnList: [{
  215. name: 'price',
  216. type: 'sum',
  217. decimals: 2
  218. }, {
  219. name: 'amount',
  220. type: 'sum',
  221. decimals: 2
  222. }, {
  223. name: 'quantity',
  224. type: 'sum',
  225. decimals: 0
  226. }],
  227. column: [
  228. {
  229. label: '费用名称',
  230. slot: true,
  231. prop: 'feeName'
  232. }, {
  233. label: '金额',
  234. cell: true,
  235. prop: 'amount'
  236. }, {
  237. label: '车号',
  238. prop: 'plateNo'
  239. }, {
  240. label: '备注',
  241. prop: 'remarks'
  242. }
  243. ]
  244. },
  245. collectionOption: {},
  246. collectionList: [],
  247. dialogVisible: false,
  248. loading: false,
  249. incidentalType: false,
  250. confirmStatus: 0,
  251. activeName: '',
  252. query: {},
  253. page: {
  254. pageSize: 10,
  255. currentPage: 1,
  256. total: 0,
  257. pageSizes: [10, 50, 100, 200, 300]
  258. },
  259. roleName: localStorage.getItem("roleName").split(','),
  260. goodsList: [],
  261. goodsOptionCrud: {},
  262. totalData: {},
  263. optionList: {},
  264. //客户
  265. optionListOne: {
  266. stripe: true,
  267. index: true,
  268. addBtn: false,
  269. delBtn: false,
  270. cellBtn: false,
  271. cancelBtn: false,
  272. editBtn: false,
  273. addRowBtn: false,
  274. refreshBtn: false,
  275. searchIcon: true,
  276. searchIndex: 2,
  277. searchSpan: 8,
  278. menuWidth: 140,
  279. menu: true,
  280. searchMenuPosition: "right",
  281. searchMenuSpan: 6,
  282. align: 'center',
  283. height: "auto",
  284. showSummary: true,
  285. summaryText: "合计",
  286. sumColumnList: [
  287. {
  288. name: 'landWeight',
  289. type: 'sum',
  290. decimals: 2
  291. }, {
  292. name: 'landAmountC',
  293. type: 'sum',
  294. decimals: 2
  295. }, {
  296. name: 'ctnQuantity',
  297. type: 'count'
  298. }, {
  299. name: 'oneFeeC',
  300. type: 'sum',
  301. decimals: 2
  302. }, {
  303. name: 'twoFeeC',
  304. type: 'sum',
  305. decimals: 2
  306. }, {
  307. name: 'threeFeeC',
  308. type: 'sum',
  309. decimals: 2
  310. }, {
  311. name: 'fourFeeC',
  312. type: 'sum',
  313. decimals: 2
  314. }, {
  315. name: 'fiveFeeC',
  316. type: 'sum',
  317. decimals: 2
  318. }, {
  319. name: 'oneFeeD',
  320. type: 'sum',
  321. decimals: 2
  322. }, {
  323. name: 'twoFeeD',
  324. type: 'sum',
  325. decimals: 2
  326. }, {
  327. name: 'threeFeeD',
  328. type: 'sum',
  329. decimals: 2
  330. }, {
  331. name: 'fourFeeD',
  332. type: 'sum',
  333. decimals: 2
  334. }, {
  335. name: 'fiveFeeD',
  336. type: 'sum',
  337. decimals: 2
  338. }, {
  339. name: 'profit',
  340. type: 'sum',
  341. decimals: 2
  342. }, {
  343. name: 'extraAmountC',
  344. type: 'sum',
  345. decimals: 2
  346. }, {
  347. name: 'landAmountD',
  348. type: 'sum',
  349. decimals: 2
  350. }, {
  351. name: 'extraAmountD',
  352. type: 'sum',
  353. decimals: 2
  354. }],
  355. column: [{
  356. label: '客户名称',
  357. prop: 'corpShortName',
  358. overHidden: true,
  359. index: 1,
  360. width: 100,
  361. searchOrder:1,
  362. search: true,
  363. }, {
  364. label: '车号',
  365. prop: 'plateNo',
  366. index: 11,
  367. width: 90,
  368. search: true,
  369. searchOrder:2,
  370. overHidden: true,
  371. }, {
  372. label: '货运日期',
  373. prop: 'arrivalTime',
  374. overHidden: true,
  375. type: "date",
  376. searchRange: true,
  377. defaultTime: ['00:00:00', '23:59:59'],
  378. format: "yyyy-MM-dd HH:mm",
  379. valueFormat: "yyyy-MM-dd HH:mm:ss",
  380. index: 2,
  381. width: 126,
  382. search: true,
  383. }, {
  384. label: '业务员',
  385. prop: 'salesmanName',
  386. index: 3,
  387. width: 70,
  388. searchProp: 'salesman',
  389. search: true,
  390. overHidden: true,
  391. filterable: true,
  392. type: "select",
  393. dicUrl: "/api/blade-user/userList?roleAlias=业务员",
  394. props: {
  395. label: "realName",
  396. value: "id"
  397. }
  398. }, {
  399. label: '物流运输',
  400. prop: 'dispatchDept',
  401. search: true,
  402. dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
  403. type: "select",
  404. props: {
  405. label: "deptName",
  406. value: "id"
  407. },
  408. overHidden: true,
  409. index: 4,
  410. width: 80
  411. }, {
  412. label: '运输调度',
  413. prop: 'dispatcherName',
  414. overHidden: true,
  415. index: 5,
  416. width: 70,
  417. }, {
  418. label: '派车单号',
  419. width: 80,
  420. index: 5,
  421. overHidden: true,
  422. search: true,
  423. prop: 'dispatchNumber'
  424. }, {
  425. label: '合同号',
  426. width: 90,
  427. index: 6,
  428. overHidden: true,
  429. search: true,
  430. prop: 'contractNo'
  431. }, {
  432. label: '装货地点',
  433. prop: 'addressDetail',
  434. index: 7,
  435. width: 132,
  436. }, {
  437. label: '卸货地点',
  438. prop: 'unloadingPlace',
  439. index: 8,
  440. width: 132,
  441. }, {
  442. label: '车型',
  443. width: 90,
  444. index: 9,
  445. prop: 'fleetVolum'
  446. }, {
  447. label: '车队',
  448. prop: 'fleetShortName',
  449. index: 10,
  450. width: 90,
  451. searchProp: 'fleetId',
  452. type: 'select',
  453. cascader: ['plateNo'],
  454. props: {
  455. label: "cname",
  456. value: "id"
  457. },
  458. filterable: true,
  459. search: true,
  460. overHidden: true,
  461. }, {
  462. label: '应收运费',
  463. overHidden: true,
  464. index: 12,
  465. width: 100,
  466. prop: 'landAmountD'
  467. }, {
  468. label: '应收杂费',
  469. prop: 'extraAmountD',
  470. index: 13,
  471. width: 100,
  472. overHidden: true,
  473. }, {
  474. label: '备注',
  475. prop: 'remarks',
  476. index: 14,
  477. width: 100,
  478. overHidden: true,
  479. },{
  480. label: '应收杂费明细',
  481. width: 100,
  482. index: 15,
  483. overHidden: true,
  484. prop: 'extraAmountItemD'
  485. }]
  486. },
  487. //平台
  488. optionListTwo: {
  489. stripe: true,
  490. index: true,
  491. addBtn: false,
  492. delBtn: false,
  493. cellBtn: false,
  494. cancelBtn: false,
  495. editBtn: false,
  496. addRowBtn: false,
  497. refreshBtn: false,
  498. searchIcon: true,
  499. searchIndex: 2,
  500. searchSpan: 8,
  501. menuWidth: 140,
  502. menu: true,
  503. searchMenuPosition: "right",
  504. searchMenuSpan: 6,
  505. align: 'center',
  506. height: "auto",
  507. showSummary: true,
  508. summaryText: "合计",
  509. sumColumnList: [
  510. {
  511. name: 'landWeight',
  512. type: 'sum',
  513. decimals: 2
  514. }, {
  515. name: 'landAmountC',
  516. type: 'sum',
  517. decimals: 2
  518. }, {
  519. name: 'ctnQuantity',
  520. type: 'count'
  521. }, {
  522. name: 'oneFeeC',
  523. type: 'sum',
  524. decimals: 2
  525. }, {
  526. name: 'twoFeeC',
  527. type: 'sum',
  528. decimals: 2
  529. }, {
  530. name: 'threeFeeC',
  531. type: 'sum',
  532. decimals: 2
  533. }, {
  534. name: 'fourFeeC',
  535. type: 'sum',
  536. decimals: 2
  537. }, {
  538. name: 'fiveFeeC',
  539. type: 'sum',
  540. decimals: 2
  541. }, {
  542. name: 'oneFeeD',
  543. type: 'sum',
  544. decimals: 2
  545. }, {
  546. name: 'twoFeeD',
  547. type: 'sum',
  548. decimals: 2
  549. }, {
  550. name: 'threeFeeD',
  551. type: 'sum',
  552. decimals: 2
  553. }, {
  554. name: 'fourFeeD',
  555. type: 'sum',
  556. decimals: 2
  557. }, {
  558. name: 'fiveFeeD',
  559. type: 'sum',
  560. decimals: 2
  561. }, {
  562. name: 'profit',
  563. type: 'sum',
  564. decimals: 2
  565. }, {
  566. name: 'extraAmountC',
  567. type: 'sum',
  568. decimals: 2
  569. }, {
  570. name: 'landAmountD',
  571. type: 'sum',
  572. decimals: 2
  573. }, {
  574. name: 'extraAmountD',
  575. type: 'sum',
  576. decimals: 2
  577. }],
  578. column: [{
  579. label: '客户名称',
  580. prop: 'corpShortName',
  581. overHidden: true,
  582. index: 1,
  583. width: 100,
  584. searchOrder:1,
  585. search: true,
  586. }, {
  587. label: '车号',
  588. prop: 'plateNo',
  589. index: 11,
  590. width: 90,
  591. search: true,
  592. searchOrder:2,
  593. overHidden: true,
  594. }, {
  595. label: '货运日期',
  596. prop: 'arrivalTime',
  597. overHidden: true,
  598. type: "date",
  599. searchRange: true,
  600. defaultTime: ['00:00:00', '23:59:59'],
  601. format: "yyyy-MM-dd HH:mm",
  602. valueFormat: "yyyy-MM-dd HH:mm:ss",
  603. index: 2,
  604. width: 126,
  605. search: true,
  606. }, {
  607. label: '业务员',
  608. prop: 'salesmanName',
  609. index: 3,
  610. width: 70,
  611. searchProp: 'salesman',
  612. search: true,
  613. overHidden: true,
  614. filterable: true,
  615. type: "select",
  616. dicUrl: "/api/blade-user/userList?roleAlias=业务员",
  617. props: {
  618. label: "realName",
  619. value: "id"
  620. }
  621. }, {
  622. label: '运输调度',
  623. prop: 'dispatcherName',
  624. overHidden: true,
  625. index: 4,
  626. width: 70,
  627. }, {
  628. label: '派车单号',
  629. width: 80,
  630. index: 5,
  631. overHidden: true,
  632. search: true,
  633. prop: 'dispatchNumber'
  634. }, {
  635. label: '合同号',
  636. width: 90,
  637. index: 6,
  638. overHidden: true,
  639. search: true,
  640. prop: 'contractNo'
  641. }, {
  642. label: '装货地点',
  643. prop: 'addressDetail',
  644. index: 7,
  645. width: 132,
  646. }, {
  647. label: '卸货地点',
  648. prop: 'unloadingPlace',
  649. index: 8,
  650. width: 132,
  651. }, {
  652. label: '车型',
  653. width: 90,
  654. index: 9,
  655. prop: 'fleetVolum'
  656. }, {
  657. label: '车队',
  658. prop: 'fleetShortName',
  659. index: 10,
  660. width: 90,
  661. searchProp: 'fleetId',
  662. type: 'select',
  663. cascader: ['plateNo'],
  664. props: {
  665. label: "cname",
  666. value: "id"
  667. },
  668. filterable: true,
  669. search: true,
  670. overHidden: true,
  671. }, {
  672. label: '应收运费',
  673. overHidden: true,
  674. index: 12,
  675. width: 100,
  676. prop: 'landAmountD'
  677. }, {
  678. label: '应收杂费',
  679. prop: 'extraAmountD',
  680. index: 13,
  681. width: 100,
  682. overHidden: true,
  683. }, {
  684. label: '备注',
  685. prop: 'remarks',
  686. index: 14,
  687. width: 100,
  688. overHidden: true,
  689. }, {
  690. label: '应付运费',
  691. prop: 'landAmountC',
  692. index: 15,
  693. width: 100,
  694. overHidden: true,
  695. }, {
  696. label: '应付杂费',
  697. prop: 'extraAmountC',
  698. index: 16,
  699. width: 100,
  700. overHidden: true
  701. }, {
  702. label: '应收杂费明细',
  703. width: 100,
  704. index: 18,
  705. overHidden: true,
  706. prop: 'extraAmountItemD'
  707. }, {
  708. label: '应付杂费明细',
  709. width: 100,
  710. index: 19,
  711. overHidden: true,
  712. prop: 'extraAmountItemC'
  713. }]
  714. },
  715. //车队
  716. optionListThree: {
  717. stripe: true,
  718. index: true,
  719. addBtn: false,
  720. delBtn: false,
  721. cellBtn: false,
  722. cancelBtn: false,
  723. editBtn: false,
  724. addRowBtn: false,
  725. refreshBtn: false,
  726. searchIcon: true,
  727. searchIndex: 2,
  728. searchSpan: 8,
  729. menuWidth: 140,
  730. menu: true,
  731. searchMenuPosition: "right",
  732. searchMenuSpan: 6,
  733. align: 'center',
  734. height: "auto",
  735. showSummary: true,
  736. summaryText: "合计",
  737. sumColumnList: [
  738. {
  739. name: 'landWeight',
  740. type: 'sum',
  741. decimals: 2
  742. }, {
  743. name: 'landAmountC',
  744. type: 'sum',
  745. decimals: 2
  746. }, {
  747. name: 'ctnQuantity',
  748. type: 'count'
  749. }, {
  750. name: 'oneFeeC',
  751. type: 'sum',
  752. decimals: 2
  753. }, {
  754. name: 'twoFeeC',
  755. type: 'sum',
  756. decimals: 2
  757. }, {
  758. name: 'threeFeeC',
  759. type: 'sum',
  760. decimals: 2
  761. }, {
  762. name: 'fourFeeC',
  763. type: 'sum',
  764. decimals: 2
  765. }, {
  766. name: 'fiveFeeC',
  767. type: 'sum',
  768. decimals: 2
  769. }, {
  770. name: 'oneFeeD',
  771. type: 'sum',
  772. decimals: 2
  773. }, {
  774. name: 'twoFeeD',
  775. type: 'sum',
  776. decimals: 2
  777. }, {
  778. name: 'threeFeeD',
  779. type: 'sum',
  780. decimals: 2
  781. }, {
  782. name: 'fourFeeD',
  783. type: 'sum',
  784. decimals: 2
  785. }, {
  786. name: 'fiveFeeD',
  787. type: 'sum',
  788. decimals: 2
  789. }, {
  790. name: 'profit',
  791. type: 'sum',
  792. decimals: 2
  793. }, {
  794. name: 'extraAmountC',
  795. type: 'sum',
  796. decimals: 2
  797. }, {
  798. name: 'landAmountD',
  799. type: 'sum',
  800. decimals: 2
  801. }, {
  802. name: 'extraAmountD',
  803. type: 'sum',
  804. decimals: 2
  805. }],
  806. column: [{
  807. label: '货运日期',
  808. prop: 'arrivalTime',
  809. overHidden: true,
  810. type: "date",
  811. searchRange: true,
  812. defaultTime: ['00:00:00', '23:59:59'],
  813. format: "yyyy-MM-dd HH:mm",
  814. valueFormat: "yyyy-MM-dd HH:mm:ss",
  815. index: 1,
  816. width: 126,
  817. searchOrder:1,
  818. search: true,
  819. }, {
  820. label: '车号',
  821. prop: 'plateNo',
  822. index: 10,
  823. width: 90,
  824. search: true,
  825. searchOrder:2,
  826. overHidden: true,
  827. }, {
  828. label: '物流运输',
  829. prop: 'dispatchDept',
  830. search: true,
  831. dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
  832. type: "select",
  833. props: {
  834. label: "deptName",
  835. value: "id"
  836. },
  837. overHidden: true,
  838. index: 2,
  839. width: 80
  840. }, {
  841. label: '运输调度',
  842. prop: 'dispatcherName',
  843. overHidden: true,
  844. index: 3,
  845. width: 70,
  846. }, {
  847. label: '派车单号',
  848. width: 80,
  849. index: 4,
  850. overHidden: true,
  851. search: true,
  852. prop: 'dispatchNumber'
  853. }, {
  854. label: '合同号',
  855. width: 90,
  856. index: 5,
  857. overHidden: true,
  858. search: true,
  859. prop: 'contractNo'
  860. }, {
  861. label: '装货地点',
  862. prop: 'addressDetail',
  863. index: 6,
  864. width: 132,
  865. }, {
  866. label: '卸货地点',
  867. prop: 'unloadingPlace',
  868. index: 7,
  869. width: 132,
  870. }, {
  871. label: '车型',
  872. width: 90,
  873. index: 8,
  874. prop: 'fleetVolum'
  875. }, {
  876. label: '车队',
  877. prop: 'fleetShortName',
  878. index: 9,
  879. width: 90,
  880. searchProp: 'fleetId',
  881. type: 'select',
  882. cascader: ['plateNo'],
  883. props: {
  884. label: "cname",
  885. value: "id"
  886. },
  887. filterable: true,
  888. search: true,
  889. overHidden: true,
  890. }, {
  891. label: '应付运费',
  892. prop: 'landAmountC',
  893. index: 11,
  894. width: 100,
  895. overHidden: true,
  896. }, {
  897. label: '应付杂费',
  898. prop: 'extraAmountC',
  899. index: 12,
  900. width: 100,
  901. overHidden: true
  902. }, {
  903. label: '备注',
  904. prop: 'remarks',
  905. index: 13,
  906. width: 100,
  907. overHidden: true,
  908. }, {
  909. label: '应付杂费明细',
  910. width: 100,
  911. index: 14,
  912. overHidden: true,
  913. prop: 'extraAmountItemC'
  914. }]
  915. }
  916. }
  917. },
  918. async created() {
  919. if (this.roleName.indexOf('客户') !== -1) {
  920. this.optionList = this.optionListOne
  921. } else if (this.roleName.indexOf('平台') !== -1||this.roleName.indexOf('admin') !== -1) {
  922. this.optionList = this.optionListTwo
  923. } else if (this.roleName.indexOf('车队') !== -1) {
  924. this.optionList = this.optionListThree
  925. } else {
  926. this.optionList = this.optionListOne
  927. }
  928. if (this.roleName.indexOf('admin') !== -1 || this.roleName.indexOf('总调度') !== -1){
  929. let type = false
  930. for (let item in this.optionList.column){
  931. if (this.optionList.column[item].prop == 'profit'){
  932. type = true
  933. }
  934. }
  935. if (!type){
  936. this.optionList.column.push({
  937. label: '利润',
  938. width: 80,
  939. precision: 2,
  940. index: 17,
  941. type: 'number',
  942. prop: 'profit'
  943. })
  944. }
  945. }else {
  946. for (let item in this.optionList.column){
  947. if (this.optionList.column[item].prop == 'profit'){
  948. this.optionList.column.splice(item, 1);
  949. }
  950. }
  951. }
  952. this.goodsOptionCrud = await this.getColumnData(this.getColumnName(88.3), this.optionList);
  953. if (this.roleName.indexOf('admin') !== -1 || this.roleName.indexOf('总调度') !== -1){
  954. this.goodsOptionCrud.column.push({
  955. label: '利润',
  956. width: 80,
  957. precision: 2,
  958. index: 17,
  959. type: 'number',
  960. prop: 'profit'
  961. })
  962. }else {
  963. for (let item in this.goodsOptionCrud.column){
  964. if (this.goodsOptionCrud.column[item].prop == 'profit'){
  965. this.goodsOptionCrud.column.splice(item, 1);
  966. }
  967. }
  968. }
  969. this.collectionOption = await this.getColumnData(this.getColumnName(88.2), this.collectionOptionBackup);
  970. getSalesman().then(res=>{
  971. this.findObject(this.goodsOptionCrud.column, "salesmanName").dicData = res.data.data
  972. })
  973. fleetList().then(res=>{
  974. this.findObject(this.option.column, "fleetShortName").dicData = res.data.data
  975. })
  976. this.key++
  977. this.calculateHu()
  978. },
  979. methods: {
  980. calculateHu() {
  981. let i = 0;
  982. this.goodsOptionCrud.column.forEach(item => {
  983. if (item.search === true) i++
  984. })
  985. if (i % 3 !== 0) {
  986. const num = 3 - Number(i % 3)
  987. this.goodsOptionCrud.searchMenuSpan = num * 8;
  988. this.goodsOptionCrud.searchMenuPosition = "right";
  989. }else {
  990. this.goodsOptionCrud.searchMenuSpan = 3 * 8;
  991. this.goodsOptionCrud.searchMenuPosition = "right";
  992. }
  993. },
  994. openTrack(row) {
  995. gaude({itemId: row.id, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
  996. this.lineArr = res.data.data.trackArray
  997. this.parkingPoint = res.data.data.parkArray
  998. this.dialogVisibleTwo = true
  999. this.loadingDialog = true
  1000. let this_ = this
  1001. setTimeout(function () {
  1002. this_.$refs.playback.initMap();
  1003. this_.loadingDialog = false
  1004. }, 1500)
  1005. })
  1006. },
  1007. //导出
  1008. outExport() {
  1009. this.$confirm('是否导出数据明细?', '提示', {
  1010. confirmButtonText: '确定',
  1011. cancelButtonText: '取消',
  1012. type: 'warning'
  1013. }).then(() => {
  1014. let queryParams = this.query
  1015. if (queryParams.arrivalTime) {
  1016. queryParams.beginArrivalTime = queryParams.arrivalTime[0]
  1017. queryParams.endArrivalTime = queryParams.arrivalTime[1]
  1018. delete queryParams.arrivalTime
  1019. }
  1020. const routeData = this.$router.resolve({
  1021. path: '/api/blade-land/order/acct-export', //跳转目标窗口的地址
  1022. query: {
  1023. ...queryParams //括号内是要传递给新窗口的参数
  1024. }
  1025. })
  1026. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  1027. }).catch(() => {
  1028. this.$message({
  1029. type: 'info',
  1030. message: '已取消' //
  1031. });
  1032. })
  1033. },
  1034. //自定义列保存
  1035. async saveColumnCollection() {
  1036. /**
  1037. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1038. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1039. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1040. */
  1041. const inSave = await this.saveColumnData(this.getColumnName(88.2), this.collectionOption);
  1042. if (inSave) {
  1043. this.$message.success("保存成功");
  1044. //关闭窗口
  1045. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  1046. }
  1047. },
  1048. //自定义列重置
  1049. async resetColumnCollection() {
  1050. this.collectionOption = this.collectionOptionBackup;
  1051. const inSave = await this.delColumnData(this.getColumnName(88.2), this.collectionOptionBackup);
  1052. if (inSave) {
  1053. this.$message.success("重置成功");
  1054. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  1055. }
  1056. },
  1057. //自定义列保存
  1058. async saveColumn() {
  1059. /**
  1060. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1061. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1062. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1063. */
  1064. const inSave = await this.saveColumnData(this.getColumnName(88.3), this.goodsOptionCrud);
  1065. if (inSave) {
  1066. this.$message.success("保存成功");
  1067. //关闭窗口
  1068. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1069. }
  1070. },
  1071. //自定义列重置
  1072. async resetColumn() {
  1073. this.goodsOptionCrud = this.optionList;
  1074. const inSave = await this.delColumnData(this.getColumnName(88.3), this.optionList);
  1075. if (inSave) {
  1076. this.$message.success("重置成功");
  1077. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1078. }
  1079. },
  1080. //行跳转
  1081. celJump(row, index) {
  1082. this.$router.push({
  1083. path: '/landTransportation/bulkCargo/index',
  1084. query: {id: '台账' + row.orderId},
  1085. });
  1086. },
  1087. // 获得高度
  1088. searchCriteriaSwitch(type) {
  1089. if (type) {
  1090. this.goodsOptionCrud.height = this.goodsOptionCrud.height - 90
  1091. } else {
  1092. this.goodsOptionCrud.height = this.goodsOptionCrud.height + 90
  1093. }
  1094. this.$refs.crud.getTableHeight()
  1095. },
  1096. //箱信息保存
  1097. rowSave(row, index, done, loading) {
  1098. done()
  1099. },
  1100. //箱信息选择车队
  1101. getfleetIdT(data, row) {
  1102. this.$set(row, 'fleetName', data.cname)
  1103. },
  1104. //搜索
  1105. searchChange(params, done) {
  1106. this.query = params;
  1107. this.onLoad(this.page, params)
  1108. done();
  1109. },
  1110. //切换订单状态
  1111. handleClick(tab) {
  1112. this.activeName = tab
  1113. this.onLoad(this.page)
  1114. },
  1115. //删除对象空值
  1116. removeProperty(obj) {
  1117. Object.keys(obj).forEach(item => {
  1118. if (obj[item] === '' || obj[item] === undefined || obj[item] === null || obj[item] === 'null') delete obj[item]
  1119. })
  1120. return obj
  1121. },
  1122. //查询
  1123. onLoad(page, params) {
  1124. motorcadeDriver(4).then(res => {
  1125. this.totalData = res.data.data
  1126. })
  1127. let queryParams = {
  1128. size: page.pageSize,
  1129. current: page.currentPage,
  1130. tag: '0',
  1131. shippingMode: '散货',
  1132. ...params ? params : this.query
  1133. }
  1134. if (queryParams.arrivalTime) {
  1135. queryParams.beginArrivalTime = queryParams.arrivalTime[0]
  1136. queryParams.endArrivalTime = queryParams.arrivalTime[1]
  1137. delete queryParams.arrivalTime
  1138. }
  1139. queryParams = this.removeProperty(queryParams)
  1140. this.loading = true;
  1141. if (this.loading) this.dialogVisibleTwo = false
  1142. standingBookCollection(queryParams).then(res => {
  1143. this.goodsList = res.data.data.records
  1144. this.page.total = res.data.data.total
  1145. this.goodsOptionCrud.height = window.innerHeight - 245;
  1146. }).finally(() => {
  1147. this.loading = false;
  1148. })
  1149. },
  1150. //箱信息保存
  1151. rowSaveT(row, index, done, loading) {
  1152. if (row.$cellEdit) {
  1153. fleetDriverSave(row).then(res => {
  1154. this.$message.success("保存成功");
  1155. })
  1156. }
  1157. this.$refs.crud.rowCell(row, index)
  1158. },
  1159. //箱信息派车
  1160. designate(row) {
  1161. this.$confirm('是否确定受理', '提示', {
  1162. confirmButtonText: '确定',
  1163. cancelButtonText: '取消',
  1164. type: 'warning'
  1165. }).then(() => {
  1166. acceptanceCollection(row).then(res => {
  1167. this.$message.success('操作成功');
  1168. this.onLoad(this.page)
  1169. })
  1170. }).catch(() => {
  1171. this.$message({
  1172. type: 'info',
  1173. message: '已取消'
  1174. });
  1175. });
  1176. },
  1177. //取消派车
  1178. cancelDesignate(row) {
  1179. this.$confirm('是否确定取消受理', '提示', {
  1180. confirmButtonText: '确定',
  1181. cancelButtonText: '取消',
  1182. type: 'warning'
  1183. }).then(() => {
  1184. acceptanceDispatchCollection({id: row.id}).then(res => {
  1185. this.$message.success('操作成功');
  1186. this.onLoad(this.page)
  1187. })
  1188. }).catch(() => {
  1189. this.$message({
  1190. type: 'info',
  1191. message: '已取消'
  1192. });
  1193. });
  1194. },
  1195. confirmCompletion(row) {
  1196. this.$confirm('是否确定完工', '提示', {
  1197. confirmButtonText: '确定',
  1198. cancelButtonText: '取消',
  1199. type: 'warning'
  1200. }).then(() => {
  1201. confirmCompletion({id: row.id}).then(res => {
  1202. this.$message.success('操作成功');
  1203. this.onLoad(this.page)
  1204. })
  1205. }).catch(() => {
  1206. this.$message({
  1207. type: 'info',
  1208. message: '已取消'
  1209. });
  1210. });
  1211. },
  1212. //打开附件
  1213. annexOpen(row, index) {
  1214. this.enclosure = true
  1215. this.formAnnex = row
  1216. getFee({id: row.id}).then(res => {
  1217. this.orderList = res.data.data
  1218. })
  1219. },
  1220. //保存
  1221. saveAnnex() {
  1222. saveAttached({
  1223. id: this.form.id,
  1224. fileList: this.orderList
  1225. }).then(res => {
  1226. this.annexOpen(this.form)
  1227. })
  1228. },
  1229. ToBreak(val) {
  1230. if (val) return val.replace(/\n/g, '<br/>')
  1231. },
  1232. incidentalConfirm(row) {
  1233. incidental({
  1234. itemId: row.itemId,
  1235. plateNo: row.plateNo,
  1236. type: '1'
  1237. }).then(res => {
  1238. this.collectionList = res.data.data
  1239. this.incidentalType = true
  1240. this.confirmStatus = row.confirmStatus
  1241. })
  1242. },
  1243. incidentalClick() {
  1244. if (this.confirmStatus == 0) {
  1245. incidentalConfirm({itemId: this.collectionList[0].itemId}).then(res => {
  1246. this.$message.success("确认成功");
  1247. this.onLoad(this.page)
  1248. })
  1249. } else {
  1250. cancelConfirm({itemId: this.collectionList[0].itemId}).then(res => {
  1251. this.$message.success("取消成功");
  1252. this.onLoad(this.page)
  1253. })
  1254. }
  1255. this.incidentalType = false
  1256. }
  1257. }
  1258. }
  1259. </script>
  1260. <style lang="scss" scoped>
  1261. .home-container {
  1262. padding: 0px 5px 5px 5px;
  1263. box-sizing: border-box;
  1264. height: 100%;
  1265. ::v-deep .el-card__body {
  1266. padding: 10px 15px;
  1267. font-size: 14px;
  1268. }
  1269. &__card {
  1270. width: 100%;
  1271. height: 100%;
  1272. }
  1273. .title {
  1274. display: flex;
  1275. justify-content: space-between;
  1276. .right {
  1277. display: flex;
  1278. align-items: center;
  1279. &_but {
  1280. margin-right: 10px;
  1281. border: 1px solid #409eff;
  1282. width: 80px;
  1283. border-radius: 3px;
  1284. display: flex;
  1285. &_left {
  1286. width: 40px;
  1287. text-align: center;
  1288. color: #409eff;
  1289. cursor: pointer;
  1290. }
  1291. &_right {
  1292. width: 40px;
  1293. text-align: center;
  1294. color: #409eff;
  1295. cursor: pointer;
  1296. }
  1297. &_active {
  1298. color: #fff;
  1299. background-color: #409eff;
  1300. }
  1301. }
  1302. }
  1303. }
  1304. }
  1305. .content {
  1306. display: flex;
  1307. justify-content: center;
  1308. align-items: center;
  1309. height: 6vh;
  1310. width: 80vw;
  1311. .divider {
  1312. display: block;
  1313. height: 0px;
  1314. width: 100%;
  1315. border-top: 1px dashed #dcdfe6;
  1316. }
  1317. &-item {
  1318. margin-left: 1vw;
  1319. .card {
  1320. width: 130px;
  1321. display: flex;
  1322. align-items: center;
  1323. &-title {
  1324. width: 40px;
  1325. height: 40px;
  1326. text-align: center;
  1327. border-radius: 50%;
  1328. font-size: 20px;
  1329. font-weight: 600;
  1330. display: flex;
  1331. justify-content: center;
  1332. align-items: center;
  1333. span {
  1334. line-height: 20px;
  1335. }
  1336. }
  1337. &-title1 {
  1338. color: #037fe1;
  1339. background-color: rgba(3, 127, 225, 0.15);
  1340. }
  1341. &-title2 {
  1342. color: #ffa21e;
  1343. background-color: rgba(255, 162, 30, 0.15);
  1344. }
  1345. &-title3 {
  1346. color: #fb5b60;
  1347. background-color: rgba(251, 91, 96, 0.15);
  1348. }
  1349. &-title4 {
  1350. color: #42bc6f;
  1351. background-color: rgba(66, 188, 111, 0.15);
  1352. }
  1353. &-title5 {
  1354. color: #14cde1;
  1355. background-color: rgba(52, 149, 161, 0.15);
  1356. }
  1357. &-title6 {
  1358. color: rgba(4, 66, 31, 0.63);
  1359. background-color: rgba(66, 188, 111, 0.15);
  1360. }
  1361. &-content {
  1362. padding-left: 1vw;
  1363. display: flex;
  1364. flex-direction: column;
  1365. &-num {
  1366. font-size: 20px;
  1367. font-weight: 600;
  1368. }
  1369. &-text {
  1370. color: #909399;
  1371. }
  1372. }
  1373. }
  1374. }
  1375. }
  1376. </style>