detailPage.vue 51 KB

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