index.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390
  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. search: true,
  362. }, {
  363. label: '货运日期',
  364. prop: 'arrivalTime',
  365. overHidden: true,
  366. type: "date",
  367. searchRange: true,
  368. defaultTime: ['00:00:00', '23:59:59'],
  369. format: "yyyy-MM-dd HH:mm",
  370. valueFormat: "yyyy-MM-dd HH:mm:ss",
  371. index: 2,
  372. width: 126,
  373. search: true,
  374. }, {
  375. label: '业务员',
  376. prop: 'salesmanName',
  377. index: 3,
  378. width: 70,
  379. searchProp: 'salesman',
  380. search: true,
  381. overHidden: true,
  382. filterable: true,
  383. type: "select",
  384. dicUrl: "/api/blade-user/userList?roleAlias=业务员",
  385. props: {
  386. label: "realName",
  387. value: "id"
  388. }
  389. }, {
  390. label: '物流运输',
  391. prop: 'dispatchDept',
  392. search: true,
  393. dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
  394. type: "select",
  395. props: {
  396. label: "deptName",
  397. value: "id"
  398. },
  399. overHidden: true,
  400. index: 4,
  401. width: 80
  402. }, {
  403. label: '运输调度',
  404. prop: 'dispatcherName',
  405. overHidden: true,
  406. index: 5,
  407. width: 70,
  408. }, {
  409. label: '派车单号',
  410. width: 80,
  411. index: 5,
  412. overHidden: true,
  413. search: true,
  414. prop: 'dispatchNumber'
  415. }, {
  416. label: '合同号',
  417. width: 90,
  418. index: 6,
  419. overHidden: true,
  420. search: true,
  421. prop: 'contractNo'
  422. }, {
  423. label: '装货地点',
  424. prop: 'addressDetail',
  425. index: 7,
  426. width: 132,
  427. }, {
  428. label: '卸货地点',
  429. prop: 'unloadingPlace',
  430. index: 8,
  431. width: 132,
  432. }, {
  433. label: '车型',
  434. width: 90,
  435. index: 9,
  436. prop: 'fleetVolum'
  437. }, {
  438. label: '车队',
  439. prop: 'fleetShortName',
  440. index: 10,
  441. width: 90,
  442. searchProp: 'fleetId',
  443. type: 'select',
  444. cascader: ['plateNo'],
  445. props: {
  446. label: "cname",
  447. value: "id"
  448. },
  449. filterable: true,
  450. search: true,
  451. overHidden: true,
  452. }, {
  453. label: '车号',
  454. prop: 'plateNo',
  455. index: 11,
  456. width: 90,
  457. overHidden: true,
  458. }, {
  459. label: '应收运费',
  460. overHidden: true,
  461. index: 12,
  462. width: 100,
  463. prop: 'landAmountD'
  464. }, {
  465. label: '应收杂费',
  466. prop: 'extraAmountD',
  467. index: 13,
  468. width: 100,
  469. overHidden: true,
  470. }, {
  471. label: '备注',
  472. prop: 'remarks',
  473. index: 14,
  474. width: 100,
  475. overHidden: true,
  476. }, {
  477. label: '应付杂费明细',
  478. width: 100,
  479. index: 15,
  480. overHidden: true,
  481. prop: 'extraAmountItemC'
  482. }]
  483. },
  484. //平台
  485. optionListTwo: {
  486. stripe: true,
  487. index: true,
  488. addBtn: false,
  489. delBtn: false,
  490. cellBtn: false,
  491. cancelBtn: false,
  492. editBtn: false,
  493. addRowBtn: false,
  494. refreshBtn: false,
  495. searchIcon: true,
  496. searchIndex: 2,
  497. searchSpan: 8,
  498. menuWidth: 140,
  499. menu: true,
  500. searchMenuPosition: "right",
  501. searchMenuSpan: 6,
  502. align: 'center',
  503. height: "auto",
  504. showSummary: true,
  505. summaryText: "合计",
  506. sumColumnList: [
  507. {
  508. name: 'landWeight',
  509. type: 'sum',
  510. decimals: 2
  511. }, {
  512. name: 'landAmountC',
  513. type: 'sum',
  514. decimals: 2
  515. }, {
  516. name: 'ctnQuantity',
  517. type: 'count'
  518. }, {
  519. name: 'oneFeeC',
  520. type: 'sum',
  521. decimals: 2
  522. }, {
  523. name: 'twoFeeC',
  524. type: 'sum',
  525. decimals: 2
  526. }, {
  527. name: 'threeFeeC',
  528. type: 'sum',
  529. decimals: 2
  530. }, {
  531. name: 'fourFeeC',
  532. type: 'sum',
  533. decimals: 2
  534. }, {
  535. name: 'fiveFeeC',
  536. type: 'sum',
  537. decimals: 2
  538. }, {
  539. name: 'oneFeeD',
  540. type: 'sum',
  541. decimals: 2
  542. }, {
  543. name: 'twoFeeD',
  544. type: 'sum',
  545. decimals: 2
  546. }, {
  547. name: 'threeFeeD',
  548. type: 'sum',
  549. decimals: 2
  550. }, {
  551. name: 'fourFeeD',
  552. type: 'sum',
  553. decimals: 2
  554. }, {
  555. name: 'fiveFeeD',
  556. type: 'sum',
  557. decimals: 2
  558. }, {
  559. name: 'profit',
  560. type: 'sum',
  561. decimals: 2
  562. }, {
  563. name: 'extraAmountC',
  564. type: 'sum',
  565. decimals: 2
  566. }, {
  567. name: 'landAmountD',
  568. type: 'sum',
  569. decimals: 2
  570. }, {
  571. name: 'extraAmountD',
  572. type: 'sum',
  573. decimals: 2
  574. }],
  575. column: [{
  576. label: '客户名称',
  577. prop: 'corpShortName',
  578. overHidden: true,
  579. index: 1,
  580. width: 100,
  581. search: true,
  582. }, {
  583. label: '货运日期',
  584. prop: 'arrivalTime',
  585. overHidden: true,
  586. type: "date",
  587. searchRange: true,
  588. defaultTime: ['00:00:00', '23:59:59'],
  589. format: "yyyy-MM-dd HH:mm",
  590. valueFormat: "yyyy-MM-dd HH:mm:ss",
  591. index: 2,
  592. width: 126,
  593. search: true,
  594. }, {
  595. label: '业务员',
  596. prop: 'salesmanName',
  597. index: 3,
  598. width: 70,
  599. searchProp: 'salesman',
  600. search: true,
  601. overHidden: true,
  602. filterable: true,
  603. type: "select",
  604. dicUrl: "/api/blade-user/userList?roleAlias=业务员",
  605. props: {
  606. label: "realName",
  607. value: "id"
  608. }
  609. }, {
  610. label: '运输调度',
  611. prop: 'dispatcherName',
  612. overHidden: true,
  613. index: 4,
  614. width: 70,
  615. }, {
  616. label: '派车单号',
  617. width: 80,
  618. index: 5,
  619. overHidden: true,
  620. search: true,
  621. prop: 'dispatchNumber'
  622. }, {
  623. label: '合同号',
  624. width: 90,
  625. index: 6,
  626. overHidden: true,
  627. search: true,
  628. prop: 'contractNo'
  629. }, {
  630. label: '装货地点',
  631. prop: 'addressDetail',
  632. index: 7,
  633. width: 132,
  634. }, {
  635. label: '卸货地点',
  636. prop: 'unloadingPlace',
  637. index: 8,
  638. width: 132,
  639. }, {
  640. label: '车型',
  641. width: 90,
  642. index: 9,
  643. prop: 'fleetVolum'
  644. }, {
  645. label: '车队',
  646. prop: 'fleetShortName',
  647. index: 10,
  648. width: 90,
  649. searchProp: 'fleetId',
  650. type: 'select',
  651. cascader: ['plateNo'],
  652. props: {
  653. label: "cname",
  654. value: "id"
  655. },
  656. filterable: true,
  657. search: true,
  658. overHidden: true,
  659. }, {
  660. label: '车号',
  661. prop: 'plateNo',
  662. index: 11,
  663. width: 90,
  664. overHidden: true,
  665. }, {
  666. label: '应收运费',
  667. overHidden: true,
  668. index: 12,
  669. width: 100,
  670. prop: 'landAmountD'
  671. }, {
  672. label: '应收杂费',
  673. prop: 'extraAmountD',
  674. index: 13,
  675. width: 100,
  676. overHidden: true,
  677. }, {
  678. label: '备注',
  679. prop: 'remarks',
  680. index: 14,
  681. width: 100,
  682. overHidden: true,
  683. }, {
  684. label: '应付运费',
  685. prop: 'landAmountC',
  686. index: 15,
  687. width: 100,
  688. overHidden: true,
  689. }, {
  690. label: '应付杂费',
  691. prop: 'extraAmountC',
  692. index: 16,
  693. width: 100,
  694. overHidden: true
  695. }, {
  696. label: '应收杂费明细',
  697. width: 100,
  698. index: 18,
  699. prop: 'extraAmountItemD'
  700. }, {
  701. label: '应付杂费明细',
  702. width: 100,
  703. index: 19,
  704. overHidden: true,
  705. prop: 'extraAmountItemC'
  706. }]
  707. },
  708. //车队
  709. optionListThree: {
  710. stripe: true,
  711. index: true,
  712. addBtn: false,
  713. delBtn: false,
  714. cellBtn: false,
  715. cancelBtn: false,
  716. editBtn: false,
  717. addRowBtn: false,
  718. refreshBtn: false,
  719. searchIcon: true,
  720. searchIndex: 2,
  721. searchSpan: 8,
  722. menuWidth: 140,
  723. menu: true,
  724. searchMenuPosition: "right",
  725. searchMenuSpan: 6,
  726. align: 'center',
  727. height: "auto",
  728. showSummary: true,
  729. summaryText: "合计",
  730. sumColumnList: [
  731. {
  732. name: 'landWeight',
  733. type: 'sum',
  734. decimals: 2
  735. }, {
  736. name: 'landAmountC',
  737. type: 'sum',
  738. decimals: 2
  739. }, {
  740. name: 'ctnQuantity',
  741. type: 'count'
  742. }, {
  743. name: 'oneFeeC',
  744. type: 'sum',
  745. decimals: 2
  746. }, {
  747. name: 'twoFeeC',
  748. type: 'sum',
  749. decimals: 2
  750. }, {
  751. name: 'threeFeeC',
  752. type: 'sum',
  753. decimals: 2
  754. }, {
  755. name: 'fourFeeC',
  756. type: 'sum',
  757. decimals: 2
  758. }, {
  759. name: 'fiveFeeC',
  760. type: 'sum',
  761. decimals: 2
  762. }, {
  763. name: 'oneFeeD',
  764. type: 'sum',
  765. decimals: 2
  766. }, {
  767. name: 'twoFeeD',
  768. type: 'sum',
  769. decimals: 2
  770. }, {
  771. name: 'threeFeeD',
  772. type: 'sum',
  773. decimals: 2
  774. }, {
  775. name: 'fourFeeD',
  776. type: 'sum',
  777. decimals: 2
  778. }, {
  779. name: 'fiveFeeD',
  780. type: 'sum',
  781. decimals: 2
  782. }, {
  783. name: 'profit',
  784. type: 'sum',
  785. decimals: 2
  786. }, {
  787. name: 'extraAmountC',
  788. type: 'sum',
  789. decimals: 2
  790. }, {
  791. name: 'landAmountD',
  792. type: 'sum',
  793. decimals: 2
  794. }, {
  795. name: 'extraAmountD',
  796. type: 'sum',
  797. decimals: 2
  798. }],
  799. column: [{
  800. label: '货运日期',
  801. prop: 'arrivalTime',
  802. overHidden: true,
  803. type: "date",
  804. searchRange: true,
  805. defaultTime: ['00:00:00', '23:59:59'],
  806. format: "yyyy-MM-dd HH:mm",
  807. valueFormat: "yyyy-MM-dd HH:mm:ss",
  808. index: 1,
  809. width: 126,
  810. search: true,
  811. }, {
  812. label: '物流运输',
  813. prop: 'dispatchDept',
  814. search: true,
  815. dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
  816. type: "select",
  817. props: {
  818. label: "deptName",
  819. value: "id"
  820. },
  821. overHidden: true,
  822. index: 2,
  823. width: 80
  824. }, {
  825. label: '运输调度',
  826. prop: 'dispatcherName',
  827. overHidden: true,
  828. index: 3,
  829. width: 70,
  830. }, {
  831. label: '派车单号',
  832. width: 80,
  833. index: 4,
  834. overHidden: true,
  835. search: true,
  836. prop: 'dispatchNumber'
  837. }, {
  838. label: '合同号',
  839. width: 90,
  840. index: 5,
  841. overHidden: true,
  842. search: true,
  843. prop: 'contractNo'
  844. }, {
  845. label: '装货地点',
  846. prop: 'addressDetail',
  847. index: 6,
  848. width: 132,
  849. }, {
  850. label: '卸货地点',
  851. prop: 'unloadingPlace',
  852. index: 7,
  853. width: 132,
  854. }, {
  855. label: '车型',
  856. width: 90,
  857. index: 8,
  858. prop: 'fleetVolum'
  859. }, {
  860. label: '车队',
  861. prop: 'fleetShortName',
  862. index: 9,
  863. width: 90,
  864. searchProp: 'fleetId',
  865. type: 'select',
  866. cascader: ['plateNo'],
  867. props: {
  868. label: "cname",
  869. value: "id"
  870. },
  871. filterable: true,
  872. search: true,
  873. overHidden: true,
  874. }, {
  875. label: '车号',
  876. prop: 'plateNo',
  877. index: 10,
  878. width: 90,
  879. overHidden: true,
  880. }, {
  881. label: '应付运费',
  882. prop: 'landAmountC',
  883. index: 11,
  884. width: 100,
  885. overHidden: true,
  886. }, {
  887. label: '应付杂费',
  888. prop: 'extraAmountC',
  889. index: 12,
  890. width: 100,
  891. overHidden: true
  892. }, {
  893. label: '备注',
  894. prop: 'remarks',
  895. index: 13,
  896. width: 100,
  897. overHidden: true,
  898. }, {
  899. label: '应付杂费明细',
  900. width: 100,
  901. index: 14,
  902. overHidden: true,
  903. prop: 'extraAmountItemC'
  904. }]
  905. }
  906. }
  907. },
  908. async created() {
  909. if (this.roleName.indexOf('客户') !== -1) {
  910. this.optionList = this.optionListOne
  911. } else if (this.roleName.indexOf('平台') !== -1||this.roleName.indexOf('admin') !== -1) {
  912. this.optionList = this.optionListTwo
  913. } else if (this.roleName.indexOf('车队') !== -1) {
  914. this.optionList = this.optionListThree
  915. } else {
  916. this.optionList = this.optionListOne
  917. }
  918. if (this.roleName.indexOf('admin') !== -1 || this.roleName.indexOf('总调度') !== -1){
  919. let type = false
  920. for (let item in this.optionList.column){
  921. if (this.optionList.column[item].prop == 'profit'){
  922. type = true
  923. }
  924. }
  925. if (!type){
  926. this.optionList.column.push({
  927. label: '利润',
  928. width: 80,
  929. precision: 2,
  930. index: 17,
  931. type: 'number',
  932. prop: 'profit'
  933. })
  934. }
  935. }else {
  936. for (let item in this.optionList.column){
  937. if (this.optionList.column[item].prop == 'profit'){
  938. this.optionList.column.splice(item, 1);
  939. }
  940. }
  941. }
  942. this.goodsOptionCrud = await this.getColumnData(this.getColumnName(88.3), this.optionList);
  943. if (this.roleName.indexOf('admin') !== -1 || this.roleName.indexOf('总调度') !== -1){
  944. this.goodsOptionCrud.column.push({
  945. label: '利润',
  946. width: 80,
  947. precision: 2,
  948. index: 17,
  949. type: 'number',
  950. prop: 'profit'
  951. })
  952. }else {
  953. for (let item in this.goodsOptionCrud.column){
  954. if (this.goodsOptionCrud.column[item].prop == 'profit'){
  955. this.goodsOptionCrud.column.splice(item, 1);
  956. }
  957. }
  958. }
  959. this.collectionOption = await this.getColumnData(this.getColumnName(88.2), this.collectionOptionBackup);
  960. getSalesman().then(res=>{
  961. this.findObject(this.goodsOptionCrud.column, "salesmanName").dicData = res.data.data
  962. })
  963. fleetList().then(res=>{
  964. this.findObject(this.option.column, "fleetShortName").dicData = res.data.data
  965. })
  966. this.key++
  967. this.calculateHu()
  968. },
  969. methods: {
  970. calculateHu() {
  971. let i = 0;
  972. this.goodsOptionCrud.column.forEach(item => {
  973. if (item.search === true) i++
  974. })
  975. if (i % 3 !== 0) {
  976. const num = 3 - Number(i % 3)
  977. this.goodsOptionCrud.searchMenuSpan = num * 8;
  978. this.goodsOptionCrud.searchMenuPosition = "right";
  979. }
  980. },
  981. openTrack(row) {
  982. gaude({itemId: row.id, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
  983. this.lineArr = res.data.data.trackArray
  984. this.parkingPoint = res.data.data.parkArray
  985. this.dialogVisibleTwo = true
  986. this.loadingDialog = true
  987. let this_ = this
  988. setTimeout(function () {
  989. this_.$refs.playback.initMap();
  990. this_.loadingDialog = false
  991. }, 1500)
  992. })
  993. },
  994. //导出
  995. outExport() {
  996. this.$confirm('是否导出数据明细?', '提示', {
  997. confirmButtonText: '确定',
  998. cancelButtonText: '取消',
  999. type: 'warning'
  1000. }).then(() => {
  1001. let queryParams = this.query
  1002. if (queryParams.arrivalTime) {
  1003. queryParams.beginArrivalTime = queryParams.arrivalTime[0]
  1004. queryParams.endArrivalTime = queryParams.arrivalTime[1]
  1005. delete queryParams.arrivalTime
  1006. }
  1007. const routeData = this.$router.resolve({
  1008. path: '/api/blade-land/order/acct-export', //跳转目标窗口的地址
  1009. query: {
  1010. ...queryParams //括号内是要传递给新窗口的参数
  1011. }
  1012. })
  1013. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  1014. }).catch(() => {
  1015. this.$message({
  1016. type: 'info',
  1017. message: '已取消' //
  1018. });
  1019. })
  1020. },
  1021. //自定义列保存
  1022. async saveColumnCollection() {
  1023. /**
  1024. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1025. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1026. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1027. */
  1028. const inSave = await this.saveColumnData(this.getColumnName(88.2), this.collectionOption);
  1029. if (inSave) {
  1030. this.$message.success("保存成功");
  1031. //关闭窗口
  1032. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  1033. }
  1034. },
  1035. //自定义列重置
  1036. async resetColumnCollection() {
  1037. this.collectionOption = this.collectionOptionBackup;
  1038. const inSave = await this.delColumnData(this.getColumnName(88.2), this.collectionOptionBackup);
  1039. if (inSave) {
  1040. this.$message.success("重置成功");
  1041. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  1042. }
  1043. },
  1044. //自定义列保存
  1045. async saveColumn() {
  1046. /**
  1047. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1048. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1049. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1050. */
  1051. const inSave = await this.saveColumnData(this.getColumnName(88.3), this.goodsOptionCrud);
  1052. if (inSave) {
  1053. this.$message.success("保存成功");
  1054. //关闭窗口
  1055. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1056. }
  1057. },
  1058. //自定义列重置
  1059. async resetColumn() {
  1060. this.goodsOptionCrud = this.optionList;
  1061. const inSave = await this.delColumnData(this.getColumnName(88.3), this.optionList);
  1062. if (inSave) {
  1063. this.$message.success("重置成功");
  1064. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1065. }
  1066. },
  1067. //行跳转
  1068. celJump(row, index) {
  1069. this.$router.push({
  1070. path: '/landTransportation/bulkCargo/index',
  1071. query: {id: '台账' + row.orderId},
  1072. });
  1073. },
  1074. // 获得高度
  1075. searchCriteriaSwitch(type) {
  1076. if (type) {
  1077. this.goodsOptionCrud.height = this.goodsOptionCrud.height - 90
  1078. } else {
  1079. this.goodsOptionCrud.height = this.goodsOptionCrud.height + 90
  1080. }
  1081. this.$refs.crud.getTableHeight()
  1082. },
  1083. //箱信息保存
  1084. rowSave(row, index, done, loading) {
  1085. done()
  1086. },
  1087. //箱信息选择车队
  1088. getfleetIdT(data, row) {
  1089. this.$set(row, 'fleetName', data.cname)
  1090. },
  1091. //搜索
  1092. searchChange(params, done) {
  1093. this.query = params;
  1094. this.onLoad(this.page, params)
  1095. done();
  1096. },
  1097. //切换订单状态
  1098. handleClick(tab) {
  1099. this.activeName = tab
  1100. this.onLoad(this.page)
  1101. },
  1102. //删除对象空值
  1103. removeProperty(obj) {
  1104. Object.keys(obj).forEach(item => {
  1105. if (obj[item] === '' || obj[item] === undefined || obj[item] === null || obj[item] === 'null') delete obj[item]
  1106. })
  1107. return obj
  1108. },
  1109. //查询
  1110. onLoad(page, params) {
  1111. motorcadeDriver(4).then(res => {
  1112. this.totalData = res.data.data
  1113. })
  1114. let queryParams = {
  1115. size: page.pageSize,
  1116. current: page.currentPage,
  1117. tag: '0',
  1118. shippingMode: '散货',
  1119. ...params ? params : this.query
  1120. }
  1121. if (queryParams.arrivalTime) {
  1122. queryParams.beginArrivalTime = queryParams.arrivalTime[0]
  1123. queryParams.endArrivalTime = queryParams.arrivalTime[1]
  1124. delete queryParams.arrivalTime
  1125. }
  1126. queryParams = this.removeProperty(queryParams)
  1127. this.loading = true;
  1128. if (this.loading) this.dialogVisibleTwo = false
  1129. standingBookCollection(queryParams).then(res => {
  1130. this.goodsList = res.data.data.records
  1131. this.page.total = res.data.data.total
  1132. this.goodsOptionCrud.height = window.innerHeight - 245;
  1133. }).finally(() => {
  1134. this.loading = false;
  1135. })
  1136. },
  1137. //箱信息保存
  1138. rowSaveT(row, index, done, loading) {
  1139. if (row.$cellEdit) {
  1140. fleetDriverSave(row).then(res => {
  1141. this.$message.success("保存成功");
  1142. })
  1143. }
  1144. this.$refs.crud.rowCell(row, index)
  1145. },
  1146. //箱信息派车
  1147. designate(row) {
  1148. this.$confirm('是否确定受理', '提示', {
  1149. confirmButtonText: '确定',
  1150. cancelButtonText: '取消',
  1151. type: 'warning'
  1152. }).then(() => {
  1153. acceptanceCollection(row).then(res => {
  1154. this.$message.success('操作成功');
  1155. this.onLoad(this.page)
  1156. })
  1157. }).catch(() => {
  1158. this.$message({
  1159. type: 'info',
  1160. message: '已取消'
  1161. });
  1162. });
  1163. },
  1164. //取消派车
  1165. cancelDesignate(row) {
  1166. this.$confirm('是否确定取消受理', '提示', {
  1167. confirmButtonText: '确定',
  1168. cancelButtonText: '取消',
  1169. type: 'warning'
  1170. }).then(() => {
  1171. acceptanceDispatchCollection({id: row.id}).then(res => {
  1172. this.$message.success('操作成功');
  1173. this.onLoad(this.page)
  1174. })
  1175. }).catch(() => {
  1176. this.$message({
  1177. type: 'info',
  1178. message: '已取消'
  1179. });
  1180. });
  1181. },
  1182. confirmCompletion(row) {
  1183. this.$confirm('是否确定完工', '提示', {
  1184. confirmButtonText: '确定',
  1185. cancelButtonText: '取消',
  1186. type: 'warning'
  1187. }).then(() => {
  1188. confirmCompletion({id: row.id}).then(res => {
  1189. this.$message.success('操作成功');
  1190. this.onLoad(this.page)
  1191. })
  1192. }).catch(() => {
  1193. this.$message({
  1194. type: 'info',
  1195. message: '已取消'
  1196. });
  1197. });
  1198. },
  1199. //打开附件
  1200. annexOpen(row, index) {
  1201. this.enclosure = true
  1202. this.formAnnex = row
  1203. getFee({id: row.id}).then(res => {
  1204. this.orderList = res.data.data
  1205. })
  1206. },
  1207. //保存
  1208. saveAnnex() {
  1209. saveAttached({
  1210. id: this.form.id,
  1211. fileList: this.orderList
  1212. }).then(res => {
  1213. this.annexOpen(this.form)
  1214. })
  1215. },
  1216. ToBreak(val) {
  1217. if (val) return val.replace(/\n/g, '<br/>')
  1218. },
  1219. incidentalConfirm(row) {
  1220. incidental({
  1221. itemId: row.itemId,
  1222. plateNo: row.plateNo,
  1223. type: '1'
  1224. }).then(res => {
  1225. this.collectionList = res.data.data
  1226. this.incidentalType = true
  1227. this.confirmStatus = row.confirmStatus
  1228. })
  1229. },
  1230. incidentalClick() {
  1231. if (this.confirmStatus == 0) {
  1232. incidentalConfirm({itemId: this.collectionList[0].itemId}).then(res => {
  1233. this.$message.success("确认成功");
  1234. this.onLoad(this.page)
  1235. })
  1236. } else {
  1237. cancelConfirm({itemId: this.collectionList[0].itemId}).then(res => {
  1238. this.$message.success("取消成功");
  1239. this.onLoad(this.page)
  1240. })
  1241. }
  1242. this.incidentalType = false
  1243. }
  1244. }
  1245. }
  1246. </script>
  1247. <style lang="scss" scoped>
  1248. .home-container {
  1249. padding: 0px 5px 5px 5px;
  1250. box-sizing: border-box;
  1251. height: 100%;
  1252. ::v-deep .el-card__body {
  1253. padding: 10px 15px;
  1254. font-size: 14px;
  1255. }
  1256. &__card {
  1257. width: 100%;
  1258. height: 100%;
  1259. }
  1260. .title {
  1261. display: flex;
  1262. justify-content: space-between;
  1263. .right {
  1264. display: flex;
  1265. align-items: center;
  1266. &_but {
  1267. margin-right: 10px;
  1268. border: 1px solid #409eff;
  1269. width: 80px;
  1270. border-radius: 3px;
  1271. display: flex;
  1272. &_left {
  1273. width: 40px;
  1274. text-align: center;
  1275. color: #409eff;
  1276. cursor: pointer;
  1277. }
  1278. &_right {
  1279. width: 40px;
  1280. text-align: center;
  1281. color: #409eff;
  1282. cursor: pointer;
  1283. }
  1284. &_active {
  1285. color: #fff;
  1286. background-color: #409eff;
  1287. }
  1288. }
  1289. }
  1290. }
  1291. }
  1292. .content {
  1293. display: flex;
  1294. justify-content: center;
  1295. align-items: center;
  1296. height: 6vh;
  1297. width: 80vw;
  1298. .divider {
  1299. display: block;
  1300. height: 0px;
  1301. width: 100%;
  1302. border-top: 1px dashed #dcdfe6;
  1303. }
  1304. &-item {
  1305. margin-left: 1vw;
  1306. .card {
  1307. width: 130px;
  1308. display: flex;
  1309. align-items: center;
  1310. &-title {
  1311. width: 40px;
  1312. height: 40px;
  1313. text-align: center;
  1314. border-radius: 50%;
  1315. font-size: 20px;
  1316. font-weight: 600;
  1317. display: flex;
  1318. justify-content: center;
  1319. align-items: center;
  1320. span {
  1321. line-height: 20px;
  1322. }
  1323. }
  1324. &-title1 {
  1325. color: #037fe1;
  1326. background-color: rgba(3, 127, 225, 0.15);
  1327. }
  1328. &-title2 {
  1329. color: #ffa21e;
  1330. background-color: rgba(255, 162, 30, 0.15);
  1331. }
  1332. &-title3 {
  1333. color: #fb5b60;
  1334. background-color: rgba(251, 91, 96, 0.15);
  1335. }
  1336. &-title4 {
  1337. color: #42bc6f;
  1338. background-color: rgba(66, 188, 111, 0.15);
  1339. }
  1340. &-title5 {
  1341. color: #14cde1;
  1342. background-color: rgba(52, 149, 161, 0.15);
  1343. }
  1344. &-title6 {
  1345. color: rgba(4, 66, 31, 0.63);
  1346. background-color: rgba(66, 188, 111, 0.15);
  1347. }
  1348. &-content {
  1349. padding-left: 1vw;
  1350. display: flex;
  1351. flex-direction: column;
  1352. &-num {
  1353. font-size: 20px;
  1354. font-weight: 600;
  1355. }
  1356. &-text {
  1357. color: #909399;
  1358. }
  1359. }
  1360. }
  1361. }
  1362. }
  1363. </style>