detailPage.vue 71 KB

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