detailPage.vue 47 KB

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