detailPage.vue 71 KB

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