detailPage.vue 81 KB

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