detailPage.vue 24 KB

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