detailPage.vue 117 KB

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