detailPage.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button
  6. type="danger"
  7. style="border: none;background: none;color: red"
  8. icon="el-icon-arrow-left"
  9. @click="backToList"
  10. >返回列表
  11. </el-button>
  12. </div>
  13. </div>
  14. <containerTitle
  15. title="起止地信息"
  16. style="margin-top: 50px"></containerTitle>
  17. <basic-container>
  18. <el-table
  19. ref="singleTable"
  20. :data="tableData"
  21. size="mini"
  22. :header-cell-style="{color:'#000',background:'#fafafa'}"
  23. style="width: 100%">
  24. <el-table-column
  25. property="date"
  26. align="center"
  27. width="40">
  28. <template slot-scope="scope">
  29. <span v-if="scope.$index == 0">
  30. <el-button type="primary" size="mini" circle>起</el-button>
  31. </span>
  32. <span v-else-if="scope.$index === tableData.length-1">
  33. <el-button type="success" size="mini" circle>止</el-button>
  34. </span>
  35. <span v-else>
  36. <el-button v-if="goodsForm.status === 1" type="warning" size="mini" circle>途</el-button>
  37. <el-tooltip v-else class="item" effect="dark" content="删除" placement="right">
  38. <el-button type="danger" icon="el-icon-delete" size="mini" circle
  39. @click="deleteAddress(scope)"></el-button>
  40. </el-tooltip>
  41. </span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column
  45. type="index"
  46. label="序号"
  47. align="center"
  48. width="60">
  49. </el-table-column>
  50. <el-table-column
  51. property="corpName"
  52. label="发货工厂"
  53. align="center"
  54. show-overflow-tooltip
  55. width="280">
  56. </el-table-column>
  57. <el-table-column
  58. property="province"
  59. label="省市区"
  60. align="center"
  61. width="280">
  62. <template slot-scope="scope">
  63. <el-cascader
  64. size="small"
  65. style="width: 100%;"
  66. v-model="scope.row.region"
  67. disabled
  68. :props="treeOption"></el-cascader>
  69. </template>
  70. </el-table-column>
  71. <el-table-column
  72. property="address"
  73. align="center"
  74. show-overflow-tooltip
  75. label="详细地址">
  76. <!-- <template slot-scope="scope">-->
  77. <!-- <el-input v-model="scope.row.address" size="small" placeholder="请输入内容"></el-input>-->
  78. <!-- </template>-->
  79. </el-table-column>
  80. </el-table>
  81. </basic-container>
  82. <containerTitle title="箱信息"></containerTitle>
  83. <basic-container>
  84. <avue-crud
  85. :data="entrustList"
  86. ref="crudContact"
  87. :option="entrustOptionTwoT"
  88. @row-save="(row,done,loading)=>{rowSaveT(row,0,done,loading)}"
  89. @row-update="rowSaveWell">
  90. <!-- <template slot-scope="{type,size,row}" slot="menu">-->
  91. <!-- <el-button icon="el-icon-edit" :size="size" :type="type" @click="designate(row)">指派</el-button>-->
  92. <!-- </template>-->
  93. <template slot-scope="{row,index}" slot="menu">
  94. <el-button
  95. type="text"
  96. size="small"
  97. v-if="row.status===0"
  98. @click="rowSaveT(row,index)"
  99. >{{ row.$cellEdit ? '保 存' : '修 改' }}
  100. </el-button>
  101. <el-button
  102. size="small"
  103. type="text"
  104. @click="designate(row, index)"
  105. v-if="row.status === 0"
  106. >调 度
  107. </el-button>
  108. <el-button
  109. size="small"
  110. type="text"
  111. @click="cancelDesignate(row, index)"
  112. v-if="row.status===1"
  113. >取消调度
  114. </el-button>
  115. </template>
  116. </avue-crud>
  117. </basic-container>
  118. <containerTitle title="货物信息"></containerTitle>
  119. <basic-container>
  120. <avue-form :option="goodsOptionForm" v-model="goodsForm">
  121. <template slot-scope="scope" slot="corpId">
  122. <crop-select
  123. v-model="goodsForm.corpId"
  124. disabled
  125. ></crop-select>
  126. </template>
  127. </avue-form>
  128. </basic-container>
  129. <span>
  130. <!-- <containerTitle title="费用明细"></containerTitle>-->
  131. <!-- <basic-container>-->
  132. <!-- <el-tabs v-model="activeIndex" @tab-click="handleSelect">-->
  133. <!-- <el-tab-pane label="应收" name="1"></el-tab-pane>-->
  134. <!-- <el-tab-pane label="应付" name="2"></el-tab-pane>-->
  135. <!-- </el-tabs>-->
  136. <!-- <avue-crud-->
  137. <!-- v-if="activeIndex === '1'"-->
  138. <!-- :data="collectionList"-->
  139. <!-- :option="collectionOption"-->
  140. <!-- ref="collection"-->
  141. <!-- @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"-->
  142. <!-- @row-update="rowSave"-->
  143. <!-- @row-del="makeDel">-->
  144. <!-- <template slot-scope="{row}" slot="corpId">-->
  145. <!-- <crop-select-->
  146. <!-- v-if="row.$cellEdit"-->
  147. <!-- v-model="row.corpId"-->
  148. <!-- @getCorpData="(data)=>{getfleetId(data,row)}"-->
  149. <!-- ></crop-select>-->
  150. <!-- <span v-else>{{row.corpName}}</span>-->
  151. <!-- </template>-->
  152. <!-- <template slot-scope="{row}" slot="feeId">-->
  153. <!-- <breakdown-select-->
  154. <!-- v-if="row.$cellEdit"-->
  155. <!-- v-model="row.feeId"-->
  156. <!-- @selectValue="(value) => selectValue(value,row)"-->
  157. <!-- :configuration="breakConfiguration"-->
  158. <!-- >-->
  159. <!-- </breakdown-select>-->
  160. <!-- <span v-else>{{ row.feeName }}</span>-->
  161. <!-- </template>-->
  162. <!-- <template slot-scope="{row,index}" slot="menu">-->
  163. <!-- <el-button-->
  164. <!-- type="text"-->
  165. <!-- size="small"-->
  166. <!-- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"-->
  167. <!-- @click="rowCell(row,index)"-->
  168. <!-- >{{row.$cellEdit?'保存':'编辑'}}</el-button>-->
  169. <!-- <el-button type="text"-->
  170. <!-- icon="el-icon-delete"-->
  171. <!-- size="small"-->
  172. <!-- @click="$refs.collection.rowDel(row,index)"-->
  173. <!-- >删除</el-button>-->
  174. <!-- </template>-->
  175. <!-- <template slot="menuLeft">-->
  176. <!-- <el-button type="primary" icon="el-icon-plus" @click="addRowCollection" size="small">录入明细</el-button>-->
  177. <!-- </template>-->
  178. <!-- </avue-crud>-->
  179. <!-- <avue-crud-->
  180. <!-- v-if="activeIndex === '2'"-->
  181. <!-- :data="paymentList"-->
  182. <!-- :option="paymentOption"-->
  183. <!-- ref="payment"-->
  184. <!-- @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"-->
  185. <!-- @row-update="rowSave"-->
  186. <!-- @row-del="feeDel"-->
  187. <!-- >-->
  188. <!-- <template slot-scope="{row}" slot="corpId">-->
  189. <!-- <crop-select-->
  190. <!-- v-if="row.$cellEdit"-->
  191. <!-- v-model="row.corpId"-->
  192. <!-- @getCorpData="(data)=>{getfleetId(data,row)}"-->
  193. <!-- ></crop-select>-->
  194. <!-- <span v-else>{{row.corpName}}</span>-->
  195. <!-- </template>-->
  196. <!-- <template slot-scope="{row}" slot="feeId">-->
  197. <!-- <breakdown-select-->
  198. <!-- v-if="row.$cellEdit"-->
  199. <!-- v-model="row.feeId"-->
  200. <!-- @selectValue="(value) => selectValue(value,row)"-->
  201. <!-- :configuration="breakConfiguration"-->
  202. <!-- >-->
  203. <!-- </breakdown-select>-->
  204. <!-- <span v-else>{{ row.feeName }}</span>-->
  205. <!-- </template>-->
  206. <!-- <template slot-scope="{row,index}" slot="menu">-->
  207. <!-- <el-button-->
  208. <!-- type="text"-->
  209. <!-- size="small"-->
  210. <!-- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"-->
  211. <!-- @click="paymentRowCell(row,index)"-->
  212. <!-- >{{row.$cellEdit?'保存':'编辑'}}</el-button>-->
  213. <!-- <el-button type="text"-->
  214. <!-- icon="el-icon-delete"-->
  215. <!-- size="small"-->
  216. <!-- @click="$refs.payment.rowDel(row,index)"-->
  217. <!-- >删除</el-button>-->
  218. <!-- </template>-->
  219. <!-- <template slot="menuLeft">-->
  220. <!-- <el-button type="primary" icon="el-icon-plus" @click="addRowPayment" size="small">录入明细</el-button>-->
  221. <!-- </template>-->
  222. <!-- </avue-crud>-->
  223. <!-- </basic-container>-->
  224. </span>
  225. <containerTitle title="上传附件"></containerTitle>
  226. <c-upload
  227. typeUpload="CD"
  228. :data="orderFilesList"
  229. :enumerationValue="76"
  230. ></c-upload>
  231. </div>
  232. </template>
  233. <script>
  234. import {getLazyTree} from "@/api/base/region";
  235. import {
  236. saveDelegationList,
  237. detailDelegationList,
  238. removeCollection,
  239. dispatchCollection,
  240. cancelDispatchCollection
  241. } from "@/api/landTransportation";
  242. export default {
  243. props: {
  244. id: {
  245. type: String
  246. }
  247. },
  248. data() {
  249. return {
  250. activeIndex: '1',
  251. goodsForm: {},
  252. orderFilesList: [],
  253. roleName: localStorage.getItem("roleName").split(',')[0],
  254. breakConfiguration: {
  255. multipleChoices: false,
  256. multiple: false,
  257. disabled: false,
  258. searchShow: true,
  259. collapseTags: false,
  260. clearable: true,
  261. placeholder: '请点击右边按钮选择',
  262. dicData: []
  263. },
  264. advantageProjectData: [],
  265. treeOption: {
  266. label: 'title',
  267. value: 'id',
  268. lazy: true,
  269. lazyLoad(node, resolve) {
  270. const parentId = node.level === 0 ? '00' : node.data.id;
  271. getLazyTree(parentId).then(res => {
  272. resolve(
  273. res.data.data.map(item => {
  274. return {
  275. ...item,
  276. leaf: !item.hasChildren
  277. };
  278. })
  279. );
  280. });
  281. }
  282. },
  283. tableData: [],
  284. entrustListT: [],
  285. entrustOptionTwoT: {
  286. align: 'center',
  287. menuAlign: 'center',
  288. index: true,
  289. cellBtn: false,
  290. addBtn: false,
  291. cancelBtn: false,
  292. editBtn: false,
  293. addRowBtn: false,
  294. delBtn: false,
  295. showSummary: true,
  296. // editBtn:false,
  297. summaryText: "合计",
  298. sumColumnList: [
  299. {
  300. name: 'landWeight',
  301. type: 'sum',
  302. decimals: 6
  303. }, {
  304. name: 'landAmountC',
  305. type: 'sum',
  306. decimals: 2
  307. }, {
  308. name: 'landAmountD',
  309. type: 'sum',
  310. decimals: 2
  311. }, {
  312. name: 'ctnQuantity',
  313. type: 'count'
  314. }],
  315. column: [
  316. {
  317. label: '状态',
  318. width: 200,
  319. type: 'select',
  320. dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
  321. props: {
  322. label: "dictValue",
  323. value: "dictKey"
  324. },
  325. dataType: "string",
  326. prop: 'status'
  327. }, {
  328. label: '车队',
  329. width: 200,
  330. type: 'select',
  331. filterable:true,
  332. dicUrl: "/api/blade-client/corpsdesc/fleet-list",
  333. props: {
  334. label: "cname",
  335. value: "id"
  336. },
  337. cell: true,
  338. prop: 'fleetId'
  339. }, {
  340. label: '尺寸箱型',
  341. width: 100,
  342. slot: true,
  343. prop: 'ctnType'
  344. }, {
  345. label: '箱量',
  346. width: 50,
  347. prop: 'ctnQuantity'
  348. }, {
  349. label: '重量',
  350. width: 160,
  351. prop: 'landWeight',
  352. controls: false,
  353. precision: 6,
  354. type: 'number'
  355. }, {
  356. label: '车号',
  357. width: 150,
  358. prop: 'plateNo'
  359. }, {
  360. label: '司机',
  361. width: 115,
  362. prop: 'driverName'
  363. }, {
  364. label: '电话',
  365. width: 160,
  366. prop: 'tel'
  367. }, {
  368. label: '陆运费(D)',
  369. prop: 'landAmountD'
  370. }, {
  371. label: '陆运费(C)',
  372. cell: true,
  373. prop: 'landAmountC'
  374. }, {
  375. label: '委托备注',
  376. prop: 'remarks'
  377. }, {
  378. label: '车队备注',
  379. prop: 'fleetRemarks'
  380. }, {
  381. label: '司机备注',
  382. prop: 'driverRemarks'
  383. }
  384. ]
  385. },
  386. entrustList: [],
  387. goodsOptionForm: {
  388. menuBtn: false,
  389. disabled: true,
  390. column: [{
  391. label: '客户名称',
  392. formslot: true,
  393. prop: 'corpId'
  394. }, {
  395. label: '订单号',
  396. prop: 'id',
  397. disabled: true
  398. }, {
  399. label: '提单号',
  400. prop: 'billNo'
  401. }, {
  402. label: '场站',
  403. prop: 'station'
  404. }, {
  405. label: '到厂时间',
  406. type: "datetime",
  407. format: 'yyyy-MM-dd HH:mm:ss',
  408. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  409. prop: 'arrivalTime'
  410. }, {
  411. label: '工厂名称',
  412. prop: 'factory'
  413. }, {
  414. label: '货物名称',
  415. prop: 'goods'
  416. }, {
  417. label: '备注',
  418. prop: 'remarks'
  419. }
  420. ]
  421. },
  422. entrustOptionTwo: {
  423. align: 'center',
  424. menuAlign: 'center',
  425. addBtnText: '录入箱信息',
  426. index: true,
  427. cellBtn: true,
  428. addBtn: false,
  429. addRowBtn: true,
  430. showSummary: true,
  431. summaryText: "合计",
  432. sumColumnList: [
  433. {
  434. name: 'landWeight',
  435. type: 'sum',
  436. decimals: 6
  437. }, {
  438. name: 'landAmountD',
  439. type: 'sum',
  440. decimals: 2
  441. }, {
  442. name: 'ctnQuantity',
  443. type: 'sum',
  444. decimals: 1
  445. }],
  446. column: [{
  447. label: '尺寸箱型',
  448. cell: true,
  449. prop: 'ctnType',
  450. type: 'select',
  451. width: 100,
  452. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  453. props: {
  454. label: "dictValue",
  455. value: "dictKey"
  456. }
  457. }, {
  458. label: '箱量',
  459. cell: true,
  460. prop: 'ctnQuantity',
  461. controls: false,
  462. precision: 0,
  463. width: 100,
  464. type: 'number'
  465. }, {
  466. label: '总重量(吨)',
  467. cell: true,
  468. prop: 'landWeight',
  469. controls: false,
  470. width: 200,
  471. precision: 6,
  472. type: 'number'
  473. }, {
  474. label: '陆运费(D)',
  475. cell: true,
  476. prop: 'landAmountD',
  477. controls: false,
  478. width: 200,
  479. precision: 2,
  480. type: 'number'
  481. }, {
  482. label: '备注',
  483. cell: true,
  484. prop: 'remarks'
  485. }
  486. ]
  487. },
  488. collectionList: [],
  489. collectionOption: {
  490. align: 'center',
  491. menuAlign: 'center',
  492. index: true,
  493. cancelBtn: false,
  494. editBtn: false,
  495. delBtn: false,
  496. cellBtn: false,
  497. addBtn: false,
  498. addRowBtn: false,
  499. showSummary: true,
  500. addBtnText: '录入明细',
  501. summaryText: "合计",
  502. sumColumnList: [{
  503. name: 'price',
  504. type: 'sum',
  505. decimals: 2
  506. }, {
  507. name: 'amount',
  508. type: 'sum',
  509. decimals: 2
  510. }, {
  511. name: 'quantity',
  512. type: 'sum',
  513. decimals: 1
  514. }],
  515. column: [{
  516. label: '客户名称',
  517. slot: true,
  518. prop: 'corpId'
  519. }, {
  520. label: '费用名称',
  521. slot: true,
  522. prop: 'feeId'
  523. }, {
  524. label: '计价单位',
  525. cell: true,
  526. prop: 'unit',
  527. type: "select",
  528. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  529. props: {
  530. label: "dictValue",
  531. value: "dictKey"
  532. }
  533. }, {
  534. label: '数量',
  535. cell: true,
  536. prop: 'quantity'
  537. }, {
  538. label: '单价',
  539. cell: true,
  540. prop: 'price'
  541. }, {
  542. label: '金额',
  543. cell: true,
  544. prop: 'amount'
  545. }, {
  546. label: '税率(默认6)',
  547. cell: true,
  548. prop: 'taxRate'
  549. }, {
  550. label: '币别',
  551. cell: true,
  552. prop: 'currency',
  553. type: "select",
  554. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  555. props: {
  556. label: "dictValue",
  557. value: "dictKey"
  558. },
  559. }
  560. ]
  561. },
  562. paymentList: [],
  563. paymentOption: {
  564. align: 'center',
  565. menuAlign: 'center',
  566. index: true,
  567. cancelBtn: false,
  568. editBtn: false,
  569. delBtn: false,
  570. cellBtn: false,
  571. addBtn: false,
  572. addRowBtn: false,
  573. showSummary: true,
  574. addBtnText: '录入明细',
  575. summaryText: "合计",
  576. sumColumnList: [{
  577. name: 'price',
  578. type: 'sum',
  579. decimals: 2
  580. }, {
  581. name: 'amount',
  582. type: 'sum',
  583. decimals: 2
  584. }, {
  585. name: 'quantity',
  586. type: 'sum',
  587. decimals: 1
  588. }],
  589. column: [{
  590. label: '客户名称',
  591. slot: true,
  592. prop: 'corpId'
  593. }, {
  594. label: '费用名称',
  595. slot: true,
  596. prop: 'feeId'
  597. }, {
  598. label: '计价单位',
  599. cell: true,
  600. prop: 'unit',
  601. type: "select",
  602. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  603. props: {
  604. label: "dictValue",
  605. value: "dictKey"
  606. }
  607. }, {
  608. label: '数量',
  609. cell: true,
  610. prop: 'quantity'
  611. }, {
  612. label: '单价',
  613. cell: true,
  614. prop: 'price'
  615. }, {
  616. label: '金额',
  617. cell: true,
  618. prop: 'amount'
  619. }, {
  620. label: '税率(默认6)',
  621. cell: true,
  622. prop: 'taxRate'
  623. }, {
  624. label: '币别(默认RMB)',
  625. cell: true,
  626. prop: 'currency',
  627. type: "select",
  628. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  629. props: {
  630. label: "dictValue",
  631. value: "dictKey"
  632. },
  633. }
  634. ]
  635. }
  636. };
  637. },
  638. created() {
  639. if (this.id) {
  640. detailDelegationList({id: this.id, kind: '2'}).then(res => {
  641. this.goodsForm = res.data.data
  642. this.tableData = res.data.data.orderAddressList
  643. this.entrustList = res.data.data.orderItemList
  644. this.goodsList = res.data.data.orderItemList
  645. if (res.data.data.orderFeeList.length > 0) {
  646. res.data.data.orderFeeList.forEach(item => {
  647. if (item.type == 1) {
  648. this.collectionList.push(item)
  649. } else {
  650. this.paymentList.push(item)
  651. }
  652. })
  653. }
  654. delete this.goodsForm.orderAddressList
  655. delete this.goodsForm.orderItemList
  656. delete this.goodsForm.orderFeeList
  657. this.tableData.forEach(item => {
  658. if (item.region) item.region = item.region.split(',')
  659. })
  660. })
  661. }
  662. },
  663. methods: {
  664. //刷新数据
  665. refreshData() {
  666. detailDelegationList({id: this.id, kind: '2'}).then(res => {
  667. this.goodsForm = res.data.data
  668. this.tableData = res.data.data.orderAddressList
  669. this.entrustList = res.data.data.orderItemList
  670. this.goodsList = res.data.data.orderItemList
  671. if (res.data.data.orderFeeList.length > 0) {
  672. res.data.data.orderFeeList.forEach(item => {
  673. if (item.type == 1) {
  674. this.collectionList.push(item)
  675. } else {
  676. this.paymentList.push(item)
  677. }
  678. })
  679. }
  680. delete this.goodsForm.orderAddressList
  681. delete this.goodsForm.orderItemList
  682. delete this.goodsForm.orderFeeList
  683. this.tableData.forEach(item => {
  684. if (item.region) item.region = item.region.split(',')
  685. })
  686. })
  687. },
  688. //切换收付费
  689. handleSelect(tab, event) {
  690. this.activeIndex = tab.name
  691. },
  692. //箱信息保存
  693. rowSaveT(row, index, done, loading) {
  694. this.$refs.crudContact.rowCell(row, index)
  695. },
  696. rowSaveWell(row, index, done, loading) {
  697. done()
  698. },
  699. //箱信息调度
  700. designate(row,index) {
  701. if (row.fleetId) {
  702. this.$confirm('是否确定调度', '提示', {
  703. confirmButtonText: '确定',
  704. cancelButtonText: '取消',
  705. type: 'warning'
  706. }).then(() => {
  707. dispatchCollection(row).then(res => {
  708. this.$message.success('操作成功');
  709. this.entrustList[index].status = res.data.data.status
  710. })
  711. }).catch(() => {
  712. this.$message({
  713. type: 'info',
  714. message: '已取消'
  715. });
  716. });
  717. } else {
  718. this.$message.warning('请选择车队');
  719. }
  720. },
  721. //取消调度
  722. cancelDesignate(row,index) {
  723. this.$confirm('是否确定取消调度', '提示', {
  724. confirmButtonText: '确定',
  725. cancelButtonText: '取消',
  726. type: 'warning'
  727. }).then(() => {
  728. cancelDispatchCollection({id: row.id}).then(res => {
  729. this.$message.success('操作成功');
  730. this.entrustList[index].status = res.data.data.status
  731. })
  732. }).catch(() => {
  733. this.$message({
  734. type: 'info',
  735. message: '已取消'
  736. });
  737. });
  738. },
  739. //箱信息选择车队
  740. getfleetIdT(data, row) {
  741. this.$set(row, 'fleetName', data.cname)
  742. },
  743. //地址新增
  744. addAddress() {
  745. this.tableData.splice(this.tableData.length - 1, 0, {leas: 1111})
  746. },
  747. //返回主列表
  748. backToList() {
  749. this.$emit('backToList')
  750. },
  751. //删除途径地址
  752. deleteAddress(scope) {
  753. this.tableData.splice(scope.$index, 1);
  754. },
  755. //箱信息保存
  756. rowSave(row, index, done, loading) {
  757. row.$cellEdit = false
  758. done()
  759. },
  760. rowCell(row, index) {
  761. this.$refs.collection.rowCell(row, index)
  762. },
  763. paymentRowCell(row, index) {
  764. this.$refs.payment.rowCell(row, index)
  765. },
  766. //箱信息移除
  767. rowDel(row, index) {
  768. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  769. confirmButtonText: '确定',
  770. cancelButtonText: '取消',
  771. type: 'warning'
  772. }).then(() => {
  773. this.entrustList.splice(index, 1);
  774. }).catch(() => {
  775. this.$message({
  776. type: 'info',
  777. message: '已取消删除'
  778. });
  779. });
  780. },
  781. //保存
  782. editCustomer() {
  783. let data = JSON.parse(JSON.stringify(this.tableData))
  784. data.forEach(item => {
  785. if (item.region.length !== 0) item.region = item.region.join(',')
  786. })
  787. saveDelegationList({
  788. ...this.goodsForm,
  789. kind: '2',
  790. orderAddressList: data,
  791. orderItemList: this.entrustList,
  792. orderFeeList: this.collectionList.concat(this.paymentList)
  793. }).then(res => {
  794. this.$message.success('保存成功');
  795. })
  796. },
  797. //收费新增
  798. addRowCollection() {
  799. this.$refs.collection.rowCellAdd({
  800. currency: '1',
  801. type: '1',
  802. $cellEdit: true
  803. });
  804. },
  805. //付费新增
  806. addRowPayment() {
  807. this.$refs.payment.rowCellAdd({
  808. currency: '1',
  809. type: '2',
  810. $cellEdit: true
  811. });
  812. },
  813. //选择费用
  814. selectValue(value, row) {
  815. this.$set(row, 'feeName', value.cname)
  816. },
  817. //选择客户信息触发
  818. getfleetId(data, row) {
  819. this.$set(row, 'corpName', data.cname)
  820. },
  821. //收款信息移除
  822. makeDel(row, index) {
  823. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  824. confirmButtonText: '确定',
  825. cancelButtonText: '取消',
  826. type: 'warning'
  827. }).then(() => {
  828. if (row.id) removeCollection(row.id)
  829. this.collectionList.splice(index, 1);
  830. }).catch(() => {
  831. this.$message({
  832. type: 'info',
  833. message: '已取消删除'
  834. });
  835. });
  836. },
  837. //付款信息移除
  838. feeDel(row, index) {
  839. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  840. confirmButtonText: '确定',
  841. cancelButtonText: '取消',
  842. type: 'warning'
  843. }).then(() => {
  844. if (row.id) removeCollection(row.id)
  845. this.paymentList.splice(index, 1);
  846. }).catch(() => {
  847. this.$message({
  848. type: 'info',
  849. message: '已取消删除'
  850. });
  851. });
  852. },
  853. //自定义表头
  854. renderHeader(h) {
  855. return (
  856. <div>
  857. <el-tooltip className="item" effect="dark" content="增加途径地址" placement="top">
  858. <el-button type="primary" icon="el-icon-plus" size="mini" circle onClick={() => this.addAddress()}
  859. style="margin-right: 1.25rem;"></el-button>
  860. </el-tooltip>
  861. </div>
  862. )
  863. }
  864. }
  865. }
  866. </script>
  867. <style scoped>
  868. </style>