detailPage.vue 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382
  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. <el-button
  15. class="el-button--small-yh add-customer-btn"
  16. type="success"
  17. v-if="goodsForm.status === 0"
  18. size="small"
  19. style="margin-right: 70px;"
  20. @click="submit(true)"
  21. >提交
  22. </el-button>
  23. <el-button
  24. class="el-button--small-yh add-customer-btn"
  25. type="success"
  26. v-if="goodsForm.status === 1"
  27. size="small"
  28. style="margin-right: 70px;"
  29. @click="submit(false)"
  30. >取消提交
  31. </el-button>
  32. <el-button
  33. class="el-button--small-yh add-customer-btn"
  34. type="primary"
  35. :disabled="goodsForm.status === 1 || type"
  36. size="small"
  37. @click="editCustomer"
  38. >保存
  39. </el-button>
  40. </div>
  41. </div>
  42. <containerTitle
  43. title="业务类型"
  44. style="margin-top: 50px"></containerTitle>
  45. <basic-container>
  46. <avue-form v-model="goodsForm" :option="goodsOptionFormC" ref="goodsFormE"></avue-form>
  47. </basic-container>
  48. <containerTitle title="起止地信息"></containerTitle>
  49. <basic-container>
  50. <el-table
  51. ref="singleTable"
  52. :data="tableData"
  53. size="mini"
  54. :header-cell-style="{color:'#000',background:'#fafafa'}"
  55. style="width: 100%">
  56. <el-table-column
  57. align="center"
  58. v-if="goodsForm.status !== 1"
  59. width="40">
  60. <template slot-scope="scope">
  61. <el-tooltip className="item" v-if="scope.$index === tableData.length-1" effect="dark" content="增加途径地址"
  62. placement="top">
  63. <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="addAddress"
  64. style="margin-right: 1.25rem;"></el-button>
  65. </el-tooltip>
  66. </template>
  67. </el-table-column>
  68. <el-table-column
  69. property="date"
  70. align="center"
  71. width="40">
  72. <template slot-scope="scope">
  73. <span v-if="scope.$index == 0">
  74. <el-button type="primary" size="mini" circle>起</el-button>
  75. </span>
  76. <span v-else-if="scope.$index === tableData.length-1">
  77. <el-button type="success" size="mini" circle>止</el-button>
  78. </span>
  79. <span v-else>
  80. <el-button v-if="goodsForm.status === 1" type="warning" size="mini" circle>途</el-button>
  81. <el-tooltip v-else class="item" effect="dark" content="删除" placement="right">
  82. <el-button type="danger" icon="el-icon-delete" size="mini" circle
  83. @click="deleteAddress(scope)"></el-button>
  84. </el-tooltip>
  85. </span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column
  89. type="index"
  90. label="序号"
  91. align="center"
  92. width="60">
  93. </el-table-column>
  94. <el-table-column
  95. property="corpId"
  96. label="发货工厂"
  97. align="center"
  98. :render-header="customTitle"
  99. width="280">
  100. <template slot-scope="scope">
  101. <crop-select
  102. :corpType="'GC'"
  103. :disabled="goodsForm.status === 1"
  104. v-model="scope.row.corpId"
  105. @getCorpData="(row)=>{withAddress(row,scope)}"/>
  106. </template>
  107. </el-table-column>
  108. <el-table-column
  109. property="province"
  110. label="省市区"
  111. align="center"
  112. width="280">
  113. <template slot-scope="scope">
  114. <el-cascader
  115. size="small"
  116. style="width: 100%;"
  117. :key="scope.row.key"
  118. :disabled="goodsForm.status === 1"
  119. :props="treeOption"
  120. v-model="scope.row.region"></el-cascader>
  121. </template>
  122. </el-table-column>
  123. <el-table-column
  124. property="address"
  125. align="center"
  126. :render-header="customTitle"
  127. label="详细地址">
  128. <template slot-scope="scope">
  129. <el-input v-model="scope.row.address" :disabled="goodsForm.status === 1" size="small"
  130. placeholder="请输入内容"></el-input>
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. </basic-container>
  135. <containerTitle title="委托信息"></containerTitle>
  136. <basic-container>
  137. <avue-form :option="goodsOptionForm" ref="goodsForm" v-model="goodsForm">
  138. <template slot-scope="scope" slot="corpId">
  139. <crop-select
  140. :disabled="goodsForm.status === 1"
  141. v-model="goodsForm.corpId"
  142. @getCorpData="getCorpData"
  143. :corpType="'KH'"
  144. ></crop-select>
  145. </template>
  146. <template slot-scope="scope" slot="agentId">
  147. <crop-select
  148. :disabled="goodsForm.status === 1"
  149. v-model="goodsForm.agentId"
  150. ></crop-select>
  151. </template>
  152. <template slot-scope="scope" slot="polId">
  153. <port-info
  154. v-model="goodsForm.polId"
  155. :disabled="goodsForm.status === 1"
  156. />
  157. </template>
  158. <template slot-scope="scope" slot="podId">
  159. <port-info
  160. v-model="goodsForm.podId"
  161. :disabled="goodsForm.status === 1"
  162. />
  163. </template>
  164. </avue-form>
  165. </basic-container>
  166. <containerTitle title="箱信息"></containerTitle>
  167. <basic-container v-if="goodsForm.status === 0 || !goodsForm.status">
  168. <avue-crud :data="entrustList"
  169. :option="entrustOptionTwo"
  170. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  171. @row-update="rowSave"
  172. @row-del="rowDel">
  173. <template slot="ctnTypeHeader" slot-scope="{column}">
  174. {{ column.label }}<span style="color:#F56C6C">*</span>
  175. </template>
  176. <template slot="ctnQuantityHeader" slot-scope="{column}">
  177. {{ column.label }}<span style="color:#F56C6C">*</span>
  178. </template>
  179. <template slot="landWeightHeader" slot-scope="{column}">
  180. {{ column.label }}<span style="color:#F56C6C">*</span>
  181. </template>
  182. <template slot="landAmountDHeader" slot-scope="{column}">
  183. {{ column.label }}<span style="color:#F56C6C">*</span>
  184. </template>
  185. </avue-crud>
  186. </basic-container>
  187. <basic-container v-if="goodsForm.status !== 0 && goodsForm.status">
  188. <avue-crud
  189. :data="entrustList"
  190. :option="entrustOptionTwoT"
  191. ref="entrustTwoT"
  192. @row-save="(row,done,loading)=>{rowSaveT(row,0,done,loading)}"
  193. @row-update="rowSaveT">
  194. <template slot="fleetId" slot-scope="{ row, index }">
  195. <crop-select
  196. v-if="row.$cellEdit"
  197. v-model="row.fleetId"
  198. :cropIndex="index"
  199. @getCorpData="(data)=>{getfleetIdT(data,row)}"
  200. ></crop-select>
  201. <span v-else>{{ row.fleetName }}</span>
  202. </template>
  203. </avue-crud>
  204. </basic-container>
  205. <containerTitle title="车辆信息"></containerTitle>
  206. <basic-container>
  207. <avue-crud
  208. :data="vehicleList"
  209. ref="crudContact"
  210. :option="vehicleOption">
  211. </avue-crud>
  212. </basic-container>
  213. <containerTitle title="费用明细"></containerTitle>
  214. <basic-container>
  215. <el-tabs v-model="activeIndex" @tab-click="handleSelect">
  216. <el-tab-pane label="应收" name="1"></el-tab-pane>
  217. <el-tab-pane label="应付" name="2"></el-tab-pane>
  218. </el-tabs>
  219. <avue-crud
  220. v-if="activeIndex === '1'"
  221. :data="collectionList"
  222. :option="collectionOption"
  223. ref="collection"
  224. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  225. @row-update="rowSave"
  226. @row-del="makeDel">
  227. <template slot-scope="{row}" slot="corpId">
  228. <crop-select
  229. v-if="row.$cellEdit"
  230. v-model="row.corpId"
  231. :disabled="goodsForm.status === 1"
  232. @getCorpData="(data)=>{getfleetId(data,row)}"
  233. ></crop-select>
  234. <span v-else>{{ row.corpName }}</span>
  235. </template>
  236. <template slot-scope="{row}" slot="feeId">
  237. <breakdown-select
  238. v-if="row.$cellEdit"
  239. v-model="row.feeId"
  240. :disabled="goodsForm.status === 1"
  241. @selectValue="(value) => selectValue(value,row)"
  242. :configuration="breakConfiguration"
  243. >
  244. </breakdown-select>
  245. <span v-else>{{ row.feeName }}</span>
  246. </template>
  247. <template slot-scope="{row,index}" slot="menu">
  248. <el-button
  249. type="text"
  250. size="small"
  251. :disabled="goodsForm.status === 1"
  252. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  253. @click="rowCell(row,index)"
  254. >{{ row.$cellEdit ? '保存' : '编辑' }}
  255. </el-button>
  256. <el-button type="text"
  257. icon="el-icon-delete"
  258. size="small"
  259. :disabled="goodsForm.status === 1"
  260. @click="$refs.collection.rowDel(row,index)"
  261. >删除
  262. </el-button>
  263. </template>
  264. <template slot="menuLeft">
  265. <el-button type="primary" icon="el-icon-plus" :disabled="goodsForm.status === 1" @click="addRowCollection" size="small">录入明细</el-button>
  266. </template>
  267. </avue-crud>
  268. <avue-crud
  269. v-if="activeIndex === '2'"
  270. :data="paymentList"
  271. :option="paymentOption"
  272. ref="payment"
  273. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  274. @row-update="rowSave"
  275. @row-del="feeDel"
  276. >
  277. <template slot-scope="{row}" slot="corpId">
  278. <crop-select
  279. v-if="row.$cellEdit"
  280. v-model="row.corpId"
  281. :disabled="goodsForm.status === 1"
  282. @getCorpData="(data)=>{getfleetId(data,row)}"
  283. ></crop-select>
  284. <span v-else>{{ row.corpName }}</span>
  285. </template>
  286. <template slot-scope="{row}" slot="feeId">
  287. <breakdown-select
  288. v-if="row.$cellEdit"
  289. v-model="row.feeId"
  290. :disabled="goodsForm.status === 1"
  291. @selectValue="(value) => selectValue(value,row)"
  292. :configuration="breakConfiguration"
  293. >
  294. </breakdown-select>
  295. <span v-else>{{ row.feeName }}</span>
  296. </template>
  297. <template slot-scope="{row,index}" slot="menu">
  298. <el-button
  299. type="text"
  300. size="small"
  301. :disabled="goodsForm.status === 1"
  302. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  303. @click="paymentRowCell(row,index)"
  304. >{{ row.$cellEdit ? '保存' : '编辑' }}
  305. </el-button>
  306. <el-button type="text"
  307. icon="el-icon-delete"
  308. size="small"
  309. :disabled="goodsForm.status === 1"
  310. @click="$refs.payment.rowDel(row,index)"
  311. >删除
  312. </el-button>
  313. </template>
  314. <template slot="menuLeft">
  315. <el-button type="primary" icon="el-icon-plus" :disabled="goodsForm.status === 1" @click="addRowPayment" size="small">录入明细</el-button>
  316. </template>
  317. </avue-crud>
  318. </basic-container>
  319. <containerTitle title="上传附件"></containerTitle>
  320. <c-upload
  321. typeUpload="CD"
  322. deleteUrl="/api/blade-client/common-file/remove"
  323. :data="orderFilesList"
  324. :disabled="goodsForm.status === 1"
  325. :enumerationValue="76"
  326. ></c-upload>
  327. </div>
  328. </template>
  329. <script>
  330. import {getLazyTree} from "@/api/base/region";
  331. import {
  332. saveDelegationList,
  333. detailDelegationList,
  334. removeCollection,
  335. saveSaveList,
  336. addressList, cancelSubmission, getCorp
  337. } from "@/api/landTransportation";
  338. export default {
  339. props: {
  340. id: {
  341. type: String
  342. }
  343. },
  344. data() {
  345. return {
  346. activeIndex: '1',
  347. type: false,
  348. goodsForm: {},
  349. modelKey: 1,
  350. orderFilesList: [],
  351. vehicleList: [],
  352. roleName: localStorage.getItem("roleName").split(',')[0],
  353. breakConfiguration: {
  354. multipleChoices: false,
  355. multiple: false,
  356. disabled: false,
  357. searchShow: true,
  358. collapseTags: false,
  359. clearable: true,
  360. placeholder: '请点击右边按钮选择',
  361. dicData: []
  362. },
  363. advantageProjectData: [],
  364. vehicleOption: {
  365. align: 'center',
  366. menuAlign: 'center',
  367. refreshBtn:false,
  368. menu:false,
  369. index: true,
  370. stripe: true,
  371. cellBtn: false,
  372. addBtn: false,
  373. cancelBtn: false,
  374. editBtn: false,
  375. addRowBtn: false,
  376. delBtn: false,
  377. showSummary: true,
  378. // editBtn:false,
  379. summaryText: "合计",
  380. sumColumnList: [
  381. {
  382. name: 'landWeight',
  383. type: 'sum',
  384. decimals: 2
  385. }, {
  386. name: 'landAmountC',
  387. type: 'sum',
  388. decimals: 2
  389. }, {
  390. name: 'landAmountD',
  391. type: 'sum',
  392. decimals: 2
  393. }, {
  394. name: 'oneFeeD',
  395. type: 'sum',
  396. decimals: 2
  397. }, {
  398. name: 'twoFeeD',
  399. type: 'sum',
  400. decimals: 2
  401. }, {
  402. name: 'threeFeeD',
  403. type: 'sum',
  404. decimals: 2
  405. }, {
  406. name: 'fourFeeD',
  407. type: 'sum',
  408. decimals: 2
  409. }, {
  410. name: 'fiveFeeD',
  411. type: 'sum',
  412. decimals: 2
  413. }, {
  414. name: 'oneFeeC',
  415. type: 'sum',
  416. decimals: 2
  417. }, {
  418. name: 'twoFeeC',
  419. type: 'sum',
  420. decimals: 2
  421. }, {
  422. name: 'threeFeeC',
  423. type: 'sum',
  424. decimals: 2
  425. }, {
  426. name: 'fourFeeC',
  427. type: 'sum',
  428. decimals: 2
  429. }, {
  430. name: 'fiveFeeC',
  431. type: 'sum',
  432. decimals: 2
  433. }, {
  434. name: 'landAmountD',
  435. type: 'sum',
  436. decimals: 2
  437. }, {
  438. name: 'ctnQuantity',
  439. type: 'sum',
  440. decimals: 0
  441. }],
  442. column: [
  443. {
  444. label: '状态',
  445. width: 100,
  446. type: 'select',
  447. dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
  448. props: {
  449. label: "dictValue",
  450. value: "dictKey"
  451. },
  452. dataType: "string",
  453. prop: 'status'
  454. }, {
  455. label: '车队',
  456. width: 200,
  457. prop: 'fleetName'
  458. }, {
  459. label: '应付陆运费',
  460. cell: true,
  461. prop: 'landAmountC'
  462. }, {
  463. label: '尺寸箱型',
  464. width: 100,
  465. slot: true,
  466. prop: 'ctnType'
  467. }, {
  468. label: '箱量',
  469. width: 50,
  470. prop: 'ctnQuantity'
  471. }, {
  472. label: '重量',
  473. width: 160,
  474. prop: 'landWeight',
  475. controls: false,
  476. precision: 2,
  477. type: 'number'
  478. }, {
  479. label: '车号',
  480. width: 150,
  481. prop: 'plateNo'
  482. }, {
  483. label: '司机',
  484. width: 115,
  485. prop: 'driverName'
  486. }, {
  487. label: '电话',
  488. width: 160,
  489. prop: 'tel'
  490. }, {
  491. label: '单柜运费',
  492. prop: 'landAmountD'
  493. }, {
  494. label: '委托备注',
  495. width: 245,
  496. prop: 'remarks'
  497. }, {
  498. label: '车队备注',
  499. width: 245,
  500. prop: 'fleetRemarks'
  501. }, {
  502. label: '司机备注',
  503. width: 245,
  504. prop: 'driverRemarks'
  505. }, {
  506. label: '应收场站费',
  507. width: 100,
  508. precision: 2,
  509. controls: false,
  510. type: 'number',
  511. prop: 'oneFeeD'
  512. }, {
  513. label: '应收港杂费',
  514. width: 100,
  515. precision: 2,
  516. controls: false,
  517. type: 'number',
  518. prop: 'twoFeeD'
  519. }, {
  520. label: '应收扣款',
  521. width: 100,
  522. precision: 2,
  523. controls: false,
  524. type: 'number',
  525. prop: 'threeFeeD'
  526. }, {
  527. label: '应收待时费',
  528. width: 100,
  529. precision: 2,
  530. controls: false,
  531. type: 'number',
  532. prop: 'fourFeeD'
  533. }, {
  534. label: '应收其他',
  535. width: 100,
  536. precision: 2,
  537. type: 'number',
  538. controls: false,
  539. prop: 'fiveFeeD'
  540. }, {
  541. label: '应收费用备注',
  542. width: 245,
  543. prop: 'feeRemarksD'
  544. }, {
  545. label: '应付场站费',
  546. width: 100,
  547. precision: 2,
  548. controls: false,
  549. type: 'number',
  550. prop: 'oneFeeC'
  551. }, {
  552. label: '应付港杂费',
  553. width: 100,
  554. precision: 2,
  555. controls: false,
  556. type: 'number',
  557. prop: 'twoFeeC'
  558. }, {
  559. label: '应付扣款',
  560. width: 100,
  561. precision: 2,
  562. controls: false,
  563. type: 'number',
  564. prop: 'threeFeeC'
  565. }, {
  566. label: '应付待时费',
  567. width: 100,
  568. precision: 2,
  569. controls: false,
  570. type: 'number',
  571. prop: 'fourFeeC'
  572. }, {
  573. label: '应付其他',
  574. width: 100,
  575. precision: 2,
  576. type: 'number',
  577. controls: false,
  578. prop: 'fiveFeeC'
  579. }, {
  580. label: '应付费用备注',
  581. width: 245,
  582. prop: 'feeRemarksC'
  583. }
  584. ]
  585. },
  586. treeOption: {
  587. label: 'title',
  588. value: 'id',
  589. lazy: true,
  590. lazyLoad(node, resolve) {
  591. const parentId = node.level === 0 ? '00' : node.data.id;
  592. getLazyTree(parentId).then(res => {
  593. resolve(
  594. res.data.data.map(item => {
  595. return {
  596. ...item,
  597. leaf: !item.hasChildren
  598. };
  599. })
  600. );
  601. });
  602. }
  603. },
  604. tableData: [],
  605. entrustListT: [],
  606. entrustOptionTwoT: {
  607. align: 'center',
  608. menuAlign: 'center',
  609. index: true,
  610. cellBtn: true,
  611. menu:false,
  612. refreshBtn:false,
  613. addBtn: false,
  614. addRowBtn: false,
  615. delBtn: false,
  616. showSummary: true,
  617. summaryText: "合计",
  618. sumColumnList: [
  619. {
  620. name: 'landWeight',
  621. type: 'sum',
  622. decimals: 2
  623. }, {
  624. name: 'landAmountC',
  625. type: 'sum',
  626. decimals: 2
  627. }, {
  628. name: 'landAmountD',
  629. type: 'sum',
  630. decimals: 2
  631. },{
  632. name: 'oneFeeD',
  633. type: 'sum',
  634. decimals: 2
  635. },{
  636. name: 'twoFeeD',
  637. type: 'sum',
  638. decimals: 2
  639. },{
  640. name: 'threeFeeD',
  641. type: 'sum',
  642. decimals: 2
  643. },{
  644. name: 'fourFeeD',
  645. type: 'sum',
  646. decimals: 2
  647. },{
  648. name: 'fiveFeeD',
  649. type: 'sum',
  650. decimals: 2
  651. }, {
  652. name: 'ctnQuantity',
  653. type: 'sum',
  654. decimals: 0
  655. }],
  656. column: [{
  657. label: '尺寸箱型',
  658. width: 100,
  659. prop: 'ctnType'
  660. }, {
  661. label: '箱量',
  662. width: 50,
  663. prop: 'ctnQuantity'
  664. }, {
  665. label: '重量',
  666. width: 160,
  667. prop: 'landWeight',
  668. controls: false,
  669. precision: 2,
  670. type: 'number'
  671. }, {
  672. label: '单柜运费',
  673. prop: 'landAmountD',
  674. width: 100,
  675. precision: 2,
  676. controls: false,
  677. }, {
  678. label: '备注',
  679. prop: 'remarks'
  680. }]
  681. },
  682. entrustList: [],
  683. goodsOptionFormC:{
  684. menuBtn: false,
  685. disabled: false,
  686. span: 8,
  687. column: [ {
  688. label: '业务类型',
  689. prop: 'businessType',
  690. type: 'select',
  691. dicUrl: "/api/blade-system/dict-biz/dictionary?code=business_type",
  692. props: {
  693. label: "dictValue",
  694. value: "dictValue"
  695. },
  696. rules: [{
  697. required: false,
  698. message: " ",
  699. trigger: "blur"
  700. }]
  701. }, {
  702. label: '运输方式',
  703. prop: 'shippingMode',
  704. type: 'select',
  705. dicUrl: "/api/blade-system/dict-biz/dictionary?code=shipping_mode",
  706. props: {
  707. label: "dictValue",
  708. value: "dictValue"
  709. },
  710. change: (data) => {
  711. if (data.value === '集装箱') {
  712. this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = true
  713. }else if(!data.value){
  714. this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = true
  715. }else {
  716. this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = false
  717. }
  718. }
  719. }]
  720. },
  721. goodsOptionForm: {
  722. menuBtn: false,
  723. disabled: false,
  724. span: 8,
  725. column: [{
  726. label: '客户名称',
  727. formslot: true,
  728. prop: 'corpId',
  729. rules: [{
  730. required: true,
  731. message: " ",
  732. trigger: "change"
  733. }],
  734. }, {
  735. label: '所属公司',
  736. formslot: true,
  737. prop: 'belongCompany',
  738. rules: [{
  739. required: false,
  740. message: " ",
  741. trigger: "blur"
  742. }],
  743. }, {
  744. label: '订单号',
  745. prop: 'orderNo',
  746. disabled: true
  747. }, {
  748. label: '提单号',
  749. prop: 'billNo',
  750. rules: [{
  751. required: true,
  752. message: " ",
  753. trigger: "blur"
  754. }],
  755. }, {
  756. label: '场站',
  757. prop: 'station',
  758. rules: [{
  759. required: false,
  760. message: " ",
  761. trigger: "blur"
  762. }],
  763. }, {
  764. label: '到厂时间',
  765. type: "datetime",
  766. format: 'yyyy-MM-dd HH:mm:ss',
  767. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  768. prop: 'arrivalTime',
  769. rules: [{
  770. required: true,
  771. message: " ",
  772. trigger: "blur"
  773. }],
  774. }, {
  775. label: '船名航次',
  776. prop: 'factory',
  777. rules: [{
  778. required: false,
  779. message: " ",
  780. trigger: "blur"
  781. }],
  782. }, {
  783. label: '货物名称',
  784. prop: 'goods',
  785. rules: [{
  786. required: false,
  787. message: " ",
  788. trigger: "blur"
  789. }],
  790. }, {
  791. label: '订舱代理',
  792. prop: 'agentId'
  793. }, {
  794. label: '起运港',
  795. prop: 'polId'
  796. }, {
  797. label: '目的港',
  798. prop: 'podId'
  799. }, {
  800. label: '开船日期',
  801. prop: 'etd',
  802. type: 'date'
  803. }, {
  804. label: '截关日期',
  805. prop: 'etc',
  806. type: 'date'
  807. }, {
  808. label: '截单日期',
  809. prop: 'siCutoffDate',
  810. type: 'date'
  811. }, {
  812. label: '备注',
  813. span: 24,
  814. prop: 'remarks'
  815. }]
  816. },
  817. entrustOptionTwo: {
  818. align: 'center',
  819. menuAlign: 'center',
  820. refreshBtn: false,
  821. addBtnText: '录入信息',
  822. index: true,
  823. cellBtn: true,
  824. addBtn: false,
  825. addRowBtn: true,
  826. showSummary: true,
  827. summaryText: "合计",
  828. sumColumnList: [
  829. {
  830. name: 'landWeight',
  831. type: 'sum',
  832. decimals: 2
  833. }, {
  834. name: 'landAmountD',
  835. type: 'sum',
  836. decimals: 2
  837. },{
  838. name: 'oneFeeD',
  839. type: 'sum',
  840. decimals: 2
  841. },{
  842. name: 'twoFeeD',
  843. type: 'sum',
  844. decimals: 2
  845. },{
  846. name: 'threeFeeD',
  847. type: 'sum',
  848. decimals: 2
  849. },{
  850. name: 'fourFeeD',
  851. type: 'sum',
  852. decimals: 2
  853. },{
  854. name: 'fiveFeeD',
  855. type: 'sum',
  856. decimals: 2
  857. }, {
  858. name: 'ctnQuantity',
  859. type: 'sum',
  860. decimals: 0
  861. }],
  862. column: [{
  863. // label: '尺寸箱型',
  864. label: '尺寸箱型',
  865. cell: true,
  866. prop: 'ctnType',
  867. type: 'select',
  868. width: 100,
  869. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  870. props: {
  871. label: "dictValue",
  872. value: "dictValue"
  873. },
  874. }, {
  875. label: '箱量',
  876. cell: true,
  877. prop: 'ctnQuantity',
  878. controls: false,
  879. precision: 0,
  880. width: 100,
  881. maxRows: 999,
  882. minRows: 1,
  883. type: 'number'
  884. }, {
  885. label: '总重量(吨)',
  886. cell: true,
  887. prop: 'landWeight',
  888. controls: false,
  889. width: 200,
  890. precision: 2,
  891. type: 'number'
  892. }, {
  893. label: '单柜运费',
  894. cell: true,
  895. prop: 'landAmountD',
  896. controls: false,
  897. width: 200,
  898. precision: 2,
  899. type: 'number'
  900. }, {
  901. label: '备注',
  902. cell: true,
  903. prop: 'remarks'
  904. }]
  905. },
  906. collectionList: [],
  907. collectionOption: {
  908. align: 'center',
  909. menuAlign: 'center',
  910. refreshBtn: false,
  911. index: true,
  912. cancelBtn: false,
  913. editBtn: false,
  914. delBtn: false,
  915. cellBtn: false,
  916. addBtn: false,
  917. addRowBtn: false,
  918. showSummary: true,
  919. addBtnText: '录入明细',
  920. summaryText: "合计",
  921. sumColumnList: [{
  922. name: 'price',
  923. type: 'sum',
  924. decimals: 2
  925. }, {
  926. name: 'amount',
  927. type: 'sum',
  928. decimals: 2
  929. }, {
  930. name: 'quantity',
  931. type: 'sum',
  932. decimals: 0
  933. }],
  934. column: [{
  935. label: '客户名称',
  936. slot: true,
  937. width: 200,
  938. overHidden: true,
  939. prop: 'corpId'
  940. }, {
  941. label: '费用名称',
  942. slot: true,
  943. prop: 'feeId'
  944. }, {
  945. label: '计价单位',
  946. cell: true,
  947. prop: 'unit',
  948. type: "select",
  949. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  950. props: {
  951. label: "dictValue",
  952. value: "dictKey"
  953. }
  954. }, {
  955. label: '数量',
  956. cell: true,
  957. prop: 'quantity'
  958. }, {
  959. label: '单价',
  960. cell: true,
  961. prop: 'price'
  962. }, {
  963. label: '金额',
  964. cell: true,
  965. prop: 'amount'
  966. }, {
  967. // label: '税率(默认6)',
  968. label: '税率',
  969. cell: true,
  970. prop: 'taxRate'
  971. }, {
  972. label: '币别',
  973. cell: true,
  974. prop: 'currency',
  975. type: "select",
  976. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  977. props: {
  978. label: "dictValue",
  979. value: "dictKey"
  980. },
  981. }
  982. ]
  983. },
  984. paymentList: [],
  985. paymentOption: {
  986. align: 'center',
  987. menuAlign: 'center',
  988. index: true,
  989. cancelBtn: false,
  990. refreshBtn: false,
  991. editBtn: false,
  992. delBtn: false,
  993. cellBtn: false,
  994. addBtn: false,
  995. addRowBtn: false,
  996. showSummary: true,
  997. addBtnText: '录入明细',
  998. summaryText: "合计",
  999. sumColumnList: [{
  1000. name: 'price',
  1001. type: 'sum',
  1002. decimals: 2
  1003. }, {
  1004. name: 'amount',
  1005. type: 'sum',
  1006. decimals: 2
  1007. }, {
  1008. name: 'quantity',
  1009. type: 'sum',
  1010. decimals: 0
  1011. }],
  1012. column: [{
  1013. label: '客户名称',
  1014. width: 200,
  1015. slot: true,
  1016. overHidden: true,
  1017. prop: 'corpId'
  1018. }, {
  1019. label: '费用名称',
  1020. slot: true,
  1021. prop: 'feeId'
  1022. }, {
  1023. label: '计价单位',
  1024. cell: true,
  1025. prop: 'unit',
  1026. type: "select",
  1027. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  1028. props: {
  1029. label: "dictValue",
  1030. value: "dictKey"
  1031. }
  1032. }, {
  1033. label: '数量',
  1034. cell: true,
  1035. prop: 'quantity'
  1036. }, {
  1037. label: '单价',
  1038. cell: true,
  1039. prop: 'price'
  1040. }, {
  1041. label: '金额',
  1042. cell: true,
  1043. prop: 'amount'
  1044. }, {
  1045. // label: '税率(默认6)',
  1046. label: '税率',
  1047. cell: true,
  1048. prop: 'taxRate'
  1049. }, {
  1050. label: '币别',
  1051. cell: true,
  1052. prop: 'currency',
  1053. type: "select",
  1054. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  1055. props: {
  1056. label: "dictValue",
  1057. value: "dictKey"
  1058. }
  1059. }]
  1060. }
  1061. };
  1062. },
  1063. created() {
  1064. if (this.id) {
  1065. detailDelegationList({id: this.id, kind: '1'}).then(res => {
  1066. this.goodsForm = res.data.data
  1067. this.tableData = res.data.data.orderAddressList
  1068. this.entrustList = res.data.data.itemList
  1069. this.goodsList = res.data.data.itemList
  1070. this.vehicleList = res.data.data.orderItemList
  1071. this.orderFilesList = res.data.data.fileList
  1072. if (res.data.data.orderFeeList.length > 0) {
  1073. res.data.data.orderFeeList.forEach(item => {
  1074. if (item.type == 1) {
  1075. this.collectionList.push(item)
  1076. } else {
  1077. this.paymentList.push(item)
  1078. }
  1079. })
  1080. }
  1081. this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status === 1
  1082. delete this.goodsForm.orderAddressList
  1083. delete this.goodsForm.itemList
  1084. delete this.goodsForm.orderFeeList
  1085. this.tableData.forEach(item => {
  1086. if (item.region) item.region = item.region.split(',')
  1087. })
  1088. })
  1089. } else {
  1090. this.tableData = [{
  1091. region: [],
  1092. address: ''
  1093. }, {
  1094. region: [],
  1095. address: ''
  1096. }]
  1097. getCorp().then(res=>{
  1098. console.log(res)
  1099. this.goodsForm = {
  1100. corpId:res.data.data.id,
  1101. businessType:"出口",
  1102. shippingMode:"集装箱",
  1103. belongCompany:res.data.data.belongCompany
  1104. }
  1105. })
  1106. this.entrustList = [{$cellEdit: true}]
  1107. }
  1108. },
  1109. methods: {
  1110. //刷新数据
  1111. refreshData() {
  1112. detailDelegationList({id: this.id, kind: '1'}).then(res => {
  1113. this.goodsForm = res.data.data
  1114. this.tableData = res.data.data.orderAddressList
  1115. this.entrustList = res.data.data.itemList
  1116. this.goodsList = res.data.data.itemList
  1117. this.vehicleList = res.data.data.orderItemList
  1118. this.orderFilesList = res.data.data.fileList
  1119. if (res.data.data.orderFeeList.length > 0) {
  1120. this.collectionList = []
  1121. this.paymentList = []
  1122. res.data.data.orderFeeList.forEach(item => {
  1123. if (item.type == 1) {
  1124. this.collectionList.push(item)
  1125. } else {
  1126. this.paymentList.push(item)
  1127. }
  1128. })
  1129. }
  1130. this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status === 1
  1131. delete this.goodsForm.orderAddressList
  1132. delete this.goodsForm.itemList
  1133. delete this.goodsForm.orderFeeList
  1134. this.tableData.forEach(item => {
  1135. if (item.region) item.region = item.region.split(',')
  1136. })
  1137. this.type = false
  1138. })
  1139. },
  1140. //提交委托
  1141. submit(type) {
  1142. if (type) {
  1143. saveDelegationList({
  1144. id: this.goodsForm.id
  1145. }).then(res => {
  1146. this.$message.success('提交成功');
  1147. this.refreshData()
  1148. })
  1149. } else {
  1150. cancelSubmission({
  1151. id: this.goodsForm.id
  1152. }).then(res => {
  1153. this.$message.success('取消成功');
  1154. this.refreshData()
  1155. })
  1156. }
  1157. },
  1158. //切换收付费
  1159. handleSelect(tab, event) {
  1160. this.activeIndex = tab.name
  1161. },
  1162. //箱信息保存
  1163. rowSaveT(row, index, done, loading) {
  1164. row.$cellEdit = false
  1165. done()
  1166. },
  1167. //箱信息选择车队
  1168. getfleetIdT(data, row) {
  1169. this.$set(row, 'fleetName', data.cname)
  1170. },
  1171. //地址新增
  1172. addAddress() {
  1173. this.tableData.splice(this.tableData.length - 1, 0, {})
  1174. },
  1175. //返回主列表
  1176. backToList() {
  1177. this.goodsForm = {}
  1178. this.$emit('backToList')
  1179. },
  1180. //删除途径地址
  1181. deleteAddress(scope) {
  1182. this.tableData.splice(scope.$index, 1);
  1183. },
  1184. //箱信息保存
  1185. rowSave(row, index, done, loading) {
  1186. row.$cellEdit = false
  1187. done()
  1188. },
  1189. rowCell(row, index) {
  1190. this.$refs.collection.rowCell(row, index)
  1191. },
  1192. paymentRowCell(row, index) {
  1193. this.$refs.payment.rowCell(row, index)
  1194. },
  1195. //箱信息移除
  1196. rowDel(row, index) {
  1197. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  1198. confirmButtonText: '确定',
  1199. cancelButtonText: '取消',
  1200. type: 'warning'
  1201. }).then(() => {
  1202. this.entrustList.splice(index, 1);
  1203. }).catch(() => {
  1204. this.$message({
  1205. type: 'info',
  1206. message: '已取消删除'
  1207. });
  1208. });
  1209. },
  1210. //保存
  1211. editCustomer() {
  1212. this.$refs['goodsFormE'].validate((valid, done) => {
  1213. done()
  1214. })
  1215. this.$refs['goodsForm'].validate((valid, done) => {
  1216. done()
  1217. })
  1218. for (let item in this.tableData) {
  1219. if (!this.tableData[item].corpId) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行发货工厂');
  1220. if (!this.tableData[item].address) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行详细地址');
  1221. }
  1222. for (let item in this.entrustList) {
  1223. if (!this.entrustList[item].ctnType) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行尺寸箱型');
  1224. if (!this.entrustList[item].ctnQuantity) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行箱量');
  1225. if (!this.entrustList[item].landWeight) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行总重量');
  1226. if (!this.entrustList[item].landAmountD) return this.$message.error('请输入第' + Number(Number(item) + 1) + '陆运费');
  1227. }
  1228. if (this.entrustList.length === 0) return this.$message.error('箱信息不能为空')
  1229. this.$refs['goodsFormE'].validate((valid, doneE) => {
  1230. doneE()
  1231. if (valid){
  1232. this.$refs['goodsForm'].validate((valid, done) => {
  1233. done();
  1234. if (valid) {
  1235. let data = JSON.parse(JSON.stringify(this.tableData))
  1236. data.forEach((item, index) => {
  1237. item.sort = index + 1
  1238. if (item.region.length !== 0) item.region = item.region.join(',')
  1239. })
  1240. this.type = true
  1241. saveSaveList({
  1242. ...this.goodsForm,
  1243. kind: '1',
  1244. orderAddressList: data,
  1245. fileList: this.orderFilesList,
  1246. itemList: this.entrustList,
  1247. orderFeeList: this.collectionList.concat(this.paymentList)
  1248. }).then(res => {
  1249. this.$message.success('保存成功');
  1250. this.goodsForm = {}
  1251. if (!this.goodsForm.id) {
  1252. this.id = res.data.data
  1253. this.refreshData()
  1254. } else {
  1255. this.refreshData()
  1256. }
  1257. })
  1258. } else {
  1259. return false;
  1260. }
  1261. });
  1262. } else {
  1263. return false;
  1264. }
  1265. })
  1266. },
  1267. //收费新增
  1268. addRowCollection() {
  1269. this.$refs.collection.rowCellAdd({
  1270. currency: '1',
  1271. type: '1',
  1272. $cellEdit: true
  1273. });
  1274. },
  1275. //付费新增
  1276. addRowPayment() {
  1277. this.$refs.payment.rowCellAdd({
  1278. currency: '1',
  1279. type: '2',
  1280. $cellEdit: true
  1281. });
  1282. },
  1283. //选择费用
  1284. selectValue(value, row) {
  1285. this.$set(row, 'feeName', value.cname)
  1286. },
  1287. //选择客户信息触发
  1288. getfleetId(data, row) {
  1289. this.$set(row, 'corpName', data.cname)
  1290. },
  1291. //收款信息移除
  1292. makeDel(row, index) {
  1293. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  1294. confirmButtonText: '确定',
  1295. cancelButtonText: '取消',
  1296. type: 'warning'
  1297. }).then(() => {
  1298. if (row.id) removeCollection(row.id)
  1299. this.collectionList.splice(index, 1);
  1300. }).catch(() => {
  1301. this.$message({
  1302. type: 'info',
  1303. message: '已取消删除'
  1304. });
  1305. });
  1306. },
  1307. //付款信息移除
  1308. feeDel(row, index) {
  1309. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  1310. confirmButtonText: '确定',
  1311. cancelButtonText: '取消',
  1312. type: 'warning'
  1313. }).then(() => {
  1314. if (row.id) removeCollection(row.id)
  1315. this.paymentList.splice(index, 1);
  1316. }).catch(() => {
  1317. this.$message({
  1318. type: 'info',
  1319. message: '已取消删除'
  1320. });
  1321. });
  1322. },
  1323. //选择客户名称带出所属公司
  1324. getCorpData(row) {
  1325. this.goodsForm.belongCompany = row.belongCompany
  1326. },
  1327. //选择地址客户带出地址
  1328. withAddress(row, scope) {
  1329. console.log(row)
  1330. if (!scope.row.key) scope.row.key = 0
  1331. this.tableData[scope.$index].corpName = row.cname
  1332. if (row.attn){
  1333. this.tableData[scope.$index].address = row.tel
  1334. }
  1335. if (row.tel) {
  1336. if (!row.attn) {
  1337. this.tableData[scope.$index].address += row.tel
  1338. } else {
  1339. this.tableData[scope.$index].address += '—' + row.tel
  1340. }
  1341. }
  1342. if (row.storageAddr) {
  1343. if (!row.tel && !row.attn) {
  1344. this.tableData[scope.$index].address += row.storageAddr
  1345. } else {
  1346. this.tableData[scope.$index].address += '—' + row.storageAddr
  1347. }
  1348. }
  1349. if (row.belongtoarea) {
  1350. addressList(row.belongtoarea.split(',')[0]).then(res => {
  1351. this.tableData[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
  1352. scope.row.key++
  1353. })
  1354. }
  1355. },
  1356. //自定义表头
  1357. renderHeader(h) {
  1358. return (
  1359. <div>
  1360. <el-tooltip className="item" effect="dark" content="增加途径地址" placement="top">
  1361. <el-button type="primary" icon="el-icon-plus" size="mini" circle onClick={() => this.addAddress()}
  1362. style="margin-right: 1.25rem;"></el-button>
  1363. </el-tooltip>
  1364. </div>
  1365. )
  1366. },
  1367. //自定义表头
  1368. customTitle(h, {column, $index}) {
  1369. let text = column.label
  1370. return (
  1371. <div>
  1372. {{text}}<span style="color:#F56C6C">*</span>
  1373. </div>
  1374. )
  1375. }
  1376. }
  1377. }
  1378. </script>
  1379. <style scoped>
  1380. </style>