voyageDetail.vue 91 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370
  1. <template>
  2. <div class="line-container-p24">
  3. <i class="el-icon-arrow-left"></i>
  4. <div
  5. class="dib go-back ml8 pointer"
  6. @click="router.replace('/voyage/voyageList')"
  7. >
  8. 返回航次列表
  9. </div>
  10. </div>
  11. <div class="container-title df aic jcsb" v-auth="'VOYAGEINFO'">
  12. <div class="df aic">
  13. <div class="mr30">航次信息</div>
  14. <el-tooltip
  15. v-if="blockchainInfo"
  16. class="box-item"
  17. effect="light"
  18. :content="blockchainInfo.hash"
  19. placement="top"
  20. >
  21. <div class="pointer" style="font-size: 14px; font-weight: normal">
  22. 汇很多科技区块链认证
  23. </div>
  24. </el-tooltip>
  25. </div>
  26. </div>
  27. <div class="line-container-p24" v-auth="'VOYAGEINFO'">
  28. <div class="line">
  29. <div class="info-line">
  30. <div class="info-line-title">航次名称</div>
  31. <el-input
  32. class="info-line-text"
  33. v-model="voyage.voyageName"
  34. disabled
  35. ></el-input>
  36. </div>
  37. <div class="info-gap" v-if="shipAudits.length"></div>
  38. <div class="info-line">
  39. <div class="info-line-title">货主</div>
  40. <el-input
  41. class="info-line-text"
  42. v-model="voyage.cargoOwnerName"
  43. disabled
  44. ></el-input>
  45. </div>
  46. </div>
  47. <!-- <div class="line">
  48. <div class="info-line">
  49. <div class="info-line-title">船东</div>
  50. <el-input
  51. class="info-line-text"
  52. v-model="voyage.shipOwnerName"
  53. disabled
  54. ></el-input>
  55. </div>
  56. <div class="info-line">
  57. <div class="info-line-title">船东手机号</div>
  58. <el-input
  59. class="info-line-text"
  60. v-model="voyage.shipOwnerPhone"
  61. disabled
  62. ></el-input>
  63. </div>
  64. </div> -->
  65. <div class="line">
  66. <div class="info-line">
  67. <div class="info-line-title">船舶名称</div>
  68. <el-input
  69. class="info-line-text"
  70. v-model="voyage.shipName"
  71. disabled
  72. ></el-input>
  73. </div>
  74. <div
  75. class="info-gap"
  76. v-if="shipAudits.length"
  77. @click="isCertsVisable = true"
  78. >
  79. 汇很多认证
  80. </div>
  81. <el-dialog
  82. @open="showCerts"
  83. v-model="isCertsVisable"
  84. destroy-on-close
  85. width="30%"
  86. >
  87. <Certs ref="certs"></Certs>
  88. </el-dialog>
  89. <div class="info-line">
  90. <div class="info-line-title">MMSI</div>
  91. <el-input
  92. class="info-line-text"
  93. v-model="voyage.shipMmsi"
  94. disabled
  95. ></el-input>
  96. </div>
  97. </div>
  98. <div :id="mapId" class="map-container"></div>
  99. <div class="line" style="margin-top: 30px">
  100. <div class="info-line">
  101. <div class="info-line-title">开始时间</div>
  102. <el-input
  103. class="info-line-text"
  104. v-model="voyage.startTime"
  105. disabled
  106. ></el-input>
  107. </div>
  108. <div class="info-line">
  109. <div class="info-line-title">结束时间</div>
  110. <el-input
  111. class="info-line-text"
  112. v-model="voyage.endTime"
  113. disabled
  114. ></el-input>
  115. </div>
  116. </div>
  117. <div class="line">
  118. <div class="info-line">
  119. <div class="info-line-title">装货港</div>
  120. <el-input
  121. class="info-line-text"
  122. v-model="voyage.loadPort"
  123. disabled
  124. ></el-input>
  125. </div>
  126. </div>
  127. <div class="line">
  128. <div
  129. class="info-line"
  130. v-for="(item, index) in voyage.voyageDetails"
  131. :key="item"
  132. >
  133. <div class="info-line-title">{{ "第 " + (index + 1) + " 卸货港" }}</div>
  134. <el-input
  135. class="info-line-text"
  136. v-model="item.portName"
  137. disabled
  138. ></el-input>
  139. </div>
  140. <div v-if="voyage.voyageStatus != 2">
  141. <div
  142. class="info-line"
  143. v-if="!insertDiscPortVisable"
  144. v-auth="'ADDNEWDISCPORT'"
  145. style="margin-left: 140px"
  146. >
  147. <el-button type="primary" @click="insertDiscPortVisable = true">
  148. 添加提前卸货港
  149. </el-button>
  150. </div>
  151. <div class="info-line" v-else style="margin-left: 40px">
  152. <div class="info-line-title" style="width: 80px">提前卸货港</div>
  153. <el-autocomplete
  154. class="info-line-text mr20"
  155. v-model="toInsertDiscPortValue"
  156. :fetch-suggestions="getCol"
  157. @blur="clear('toInsertDiscPortId')"
  158. placeholder="选择卸货港"
  159. @select="selectToInsertDiscPort($event)"
  160. style="width: 120px !important"
  161. />
  162. <el-button type="primary" @click="addNewPort">确认添加</el-button>
  163. <el-button type="default" @click="cancelInsertDiscPort">
  164. 取消添加
  165. </el-button>
  166. </div>
  167. </div>
  168. </div>
  169. <div class="line">
  170. <div class="info-line">
  171. <div class="info-line-title">货种</div>
  172. <el-input
  173. class="info-line-text"
  174. v-model="voyage.cargo"
  175. disabled
  176. ></el-input>
  177. </div>
  178. <div class="info-line">
  179. <div style="width: 120px !important" class="info-line-title">货量</div>
  180. <el-input
  181. style="width: 100px !important"
  182. class="info-line-text"
  183. v-model="voyage.tons"
  184. disabled
  185. ></el-input>
  186. <span class="unit">吨</span>
  187. <el-input
  188. style="width: 80px !important"
  189. class="info-line-text"
  190. v-model="voyage.pieces"
  191. disabled
  192. ></el-input>
  193. <span class="unit">件</span>
  194. </div>
  195. </div>
  196. <div class="line">
  197. <div class="info-line">
  198. <div class="info-line-title">合理卸货天数</div>
  199. <el-input
  200. class="info-line-text"
  201. v-model="voyage.reasonableUnloadingDays"
  202. disabled
  203. ></el-input>
  204. </div>
  205. </div>
  206. <div class="container-second-title df aic jcsb mt40">
  207. <div>船舶运输记录详情</div>
  208. <div class="df aic">
  209. <div v-auth="'VOYAGEINFOUPDATE'" v-if="voyage.voyageStatus == 1">
  210. <el-button
  211. class="mr20"
  212. v-if="disabledStatus"
  213. type="primary"
  214. @click="changeVoyageInfo"
  215. >
  216. 修改航次
  217. </el-button>
  218. <div v-else>
  219. <div>
  220. <el-button class="ml20" @click="cancelVoyageChange">
  221. 取消修改
  222. </el-button>
  223. <el-button
  224. class="ml20 mr20"
  225. type="primary"
  226. @click="submitVoyageChange"
  227. >
  228. 提交修改
  229. </el-button>
  230. </div>
  231. </div>
  232. </div>
  233. <el-button
  234. style="width: 160px"
  235. type="primary"
  236. @click="downloadExcel"
  237. v-auth="'DOWNLOADSHIPTRACK'"
  238. :loading="isLoadingExcel"
  239. >
  240. 下载船舶跟踪表
  241. </el-button>
  242. </div>
  243. </div>
  244. <div class="line">
  245. <div class="info-line">
  246. <div class="info-line-title">到达装货港时间</div>
  247. <el-date-picker
  248. class="info-line-text"
  249. v-model="voyage.arrivalLoadPortTime"
  250. type="datetime"
  251. format="YYYY/MM/DD HH:mm"
  252. value-format="YYYY/MM/DD HH:mm:ss"
  253. placeholder="到达装货港时间"
  254. :disabled="disabledStatus"
  255. ></el-date-picker>
  256. </div>
  257. <div class="info-line">
  258. <div class="info-line-title">实装货量</div>
  259. <el-input
  260. style="width: 100px !important"
  261. class="info-line-text"
  262. v-model="voyage.actualLoadTons"
  263. :disabled="disabledStatus"
  264. placeholder="实装吨位"
  265. ></el-input>
  266. <span class="unit">吨</span>
  267. <el-input
  268. style="width: 80px !important"
  269. class="info-line-text"
  270. v-model="voyage.actualLoadPieces"
  271. :disabled="disabledStatus"
  272. placeholder="实装件数"
  273. ></el-input>
  274. <span class="unit">件</span>
  275. </div>
  276. </div>
  277. <div class="line">
  278. <div class="info-line">
  279. <div class="info-line-title">装货开始时间</div>
  280. <el-date-picker
  281. class="info-line-text"
  282. v-model="voyage.loadStartTime"
  283. type="datetime"
  284. format="YYYY/MM/DD HH:mm"
  285. value-format="YYYY/MM/DD HH:mm:ss"
  286. placeholder="装货开始时间"
  287. :disabled="disabledStatus"
  288. ></el-date-picker>
  289. </div>
  290. <div class="info-line">
  291. <div class="info-line-title">装货结束时间</div>
  292. <el-date-picker
  293. class="info-line-text"
  294. v-model="voyage.loadEndTime"
  295. type="datetime"
  296. format="YYYY/MM/DD HH:mm"
  297. value-format="YYYY/MM/DD HH:mm:ss"
  298. placeholder="装货开始时间"
  299. :disabled="disabledStatus"
  300. ></el-date-picker>
  301. </div>
  302. </div>
  303. <el-tabs v-model="currentPortId" type="border-card" class="demo-tabs mb20">
  304. <el-tab-pane
  305. v-for="(item, index) in voyage.voyageDetails"
  306. :key="item"
  307. :label="item.portName + ' # ' + (index + 1)"
  308. :name="item.portId + ''"
  309. >
  310. <div class="line">
  311. <div class="info-line">
  312. <div class="info-line-title">
  313. <div class="mb10">
  314. {{
  315. index === 0
  316. ? voyage.loadPort
  317. : voyage.voyageDetails[index - 1].portName
  318. }}
  319. </div>
  320. <div>开航时间</div>
  321. </div>
  322. <el-date-picker
  323. class="info-line-text"
  324. v-model="item.setSailTime"
  325. type="datetime"
  326. @change="calExpectedArrivalTime(item.id, index)"
  327. format="YYYY/MM/DD HH:mm"
  328. value-format="YYYY/MM/DD HH:mm:ss"
  329. placeholder="开航时间"
  330. :disabled="disabledStatus"
  331. ></el-date-picker>
  332. </div>
  333. <div class="info-line">
  334. <div class="info-line-title">预计到港时间</div>
  335. <el-date-picker
  336. class="info-line-text"
  337. v-model="item.expectedArrivalTime"
  338. type="datetime"
  339. format="YYYY/MM/DD"
  340. value-format="YYYY/MM/DD HH:mm:ss"
  341. placeholder="预计到港时间"
  342. disabled
  343. ></el-date-picker>
  344. </div>
  345. </div>
  346. <div class="line">
  347. <div class="info-line">
  348. <div class="info-line-title">实际到港时间</div>
  349. <el-date-picker
  350. class="info-line-text"
  351. v-model="item.actualArrivalTime"
  352. type="datetime"
  353. format="YYYY/MM/DD HH:mm"
  354. value-format="YYYY/MM/DD HH:mm:ss"
  355. placeholder="实际到港时间"
  356. :disabled="disabledStatus"
  357. ></el-date-picker>
  358. </div>
  359. <!-- <div class="info-line">
  360. <div class="info-line-title">抵达目的地港时间</div>
  361. <el-date-picker
  362. class="info-line-text"
  363. v-model="voyage.arrivalPortTime"
  364. type="datetime"
  365. format="YYYY/MM/DD HH:mm:ss"
  366. value-format="YYYY/MM/DD HH:mm:ss"
  367. placeholder="抵达目的地港时间"
  368. :disabled="disabledStatus"
  369. ></el-date-picker>
  370. </div> -->
  371. </div>
  372. <div class="line">
  373. <div class="info-line">
  374. <div class="info-line-title">卸货开始时间</div>
  375. <el-date-picker
  376. class="info-line-text"
  377. v-model="item.dischargeStartTime"
  378. type="datetime"
  379. format="YYYY/MM/DD HH:mm"
  380. value-format="YYYY/MM/DD HH:mm:ss"
  381. placeholder="卸货开始时间"
  382. :disabled="disabledStatus"
  383. ></el-date-picker>
  384. </div>
  385. <div class="info-line">
  386. <div class="info-line-title">卸货结束时间</div>
  387. <el-date-picker
  388. class="info-line-text"
  389. v-model="item.dischargeEndTime"
  390. type="datetime"
  391. format="YYYY/MM/DD HH:mm"
  392. value-format="YYYY/MM/DD HH:mm:ss"
  393. placeholder="卸货结束时间"
  394. :disabled="disabledStatus"
  395. ></el-date-picker>
  396. </div>
  397. </div>
  398. <div class="line">
  399. <div class="info-line">
  400. <div class="info-line-title">实际卸货量</div>
  401. <el-input
  402. style="width: 100px !important"
  403. class="info-line-text"
  404. placeholder="实际卸货吨位"
  405. v-model="item.actualDischargeTons"
  406. :disabled="disabledStatus"
  407. ></el-input>
  408. <span class="unit">吨</span>
  409. <el-input
  410. style="width: 80px !important"
  411. class="info-line-text"
  412. placeholder="实际卸货件数"
  413. v-model="item.actualDischargePieces"
  414. :disabled="disabledStatus"
  415. ></el-input>
  416. <span class="unit">件</span>
  417. </div>
  418. <!-- <div class="info-line">
  419. <div class="info-line-title">是否购买保险</div>
  420. <el-checkbox
  421. v-model="voyage.hasInsurance"
  422. :checked="voyage.hasInsurance == 1"
  423. :disabled="disabledStatus"
  424. label="购买保险"
  425. ></el-checkbox>
  426. </div> -->
  427. </div>
  428. </el-tab-pane>
  429. </el-tabs>
  430. <div class="line">
  431. <div class="info-line">
  432. <div class="info-line-title">备注</div>
  433. <el-input
  434. class="info-line-textarea"
  435. v-model="voyage.remark"
  436. autosize
  437. type="textarea"
  438. :disabled="disabledStatus"
  439. ></el-input>
  440. </div>
  441. </div>
  442. </div>
  443. <div class="container-title" v-auth="'DISCHARGEINFO'">卸货信息</div>
  444. <div class="line-container-p24" v-auth="'DISCHARGEINFO'">
  445. <el-tabs
  446. v-model="currentDiscPortId"
  447. type="card"
  448. class="demo-tabs"
  449. @tab-click="changeDiscPortTab"
  450. >
  451. <el-tab-pane
  452. v-for="(item, index) in voyage.voyageDetails"
  453. :key="item"
  454. :label="item.portName + ' # ' + (index + 1)"
  455. :name="item.portId + ''"
  456. ></el-tab-pane>
  457. </el-tabs>
  458. <div v-auth="'WEATHERRECORD'">
  459. <div class="container-second-title df" v-auth="'WEATHERRECORD'">
  460. <div>天气信息</div>
  461. <div
  462. class="ml10"
  463. style="
  464. font-size: 12px;
  465. color: rgba(0, 0, 0, 0.2);
  466. font-weight: normal;
  467. scale: 0.9;
  468. "
  469. >
  470. 天气信息为天气预报反应船舶所在区域即将发生天气情况
  471. <br />
  472. 预报下雨情况为预警信息请联系船东拍摄现场实际情况。
  473. </div>
  474. </div>
  475. <el-table
  476. style="width: 1200px"
  477. :data="weatherTableData"
  478. stripe
  479. v-auth="'WEATHERRECORD'"
  480. >
  481. <el-table-column
  482. type="index"
  483. label="序号"
  484. min-width="120"
  485. align="center"
  486. ></el-table-column>
  487. <el-table-column
  488. prop="weather"
  489. label="天气"
  490. min-width="120"
  491. align="center"
  492. ></el-table-column>
  493. <el-table-column
  494. prop="temperature"
  495. label="温度"
  496. min-width="100"
  497. align="center"
  498. ></el-table-column>
  499. <el-table-column
  500. prop="winddirection"
  501. label="风向"
  502. min-width="100"
  503. align="center"
  504. ></el-table-column>
  505. <el-table-column
  506. prop="windpower"
  507. label="风力"
  508. min-width="100"
  509. align="center"
  510. ></el-table-column>
  511. <el-table-column
  512. prop="reporttime"
  513. label="记录时间"
  514. min-width="100"
  515. align="center"
  516. >
  517. <template v-slot="scope">
  518. {{ subTimeStr(scope.row.reporttime, 16) }}
  519. </template>
  520. </el-table-column>
  521. </el-table>
  522. <div
  523. style="width: 1200px; text-align: right; margin-top: 43px"
  524. v-auth="'WEATHERRECORD'"
  525. >
  526. <el-pagination
  527. background
  528. layout="prev, pager, next"
  529. :total="weatherTotal"
  530. @current-change="weatherPageChange"
  531. ></el-pagination>
  532. </div>
  533. <div class="hr mt20"></div>
  534. </div>
  535. <div v-auth="'LABDETAIL_DISABLE'">
  536. <div class="container-second-title df aic jcsb mt40">
  537. <div>提单信息</div>
  538. <div>
  539. <el-button v-auth="'LABADD'" type="primary" @click="showAddLab()">
  540. 新增提单记录
  541. </el-button>
  542. </div>
  543. </div>
  544. <el-table :data="labTableData" stripe style="width: 90%">
  545. <!-- <el-table-column
  546. type="index"
  547. label="序号"
  548. min-width="120"
  549. align="center"
  550. ></el-table-column> -->
  551. <el-table-column
  552. prop="labNumber"
  553. label="提货单编号"
  554. min-width="120"
  555. align="center"
  556. ></el-table-column>
  557. <el-table-column
  558. prop="billingDate"
  559. label="开单日期"
  560. min-width="120"
  561. align="center"
  562. >
  563. <template v-slot="scope">
  564. {{ subTimeStr(scope.row.billingDate, 10) }}
  565. </template>
  566. </el-table-column>
  567. <el-table-column
  568. prop="cargo"
  569. label="产品名称"
  570. min-width="100"
  571. align="center"
  572. ></el-table-column>
  573. <el-table-column
  574. prop="carrier"
  575. label="承运人"
  576. min-width="120"
  577. align="center"
  578. ></el-table-column>
  579. <el-table-column
  580. prop="sentPieces"
  581. label="应发件数"
  582. min-width="100"
  583. align="center"
  584. ></el-table-column>
  585. <el-table-column
  586. prop="sentTons"
  587. label="应发数量"
  588. min-width="120"
  589. align="center"
  590. ></el-table-column>
  591. <el-table-column
  592. prop="actualPieces"
  593. label="实发件数"
  594. min-width="100"
  595. align="center"
  596. ></el-table-column>
  597. <el-table-column
  598. prop="actualTons"
  599. label="实发数量"
  600. min-width="120"
  601. align="center"
  602. ></el-table-column>
  603. <el-table-column
  604. prop="pickUpShip"
  605. label="提货船舶"
  606. min-width="100"
  607. align="center"
  608. ></el-table-column>
  609. <el-table-column
  610. prop="pickUpCompany"
  611. label="提货单位"
  612. min-width="120"
  613. align="center"
  614. ></el-table-column>
  615. <el-table-column
  616. prop="sapNo"
  617. label="SAP号"
  618. min-width="120"
  619. align="center"
  620. ></el-table-column>
  621. <el-table-column
  622. prop="salesman"
  623. label="业务员"
  624. min-width="120"
  625. align="center"
  626. ></el-table-column>
  627. <el-table-column label="单据" align="center">
  628. <template v-slot="scope">
  629. <el-button
  630. @click="showLab(scope.row, scope.$index, '查看提单')"
  631. type="primary"
  632. size="small"
  633. >
  634. {{ scope.row.file ? "查看" : "上传" }}
  635. </el-button>
  636. </template>
  637. </el-table-column>
  638. <el-table-column label="操作" align="center">
  639. <template v-slot="scope">
  640. <!-- <el-button
  641. v-auth="'LABUPDATE'"
  642. @click="showLab(scope.row, scope.$index, '修改提单')"
  643. type="primary"
  644. size="small"
  645. >
  646. 修改
  647. </el-button> -->
  648. <el-button
  649. v-auth="'LABDELETE'"
  650. @click="deleteLab(scope.row.id, scope.$index)"
  651. type="danger"
  652. size="small"
  653. >
  654. 删除
  655. </el-button>
  656. </template>
  657. </el-table-column>
  658. </el-table>
  659. <div style="text-align: right; margin-top: 43px; width: 1200px">
  660. <el-pagination
  661. background
  662. layout="prev, pager, next"
  663. :total="labTotal"
  664. @current-change="labPageChange"
  665. ></el-pagination>
  666. </div>
  667. <el-dialog
  668. v-model="isAddLabVisable"
  669. :title="labModalType"
  670. width="780px"
  671. center
  672. @close="cancelUploadLab"
  673. destroy-on-close
  674. >
  675. <el-form
  676. :model="labForm"
  677. inline
  678. style="margin-bottom: 20px"
  679. label-width="100px"
  680. >
  681. <!-- <el-form-item label="开单日期">
  682. <el-date-picker
  683. class="info-line-text"
  684. v-model="labForm.billingDate"
  685. type="date"
  686. format="YYYY/MM/DD"
  687. value-format="YYYY/MM/DD"
  688. placeholder="开单日期"
  689. ></el-date-picker>
  690. </el-form-item>
  691. <el-form-item label="开单数量">
  692. <el-input
  693. style="width: 240px"
  694. v-model="labForm.billingNum"
  695. placeholder="开单数量"
  696. ></el-input>
  697. </el-form-item> -->
  698. <el-form-item label="提单">
  699. <Uploader
  700. :actionUrl="store.state.wayBillUrl"
  701. :uploaderId="'labLoad'"
  702. :params="labParams"
  703. @onSendFileList="getLabBillList"
  704. :fileList="labBillList"
  705. uploadText="上传提单"
  706. :disabled="labModalType == '查看提单'"
  707. :limit="1"
  708. ></Uploader>
  709. </el-form-item>
  710. </el-form>
  711. <template
  712. #footer
  713. v-if="labModalType != '查看提单' && labBillList.length"
  714. >
  715. <el-button @click="cancelUploadLab">取消</el-button>
  716. <el-button
  717. :loading="isLabLoading"
  718. style="margin-left: 30px"
  719. type="primary"
  720. @click="addLab"
  721. >
  722. {{ isLabLoading ? "正在上传" : "提交" }}
  723. </el-button>
  724. </template>
  725. </el-dialog>
  726. <div class="hr mt20"></div>
  727. </div>
  728. <div v-auth="'SHIPDISCHARGE'">
  729. <div class="container-second-title df aic jcsb">
  730. <div>卸货记录</div>
  731. <div>
  732. <el-button
  733. v-auth="'SHIPDISCHARGEADD'"
  734. class="mr20"
  735. type="primary"
  736. @click="showAddPoundModal"
  737. >
  738. 新增卸货记录
  739. </el-button>
  740. <el-button
  741. v-auth="'DOWNLOADDISCHARGE'"
  742. @click="exportDischargeExcel"
  743. style="width: 160px"
  744. type="primary"
  745. :loading="isDischargeLoadingExcel"
  746. >
  747. 下载卸货信息
  748. </el-button>
  749. </div>
  750. </div>
  751. <el-table
  752. style="width: 1200px"
  753. :data="dischargeList"
  754. stripe
  755. :disabled="disabledStatus"
  756. >
  757. <el-table-column
  758. type="index"
  759. label="序号"
  760. min-width="120"
  761. align="center"
  762. ></el-table-column>
  763. <el-table-column
  764. prop="dischargeTime"
  765. label="卸货时间"
  766. min-width="120"
  767. align="center"
  768. >
  769. <template v-slot="scope">
  770. {{ subTimeStr(scope.row.dischargeTime, 16) }}
  771. </template>
  772. </el-table-column>
  773. <el-table-column
  774. prop="dischargeTons"
  775. label="卸货吨位"
  776. min-width="100"
  777. align="center"
  778. ></el-table-column>
  779. <el-table-column
  780. prop="dischargePieces"
  781. label="卸货件数"
  782. min-width="100"
  783. align="center"
  784. ></el-table-column>
  785. <el-table-column label="磅单" min-width="150" align="center">
  786. <template v-slot="scope">
  787. <el-button
  788. @click="showUpdateDischarge(scope.row, scope.$index, '查看记录')"
  789. type="primary"
  790. size="small"
  791. >
  792. {{ scope.row.files ? "查看" : "上传" }}
  793. </el-button>
  794. </template>
  795. </el-table-column>
  796. <el-table-column label="操作" min-width="150" align="center">
  797. <template v-slot="scope">
  798. <el-button
  799. v-auth="'SHIPDISCHARGEUPDATE'"
  800. @click="showUpdateDischarge(scope.row, scope.$index, '修改记录')"
  801. type="primary"
  802. size="small"
  803. >
  804. 修改
  805. </el-button>
  806. <el-button
  807. v-auth="'SHIPDISCHARGEDELETE'"
  808. @click="deleteDischarge(scope.row.id, scope.$index)"
  809. type="danger"
  810. size="small"
  811. >
  812. 删除
  813. </el-button>
  814. </template>
  815. </el-table-column>
  816. </el-table>
  817. <div style="width: 1200px; text-align: right; margin-top: 43px">
  818. <el-pagination
  819. background
  820. layout="prev, pager, next"
  821. :total="total"
  822. @current-change="pageChange"
  823. ></el-pagination>
  824. </div>
  825. <div class="hr m30-0"></div>
  826. </div>
  827. <el-dialog
  828. title="新增卸货记录"
  829. v-model="isAddPoundVisable"
  830. destroy-on-close
  831. >
  832. <el-form :model="formInline">
  833. <el-form-item label="卸货时间">
  834. <el-date-picker
  835. class="info-line-text"
  836. v-model="formInline.dischargeTime"
  837. type="datetime"
  838. format="YYYY/MM/DD HH:mm:ss"
  839. value-format="YYYY/MM/DD HH:mm:ss"
  840. placeholder="卸货时间"
  841. ></el-date-picker>
  842. </el-form-item>
  843. <el-form-item label="卸货吨位">
  844. <el-input
  845. class="info-line-text"
  846. v-model="formInline.dischargeTons"
  847. placeholder="卸货吨位"
  848. ></el-input>
  849. </el-form-item>
  850. <el-form-item label="卸货件数">
  851. <el-input
  852. class="info-line-text"
  853. v-model="formInline.dischargePieces"
  854. placeholder="卸货件数"
  855. ></el-input>
  856. </el-form-item>
  857. <el-form-item label="卸货记录">
  858. <Uploader
  859. :actionUrl="store.state.wayBillUrl"
  860. :uploaderId="'pound'"
  861. :params="poundParams"
  862. @onSendFileList="getPoundBillList"
  863. :fileList="poundBillList"
  864. uploadText="拖拽或点击上传磅单"
  865. ></Uploader>
  866. </el-form-item>
  867. </el-form>
  868. <div class="df aic jcfe mb30">
  869. <el-button type="primary" @click="addDischarge">新增</el-button>
  870. </div>
  871. </el-dialog>
  872. <el-dialog
  873. v-model="updateDischargeDialog"
  874. :title="dischargeDialogTitle"
  875. width="700px"
  876. center
  877. destroy-on-close
  878. >
  879. <el-form :model="updateForm" style="margin-bottom: 20px">
  880. <!-- <el-form-item label="记录ID">
  881. <span style="padding-left: 20px">{{ updateForm.id }}</span>
  882. </el-form-item> -->
  883. <el-form-item label="卸货时间">
  884. <el-date-picker
  885. class="info-line-text"
  886. v-model="updateForm.dischargeTime"
  887. type="datetime"
  888. format="YYYY/MM/DD HH:mm:ss"
  889. value-format="YYYY/MM/DD HH:mm:ss"
  890. placeholder="卸货时间"
  891. ></el-date-picker>
  892. </el-form-item>
  893. <el-form-item label="卸货吨位">
  894. <el-input
  895. style="width: 240px"
  896. v-model="updateForm.dischargeTons"
  897. placeholder="卸货吨位"
  898. ></el-input>
  899. </el-form-item>
  900. <el-form-item label="上传磅单">
  901. <Uploader
  902. :actionUrl="store.state.wayBillUrl"
  903. :uploaderId="'updatePound'"
  904. :params="updatePoundParams"
  905. @onSendFileList="getupdatePoundBillList"
  906. :fileList="updatePoundBillList"
  907. uploadText="拖拽或点击上传磅单"
  908. :disabled="dischargeDialogTitle == '查看记录'"
  909. ></Uploader>
  910. </el-form-item>
  911. </el-form>
  912. <template #footer>
  913. <el-button
  914. v-if="dischargeDialogTitle == '修改记录'"
  915. @click="cancelUpdateDischarge"
  916. >
  917. 取消
  918. </el-button>
  919. <el-button
  920. style="margin-left: 30px"
  921. type="primary"
  922. @click="updateDischarge"
  923. v-if="dischargeDialogTitle == '修改记录'"
  924. >
  925. 提交
  926. </el-button>
  927. </template>
  928. </el-dialog>
  929. <el-dialog
  930. v-model="dialogVisible"
  931. title="图片预览"
  932. width="30%"
  933. destroy-on-close
  934. >
  935. <el-image
  936. :src="dialogImageUrl"
  937. style="height: 100%; width: 100%"
  938. ></el-image>
  939. </el-dialog>
  940. <div v-auth="'CARLOAD'">
  941. <div class="container-second-title df aic jcsb mt40">
  942. <div>汽车装货记录详情</div>
  943. <div>
  944. <el-button
  945. v-auth="'CARLOADADD'"
  946. type="primary"
  947. @click="showAddTruckRecord()"
  948. >
  949. 新增汽车装货记录
  950. </el-button>
  951. </div>
  952. </div>
  953. <el-table :data="truckTableData" stripe>
  954. <el-table-column
  955. type="index"
  956. label="序号"
  957. min-width="120"
  958. align="center"
  959. ></el-table-column>
  960. <el-table-column
  961. prop="portName"
  962. label="港口名称"
  963. min-width="100"
  964. align="center"
  965. ></el-table-column>
  966. <el-table-column
  967. prop="weighTime"
  968. label="称重时间"
  969. min-width="120"
  970. align="center"
  971. >
  972. <template v-slot="scope">
  973. {{ subTimeStr(scope.row.weighTime, 16) }}
  974. </template>
  975. </el-table-column>
  976. <el-table-column
  977. prop="carNum"
  978. label="车号"
  979. min-width="100"
  980. align="center"
  981. ></el-table-column>
  982. <el-table-column
  983. prop="cargoName"
  984. label="货物名称"
  985. min-width="120"
  986. align="center"
  987. ></el-table-column>
  988. <el-table-column
  989. prop="shippingUnit"
  990. label="发货单位"
  991. min-width="100"
  992. align="center"
  993. ></el-table-column>
  994. <el-table-column
  995. prop="receivingUnit"
  996. label="收货单位"
  997. min-width="120"
  998. align="center"
  999. ></el-table-column>
  1000. <el-table-column
  1001. prop="grossWeight"
  1002. label="毛重"
  1003. min-width="100"
  1004. align="center"
  1005. ></el-table-column>
  1006. <el-table-column
  1007. prop="tare"
  1008. label="皮重"
  1009. min-width="120"
  1010. align="center"
  1011. ></el-table-column>
  1012. <el-table-column
  1013. prop="netWeight"
  1014. label="净重"
  1015. min-width="100"
  1016. align="center"
  1017. ></el-table-column>
  1018. <el-table-column
  1019. prop="shipName"
  1020. label="货船名称"
  1021. min-width="120"
  1022. align="center"
  1023. ></el-table-column>
  1024. <el-table-column
  1025. prop="weigher"
  1026. label="司磅员"
  1027. min-width="100"
  1028. align="center"
  1029. ></el-table-column>
  1030. <el-table-column label="单据" min-width="150" align="center">
  1031. <template v-slot="scope">
  1032. <el-button
  1033. @click="showTruckRecord(scope.row, scope.$index, '查看单据')"
  1034. type="primary"
  1035. size="small"
  1036. >
  1037. {{ scope.row.file ? "查看" : "上传" }}
  1038. </el-button>
  1039. </template>
  1040. </el-table-column>
  1041. <el-table-column label="操作" min-width="150" align="center">
  1042. <template v-slot="scope">
  1043. <el-button
  1044. v-auth="'CARLOADUPDATE'"
  1045. @click="showTruckRecord(scope.row, scope.$index, '修改单据')"
  1046. type="primary"
  1047. size="small"
  1048. >
  1049. 修改
  1050. </el-button>
  1051. <el-button
  1052. v-auth="'CARLOADDELETE'"
  1053. @click="deleteTruckRecord(scope.row.id, scope.$index)"
  1054. type="danger"
  1055. size="small"
  1056. >
  1057. 删除
  1058. </el-button>
  1059. </template>
  1060. </el-table-column>
  1061. </el-table>
  1062. <div style="text-align: right; margin-top: 43px">
  1063. <el-pagination
  1064. background
  1065. layout="prev, pager, next"
  1066. :total="truckTotal"
  1067. @current-change="truckPageChange"
  1068. ></el-pagination>
  1069. </div>
  1070. <div class="hr mt20"></div>
  1071. </div>
  1072. <div class="df aic jcfe mt20" v-if="voyage.voyageStatus == 1">
  1073. <el-button
  1074. v-auth="'CANCELVOYAGE'"
  1075. type="primary"
  1076. class="mr20"
  1077. @click="cancelVoyage"
  1078. >
  1079. 取消航次
  1080. </el-button>
  1081. <el-button
  1082. v-if="voyage.canComplete && disabledStatus"
  1083. type="primary"
  1084. v-auth="'FINISHVOYAGE'"
  1085. @click="finishVoyage"
  1086. >
  1087. 完成航次
  1088. </el-button>
  1089. </div>
  1090. <el-dialog
  1091. v-model="isAddTruckRecordVisable"
  1092. :title="truckRecordModalType"
  1093. width="780px"
  1094. center
  1095. @close="cancelUploadTruckRecord"
  1096. destroy-on-close
  1097. >
  1098. <el-form
  1099. :model="truckRecordForm"
  1100. inline
  1101. style="margin-bottom: 20px"
  1102. label-width="100px"
  1103. >
  1104. <el-form-item label="港口名称">
  1105. <el-input
  1106. style="width: 240px"
  1107. v-model="truckRecordForm.portName"
  1108. placeholder="港口名称"
  1109. ></el-input>
  1110. </el-form-item>
  1111. <el-form-item label="称重时间">
  1112. <el-date-picker
  1113. class="info-line-text"
  1114. v-model="truckRecordForm.weighTime"
  1115. type="datetime"
  1116. format="YYYY/MM/DD HH:mm:ss"
  1117. value-format="YYYY/MM/DD HH:mm:ss"
  1118. placeholder="称重时间"
  1119. ></el-date-picker>
  1120. </el-form-item>
  1121. <el-form-item label="车号">
  1122. <el-input
  1123. style="width: 240px"
  1124. v-model="truckRecordForm.carNum"
  1125. placeholder="车号"
  1126. ></el-input>
  1127. </el-form-item>
  1128. <el-form-item label="货物名称">
  1129. <el-input
  1130. style="width: 240px"
  1131. v-model="truckRecordForm.cargoName"
  1132. placeholder="货物名称"
  1133. ></el-input>
  1134. </el-form-item>
  1135. <el-form-item label="发货单位">
  1136. <el-input
  1137. style="width: 240px"
  1138. v-model="truckRecordForm.shippingUnit"
  1139. placeholder="发货单位"
  1140. ></el-input>
  1141. </el-form-item>
  1142. <el-form-item label="毛重">
  1143. <el-input
  1144. style="width: 240px"
  1145. v-model="truckRecordForm.grossWeight"
  1146. placeholder="毛重"
  1147. ></el-input>
  1148. </el-form-item>
  1149. <el-form-item label="收货单位">
  1150. <el-input
  1151. style="width: 240px"
  1152. v-model="truckRecordForm.receivingUnit"
  1153. placeholder="收货单位"
  1154. ></el-input>
  1155. </el-form-item>
  1156. <el-form-item label="皮重">
  1157. <el-input
  1158. style="width: 240px"
  1159. v-model="truckRecordForm.tare"
  1160. placeholder="皮重"
  1161. ></el-input>
  1162. </el-form-item>
  1163. <el-form-item label="运输单位">
  1164. <el-input
  1165. style="width: 240px"
  1166. v-model="truckRecordForm.transUnit"
  1167. placeholder="运输单位"
  1168. ></el-input>
  1169. </el-form-item>
  1170. <el-form-item label="净重">
  1171. <el-input
  1172. style="width: 240px"
  1173. v-model="truckRecordForm.netWeight"
  1174. placeholder="净重"
  1175. ></el-input>
  1176. </el-form-item>
  1177. <el-form-item label="货船名称">
  1178. <el-input
  1179. style="width: 240px"
  1180. v-model="truckRecordForm.shipName"
  1181. placeholder="货船名称"
  1182. ></el-input>
  1183. </el-form-item>
  1184. <el-form-item label="司磅员">
  1185. <el-input
  1186. style="width: 240px"
  1187. v-model="truckRecordForm.weigher"
  1188. placeholder="司磅员"
  1189. ></el-input>
  1190. </el-form-item>
  1191. <el-form-item label="汽车装货单">
  1192. <Uploader
  1193. :actionUrl="store.state.wayBillUrl"
  1194. :uploaderId="'truckLoad'"
  1195. :params="truckLoadParams"
  1196. @onSendFileList="getTruckLoadBillList"
  1197. :fileList="truckRecordBillList"
  1198. uploadText="上传装货单"
  1199. :disabled="truckRecordModalType == '查看单据'"
  1200. :limit="1"
  1201. ></Uploader>
  1202. </el-form-item>
  1203. </el-form>
  1204. <template #footer>
  1205. <el-button
  1206. v-if="truckRecordModalType != '查看单据'"
  1207. @click="cancelUploadTruckRecord"
  1208. >
  1209. 取消
  1210. </el-button>
  1211. <el-button
  1212. v-if="truckRecordModalType != '查看单据'"
  1213. style="margin-left: 30px"
  1214. type="primary"
  1215. @click="addTruckLoadRecord"
  1216. >
  1217. 提交
  1218. </el-button>
  1219. </template>
  1220. </el-dialog>
  1221. </div>
  1222. <div class="container-title" v-auth="'BILLINFO'">单据信息</div>
  1223. <div class="line-container-p24" v-auth="'BILLINFO'">
  1224. <div class="line" v-auth="'POLICY'">
  1225. <div class="info-line">
  1226. <div class="info-line-title">保险单</div>
  1227. <el-upload
  1228. drag
  1229. multiple
  1230. :action="store.state.wayBillUrl"
  1231. list-type="picture-card"
  1232. :on-preview="handlePictureCardPreview"
  1233. :on-remove="handleRemovePolicy"
  1234. :data="policyParams"
  1235. :on-success="policyUploadSuccess"
  1236. :file-list="policyFileList"
  1237. :disabled="isAuthDisabled('POLICYADD')"
  1238. >
  1239. <div class="upload-plus-icon">+</div>
  1240. <div class="upload-text">拖拽或点击上传</div>
  1241. </el-upload>
  1242. </div>
  1243. </div>
  1244. <div v-if="voyage.hasInsurance == 1">
  1245. <div class="hr mb20"></div>
  1246. <div class="df aic jcsb">
  1247. <div style="color: #0094fe">出险记录</div>
  1248. <!-- <el-button
  1249. type="primary"
  1250. @click="
  1251. (isAccidentVisable = true) && (accidentTitle = '新增出险记录')
  1252. "
  1253. >
  1254. 新增出险记录
  1255. </el-button> -->
  1256. </div>
  1257. <el-table :data="accidentList" style="width: 800px">
  1258. <el-table-column
  1259. type="index"
  1260. label="序号"
  1261. min-width="120"
  1262. align="center"
  1263. ></el-table-column>
  1264. <el-table-column
  1265. prop="remark"
  1266. label="备注"
  1267. min-width="120"
  1268. align="center"
  1269. ></el-table-column>
  1270. <el-table-column
  1271. prop="accidentTime"
  1272. label="出险时间"
  1273. min-width="100"
  1274. align="center"
  1275. ></el-table-column>
  1276. <el-table-column
  1277. prop="accidentTime"
  1278. label="操作"
  1279. min-width="100"
  1280. align="center"
  1281. >
  1282. <template v-slot="scope">
  1283. <el-button
  1284. type="primary"
  1285. size="small"
  1286. @click="checkAccident(scope.row, true)"
  1287. >
  1288. 查看
  1289. </el-button>
  1290. <el-button
  1291. type="info"
  1292. size="small"
  1293. @click="checkAccident(scope.row)"
  1294. >
  1295. 修改
  1296. </el-button>
  1297. <el-button
  1298. type="danger"
  1299. size="small"
  1300. @click="deleteAccident(scope.row.id)"
  1301. >
  1302. 删除
  1303. </el-button>
  1304. </template>
  1305. </el-table-column>
  1306. </el-table>
  1307. <div class="df jcfe">
  1308. <el-pagination
  1309. class="mt20"
  1310. background
  1311. layout="prev, pager, next"
  1312. :total="accidentTotal"
  1313. :current-page="accidentCurrentPage"
  1314. @current-change="accidentPageChange"
  1315. ></el-pagination>
  1316. </div>
  1317. <el-dialog
  1318. :title="accidentTitle"
  1319. v-model="isAccidentVisable"
  1320. @close="resetAccidentForm"
  1321. destroy-on-close
  1322. >
  1323. <el-form :model="accidentForm" label-width="100px">
  1324. <el-form-item label="出险时间">
  1325. <el-date-picker
  1326. class="info-line-text"
  1327. v-model="accidentForm.accidentTime"
  1328. type="datetime"
  1329. format="YYYY/MM/DD HH:mm:ss"
  1330. value-format="YYYY/MM/DD HH:mm:ss"
  1331. placeholder="出险时间"
  1332. :disabled="isAccidentCheck"
  1333. ></el-date-picker>
  1334. </el-form-item>
  1335. <el-form-item label="备注">
  1336. <el-input
  1337. class="info-line-text"
  1338. v-model="accidentForm.remark"
  1339. placeholder="备注"
  1340. :disabled="isAccidentCheck"
  1341. ></el-input>
  1342. </el-form-item>
  1343. <el-form-item label="出险材料">
  1344. <div class="df">
  1345. <div
  1346. v-for="item in accidentForm.files"
  1347. v-bind:key="item.id"
  1348. style="position: relative"
  1349. >
  1350. <img
  1351. v-if="item.mediaType == 1"
  1352. style="
  1353. height: 148px;
  1354. width: 148px;
  1355. object-fit: contain;
  1356. margin-right: 10px;
  1357. "
  1358. @click="openMediaModal(item.viewUrl, 1, '图片查看')"
  1359. :src="item.viewUrl"
  1360. alt=""
  1361. />
  1362. <div v-else>
  1363. <div style="height: 148px; width: 148px; margin-right: 10px">
  1364. <video
  1365. style="height: 100%; width: 100%"
  1366. @click="openMediaModal(item.viewUrl, 2, '视频查看')"
  1367. :src="item.viewUrl"
  1368. ></video>
  1369. </div>
  1370. </div>
  1371. <img
  1372. v-if="item.mediaType == 2"
  1373. @click="openMediaModal(item.viewUrl, 2, '视频查看')"
  1374. src="../../assets/icon-player.png"
  1375. style="
  1376. object-fit: contain;
  1377. width: 40px;
  1378. height: 40px;
  1379. position: absolute;
  1380. z-index: 100;
  1381. left: 50px;
  1382. top: 50px;
  1383. background: #fff;
  1384. border-radius: 50%;
  1385. "
  1386. alt=""
  1387. />
  1388. </div>
  1389. <el-upload
  1390. drag
  1391. multiple
  1392. :action="store.state.accidentUrl"
  1393. list-type="picture-card"
  1394. :data="accidentParams"
  1395. :on-success="accidentUploadSuccess"
  1396. :show-file-list="false"
  1397. :file-list="accidentList"
  1398. :before-upload="accidentBeforeUpload"
  1399. v-if="!isAccidentCheck"
  1400. >
  1401. <div class="upload-plus-icon">+</div>
  1402. <div class="upload-text">拖拽或点击上传</div>
  1403. </el-upload>
  1404. </div>
  1405. </el-form-item>
  1406. </el-form>
  1407. <div class="df aic jcfe mb30" v-if="!isAccidentCheck">
  1408. <el-button
  1409. type="primary"
  1410. v-if="accidentForm.id"
  1411. @click="addUpdateAccident"
  1412. >
  1413. 修改
  1414. </el-button>
  1415. <el-button type="primary" v-else @click="addUpdateAccident">
  1416. 新增
  1417. </el-button>
  1418. </div>
  1419. </el-dialog>
  1420. <div class="hr mt20 mb20"></div>
  1421. </div>
  1422. <div class="line" v-auth="'WAYBILL'">
  1423. <div class="info-line">
  1424. <div class="info-line-title">运单</div>
  1425. <el-upload
  1426. drag
  1427. multiple
  1428. :action="store.state.wayBillUrl"
  1429. list-type="picture-card"
  1430. :on-preview="handlePictureCardPreview"
  1431. :on-remove="handleRemoveBill"
  1432. :data="billParams"
  1433. :on-success="billUploadSuccess"
  1434. :file-list="voyageBill"
  1435. :disabled="isAuthDisabled('WAYBILLADD')"
  1436. >
  1437. <div class="upload-plus-icon">+</div>
  1438. <div class="upload-text">拖拽或点击上传</div>
  1439. </el-upload>
  1440. </div>
  1441. </div>
  1442. </div>
  1443. <!-- <div class="container-title">运单列表</div>
  1444. <div class="line-container-p24">
  1445. <div class="line">
  1446. <div class="info-line">
  1447. <div class="info-line-title">上传航次运单</div>
  1448. <el-upload
  1449. drag
  1450. multiple
  1451. :action="store.state.wayBillUrl"
  1452. list-type="picture-card"
  1453. :on-preview="handlePictureCardPreview"
  1454. :on-remove="handleRemoveBill"
  1455. :data="billParams"
  1456. :on-success="billUploadSuccess"
  1457. :file-list="voyageBill"
  1458. >
  1459. <div class="upload-plus-icon">+</div>
  1460. <div class="upload-text">拖拽或点击上传</div>
  1461. </el-upload>
  1462. </div>
  1463. </div>
  1464. </div> -->
  1465. <!-- <div class="container-title">磅单列表</div>
  1466. <div class="line-container-p24">
  1467. <div class="line" style="margin-bottom: 60px">
  1468. <div class="info-line">
  1469. <div class="info-line-title">上传磅单</div>
  1470. <el-upload
  1471. drag
  1472. multiple
  1473. :action="store.state.wayBillUrl"
  1474. list-type="picture-card"
  1475. :on-preview="handlePictureCardPreview"
  1476. :on-remove="handleRemovePoundBill"
  1477. :data="poundParams"
  1478. :on-success="poundBillUploadSuccess"
  1479. :file-list="poundBill"
  1480. >
  1481. <div class="upload-plus-icon">+</div>
  1482. <div class="upload-text">拖拽或点击上传</div>
  1483. </el-upload>
  1484. </div>
  1485. </div>
  1486. </div> -->
  1487. <!-- <div class="container-title">船舶证书</div>
  1488. <div class="line-container-p24">
  1489. <Certs ref="certs"></Certs>
  1490. </div> -->
  1491. <div class="container-title df aic jcsb" v-auth="'BILLDISTRIBUTE'">
  1492. <div @click="getVoyageDetail()">单据图片分配</div>
  1493. <div>
  1494. <el-checkbox
  1495. v-model="isCheckAll"
  1496. @change="checkAll"
  1497. :indeterminate="isIndeterminate"
  1498. size="large"
  1499. style="margin-right: 20px"
  1500. >
  1501. 全选
  1502. </el-checkbox>
  1503. <el-button
  1504. style="width: 220px; margin-right: 20px"
  1505. type="primary"
  1506. v-auth="'DOBILLDISTRIBUTE'"
  1507. @click="showDistributeModal"
  1508. >
  1509. 分配单据
  1510. </el-button>
  1511. </div>
  1512. </div>
  1513. <div class="line-container-p24" v-auth="'BILLDISTRIBUTE'">
  1514. <div v-show="shipownerUploadFiles?.length" class="df aic fww">
  1515. <div
  1516. style="
  1517. width: 100px;
  1518. text-align: center;
  1519. margin-right: 20px;
  1520. margin-bottom: 20px;
  1521. "
  1522. v-for="item in shipownerUploadFiles"
  1523. :key="item"
  1524. >
  1525. <el-image
  1526. style="height: 100px; width: 100px"
  1527. fit="contain"
  1528. :src="item.viewUrl"
  1529. :preview-src-list="previewList"
  1530. ></el-image>
  1531. <div style="width: 100px; text-align: center; font-size: 12px">
  1532. {{ item.createTime }}
  1533. </div>
  1534. <div class="tac">
  1535. <el-checkbox
  1536. @change="checkItem"
  1537. v-model="item.checked"
  1538. size="large"
  1539. ></el-checkbox>
  1540. </div>
  1541. </div>
  1542. </div>
  1543. <div
  1544. v-show="!shipownerUploadFiles?.length"
  1545. style="text-align: center; font-size: 24px; color: #ccc"
  1546. >
  1547. 暂无单据图片
  1548. </div>
  1549. </div>
  1550. <el-dialog
  1551. title="单据分配"
  1552. v-model="isDistributeModalVisable"
  1553. @closed="distributeModalClose"
  1554. destroy-on-close
  1555. width="80%"
  1556. >
  1557. <h4 class="mb10">请选择卸货港:</h4>
  1558. <div class="df aic distribute-group">
  1559. <el-button
  1560. v-for="item in voyage.voyageDetails"
  1561. :key="item"
  1562. class="mr20"
  1563. :type="distributePortId == item.portId ? 'primary' : ''"
  1564. @click="distributePortId = item.portId"
  1565. >
  1566. {{ item.portName }}
  1567. </el-button>
  1568. </div>
  1569. <div class="hr m10-0"></div>
  1570. <h4 class="mb10">请选择单据类型:</h4>
  1571. <div class="df aic distribute-group">
  1572. <el-button
  1573. class="mr20"
  1574. :type="distributeType == 1 ? 'primary' : ''"
  1575. @click="distributeType = 1"
  1576. >
  1577. 运单
  1578. </el-button>
  1579. <el-button
  1580. class="mr20"
  1581. :type="distributeType == 2 ? 'primary' : ''"
  1582. @click="distributeType = 2"
  1583. >
  1584. 磅单
  1585. </el-button>
  1586. <el-button
  1587. :type="distributeType == 4 ? 'primary' : ''"
  1588. @click="distributeType = 4"
  1589. >
  1590. 汽运装货单
  1591. </el-button>
  1592. <!-- <el-radio v-model="distributeType" label="1" size="large">运单</el-radio>
  1593. <el-radio v-model="distributeType" label="2" size="large">磅单</el-radio>
  1594. <el-radio v-model="distributeType" label="4" size="large"
  1595. >汽运装货单</el-radio
  1596. > -->
  1597. </div>
  1598. <div class="hr m10-0"></div>
  1599. <div class="df aic fww" style="max-height: 300px; overflow: scroll">
  1600. <div
  1601. style="
  1602. width: 100px;
  1603. text-align: center;
  1604. margin-right: 20px;
  1605. margin-bottom: 10px;
  1606. border: 2px solid #7598b1;
  1607. "
  1608. v-for="item in checkedImages"
  1609. :key="item"
  1610. >
  1611. <el-image
  1612. style="height: 100px; width: 100px"
  1613. fit="contain"
  1614. :src="item.viewUrl"
  1615. :preview-src-list="checkedPreviewList"
  1616. ></el-image>
  1617. </div>
  1618. </div>
  1619. <div class="hr m10-0"></div>
  1620. <div v-show="distributeType == 2">
  1621. <el-form inline :model="distributePoundForm">
  1622. <el-form-item label="卸货时间">
  1623. <el-date-picker
  1624. class="info-line-text"
  1625. v-model="distributePoundForm.dischargeTime"
  1626. type="datetime"
  1627. format="YYYY/MM/DD HH:mm:ss"
  1628. value-format="YYYY/MM/DD HH:mm:ss"
  1629. placeholder="卸货时间"
  1630. ></el-date-picker>
  1631. </el-form-item>
  1632. <el-form-item label="卸货吨位">
  1633. <el-input
  1634. class="info-line-text"
  1635. v-model="distributePoundForm.dischargeTons"
  1636. placeholder="卸货吨位"
  1637. ></el-input>
  1638. </el-form-item>
  1639. <el-form-item label="卸货件数">
  1640. <el-input
  1641. class="info-line-text"
  1642. v-model="distributePoundForm.dischargePieces"
  1643. placeholder="卸货件数"
  1644. ></el-input>
  1645. </el-form-item>
  1646. </el-form>
  1647. </div>
  1648. <div v-show="distributeType == 4">
  1649. <div class="tar">
  1650. <el-button @click="ocr" :loading="ocrLoading" type="primary">
  1651. {{ ocrLoading ? "正在识别" : "开始识别" }}
  1652. </el-button>
  1653. </div>
  1654. <el-table :data="ocrTruckRecordTableData" stripe max-height="500">
  1655. <el-table-column label="港口名称" min-width="200" align="center">
  1656. <template v-slot="scope">
  1657. <el-input size="small" v-model="scope.row.portName"></el-input>
  1658. </template>
  1659. </el-table-column>
  1660. <!-- <el-table-column label="称重时间" min-width="200" align="center">
  1661. <template v-slot="scope">
  1662. <el-date-picker
  1663. size="small"
  1664. class="info-line-text"
  1665. v-model="scope.row.weighTime"
  1666. type="datetime"
  1667. format="YYYY/MM/DD HH:mm:ss"
  1668. value-format="YYYY/MM/DD HH:mm:ss"
  1669. placeholder="称重时间"
  1670. ></el-date-picker>
  1671. </template>
  1672. </el-table-column> -->
  1673. <el-table-column label="称重时间" min-width="120" align="center">
  1674. <template v-slot="scope">
  1675. <el-input
  1676. :input-style="
  1677. scope.row.weighTime ? {} : { border: '1px solid red' }
  1678. "
  1679. size="small"
  1680. v-model="scope.row.weighTime"
  1681. ></el-input>
  1682. </template>
  1683. </el-table-column>
  1684. <el-table-column label="车号" min-width="120" align="center">
  1685. <template v-slot="scope">
  1686. <el-input
  1687. :input-style="
  1688. scope.row.carNum?.length == 7 ? {} : { border: '1px solid red' }
  1689. "
  1690. size="small"
  1691. v-model="scope.row.carNum"
  1692. ></el-input>
  1693. </template>
  1694. </el-table-column>
  1695. <el-table-column label="货物名称" min-width="120" align="center">
  1696. <template v-slot="scope">
  1697. <el-input size="small" v-model="scope.row.cargoName"></el-input>
  1698. </template>
  1699. </el-table-column>
  1700. <el-table-column label="发货单位" min-width="200" align="center">
  1701. <template v-slot="scope">
  1702. <el-input size="small" v-model="scope.row.shippingUnit"></el-input>
  1703. </template>
  1704. </el-table-column>
  1705. <el-table-column label="收货单位" min-width="200" align="center">
  1706. <template v-slot="scope">
  1707. <el-input
  1708. :input-style="
  1709. scope.row.receivingUnit ? {} : { border: '1px solid red' }
  1710. "
  1711. size="small"
  1712. v-model="scope.row.receivingUnit"
  1713. ></el-input>
  1714. </template>
  1715. </el-table-column>
  1716. <el-table-column label="毛重" min-width="120" align="center">
  1717. <template v-slot="scope">
  1718. <el-input
  1719. :input-style="
  1720. scope.row.grossWeight ? {} : { border: '1px solid red' }
  1721. "
  1722. size="small"
  1723. v-model="scope.row.grossWeight"
  1724. ></el-input>
  1725. </template>
  1726. </el-table-column>
  1727. <el-table-column label="皮重" min-width="120" align="center">
  1728. <template v-slot="scope">
  1729. <el-input
  1730. :input-style="scope.row.tare ? {} : { border: '1px solid red' }"
  1731. size="small"
  1732. v-model="scope.row.tare"
  1733. ></el-input>
  1734. </template>
  1735. </el-table-column>
  1736. <el-table-column label="净重" min-width="120" align="center">
  1737. <template v-slot="scope">
  1738. <el-input
  1739. :input-style="
  1740. scope.row.netWeight ? {} : { border: '1px solid red' }
  1741. "
  1742. size="small"
  1743. v-model="scope.row.netWeight"
  1744. ></el-input>
  1745. </template>
  1746. </el-table-column>
  1747. <el-table-column label="货船名称" min-width="120" align="center">
  1748. <template v-slot="scope">
  1749. <el-input size="small" v-model="scope.row.shipName"></el-input>
  1750. </template>
  1751. </el-table-column>
  1752. <el-table-column label="司磅员" min-width="120" align="center">
  1753. <template v-slot="scope">
  1754. <el-input size="small" v-model="scope.row.weigher"></el-input>
  1755. </template>
  1756. </el-table-column>
  1757. <el-table-column label="查看" min-width="120" align="center">
  1758. <template v-slot="scope">
  1759. <el-image
  1760. style="height: 40px; width: 60px"
  1761. fit="contain"
  1762. :src="scope.row.viewUrl"
  1763. :preview-src-list="ocrImageList"
  1764. ></el-image>
  1765. </template>
  1766. </el-table-column>
  1767. <!-- <el-table-column label="操作" min-width="120" align="center">
  1768. <template v-slot="scope">
  1769. <el-button
  1770. size="small"
  1771. @click="deleteOcrRecord(scope.$index)"
  1772. type="danger"
  1773. >删除</el-button
  1774. >
  1775. </template>
  1776. </el-table-column> -->
  1777. </el-table>
  1778. </div>
  1779. <div class="hr m10-0"></div>
  1780. <div class="tar">
  1781. <el-button @click="submitDistribute" type="primary">确定</el-button>
  1782. </div>
  1783. </el-dialog>
  1784. <div class="container-title" v-auth="'VOYAGEIMAGE'">航次图片</div>
  1785. <div class="line-container-p24" v-auth="'VOYAGEIMAGE'">
  1786. <div v-if="medias.length" class="medias-content df ffw">
  1787. <div class="pic-container">
  1788. <div v-for="(item, index) in medias" :key="item" class="pic-main">
  1789. <div
  1790. :class="[
  1791. 'box',
  1792. index % 2 == 0 ? '' : 'bottom-box',
  1793. item.status == 1 ? 'now-box' : '',
  1794. ]"
  1795. >
  1796. <div class="card-note">
  1797. {{ item.shipName }} 拍摄于
  1798. <br />
  1799. {{ item.createTime }}
  1800. <br />
  1801. 天气 : {{ item.weather?.weather }} - 气温 :
  1802. {{ item.weather?.temperature }}℃
  1803. </div>
  1804. <div class="medias-box mb10" style="position: relative">
  1805. <el-image
  1806. v-if="item.mediaType == 1"
  1807. style="width: 100%; height: 100%"
  1808. fit="contain"
  1809. :src="item.downloadUrl"
  1810. @click="openMediaModal(item.downloadUrl, 1, '图片审核')"
  1811. ></el-image>
  1812. <video
  1813. style="width: 100%; height: 100%"
  1814. v-else
  1815. :src="item.downloadUrl"
  1816. ></video>
  1817. <img
  1818. @click="openMediaModal(item.downloadUrl, 2, '视频审核')"
  1819. v-if="item.mediaType == 2"
  1820. src="../../assets/icon-player.png"
  1821. style="
  1822. object-fit: contain;
  1823. width: 40px;
  1824. height: 40px;
  1825. position: absolute;
  1826. top: calc(50% - 20px);
  1827. left: calc(50% - 20px);
  1828. background: #fff;
  1829. border-radius: 50%;
  1830. "
  1831. alt=""
  1832. />
  1833. </div>
  1834. <div
  1835. class="checkbox-group df aic jcsa mb10"
  1836. v-auth="'VOYAGEIMAGEAUDIT'"
  1837. >
  1838. <el-checkbox
  1839. @change="auditMedia(item.id, 1, index, item.mediaType)"
  1840. :model-value="item.audit == 1"
  1841. label="通过"
  1842. ></el-checkbox>
  1843. <el-checkbox
  1844. @change="auditMedia(item.id, 2, index, item.mediaType)"
  1845. :model-value="item.audit == 2"
  1846. label="未通过"
  1847. ></el-checkbox>
  1848. </div>
  1849. <div class="checkbox-group df aic jcsa" v-auth="'VOYAGEIMAGEAUDIT'">
  1850. <el-checkbox
  1851. @change="markMedia(item.id, 1, index, item.mediaType)"
  1852. :model-value="item.type == 1"
  1853. label="验仓"
  1854. ></el-checkbox>
  1855. <el-checkbox
  1856. @change="markMedia(item.id, 2, index, item.mediaType)"
  1857. :model-value="item.type == 2"
  1858. label="清仓"
  1859. ></el-checkbox>
  1860. </div>
  1861. </div>
  1862. <div
  1863. :class="[
  1864. 's-line',
  1865. index % 2 == 0 ? '' : 'top210px',
  1866. item.status == 1 ? 'now-s-line' : '',
  1867. ]"
  1868. ></div>
  1869. <div :class="['point', item.status == 1 ? '' : 'now-point']"></div>
  1870. <div
  1871. :class="['l-line', item.status == 1 ? 'now-l-line' : '']"
  1872. v-if="index + 1 != medias.length"
  1873. ></div>
  1874. </div>
  1875. <el-dialog v-model="mediaModal" :title="modalTitle" destroy-on-close>
  1876. <el-image
  1877. v-if="modalType == 1"
  1878. style="height: 60vh; display: flex"
  1879. fit="contain"
  1880. :src="currentUrl"
  1881. :preview-src-list="modalPreview"
  1882. ></el-image>
  1883. <video
  1884. v-else
  1885. autoplay
  1886. controls
  1887. style="width: 100%; height: 60vh"
  1888. :src="currentUrl"
  1889. ></video>
  1890. </el-dialog>
  1891. </div>
  1892. </div>
  1893. </div>
  1894. </template>
  1895. <script setup>
  1896. import { onMounted, reactive, ref, toRefs } from "vue";
  1897. import api from "../../apis/fetch";
  1898. import { useRoute } from "vue-router";
  1899. import _ from "lodash";
  1900. import router from "../../router";
  1901. import store from "../../store";
  1902. import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
  1903. import downloadBlobFile from "../../utils/downloadBlobFile";
  1904. import url from "../../apis/config";
  1905. import { subTimeStr } from "utils/utils";
  1906. import * as dayjs from "dayjs";
  1907. import isAuthDisabled from "../../auth/isAuthDisabled";
  1908. const route = useRoute();
  1909. let map = ref({});
  1910. let voyage = ref({});
  1911. let medias = ref([]);
  1912. let coordinates = ref([]);
  1913. let previewSrcList = ref([]);
  1914. let shipAudits = ref([]);
  1915. let shipownerUploadFiles = ref([]);
  1916. async function getVoyageDetail(isInit) {
  1917. previewList.value = [];
  1918. policyFileList.value = [];
  1919. voyageBill.value = [];
  1920. previewSrcList.value = [];
  1921. shipownerUploadFiles.value = [];
  1922. let res = await api.getVoyageDetail({
  1923. type: localStorage.userType,
  1924. voyageId: route.query.id,
  1925. });
  1926. if (res.data.status == 0) {
  1927. ElNotification({
  1928. type: "success",
  1929. title: res.data.msg,
  1930. });
  1931. blockchainInfo.value = res.data.result.blockChain;
  1932. coordinates.value = res.data.result.coordinates;
  1933. voyage.value = res.data.result.voyage;
  1934. voyage.value.startTime = voyage.value.startTime.substring(0, 16);
  1935. currentPortId.value = voyage.value.voyageDetails[0].portId + "";
  1936. currentDiscPortId.value = voyage.value.voyageDetails[0].portId + "";
  1937. medias.value = res.data.result.medias;
  1938. shipAudits.value = res.data.result.shipAudits;
  1939. shipownerUploadFiles.value = res.data.result?.shipownerUploadFiles;
  1940. for (let i of shipownerUploadFiles.value || []) {
  1941. previewList.value.push(i.viewUrl);
  1942. }
  1943. for (let i of res.data.result.policys || []) {
  1944. policyFileList.value.push({
  1945. ...i,
  1946. url: i.viewUrl,
  1947. });
  1948. }
  1949. for (let i of res.data.result.waybills) {
  1950. voyageBill.value.push({
  1951. ...i,
  1952. url: i.viewUrl,
  1953. });
  1954. }
  1955. for (let i of medias.value) {
  1956. previewSrcList.value.push(i.downloadUrl);
  1957. }
  1958. if (isInit) {
  1959. getDischargeList();
  1960. getTruckLoadRecord();
  1961. getLabList();
  1962. getPortWeatherList();
  1963. getAccidentList();
  1964. try {
  1965. initMap();
  1966. } catch (error) {}
  1967. }
  1968. } else {
  1969. console.log(res);
  1970. ElNotification({
  1971. type: "error",
  1972. title: res.data.msg,
  1973. });
  1974. }
  1975. }
  1976. let total = ref(0);
  1977. function pageChange(e) {
  1978. dischargeCurrentPage.value = e;
  1979. getDischargeList();
  1980. }
  1981. async function addDischarge() {
  1982. if (!formInline.value.dischargeTime || !formInline.value.dischargeTons)
  1983. return;
  1984. let arr = [];
  1985. if (poundBillList.value.length) {
  1986. for (let i of poundBillList.value) {
  1987. arr.push(i.response.result.id);
  1988. }
  1989. }
  1990. let res = await api.addDischarge({
  1991. ...formInline.value,
  1992. voyageFileIds: arr.join(","),
  1993. voyageId: route.query.id,
  1994. portId: currentDiscPortId.value,
  1995. });
  1996. if (res.data.status == 0) {
  1997. getDischargeList(1);
  1998. poundBillList.value = [];
  1999. formInline.value = {
  2000. dischargeTons: 0,
  2001. dischargePieces: 0,
  2002. };
  2003. } else {
  2004. console.log(res);
  2005. }
  2006. isAddPoundVisable.value = false;
  2007. }
  2008. async function deleteDischarge(id, index) {
  2009. let res = await api.deleteDischarge({
  2010. id,
  2011. });
  2012. if (res.data.status == 0) {
  2013. dischargeList.value.splice(index, 1);
  2014. ElNotification({
  2015. type: "success",
  2016. title: res.data.msg,
  2017. });
  2018. } else {
  2019. console.log(res);
  2020. ElNotification({
  2021. type: "error",
  2022. title: res.data.msg,
  2023. });
  2024. }
  2025. }
  2026. async function exportExcel() {}
  2027. let dischargeCurrentPage = ref(1);
  2028. let dischargeList = ref([]);
  2029. let formInline = ref({
  2030. dischargeTons: 0,
  2031. dischargePieces: 0,
  2032. });
  2033. async function getDischargeList() {
  2034. let res = await api.getDischargeList({
  2035. voyageId: route.query.id,
  2036. portId: currentDiscPortId.value,
  2037. currentPage: dischargeCurrentPage.value,
  2038. size: 10,
  2039. });
  2040. if (res.data.status == 0) {
  2041. dischargeList.value = res.data.result;
  2042. total.value = res.data.total;
  2043. } else {
  2044. console.log(res);
  2045. }
  2046. }
  2047. let updateForm = ref({});
  2048. let updateDischargeDialog = ref(false);
  2049. async function updateDischarge() {
  2050. let postData = {
  2051. ...updateForm.value,
  2052. };
  2053. let arr = [];
  2054. if (updatePoundBillList.value.length) {
  2055. for (let i of updatePoundBillList.value) {
  2056. arr.push(i.id || i.response.result.id);
  2057. }
  2058. postData.voyageFileIds = arr.join(",");
  2059. } else {
  2060. postData.voyageFileIds = "";
  2061. }
  2062. let res = await api.updateDischarge({
  2063. ...postData,
  2064. });
  2065. if (res.data.status == 0) {
  2066. getDischargeList();
  2067. cancelUpdateDischarge();
  2068. ElNotification({
  2069. type: "success",
  2070. title: res.data.msg,
  2071. });
  2072. } else {
  2073. console.log(res);
  2074. ElNotification({
  2075. type: "error",
  2076. title: res.data.msg,
  2077. });
  2078. }
  2079. }
  2080. let dischargeDialogTitle = ref("");
  2081. function showUpdateDischarge(item, index, text) {
  2082. dischargeDialogTitle.value = text;
  2083. updateDischargeDialog.value = true;
  2084. updatePoundBillList.value = [];
  2085. let { id, dischargeTons, dischargeTime, voyageId, files } = item;
  2086. if (files && files.length) {
  2087. for (let i of files)
  2088. updatePoundBillList.value.push({ id: i.id, url: i.viewUrl });
  2089. }
  2090. updateForm.value = {
  2091. id,
  2092. dischargeTons,
  2093. dischargeTime,
  2094. };
  2095. }
  2096. function cancelUpdateDischarge() {
  2097. updateDischargeDialog.value = false;
  2098. updateForm.value = {};
  2099. updatePoundBillList.value = [];
  2100. }
  2101. let mapId = ref(`map${route.query.id}`);
  2102. function initMap() {
  2103. let c;
  2104. let longitude = 121.524761;
  2105. let latitude = 31.228721;
  2106. if (medias.value.length) {
  2107. c = Math.floor(medias.value.length / 2);
  2108. longitude = medias.value[c].longitude;
  2109. latitude = medias.value[c].latitude;
  2110. }
  2111. map.value = new AMap.Map(mapId.value, {
  2112. zoom: 16, //级别
  2113. center: [longitude, latitude], //中心点坐标
  2114. mapStyle: "amap://styles/f48d96805f5fa7f5aada657c5ee37017",
  2115. zoomEnable: false,
  2116. dragEnable: false,
  2117. });
  2118. let toolBar = new AMap.ToolBar({
  2119. position: {
  2120. top: "40px",
  2121. right: "40px",
  2122. },
  2123. });
  2124. let hawkEye = new AMap.HawkEye({
  2125. opened: false,
  2126. });
  2127. map.value.addControl(toolBar);
  2128. map.value.addControl(hawkEye);
  2129. let markers = [];
  2130. for (let i of medias.value) {
  2131. let content = `<div style='width:160px'>
  2132. ${
  2133. i.audit == 1
  2134. ? `<img id='img${i.id}' style='width:160px;height:160px;object-fit:contain;' src='${i.viewUrl}'/>`
  2135. : ``
  2136. }
  2137. <img src='https://hhd-pat-1255802371.cos.ap-shanghai.myqcloud.com/frontend/ship-red-icon.png' style='display:block;width:20px;height:20px;margin:6px auto'/
  2138. </div>`;
  2139. let marker = new AMap.Marker({
  2140. content,
  2141. zIndex: 10,
  2142. position: new AMap.LngLat(i.longitude, i.latitude),
  2143. offset: new AMap.Pixel(-75, i.audit == 1 ? -195 : -30),
  2144. });
  2145. if (i.audit == 1) {
  2146. marker.on("click", () => {
  2147. openMediaModal(i.viewUrl, 1, "航次图片", i);
  2148. });
  2149. }
  2150. markers.push(marker);
  2151. }
  2152. for (let i of coordinates.value) {
  2153. let content = `<div style='width:160px'>
  2154. <img src='https://frontend-1255802371.cos.ap-shanghai.myqcloud.com/green-circle.png' style='display:block;width:20px;height:20px;margin:6px auto'/
  2155. </div>`;
  2156. let marker = new AMap.Marker({
  2157. content,
  2158. zIndex: 5,
  2159. position: new AMap.LngLat(i.longitude, i.latitude),
  2160. offset: new AMap.Pixel(-75, i.audit == 1 ? -195 : -30),
  2161. });
  2162. if (i.audit == 1) {
  2163. marker.on("click", () => {
  2164. openMediaModal(i.viewUrl, 1, "航次图片", i);
  2165. });
  2166. }
  2167. markers.push(marker);
  2168. }
  2169. let overlayGroups = new AMap.OverlayGroup(markers);
  2170. map.value.on("complete", function () {
  2171. let t = setTimeout(() => {
  2172. map.value.add(overlayGroups);
  2173. map.value.setFitView(markers, true, [200, 50, 0, 0], 18);
  2174. clearTimeout(t);
  2175. }, 2000);
  2176. });
  2177. }
  2178. let disabledStatus = ref(true);
  2179. let updateCache = {};
  2180. function changeVoyageInfo() {
  2181. updateCache = _.cloneDeep(voyage.value);
  2182. disabledStatus.value = false;
  2183. }
  2184. function cancelVoyageChange() {
  2185. voyage.value = updateCache;
  2186. disabledStatus.value = true;
  2187. }
  2188. async function submitVoyageChange() {
  2189. let res = await api.updateVoyage({
  2190. ...voyage.value,
  2191. hasInsurance: Number(voyage.value.hasInsurance),
  2192. });
  2193. if (res.data.status == 0) {
  2194. ElNotification({
  2195. type: "success",
  2196. title: res.data.msg,
  2197. });
  2198. disabledStatus.value = true;
  2199. } else {
  2200. ElNotification({
  2201. type: "error",
  2202. title: res.data.msg,
  2203. });
  2204. console.log(res);
  2205. }
  2206. getVoyageDetail();
  2207. }
  2208. let options = ref([
  2209. { value: 0, label: "请选择" },
  2210. {
  2211. value: 1,
  2212. label: "航行",
  2213. },
  2214. {
  2215. value: 2,
  2216. label: "停泊",
  2217. },
  2218. {
  2219. value: 3,
  2220. label: "装货",
  2221. },
  2222. {
  2223. value: 4,
  2224. label: "运输中",
  2225. },
  2226. {
  2227. value: 5,
  2228. label: "卸货",
  2229. },
  2230. ]);
  2231. async function finishVoyage() {
  2232. if (!voyage.value.canComplete) return;
  2233. let res = await api.finishVoyage({
  2234. voyageId: route.query.id,
  2235. });
  2236. if (res.data.status == 0) {
  2237. ElNotification({
  2238. type: "success",
  2239. title: "航次已完成",
  2240. });
  2241. } else {
  2242. ElNotification({
  2243. type: "error",
  2244. title: res.data.msg,
  2245. });
  2246. console.log(res);
  2247. }
  2248. getVoyageDetail();
  2249. }
  2250. let currentUrl = ref("");
  2251. let mediaModal = ref(false);
  2252. let modalType = ref(1);
  2253. let modalTitle = ref("");
  2254. let modalPreview = ref([]);
  2255. function openMediaModal(url, type, title, item = {}) {
  2256. modalPreview.value = [url];
  2257. modalTitle.value = title;
  2258. modalType.value = type;
  2259. currentUrl.value = url;
  2260. mediaModal.value = true;
  2261. }
  2262. async function auditMedia(mediaId, a, index, mediaType) {
  2263. console.log(mediaId, a, index, mediaType);
  2264. let res = await api.auditMedia({
  2265. mediaId,
  2266. audit: a,
  2267. });
  2268. if (res.data.status == 0) {
  2269. medias.value[index].audit = a;
  2270. ElNotification({
  2271. type: "success",
  2272. title: res.data.msg,
  2273. });
  2274. } else {
  2275. console.log(res);
  2276. }
  2277. }
  2278. async function markMedia(mediaId, type, index, mediaType) {
  2279. console.log(mediaId, type, index, mediaType);
  2280. let res = await api.markMedia({
  2281. mediaId,
  2282. type,
  2283. });
  2284. if (res.data.status == 0) {
  2285. medias.value[index].type = type;
  2286. ElNotification({
  2287. type: "success",
  2288. title: res.data.msg,
  2289. });
  2290. } else {
  2291. console.log(res);
  2292. }
  2293. }
  2294. let dialogImageUrl = ref("");
  2295. let dialogVisible = ref(false);
  2296. function handlePictureCardPreview(file) {
  2297. dialogVisible.value = true;
  2298. dialogImageUrl.value = file.url;
  2299. }
  2300. async function handleRemovePolicy(file, list) {
  2301. let cache = _.cloneDeep(policyFileList.value);
  2302. console.log(cache);
  2303. ElMessageBox.confirm("确认删除保险单?", "Warning", {
  2304. confirmButtonText: "删除",
  2305. cancelButtonText: "取消",
  2306. type: "warning",
  2307. })
  2308. .then(async () => {
  2309. let { id } = file;
  2310. let res = await api.deleteWaybill({
  2311. id,
  2312. });
  2313. if (res.data.status == 0) {
  2314. ElMessage({
  2315. message: "删除成功!",
  2316. type: "success",
  2317. });
  2318. policyFileList.value = list;
  2319. }
  2320. })
  2321. .catch(() => {
  2322. policyFileList.value = cache;
  2323. ElMessage({
  2324. type: "info",
  2325. message: "取消删除",
  2326. });
  2327. });
  2328. }
  2329. let policyFileList = ref([]);
  2330. function policyUploadSuccess(response, file, list) {
  2331. list[list.length - 1] = {
  2332. ...response.result,
  2333. url: response.result.viewUrl,
  2334. };
  2335. console.log(list);
  2336. policyFileList.value = list;
  2337. }
  2338. let policyParams = ref({
  2339. voyageId: route.query.id,
  2340. type: 3,
  2341. });
  2342. async function handleRemovePoundBill(file, list) {
  2343. let cache = _.cloneDeep(poundBill.value);
  2344. console.log(cache);
  2345. ElMessageBox.confirm("确认删除磅单?", "Warning", {
  2346. confirmButtonText: "删除",
  2347. cancelButtonText: "取消",
  2348. type: "warning",
  2349. })
  2350. .then(async () => {
  2351. let { id } = file;
  2352. let res = await api.deleteWaybill({
  2353. id,
  2354. });
  2355. if (res.data.status == 0) {
  2356. ElMessage({
  2357. message: "删除成功!",
  2358. type: "success",
  2359. });
  2360. poundBill.value = list;
  2361. }
  2362. })
  2363. .catch(() => {
  2364. poundBill.value = cache;
  2365. ElMessage({
  2366. type: "info",
  2367. message: "取消删除",
  2368. });
  2369. });
  2370. }
  2371. async function handleRemoveBill(file, list) {
  2372. let cache = _.cloneDeep(voyageBill.value);
  2373. console.log(cache);
  2374. ElMessageBox.confirm("确认删除运单?", "Warning", {
  2375. confirmButtonText: "删除",
  2376. cancelButtonText: "取消",
  2377. type: "warning",
  2378. })
  2379. .then(async () => {
  2380. let { id } = file;
  2381. let res = await api.deleteWaybill({
  2382. id,
  2383. });
  2384. if (res.data.status == 0) {
  2385. ElMessage({
  2386. message: "删除成功!",
  2387. type: "success",
  2388. });
  2389. voyageBill.value = list;
  2390. }
  2391. })
  2392. .catch(() => {
  2393. voyageBill.value = cache;
  2394. ElMessage({
  2395. type: "info",
  2396. message: "取消删除",
  2397. });
  2398. });
  2399. }
  2400. let voyageBill = ref([]);
  2401. function billUploadSuccess(response, file, list) {
  2402. list[list.length - 1] = {
  2403. ...response.result,
  2404. url: response.result.viewUrl,
  2405. };
  2406. console.log(list);
  2407. voyageBill.value = list;
  2408. }
  2409. let billParams = ref({
  2410. voyageId: route.query.id,
  2411. type: 1,
  2412. });
  2413. function getPoundBillList(list) {
  2414. console.log(list);
  2415. poundBillList.value = list;
  2416. }
  2417. let poundBillList = ref([]);
  2418. let poundBill = ref([]);
  2419. function poundBillUploadSuccess(response, file, list) {
  2420. list[list.length - 1] = {
  2421. ...response.result,
  2422. url: response.result.viewUrl,
  2423. };
  2424. console.log(list);
  2425. poundBill.value = list;
  2426. }
  2427. function previewPoundBill(url) {
  2428. console.log(url);
  2429. }
  2430. let updatePoundParams = ref({
  2431. voyageId: route.query.id,
  2432. type: 2,
  2433. });
  2434. let updatePoundBillList = ref([]);
  2435. function getupdatePoundBillList(list) {
  2436. console.log(list);
  2437. updatePoundBillList.value = list;
  2438. }
  2439. let previewPoundList = ref([]);
  2440. let poundParams = ref({
  2441. voyageId: route.query.id,
  2442. type: 2,
  2443. });
  2444. async function calExpectedArrivalTime(voyageDetailId, index) {
  2445. let res = await api.calExpectedArrivalTime({
  2446. voyageDetailId,
  2447. setSailTime: voyage.value.voyageDetails[index].setSailTime,
  2448. });
  2449. if (res.data.status == 0) {
  2450. voyage.value.voyageDetails[index].expectedArrivalTime = res.data.result;
  2451. } else {
  2452. ElMessage({
  2453. type: "error",
  2454. message: res.data.msg,
  2455. });
  2456. }
  2457. }
  2458. let isLoadingExcel = ref(false);
  2459. async function downloadExcel() {
  2460. isLoadingExcel.value = true;
  2461. let res = await downloadBlobFile(
  2462. `${url.baseurl}/voyage/exportExcel`,
  2463. { voyageId: route.query.id },
  2464. `${voyage.value.voyageName}-船舶跟踪表`,
  2465. "post",
  2466. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
  2467. );
  2468. if (res) {
  2469. isLoadingExcel.value = false;
  2470. }
  2471. }
  2472. async function cancelVoyage() {
  2473. console.log("取消航次");
  2474. ElMessageBox.confirm("确认取消航次?", "确认操作", {
  2475. confirmButtonText: "确认",
  2476. cancelButtonText: "取消操作",
  2477. type: "warning",
  2478. })
  2479. .then(async (e) => {
  2480. console.log(e);
  2481. let res = await api.cancelVoyage({
  2482. id: route.query.id,
  2483. });
  2484. if (res.data.status == 0) {
  2485. ElMessage({
  2486. type: "success",
  2487. message: "航次取消成功!",
  2488. });
  2489. router.push("/voyageList");
  2490. } else {
  2491. console.log(res);
  2492. }
  2493. })
  2494. .catch((e) => {
  2495. console.log(e);
  2496. ElMessage({
  2497. type: "info",
  2498. message: "取消操作",
  2499. });
  2500. });
  2501. }
  2502. let certs = ref(null);
  2503. let isCertsVisable = ref(false);
  2504. function showCerts() {
  2505. setTimeout(() => {
  2506. certs.value.initCerts(shipAudits.value);
  2507. });
  2508. }
  2509. let isDischargeLoadingExcel = ref(false);
  2510. async function exportDischargeExcel() {
  2511. isDischargeLoadingExcel.value = true;
  2512. let res = await downloadBlobFile(
  2513. `${url.baseurl}/voyage/exportDischargeExcel`,
  2514. { voyageId: route.query.id },
  2515. `${voyage.value.voyageName}-卸货记录表`,
  2516. "post",
  2517. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
  2518. );
  2519. if (res) {
  2520. isDischargeLoadingExcel.value = false;
  2521. }
  2522. }
  2523. let isAddPoundVisable = ref(false);
  2524. let isAddTruckRecordVisable = ref(false);
  2525. let truckTableData = ref([]);
  2526. let truckRecordForm = ref({});
  2527. let truckRecordBillList = ref([]);
  2528. let truckCurrentPage = ref(1);
  2529. let truckTotal = ref(0);
  2530. let truckLoadParams = ref({
  2531. voyageId: route.query.id,
  2532. type: 4,
  2533. });
  2534. function getTruckLoadBillList(list) {
  2535. truckRecordBillList.value = list;
  2536. }
  2537. function cancelUploadTruckRecord() {
  2538. isAddTruckRecordVisable.value = false;
  2539. truckRecordForm.value = {};
  2540. truckRecordBillList.value = [];
  2541. currentRecordId.value = -1;
  2542. }
  2543. let currentRecordId = ref(-1);
  2544. async function addTruckLoadRecord() {
  2545. let postData = {};
  2546. if (truckRecordBillList.value.length) {
  2547. if (truckRecordBillList.value[0].viewUrl) {
  2548. let { fileKey, viewUrl, downloadUrl } = truckRecordBillList.value[0];
  2549. postData = {
  2550. fileKey,
  2551. viewUrl,
  2552. downloadUrl,
  2553. };
  2554. } else {
  2555. let { fileKey, viewUrl, downloadUrl } =
  2556. truckRecordBillList.value[0].response.result;
  2557. postData = {
  2558. fileKey,
  2559. viewUrl,
  2560. downloadUrl,
  2561. };
  2562. }
  2563. } else {
  2564. postData = {
  2565. fileKey: "",
  2566. viewUrl: "",
  2567. downloadUrl: "",
  2568. };
  2569. }
  2570. if (currentRecordId.value != -1) {
  2571. postData.recordId = currentRecordId.value;
  2572. delete truckRecordForm.value.file;
  2573. delete truckRecordForm.value.fileId;
  2574. }
  2575. let res = await api[
  2576. `${
  2577. truckRecordModalType.value == "新增记录"
  2578. ? "addTruckLoadRecord"
  2579. : "updateTruckLoadRecord"
  2580. }`
  2581. ]({
  2582. voyageId: route.query.id,
  2583. portId: currentDiscPortId.value,
  2584. ...postData,
  2585. ...truckRecordForm.value,
  2586. });
  2587. cancelUploadTruckRecord();
  2588. getTruckLoadRecord();
  2589. }
  2590. function showAddTruckRecord() {
  2591. isAddTruckRecordVisable.value = true;
  2592. truckRecordModalType.value = "新增记录";
  2593. }
  2594. async function getTruckLoadRecord() {
  2595. let res = await api.getTruckLoadRecord({
  2596. voyageId: route.query.id,
  2597. portId: currentDiscPortId.value,
  2598. currentPage: truckCurrentPage.value,
  2599. size: 10,
  2600. });
  2601. truckTableData.value = res.data.result;
  2602. truckTotal.value = res.data.total;
  2603. }
  2604. function truckPageChange(e) {
  2605. truckCurrentPage.value = e;
  2606. getTruckLoadRecord();
  2607. }
  2608. let truckRecordModalType = ref("");
  2609. function showTruckRecord(item, index, text) {
  2610. isAddTruckRecordVisable.value = true;
  2611. currentRecordId.value = item.id;
  2612. truckRecordModalType.value = text;
  2613. if (item.file) {
  2614. truckRecordBillList.value[0] = {
  2615. ...item.file,
  2616. url: item.file.viewUrl,
  2617. };
  2618. }
  2619. truckRecordForm.value = { ...item };
  2620. }
  2621. async function deleteTruckRecord(id, index) {
  2622. console.log(id);
  2623. ElMessageBox.confirm("确认删除装货记录?", "Warning", {
  2624. confirmButtonText: "删除",
  2625. cancelButtonText: "取消",
  2626. type: "warning",
  2627. })
  2628. .then(async () => {
  2629. let res = await api.deleteTruckLoadRecord({
  2630. id,
  2631. });
  2632. if (res.data.status == 0) {
  2633. ElMessage({
  2634. message: "删除成功!",
  2635. type: "success",
  2636. });
  2637. }
  2638. getTruckLoadRecord();
  2639. })
  2640. .catch(() => {
  2641. ElMessage({
  2642. type: "info",
  2643. message: "取消删除",
  2644. });
  2645. });
  2646. }
  2647. let isDistributeModalVisable = ref(false);
  2648. let previewList = ref([]);
  2649. let checkedImages = ref([]);
  2650. let distributeType = ref(-1);
  2651. let distributePortId = ref(-1);
  2652. let checkedPreviewList = ref([]);
  2653. let recordIds = ref("");
  2654. let ocrTruckRecordTableData = ref([]);
  2655. function showDistributeModal() {
  2656. checkedImages.value = shipownerUploadFiles.value.filter((e) => e.checked);
  2657. if (!checkedImages.value.length) {
  2658. ElMessage({
  2659. type: "error",
  2660. message: "请选择要分配的图片!",
  2661. });
  2662. return;
  2663. }
  2664. let arr0 = [];
  2665. for (let i of checkedImages.value) {
  2666. checkedPreviewList.value.push(i.viewUrl);
  2667. arr0.push(i.id);
  2668. }
  2669. recordIds.value = arr0.join(",");
  2670. isDistributeModalVisable.value = true;
  2671. }
  2672. function distributeModalClose() {
  2673. isDistributeModalVisable.value = false;
  2674. distributeType.value = -1;
  2675. distributePortId.value = -1;
  2676. distributePoundForm.value = {
  2677. dischargeTime: "",
  2678. dischargeTons: "",
  2679. dischargePieces: "",
  2680. };
  2681. ocrTruckRecordTableData.value = [];
  2682. }
  2683. async function submitDistribute() {
  2684. if (distributePortId.value == -1) {
  2685. ElMessage({
  2686. type: "error",
  2687. message: "请选择要分配的港口!",
  2688. });
  2689. return;
  2690. }
  2691. if (distributeType.value == -1) {
  2692. ElMessage({
  2693. type: "error",
  2694. message: "请选择要分配类型!",
  2695. });
  2696. return;
  2697. }
  2698. let postData = {};
  2699. let type = distributeType.value;
  2700. if (2 == type) {
  2701. postData = {
  2702. poundBillData: {
  2703. ...distributePoundForm.value,
  2704. portId: distributePortId.value,
  2705. },
  2706. };
  2707. } else if (4 == type) {
  2708. for (let i of ocrTruckRecordTableData.value) {
  2709. i.portId = distributePortId.value;
  2710. }
  2711. postData = { carLoadDatas: ocrTruckRecordTableData.value };
  2712. }
  2713. let res = await api.distribute({
  2714. ...postData,
  2715. voyageId: route.query.id,
  2716. recordIds: recordIds.value,
  2717. type,
  2718. });
  2719. console.log(res);
  2720. distributeModalClose();
  2721. getVoyageDetail();
  2722. if (2 == type) getDischargeList();
  2723. if (4 == type) getTruckLoadRecord();
  2724. }
  2725. async function deleteOcrRecord(index) {
  2726. console.log(index);
  2727. ocrTruckRecordTableData.value.splice(index, 1);
  2728. }
  2729. let distributePoundForm = ref({});
  2730. async function ocr() {
  2731. ocrLoading.value = true;
  2732. ocrImageList.value = [];
  2733. let res = await api.ocr({
  2734. recordIds: recordIds.value,
  2735. });
  2736. ocrLoading.value = false;
  2737. ocrTruckRecordTableData.value = res.data.result;
  2738. for (let i of ocrTruckRecordTableData.value) {
  2739. if (i.weighTime) i.weighTime = i.weighTime.substring(0, 10);
  2740. ocrImageList.value.push(i.viewUrl);
  2741. }
  2742. }
  2743. let isCheckAll = ref(false);
  2744. let isIndeterminate = ref(false);
  2745. function checkAll(b) {
  2746. isIndeterminate.value = false;
  2747. shipownerUploadFiles.value.forEach((e) => {
  2748. e.checked = b;
  2749. });
  2750. }
  2751. function checkItem() {
  2752. let arr = shipownerUploadFiles.value.filter((e) => e.checked);
  2753. if (arr.length == shipownerUploadFiles.value.length) {
  2754. isCheckAll.value = true;
  2755. isIndeterminate.value = false;
  2756. } else if (arr.length == 0) {
  2757. isCheckAll.value = false;
  2758. isIndeterminate.value = false;
  2759. } else {
  2760. isIndeterminate.value = true;
  2761. }
  2762. }
  2763. let ocrLoading = ref(false);
  2764. let ocrImageList = ref([]);
  2765. let blockchainInfo = ref("");
  2766. let isAddLabVisable = ref(false);
  2767. let labTableData = ref([]);
  2768. let labForm = ref({});
  2769. let labBillList = ref([]);
  2770. let labCurrentPage = ref(1);
  2771. let labTotal = ref(0);
  2772. let labParams = ref({
  2773. voyageId: route.query.id,
  2774. type: 5,
  2775. });
  2776. function getLabBillList(list) {
  2777. labBillList.value = list;
  2778. }
  2779. function cancelUploadLab() {
  2780. isAddLabVisable.value = false;
  2781. labForm.value = {};
  2782. labBillList.value = [];
  2783. currentLabId.value = -1;
  2784. }
  2785. let currentLabId = ref(-1);
  2786. let isLabLoading = ref(false);
  2787. async function addLab() {
  2788. let postData = {
  2789. portId: currentDiscPortId.value,
  2790. };
  2791. if (labBillList.value.length) {
  2792. if (labBillList.value[0].viewUrl) {
  2793. let { fileKey, viewUrl, downloadUrl } = labBillList.value[0];
  2794. postData = {
  2795. ...postData,
  2796. fileKey,
  2797. viewUrl,
  2798. downloadUrl,
  2799. };
  2800. } else {
  2801. let { fileKey, viewUrl, downloadUrl } =
  2802. labBillList.value[0].response.result;
  2803. postData = {
  2804. ...postData,
  2805. fileKey,
  2806. viewUrl,
  2807. downloadUrl,
  2808. };
  2809. }
  2810. } else {
  2811. postData = {
  2812. ...postData,
  2813. fileKey: "",
  2814. viewUrl: "",
  2815. downloadUrl: "",
  2816. };
  2817. }
  2818. if (currentLabId.value != -1) {
  2819. postData.labId = currentLabId.value;
  2820. delete postData.portId;
  2821. delete labForm.value.file;
  2822. delete labForm.value.fileId;
  2823. }
  2824. isLabLoading.value = true;
  2825. let res = await api[
  2826. `${labModalType.value == "新增记录" ? "addLab" : "updateLab"}`
  2827. ]({
  2828. voyageId: route.query.id,
  2829. ...postData,
  2830. ...labForm.value,
  2831. });
  2832. isLabLoading.value = false;
  2833. cancelUploadLab();
  2834. getLabList();
  2835. }
  2836. function showAddLab() {
  2837. isAddLabVisable.value = true;
  2838. labModalType.value = "新增记录";
  2839. }
  2840. async function getLabList() {
  2841. let res = await api.getLabList({
  2842. voyageId: route.query.id,
  2843. portId: currentDiscPortId.value,
  2844. currentPage: labCurrentPage.value,
  2845. size: 10,
  2846. });
  2847. labTableData.value = res.data.result;
  2848. labTotal.value = res.data.total;
  2849. }
  2850. function labPageChange(e) {
  2851. labCurrentPage.value = e;
  2852. getLabList();
  2853. }
  2854. let labModalType = ref("");
  2855. function showLab(item, index, text) {
  2856. isAddLabVisable.value = true;
  2857. currentLabId.value = item.id;
  2858. labModalType.value = text;
  2859. if (item.file) {
  2860. labBillList.value[0] = {
  2861. ...item.file,
  2862. url: item.file.viewUrl,
  2863. };
  2864. }
  2865. labForm.value = { ...item };
  2866. }
  2867. async function deleteLab(id, index) {
  2868. console.log(id);
  2869. ElMessageBox.confirm("确认删除装货记录?", "Warning", {
  2870. confirmButtonText: "删除",
  2871. cancelButtonText: "取消",
  2872. type: "warning",
  2873. })
  2874. .then(async () => {
  2875. let res = await api.deleteLab({
  2876. id,
  2877. });
  2878. if (res.data.status == 0) {
  2879. ElMessage({
  2880. message: "删除成功!",
  2881. type: "success",
  2882. });
  2883. }
  2884. getLabList();
  2885. })
  2886. .catch(() => {
  2887. ElMessage({
  2888. type: "info",
  2889. message: "取消删除",
  2890. });
  2891. });
  2892. }
  2893. let weatherTableData = ref([]);
  2894. let weatherCurrentPage = ref(1);
  2895. let weatherTotal = ref(0);
  2896. async function getPortWeatherList() {
  2897. let res = await api.getPortWeatherList({
  2898. voyageId: route.query.id,
  2899. portId: currentDiscPortId.value,
  2900. currentPage: weatherCurrentPage.value,
  2901. size: 10,
  2902. });
  2903. weatherTableData.value = res.data.result;
  2904. weatherTotal.value = res.data.total;
  2905. }
  2906. function weatherPageChange(e) {
  2907. weatherCurrentPage.value = e;
  2908. getPortWeatherList();
  2909. }
  2910. let currentPortId = ref("");
  2911. let currentDiscPortId = ref("");
  2912. let currentDiscPortIndex = ref(0);
  2913. function changeDiscPortTab(e) {
  2914. currentDiscPortIndex.value = e.index;
  2915. currentDiscPortId.value =
  2916. voyage.value.voyageDetails[currentDiscPortIndex.value].portId + "";
  2917. weatherTableData.value = [];
  2918. weatherTotal.value = 0;
  2919. labTableData.value = [];
  2920. labTotal.value = 0;
  2921. dischargeList.value = [];
  2922. total.value = 0;
  2923. truckTableData.value = [];
  2924. truckTotal.value = 0;
  2925. labCurrentPage.value = 1;
  2926. dischargeCurrentPage.value = 1;
  2927. weatherCurrentPage.value = 1;
  2928. truckCurrentPage.value = 1;
  2929. getDischargeList();
  2930. getTruckLoadRecord();
  2931. getLabList();
  2932. getPortWeatherList();
  2933. }
  2934. let toInsertDiscPortId = ref("");
  2935. let toInsertDiscPortValue = ref("");
  2936. let getCol = _.debounce(
  2937. async (queryString, cb) => {
  2938. if (!queryString) return;
  2939. let res = await api.getCol({
  2940. term: queryString,
  2941. });
  2942. if (res.data.status == 0) {
  2943. cb(res.data.result);
  2944. }
  2945. },
  2946. 1000,
  2947. { leading: true }
  2948. );
  2949. function clear(type) {
  2950. toInsertDiscPortId.value = "";
  2951. toInsertDiscPortValue.value = "";
  2952. }
  2953. let selectToInsertDiscPort = (item, index) => {
  2954. console.log(item);
  2955. toInsertDiscPortId.value = item.key;
  2956. toInsertDiscPortValue.value = item.value;
  2957. };
  2958. let insertDiscPortVisable = ref(false);
  2959. async function addNewPort() {
  2960. if (!toInsertDiscPortId.value || !toInsertDiscPortValue.value) {
  2961. ElMessage({
  2962. message: "请选择提前卸货港!",
  2963. type: "warning",
  2964. });
  2965. return;
  2966. }
  2967. let res = await api.addNewPort({
  2968. voyageId: route.query.id,
  2969. portId: toInsertDiscPortId.value,
  2970. });
  2971. if (res.data.status == 0) {
  2972. ElMessage({
  2973. message: "添加提前卸货港成功!",
  2974. type: "success",
  2975. });
  2976. getVoyageDetail(true);
  2977. cancelInsertDiscPort();
  2978. } else {
  2979. ElMessage({
  2980. message: res.data.msg,
  2981. type: "error",
  2982. });
  2983. }
  2984. }
  2985. function cancelInsertDiscPort() {
  2986. insertDiscPortVisable.value = false;
  2987. toInsertDiscPortId.value = "";
  2988. toInsertDiscPortValue.value = "";
  2989. }
  2990. function showAddPoundModal() {
  2991. isAddPoundVisable.value = true;
  2992. formInline.value.dischargeTime = dayjs().format("YYYY/MM/DD HH:mm:ss");
  2993. }
  2994. let isAccidentVisable = ref(false);
  2995. let accidentForm = ref({
  2996. files: [],
  2997. });
  2998. let accidentParams = ref({
  2999. voyageId: route.query.id,
  3000. });
  3001. let accidentCurrentPage = ref(1);
  3002. let accidentTotal = ref(0);
  3003. async function getAccidentList() {
  3004. let res = await api.getAccidentList({
  3005. voyageId: route.query.id,
  3006. currentPage: accidentCurrentPage.value,
  3007. size: 10,
  3008. });
  3009. if (res.data.status == 0) {
  3010. accidentList.value = res.data.result;
  3011. accidentTotal.value = res.data.total;
  3012. } else {
  3013. accidentList.value = [];
  3014. accidentTotal.value = 0;
  3015. accidentCurrentPage.value = 1;
  3016. }
  3017. }
  3018. let accidentList = ref([]);
  3019. async function addUpdateAccident() {
  3020. // console.log("accidentForm", accidentForm.value);
  3021. let { accidentTime, remark, files, id } = accidentForm.value;
  3022. let arr = [];
  3023. for (let i of files) {
  3024. arr.push(i.id);
  3025. }
  3026. let postData = {
  3027. loginAccountId: localStorage.loginAccountId,
  3028. voyageId: route.query.id,
  3029. accidentTime,
  3030. remark,
  3031. voyageFileIds: arr.join(","),
  3032. id,
  3033. };
  3034. // console.log("postData", postData);
  3035. let res = await api[id ? "updateAccident" : "addAccident"](postData);
  3036. if (res.data.status == 0) {
  3037. resetAccidentForm();
  3038. isAccidentVisable.value = false;
  3039. }
  3040. getAccidentList();
  3041. }
  3042. function resetAccidentForm() {
  3043. isAccidentCheck.value = false;
  3044. accidentForm.value = {
  3045. files: [],
  3046. };
  3047. }
  3048. function accidentUploadSuccess(e) {
  3049. console.log(e);
  3050. accidentForm.value.files.push(e.result);
  3051. }
  3052. function accidentPageChange(e) {
  3053. accidentCurrentPage.value = e;
  3054. getAccidentList();
  3055. }
  3056. let accidentTitle = ref("");
  3057. function accidentBeforeUpload(e) {
  3058. if (e.type.indexOf("image") != -1) {
  3059. accidentParams.value.mediaType = 1;
  3060. } else {
  3061. accidentParams.value.mediaType = 2;
  3062. }
  3063. }
  3064. let isAccidentCheck = ref(false);
  3065. function checkAccident(item, boo) {
  3066. isAccidentCheck.value = boo;
  3067. if (boo) {
  3068. accidentTitle.value = "查看出险记录";
  3069. } else {
  3070. accidentTitle.value = "修改出险记录";
  3071. }
  3072. isAccidentVisable.value = true;
  3073. item.files = item.files || [];
  3074. accidentForm.value = item;
  3075. }
  3076. function deleteAccident(id) {
  3077. ElMessageBox.confirm("确认删除出险记录?", "提示", {
  3078. confirmButtonText: "确认",
  3079. cancelButtonText: "取消",
  3080. type: "info",
  3081. })
  3082. .then(async () => {
  3083. let res = await api.deleteAccident({
  3084. id,
  3085. });
  3086. if (res.data.status == 0) {
  3087. ElMessage({
  3088. type: "success",
  3089. message: "删除成功!",
  3090. });
  3091. }
  3092. getAccidentList();
  3093. })
  3094. .catch(() => {
  3095. ElMessage({
  3096. type: "info",
  3097. message: "取消删除",
  3098. });
  3099. });
  3100. }
  3101. onMounted(() => {
  3102. getVoyageDetail(true);
  3103. });
  3104. </script>
  3105. <style scoped>
  3106. .map-container {
  3107. width: 100%;
  3108. height: 500px;
  3109. }
  3110. .card-note {
  3111. height: 30px;
  3112. font-size: 12px;
  3113. font-family: PingFangSC-Regular, PingFang SC;
  3114. font-weight: 400;
  3115. color: #777777;
  3116. }
  3117. .medias-box {
  3118. width: 200px;
  3119. height: 200px;
  3120. margin-top: 20px;
  3121. }
  3122. .medias-content {
  3123. width: 100%;
  3124. height: 640px;
  3125. background: #f7f7f7;
  3126. border-radius: 2px;
  3127. }
  3128. .pic-container {
  3129. width: 100%;
  3130. height: 100%;
  3131. box-sizing: border-box;
  3132. display: flex;
  3133. padding: 30px;
  3134. overflow-x: scroll;
  3135. overflow-y: hidden;
  3136. white-space: nowrap;
  3137. }
  3138. .pic-main {
  3139. position: relative;
  3140. width: 120px;
  3141. }
  3142. .box {
  3143. position: absolute;
  3144. height: 255px;
  3145. width: 180px;
  3146. border: 5px solid #dddddd;
  3147. transition: all 0.5s;
  3148. background: #fff;
  3149. z-index: 10;
  3150. }
  3151. .point {
  3152. position: relative;
  3153. left: 93px;
  3154. top: 277px;
  3155. width: 16px;
  3156. height: 16px;
  3157. background-image: url(../../assets/blue-circle.png);
  3158. }
  3159. .s-line {
  3160. position: absolute;
  3161. left: 100px;
  3162. top: 261px;
  3163. height: 20px;
  3164. border-left: 2px dashed;
  3165. box-sizing: border-box;
  3166. border-color: #ddd;
  3167. }
  3168. .l-line {
  3169. position: relative;
  3170. bottom: 30px;
  3171. left: 111px;
  3172. top: 268px;
  3173. height: 3px;
  3174. width: 100px;
  3175. background-color: #dddddd;
  3176. }
  3177. .bottom-box {
  3178. top: 309px;
  3179. }
  3180. .top210px {
  3181. top: 289px;
  3182. }
  3183. .box:hover {
  3184. transform: scale(1.15);
  3185. }
  3186. .medias-box {
  3187. width: 80px;
  3188. height: 80px;
  3189. margin-top: 10px;
  3190. }
  3191. .card-note {
  3192. height: 30px;
  3193. font-size: 12px;
  3194. font-family: PingFangSC-Regular, PingFang SC;
  3195. font-weight: 400;
  3196. color: #777777;
  3197. padding: 10px 20px;
  3198. }
  3199. .medias-box {
  3200. width: 100%;
  3201. height: 100px;
  3202. margin-top: 20px;
  3203. }
  3204. .checkbox-group {
  3205. width: 180px;
  3206. }
  3207. .el-checkbox {
  3208. height: 20px;
  3209. margin-top: 15px;
  3210. margin-right: 0;
  3211. }
  3212. .now-box {
  3213. border: 5px solid #0094fe;
  3214. }
  3215. .now-l-line {
  3216. background-color: #0094fe;
  3217. }
  3218. .now-s-line {
  3219. border-color: #97caf6;
  3220. }
  3221. .now-point {
  3222. filter: grayscale(1);
  3223. }
  3224. .info-line-text-table {
  3225. width: 180px !important;
  3226. }
  3227. .upload-plus-icon {
  3228. height: 15%;
  3229. color: rgb(139, 147, 156);
  3230. line-height: 100px;
  3231. font-size: 40px;
  3232. font-weight: 200;
  3233. }
  3234. .upload-text {
  3235. height: 25%;
  3236. color: rgb(139, 147, 156);
  3237. }
  3238. .el-checkbox {
  3239. margin-top: 0;
  3240. }
  3241. :deep().el-upload-dragger {
  3242. width: 100%;
  3243. height: 148px !important;
  3244. }
  3245. .info-gap {
  3246. width: 40px;
  3247. font-size: 14px;
  3248. overflow: visible;
  3249. white-space: nowrap;
  3250. color: #006ebc;
  3251. cursor: pointer;
  3252. }
  3253. .unit {
  3254. font-size: 14px;
  3255. font-family: PingFangSC-Regular, PingFang SC;
  3256. font-weight: 400;
  3257. color: #353a42;
  3258. line-height: 100%;
  3259. margin: 0 10px;
  3260. }
  3261. .line {
  3262. flex-wrap: wrap;
  3263. margin: 0 20px;
  3264. }
  3265. .info-line {
  3266. margin-bottom: 20px;
  3267. }
  3268. .ml50 {
  3269. margin-left: 140px;
  3270. }
  3271. .medias-content ::-webkit-scrollbar {
  3272. height: 20px; /* 设置滚动条的高度 */
  3273. }
  3274. .medias-content ::-webkit-scrollbar-track {
  3275. background-color: #f1f1f1; /* 设置滚动条的背景颜色 */
  3276. }
  3277. .medias-content ::-webkit-scrollbar-thumb {
  3278. background-color: #0094feb6; /* 设置滚动条的颜色 */
  3279. border-radius: 10px;
  3280. }
  3281. </style>