detailPage.vue 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991
  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="warning"
  17. size="small"
  18. v-if="goodsForm.status > 0"
  19. :style="{marginRight: goodsForm.status == 2?'80px':'180px'}"
  20. @click="confirmChange"
  21. >变更
  22. </el-button>
  23. <el-button
  24. class="el-button--small-yh add-customer-btn"
  25. type="success"
  26. v-if="goodsForm.status === 0 && typeTwo === false"
  27. size="small"
  28. style="margin-right: 80px;"
  29. @click="submit(true)"
  30. >提交
  31. </el-button>
  32. <el-button
  33. class="el-button--small-yh add-customer-btn"
  34. type="success"
  35. v-if="goodsForm.status === 1"
  36. size="small"
  37. style="margin-right: 80px;"
  38. @click="submit(false)"
  39. >取消提交
  40. </el-button>
  41. <div class="el-button&#45;&#45;small-yh add-customer-btn">
  42. <el-button
  43. type="primary"
  44. :disabled="goodsForm.status > 1"
  45. size="small"
  46. :loading="type"
  47. v-if="!typeTwo"
  48. @click="editCustomer"
  49. >保存
  50. </el-button>
  51. <el-button
  52. type="primary"
  53. :disabled="goodsForm.status === 1"
  54. size="small"
  55. v-else
  56. :loading="type"
  57. @click="changeSaving"
  58. >变更保存
  59. </el-button>
  60. </div>
  61. </div>
  62. </div>
  63. <containerTitle
  64. title="业务类型"
  65. style="margin-top: 50px"></containerTitle>
  66. <basic-container>
  67. <avue-form v-model="goodsForm" :option="goodsOptionFormC" ref="goodsFormE"></avue-form>
  68. </basic-container>
  69. <containerTitle title="委托信息"></containerTitle>
  70. <basic-container>
  71. <avue-form :option="goodsOptionForm" ref="goodsForm" v-model="goodsForm">
  72. <template slot-scope="scope" slot="corpId">
  73. <crop-select
  74. :disabled="goodsForm.status !== 0"
  75. v-model="goodsForm.corpId"
  76. @getCorpData="getCorpData"
  77. :corpType="'KH'"
  78. ></crop-select>
  79. </template>
  80. <template slot-scope="scope" slot="station">
  81. <port-info
  82. v-model="goodsForm.station"
  83. :disabled="goodsForm.status !== 0"
  84. />
  85. </template>
  86. <template slot-scope="scope" slot="salesman">
  87. <el-select v-model="goodsForm.salesman" placeholder="请选择" :disabled="goodsForm.status !== 0"
  88. @change="changeSelect">
  89. <el-option
  90. v-for="item in salesmanList"
  91. :key="item.id"
  92. :label="item.realName"
  93. :value="item.id">
  94. </el-option>
  95. </el-select>
  96. </template>
  97. <template slot-scope="scope" slot="agentId">
  98. <crop-select
  99. :disabled="goodsForm.status !== 0"
  100. v-model="goodsForm.agentId"
  101. ></crop-select>
  102. </template>
  103. <template slot-scope="scope" slot="polId">
  104. <port-info
  105. v-model="goodsForm.polId"
  106. :disabled="goodsForm.status !== 0"
  107. />
  108. </template>
  109. <template slot-scope="scope" slot="podId">
  110. <port-info
  111. v-model="goodsForm.podId"
  112. :disabled="goodsForm.status !== 0"
  113. />
  114. </template>
  115. </avue-form>
  116. </basic-container>
  117. <containerTitle title="其他信息"></containerTitle>
  118. <basic-container :showBtn="true" ref="other">
  119. <avue-form :option="goodsOptionFormTwo" v-model="goodsForm">
  120. <template slot-scope="scope" slot="corpId">
  121. <crop-select
  122. :disabled="goodsForm.status !== 0"
  123. v-model="goodsForm.corpId"
  124. @getCorpData="getCorpData"
  125. :corpType="'KH'"
  126. ></crop-select>
  127. </template>
  128. <template slot-scope="scope" slot="station">
  129. <port-info
  130. v-model="goodsForm.station"
  131. :disabled="goodsForm.status !== 0"
  132. />
  133. </template>
  134. <template slot-scope="scope" slot="salesman">
  135. <el-select v-model="goodsForm.salesman" placeholder="请选择" :disabled="goodsForm.status !== 0">
  136. <el-option
  137. v-for="item in salesmanList"
  138. :key="item.id"
  139. :label="item.realName"
  140. :value="item.id">
  141. </el-option>
  142. </el-select>
  143. </template>
  144. <template slot-scope="scope" slot="agentId">
  145. <crop-select
  146. :disabled="goodsForm.status !== 0"
  147. v-model="goodsForm.agentId"
  148. ></crop-select>
  149. </template>
  150. <template slot-scope="scope" slot="polId">
  151. <port-info
  152. :type="'id'"
  153. v-model="goodsForm.polId"
  154. :disabled="goodsForm.status !== 0"
  155. />
  156. </template>
  157. <template slot-scope="scope" slot="podId">
  158. <port-info
  159. :type="'id'"
  160. v-model="goodsForm.podId"
  161. :disabled="goodsForm.status !== 0"
  162. />
  163. </template>
  164. </avue-form>
  165. </basic-container>
  166. <containerTitle title="箱信息"></containerTitle>
  167. <basic-container v-if="goodsForm.status === 0 || !goodsForm.status">
  168. <avue-crud :data="entrustList"
  169. :option="entrustOptionTwo"
  170. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  171. @row-update="rowSave"
  172. ref="crudBox"
  173. v-if="KeyBox>0"
  174. @resetColumn="resetColumnBox"
  175. @saveColumn="saveColumnBox"
  176. @row-del="rowDel">
  177. <template slot="headerSerial" slot-scope="{column}">
  178. <el-tooltip class="item" effect="dark" content="录入明细" placement="top">
  179. <el-button type="primary" icon="el-icon-circle-plus-outline" circle size="mini"
  180. @click="$refs.crudBox.rowCellAdd({arrivalTime:new Date((new Date).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 14)+'00:00',landAmountD:0})"></el-button>
  181. </el-tooltip>
  182. </template>
  183. <template slot="ctnTypeHeader" slot-scope="{column}">
  184. {{ column.label }}<span style="color:#F56C6C">*</span>
  185. </template>
  186. <template slot="ctnQuantityHeader" slot-scope="{column}">
  187. {{ column.label }}<span style="color:#F56C6C">*</span>
  188. </template>
  189. <!-- <template slot="landWeightHeader" slot-scope="{column}">-->
  190. <!-- {{ column.label }}<span style="color:#F56C6C">*</span>-->
  191. <!-- </template>-->
  192. <!-- <template slot="landAmountDHeader" slot-scope="{column}">-->
  193. <!-- {{ column.label }}<span style="color:#F56C6C">*</span>-->
  194. <!-- </template>-->
  195. <template slot="arrivalTimeHeader" slot-scope="{column}">
  196. {{ column.label }}<span style="color:#F56C6C">*</span>
  197. </template>
  198. </avue-crud>
  199. </basic-container>
  200. <basic-container v-if="goodsForm.status !== 0 && goodsForm.status">
  201. <avue-crud
  202. :data="entrustList"
  203. :option="entrustOptionTwoT"
  204. ref="crudBoxTwo"
  205. v-if="KeyBoxTwo>0"
  206. @resetColumn="resetColumnBoxTwo"
  207. @saveColumn="saveColumnBoxTwo"
  208. @row-save="(row,done,loading)=>{rowSaveT(row,0,done,loading)}"
  209. @row-update="rowSaveT">
  210. <template slot="fleetId" slot-scope="{ row, index }">
  211. <crop-select
  212. v-if="row.$cellEdit"
  213. v-model="row.fleetId"
  214. :cropIndex="index"
  215. @getCorpData="(data)=>{getfleetIdT(data,row)}"
  216. ></crop-select>
  217. <span v-else>{{ row.fleetName }}</span>
  218. </template>
  219. </avue-crud>
  220. </basic-container>
  221. <containerTitle title="起止地信息"></containerTitle>
  222. <basic-container>
  223. <el-table
  224. ref="singleTable"
  225. :data="tableData"
  226. size="mini"
  227. :header-cell-style="{color:'#000',background:'#fafafa'}"
  228. style="width: 100%">
  229. <el-table-column
  230. align="center"
  231. v-if="goodsForm.status === 0"
  232. width="40">
  233. <template slot-scope="scope">
  234. <el-tooltip className="item" v-if="scope.$index === tableData.length-1" effect="dark" content="增加途径地址"
  235. placement="top">
  236. <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="addAddress"
  237. style="margin-right: 1.25rem;"></el-button>
  238. </el-tooltip>
  239. </template>
  240. </el-table-column>
  241. <el-table-column
  242. property="date"
  243. align="center"
  244. width="40">
  245. <template slot-scope="scope">
  246. <span v-if="scope.$index == 0">
  247. <el-button type="primary" size="mini" circle>起</el-button>
  248. </span>
  249. <span v-else-if="scope.$index === tableData.length-1">
  250. <el-button type="success" size="mini" circle>止</el-button>
  251. </span>
  252. <span v-else>
  253. <el-button v-if="goodsForm.status !== 0" type="warning" size="mini" circle>途</el-button>
  254. <el-tooltip v-else class="item" effect="dark" content="删除" placement="left">
  255. <el-button type="danger" icon="el-icon-delete" size="mini" circle
  256. @click="deleteAddress(scope)"></el-button>
  257. </el-tooltip>
  258. </span>
  259. </template>
  260. </el-table-column>
  261. <el-table-column
  262. type="index"
  263. label="序号"
  264. align="center"
  265. width="60">
  266. </el-table-column>
  267. <el-table-column
  268. property="corpId"
  269. label="货运地点"
  270. align="center"
  271. :render-header="customTitle"
  272. width="280">
  273. <template slot-scope="scope">
  274. <crop-select
  275. :corpType="'GC'"
  276. :disabled="goodsForm.status !== 0"
  277. v-model="scope.row.corpId"
  278. @getCorpData="(row)=>{withAddress(row,scope)}"/>
  279. </template>
  280. </el-table-column>
  281. <!-- <el-table-column-->
  282. <!-- property="province"-->
  283. <!-- label="省市区"-->
  284. <!-- align="center"-->
  285. <!-- width="280">-->
  286. <!-- <template slot-scope="scope">-->
  287. <!-- <el-cascader-->
  288. <!-- size="small"-->
  289. <!-- style="width: 100%;"-->
  290. <!-- :key="scope.row.key"-->
  291. <!-- :disabled="goodsForm.status === 1"-->
  292. <!-- :props="treeOption"-->
  293. <!-- clearable-->
  294. <!-- v-model="scope.row.region"></el-cascader>-->
  295. <!-- </template>-->
  296. <!-- </el-table-column>-->
  297. <el-table-column
  298. property="address"
  299. align="center"
  300. width="150"
  301. label="联系人">
  302. <template slot-scope="scope">
  303. <el-input v-model="scope.row.contacts" :disabled="goodsForm.status !== 0" size="small"
  304. placeholder="请输入内容"></el-input>
  305. </template>
  306. </el-table-column>
  307. <el-table-column
  308. property="address"
  309. align="center"
  310. width="180"
  311. label="电话">
  312. <template slot-scope="scope">
  313. <el-input v-model="scope.row.tel" :disabled="goodsForm.status !== 0" size="small"
  314. placeholder="请输入内容"></el-input>
  315. </template>
  316. </el-table-column>
  317. <el-table-column
  318. property="address"
  319. align="center"
  320. label="详细地址">
  321. <template slot-scope="scope">
  322. <el-input v-model="scope.row.address" :disabled="goodsForm.status !== 0" size="small"
  323. placeholder="请输入内容"></el-input>
  324. </template>
  325. </el-table-column>
  326. <el-table-column
  327. property="remarks"
  328. align="center"
  329. label="备注">
  330. <template slot-scope="scope">
  331. <el-input v-model="scope.row.remarks" :disabled="goodsForm.status !== 0" size="small"
  332. placeholder="请输入内容"></el-input>
  333. </template>
  334. </el-table-column>
  335. </el-table>
  336. </basic-container>
  337. <containerTitle title="车辆信息"></containerTitle>
  338. <basic-container>
  339. <avue-crud
  340. :data="vehicleList"
  341. ref="crudContact"
  342. v-if="keyContact>0"
  343. @resetColumn="resetColumnContact"
  344. @saveColumn="saveColumnContact"
  345. :option="vehicleOption">
  346. </avue-crud>
  347. </basic-container>
  348. <containerTitle title="杂费明细"></containerTitle>
  349. <basic-container>
  350. <el-tabs v-model="activeIndex" @tab-click="handleSelect">
  351. <el-tab-pane label="应收" name="1"></el-tab-pane>
  352. <!-- <el-tab-pane label="应付" name="2"></el-tab-pane>-->
  353. </el-tabs>
  354. <avue-crud
  355. v-if="activeIndex === '1'"
  356. :data="collectionList"
  357. :option="collectionOption"
  358. ref="collection"
  359. @resetColumn="resetColumnCollection"
  360. @saveColumn="saveColumnCollection"
  361. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  362. @row-update="rowSave"
  363. @row-del="makeDel">
  364. <template slot-scope="{row}" slot="corpId">
  365. <crop-select
  366. v-if="row.$cellEdit"
  367. v-model="row.corpId"
  368. :disabled="goodsForm.status !== 0"
  369. @getCorpData="(data)=>{getfleetId(data,row)}"
  370. ></crop-select>
  371. <span v-else>{{ row.corpName }}</span>
  372. </template>
  373. <template slot-scope="{row}" slot="feeId">
  374. <breakdown-select
  375. v-if="row.$cellEdit"
  376. v-model="row.feeId"
  377. :disabled="goodsForm.status !== 0"
  378. @selectValue="(value) => selectValue(value,row)"
  379. :configuration="breakConfiguration"
  380. >
  381. </breakdown-select>
  382. <span v-else>{{ row.feeName }}</span>
  383. </template>
  384. <template slot-scope="{row,index}" slot="menu">
  385. <!-- <el-button-->
  386. <!-- type="text"-->
  387. <!-- size="small"-->
  388. <!-- :disabled="goodsForm.status === 1"-->
  389. <!-- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"-->
  390. <!-- @click="rowCell(row,index)"-->
  391. <!-- >{{ row.$cellEdit ? '保存' : '编辑' }}-->
  392. <!-- </el-button>-->
  393. <!-- <el-button type="text"-->
  394. <!-- icon="el-icon-delete"-->
  395. <!-- size="small"-->
  396. <!-- :disabled="goodsForm.status === 1"-->
  397. <!-- @click="$refs.collection.rowDel(row,index)"-->
  398. <!-- >删除-->
  399. <!-- </el-button>-->
  400. <el-button
  401. size="small"
  402. type="text"
  403. icon="el-icon-s-order"
  404. @click="annexOpen(row, index)"
  405. >附 件
  406. </el-button>
  407. </template>
  408. <template slot="menuLeft">
  409. <!-- <el-button-->
  410. <!-- type="primary"-->
  411. <!-- icon="el-icon-plus"-->
  412. <!-- :disabled="goodsForm.status !== 0"-->
  413. <!-- @click="addRowCollection"-->
  414. <!-- size="small">录入明细</el-button>-->
  415. </template>
  416. </avue-crud>
  417. <avue-crud
  418. v-if="activeIndex === '2'"
  419. :data="paymentList"
  420. :option="paymentOption"
  421. ref="payment"
  422. @resetColumn="resetColumnPayment"
  423. @saveColumn="saveColumnPayment"
  424. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  425. @row-update="rowSave"
  426. @row-del="feeDel"
  427. >
  428. <template slot-scope="{row}" slot="corpId">
  429. <crop-select
  430. v-if="row.$cellEdit"
  431. v-model="row.corpId"
  432. :disabled="goodsForm.status === 1"
  433. @getCorpData="(data)=>{getfleetId(data,row)}"
  434. ></crop-select>
  435. <span v-else>{{ row.corpName }}</span>
  436. </template>
  437. <template slot-scope="{row}" slot="feeId">
  438. <breakdown-select
  439. v-if="row.$cellEdit"
  440. v-model="row.feeId"
  441. :disabled="goodsForm.status !== 0"
  442. @selectValue="(value) => selectValue(value,row)"
  443. :configuration="breakConfiguration"
  444. >
  445. </breakdown-select>
  446. <span v-else>{{ row.feeName }}</span>
  447. </template>
  448. <template slot-scope="{row,index}" slot="menu">
  449. <el-button
  450. type="text"
  451. size="small"
  452. :disabled="goodsForm.status === 1"
  453. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  454. @click="paymentRowCell(row,index)"
  455. >{{ row.$cellEdit ? '保存' : '编辑' }}
  456. </el-button>
  457. <el-button type="text"
  458. icon="el-icon-delete"
  459. size="small"
  460. :disabled="goodsForm.status === 1"
  461. @click="$refs.payment.rowDel(row,index)"
  462. >删除
  463. </el-button>
  464. </template>
  465. <template slot="menuLeft">
  466. <el-button
  467. type="primary"
  468. icon="el-icon-plus"
  469. :disabled="goodsForm.status === 1"
  470. @click="addRowPayment"
  471. size="small">录入明细
  472. </el-button>
  473. </template>
  474. </avue-crud>
  475. </basic-container>
  476. <containerTitle title="上传附件"></containerTitle>
  477. <c-upload
  478. typeUpload="CD"
  479. deleteUrl="/api/blade-client/common-file/remove"
  480. :data="orderFilesList"
  481. :disabled="goodsForm.status === 1"
  482. :enumerationValue="85.6"
  483. ></c-upload>
  484. <el-dialog
  485. title="附件"
  486. :visible.sync="enclosure"
  487. append-to-body
  488. width="70%">
  489. <c-upload
  490. typeUpload="GZ"
  491. :basic="true"
  492. deleteUrl="/api/blade-client/common-file/remove"
  493. :data="orderList"
  494. disabled
  495. :enumerationValue="76"
  496. ></c-upload>
  497. <span slot="footer" class="dialog-footer">
  498. <el-button @click="enclosure = false" size="small">取 消</el-button>
  499. </span>
  500. </el-dialog>
  501. </div>
  502. </template>
  503. <script>
  504. import {getLazyTree} from "@/api/base/region";
  505. import {
  506. saveDelegationList,
  507. detailDelegationList,
  508. removeCollection,
  509. saveSaveList,
  510. addressList, cancelSubmission, getCorp, getSalesman, getFee, changeSubmission, validChange
  511. } from "@/api/landTransportation";
  512. import {getDeptTree} from "@/api/system/dept";
  513. import website from "@/config/website";
  514. export default {
  515. props: {
  516. id: {
  517. type: String
  518. }
  519. },
  520. data() {
  521. return {
  522. activeIndex: '1',
  523. KeyBox: 0,
  524. KeyBoxTwo: 0,
  525. typeTwo: false,
  526. type: false,
  527. enclosure: false,
  528. orderList: [],
  529. goodsForm: {},
  530. modelKey: 1,
  531. orderFilesList: [],
  532. salesmanList: [],
  533. vehicleList: [],
  534. breakConfiguration: {
  535. multipleChoices: false,
  536. multiple: false,
  537. disabled: false,
  538. searchShow: true,
  539. collapseTags: false,
  540. clearable: true,
  541. placeholder: '请点击右边按钮选择',
  542. dicData: []
  543. },
  544. advantageProjectData: [],
  545. keyContact: 0,
  546. vehicleOptionTwo: {
  547. align: 'center',
  548. menuAlign: 'center',
  549. refreshBtn: false,
  550. menu: false,
  551. index: true,
  552. stripe: true,
  553. cellBtn: false,
  554. addBtn: false,
  555. cancelBtn: false,
  556. editBtn: false,
  557. addRowBtn: false,
  558. delBtn: false,
  559. showSummary: true,
  560. // editBtn:false,
  561. summaryText: "合计",
  562. sumColumnList: [
  563. {
  564. name: 'landWeight',
  565. type: 'sum',
  566. decimals: 2
  567. }, {
  568. name: 'landAmountC',
  569. type: 'sum',
  570. decimals: 2
  571. }, {
  572. name: 'landAmountD',
  573. type: 'sum',
  574. decimals: 2
  575. }, {
  576. name: 'oneFeeD',
  577. type: 'sum',
  578. decimals: 2
  579. }, {
  580. name: 'twoFeeD',
  581. type: 'sum',
  582. decimals: 2
  583. }, {
  584. name: 'threeFeeD',
  585. type: 'sum',
  586. decimals: 2
  587. }, {
  588. name: 'fourFeeD',
  589. type: 'sum',
  590. decimals: 2
  591. }, {
  592. name: 'fiveFeeD',
  593. type: 'sum',
  594. decimals: 2
  595. }, {
  596. name: 'oneFeeC',
  597. type: 'sum',
  598. decimals: 2
  599. }, {
  600. name: 'twoFeeC',
  601. type: 'sum',
  602. decimals: 2
  603. }, {
  604. name: 'threeFeeC',
  605. type: 'sum',
  606. decimals: 2
  607. }, {
  608. name: 'fourFeeC',
  609. type: 'sum',
  610. decimals: 2
  611. }, {
  612. name: 'fiveFeeC',
  613. type: 'sum',
  614. decimals: 2
  615. }, {
  616. name: 'landAmountD',
  617. type: 'sum',
  618. decimals: 2
  619. }, {
  620. name: 'ctnQuantity',
  621. type: 'sum',
  622. decimals: 0
  623. }],
  624. column: [{
  625. label: '货运日期',
  626. type: "datetime",
  627. format: 'yyyy-MM-dd HH:mm:ss',
  628. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  629. width: 200,
  630. index: 1,
  631. prop: 'arrivalTime'
  632. }, {
  633. label: '受理日期',
  634. type: "datetime",
  635. format: 'yyyy-MM-dd HH:mm:ss',
  636. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  637. width: 200,
  638. index: 2,
  639. prop: 'acceptTime'
  640. }, {
  641. label: '实际到厂时间',
  642. prop: 'realArrivalTime',
  643. overHidden: true,
  644. type: "date",
  645. searchRange: true,
  646. defaultTime: ['00:00:00', '23:59:59'],
  647. format: "yyyy-MM-dd HH:mm:ss",
  648. valueFormat: "yyyy-MM-dd HH:mm:ss",
  649. index: 3,
  650. width: 140,
  651. }, {
  652. label: '车号',
  653. width: 150,
  654. index: 4,
  655. prop: 'plateNo'
  656. }, {
  657. label: '司机',
  658. width: 115,
  659. index: 5,
  660. prop: 'driverName'
  661. }, {
  662. label: '电话',
  663. width: 160,
  664. index: 6,
  665. prop: 'tel'
  666. }, {
  667. label: '完工日期',
  668. prop: 'finishedTime',
  669. overHidden: true,
  670. type: "date",
  671. searchRange: true,
  672. defaultTime: ['00:00:00', '23:59:59'],
  673. format: "yyyy-MM-dd HH:mm:ss",
  674. valueFormat: "yyyy-MM-dd HH:mm:ss",
  675. index: 7,
  676. width: 140,
  677. }, {
  678. label: '箱型',
  679. width: 100,
  680. slot: true,
  681. index: 8,
  682. prop: 'ctnType'
  683. }, {
  684. label: '箱量',
  685. width: 50,
  686. index: 9,
  687. prop: 'ctnQuantity'
  688. }, {
  689. label: '货物名称',
  690. overHidden: true,
  691. width: 160,
  692. index: 10,
  693. prop: 'goods'
  694. }, {
  695. label: '件数',
  696. width: 100,
  697. overHidden: true,
  698. controls: false,
  699. cell: true,
  700. index: 11,
  701. prop: 'quantity',
  702. type: 'number',
  703. precision: 0
  704. }, {
  705. label: '重量',
  706. width: 160,
  707. prop: 'landWeight',
  708. controls: false,
  709. precision: 2,
  710. index: 12,
  711. type: 'number'
  712. }, {
  713. label: '尺码',
  714. width: 100,
  715. overHidden: true,
  716. index: 13,
  717. prop: 'size',
  718. }, {
  719. label: '委托备注',
  720. width: 245,
  721. index: 14,
  722. prop: 'remarks'
  723. }, {
  724. label: '状态',
  725. width: 100,
  726. index: 15,
  727. type: 'select',
  728. dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
  729. props: {
  730. label: "dictValue",
  731. value: "dictKey"
  732. },
  733. dataType: "string",
  734. prop: 'status'
  735. }
  736. // {
  737. // label: '应付陆运费',
  738. // cell: true,
  739. // prop: 'landAmountC'
  740. // }
  741. // , {
  742. // label: '车队备注',
  743. // width: 245,
  744. // prop: 'fleetRemarks'
  745. // }, {
  746. // label: '司机备注',
  747. // width: 245,
  748. // prop: 'driverRemarks'
  749. // }
  750. ]
  751. },
  752. vehicleOption: {},
  753. treeOption: {
  754. label: 'title',
  755. value: 'id',
  756. lazy: true,
  757. lazyLoad(node, resolve) {
  758. const parentId = node.level === 0 ? '00' : node.data.id;
  759. getLazyTree(parentId).then(res => {
  760. resolve(
  761. res.data.data.map(item => {
  762. return {
  763. ...item,
  764. leaf: !item.hasChildren
  765. };
  766. })
  767. );
  768. });
  769. }
  770. },
  771. tableData: [],
  772. entrustListT: [],
  773. entrustOptionTwoTBackup: {
  774. align: 'center',
  775. menuAlign: 'center',
  776. index: true,
  777. cellBtn: true,
  778. menu: false,
  779. refreshBtn: false,
  780. addBtn: false,
  781. addRowBtn: false,
  782. delBtn: false,
  783. showSummary: true,
  784. summaryText: "合计",
  785. sumColumnList: [
  786. {
  787. name: 'landWeight',
  788. type: 'sum',
  789. decimals: 2
  790. }, {
  791. name: 'landAmountC',
  792. type: 'sum',
  793. decimals: 2
  794. }, {
  795. name: 'landAmountD',
  796. type: 'sum',
  797. decimals: 2
  798. }, {
  799. name: 'oneFeeD',
  800. type: 'sum',
  801. decimals: 2
  802. }, {
  803. name: 'twoFeeD',
  804. type: 'sum',
  805. decimals: 2
  806. }, {
  807. name: 'threeFeeD',
  808. type: 'sum',
  809. decimals: 2
  810. }, {
  811. name: 'fourFeeD',
  812. type: 'sum',
  813. decimals: 2
  814. }, {
  815. name: 'fiveFeeD',
  816. type: 'sum',
  817. decimals: 2
  818. }, {
  819. name: 'ctnQuantity',
  820. type: 'sum',
  821. decimals: 0
  822. }],
  823. column: [{
  824. label: '货运日期',
  825. type: "datetime",
  826. format: 'yyyy-MM-dd HH:mm:ss',
  827. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  828. index: 1,
  829. cell: true,
  830. width: 200,
  831. prop: 'arrivalTime'
  832. }, {
  833. label: '箱型',
  834. width: 100,
  835. index: 2,
  836. prop: 'ctnType'
  837. }, {
  838. label: '箱量',
  839. width: 50,
  840. index: 3,
  841. prop: 'ctnQuantity'
  842. }, {
  843. label: '运费',
  844. prop: 'landAmountD',
  845. width: 100,
  846. precision: 2,
  847. index: 4,
  848. controls: false,
  849. }, {
  850. label: '件数',
  851. width: 100,
  852. index: 5,
  853. overHidden: true,
  854. controls: false,
  855. prop: 'quantity',
  856. type: 'number',
  857. precision: 0
  858. }, {
  859. label: '重量',
  860. width: 160,
  861. index: 6,
  862. prop: 'landWeight',
  863. controls: false,
  864. precision: 2,
  865. type: 'number'
  866. }
  867. // , {
  868. // label: '包装',
  869. // width: 100,
  870. // index: 7,
  871. // overHidden: true,
  872. // prop: 'packing',
  873. // type: 'select',
  874. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  875. // props: {
  876. // label: "dictValue",
  877. // value: "dictValue"
  878. // },
  879. // }
  880. , {
  881. label: '尺码',
  882. width: 100,
  883. index: 8,
  884. overHidden: true,
  885. prop: 'size',
  886. }, {
  887. label: '货物名称',
  888. width: 200,
  889. index: 9,
  890. overHidden: true,
  891. prop: 'goods',
  892. }, {
  893. label: '备注',
  894. width: 200,
  895. index: 10,
  896. prop: 'remarks'
  897. }]
  898. },
  899. entrustOptionTwoT: {},
  900. entrustList: [],
  901. goodsOptionFormC: {
  902. menuBtn: false,
  903. disabled: false,
  904. span: 8,
  905. column: [{
  906. label: '业务类型',
  907. prop: 'businessType',
  908. type: 'select',
  909. dicUrl: "/api/blade-system/dict-biz/dictionary?code=business_type",
  910. props: {
  911. label: "dictValue",
  912. value: "dictValue"
  913. },
  914. rules: [{
  915. required: false,
  916. message: " ",
  917. trigger: "blur"
  918. }]
  919. }, {
  920. label: '运输方式',
  921. prop: 'shippingMode',
  922. type: 'select',
  923. dicUrl: "/api/blade-system/dict-biz/dictionary?code=shipping_mode",
  924. props: {
  925. label: "dictValue",
  926. value: "dictValue"
  927. },
  928. change: (data) => {
  929. if (data.value === '集装箱') {
  930. this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = true
  931. } else if (!data.value) {
  932. this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = true
  933. } else {
  934. this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = false
  935. }
  936. }
  937. }, {
  938. label: '平台号',
  939. prop: 'orderNo',
  940. disabled: true
  941. }]
  942. },
  943. goodsOptionForm: {
  944. menuBtn: false,
  945. disabled: false,
  946. span: 8,
  947. column: [{
  948. label: '公司名称',
  949. formslot: true,
  950. prop: 'corpId',
  951. rules: [{
  952. required: true,
  953. message: " ",
  954. trigger: "change"
  955. }],
  956. }, {
  957. label: '所属部门',
  958. prop: 'salesmanDept',
  959. type: "tree",
  960. filter: false,
  961. dicData: [],
  962. props: {
  963. label: "title"
  964. }
  965. }, {
  966. label: '业务员',
  967. prop: 'salesman',
  968. rules: [{
  969. required: true,
  970. message: " ",
  971. trigger: "blur"
  972. }]
  973. }, {
  974. label: '委托日期',
  975. prop: 'bsDate',
  976. type: "datetime",
  977. format: 'yyyy-MM-dd HH:mm:ss',
  978. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  979. }, {
  980. label: '票据号',
  981. prop: 'receiptNo'
  982. }, {
  983. label: '联系电话',
  984. prop: 'tel'
  985. }, {
  986. label: '提单号',
  987. prop: 'billNo',
  988. rules: [{
  989. required: true,
  990. message: " ",
  991. trigger: "blur"
  992. }],
  993. }, {
  994. label: '场站',
  995. prop: 'station',
  996. rules: [{
  997. required: true,
  998. message: " ",
  999. trigger: "blur"
  1000. }],
  1001. }
  1002. // , {
  1003. // label: '货运日期',
  1004. // type: "datetime",
  1005. // format: 'yyyy-MM-dd HH:mm:ss',
  1006. // valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1007. // prop: 'arrivalTime',
  1008. // rules: [{
  1009. // required: true,
  1010. // message: " ",
  1011. // trigger: "blur"
  1012. // }],
  1013. // }
  1014. , {
  1015. label: '备注',
  1016. span: 24,
  1017. minRows: 2,
  1018. prop: 'remarks',
  1019. type: 'textarea'
  1020. }]
  1021. },
  1022. goodsOptionFormTwo: {
  1023. menuBtn: false,
  1024. disabled: false,
  1025. span: 8,
  1026. column: [
  1027. // {
  1028. // label: '所属公司',
  1029. // formslot: true,
  1030. // prop: 'belongCompany',
  1031. // rules: [{
  1032. // required: false,
  1033. // message: " ",
  1034. // trigger: "blur"
  1035. // }],
  1036. // },
  1037. {
  1038. label: '船名航次',
  1039. prop: 'factory',
  1040. rules: [{
  1041. required: false,
  1042. message: " ",
  1043. trigger: "blur"
  1044. }],
  1045. }
  1046. // , {
  1047. // label: '货物名称',
  1048. // prop: 'goods',
  1049. // rules: [{
  1050. // required: false,
  1051. // message: " ",
  1052. // trigger: "blur"
  1053. // }],
  1054. // }
  1055. , {
  1056. label: '开船日期',
  1057. prop: 'etd',
  1058. type: 'date'
  1059. }, {
  1060. label: '预配箱量',
  1061. prop: 'expectCtnQty'
  1062. }, {
  1063. label: '起运港',
  1064. prop: 'polId'
  1065. }, {
  1066. label: '目的港',
  1067. prop: 'podId'
  1068. }, {
  1069. label: '截港日期',
  1070. prop: 'etc',
  1071. type: 'date'
  1072. }, {
  1073. label: '截单日期',
  1074. prop: 'siCutoffDate',
  1075. type: 'date'
  1076. }, {
  1077. label: '订舱代理',
  1078. prop: 'agentId'
  1079. }]
  1080. },
  1081. entrustOptionTwoBackup: {
  1082. align: 'center',
  1083. menuAlign: 'center',
  1084. refreshBtn: false,
  1085. addBtnText: '录入信息',
  1086. index: true,
  1087. indexSlot: true,
  1088. cellBtn: true,
  1089. addBtn: false,
  1090. addRowBtn: false,
  1091. showSummary: true,
  1092. summaryText: "合计",
  1093. sumColumnList: [
  1094. {
  1095. name: 'landWeight',
  1096. type: 'sum',
  1097. decimals: 2
  1098. }, {
  1099. name: 'landAmountD',
  1100. type: 'sum',
  1101. decimals: 2
  1102. }, {
  1103. name: 'oneFeeD',
  1104. type: 'sum',
  1105. decimals: 2
  1106. }, {
  1107. name: 'twoFeeD',
  1108. type: 'sum',
  1109. decimals: 2
  1110. }, {
  1111. name: 'threeFeeD',
  1112. type: 'sum',
  1113. decimals: 2
  1114. }, {
  1115. name: 'fourFeeD',
  1116. type: 'sum',
  1117. decimals: 2
  1118. }, {
  1119. name: 'fiveFeeD',
  1120. type: 'sum',
  1121. decimals: 2
  1122. }, {
  1123. name: 'ctnQuantity',
  1124. type: 'sum',
  1125. decimals: 0
  1126. }],
  1127. column: [{
  1128. label: '货运日期',
  1129. type: "datetime",
  1130. format: 'yyyy-MM-dd HH:mm:ss',
  1131. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1132. cell: true,
  1133. width: 200,
  1134. index: 1,
  1135. prop: 'arrivalTime'
  1136. }, {
  1137. // label: '箱型',
  1138. label: '箱型',
  1139. cell: true,
  1140. prop: 'ctnType',
  1141. type: 'select',
  1142. width: 100,
  1143. index: 2,
  1144. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  1145. props: {
  1146. label: "dictValue",
  1147. value: "dictValue"
  1148. },
  1149. }, {
  1150. label: '箱量',
  1151. cell: true,
  1152. prop: 'ctnQuantity',
  1153. controls: false,
  1154. precision: 0,
  1155. index: 3,
  1156. width: 100,
  1157. maxRows: 999,
  1158. minRows: 1,
  1159. type: 'number'
  1160. }, {
  1161. label: '运费',
  1162. cell: true,
  1163. prop: 'landAmountD',
  1164. controls: false,
  1165. width: 200,
  1166. index: 4,
  1167. precision: 2,
  1168. type: 'number'
  1169. }, {
  1170. label: '件数',
  1171. width: 100,
  1172. index: 5,
  1173. overHidden: true,
  1174. controls: false,
  1175. cell: true,
  1176. prop: 'quantity',
  1177. type: 'number',
  1178. precision: 0
  1179. }, {
  1180. label: '重量(吨)',
  1181. cell: true,
  1182. prop: 'landWeight',
  1183. controls: false,
  1184. width: 200,
  1185. index: 6,
  1186. precision: 2,
  1187. type: 'number'
  1188. }
  1189. // , {
  1190. // label: '包装',
  1191. // width: 100,
  1192. // index: 7,
  1193. // overHidden: true,
  1194. // cell: true,
  1195. // prop: 'packing',
  1196. // type: 'select',
  1197. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  1198. // props: {
  1199. // label: "dictValue",
  1200. // value: "dictValue"
  1201. // },
  1202. // }
  1203. , {
  1204. label: '尺码',
  1205. width: 100,
  1206. index: 8,
  1207. overHidden: true,
  1208. cell: true,
  1209. prop: 'size',
  1210. }, {
  1211. label: '货物名称',
  1212. width: 200,
  1213. index: 9,
  1214. overHidden: true,
  1215. cell: true,
  1216. prop: 'goods',
  1217. }, {
  1218. label: '备注',
  1219. cell: true,
  1220. index: 10,
  1221. width: 200,
  1222. prop: 'remarks'
  1223. }]
  1224. },
  1225. entrustOptionTwo: {},
  1226. collectionList: [],
  1227. collectionOptionBackup: {
  1228. align: 'center',
  1229. menuAlign: 'center',
  1230. refreshBtn: false,
  1231. index: true,
  1232. // menu:false,
  1233. cancelBtn: false,
  1234. editBtn: false,
  1235. delBtn: false,
  1236. cellBtn: false,
  1237. addBtn: false,
  1238. addRowBtn: false,
  1239. showSummary: true,
  1240. addBtnText: '录入明细',
  1241. summaryText: "合计",
  1242. sumColumnList: [{
  1243. name: 'price',
  1244. type: 'sum',
  1245. decimals: 2
  1246. }, {
  1247. name: 'amount',
  1248. type: 'sum',
  1249. decimals: 2
  1250. }, {
  1251. name: 'quantity',
  1252. type: 'sum',
  1253. decimals: 0
  1254. }],
  1255. column: [{
  1256. label: '公司名称',
  1257. slot: true,
  1258. width: 200,
  1259. overHidden: true,
  1260. prop: 'corpId'
  1261. }, {
  1262. label: '费用名称',
  1263. slot: true,
  1264. width: 160,
  1265. prop: 'feeId'
  1266. }, {
  1267. label: '计价单位',
  1268. cell: true,
  1269. prop: 'unit',
  1270. type: "select",
  1271. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  1272. props: {
  1273. label: "dictValue",
  1274. value: "dictKey"
  1275. }
  1276. }, {
  1277. label: '数量',
  1278. cell: true,
  1279. prop: 'quantity'
  1280. }, {
  1281. label: '单价',
  1282. cell: true,
  1283. prop: 'price'
  1284. }, {
  1285. label: '金额',
  1286. cell: true,
  1287. prop: 'amount'
  1288. }, {
  1289. // label: '税率(默认6)',
  1290. label: '税率',
  1291. cell: true,
  1292. prop: 'taxRate'
  1293. }, {
  1294. label: '币别',
  1295. cell: true,
  1296. prop: 'currency',
  1297. type: "select",
  1298. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  1299. props: {
  1300. label: "dictValue",
  1301. value: "dictKey"
  1302. },
  1303. }
  1304. ]
  1305. },
  1306. paymentList: [],
  1307. collectionOption: {},
  1308. paymentOption: {},
  1309. paymentOptionBackup: {
  1310. align: 'center',
  1311. menuAlign: 'center',
  1312. index: true,
  1313. cancelBtn: false,
  1314. refreshBtn: false,
  1315. editBtn: false,
  1316. delBtn: false,
  1317. cellBtn: false,
  1318. addBtn: false,
  1319. addRowBtn: false,
  1320. showSummary: true,
  1321. addBtnText: '录入明细',
  1322. summaryText: "合计",
  1323. sumColumnList: [{
  1324. name: 'price',
  1325. type: 'sum',
  1326. decimals: 2
  1327. }, {
  1328. name: 'amount',
  1329. type: 'sum',
  1330. decimals: 2
  1331. }, {
  1332. name: 'quantity',
  1333. type: 'sum',
  1334. decimals: 0
  1335. }],
  1336. column: [{
  1337. label: '公司名称',
  1338. width: 200,
  1339. slot: true,
  1340. overHidden: true,
  1341. prop: 'corpId'
  1342. }, {
  1343. label: '费用名称',
  1344. slot: true,
  1345. prop: 'feeId'
  1346. }, {
  1347. label: '计价单位',
  1348. cell: true,
  1349. prop: 'unit',
  1350. type: "select",
  1351. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  1352. props: {
  1353. label: "dictValue",
  1354. value: "dictKey"
  1355. }
  1356. }, {
  1357. label: '数量',
  1358. cell: true,
  1359. prop: 'quantity'
  1360. }, {
  1361. label: '单价',
  1362. cell: true,
  1363. prop: 'price'
  1364. }, {
  1365. label: '金额',
  1366. cell: true,
  1367. prop: 'amount'
  1368. }, {
  1369. // label: '税率(默认6)',
  1370. label: '税率',
  1371. cell: true,
  1372. prop: 'taxRate'
  1373. }, {
  1374. label: '币别',
  1375. cell: true,
  1376. prop: 'currency',
  1377. type: "select",
  1378. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  1379. props: {
  1380. label: "dictValue",
  1381. value: "dictKey"
  1382. }
  1383. }]
  1384. }
  1385. };
  1386. },
  1387. async created() {
  1388. this.entrustOptionTwo = await this.getColumnData(this.getColumnName(85.1), this.entrustOptionTwoBackup);
  1389. this.KeyBox++
  1390. this.entrustOptionTwoT = await this.getColumnData(this.getColumnName(85.2), this.entrustOptionTwoTBackup);
  1391. this.KeyBoxTwo++
  1392. this.vehicleOption = await this.getColumnData(this.getColumnName(85.3), this.vehicleOptionTwo);
  1393. this.keyContact++
  1394. this.collectionOption = await this.getColumnData(this.getColumnName(85.4), this.collectionOptionBackup);
  1395. this.paymentOption = await this.getColumnData(this.getColumnName(85.5), this.paymentOptionBackup);
  1396. if (this.id) {
  1397. if (this.id.slice(0, 4) === 'copy') {
  1398. detailDelegationList({id: this.id.slice(4, this.id.length), kind: '1'}).then(res => {
  1399. this.goodsForm = res.data.data
  1400. this.tableData = res.data.data.orderAddressList
  1401. this.entrustList = res.data.data.itemList
  1402. this.goodsList = res.data.data.itemList
  1403. this.vehicleList = res.data.data.orderItemList
  1404. this.orderFilesList = res.data.data.fileList
  1405. this.goodsForm.status = 0
  1406. if (res.data.data.orderFeeList.length > 0) {
  1407. res.data.data.orderFeeList.forEach(item => {
  1408. if (item.type == 1) {
  1409. this.collectionList.push(item)
  1410. } else {
  1411. this.paymentList.push(item)
  1412. }
  1413. })
  1414. }
  1415. this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status !== 0
  1416. delete this.goodsForm.orderAddressList
  1417. delete this.goodsForm.itemList
  1418. delete this.goodsForm.orderFeeList
  1419. this.goodsForm.id = ''
  1420. this.tableData.forEach(item => item.id = '')
  1421. this.entrustList.forEach(item => item.id = '')
  1422. this.goodsList.forEach(item => item.id = '')
  1423. this.vehicleList.forEach(item => item.id = '')
  1424. this.orderFilesList.forEach(item => item.id = '')
  1425. //查询业务员
  1426. this.salesmanQuery()
  1427. })
  1428. } else {
  1429. detailDelegationList({id: this.id, kind: '1'}).then(res => {
  1430. this.goodsForm = res.data.data
  1431. this.tableData = res.data.data.orderAddressList
  1432. this.entrustList = res.data.data.itemList
  1433. this.goodsList = res.data.data.itemList
  1434. this.vehicleList = res.data.data.orderItemList
  1435. this.orderFilesList = res.data.data.fileList
  1436. if (res.data.data.orderFeeList.length > 0) {
  1437. res.data.data.orderFeeList.forEach(item => {
  1438. if (item.type == 1) {
  1439. this.collectionList.push(item)
  1440. } else {
  1441. this.paymentList.push(item)
  1442. }
  1443. })
  1444. }
  1445. this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status !== 0
  1446. delete this.goodsForm.orderAddressList
  1447. delete this.goodsForm.itemList
  1448. delete this.goodsForm.orderFeeList
  1449. // this.tableData.forEach(item => {
  1450. // if (item.region) item.region = item.region.split(',')
  1451. // })
  1452. //查询业务员
  1453. this.salesmanQuery()
  1454. })
  1455. }
  1456. } else {
  1457. this.tableData = [{}, {}]
  1458. getCorp().then(res => {
  1459. this.goodsForm = {
  1460. corpId: res.data.data ? res.data.data.id : '',
  1461. businessType: "出口",
  1462. shippingMode: "集装箱",
  1463. status: 0,
  1464. belongCompany: res.data.data ? res.data.data.belongCompany : '',
  1465. bsDate: new Date((new Date).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 19)//获取当天时间并格式化
  1466. }
  1467. this.salesmanQuery()
  1468. })
  1469. this.entrustList = []
  1470. }
  1471. // 非租户模式默认加载管理组数据
  1472. if (!website.tenantMode) {
  1473. this.initData(website.tenantId);
  1474. } else {
  1475. this.initData();
  1476. }
  1477. this.$refs.other.show = false
  1478. },
  1479. methods: {
  1480. changeSelect(val) {
  1481. for (let item of this.salesmanList) {
  1482. if (item.id == val) {
  1483. this.goodsForm.salesmanDept = item.deptId.split(',')[0]
  1484. }
  1485. }
  1486. },
  1487. initData(tenantId) {
  1488. getDeptTree(tenantId).then(res => {
  1489. const column = this.findObject(this.goodsOptionForm.column, "salesmanDept");
  1490. column.dicData = res.data.data;
  1491. });
  1492. },
  1493. //查询业务员
  1494. salesmanQuery(realName) {
  1495. getSalesman({realName: realName}).then(res => {
  1496. this.salesmanList = res.data.data
  1497. })
  1498. },
  1499. //自定义列保存
  1500. async saveColumnCollection() {
  1501. /**
  1502. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1503. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1504. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1505. */
  1506. const inSave = await this.saveColumnData(this.getColumnName(85.4), this.collectionOption);
  1507. if (inSave) {
  1508. this.$message.success("保存成功");
  1509. //关闭窗口
  1510. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  1511. }
  1512. },
  1513. //自定义列重置
  1514. async resetColumnCollection() {
  1515. this.collectionOption = this.collectionOptionBackup;
  1516. const inSave = await this.delColumnData(this.getColumnName(85.4), this.collectionOptionBackup);
  1517. if (inSave) {
  1518. this.$message.success("重置成功");
  1519. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  1520. }
  1521. },
  1522. //自定义列保存
  1523. async saveColumnPayment() {
  1524. /**
  1525. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1526. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1527. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1528. */
  1529. const inSave = await this.saveColumnData(this.getColumnName(85.5), this.paymentOption);
  1530. if (inSave) {
  1531. this.$message.success("保存成功");
  1532. //关闭窗口
  1533. this.$refs.payment.$refs.dialogColumn.columnBox = false;
  1534. }
  1535. },
  1536. //自定义列重置
  1537. async resetColumnPayment() {
  1538. this.paymentOption = this.paymentOptionBackup;
  1539. const inSave = await this.delColumnData(this.getColumnName(85.5), this.paymentOptionBackup);
  1540. if (inSave) {
  1541. this.$message.success("重置成功");
  1542. this.$refs.payment.$refs.dialogColumn.columnBox = false;
  1543. }
  1544. },
  1545. //自定义列保存
  1546. async saveColumnBox() {
  1547. /**
  1548. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1549. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1550. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1551. */
  1552. const inSave = await this.saveColumnData(this.getColumnName(85.1), this.entrustOptionTwo);
  1553. if (inSave) {
  1554. this.$message.success("保存成功");
  1555. //关闭窗口
  1556. this.$refs.crudBox.$refs.dialogColumn.columnBox = false;
  1557. }
  1558. },
  1559. //自定义列重置
  1560. async resetColumnBox() {
  1561. this.entrustOptionTwo = this.entrustOptionTwoBackup;
  1562. const inSave = await this.delColumnData(this.getColumnName(85.1), this.entrustOptionTwoBackup);
  1563. if (inSave) {
  1564. this.$message.success("重置成功");
  1565. this.$refs.crudBox.$refs.dialogColumn.columnBox = false;
  1566. }
  1567. },
  1568. //自定义列保存
  1569. async saveColumnBoxTwo() {
  1570. /**
  1571. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1572. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1573. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1574. */
  1575. const inSave = await this.saveColumnData(this.getColumnName(85.2), this.entrustOptionTwoT);
  1576. if (inSave) {
  1577. this.$message.success("保存成功");
  1578. //关闭窗口
  1579. this.$refs.crudBoxTwo.$refs.dialogColumn.columnBox = false;
  1580. }
  1581. },
  1582. //自定义列重置
  1583. async resetColumnBoxTwo() {
  1584. this.entrustOptionTwoT = this.entrustOptionTwoTBackup;
  1585. const inSave = await this.delColumnData(this.getColumnName(85.2), this.entrustOptionTwoTBackup);
  1586. if (inSave) {
  1587. this.$message.success("重置成功");
  1588. this.$refs.crudBoxTwo.$refs.dialogColumn.columnBox = false;
  1589. }
  1590. },
  1591. //自定义列保存
  1592. async saveColumnContact() {
  1593. /**
  1594. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1595. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1596. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1597. */
  1598. const inSave = await this.saveColumnData(this.getColumnName(85.3), this.vehicleOption);
  1599. if (inSave) {
  1600. this.$message.success("保存成功");
  1601. //关闭窗口
  1602. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1603. }
  1604. },
  1605. //自定义列重置
  1606. async resetColumnContact() {
  1607. this.vehicleOption = this.vehicleOptionTwo;
  1608. const inSave = await this.delColumnData(this.getColumnName(85.3), this.vehicleOptionTwo);
  1609. if (inSave) {
  1610. this.$message.success("重置成功");
  1611. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1612. }
  1613. },
  1614. //刷新数据
  1615. refreshData() {
  1616. detailDelegationList({id: this.id, kind: '1'}).then(res => {
  1617. this.goodsForm = res.data.data
  1618. this.tableData = res.data.data.orderAddressList
  1619. this.entrustList = res.data.data.itemList
  1620. this.goodsList = res.data.data.itemList
  1621. this.vehicleList = res.data.data.orderItemList
  1622. this.orderFilesList = res.data.data.fileList
  1623. if (res.data.data.orderFeeList.length > 0) {
  1624. this.collectionList = []
  1625. this.paymentList = []
  1626. res.data.data.orderFeeList.forEach(item => {
  1627. if (item.type == 1) {
  1628. this.collectionList.push(item)
  1629. } else {
  1630. this.paymentList.push(item)
  1631. }
  1632. })
  1633. }
  1634. this.goodsOptionFormC.disabled = true
  1635. this.goodsOptionForm.disabled = true
  1636. this.goodsOptionFormTwo.disabled = true
  1637. this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status >= 1
  1638. delete this.goodsForm.orderAddressList
  1639. delete this.goodsForm.itemList
  1640. delete this.goodsForm.orderFeeList
  1641. // this.tableData.forEach(item => {
  1642. // if (item.region) item.region = item.region.split(',')
  1643. // })
  1644. this.type = false
  1645. })
  1646. },
  1647. //切换收付费
  1648. handleSelect(tab, event) {
  1649. this.activeIndex = tab.name
  1650. },
  1651. //箱信息保存
  1652. rowSaveT(row, index, done, loading) {
  1653. row.$cellEdit = false
  1654. done()
  1655. },
  1656. //箱信息选择车队
  1657. getfleetIdT(data, row) {
  1658. this.$set(row, 'fleetName', data.cname)
  1659. },
  1660. //地址新增
  1661. addAddress() {
  1662. this.tableData.splice(this.tableData.length - 1, 0, {})
  1663. },
  1664. //返回主列表
  1665. backToList() {
  1666. this.goodsForm = {}
  1667. this.$emit('backToList')
  1668. },
  1669. //删除途径地址
  1670. deleteAddress(scope) {
  1671. this.tableData.splice(scope.$index, 1);
  1672. },
  1673. //箱信息保存
  1674. rowSave(row, index, done, loading) {
  1675. row.$cellEdit = false
  1676. done()
  1677. },
  1678. rowCell(row, index) {
  1679. this.$refs.collection.rowCell(row, index)
  1680. },
  1681. paymentRowCell(row, index) {
  1682. this.$refs.payment.rowCell(row, index)
  1683. },
  1684. //箱信息移除
  1685. rowDel(row, index) {
  1686. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  1687. confirmButtonText: '确定',
  1688. cancelButtonText: '取消',
  1689. type: 'warning'
  1690. }).then(() => {
  1691. this.entrustList.splice(index, 1);
  1692. }).catch(() => {
  1693. this.$message({
  1694. type: 'info',
  1695. message: '已取消删除'
  1696. });
  1697. });
  1698. },
  1699. //保存
  1700. editCustomer() {
  1701. let data = JSON.parse(JSON.stringify(this.tableData))
  1702. data.forEach((item, index) => {
  1703. item.sort = index + 1
  1704. // if (item.region !== undefined && item.region.length !== 0) {
  1705. // item.region = item.region.join(',')
  1706. // } else {
  1707. // item.region = ''
  1708. // }
  1709. })
  1710. this.type = true
  1711. saveSaveList({
  1712. ...this.goodsForm,
  1713. kind: '1',
  1714. orderAddressList: data,
  1715. fileList: this.orderFilesList,
  1716. itemList: this.entrustList,
  1717. orderFeeList: this.collectionList.concat(this.paymentList)
  1718. }).then(res => {
  1719. this.$message.success('保存成功');
  1720. if (!this.goodsForm.id) {
  1721. this.id = res.data.data
  1722. this.refreshData()
  1723. } else {
  1724. this.refreshData()
  1725. }
  1726. })
  1727. },
  1728. //确认变更
  1729. confirmChange() {
  1730. validChange().then(res => {
  1731. console.log(res)
  1732. this.goodsForm.status = 0
  1733. this.goodsOptionFormC.disabled = false
  1734. this.goodsOptionForm.disabled = false
  1735. this.goodsOptionFormTwo.disabled = false
  1736. this.typeTwo = true
  1737. })
  1738. },
  1739. //变更保存
  1740. changeSaving() {
  1741. this.$refs['goodsFormE'].validate((valid, doneE) => {
  1742. doneE()
  1743. if (valid) {
  1744. this.$refs['goodsForm'].validate((valid, done) => {
  1745. done();
  1746. if (valid) {
  1747. let data = JSON.parse(JSON.stringify(this.tableData))
  1748. data.forEach((item, index) => {
  1749. item.sort = index + 1
  1750. })
  1751. this.type = true
  1752. delete this.goodsForm.status
  1753. changeSubmission({
  1754. ...this.goodsForm,
  1755. kind: '1',
  1756. orderAddressList: data,
  1757. fileList: this.orderFilesList,
  1758. itemList: this.entrustList,
  1759. orderItemList: this.vehicleList,
  1760. orderFeeList: this.collectionList.concat(this.paymentList)
  1761. }).then(res => {
  1762. this.$message.success('保存成功');
  1763. this.typeTwo = false
  1764. this.refreshData()
  1765. })
  1766. } else {
  1767. return false;
  1768. }
  1769. });
  1770. } else {
  1771. return false;
  1772. }
  1773. })
  1774. },
  1775. //提交委托
  1776. submit(type) {
  1777. if (type) {
  1778. this.$refs['goodsFormE'].validate((valid, done) => {
  1779. done()
  1780. })
  1781. this.$refs['goodsForm'].validate((valid, done) => {
  1782. done()
  1783. })
  1784. for (let item in this.tableData) {
  1785. if (item < Number(this.tableData.length) - 1) {
  1786. if (!this.tableData[item].corpId) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行货运地点');
  1787. // if (!this.tableData[item].address) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行详细地址');
  1788. // if (!this.tableData[item].contacts) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行联系人');
  1789. // if (!this.tableData[item].tel) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行电话');
  1790. }
  1791. }
  1792. for (let item in this.entrustList) {
  1793. if (!this.entrustList[item].ctnType) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行箱型');
  1794. if (!this.entrustList[item].ctnQuantity) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行箱量');
  1795. if (!this.entrustList[item].arrivalTime) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行货运日期');
  1796. // if (!this.entrustList[item].landAmountD) return this.$message.error('请输入第' + Number(Number(item) + 1) + '运费');
  1797. }
  1798. if (this.entrustList.length === 0) return this.$message.error('箱信息不能为空')
  1799. this.$refs['goodsFormE'].validate((valid, doneE) => {
  1800. doneE()
  1801. if (valid) {
  1802. this.$refs['goodsForm'].validate((valid, done) => {
  1803. done();
  1804. if (valid) {
  1805. let data = JSON.parse(JSON.stringify(this.tableData))
  1806. data.forEach((item, index) => {
  1807. item.sort = index + 1
  1808. // if (item.region.length !== 0) {
  1809. // item.region = item.region.join(',')
  1810. // } else {
  1811. // item.region = ''
  1812. // }
  1813. })
  1814. this.entrustList.forEach(item => {
  1815. if (!item.arrivalTime) {
  1816. item.arrivalTime = this.goodsForm.arrivalTime
  1817. }
  1818. })
  1819. saveSaveList({
  1820. ...this.goodsForm,
  1821. kind: '1',
  1822. orderAddressList: data,
  1823. fileList: this.orderFilesList,
  1824. itemList: this.entrustList,
  1825. orderFeeList: this.collectionList.concat(this.paymentList)
  1826. }).then(res => {
  1827. saveDelegationList({
  1828. id: this.goodsForm.id
  1829. }).then(res => {
  1830. this.$message.success('提交成功');
  1831. this.refreshData()
  1832. })
  1833. })
  1834. } else {
  1835. return false;
  1836. }
  1837. });
  1838. } else {
  1839. return false;
  1840. }
  1841. })
  1842. } else {
  1843. cancelSubmission({
  1844. id: this.goodsForm.id
  1845. }).then(res => {
  1846. this.$message.success('取消成功');
  1847. this.refreshData()
  1848. })
  1849. }
  1850. }
  1851. ,
  1852. //收费新增
  1853. addRowCollection() {
  1854. this.$refs.collection.rowCellAdd({
  1855. currency: '1',
  1856. type: '1',
  1857. $cellEdit: true
  1858. });
  1859. }
  1860. ,
  1861. //打开附件
  1862. annexOpen(row, index) {
  1863. this.enclosure = true
  1864. getFee({id: row.id}).then(res => {
  1865. this.orderList = res.data.data
  1866. })
  1867. }
  1868. ,
  1869. //付费新增
  1870. addRowPayment() {
  1871. this.$refs.payment.rowCellAdd({
  1872. currency: '1',
  1873. type: '2',
  1874. $cellEdit: true
  1875. });
  1876. }
  1877. ,
  1878. //选择费用
  1879. selectValue(value, row) {
  1880. this.$set(row, 'feeName', value.cname)
  1881. }
  1882. ,
  1883. //选择客户信息触发
  1884. getfleetId(data, row) {
  1885. this.$set(row, 'corpName', data.cname)
  1886. }
  1887. ,
  1888. //收款信息移除
  1889. makeDel(row, index) {
  1890. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  1891. confirmButtonText: '确定',
  1892. cancelButtonText: '取消',
  1893. type: 'warning'
  1894. }).then(() => {
  1895. if (row.id) removeCollection(row.id)
  1896. this.collectionList.splice(index, 1);
  1897. }).catch(() => {
  1898. this.$message({
  1899. type: 'info',
  1900. message: '已取消删除'
  1901. });
  1902. });
  1903. }
  1904. ,
  1905. //付款信息移除
  1906. feeDel(row, index) {
  1907. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  1908. confirmButtonText: '确定',
  1909. cancelButtonText: '取消',
  1910. type: 'warning'
  1911. }).then(() => {
  1912. if (row.id) removeCollection(row.id)
  1913. this.paymentList.splice(index, 1);
  1914. }).catch(() => {
  1915. this.$message({
  1916. type: 'info',
  1917. message: '已取消删除'
  1918. });
  1919. });
  1920. }
  1921. ,
  1922. //选择公司名称带出所属公司
  1923. getCorpData(row) {
  1924. this.goodsForm.belongCompany = row.belongCompany
  1925. this.goodsForm.salesman = ''
  1926. //查询业务员
  1927. this.salesmanQuery()
  1928. }
  1929. ,
  1930. //选择地址客户带出地址
  1931. withAddress(row, scope) {
  1932. this.$set(this.tableData[scope.$index], 'contacts', row.attn)
  1933. this.$set(this.tableData[scope.$index], 'tel', row.tel)
  1934. this.$set(this.tableData[scope.$index], 'address', row.storageAddr)
  1935. // this.tableData[scope.$index].contacts = row.attn
  1936. // this.tableData[scope.$index].tel = row.tel
  1937. // this.tableData[scope.$index].address = row.storageAddr
  1938. if (!scope.row.key) scope.row.key = 0
  1939. this.$set(this.tableData[scope.$index], 'corpName', row.cname)
  1940. // this.tableData[scope.$index].corpName = row.cname
  1941. if (row.belongtoarea) {
  1942. addressList(row.belongtoarea.split(',')[0]).then(res => {
  1943. this.tableData[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
  1944. scope.row.key++
  1945. })
  1946. }
  1947. }
  1948. ,
  1949. //自定义表头
  1950. renderHeader(h) {
  1951. return (
  1952. <div>
  1953. <el-tooltip className="item" effect="dark" content="增加途径地址" placement="top">
  1954. <el-button type="primary" icon="el-icon-plus" size="mini" circle onClick={() => this.addAddress()}
  1955. style="margin-right: 1.25rem;"></el-button>
  1956. </el-tooltip>
  1957. </div>
  1958. )
  1959. }
  1960. ,
  1961. //自定义表头
  1962. customTitle(h, {column, $index}) {
  1963. let text = column.label
  1964. return (
  1965. <div>
  1966. {{text}}<span style="color:#F56C6C">*</span>
  1967. </div>
  1968. )
  1969. }
  1970. }
  1971. }
  1972. </script>
  1973. <style scoped lang="scss">
  1974. ::v-deep .el-form-item {
  1975. margin-bottom: 8px;
  1976. }
  1977. ::v-deep .el-form-item__content {
  1978. line-height: 32px;
  1979. }
  1980. ::v-deep .el-card__body {
  1981. padding: 10px 15px;
  1982. font-size: 14px;
  1983. }
  1984. </style>