detailPage.vue 49 KB

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