billsDetails.vue 161 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  7. @click="backToList">{{ $t("btn118n.toList") }}
  8. </el-button>
  9. <el-button v-if="form.id && pageIds.length" type="text" @click="lastPage">{{ $t("btn118n.previous")
  10. }}</el-button>
  11. <el-button v-if="form.id && pageIds.length" type="text" @click="nextPage">{{ $t("btn118n.next")
  12. }}</el-button>
  13. </div>
  14. <div class="add-customer-btn">
  15. <!--<el-popover-->
  16. <!-- placement="bottom-end"-->
  17. <!-- width="100"-->
  18. <!-- trigger="hover">-->
  19. <!-- <div>-->
  20. <!-- </div>-->
  21. <el-button v-if="form.changeOrderStatus == '录入'" type="primary" size="small"
  22. @click="allClick('申请换单')">申请换单
  23. </el-button>
  24. <el-button v-if="form.changeOrderStatus == '申请'" type="danger" size="small"
  25. @click="allClick('撤销换单')">撤销换单
  26. </el-button>
  27. <el-button v-if="form.deliveryNoteStatus == '录入'" type="success" size="small"
  28. @click="allClick('电子提货单')">电子提货单
  29. </el-button>
  30. <el-button v-if="form.deliveryNoteStatus == '已发送'" type="danger" size="small"
  31. @click="allClick('撤销电子提货单')">撤销电子提货单
  32. </el-button>
  33. <el-button size="small" type="primary" @click="addEdit">{{ $t("btn118n.new") }}
  34. </el-button>
  35. <el-button type="success" size="small" style="margin-right: 8px" @click="CopyDocumentsfun">{{
  36. $t("btn118n.copy") }}
  37. </el-button>
  38. <el-dropdown style="line-height: 0" v-if="
  39. saberTenantId == '409341' || saberTenantId == '607913'
  40. ">
  41. <el-button size="small" type="warning" style="margin-right: 8px"
  42. :disabled="form.status > 0 || showLock || !form.id">
  43. {{ $t("btn118n.importTemplate") }}<i class="el-icon-arrow-down el-icon--right"></i>
  44. </el-button>
  45. <el-dropdown-menu slot="dropdown">
  46. <el-dropdown-item v-for="item in imporiData" :key="item.id"
  47. @click.native="importData(item.id)">{{ item.name }}
  48. </el-dropdown-item>
  49. </el-dropdown-menu>
  50. </el-dropdown>
  51. <el-dropdown style="line-height: 0">
  52. <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
  53. :disabled="!form.id || showLock">
  54. 发送 SO EDI<i class="el-icon-arrow-down el-icon--right"></i>
  55. </el-button>
  56. <el-dropdown-menu slot="dropdown">
  57. <el-dropdown-item v-for="item in ediData_SO" :key="item.id" class="dropdown-max"
  58. @click.native="editypesSendingEdifun(item)">{{ item.cnName }}
  59. </el-dropdown-item>
  60. </el-dropdown-menu>
  61. </el-dropdown>
  62. <!-- <el-dropdown style="line-height: 0">
  63. <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
  64. :disabled="!form.id || showLock">
  65. 发送 SI EDI<i class="el-icon-arrow-down el-icon--right"></i>
  66. </el-button>
  67. <el-dropdown-menu slot="dropdown">
  68. <el-dropdown-item v-for="item in ediData_SI" :key="item.id" class="dropdown-max"
  69. @click.native="editypesSendingEdifun(item)">{{ item.cnName }}
  70. </el-dropdown-item>
  71. </el-dropdown-menu>
  72. </el-dropdown> -->
  73. <el-button
  74. v-if="bigtabs != 'dz' && (roleName.includes('admin') || (roleName.includes('应付修改') && roleName.includes('应付查看')) || (roleName.includes('应收修改') && roleName.includes('应收查看')))"
  75. size="small" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id"
  76. @click="previewDialogfun">{{ $t("btn118n.preview") }}
  77. </el-button>
  78. <el-button v-if="form.id && form.receiveStatus == '录入'" size="small" type="success"
  79. @click.stop="allClick('接收')">{{ $t("btn118n.received") }}
  80. </el-button>
  81. <el-button v-if="form.id && form.receiveStatus == '已接收'" size="small" type="danger"
  82. @click.stop="allClick('撤销接收')">{{ $t("btn118n.unReceived") }}
  83. </el-button>
  84. <!-- <el-button v-if="form.id && form.changeOrdersStatus == '可换单'" size="small" type="warning"
  85. @click.stop="allClick('换单')">{{ $t("sea118n.changeDoc") }}
  86. </el-button> -->
  87. <!-- <el-button v-if="form.id && form.changeOrdersStatus == '已换单'" size="small" type="danger"
  88. @click.stop="allClick('撤销换单')">{{ $t("sea118n.unChangeDoc") }}
  89. </el-button> -->
  90. <el-button size="small" type="warning" :disabled="!form.id || showLock" v-if="form.billType == 'MM'"
  91. @click.stop="allClick('同步分单信息')">{{ $t("btn118n.getInfoMMToMH") }}
  92. </el-button>
  93. <el-button v-if="form.id && form.returningSecurityMoneyStatus == '可退押'" size="small" type="info"
  94. @click.stop="allClick('退押')">{{ $t("btn118n.returnDeposit") }}
  95. </el-button>
  96. <el-button v-if="
  97. form.id && form.returningSecurityMoneyStatus == '已退押'
  98. " size="small" type="danger" @click.stop="allClick('撤销退押')">{{ $t("btn118n.unReturnDeposit") }}
  99. </el-button>
  100. <el-button size="small" type="warning" :disabled="!form.id || showLock"
  101. v-if="form.status == 1 && form.billType != 'MH'" @click.stop="revokeDocumentApproval">{{
  102. $t("btn118n.unapply") }}
  103. </el-button>
  104. <el-button size="small" type="success" :disabled="!form.id || detailData.seeDisabled || showLock" v-if="
  105. form.status == 0 ||
  106. (form.status == 4 && form.billType != 'MH')
  107. " @click.stop="DocumentApproval">{{ $t("btn118n.apply") }}
  108. </el-button>
  109. <el-button size="small" type="danger" :disabled="showLock"
  110. v-if="form.status == 3 && form.billType != 'MH' && (roleName.includes('admin') || roleName.includes('撤销锁单'))"
  111. @click.stop="revokeLockOrder">{{ $t("btn118n.unapply") }}
  112. </el-button>
  113. <el-button size="small" type="primary" style="margin-right: 8px"
  114. :disabled="detailData.seeDisabled || showLock" :loading="saveLoading" @click="editCustomer">{{
  115. $t("btn118n.save") }}
  116. </el-button>
  117. <el-dropdown style="line-height: 0" v-if="form.billType != 'MH'">
  118. <el-button type="warning" :loading="saveLoading" :disabled="!form.id" size="small">
  119. {{ $t("btn118n.checked") }}<i class="el-icon-arrow-down el-icon--right"></i>
  120. </el-button>
  121. <el-dropdown-menu slot="dropdown">
  122. <el-dropdown-item @click.native="
  123. (checkScheduleDialog = true),
  124. (checkId = form.id)
  125. ">审核进度
  126. </el-dropdown-item>
  127. </el-dropdown-menu>
  128. </el-dropdown>
  129. </div>
  130. </div>
  131. <div style="margin-top: 50px">
  132. <el-tabs type="border-card" v-model="bigtabs" @tab-click="bigHandleClick">
  133. <el-tab-pane :label="$t('sea118n.orderInfo')" name="wt" class="scrollable-container">
  134. <div>
  135. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm" :disabled="showLock">
  136. <basic-container>
  137. <el-row :gutter="60">
  138. <el-col v-for="(item,
  139. index) in basicData.column" :key="index" :span="8">
  140. <!--数组-->
  141. <div v-if="item instanceof Array"
  142. style="display: flex;align-items: center;justify-content: space-between">
  143. <el-row>
  144. <el-col :span="item[0].span
  145. ? item[0].span
  146. : 12
  147. ">
  148. <el-form-item :label="item[0].label" :prop="item[0].prop"
  149. :rules="item[0].rules" :label-width="item[0].labelWidth
  150. ">
  151. <span slot="label" v-if="item[0].label">
  152. <span v-if="
  153. item[0]
  154. .label ==
  155. 'HB/L NO'
  156. " style="color: #4c9e44;cursor: pointer;text-decoration: underline;"
  157. @click="
  158. applyforfun(
  159. item[0]
  160. .label
  161. )
  162. ">{{
  163. form.hblno
  164. ? "删除"
  165. : "申请"
  166. }}
  167. {{
  168. item[0]
  169. .label
  170. }}
  171. </span>
  172. <span v-else style="color: #1e9fff">{{
  173. item[0]
  174. .label
  175. }}</span>
  176. </span>
  177. <span v-if="
  178. item[0].type ==
  179. 'button'
  180. "></span>
  181. <!--<el-button v-if="item[0].type == 'button'" :disabled="detailData.seeDisabled || item[0].disabled"-->
  182. <!-- size="mini" type="success" icon="el-icon-circle-plus" circle-->
  183. <!-- @click="applyforfun(item[0].label)" >-->
  184. <!--</el-button>-->
  185. <search-query v-else-if="
  186. item[0].type ==
  187. 'select'
  188. " :datalist="item[0].dicData
  189. " :selectValue="form[
  190. item[0].prop
  191. ]
  192. " :filterable="true" :allowCreate="item[0]
  193. .allowCreate ||
  194. false
  195. " :remote="true" :disabled="detailData.seeDisabled ||
  196. item[0]
  197. .disabled
  198. " :buttonIf="false" :placeholder="`${item[0]
  199. .text ||
  200. ''}`
  201. " :forParameter="item[0]
  202. .forParameter
  203. " @remoteMethod="
  204. remoteMethod(
  205. $event,
  206. item[0].prop
  207. )
  208. " @corpChange="
  209. corpChange(
  210. $event,
  211. item[0].prop
  212. )
  213. " @corpFocus="
  214. remoteMethod(
  215. $event,
  216. item[0].prop
  217. )
  218. ">
  219. </search-query>
  220. <el-input v-else type="age" style="width: 100%;" v-model="form[item[0].prop]
  221. " size="small" autocomplete="off"
  222. :disabled="detailData.seeDisabled || item[0].disabled || form.feeCenterListD.filter(item => item.auditStatus > 0).length || form.feeCenterListC.filter(item => item.auditStatus > 0).length"
  223. :placeholder="item[0].text || ''"></el-input>
  224. </el-form-item>
  225. </el-col>
  226. <el-col :span="item[1].span
  227. ? item[1].span
  228. : 12
  229. ">
  230. <el-form-item :label="item[1].label" :prop="item[1].prop"
  231. :rules="item[1].rules" :label-width="item[1].labelWidth
  232. ">
  233. <span slot="label" v-if="item[1].label">
  234. <span style="color: #1e9fff">{{
  235. item[1]
  236. .label
  237. }}</span>
  238. </span>
  239. <el-date-picker v-if="
  240. item[1].type ==
  241. 'date'
  242. " v-model="form[
  243. item[1].prop
  244. ]
  245. " clearable style="width: 100%;" type="date" size="small"
  246. :disabled="detailData.seeDisabled ||
  247. item[1]
  248. .disabled
  249. " value-format="yyyy-MM-dd HH:mm" placeholder="选择日期">
  250. </el-date-picker>
  251. <search-query v-else-if="item[1].type == 'select'"
  252. :datalist="item[1].dicData"
  253. :selectValue="form[item[1].prop]" :filterable="true"
  254. :remote="true"
  255. :disabled="detailData.seeDisabled || item[1].disabled || form.feeCenterListD.filter(item => item.auditStatus > 0).length || form.feeCenterListC.filter(item => item.auditStatus > 0).length"
  256. :buttonIf="false" :placeholder="`${item[1].text || ''}`"
  257. :forParameter="item[1].forParameter"
  258. @remoteMethod="remoteMethod($event, item[1].prop)"
  259. @corpChange="corpChange($event, item[1].prop)"
  260. @corpFocus="remoteMethod($event, item[1].prop)">
  261. </search-query>
  262. <tree-select v-else-if="
  263. item[1].type ==
  264. 'tree'
  265. " v-model="form[
  266. item[1].prop
  267. ]
  268. " :data="item[1].dicData
  269. " :props="item[1]
  270. .forParameter
  271. " nodeKey="title" size="small" :clearable="false"
  272. :disabled="detailData.seeDisabled ||
  273. item[1]
  274. .disabled
  275. " :multiple="false" :placeholder="`${item[1]
  276. .text ||
  277. ''}`
  278. " @input="
  279. corpChange(
  280. $event,
  281. item[1].prop
  282. )
  283. ">
  284. </tree-select>
  285. <el-input v-else type="age" style="width: 100%;" v-model="form[
  286. item[1].prop
  287. ]
  288. " size="small" autocomplete="off" :disabled="detailData.seeDisabled ||
  289. item[1]
  290. .disabled
  291. " :placeholder="item[1].text ||
  292. ''
  293. "></el-input>
  294. </el-form-item>
  295. </el-col>
  296. <el-col v-if="item[2]" :span="item[2].span
  297. ? item[2].span
  298. : 12
  299. ">
  300. <el-form-item :label="item[2].label" :prop="item[2].prop"
  301. :rules="item[2].rules" :label-width="item[2].labelWidth
  302. ">
  303. <span slot="label" v-if="item[2].label">
  304. <span style="color: #1e9fff">{{
  305. item[2]
  306. .label
  307. }}</span>
  308. </span>
  309. <search-query v-if="
  310. item[2].type ==
  311. 'select'
  312. " :datalist="item[2].dicData
  313. " :selectValue="form[
  314. item[2].prop
  315. ]
  316. " :filterable="true" :clearable="false" :remote="true"
  317. :disabled="detailData.seeDisabled ||
  318. item[2]
  319. .disabled
  320. " :buttonIf="false" :forParameter="item[2]
  321. .forParameter
  322. " :placeholder="`${item[2]
  323. .text ||
  324. ''}`
  325. " @remoteMethod="
  326. remoteMethod(
  327. $event,
  328. item[2].prop
  329. )
  330. " @corpChange="
  331. corpChange(
  332. $event,
  333. item[2].prop
  334. )
  335. " @corpFocus="
  336. remoteMethod(
  337. $event,
  338. item[2].prop
  339. )
  340. ">
  341. </search-query>
  342. <el-input v-else type="age" style="width: 100%;" v-model="form[
  343. item[2].prop
  344. ]
  345. " size="small" autocomplete="off" :disabled="detailData.seeDisabled ||
  346. item[1]
  347. .disabled
  348. " :placeholder="item[2].text ||
  349. ''
  350. "></el-input>
  351. </el-form-item>
  352. </el-col>
  353. </el-row>
  354. </div>
  355. <!--对象-->
  356. <div v-else>
  357. <el-form-item v-if="item.display == true" :label="item.label"
  358. :prop="item.prop" :rules="item.rules">
  359. <span slot="label" v-if="item.label">
  360. <span style="color: #1e9fff">{{ item.label }}</span>
  361. </span>
  362. <search-query v-if="item.type == 'select'" ref="searchQueryRef"
  363. :datalist="item.dicData" :selectValue="form[item.prop]
  364. " :filterable="true" :clearable="false" :remote="true"
  365. :disabled="detailData.seeDisabled || item.disabled"
  366. :buttonIf="item.buttonIf" :forParameter="item.forParameter
  367. " :placeholder="`${item.text || ''}`
  368. " :joinData="item.joinData" @remoteMethod="
  369. remoteMethod(
  370. $event,
  371. item.prop
  372. )
  373. " @corpChange="
  374. corpChange(
  375. $event,
  376. item.prop
  377. )
  378. " @corpFocus="
  379. remoteMethod(
  380. $event,
  381. item.prop
  382. )
  383. " @eldialogConfirm="
  384. eldialogConfirm(
  385. item.slot
  386. )
  387. ">
  388. <bcorps v-show="item.slot ==
  389. 'bcorps'
  390. " ref="bcorps" :eldialog="true" @selectionChange="
  391. eldialogMultipleChoice(
  392. $event,
  393. item.slot
  394. )
  395. ">
  396. </bcorps>
  397. <bcorpstypedefine v-show="item.slot ==
  398. 'bcorpstypedefine'
  399. ">
  400. </bcorpstypedefine>
  401. </search-query>
  402. <el-input v-else type="age" style="width: 100%;"
  403. v-model="form[item.prop]" size="small" autocomplete="off" :disabled="detailData.seeDisabled ||
  404. item.disabled
  405. " :placeholder="item.text || ''
  406. "></el-input>
  407. </el-form-item>
  408. </div>
  409. </el-col>
  410. </el-row>
  411. </basic-container>
  412. </el-form>
  413. </div>
  414. <div class="customer-main margintop">
  415. <basic-container :showBtn="true">
  416. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  417. <el-tab-pane :label='$t("sea118n.billInfo")' name="first">
  418. <entrustment-lnformation :assemblyForm="form" :saberUserInfo="saberUserInfo"
  419. :detailData="detailData" :disabled="showLock"
  420. :generateBillsfalse="generateBillsfalse" @billsDetailfun="
  421. billsDetailfun(form.id)
  422. ">
  423. </entrustment-lnformation>
  424. </el-tab-pane>
  425. <el-tab-pane :label='$t("sea118n.ctnrList")' name="second">
  426. <DistributionBox :assemblyForm="form" :detailData="detailData" :showLock="showLock"
  427. :pleasereviewType="pleasereviewType" @billsAddfun="billsAddfun" @billsDetailfun="
  428. billsDetailfun(form.id)
  429. ">
  430. </DistributionBox>
  431. </el-tab-pane>
  432. <el-tab-pane label="MB/L信息" name="third">
  433. <mbinformation :assemblyForm="form" :detailData="detailData" :disabled="showLock">
  434. </mbinformation>
  435. </el-tab-pane>
  436. <el-tab-pane :label='$t("sea118n.reportManage")' name="fourth" v-if="
  437. roleName.indexOf('admin') != -1
  438. ? true
  439. : roleName.indexOf('报表管理') != -1
  440. ? true
  441. : false
  442. ">
  443. <reports :id="form.id" :assemblyForm="form" :disabled="detailData.seeDisabled || showLock
  444. " businessValue="HYJK"></reports>
  445. </el-tab-pane>
  446. <!-- <el-tab-pane label="EDI 及其他" name="sixth">
  447. <edicode :assemblyForm="form" :detailData="detailData" :disabled="showLock">
  448. </edicode>
  449. </el-tab-pane> -->
  450. <el-tab-pane :label='$t("sea118n.fileCerter")' name="seventh">
  451. <filescenter ref="filescenter" :assemblyForm="form" :pid="form.id"
  452. :detailData="detailData" :showLock="showLock"></filescenter>
  453. </el-tab-pane>
  454. </el-tabs>
  455. </basic-container>
  456. <basic-container :showBtn="true" v-if="
  457. activeName == 'first' || activeName == 'third'
  458. ">
  459. <formbottom :assemblyForm="form" :generateBillsfalse="generateBillsfalse"
  460. :disabled="showLock" :detailData="detailData"></formbottom>
  461. </basic-container>
  462. </div>
  463. </el-tab-pane>
  464. <el-tab-pane :label='$t("sea118n.feeInfo")' name="fy" class="scrollable-container"
  465. v-if="(roleName.includes('admin') || roleName.includes('secondaryAdmin') || roleName.includes('应收修改') || roleName.includes('应付修改') || roleName.includes('应收查看') || roleName.includes('应付查看')) || roleName.includes('国外费用')">
  466. <feecenter :assemblyForm="form" :copyFormData="copyFormData" :detailData="detailData"
  467. :disabled="detailData.seeDisabled || showLock" :showLock="showLock"
  468. :pleasereviewType="pleasereviewType" :pid="form.id" @billsDetailfun="billsDetailfun(form.id)">
  469. </feecenter>
  470. </el-tab-pane>
  471. <el-tab-pane :label='$t("sea118n.docCenter")' name="dz" class="scrollable-container">
  472. <document-center ref="documentCenter" :detailData="detailData" :assemblyForm="form"
  473. :disabled="showLock"></document-center>
  474. </el-tab-pane>
  475. <el-tab-pane :label='$t("sea118n.hblnolist")' name="fd" v-if="form.billType == 'MM'"
  476. class="scrollable-container">
  477. <Split-list :detailData="detailData" :assemblyForm="form" :data="billsListAllData"
  478. :disabled="detailData.seeDisabled || showLock"
  479. @billsListAllfun="billsListAllfun(form.id)"></Split-list>
  480. </el-tab-pane>
  481. </el-tabs>
  482. </div>
  483. <!--导入模板-->
  484. <el-dialog :title='$t("btn118n.importTemplate")' append-to-body :visible.sync="excelBox" width="555px"
  485. :close-on-click-modal="false" v-dialog-drag>
  486. <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading"
  487. :upload-before="uploadBefore" :upload-after="onSuccess">
  488. </avue-form>
  489. </el-dialog>
  490. <!--审核弹窗-->
  491. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  492. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  493. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  494. </el-dialog>
  495. <!--预览报表弹窗-->
  496. <el-dialog append-to-body title="预览报表" class="el-dialogDeep" :visible.sync="previewDialog" width="60%"
  497. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  498. <business-reports v-if="previewDialog" :id="form.id" :classifycode="getReportTypeByBigHandle()"
  499. :disabled="detailData.seeDisabled"></business-reports>
  500. </el-dialog>
  501. </div>
  502. </template>
  503. <script>
  504. import EntrustmentLnformation from "@/views/iosBasicData/OceanFreightImport/bills/assembly/EntrustmentLnformation.vue";
  505. import mbinformation from "@/views/iosBasicData/OceanFreightImport/bills/assembly/mbinformation.vue";
  506. import reports from "@/views/iosBasicData/OceanFreightImport/bills/assembly/reports.vue";
  507. import formbottom from "@/views/iosBasicData/OceanFreightImport/bills/assembly/formbottom.vue";
  508. import edicode from "@/views/iosBasicData/OceanFreightImport/bills/assembly/edicode.vue";
  509. import filescenter from "@/views/iosBasicData/OceanFreightImport/bills/assembly/filescenter.vue";
  510. import DistributionBox from "@/views/iosBasicData/OceanFreightImport/bills/assembly/DistributionBox.vue";
  511. import feecenter from "@/views/iosBasicData/OceanFreightImport/bills/assembly/feecenter.vue";
  512. import { getList as userGetList } from "@/api/system/user";
  513. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  514. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  515. import bcorps from "@/views/iosBasicData/bcorps/index.vue";
  516. import bcorpstypedefine from "@/views/iosBasicData/bcorps/bcorpstypedefine.vue";
  517. import SplitList from "@/views/iosBasicData/OceanFreightImport/bills/assembly/SplitList.vue";
  518. import { getLazylist } from "@/api/basicData/agreement";
  519. import { getBcorpsList, getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  520. import { getBlocationsList } from "@/api/iosBasicData/blocations";
  521. import { getBcorpsattnList } from "@/api/iosBasicData/bcorpsattn";
  522. import { getWorkDicts } from "@/api/system/dictbiz";
  523. import { getDeptLazyTree, getDeptTree, getLazyList } from "@/api/system/dept";
  524. import {
  525. billsCheckBills,
  526. billsCopyBills,
  527. billsDetail,
  528. billsGetBillNo,
  529. removeHblNo,
  530. billsListAll,
  531. billsRevokeCheckBills,
  532. editypesSendingEdi,
  533. billsSubmit,
  534. billsAdd,
  535. deptGetDetailPol,
  536. postSelectByUser,
  537. receive,
  538. revokeReceive,
  539. changeOrders,
  540. revokeChangeOrders,
  541. returningSecurityMoney,
  542. revokeReturningSecurityMoney,
  543. synchronizeData,
  544. revokeLockOrder
  545. } from "@/api/iosBasicData/bills";
  546. import { dateFormat } from "@/util/date";
  547. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  548. import { getBvesselsList } from "@/api/iosBasicData/bvessels";
  549. import DocumentCenter from "@/views/iosBasicData/OceanFreightImport/bills/assembly/DocumentCenter.vue";
  550. import businessReports from "@/views/iosBasicData/OceanFreightImport/bills/assembly/businessReports.vue";
  551. import { popupReminder } from "@/util/messageReminder";
  552. import editypes from "@/views/iosBasicData/editypes/index.vue";
  553. import { editypesList } from "@/api/iosBasicData/editypes";
  554. import { verifyEnglish, checkFullWidthSymbols } from "@/util/date";
  555. import { contrastObj, contrastList } from "@/util/contrastData";
  556. import { selectListLos } from "@/api/approval/processConfig";
  557. import { isProcurement } from "@/api/basicData/configuration";
  558. import {
  559. applySwitch,
  560. revokeSwitch,
  561. electronBillOfLading,
  562. revokeElectronBillOfLading
  563. } from "@/api/iosBasicData/ImportExchange.js";
  564. import _ from "lodash";
  565. export default {
  566. components: {
  567. checkSchedule,
  568. SearchQuery,
  569. EntrustmentLnformation,
  570. formbottom,
  571. mbinformation,
  572. reports,
  573. edicode,
  574. filescenter,
  575. DistributionBox,
  576. feecenter,
  577. bcorps,
  578. bcorpstypedefine,
  579. SplitList,
  580. TreeSelect,
  581. DocumentCenter,
  582. businessReports,
  583. editypes
  584. },
  585. props: {
  586. detailData: {
  587. type: Object
  588. },
  589. pageIds: {
  590. type: Array, // 指定 prop 的类型为 Array
  591. default: () => [], // 提供一个默认值,这里使用函数形式返回一个空数组
  592. }
  593. },
  594. data() {
  595. return {
  596. verifySymbolStatus: 0,
  597. showLock: false,
  598. ediData: [], // edi 列表数据
  599. ediData_SO: [], // edi SO 列表数据
  600. ediData_SI: [], // edi SI 列表数据
  601. previewDialog: false, // 预览报表弹窗开启
  602. generateBillsfalse: false, // 如果生成账单就禁用
  603. pleasereviewType: false, // 如果请核就禁用
  604. checkScheduleDialog: false, // 审核弹窗
  605. checkId: "", // 审核需要的id
  606. batchNo: "",
  607. billsListAllData: [], // 分单列表数据
  608. pageLoading: false, // 全屏的动画
  609. saveLoading: false,
  610. copyFormData: {}, // 详情的备份数据
  611. // 详情数据
  612. form: {
  613. branchId: JSON.parse(localStorage.getItem("sysitemData"))
  614. .deptId,
  615. branchName: JSON.parse(localStorage.getItem("sysitemData"))
  616. .deptName,
  617. billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00", // 单据日期 默认 当天
  618. operatorName: JSON.parse(localStorage.getItem("saber-userInfo"))
  619. .content.user_name, // OP 默认登录人
  620. operatorId: JSON.parse(localStorage.getItem("saber-userInfo"))
  621. .content.user_id, // OP 默认登录人
  622. businessType: "SI", // 业务类型 默认 海运出口
  623. businessTypes: "海运",
  624. billType: "DD", // 单据类型 默认 直单
  625. accDeptName: "", // 核算部门 默认登录人的部门
  626. issueType: "TER", // 签单方式 默认 正本提单
  627. mpaymode: "PP", // 主单付费方式 默认PP
  628. hpaymode: "PP", // 分单付费方式 默认 PP
  629. polFreeBoxUseDays: 7,
  630. podFreeBoxUseDays: 14,
  631. loadType: "整箱", // 装箱方式默认整箱
  632. srcType: "OWN", // 业务来源默认公司 来源 内容 默认登录人所属公司
  633. numberOfObl: "NONE", // 正本份数 默认 THREE
  634. numberOfCopy: "NONE", // 副本份数 默认 THREE
  635. seaType: "I", // 进出口 默认出口 E=出口 I=进口"
  636. cargoType: "dry", // 货物类型默认普货
  637. marks: "N/M",
  638. dgPackingLevel: "0", // 危险品包装等级
  639. serviceTerms: "CY-CY", // 服务方式
  640. filesList: [], // 文件中心
  641. feeCenterListD: [], // 收
  642. feeCenterListC: [], // 付
  643. preContainersList: [], // 箱
  644. feeCenterAmendList: [],
  645. containerNumberItemList: [],
  646. placeReceiptName: "",
  647. placeReceiptNamePrint: "",
  648. polEnName: "",
  649. polNamePrint: "",
  650. podEnName: "",
  651. podNamePrint: "",
  652. destinationName: "",
  653. destinationNamePrint: "",
  654. placeDeliveryName: "",
  655. placeDeliveryNamePrint: "",
  656. potEnName: "",
  657. potNamePrint: "",
  658. detail: {},
  659. hmmEdi: {}
  660. },
  661. oldForm: {
  662. branchId: JSON.parse(localStorage.getItem("sysitemData"))
  663. .deptId,
  664. branchName: JSON.parse(localStorage.getItem("sysitemData"))
  665. .deptName,
  666. billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00", // 单据日期 默认 当天
  667. operatorName: JSON.parse(localStorage.getItem("saber-userInfo"))
  668. .content.user_name, // OP 默认登录人
  669. operatorId: JSON.parse(localStorage.getItem("saber-userInfo"))
  670. .content.user_id, // OP 默认登录人
  671. businessType: "SI", // 业务类型 默认 海运出口
  672. businessTypes: "海运",
  673. billType: "DD", // 单据类型 默认 直单
  674. accDeptName: "", // 核算部门 默认登录人的部门
  675. issueType: "TER", // 签单方式 默认 正本提单
  676. mpaymode: "PP", // 主单付费方式 默认PP
  677. hpaymode: "PP", // 分单付费方式 默认 PP
  678. polFreeBoxUseDays: 7,
  679. podFreeBoxUseDays: 14,
  680. loadType: "整箱", // 装箱方式默认整箱
  681. srcType: "OWN", // 业务来源默认公司 来源 内容 默认登录人所属公司
  682. numberOfObl: "NONE", // 正本份数 默认 THREE
  683. numberOfCopy: "NONE", // 副本份数 默认 THREE
  684. seaType: "I", // 进出口 默认出口 E=出口 I=进口"
  685. cargoType: "dry", // 货物类型默认普货
  686. marks: "N/M",
  687. dgPackingLevel: "0", // 危险品包装等级
  688. serviceTerms: "CY-CY", // 服务方式
  689. filesList: [], // 文件中心
  690. feeCenterListD: [], // 收
  691. feeCenterListC: [], // 付
  692. preContainersList: [], // 箱
  693. feeCenterAmendList: [],
  694. containerNumberItemList: [],
  695. placeReceiptName: "",
  696. placeReceiptNamePrint: "",
  697. polEnName: "",
  698. polNamePrint: "",
  699. podEnName: "",
  700. podNamePrint: "",
  701. destinationName: "",
  702. destinationNamePrint: "",
  703. placeDeliveryName: "",
  704. placeDeliveryNamePrint: "",
  705. potEnName: "",
  706. potNamePrint: "",
  707. detail: {},
  708. hmmEdi: {}
  709. },
  710. // 循环的配置
  711. basicData: {
  712. column: [
  713. {
  714. label: this.$t("sea118n.corpName"), // 调往来单位接口
  715. prop: "corpCnName",
  716. text: "请选择客户名称",
  717. type: "select",
  718. dicData: [],
  719. disabled: false,
  720. buttonIf: true,
  721. joinData: true,
  722. slot: "bcorps",
  723. display: true,
  724. forParameter: {
  725. key: "id",
  726. label: "cnName",
  727. value: "cnName",
  728. short: "shortName"
  729. },
  730. rules: [
  731. {
  732. required: true,
  733. message: " ",
  734. trigger: "blur"
  735. }
  736. ]
  737. },
  738. {
  739. label: "booking NO", // 订舱号
  740. text: "请输入booking NO",
  741. prop: "bookingNo",
  742. disabled: false,
  743. display: true
  744. },
  745. {
  746. label: "HB/L NO",
  747. text: "请输入MB/L NO",
  748. prop: "hblno",
  749. disabled: false,
  750. display: false
  751. },
  752. [
  753. {
  754. label: "MB/L NO",
  755. text: "请输入MB/L NO",
  756. prop: "mblno",
  757. span: 18,
  758. disabled: false
  759. },
  760. {
  761. label: "", // MB/L 付款方式 PP=预付, CC=到付, FPA, Other
  762. text: "请选择付款方式",
  763. prop: "mpaymode",
  764. type: "select",
  765. labelWidth: "30px",
  766. disabled: false,
  767. span: 6,
  768. dicData: [],
  769. forParameter: {
  770. key: "dictKey",
  771. label: "dictValue",
  772. value: "dictKey"
  773. }
  774. }
  775. ]
  776. // [
  777. // {
  778. // label: "OP", // 操作id 用户管理下拉 模糊搜索
  779. // text: "请选择OP",
  780. // prop: "operatorName",
  781. // type: 'select',
  782. // dicData: [],
  783. // disabled: false,
  784. // forParameter: {
  785. // key: 'id',
  786. // label: 'name',
  787. // value: 'name',
  788. // },
  789. // rules: [{
  790. // required: true,
  791. // message: " ",
  792. // trigger: "blur"
  793. // }]
  794. // },
  795. // {
  796. // label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
  797. // text: "请选择核算部门",
  798. // prop: "accDeptName",
  799. // type: 'tree',
  800. // dicData: [],
  801. // disabled: false,
  802. // clearable: false,
  803. // forParameter: {
  804. // label: "title",
  805. // children: 'children'
  806. // },
  807. // rules: [{
  808. // required: true,
  809. // message: " ",
  810. // trigger: "blur"
  811. // }]
  812. // },
  813. // ],
  814. ]
  815. },
  816. activeName: "first",
  817. bigtabs: "wt",
  818. saberUserInfo: {}, // 当前登录人信息
  819. roleName: [], // 当前的角色权限
  820. // 需要加判断是否必填的数据
  821. messageData: [
  822. {
  823. name: "客户",
  824. value: "corpCnName"
  825. },
  826. {
  827. name: "业务来源",
  828. value: "srcType"
  829. },
  830. {
  831. name: "MBLNO",
  832. value: "mblno"
  833. },
  834. // {
  835. // name: 'booking NO',
  836. // value: 'bookingNo',
  837. // },
  838. // {
  839. // name: 'REF MBLNO',
  840. // value: 'refno',
  841. // },
  842. {
  843. name: "船名(VSL)",
  844. value: "vesselCnName"
  845. },
  846. {
  847. name: "航次(VOY)",
  848. value: "voyageNo"
  849. },
  850. // {
  851. // name: 'ETD',
  852. // value: 'etd',
  853. // },
  854. {
  855. name: "装货港",
  856. value: "polCnName"
  857. },
  858. {
  859. name: "目的港",
  860. value: "destinationNamePrint"
  861. },
  862. // {
  863. // name: '包装单位',
  864. // value: 'packingUnit',
  865. // },
  866. {
  867. name: "船公司",
  868. value: "carrierCnName"
  869. },
  870. {
  871. name: "场站",
  872. value: "podCyCnName"
  873. }
  874. ],
  875. imporiData: [
  876. {
  877. id: 0,
  878. name: "导入 ONE 模板"
  879. },
  880. {
  881. id: 1,
  882. name: "导入 PIL 订舱模板"
  883. },
  884. {
  885. id: 2,
  886. name: "导入截单格式"
  887. },
  888. {
  889. id: 3,
  890. name: "导入海信提单"
  891. }
  892. ],
  893. excelForm: {},
  894. excelLoading: false,
  895. excelOption: {
  896. submitBtn: false,
  897. emptyBtn: false,
  898. column: [
  899. {
  900. label: "模板上传",
  901. prop: "excelFile",
  902. type: "upload",
  903. drag: true,
  904. loadText: "模板上传中,请稍等",
  905. span: 24,
  906. propsHttp: {
  907. res: "data"
  908. },
  909. tip: "请上传 .xls,.xlsx 标准格式文件",
  910. action: "api/blade-los/templateImport/importOne"
  911. }
  912. ]
  913. },
  914. excelBox: false,
  915. saberTenantId: 0,
  916. isHq: null
  917. };
  918. },
  919. watch: {
  920. // 监听业务类型 如果不是分单 可以编辑分单号
  921. "form.billType": {
  922. // 执行方法
  923. handler(oldValue, newValue) {
  924. if (oldValue == "MH" || oldValue == "MM") {
  925. this.basicData.column.forEach(item => {
  926. if (item.prop == "bookingNo") {
  927. item.display = false;
  928. }
  929. if (item.prop == "hblno") {
  930. item.display = true;
  931. }
  932. });
  933. } else {
  934. this.basicData.column.forEach(item => {
  935. if (item.prop == "bookingNo") {
  936. item.display = false;
  937. }
  938. if (item.prop == "hblno") {
  939. item.display = true;
  940. }
  941. });
  942. }
  943. // 只有分单不能编辑
  944. // if (oldValue == 'MH') {
  945. // this.columnforfun('hblno').disabled = true
  946. // } else {
  947. // this.columnforfun('hblno').disabled = false
  948. // }
  949. // 王风刚 2025-02-21 所有分单号都不能手动输入,都可以申请
  950. },
  951. deep: true, // 深度监听
  952. immediate: true // 第一次改变就执行
  953. },
  954. // 监听箱信息数据 箱信息中有温度 自动切换 冻货
  955. "form.preContainersList": {
  956. // 执行方法
  957. handler(oldValue, newValue) {
  958. // 判断是否是数组
  959. if (oldValue instanceof Array) {
  960. // 循环 有温度反 true 没有反 false
  961. const arr = oldValue.map(item => {
  962. if (Number(item.temperature)) {
  963. return true;
  964. } else {
  965. return false;
  966. }
  967. });
  968. console.log(arr, 12345);
  969. // 判断是否有温度
  970. if (arr[0]) {
  971. // 判断之前是否是冻货
  972. if (this.form.cargoType == "reefer") return;
  973. this.$message({
  974. message: "箱信息里有温度已将货描切换为冻柜",
  975. type: "warning"
  976. });
  977. this.$set(this.form, "cargoType", "reefer");
  978. }
  979. }
  980. },
  981. deep: true, // 深度监听
  982. immediate: true // 第一次改变就执行,
  983. }
  984. },
  985. created() {
  986. let Obj = JSON.parse(localStorage.getItem("saber-tenantId"));
  987. this.saberTenantId = Obj ? Obj.content : 0;
  988. this.saberUserInfo = JSON.parse(
  989. localStorage.getItem("saber-userInfo")
  990. ).content;
  991. this.isHq = JSON.parse(localStorage.getItem('user-Information')).isHq
  992. this.roleName = localStorage.getItem("roleName").split(",");
  993. isProcurement({
  994. param: "verify.symbol"
  995. }).then(res => {
  996. this.verifySymbolStatus = res.data.data;
  997. });
  998. if (this.detailData.billType) {
  999. this.form.billType = this.detailData.billType;
  1000. }
  1001. // 判断是否员id, 有id 就不显示
  1002. if (!this.form.id) {
  1003. this.deptGetDetailPolfun(); // 收货地 装货港 当前登录人的默认
  1004. this.userGetListfun(undefined, true); // 获取用户管理数据
  1005. }
  1006. this.ownDeptLazyTreefun(); // 获取公司数据
  1007. this.getLazylistfun(); // 获取审核数据
  1008. this.mpaymodeWorkDictsfun(); // 获取 付款方式字典
  1009. this.srcTypeWorkDictsfun();
  1010. // 获取EDI 数据
  1011. this.editypesListfun();
  1012. // 获取所属团队数据
  1013. this.postSelectByUserfun();
  1014. },
  1015. methods: {
  1016. inLock() {
  1017. this.showLock = true;
  1018. const data = {
  1019. moduleName: "SI",
  1020. tableName: "SI_order",
  1021. billId: this.form.id,
  1022. no: localStorage.getItem("browserID"),
  1023. billNo: this.form.mblno
  1024. };
  1025. this.inDetailsKey(this.$route.name, {
  1026. moduleName: "SI",
  1027. tableName: "SI_order",
  1028. billId: this.form.id,
  1029. billNo: this.form.mblno
  1030. });
  1031. this.checkLock(data).then(res => {
  1032. if (res.data.code == 200) {
  1033. this.onLock(data).then(res => {
  1034. if (res.data.code == 200) {
  1035. this.showLock = false;
  1036. }
  1037. });
  1038. }
  1039. });
  1040. },
  1041. lastPage() {
  1042. if (this.pageIds.length) {
  1043. const index = this.pageIds.indexOf(this.form.id)
  1044. if (index == 0) {
  1045. return this.$message.error('没有上一票了');
  1046. }
  1047. if (this.form.id) {
  1048. this.unLock({
  1049. moduleName: "SI",
  1050. tableName: "SI_order",
  1051. billId: this.form.id,
  1052. billNo: this.form.mblno
  1053. });
  1054. }
  1055. const lastIndex = index - 1
  1056. this.pageLoading = true
  1057. this.billsDetailfun(this.pageIds[lastIndex])
  1058. }
  1059. },
  1060. nextPage() {
  1061. if (this.pageIds.length) {
  1062. const index = this.pageIds.indexOf(this.form.id)
  1063. if (this.pageIds[this.pageIds.length - 1] == this.form.id) {
  1064. return this.$message.error('没有下一票了');
  1065. }
  1066. if (this.form.id) {
  1067. this.unLock({
  1068. moduleName: "SI",
  1069. tableName: "SI_order",
  1070. billId: this.form.id,
  1071. billNo: this.form.mblno
  1072. });
  1073. }
  1074. const nextIndex = index + 1
  1075. this.pageLoading = true
  1076. this.billsDetailfun(this.pageIds[nextIndex])
  1077. }
  1078. },
  1079. addEdit() {
  1080. if (this.form.billStatus >= 3) {
  1081. this.$emit("toAddEdit");
  1082. } else {
  1083. if (
  1084. contrastObj(this.form, this.oldForm) ||
  1085. contrastList(
  1086. this.form.preContainersList,
  1087. this.oldForm.preContainersList
  1088. ) ||
  1089. contrastList(
  1090. this.form.containersList,
  1091. this.oldForm.containersList
  1092. ) ||
  1093. contrastList(
  1094. this.form.feeCenterListC,
  1095. this.oldForm.feeCenterListC
  1096. ) ||
  1097. contrastList(
  1098. this.form.feeCenterListD,
  1099. this.oldForm.feeCenterListD
  1100. ) ||
  1101. contrastList(this.form.filesList, this.oldForm.filesList) ||
  1102. contrastList(
  1103. this.form.waitingBoxList,
  1104. this.oldForm.waitingBoxList
  1105. )
  1106. ) {
  1107. this.$confirm("是否需要保存?", "提示", {
  1108. confirmButtonText: "确定",
  1109. cancelButtonText: "取消",
  1110. type: "warning"
  1111. })
  1112. .then(() => {
  1113. this.editCustomer("toAddEdit");
  1114. })
  1115. .catch(() => {
  1116. this.$emit("toAddEdit");
  1117. });
  1118. } else {
  1119. this.$emit("toAddEdit");
  1120. }
  1121. }
  1122. },
  1123. CopyDocumentsfun() {
  1124. if (!this.form.id) {
  1125. return this.$message.error("请保存数据");
  1126. }
  1127. this.$DialogForm.show({
  1128. title: "复制单据",
  1129. width: "300px",
  1130. menuPosition: "right",
  1131. data: {
  1132. checkbox: "复制费用,复制箱型箱量"
  1133. },
  1134. option: {
  1135. submitText: "确认",
  1136. emptyText: "取消",
  1137. span: 24,
  1138. column: [
  1139. {
  1140. label: "单据类型",
  1141. prop: "billType",
  1142. type: "select",
  1143. value: this.form.billType,
  1144. dicData: [
  1145. {
  1146. label: '直单',
  1147. value: 'DD'
  1148. },
  1149. {
  1150. label: '主单',
  1151. value: 'MM'
  1152. },
  1153. {
  1154. label: '分单',
  1155. value: 'MH'
  1156. }
  1157. ],
  1158. dataType: "string",
  1159. span: 24
  1160. },
  1161. {
  1162. label: "复制类型",
  1163. prop: "checkbox",
  1164. type: "checkbox",
  1165. dicData: [
  1166. {
  1167. label: "复制费用",
  1168. value: "复制费用"
  1169. },
  1170. {
  1171. label: "复制箱型箱量",
  1172. value: "复制箱型箱量"
  1173. }
  1174. ],
  1175. dataType: "string",
  1176. span: 24
  1177. }
  1178. ]
  1179. },
  1180. beforeClose: done => {
  1181. done();
  1182. },
  1183. callback: res => {
  1184. res.done();
  1185. this.billsCopyBillsfun(
  1186. this.form.id,
  1187. res.data.checkbox,
  1188. res.data.billType
  1189. );
  1190. res.close();
  1191. }
  1192. });
  1193. },
  1194. //文档导入
  1195. importData(row) {
  1196. if (row == 0) {
  1197. this.excelOption.column[0].action = `/api/blade-los/templateImport/importOne?billId=${this.form.id}`;
  1198. } else if (row == 1) {
  1199. this.excelOption.column[0].action = `/api/blade-los/templateImport/importPilBooking?billId=${this.form.id}`;
  1200. } else if (row == 2) {
  1201. this.excelOption.column[0].action = `/api/blade-los/templateImport/importPilCutOffOrders?billId=${this.form.id}`;
  1202. } else if (row == 3) {
  1203. this.excelOption.column[0].action = `/api/blade-los/templateImport/importHisenseBill?billId=${this.form.id}`;
  1204. }
  1205. this.excelBox = true;
  1206. },
  1207. uploadBefore(file, done, loading) {
  1208. done();
  1209. loading = true;
  1210. },
  1211. removeEmptyValues(obj) {
  1212. Object.keys(obj).forEach(key => {
  1213. if (
  1214. obj[key] === null ||
  1215. obj[key] === undefined ||
  1216. obj[key] === ""
  1217. ) {
  1218. delete obj[key];
  1219. }
  1220. });
  1221. return obj;
  1222. },
  1223. // 上传成功
  1224. onSuccess(res, done, loading, column) {
  1225. if (Object.keys(res).length) {
  1226. this.$confirm("此操作将覆盖数据, 是否继续?", "提示", {
  1227. confirmButtonText: "确定",
  1228. cancelButtonText: "取消",
  1229. type: "warning"
  1230. })
  1231. .then(() => {
  1232. // this.form = res;
  1233. Object.keys(res).forEach(key => {
  1234. if (res[key]) {
  1235. if (key != "detail") {
  1236. // this.form[key] = res[key]
  1237. this.$set(this.form, key, res[key]);
  1238. }
  1239. if (key == "detail") {
  1240. Object.keys(res.detail).forEach(key => {
  1241. if (res.detail[key]) {
  1242. // this.form.detail[key] = res.detail[key]
  1243. this.$set(
  1244. this.form.detail,
  1245. key,
  1246. res.detail[key]
  1247. );
  1248. }
  1249. });
  1250. }
  1251. }
  1252. });
  1253. this.excelBox = false;
  1254. this.$message.success("导入成功!");
  1255. loading = false;
  1256. done();
  1257. })
  1258. .catch(() => {
  1259. this.excelBox = false;
  1260. loading = false;
  1261. done();
  1262. });
  1263. } else {
  1264. loading = false;
  1265. done();
  1266. }
  1267. },
  1268. allClick(name) {
  1269. if (name == '申请换单') {
  1270. if (this.form.feeCenterListD.length == 0) {
  1271. return this.$message.error("应收费用明细不能为空!");
  1272. }
  1273. for (let item of this.form.feeCenterListD) {
  1274. if (item.auditStatus != 4) {
  1275. return this.$message.error("应收费用明细存在未请核的数据!");
  1276. }
  1277. }
  1278. // this.$confirm("是否申请换单?", "提示", {
  1279. // confirmButtonText: "确定",
  1280. // cancelButtonText: "取消",
  1281. // type: "warning"
  1282. // }).then(() => {
  1283. // let obj = {
  1284. // id: this.form.id
  1285. // }
  1286. // applySwitch(obj).then(res => {
  1287. // this.$message({
  1288. // type: "success",
  1289. // message: "操作成功!"
  1290. // });
  1291. // this.billsDetailfun(this.form.id);
  1292. // });
  1293. // });
  1294. this.$DialogForm.show({
  1295. title: '收押箱款',
  1296. width: '30%',
  1297. menuPosition: 'right',
  1298. option: {
  1299. submitText: '确定',
  1300. emptyText: '取消',
  1301. // labelWidth: 130,
  1302. column: [{
  1303. label: "押箱金额",
  1304. span: 24,
  1305. prop: "boxPackingAmount",
  1306. type: 'number',
  1307. controls: false,
  1308. rules: [{
  1309. required: true,
  1310. message: "",
  1311. trigger: "blur",
  1312. }],
  1313. }
  1314. ]
  1315. },
  1316. beforeClose: (done) => {
  1317. done()
  1318. },
  1319. callback: (res) => {
  1320. res.done()
  1321. let obj = {
  1322. id: this.form.id,
  1323. ...res.data
  1324. }
  1325. applySwitch(obj).then(res => {
  1326. this.$message({
  1327. type: "success",
  1328. message: "操作成功!"
  1329. });
  1330. this.billsDetailfun(this.form.id);
  1331. });
  1332. res.close()
  1333. }
  1334. })
  1335. }
  1336. if (name == '撤销换单') {
  1337. this.$confirm("是否撤销换单?", "提示", {
  1338. confirmButtonText: "确定",
  1339. cancelButtonText: "取消",
  1340. type: "warning"
  1341. }).then(() => {
  1342. let obj = {
  1343. id: this.form.id
  1344. }
  1345. revokeSwitch(obj).then(res => {
  1346. this.$message({
  1347. type: "success",
  1348. message: "操作成功!"
  1349. });
  1350. this.billsDetailfun(this.form.id);
  1351. });
  1352. });
  1353. }
  1354. if (name == '电子提货单') {
  1355. this.$confirm("是否确认电子提货单?", "提示", {
  1356. confirmButtonText: "确定",
  1357. cancelButtonText: "取消",
  1358. type: "warning"
  1359. }).then(() => {
  1360. let obj = {
  1361. id: this.form.id
  1362. }
  1363. electronBillOfLading(obj).then(res => {
  1364. this.$message({
  1365. type: "success",
  1366. message: "操作成功!"
  1367. });
  1368. this.billsDetailfun(this.form.id);
  1369. });
  1370. });
  1371. }
  1372. if (name == '撤销电子提货单') {
  1373. this.$confirm("是否撤销电子提货单?", "提示", {
  1374. confirmButtonText: "确定",
  1375. cancelButtonText: "取消",
  1376. type: "warning"
  1377. }).then(() => {
  1378. let obj = {
  1379. id: this.form.id
  1380. }
  1381. revokeElectronBillOfLading(obj).then(res => {
  1382. this.$message({
  1383. type: "success",
  1384. message: "操作成功!"
  1385. });
  1386. this.billsDetailfun(this.form.id);
  1387. });
  1388. });
  1389. }
  1390. if (name == "接收") {
  1391. this.$confirm("是否接收?", "提示", {
  1392. confirmButtonText: "确定",
  1393. cancelButtonText: "取消",
  1394. type: "warning"
  1395. }).then(() => {
  1396. receive(this.form).then(res => {
  1397. this.$message({
  1398. type: "success",
  1399. message: "操作成功!"
  1400. });
  1401. this.billsDetailfun(this.form.id);
  1402. });
  1403. });
  1404. }
  1405. if (name == "撤销接收") {
  1406. this.$confirm("是否撤销接收?", "提示", {
  1407. confirmButtonText: "确定",
  1408. cancelButtonText: "取消",
  1409. type: "warning"
  1410. }).then(() => {
  1411. revokeReceive(this.form).then(res => {
  1412. this.$message({
  1413. type: "success",
  1414. message: "操作成功!"
  1415. });
  1416. this.logisticsDialog = false;
  1417. this.billsDetailfun(this.form.id);
  1418. });
  1419. });
  1420. }
  1421. // if (name == "换单") {
  1422. // this.$confirm("是否换单?", "提示", {
  1423. // confirmButtonText: "确定",
  1424. // cancelButtonText: "取消",
  1425. // type: "warning"
  1426. // }).then(() => {
  1427. // changeOrders(this.form).then(res => {
  1428. // this.$message({
  1429. // type: "success",
  1430. // message: "操作成功!"
  1431. // });
  1432. // this.billsDetailfun(this.form.id);
  1433. // });
  1434. // });
  1435. // }
  1436. // if (name == "撤销换单") {
  1437. // this.$confirm("是否撤销换单?", "提示", {
  1438. // confirmButtonText: "确定",
  1439. // cancelButtonText: "取消",
  1440. // type: "warning"
  1441. // }).then(() => {
  1442. // revokeChangeOrders(this.form).then(res => {
  1443. // this.$message({
  1444. // type: "success",
  1445. // message: "操作成功!"
  1446. // });
  1447. // this.logisticsDialog = false;
  1448. // this.billsDetailfun(this.form.id);
  1449. // });
  1450. // });
  1451. // }
  1452. if (name == "退押") {
  1453. this.$confirm("是否退押?", "提示", {
  1454. confirmButtonText: "确定",
  1455. cancelButtonText: "取消",
  1456. type: "warning"
  1457. }).then(() => {
  1458. returningSecurityMoney(this.form).then(res => {
  1459. this.$message({
  1460. type: "success",
  1461. message: "操作成功!"
  1462. });
  1463. this.billsDetailfun(this.form.id);
  1464. });
  1465. });
  1466. }
  1467. if (name == "撤销退押") {
  1468. this.$confirm("是否撤销退押?", "提示", {
  1469. confirmButtonText: "确定",
  1470. cancelButtonText: "取消",
  1471. type: "warning"
  1472. }).then(() => {
  1473. revokeReturningSecurityMoney(this.form).then(res => {
  1474. this.$message({
  1475. type: "success",
  1476. message: "操作成功!"
  1477. });
  1478. this.logisticsDialog = false;
  1479. this.billsDetailfun(this.form.id);
  1480. });
  1481. });
  1482. }
  1483. if (name == '同步分单信息') {
  1484. this.$confirm('是否同步分单信息?', '提示', {
  1485. confirmButtonText: '确定',
  1486. cancelButtonText: '取消',
  1487. type: 'warning'
  1488. }).then(() => {
  1489. synchronizeData({ billId: this.form.id }).then(res => {
  1490. this.$message({
  1491. type: "success",
  1492. message: "操作成功!"
  1493. })
  1494. this.billsDetailfun(this.form.id)
  1495. })
  1496. })
  1497. }
  1498. if (name == '提单确认') {
  1499. // this.$refs.
  1500. }
  1501. },
  1502. // 获取EDI列表数据
  1503. editypesListfun() {
  1504. editypesList(1, 1000).then(res => {
  1505. this.ediData = res.data.data.records;
  1506. this.ediData_SO = res.data.data.records.filter(
  1507. r => r.groupName == "SO"
  1508. );
  1509. this.ediData_SI = res.data.data.records.filter(
  1510. r => r.groupName == "SI"
  1511. );
  1512. });
  1513. },
  1514. // 发送edi
  1515. editypesSendingEdifun(row) {
  1516. row.billId = this.form.id;
  1517. let msgsList = [];
  1518. if (
  1519. checkFullWidthSymbols(this.form.detail.hshipperDetails)
  1520. .hasFullWidth
  1521. ) {
  1522. let msg = [];
  1523. for (let item of checkFullWidthSymbols(
  1524. this.form.detail.hshipperDetails
  1525. ).positions) {
  1526. msg.push(`第${item.row}行的"${item.symbol}"`);
  1527. }
  1528. this.$message({
  1529. dangerouslyUseHTMLString: true,
  1530. message: `发货人:<br>${msg.join(
  1531. ";<br>"
  1532. )}<br>存在全角或汉字符号,请确认`,
  1533. type: "error"
  1534. });
  1535. return;
  1536. }
  1537. if (
  1538. checkFullWidthSymbols(this.form.detail.hconsigneeDetails)
  1539. .hasFullWidth
  1540. ) {
  1541. let msg = [];
  1542. for (let item of checkFullWidthSymbols(
  1543. this.form.detail.hconsigneeDetails
  1544. ).positions) {
  1545. msg.push(`第${item.row}行的"${item.symbol}"`);
  1546. }
  1547. this.$message({
  1548. dangerouslyUseHTMLString: true,
  1549. message: `收货人:<br>${msg.join(
  1550. ";<br>"
  1551. )}<br>存在全角或汉字符号,请确认`,
  1552. type: "error"
  1553. });
  1554. return;
  1555. }
  1556. if (
  1557. checkFullWidthSymbols(this.form.detail.hnotifyDetails)
  1558. .hasFullWidth
  1559. ) {
  1560. let msg = [];
  1561. for (let item of checkFullWidthSymbols(
  1562. this.form.detail.hnotifyDetails
  1563. ).positions) {
  1564. msg.push(`第${item.row}行的"${item.symbol}"`);
  1565. }
  1566. this.$message({
  1567. dangerouslyUseHTMLString: true,
  1568. message: `通知人:<br>${msg.join(
  1569. ";<br>"
  1570. )}<br>存在全角或汉字符号,请确认`,
  1571. type: "error"
  1572. });
  1573. return;
  1574. }
  1575. if (
  1576. checkFullWidthSymbols(this.form.detail.mshipperDetails)
  1577. .hasFullWidth
  1578. ) {
  1579. let msg = [];
  1580. for (let item of checkFullWidthSymbols(
  1581. this.form.detail.mshipperDetails
  1582. ).positions) {
  1583. msg.push(`第${item.row}行的"${item.symbol}"`);
  1584. }
  1585. if (msg.length > 0) {
  1586. this.$message({
  1587. dangerouslyUseHTMLString: true,
  1588. message: `MBL 发货人:<br>${msg.join(
  1589. ";<br>"
  1590. )}<br>存在全角或汉字符号,请确认`,
  1591. type: "error"
  1592. });
  1593. return;
  1594. }
  1595. }
  1596. if (
  1597. checkFullWidthSymbols(this.form.detail.mconsigneeDetails)
  1598. .hasFullWidth
  1599. ) {
  1600. let msg = [];
  1601. for (let item of checkFullWidthSymbols(
  1602. this.form.detail.mconsigneeDetails
  1603. ).positions) {
  1604. msg.push(`第${item.row}行的"${item.symbol}"`);
  1605. }
  1606. if (msg.length > 0) {
  1607. this.$message({
  1608. dangerouslyUseHTMLString: true,
  1609. message: `MBL 收货人:<br>${msg.join(
  1610. ";<br>"
  1611. )}<br>存在全角或汉字符号,请确认`,
  1612. type: "error"
  1613. });
  1614. return;
  1615. }
  1616. }
  1617. if (
  1618. checkFullWidthSymbols(this.form.detail.mnotifyDetails)
  1619. .hasFullWidth
  1620. ) {
  1621. let msg = [];
  1622. for (let item of checkFullWidthSymbols(
  1623. this.form.detail.mnotifyDetails
  1624. ).positions) {
  1625. msg.push(`第${item.row}行的"${item.symbol}"`);
  1626. }
  1627. if (msg.length > 0) {
  1628. this.$message({
  1629. dangerouslyUseHTMLString: true,
  1630. message: `MBL 通知人:<br>${msg.join(
  1631. ";<br>"
  1632. )}<br>存在全角或汉字符号,请确认`,
  1633. type: "error"
  1634. });
  1635. return;
  1636. }
  1637. }
  1638. if (checkFullWidthSymbols(this.form.marks).hasFullWidth) {
  1639. let msg = [];
  1640. for (let item of checkFullWidthSymbols(this.form.marks)
  1641. .positions) {
  1642. msg.push(`第${item.row}行的"${item.symbol}"`);
  1643. }
  1644. this.$message({
  1645. dangerouslyUseHTMLString: true,
  1646. message: `唛头:<br>${msg.join(
  1647. ";<br>"
  1648. )}<br>存在全角或汉字符号,请确认`,
  1649. type: "error"
  1650. });
  1651. return;
  1652. }
  1653. if (checkFullWidthSymbols(this.form.commodityDescr).hasFullWidth) {
  1654. let msg = [];
  1655. for (let item of checkFullWidthSymbols(this.form.commodityDescr)
  1656. .positions) {
  1657. msg.push(`第${item.row}行的"${item.symbol}"`);
  1658. }
  1659. this.$message({
  1660. dangerouslyUseHTMLString: true,
  1661. message: `货描:<br>${msg.join(
  1662. ";<br>"
  1663. )}<br>存在全角或汉字符号,请确认`,
  1664. type: "error"
  1665. });
  1666. return;
  1667. }
  1668. if (checkFullWidthSymbols(this.form.forwarding).hasFullWidth) {
  1669. let msg = [];
  1670. for (let item of checkFullWidthSymbols(this.form.forwarding)
  1671. .positions) {
  1672. msg.push(`第${item.row}行的"${item.symbol}"`);
  1673. }
  1674. this.$message({
  1675. dangerouslyUseHTMLString: true,
  1676. message: `FORWARDING:<br>${msg.join(
  1677. ";<br>"
  1678. )}<br>存在全角或汉字符号,请确认`,
  1679. type: "error"
  1680. });
  1681. return;
  1682. }
  1683. if (!verifyEnglish(this.form.detail.hshipperDetails)) {
  1684. msgsList.push("发货人");
  1685. }
  1686. if (!verifyEnglish(this.form.detail.hconsigneeDetails)) {
  1687. msgsList.push("收货人");
  1688. }
  1689. if (!verifyEnglish(this.form.detail.hnotifyDetails)) {
  1690. msgsList.push("通知人");
  1691. }
  1692. if (!verifyEnglish(this.form.detail.mshipperDetails)) {
  1693. msgsList.push("MBL 发货人");
  1694. }
  1695. if (!verifyEnglish(this.form.detail.mconsigneeDetails)) {
  1696. msgsList.push("MBL 收货人");
  1697. }
  1698. if (!verifyEnglish(this.form.detail.mnotifyDetails)) {
  1699. msgsList.push("MBL 通知人");
  1700. }
  1701. if (!verifyEnglish(this.form.marks)) {
  1702. msgsList.push("唛头");
  1703. }
  1704. if (!verifyEnglish(this.form.commodityDescr)) {
  1705. msgsList.push("货描");
  1706. }
  1707. if (!verifyEnglish(this.form.forwarding)) {
  1708. msgsList.push("FORWARDING");
  1709. }
  1710. if (msgsList.length > 0) {
  1711. this.$message.error(`请正确输入${msgsList.join(",")}的英文`);
  1712. return;
  1713. }
  1714. this.saveLoading = true;
  1715. editypesSendingEdi(row)
  1716. .then(res => {
  1717. this.saveLoading = false;
  1718. // 判断data是否有值,没有值说明不成功给个弹窗返回
  1719. if (!res.data.data) {
  1720. let text = res.data.msg.replace("\r\n", "<br>");
  1721. console.log(text);
  1722. this.$message({
  1723. type: "warning",
  1724. dangerouslyUseHTMLString: true,
  1725. message: text,
  1726. // message: `<p>${text.slice(text.indexOf('非空'), text.indexOf('特殊字符'))}</p><p>${text.slice(text.indexOf('特殊字符'), text.indexOf('长度超长'))}</p><p>${text.slice(text.indexOf('长度超长'), text.indexOf('其他'))}</p><p>${text.slice(text.indexOf('其他'))}</p>`,
  1727. duration: 5000
  1728. });
  1729. } else {
  1730. this.$message.success("操作成功,请去文件中心查看");
  1731. this.billsDetailfun(this.form.id); // 详情接口
  1732. }
  1733. })
  1734. .catch(err => {
  1735. this.saveLoading = false;
  1736. });
  1737. },
  1738. // 报表弹窗
  1739. previewDialogfun() {
  1740. this.getReportTypeByBigHandle("业务");
  1741. this.previewDialog = true;
  1742. },
  1743. //请核关闭
  1744. choceScheduleFun() {
  1745. this.checkScheduleDialog = false;
  1746. },
  1747. // 收货地 装货港 当前登录人的默认
  1748. deptGetDetailPolfun() {
  1749. deptGetDetailPol(this.saberUserInfo.dept_pid.split(",")[0]).then(
  1750. res => {
  1751. this.form.placeReceiptName = res.data.data.polEnName
  1752. this.form.placeReceiptId = res.data.data.polId
  1753. this.form.placeReceiptCode = res.data.data.polCode
  1754. this.form.placeReceiptNamePrint = res.data.data.polEnName
  1755. this.form.polCnName = res.data.data.polCnName
  1756. this.form.polEnName = res.data.data.polEnName
  1757. this.form.polId = res.data.data.polId
  1758. this.form.polCode = res.data.data.polCode
  1759. this.form.polNamePrint = res.data.data.polEnName
  1760. // 签单地点 默认 装货港
  1761. this.$set(this.form, "issueAtId", this.form.polId);
  1762. this.$set(this.form, "issueAt", this.form.polEnName);
  1763. // 主单单付费地点 默认 如果主单付费方式 为PP 取装货港 如果主单付费地点为CC 取卸货港
  1764. if (this.form.mpaymode == "PP") {
  1765. this.$set(this.form, "mpayplace", this.form.polEnName);
  1766. }
  1767. // 分单单付费地点 默认 如果分单付费方式 为PP 取装货港 如果分单付费地点为CC 取卸货港
  1768. if (this.form.hpaymode == "PP") {
  1769. this.$set(this.form, "hpayplace", this.form.polEnName);
  1770. }
  1771. }
  1772. );
  1773. },
  1774. // 获取用户管理数据
  1775. userGetListfun(account = undefined, type = false) {
  1776. // userGetList(1, 10, { account }, this.saberUserInfo.dept_pid.split(',')[0]).then(res => {
  1777. // this.columnforfun('operatorName').dicData = res.data.data.records
  1778. // if (type) {
  1779. // // 核算部门 默认登录人的部门
  1780. // for (let item of this.columnforfun('operatorName').dicData) {
  1781. // if (item.name == this.form.operatorName) {
  1782. // this.$set(this.form, 'accDeptName', item.deptName)
  1783. // this.$set(this.form, 'accDept', item.deptId)
  1784. // this.$set(this.form, 'operatorDept', item.deptId.split(',').pop())
  1785. // this.$set(this.form, 'operatorDeptName', item.deptId)
  1786. // }
  1787. // }
  1788. // }
  1789. // })
  1790. },
  1791. // 获取所属岗位数据
  1792. postSelectByUserfun() {
  1793. postSelectByUser(
  1794. JSON.parse(localStorage.getItem("saber-userInfo")).content
  1795. .user_id
  1796. ).then(res => {
  1797. // this.columnforfun('teamName').dicData = res.data.data
  1798. // 判断是否有值,没有的话默认第一个
  1799. if (!this.form.teamName) {
  1800. this.$set(this.form, "teamId", res.data.data[0].id);
  1801. this.$set(this.form, "teamName", res.data.data[0].postName);
  1802. }
  1803. });
  1804. },
  1805. // 获取付款方式字典数据
  1806. mpaymodeWorkDictsfun() {
  1807. getWorkDicts("payment_method_los").then(res => {
  1808. this.columnforfun("mpaymode").dicData = res.data.data;
  1809. // this.columnforfun('hpaymode').dicData = res.data.data
  1810. });
  1811. },
  1812. // 获取核算部分数据 // 机构管理接口
  1813. getLazylistfun() {
  1814. // getDeptTree().then(res => {
  1815. // this.columnforfun('accDeptName').dicData = res.data.data
  1816. // })
  1817. },
  1818. // 获取客户名称数据 往来单位数据
  1819. getBcorpsListfun(cnName) {
  1820. getBcorpsList(1, 20, {
  1821. shortName: cnName,
  1822. status: 0
  1823. }).then(res => {
  1824. this.columnforfun("corpCnName").dicData = res.data.data.records;
  1825. });
  1826. },
  1827. // 获取客户联系人 客户OP
  1828. getBcorpsattnListfun(cname) {
  1829. // getBcorpsattnList(1, 10, { pid: this.form.corpId, cname }).then(res => {
  1830. // this.columnforfun('corpAttnName').dicData = res.data.data.records
  1831. // // if (res.data.data.records.length == 0) {
  1832. // // this.form.corpAttnName = ''
  1833. // // this.form.corpAttnId = ''
  1834. // // this.$set(this.form, 'corpAttnTel', '')
  1835. // // this.$set(this.form, 'corpAttnEmail', '')
  1836. // // return
  1837. // // }
  1838. // // this.form.corpAttnName = res.data.data.records[0].cname
  1839. // // this.form.corpAttnId = res.data.data.records[0].id
  1840. // // this.$set(this.form, 'corpAttnTel', res.data.data.records[0].tel)
  1841. // // this.$set(this.form, 'corpAttnEmail', res.data.data.records[0].email)
  1842. // })
  1843. },
  1844. // 获取地点信息
  1845. getBlocationsListfun(cnName) {
  1846. // getBlocationsList(1, 10, { cnName }).then(res => {
  1847. // this.columnforfun('mPayplace').dicData = res.data.data.records
  1848. // })
  1849. },
  1850. // 获取业务来源数据
  1851. srcTypeWorkDictsfun() {
  1852. // getWorkDicts('src_type_los').then(res => {
  1853. // this.columnforfun('srcType').dicData = res.data.data
  1854. // })
  1855. },
  1856. // 获取业务来源代理数据
  1857. agentBcorpsListfun(cnName) {
  1858. // let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  1859. // getBcorpslistByType(1, 20, { cnName, status: 0, corpTypeName }).then(res => {
  1860. // this.columnforfun('srcCnName').dicData = res.data.data.records
  1861. // })
  1862. },
  1863. // 获取业务来源业务员数据
  1864. salesUserGetListfun(account) {
  1865. // if (this.$store.getters.userInfo.tenant_id === "263057") {
  1866. // userGetList(1, 10, { roleId: '业务员' }).then(res => {
  1867. // this.columnforfun('srcCnName').dicData = res.data.data.records
  1868. // })
  1869. // } else {
  1870. // selectListLos('业务员', account).then(res => {
  1871. // this.columnforfun('srcCnName').dicData = res.data.data
  1872. // })
  1873. // }
  1874. },
  1875. // 获取公司名称 用户管理左侧
  1876. ownDeptLazyTreefun() {
  1877. // getDeptLazyTree(0).then(res => {
  1878. // this.columnforfun('srcCnName').dicData = res.data.data
  1879. // // 来源 内容 默认登录人所属公司
  1880. // for (let item of this.columnforfun('srcCnName').dicData) {
  1881. // if (item.id == JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]) {
  1882. // this.$set(this.form, 'srcId', item.id)
  1883. // this.$set(this.form, 'srcCnName', item.title)
  1884. // this.$set(this.form, 'srcEnName', item.title)
  1885. // }
  1886. // }
  1887. // })
  1888. },
  1889. // 申请B/L NO
  1890. billsGetBillNofun() {
  1891. let billNoFormat = "";
  1892. if (this.form.cargoType == "dry") {
  1893. billNoFormat = "HYJK-PH";
  1894. } else if (this.form.cargoType == "danger") {
  1895. billNoFormat = "HYJK-WXP";
  1896. } else if (this.form.cargoType == "reefer") {
  1897. billNoFormat = "HYJK-DG";
  1898. }
  1899. billsGetBillNo({
  1900. businessTypeCode: "HYJK",
  1901. billNoFormat: billNoFormat
  1902. }).then(res => {
  1903. // this.columnforfun('hpaymode').disabled = false
  1904. this.$set(this.form, "hblno", res.data.data);
  1905. this.billsSubmitfun();
  1906. });
  1907. },
  1908. // 下拉多选弹窗的确认
  1909. eldialogConfirm(name) {
  1910. if (name == "bcorps") {
  1911. if (this.$refs.bcorps[0].isShow) {
  1912. console.log("列表确认");
  1913. this.form.corpCnName = this.$refs.bcorps[0].selectionList[0].cnName;
  1914. this.form.corpEnName = this.$refs.bcorps[0].selectionList[0].enName;
  1915. this.form.corpId = this.$refs.bcorps[0].selectionList[0].id;
  1916. this.form.corpCode = this.$refs.bcorps[0].selectionList[0].code;
  1917. this.form.corpSource = this.$refs.bcorps[0].selectionList[0].corpSource;
  1918. // 获取 客户op数据
  1919. this.getBcorpsattnListfun();
  1920. // 业务来源参数带出
  1921. this.$set(
  1922. this.form,
  1923. "srcType",
  1924. this.$refs.bcorps[0].selectionList[0].sourceType
  1925. );
  1926. this.$set(
  1927. this.form,
  1928. "srcId",
  1929. this.$refs.bcorps[0].selectionList[0].srcId
  1930. );
  1931. this.$set(
  1932. this.form,
  1933. "srcCnName",
  1934. this.$refs.bcorps[0].selectionList[0].srcCnName
  1935. );
  1936. this.$set(
  1937. this.form,
  1938. "srcEnName",
  1939. this.$refs.bcorps[0].selectionList[0].srcEnName
  1940. );
  1941. // this.columnforfun('srcType').disabled = false
  1942. // this.columnforfun('srcCnName').disabled = false
  1943. // 航线带出往来单位的优势航线
  1944. this.$set(
  1945. this.form,
  1946. "lineCnName",
  1947. this.$refs.bcorps[0].selectionList[0].advantageRoute
  1948. );
  1949. // 带出发货人数据
  1950. this.$set(
  1951. this.form.detail,
  1952. "hshipperId",
  1953. this.$refs.bcorps[0].selectionList[0].id
  1954. );
  1955. this.$set(
  1956. this.form.detail,
  1957. "hshipperCnName",
  1958. this.$refs.bcorps[0].selectionList[0].cnName
  1959. );
  1960. this.$set(
  1961. this.form.detail,
  1962. "hshipperEnName",
  1963. this.$refs.bcorps[0].selectionList[0].enName
  1964. );
  1965. this.$set(
  1966. this.form.detail,
  1967. "hshipperCode",
  1968. this.$refs.bcorps[0].selectionList[0].code
  1969. );
  1970. this.$set(
  1971. this.form.detail,
  1972. "hshipperDetails",
  1973. this.$refs.bcorps[0].selectionList[0].details
  1974. );
  1975. this.$set(
  1976. this.form.detail,
  1977. "hshipperCntyName",
  1978. this.$refs.bcorps[0].selectionList[0].cntyName
  1979. );
  1980. this.$set(
  1981. this.form.detail,
  1982. "hshipperCntyCode",
  1983. this.$refs.bcorps[0].selectionList[0].cntyCode
  1984. );
  1985. // this.columnforfun('corpAttnName').disabled = false
  1986. // this.columnforfun('corpAttnTel').disabled = false
  1987. // this.columnforfun('corpAttnEmail').disabled = false
  1988. } else {
  1989. console.log("详情确认");
  1990. console.log(this.$refs.bcorps, 962);
  1991. this.$refs.bcorps[0].$refs.detail.submitForm();
  1992. this.form.corpCnName = this.$refs.bcorps[0].$refs.detail.formData.cnName;
  1993. this.form.corpEnName = this.$refs.bcorps[0].$refs.detail.formData.enName;
  1994. this.form.corpId = this.$refs.bcorps[0].$refs.detail.formData.id;
  1995. this.form.corpCode = this.$refs.bcorps[0].$refs.detail.formData.code;
  1996. this.form.corpSource = this.$refs.bcorps[0].$refs.detail.formData.corpSource;
  1997. // 获取 客户op数据
  1998. this.getBcorpsattnListfun();
  1999. // 业务来源参数带出
  2000. this.$set(
  2001. this.form,
  2002. "srcType",
  2003. this.$refs.bcorps[0].$refs.detail.formData.sourceType
  2004. );
  2005. this.$set(
  2006. this.form,
  2007. "srcId",
  2008. this.$refs.bcorps[0].$refs.detail.formData.srcId
  2009. );
  2010. this.$set(
  2011. this.form,
  2012. "srcCnName",
  2013. this.$refs.bcorps[0].$refs.detail.formData.srcCnName
  2014. );
  2015. this.$set(
  2016. this.form,
  2017. "srcEnName",
  2018. this.$refs.bcorps[0].$refs.detail.formData.srcEnName
  2019. );
  2020. // this.columnforfun('srcType').disabled = false
  2021. // this.columnforfun('srcCnName').disabled = false
  2022. // 航线带出往来单位的优势航线
  2023. this.$set(
  2024. this.form,
  2025. "lineCnName",
  2026. this.$refs.bcorps[0].$refs.detail.formData
  2027. .advantageRoute
  2028. );
  2029. // 带出发货人数据
  2030. this.$set(
  2031. this.form.detail,
  2032. "hshipperId",
  2033. this.$refs.bcorps[0].$refs.detail.formData.id
  2034. );
  2035. this.$set(
  2036. this.form.detail,
  2037. "hshipperCnName",
  2038. this.$refs.bcorps[0].$refs.detail.formData.cnName
  2039. );
  2040. this.$set(
  2041. this.form.detail,
  2042. "hshipperEnName",
  2043. this.$refs.bcorps[0].$refs.detail.formData.enName
  2044. );
  2045. this.$set(
  2046. this.form.detail,
  2047. "hshipperCode",
  2048. this.$refs.bcorps[0].$refs.detail.formData.code
  2049. );
  2050. this.$set(
  2051. this.form.detail,
  2052. "hshipperDetails",
  2053. this.$refs.bcorps[0].$refs.detail.formData.details
  2054. );
  2055. this.$set(
  2056. this.form.detail,
  2057. "hshipperCntyName",
  2058. this.$refs.bcorps[0].$refs.detail.formData.cntyName
  2059. );
  2060. this.$set(
  2061. this.form.detail,
  2062. "hshipperCntyCode",
  2063. this.$refs.bcorps[0].$refs.detail.formData.cntyCode
  2064. );
  2065. // this.columnforfun('corpAttnName').disabled = false
  2066. // this.columnforfun('corpAttnTel').disabled = false
  2067. // this.columnforfun('corpAttnEmail').disabled = false
  2068. }
  2069. }
  2070. this.$refs.searchQueryRef[0].corpVisible = false;
  2071. },
  2072. // 下拉多选弹窗数据多选回调
  2073. eldialogMultipleChoice(list, name) {
  2074. if (name == "bcorps") {
  2075. let arr = [];
  2076. if (list.length > 1) {
  2077. this.$refs.bcorps[0].$refs.crud.toggleSelection(); // 先清空所以选择的数据
  2078. arr = [list[list.length - 1]]; // 获取最新点击的数组
  2079. this.$refs.bcorps[0].$refs.crud.toggleSelection(arr, true); // 把刚点击的数组变成选择状态
  2080. } else {
  2081. arr = list;
  2082. }
  2083. this.$refs.bcorps[0].selectionList = arr;
  2084. }
  2085. },
  2086. /* 远程模糊查询操作用户 */
  2087. remoteMethod(value, name) {
  2088. // if (name == 'operatorName') {
  2089. // this.userGetListfun(value)
  2090. // }
  2091. // else if (name == 'accDeptName') {
  2092. // this.getLazylistfun(value)
  2093. // }
  2094. if (name == "corpCnName") {
  2095. this.getBcorpsListfun(value);
  2096. }
  2097. // else if (name == 'mPayplace') {
  2098. // this.getBlocationsListfun(value)
  2099. // }
  2100. // else if (name == 'corpAttnName') {
  2101. // this.getBcorpsattnListfun(value)
  2102. // }
  2103. // else if (name == 'srcType') {
  2104. // this.srcTypeWorkDictsfun()
  2105. // }
  2106. // else if (name == 'srcCnName') {
  2107. // if (this.form.srcType == 'SALES') {
  2108. // // 业务员
  2109. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'name', value: 'name' }
  2110. // this.salesUserGetListfun(value)
  2111. // } else if (this.form.srcType == 'AGENT') {
  2112. // // 代理
  2113. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  2114. // this.agentBcorpsListfun(value)
  2115. // } else if (this.form.srcType == 'OWN') {
  2116. // // 公司
  2117. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'title', value: 'title' }
  2118. // this.ownDeptLazyTreefun()
  2119. // }
  2120. // } else if (name == 'teamName') {
  2121. // this.postSelectByUserfun()
  2122. // }
  2123. },
  2124. // 下拉的监听事件
  2125. corpChange(value, name) {
  2126. // if (name == 'operatorName') {
  2127. // // OP 下拉赋值 用户管理列表
  2128. // for (let item of this.columnforfun('operatorName').dicData) {
  2129. // if (item.name == value) {
  2130. // this.form.operatorName = item.name
  2131. // this.form.operatorId = item.id
  2132. // this.form.operatorDept = item.deptId.split(',').pop()
  2133. // this.form.operatorDeptName = item.deptName
  2134. // }
  2135. // }
  2136. // }
  2137. // else if (name == 'accDeptName') {
  2138. // // OP 下拉赋值 用户管理列表
  2139. // for (let item of this.columnforfun('accDeptName').dicData) {
  2140. // if (item.title == value) {
  2141. // this.form.accDeptName = item.title
  2142. // this.form.accDept = item.id
  2143. // }
  2144. // }
  2145. // }
  2146. if (name == "corpCnName") {
  2147. if (value) {
  2148. // this.columnforfun('corpAttnName').disabled = false
  2149. // this.columnforfun('corpAttnTel').disabled = false
  2150. // this.columnforfun('corpAttnEmail').disabled = false
  2151. } else {
  2152. // this.columnforfun('corpAttnName').disabled = true
  2153. // this.columnforfun('corpAttnTel').disabled = true
  2154. // this.columnforfun('corpAttnEmail').disabled = true
  2155. // 如果点击清空按钮把值赋值为空
  2156. this.form.corpCnName = "";
  2157. this.form.corpEnName = "";
  2158. this.form.corpId = "";
  2159. this.form.corpCode = "";
  2160. this.form.shortName = "";
  2161. this.form.corpSource = "";
  2162. // 清空 客户OP
  2163. // this.form.corpAttnName = ''
  2164. this.form.corpAttnId = "";
  2165. this.$set(this.form, "corpAttnTel", "");
  2166. this.$set(this.form, "corpAttnEmail", "");
  2167. // 清空 业务来源和来源详情
  2168. this.$set(this.form, "srcType", "");
  2169. this.$set(this.form, "srcId", "");
  2170. this.$set(this.form, "srcCnName", "");
  2171. this.$set(this.form, "srcEnName", "");
  2172. }
  2173. // 往来单位
  2174. for (let item of this.columnforfun("corpCnName").dicData) {
  2175. if (item.cnName == value) {
  2176. this.form.corpCnName = item.cnName;
  2177. this.form.corpEnName = item.enName;
  2178. this.form.corpId = item.id;
  2179. this.form.corpCode = item.code;
  2180. this.form.shortName = item.shortName;
  2181. this.form.corpSource = item.corpSource;
  2182. // 获取 客户op数据
  2183. this.getBcorpsattnListfun();
  2184. // 业务来源参数带出
  2185. this.$set(this.form, "srcType", item.sourceType);
  2186. this.$set(this.form, "srcId", item.srcId);
  2187. this.$set(this.form, "srcCnName", item.srcCnName);
  2188. this.$set(this.form, "srcEnName", item.srcEnName);
  2189. this.$set(
  2190. this.form,
  2191. "srcDeptId",
  2192. item.deptId.split(",").pop()
  2193. );
  2194. this.$set(this.form, "srcDeptName", item.deptName);
  2195. this.columnforfun("srcType").disabled = false;
  2196. this.columnforfun("srcCnName").disabled = false;
  2197. // 航线带出往来单位的优势航线
  2198. this.$set(this.form, "lineCnName", item.advantageRoute);
  2199. // 带出发货人数据
  2200. // this.$set(this.form,'hshipperId',item.id)
  2201. // this.$set(this.form,'hshipperCnName',item.cnName)
  2202. // this.$set(this.form,'hshipperEnName',item.enName)
  2203. // this.$set(this.form,'hshipperCode',item.code)
  2204. // this.$set(this.form,'hshipperDetails',item.details)
  2205. // this.$set(this.form,'hshipperCntyName',item.cntyName)
  2206. // this.$set(this.form,'hshipperCntyCode',item.cntyCode)
  2207. }
  2208. }
  2209. }
  2210. // else if (name == 'corpAttnName') {
  2211. // if (this.columnforfun('corpAttnName').dicData.length) {
  2212. // for (let item of this.columnforfun('corpAttnName').dicData) {
  2213. // if (item.cname == value) {
  2214. // this.form.corpAttnName = item.cname
  2215. // this.form.corpAttnId = item.id
  2216. // this.$set(this.form, 'corpAttnTel', item.tel)
  2217. // this.$set(this.form, 'corpAttnEmail', item.email)
  2218. // }
  2219. // }
  2220. // } else {
  2221. // if (value) {
  2222. // this.form.corpAttnName = value
  2223. // this.form.corpAttnId = null
  2224. // }
  2225. // }
  2226. // }
  2227. // else if (name == 'srcType') {
  2228. // if (!value) {
  2229. // this.$set(this.form, 'srcType', '')
  2230. // // this.columnforfun('srcCnName').disabled = true
  2231. // return
  2232. // }
  2233. // this.$set(this.form, 'srcId', '')
  2234. // this.$set(this.form, 'srcCnName', '')
  2235. // this.$set(this.form, 'srcEnName', '')
  2236. // this.form[name] = value
  2237. // if (value == 'OWN') {
  2238. // // 公司
  2239. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'title', value: 'title' }
  2240. // this.ownDeptLazyTreefun()
  2241. // } else if (value == 'AGENT') {
  2242. // // 代理
  2243. // this.columnforfun('srcCnName').type = 'select'
  2244. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  2245. // this.columnforfun('srcCnName').disabled = false
  2246. // this.agentBcorpsListfun()
  2247. // } else if (value == 'SALES') {
  2248. // // 业务员
  2249. // this.columnforfun('srcCnName').type = 'select'
  2250. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'name', value: 'name' }
  2251. // this.columnforfun('srcCnName').disabled = false
  2252. // this.salesUserGetListfun()
  2253. // }
  2254. // }
  2255. // else if (name == 'srcCnName') {
  2256. // for (let item of this.columnforfun('srcCnName').dicData) {
  2257. // if (item[this.columnforfun('srcCnName').forParameter.value] == value) {
  2258. // if (this.form.srcType == 'SALES') {
  2259. // // 业务员
  2260. // this.$set(this.form, 'srcId', item.id)
  2261. // this.$set(this.form, 'srcCnName', item.name)
  2262. // this.$set(this.form, 'srcEnName', item.name)
  2263. // this.$set(this.form, 'srcDeptId', item.deptId.split(',').pop())
  2264. // this.$set(this.form, 'srcDeptName', item.deptName)
  2265. // } else if (this.form.srcType == 'AGENT') {
  2266. // // 代理
  2267. // this.$set(this.form, 'srcId', item.id)
  2268. // this.$set(this.form, 'srcCnName', item.cnName)
  2269. // this.$set(this.form, 'srcEnName', item.enName)
  2270. // }
  2271. // }
  2272. // }
  2273. // }
  2274. // else if (name == 'coloaderCnName') {
  2275. // for (let item of this.columnforfun('coloaderCnName').dicData) {
  2276. // if (item.cnName == value) {
  2277. // this.$set(this.form, 'coloaderId', item.id)
  2278. // this.$set(this.form, 'coloaderCnName', item.cnName)
  2279. // this.$set(this.form, 'coloaderEnName', item.enName)
  2280. // }
  2281. // }
  2282. // }
  2283. else if (name == "mpaymode") {
  2284. // 主单付费方式
  2285. this.form[name] = value;
  2286. if (value == "PP") {
  2287. this.$set(
  2288. this.form,
  2289. "mpayplace",
  2290. this.form.polEnName
  2291. ? this.form.polEnName.split(" - ")[0]
  2292. : ""
  2293. );
  2294. } else {
  2295. this.$set(
  2296. this.form,
  2297. "mpayplace",
  2298. this.form.podEnName
  2299. ? this.form.podEnName.split(" - ")[0]
  2300. : ""
  2301. );
  2302. }
  2303. }
  2304. // else if (name == 'hpaymode') {
  2305. // // 分单付费方式
  2306. // this.form[name] = value
  2307. // if (value == 'PP') {
  2308. // this.$set(this.form, 'hpayplace', this.form.polEnName.split(' - ')[0])
  2309. // } else {
  2310. // this.$set(this.form, 'hpayplace', this.form.podEnName.split(' - ')[0])
  2311. // }
  2312. // }
  2313. // else if (name == 'teamName') {
  2314. // if (!value) {
  2315. // this.$set(this.form, 'teamId', '')
  2316. // this.$set(this.form, 'teamName', '')
  2317. // }
  2318. // for (let item of this.columnforfun('teamName').dicData) {
  2319. // if (item.id == value) {
  2320. // this.$set(this.form, 'teamId', item.id)
  2321. // this.$set(this.form, 'teamName', item.postName)
  2322. // }
  2323. // }
  2324. // }
  2325. else {
  2326. this.form[name] = value;
  2327. }
  2328. },
  2329. // 申请B/L NO
  2330. applyforfun(text) {
  2331. if (!this.form.id) {
  2332. this.$message({
  2333. message: "请先保存数据",
  2334. type: "warning"
  2335. });
  2336. return;
  2337. }
  2338. // 如果不是分单
  2339. // 王风刚 2025-02-21 所有分单号都不能手动输入,都可以申请
  2340. // if (this.form.billType != 'MH') {
  2341. // this.$message({
  2342. // message: '只有分单需要申请',
  2343. // type: 'warning'
  2344. // });
  2345. // return
  2346. // }
  2347. if (!this.form.businessType) {
  2348. this.$message({
  2349. message: "请先选择业务类型",
  2350. type: "warning"
  2351. });
  2352. return;
  2353. }
  2354. if (!this.form.corpCnName) {
  2355. this.$message({
  2356. message: "请先选择客户名称",
  2357. type: "warning"
  2358. });
  2359. return;
  2360. }
  2361. if (this.form.hblno) {
  2362. this.$confirm(`确定删除${text}?`, {
  2363. confirmButtonText: "确定",
  2364. cancelButtonText: "取消",
  2365. type: "warning"
  2366. }).then(res => {
  2367. removeHblNo({
  2368. id: this.form.id
  2369. }).then(res => {
  2370. this.form.hblno = null;
  2371. this.billsSubmitfun();
  2372. });
  2373. });
  2374. } else {
  2375. if (!this.form.hblno) {
  2376. // 王风刚 2025-02-21 无需弹窗,直接申请分单号
  2377. // this.$confirm(`确定${text}?`, {
  2378. // confirmButtonText: "确定",
  2379. // cancelButtonText: "取消",
  2380. // type: "warning"
  2381. // }).then(res => {
  2382. // this.billsGetBillNofun()
  2383. // })
  2384. this.billsGetBillNofun();
  2385. }
  2386. }
  2387. },
  2388. // 配置项
  2389. columnforfun(value) {
  2390. for (let item of this.basicData.column) {
  2391. if (item instanceof Array) {
  2392. for (let ite of item) {
  2393. if (value == ite.prop) {
  2394. return ite;
  2395. }
  2396. }
  2397. } else {
  2398. if (value == item.prop) {
  2399. return item;
  2400. }
  2401. }
  2402. }
  2403. },
  2404. //返回列表
  2405. backToList() {
  2406. if (
  2407. contrastObj(this.form, this.oldForm) ||
  2408. contrastList(
  2409. this.form.preContainersList,
  2410. this.oldForm.preContainersList
  2411. ) ||
  2412. contrastList(
  2413. this.form.containersList,
  2414. this.oldForm.containersList
  2415. ) ||
  2416. contrastList(
  2417. this.form.feeCenterListC,
  2418. this.oldForm.feeCenterListC
  2419. ) ||
  2420. contrastList(
  2421. this.form.feeCenterListD,
  2422. this.oldForm.feeCenterListD
  2423. ) ||
  2424. contrastList(this.form.filesList, this.oldForm.filesList) ||
  2425. contrastList(
  2426. this.form.waitingBoxList,
  2427. this.oldForm.waitingBoxList
  2428. )
  2429. ) {
  2430. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  2431. confirmButtonText: "确定",
  2432. cancelButtonText: "取消",
  2433. type: "warning"
  2434. })
  2435. .then(() => {
  2436. this.editCustomer("goBack");
  2437. })
  2438. .catch(() => {
  2439. if (this.form.id) {
  2440. this.unLock({
  2441. moduleName: "SI",
  2442. tableName: "SI_order",
  2443. billId: this.form.id,
  2444. billNo: this.form.mblno
  2445. });
  2446. }
  2447. this.$emit("goBack");
  2448. });
  2449. } else {
  2450. if (this.form.id) {
  2451. this.unLock({
  2452. moduleName: "SI",
  2453. tableName: "SI_order",
  2454. billId: this.form.id,
  2455. billNo: this.form.mblno
  2456. });
  2457. }
  2458. this.$emit("goBack");
  2459. }
  2460. },
  2461. // 单据请核
  2462. DocumentApproval() {
  2463. if (this.form.billType == "MH") {
  2464. this.$message.warning("分单不能提交请核");
  2465. return;
  2466. }
  2467. if (popupReminder(this.form, this.messageData)) {
  2468. this.$confirm(popupReminder(this.form, this.messageData), {
  2469. confirmButtonText: "确定",
  2470. cancelButtonText: "取消",
  2471. type: "warning"
  2472. });
  2473. }
  2474. if (popupReminder(this.form, this.messageData)) {
  2475. return;
  2476. }
  2477. if (this.form.billType == 'DD') {
  2478. if (this.form.feeCenterListC.length == 0 && this.form.feeCenterListD == 0) {
  2479. return this.$message.warning('请添加费用信息')
  2480. }
  2481. return
  2482. }
  2483. this.$confirm("确定要请核数据?", {
  2484. confirmButtonText: "确定",
  2485. cancelButtonText: "取消",
  2486. type: "warning"
  2487. }).then(() => {
  2488. this.pageLoading = true;
  2489. billsCheckBills({
  2490. id: this.form.id,
  2491. url: "/iosBasicData/OceanFreightImport/bills/approvalDetails",
  2492. pageStatus: "this.$store.getters.approvalDetails",
  2493. pageLabel: "审批详情(F)"
  2494. })
  2495. .then(res => {
  2496. this.pageLoading = false;
  2497. this.$message({
  2498. type: "success",
  2499. message: "操作成功!"
  2500. });
  2501. // 详情
  2502. this.billsDetailfun(this.form.id);
  2503. })
  2504. .catch(() => {
  2505. this.pageLoading = false;
  2506. });
  2507. });
  2508. },
  2509. // 撤销单据请核
  2510. revokeDocumentApproval() {
  2511. this.$confirm("确定要撤销请核数据?", {
  2512. confirmButtonText: "确定",
  2513. cancelButtonText: "取消",
  2514. type: "warning"
  2515. }).then(() => {
  2516. this.pageLoading = true;
  2517. billsRevokeCheckBills({
  2518. id: this.form.id
  2519. }).then(res => {
  2520. this.pageLoading = false;
  2521. this.$message({
  2522. type: "success",
  2523. message: "操作成功!"
  2524. });
  2525. // 详情
  2526. this.billsDetailfun(this.form.id);
  2527. });
  2528. });
  2529. },
  2530. //撤销锁单
  2531. revokeLockOrder() {
  2532. this.$confirm("是否撤销锁单?", {
  2533. confirmButtonText: "确定",
  2534. cancelButtonText: "取消",
  2535. type: "warning"
  2536. }).then(() => {
  2537. this.pageLoading = true;
  2538. revokeLockOrder({
  2539. id: this.form.id
  2540. }).then(res => {
  2541. this.pageLoading = false;
  2542. this.$message({
  2543. type: "success",
  2544. message: "操作成功!"
  2545. });
  2546. // 详情
  2547. this.billsDetailfun(this.form.id);
  2548. });
  2549. });
  2550. },
  2551. // 编辑按钮
  2552. editHandle() {
  2553. this.detailData.seeDisabled = false;
  2554. },
  2555. //去除文本框的空格
  2556. getTextTirim(data) {
  2557. if (data) {
  2558. let obj = data.split("\n");
  2559. let res = [];
  2560. obj.forEach(item => {
  2561. res.push(_.trimEnd(item));
  2562. });
  2563. return res.join("\n");
  2564. } else {
  2565. return null;
  2566. }
  2567. },
  2568. // 大保存按钮
  2569. editCustomer(status) {
  2570. this.$refs.form.validate(valid => {
  2571. if (valid) {
  2572. // 判断必填项
  2573. let msgs = [];
  2574. if (!this.form.cargoType) {
  2575. msgs.push('货描')
  2576. }
  2577. if (!this.form.actualEta) {
  2578. msgs.push("ATA");
  2579. }
  2580. if (!this.form.eta) {
  2581. msgs.push("ETA");
  2582. }
  2583. if (!this.form.quantity) {
  2584. msgs.push("件数");
  2585. }
  2586. if (!this.form.packingUnit) {
  2587. msgs.push("包装");
  2588. }
  2589. if (!this.form.grossWeight) {
  2590. msgs.push("毛重");
  2591. }
  2592. if (!this.form.measurement) {
  2593. msgs.push("尺码");
  2594. }
  2595. if (!this.form.srcType || !this.form.srcCnName) {
  2596. msgs.push('业务来源')
  2597. }
  2598. // if (!this.form.etd) {
  2599. // msgs.push('ETD')
  2600. // }
  2601. // if (!this.form.teamName) {
  2602. // msgs.push('所属团队')
  2603. // }
  2604. for (let item of this.form.preContainersList) {
  2605. if (!item.cntrTypeCode) {
  2606. this.$message.warning("请选择尺码箱型");
  2607. return;
  2608. }
  2609. if (!item.quantity) {
  2610. this.$message.warning("请输入箱量");
  2611. return;
  2612. }
  2613. }
  2614. for (let item of this.form.feeCenterListD) {
  2615. if (!item.corpId || !item.feeId || !item.curCode) {
  2616. msgs.push(
  2617. `应收第${item.$index + 1}行${!item.corpId ? " 往来单位" : ""
  2618. }${!item.feeId ? " 费用简称" : ""}${!item.curCode ? " 币种" : ""
  2619. }`
  2620. );
  2621. }
  2622. }
  2623. for (let item of this.form.feeCenterListC) {
  2624. if (!item.corpId || !item.feeId || !item.curCode) {
  2625. msgs.push(
  2626. `应付第${item.$index + 1}行${!item.corpId ? " 往来单位" : ""
  2627. }${!item.feeId ? " 费用简称" : ""}${!item.curCode ? " 币种" : ""
  2628. }`
  2629. );
  2630. }
  2631. }
  2632. if (msgs.length > 0) {
  2633. this.$confirm(`请填写下列信息:${msgs.join(" ,")}!`, {
  2634. confirmButtonText: "确定",
  2635. cancelButtonText: "取消",
  2636. type: "warning"
  2637. });
  2638. return;
  2639. }
  2640. if (this.verifySymbolStatus == 1) {
  2641. let msgsList = [];
  2642. if (
  2643. checkFullWidthSymbols(
  2644. this.form.detail.hshipperDetails
  2645. ).hasFullWidth
  2646. ) {
  2647. let msg = [];
  2648. for (let item of checkFullWidthSymbols(
  2649. this.form.detail.hshipperDetails
  2650. ).positions) {
  2651. msg.push(`第${item.row}行的"${item.symbol}"`);
  2652. }
  2653. if (msg.length > 0) {
  2654. this.$message({
  2655. dangerouslyUseHTMLString: true,
  2656. message: `发货人:<br>${msg.join(
  2657. ";<br>"
  2658. )}<br>存在全角或汉字符号,请确认`,
  2659. type: "error"
  2660. });
  2661. return;
  2662. }
  2663. }
  2664. if (
  2665. checkFullWidthSymbols(
  2666. this.form.detail.hconsigneeDetails
  2667. ).hasFullWidth
  2668. ) {
  2669. let msg = [];
  2670. for (let item of checkFullWidthSymbols(
  2671. this.form.detail.hconsigneeDetails
  2672. ).positions) {
  2673. msg.push(`第${item.row}行的"${item.symbol}"`);
  2674. }
  2675. if (msg.length > 0) {
  2676. this.$message({
  2677. dangerouslyUseHTMLString: true,
  2678. message: `收货人:<br>${msg.join(
  2679. ";<br>"
  2680. )}<br>存在全角或汉字符号,请确认`,
  2681. type: "error"
  2682. });
  2683. return;
  2684. }
  2685. }
  2686. if (
  2687. checkFullWidthSymbols(
  2688. this.form.detail.hnotifyDetails
  2689. ).hasFullWidth
  2690. ) {
  2691. let msg = [];
  2692. for (let item of checkFullWidthSymbols(
  2693. this.form.detail.hnotifyDetails
  2694. ).positions) {
  2695. msg.push(`第${item.row}行的"${item.symbol}"`);
  2696. }
  2697. if (msg.length > 0) {
  2698. this.$message({
  2699. dangerouslyUseHTMLString: true,
  2700. message: `通知人:<br>${msg.join(
  2701. ";<br>"
  2702. )}<br>存在全角或汉字符号,请确认`,
  2703. type: "error"
  2704. });
  2705. return;
  2706. }
  2707. }
  2708. if (
  2709. checkFullWidthSymbols(
  2710. this.form.detail.mshipperDetails
  2711. ).hasFullWidth
  2712. ) {
  2713. let msg = [];
  2714. for (let item of checkFullWidthSymbols(
  2715. this.form.detail.mshipperDetails
  2716. ).positions) {
  2717. msg.push(`第${item.row}行的"${item.symbol}"`);
  2718. }
  2719. if (msg.length > 0) {
  2720. this.$message({
  2721. dangerouslyUseHTMLString: true,
  2722. message: `MBL 发货人:<br>${msg.join(
  2723. ";<br>"
  2724. )}<br>存在全角或汉字符号,请确认`,
  2725. type: "error"
  2726. });
  2727. return;
  2728. }
  2729. }
  2730. if (
  2731. checkFullWidthSymbols(
  2732. this.form.detail.mconsigneeDetails
  2733. ).hasFullWidth
  2734. ) {
  2735. let msg = [];
  2736. for (let item of checkFullWidthSymbols(
  2737. this.form.detail.mconsigneeDetails
  2738. ).positions) {
  2739. msg.push(`第${item.row}行的"${item.symbol}"`);
  2740. }
  2741. if (msg.length > 0) {
  2742. this.$message({
  2743. dangerouslyUseHTMLString: true,
  2744. message: `MBL 收货人:<br>${msg.join(
  2745. ";<br>"
  2746. )}<br>存在全角或汉字符号,请确认`,
  2747. type: "error"
  2748. });
  2749. return;
  2750. }
  2751. }
  2752. if (
  2753. checkFullWidthSymbols(
  2754. this.form.detail.mnotifyDetails
  2755. ).hasFullWidth
  2756. ) {
  2757. let msg = [];
  2758. for (let item of checkFullWidthSymbols(
  2759. this.form.detail.mnotifyDetails
  2760. ).positions) {
  2761. msg.push(`第${item.row}行的"${item.symbol}"`);
  2762. }
  2763. if (msg.length > 0) {
  2764. this.$message({
  2765. dangerouslyUseHTMLString: true,
  2766. message: `MBL 通知人:<br>${msg.join(
  2767. ";<br>"
  2768. )}<br>存在全角或汉字符号,请确认`,
  2769. type: "error"
  2770. });
  2771. return;
  2772. }
  2773. }
  2774. if (
  2775. checkFullWidthSymbols(this.form.marks).hasFullWidth
  2776. ) {
  2777. let msg = [];
  2778. for (let item of checkFullWidthSymbols(
  2779. this.form.marks
  2780. ).positions) {
  2781. msg.push(`第${item.row}行的"${item.symbol}"`);
  2782. }
  2783. if (msg.length > 0) {
  2784. this.$message({
  2785. dangerouslyUseHTMLString: true,
  2786. message: `唛头:<br>${msg.join(
  2787. ";<br>"
  2788. )}<br>存在全角或汉字符号,请确认`,
  2789. type: "error"
  2790. });
  2791. return;
  2792. }
  2793. }
  2794. if (
  2795. checkFullWidthSymbols(this.form.commodityDescr)
  2796. .hasFullWidth
  2797. ) {
  2798. let msg = [];
  2799. for (let item of checkFullWidthSymbols(
  2800. this.form.commodityDescr
  2801. ).positions) {
  2802. msg.push(`第${item.row}行的"${item.symbol}"`);
  2803. }
  2804. if (msg.length > 0) {
  2805. this.$message({
  2806. dangerouslyUseHTMLString: true,
  2807. message: `货描:<br>${msg.join(
  2808. ";<br>"
  2809. )}<br>存在全角或汉字符号,请确认`,
  2810. type: "error"
  2811. });
  2812. return;
  2813. }
  2814. }
  2815. if (
  2816. checkFullWidthSymbols(this.form.forwarding)
  2817. .hasFullWidth
  2818. ) {
  2819. let msg = [];
  2820. for (let item of checkFullWidthSymbols(
  2821. this.form.forwarding
  2822. ).positions) {
  2823. msg.push(`第${item.row}行的"${item.symbol}"`);
  2824. }
  2825. if (msg.length > 0) {
  2826. this.$message({
  2827. dangerouslyUseHTMLString: true,
  2828. message: `FORWARDING:<br>${msg.join(
  2829. ";<br>"
  2830. )}<br>存在全角或汉字符号,,请修正后再保存!`,
  2831. type: "error"
  2832. });
  2833. return;
  2834. }
  2835. }
  2836. console.log(this.form.detail);
  2837. if (!verifyEnglish(this.form.detail.hshipperDetails)) {
  2838. msgsList.push("发货人");
  2839. }
  2840. if (
  2841. !verifyEnglish(this.form.detail.hconsigneeDetails)
  2842. ) {
  2843. msgsList.push("收货人");
  2844. }
  2845. if (!verifyEnglish(this.form.detail.hnotifyDetails)) {
  2846. msgsList.push("通知人");
  2847. }
  2848. if (!verifyEnglish(this.form.detail.mshipperDetails)) {
  2849. msgsList.push("MBL 发货人");
  2850. }
  2851. if (
  2852. !verifyEnglish(this.form.detail.mconsigneeDetails)
  2853. ) {
  2854. msgsList.push("MBL 收货人");
  2855. }
  2856. if (!verifyEnglish(this.form.detail.mnotifyDetails)) {
  2857. msgsList.push("MBL 通知人");
  2858. }
  2859. if (!verifyEnglish(this.form.marks)) {
  2860. msgsList.push("唛头");
  2861. }
  2862. if (!verifyEnglish(this.form.commodityDescr)) {
  2863. msgsList.push("货描");
  2864. }
  2865. if (!verifyEnglish(this.form.forwarding)) {
  2866. msgsList.push("FORWARDING");
  2867. }
  2868. if (msgsList.length > 0) {
  2869. // this.$message.error(`请正确输入${msgsList.join(",")}的英文`);
  2870. this.$message.error(
  2871. `${msgsList.join(
  2872. ","
  2873. )}存在非英文字符,如汉字等,请修正后再保存!`
  2874. );
  2875. return;
  2876. }
  2877. }
  2878. this.form.detail.hshipperDetails = this.getTextTirim(
  2879. this.form.detail.hshipperDetails
  2880. );
  2881. this.form.detail.hconsigneeDetails = this.getTextTirim(
  2882. this.form.detail.hconsigneeDetails
  2883. );
  2884. this.form.detail.hnotifyDetails = this.getTextTirim(
  2885. this.form.detail.hnotifyDetails
  2886. );
  2887. this.form.detail.marks = this.getTextTirim(
  2888. this.form.detail.marks
  2889. );
  2890. this.form.detail.commodityDescr = this.getTextTirim(
  2891. this.form.detail.commodityDescr
  2892. );
  2893. this.form.forwarding = this.getTextTirim(
  2894. this.form.forwarding
  2895. );
  2896. // 赋值 ETD 日期
  2897. // this.form.billDate = this.form.etd ? this.form.etd.slice(0, 10) + ' 00:00:00' : null // 单据日期
  2898. // 调用保存接口
  2899. this.billsSubmitfun(status);
  2900. }
  2901. });
  2902. },
  2903. // 主表保存接口大保存
  2904. billsSubmitfun(status) {
  2905. if (this.form.cargoType == "dry") {
  2906. // 普货
  2907. this.form.billNoFormat = "HYJK-PH";
  2908. } else if (this.form.cargoType == "danger") {
  2909. // 危险品
  2910. this.form.billNoFormat = "HYJK-WXP";
  2911. } else if (this.form.cargoType == "reefer") {
  2912. // 冻柜
  2913. this.form.billNoFormat = "HYJK-DG";
  2914. } else {
  2915. this.form.billNoFormat = "HYJK";
  2916. }
  2917. this.form.businessTypeCode = "HYJK";
  2918. delete this.form.extendedData;
  2919. // 把拼接的数据拆开 开始 🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒
  2920. // this.searchSplit()
  2921. // 把拼接的数据拆开 结束 💩💩💩💩💩💩💩💩💩💩💩💩💩💩
  2922. // 费用 收 赋值数据
  2923. // this.form.shortName=this.form.corpCnName.split('-')[1]
  2924. this.form.feeCenterListD.map((row, index) => {
  2925. row.dc = "D";
  2926. row.sort = Number(index) + 1;
  2927. row.businessType = this.form.businessType; // 业务类型
  2928. row.billType = this.form.billType; // 单据类型
  2929. row.billNo = this.form.billNo; // 单据编号
  2930. row.billDate = this.form.billDate;
  2931. row.billCorpId = this.form.corpId; // 主表客户 id
  2932. row.billCorpCnName = this.form.corpCnName; // 主表客户中文名称
  2933. row.billCorpEnName = this.form.corpEnName; // 主表客户英文名称
  2934. row.lineId = this.form.lineId; // 航线 id
  2935. row.lineCnName = this.form.lineCnName; // 航线中文名称
  2936. row.lineEnName = this.form.lineEnName; // 航线英文名称
  2937. row.vesselId = this.form.vesselId; // 船名 id
  2938. row.vesselCnName = this.form.vesselCnName; // 中文船名
  2939. row.vesselEnName = this.form.vesselEnName; // 英文船名
  2940. row.voyageNo = this.form.voyageNo; // 航次
  2941. row.mblno = this.form.mblno; // MB/L NO
  2942. row.hblno = this.form.hblno; // HB/L NO
  2943. // row.etd = this.form.etd // 开船日期
  2944. row.eta = this.form.actualEta; // 到港日期
  2945. row.polId = this.form.polId; // 装货港 id
  2946. row.polCode = this.form.polCode; // 装货港代码
  2947. row.polCnName = this.form.polCnName; // 装货港中文名称
  2948. row.polEnName = this.form.polEnName; // 装货港英文名称
  2949. row.podId = this.form.podId; // 卸货港 id
  2950. row.podCode = this.form.podCode; // 卸货港代码
  2951. row.podCnName = this.form.podCnName; // 卸货港中文名称
  2952. row.podEnName = this.form.podEnName; // 卸货港英文名称
  2953. row.corpArgreementNo = this.form.corpArgreementNo; // 客户约号
  2954. // 数量 * 单价 = 净额
  2955. // 总税率 = 税率 + 附件税率
  2956. // 税额 = 净额 * 总税率
  2957. // 含税
  2958. if (row.curCode == this.getLocalCurrency()) {
  2959. row.amount = row.rmbAmount
  2960. ? row.rmbAmount
  2961. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2962. } else {
  2963. row.amount = row.usdAmount
  2964. ? row.usdAmount
  2965. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2966. }
  2967. // 净额
  2968. if (row.curCode == this.getLocalCurrency()) {
  2969. row.amountNet = row.rmbAmountNet
  2970. ? row.rmbAmountNet
  2971. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2972. } else {
  2973. row.amountNet = row.usdAmountNet
  2974. ? row.usdAmountNet
  2975. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2976. }
  2977. });
  2978. // 费用 付 赋值数据
  2979. this.form.feeCenterListC.map((row, index) => {
  2980. row.dc = "C";
  2981. row.sort = Number(index) + 1;
  2982. row.businessType = this.form.businessType; // 业务类型
  2983. row.billType = this.form.billType; // 单据类型
  2984. row.billNo = this.form.billNo; // 单据编号
  2985. row.billDate = this.form.billDate; // 单据日期
  2986. row.billCorpId = this.form.corpId; // 主表客户 id
  2987. row.billCorpCnName = this.form.corpCnName; // 主表客户中文名称
  2988. row.billCorpEnName = this.form.corpEnName; // 主表客户英文名称
  2989. row.lineId = this.form.lineId; // 航线 id
  2990. row.lineCnName = this.form.lineCnName; // 航线中文名称
  2991. row.lineEnName = this.form.lineEnName; // 航线英文名称
  2992. row.vesselId = this.form.vesselId; // 船名 id
  2993. row.vesselCnName = this.form.vesselCnName; // 中文船名
  2994. row.vesselEnName = this.form.vesselEnName; // 英文船名
  2995. row.voyageNo = this.form.voyageNo; // 航次
  2996. row.mblno = this.form.mblno; // MB/L NO
  2997. row.hblno = this.form.hblno; // HB/L NO
  2998. // row.etd = this.form.etd // 开船日期
  2999. row.eta = this.form.actualEta; // 到港日期
  3000. row.polId = this.form.polId; // 装货港 id
  3001. row.polCode = this.form.polCode; // 装货港代码
  3002. row.polCnName = this.form.polCnName; // 装货港中文名称
  3003. row.polEnName = this.form.polEnName; // 装货港英文名称
  3004. row.podId = this.form.podId; // 卸货港 id
  3005. row.podCode = this.form.podCode; // 卸货港代码
  3006. row.podCnName = this.form.podCnName; // 卸货港中文名称
  3007. row.podEnName = this.form.podEnName; // 卸货港英文名称
  3008. row.corpArgreementNo = this.form.corpArgreementNo; // 客户约号
  3009. // 数量 * 单价 = 净额
  3010. // 总税率 = 税率 + 附件税率
  3011. // 税额 = 净额 * 总税率
  3012. // 含税
  3013. if (row.curCode == this.getLocalCurrency()) {
  3014. row.amount = row.rmbAmount
  3015. ? row.rmbAmount
  3016. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  3017. } else {
  3018. row.amount = row.usdAmount
  3019. ? row.usdAmount
  3020. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  3021. }
  3022. // 净额
  3023. if (row.curCode == this.getLocalCurrency()) {
  3024. row.amountNet = row.rmbAmountNet
  3025. ? row.rmbAmountNet
  3026. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  3027. } else {
  3028. row.amountNet = row.usdAmountNet
  3029. ? row.usdAmountNet
  3030. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  3031. }
  3032. });
  3033. this.pageLoading = true;
  3034. billsSubmit(this.form)
  3035. .then(res => {
  3036. this.pageLoading = false;
  3037. if (res.data.code === 601) {
  3038. console.info("11111111111----", res);
  3039. this.billsDetailfun(this.form.id);
  3040. this.$message({
  3041. type: "error",
  3042. message: res.data.msg
  3043. });
  3044. return true;
  3045. }
  3046. this.$message({
  3047. type: "success",
  3048. message: "操作成功!"
  3049. });
  3050. if (status == "goBack") {
  3051. if (this.form.id) {
  3052. this.unLock({
  3053. moduleName: "SI",
  3054. tableName: "SI_order",
  3055. billId: this.form.id,
  3056. billNo: this.form.mblno
  3057. });
  3058. }
  3059. this.$emit("goBack");
  3060. }
  3061. // this.detailData.seeDisabled = true
  3062. this.billsDetailfun(res.data.data.id, status);
  3063. })
  3064. .catch(err => {
  3065. this.pageLoading = false;
  3066. })
  3067. .finally(() => { });
  3068. },
  3069. // 提取箱专用的保存
  3070. billsAddfun() {
  3071. billsAdd(this.form)
  3072. .then(res => {
  3073. this.pageLoading = false;
  3074. this.$message({
  3075. type: "success",
  3076. message: "操作成功!"
  3077. });
  3078. // this.detailData.seeDisabled = true
  3079. this.billsDetailfun(res.data.data.id);
  3080. })
  3081. .catch(err => {
  3082. this.pageLoading = false;
  3083. });
  3084. },
  3085. // 复制单据接口
  3086. async billsCopyBillsfun(id, type, billType) {
  3087. const loading = this.$loading({
  3088. lock: true,
  3089. text: "加载中",
  3090. spinner: "el-icon-loading",
  3091. background: "rgba(255,255,255,0.7)"
  3092. });
  3093. let res = await billsCopyBills({
  3094. id
  3095. });
  3096. loading.close();
  3097. let types = typeof type == "string" ? type.split(",") : [];
  3098. // if (type == '复制费用' || type == '') {
  3099. // res.data.data.preContainersList = []
  3100. // }
  3101. // if (type == '复制箱型箱量' || type == '') {
  3102. // res.data.data.feeCenterListD = []
  3103. // res.data.data.feeCenterListC = []
  3104. // }
  3105. if (types.indexOf("复制箱型箱量") < 0) {
  3106. res.data.data.preContainersList = [];
  3107. }
  3108. if (types.indexOf("复制费用") < 0) {
  3109. res.data.data.feeCenterListD = [];
  3110. res.data.data.feeCenterListC = [];
  3111. }
  3112. res.data.data.billType = billType
  3113. if (!this.roleName.includes('admin') && (this.roleName.includes('应收修改') || this.roleName.includes('应收查看')) && !(this.roleName.includes('应付修改') || this.roleName.includes('应付查看'))) {
  3114. res.data.data.feeCenterListC = []
  3115. }
  3116. if (!this.roleName.includes('admin') && (this.roleName.includes('应付修改') || this.roleName.includes('应付查看')) && !(this.roleName.includes('应收修改') || this.roleName.includes('应收查看'))) {
  3117. res.data.data.feeCenterListD = []
  3118. }
  3119. await this.saveLocalCurrency(res.data.data.branchId);
  3120. this.form = res.data.data;
  3121. this.pageLoading = false;
  3122. // this.searchMontage() // 下拉 中文名称和编号拼接
  3123. // 配箱最上面可以编辑
  3124. for (let item of this.form.containersList) {
  3125. item.edit = false;
  3126. }
  3127. // 先把状态改成可以编辑,然后判断是否可以编辑
  3128. this.generateBillsfalse = false;
  3129. // 应收
  3130. for (let item of this.form.feeCenterListD) {
  3131. // 判断是否生成了账单
  3132. if (item.accStatus == 1) {
  3133. // this.columnforfun("corpCnName").disabled = true;
  3134. // this.columnforfun('srcType').disabled = true
  3135. this.columnforfun("mblno").disabled = true;
  3136. this.columnforfun("bookingNo").disabled = true;
  3137. // this.columnforfun('refno').disabled = true
  3138. this.generateBillsfalse = true;
  3139. }
  3140. if (item.curCode == this.getLocalCurrency()) {
  3141. this.$set(item, "rmbAmount", item.amount);
  3142. this.$set(item, "usdAmount", "");
  3143. this.$set(item, "rmbAmountNet", item.amountNet);
  3144. this.$set(item, "usdAmountNet", "");
  3145. } else {
  3146. this.$set(item, "usdAmount", item.amount);
  3147. this.$set(item, "rmbAmount", "");
  3148. this.$set(item, "usdAmountNet", item.amountNet);
  3149. this.$set(item, "rmbAmountNet", "");
  3150. }
  3151. item.edit = false;
  3152. }
  3153. // 应付
  3154. for (let item of this.form.feeCenterListC) {
  3155. // 判断是否生成了账单
  3156. if (item.accStatus == 1) {
  3157. this.generateBillsfalse = true;
  3158. // this.columnforfun("corpCnName").disabled = true;
  3159. // this.columnforfun('srcType').disabled = true
  3160. this.columnforfun("mblno").disabled = true;
  3161. this.columnforfun("bookingNo").disabled = true;
  3162. // this.columnforfun('refno').disabled = true
  3163. }
  3164. if (item.curCode == this.getLocalCurrency()) {
  3165. this.$set(item, "rmbAmount", item.amount);
  3166. this.$set(item, "usdAmount", "");
  3167. this.$set(item, "rmbAmountNet", item.amountNet);
  3168. this.$set(item, "usdAmountNet", "");
  3169. } else {
  3170. this.$set(item, "usdAmount", item.amount);
  3171. this.$set(item, "rmbAmount", "");
  3172. this.$set(item, "usdAmountNet", item.amountNet);
  3173. this.$set(item, "rmbAmountNet", "");
  3174. }
  3175. item.edit = false;
  3176. }
  3177. // 文件中心
  3178. for (let item of this.form.filesList) {
  3179. this.$set(item, "edit", false);
  3180. }
  3181. },
  3182. // 详情接口
  3183. async billsDetailfun(id, status) {
  3184. const res = await billsDetail(id);
  3185. // this.form = res.data.data;
  3186. if (!this.roleName.includes('admin') && (this.roleName.includes('应收修改') || this.roleName.includes('应收查看')) && !(this.roleName.includes('应付修改') || this.roleName.includes('应付查看'))) {
  3187. res.data.data.feeCenterListC = []
  3188. }
  3189. if (!this.roleName.includes('admin') && (this.roleName.includes('应付修改') || this.roleName.includes('应付查看')) && !(this.roleName.includes('应收修改') || this.roleName.includes('应收查看'))) {
  3190. res.data.data.feeCenterListD = []
  3191. }
  3192. res.data.data.marks = res.data.data.marks ? res.data.data.marks.split("&|&").join("\n") : ''
  3193. res.data.data.commodityDescr = res.data.data.commodityDescr ? res.data.data.commodityDescr.split("&|&").join("\n") : ''
  3194. this.$set(this, "form", res.data.data);
  3195. this.inLock();
  3196. // console.log('form', this.form)
  3197. // console.log(this.$refs)
  3198. if (this.form.id) {
  3199. this.$refs.documentCenter.reportslogListfun({ currentPage: 1, pageSize: 10 })
  3200. }
  3201. this.billsListAllfun(this.form.id);
  3202. this.copyFormData = JSON.parse(JSON.stringify(res.data.data));
  3203. // 如果已经请核就禁用按钮
  3204. if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
  3205. this.detailData.seeDisabled = true
  3206. } else {
  3207. this.detailData.seeDisabled = false
  3208. }
  3209. // this.columnforfun('teamName').disabled = true
  3210. // this.columnforfun('operatorName').disabled = true
  3211. // this.columnforfun('accDeptName').disabled = true
  3212. if (
  3213. this.form.status == 1 ||
  3214. this.form.status == 2 ||
  3215. this.form.status == 3
  3216. ) {
  3217. this.columnforfun("corpCnName").disabled = true;
  3218. // this.columnforfun('srcType').disabled = true
  3219. this.columnforfun("mblno").disabled = true;
  3220. this.columnforfun("bookingNo").disabled = true;
  3221. // this.columnforfun('refno').disabled = true
  3222. // this.columnforfun('teamId').disabled = true
  3223. this.generateBillsfalse = true;
  3224. this.pleasereviewType = true; // 请核禁用
  3225. } else {
  3226. // 判断是否可以编辑
  3227. this.columnforfun("corpCnName").disabled = false;
  3228. // this.columnforfun('srcType').disabled = false
  3229. this.columnforfun("mblno").disabled = false;
  3230. this.columnforfun("bookingNo").disabled = false;
  3231. // this.columnforfun('refno').disabled = false
  3232. // if (this.saberTenantId == '607913') {
  3233. // this.columnforfun('operatorName').disabled = false
  3234. // this.columnforfun('accDeptName').disabled = false
  3235. // }
  3236. // this.columnforfun('teamId').disabled = false
  3237. this.generateBillsfalse = false;
  3238. this.pleasereviewType = false;
  3239. }
  3240. this.pageLoading = false;
  3241. // this.searchMontage() // 下拉 中文名称和编号拼接
  3242. // 配箱最上面可以编辑
  3243. for (let item of this.form.containersList) {
  3244. item.edit = false;
  3245. }
  3246. // 配箱最下面的
  3247. for (let item of this.form.waitingBoxList) {
  3248. this.$set(item, "editQuantity", item.quantity);
  3249. this.$set(item, "editGrossWeight", item.grossWeight);
  3250. this.$set(item, "editMeasurement", item.measurement);
  3251. this.$set(item, "edit", false);
  3252. }
  3253. // 应收
  3254. for (let item of this.form.feeCenterListD) {
  3255. // 判断是否生成了账单
  3256. if (item.accStatus == 1) {
  3257. this.generateBillsfalse = true;
  3258. // this.columnforfun("corpCnName").disabled = true;
  3259. // this.columnforfun('srcType').disabled = true
  3260. this.columnforfun("mblno").disabled = true;
  3261. this.columnforfun("bookingNo").disabled = true;
  3262. // this.columnforfun('refno').disabled = true
  3263. }
  3264. if (item.curCode == this.getLocalCurrency()) {
  3265. this.$set(item, "rmbAmount", item.amount);
  3266. this.$set(item, "usdAmount", "");
  3267. this.$set(item, "rmbAmountNet", item.amountNet);
  3268. this.$set(item, "usdAmountNet", "");
  3269. } else {
  3270. this.$set(item, "usdAmount", item.amount);
  3271. this.$set(item, "rmbAmount", "");
  3272. this.$set(item, "usdAmountNet", item.amountNet);
  3273. this.$set(item, "rmbAmountNet", "");
  3274. }
  3275. item.edit = false;
  3276. }
  3277. // 应付
  3278. for (let item of this.form.feeCenterListC) {
  3279. // 判断是否生成了账单
  3280. if (item.accStatus == 1) {
  3281. this.generateBillsfalse = true;
  3282. // this.columnforfun("corpCnName").disabled = true;
  3283. // this.columnforfun('srcType').disabled = true
  3284. this.columnforfun("mblno").disabled = true;
  3285. this.columnforfun("bookingNo").disabled = true;
  3286. // this.columnforfun('refno').disabled = true
  3287. }
  3288. if (item.curCode == this.getLocalCurrency()) {
  3289. this.$set(item, "rmbAmount", item.amount);
  3290. this.$set(item, "usdAmount", "");
  3291. this.$set(item, "rmbAmountNet", item.amountNet);
  3292. this.$set(item, "usdAmountNet", "");
  3293. } else {
  3294. this.$set(item, "usdAmount", item.amount);
  3295. this.$set(item, "rmbAmount", "");
  3296. this.$set(item, "usdAmountNet", item.amountNet);
  3297. this.$set(item, "rmbAmountNet", "");
  3298. }
  3299. item.edit = false;
  3300. }
  3301. // 文件中心
  3302. this.$refs.filescenter.getData(res.data.data);
  3303. for (let item of this.form.filesList) {
  3304. this.$set(item, "edit", false);
  3305. }
  3306. if (status == "toAddEdit") {
  3307. this.$emit(status);
  3308. }
  3309. this.oldForm = this.deepClone(this.form);
  3310. },
  3311. // tbas切换
  3312. handleClick(tba, event) { },
  3313. // 大tbas切换
  3314. bigHandleClick() {
  3315. if (this.bigtabs == "fd") {
  3316. if (this.form.id) {
  3317. this.billsListAllfun(this.form.id);
  3318. }
  3319. }
  3320. if (this.bigtabs == "dz") {
  3321. if (this.form.id) {
  3322. this.$refs.documentCenter.reportslogListfun({
  3323. currentPage: 1,
  3324. pageSize: 10
  3325. });
  3326. }
  3327. this.getReportTypeByBigHandle("单证");
  3328. }
  3329. if (this.bigtabs == "fy") this.getReportTypeByBigHandle("费用");
  3330. },
  3331. getReportTypeByBigHandle(name) {
  3332. return name;
  3333. },
  3334. // 获取不分页的分单列表
  3335. billsListAllfun(masterId) {
  3336. billsListAll({
  3337. masterId
  3338. }).then(res => {
  3339. this.billsListAllData = res.data.data;
  3340. });
  3341. }
  3342. }
  3343. };
  3344. </script>
  3345. <style scoped lang="scss">
  3346. ::v-deep .el-tabs--border-card>.el-tabs__content {
  3347. padding: 4px !important;
  3348. }
  3349. .scrollable-container {
  3350. height: 84vh;
  3351. /* 设置容器高度 */
  3352. overflow-y: auto;
  3353. /* 添加垂直滚动条 */
  3354. }
  3355. .borderless {
  3356. height: 100%;
  3357. box-sizing: border-box;
  3358. }
  3359. .customer-main {
  3360. margin-bottom: 15px;
  3361. }
  3362. .demo-ruleForm {
  3363. font-size: 14px;
  3364. }
  3365. .margintop {
  3366. margin-top: 0px !important;
  3367. }
  3368. ::v-deep.el-form-item {
  3369. margin-bottom: 0;
  3370. }
  3371. ::v-deep .basic-container .el-card__body {
  3372. padding: 6px 20px;
  3373. }
  3374. ::v-deep .el-tabs__header {
  3375. margin: 0 05px;
  3376. }
  3377. .isShow {
  3378. display: none;
  3379. }
  3380. .dropdown-max {
  3381. top: 150px !important;
  3382. max-width: 600px;
  3383. display: flex;
  3384. flex-flow: row wrap;
  3385. li {
  3386. margin-right: 5px;
  3387. white-space: nowrap;
  3388. }
  3389. }
  3390. </style>