detailPage.vue 103 KB

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