detailPage.vue 112 KB

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