detailPage.vue 25 KB

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