index.vue 41 KB

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