index.vue 33 KB

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