billsDetails.vue 126 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563
  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">返回列表
  8. </el-button>
  9. </div>
  10. <div class="add-customer-btn">
  11. <!--<el-popover-->
  12. <!-- placement="bottom-end"-->
  13. <!-- width="100"-->
  14. <!-- trigger="hover">-->
  15. <!-- <div>-->
  16. <!-- </div>-->
  17. <el-button size="small" type="primary" @click="addEdit">新 建
  18. </el-button>
  19. <el-button type="success" size="small" style="margin-right: 8px" @click="CopyDocumentsfun">复制单据
  20. </el-button>
  21. <el-dropdown style="line-height: 0" v-if="saberTenantId == '409341' || saberTenantId == '607913'">
  22. <el-button size="small" type="warning" style="margin-right: 8px"
  23. :disabled="form.status > 0 || showLock || !form.id">
  24. 导入模板<i class="el-icon-arrow-down el-icon--right"></i>
  25. </el-button>
  26. <el-dropdown-menu slot="dropdown">
  27. <el-dropdown-item v-for="item in imporiData" :key="item.id"
  28. @click.native="importData(item.id)">{{
  29. item.name }}
  30. </el-dropdown-item>
  31. </el-dropdown-menu>
  32. </el-dropdown>
  33. <el-dropdown style="line-height: 0">
  34. <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
  35. :disabled="!form.id || showLock">
  36. 发送 SO EDI<i class="el-icon-arrow-down el-icon--right"></i>
  37. </el-button>
  38. <el-dropdown-menu slot="dropdown">
  39. <el-dropdown-item v-for="item in ediData_SO" :key="item.id" class="dropdown-max"
  40. @click.native="editypesSendingEdifun(item)">{{ item.cnName }}
  41. </el-dropdown-item>
  42. </el-dropdown-menu>
  43. </el-dropdown>
  44. <el-dropdown style="line-height: 0">
  45. <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
  46. :disabled="!form.id || showLock">
  47. 发送 SI EDI<i class="el-icon-arrow-down el-icon--right"></i>
  48. </el-button>
  49. <el-dropdown-menu slot="dropdown">
  50. <el-dropdown-item v-for="item in ediData_SI" :key="item.id" class="dropdown-max"
  51. @click.native="editypesSendingEdifun(item)">{{ item.cnName }}
  52. </el-dropdown-item>
  53. </el-dropdown-menu>
  54. </el-dropdown>
  55. <el-button size="small" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id"
  56. @click="previewDialogfun">预 览
  57. </el-button>
  58. <el-button size="small" type="warning" :disabled="!form.id || detailData.seeDisabled || showLock"
  59. v-if="form.status == 1" @click.stop="revokeDocumentApproval">撤销单据请核
  60. </el-button>
  61. <el-button size="small" type="success" :disabled="!form.id || detailData.seeDisabled || showLock"
  62. v-if="form.status == 0 || form.status == 4" @click.stop="DocumentApproval">单据请核
  63. </el-button>
  64. <el-button size="small" type="primary" style="margin-right: 8px"
  65. :disabled="detailData.seeDisabled || showLock" :loading="saveLoading" @click="editCustomer">保 存
  66. </el-button>
  67. <el-dropdown style="line-height: 0">
  68. <el-button type="warning" :loading="saveLoading" :disabled="!form.id" size="small">
  69. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  70. </el-button>
  71. <el-dropdown-menu slot="dropdown">
  72. <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
  73. </el-dropdown-item>
  74. </el-dropdown-menu>
  75. </el-dropdown>
  76. </div>
  77. </div>
  78. <div style="margin-top: 50px">
  79. <el-tabs type="border-card" v-model="bigtabs" @tab-click="bigHandleClick">
  80. <el-tab-pane label="委托信息" name="wt" class="scrollable-container">
  81. <div>
  82. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm" :disabled="showLock">
  83. <containerTitle title="基础资料"></containerTitle>
  84. <basic-container :showBtn="true">
  85. <el-row :gutter="60">
  86. <el-col v-for="(item, index) in basicData.column" :key="index" :span="8">
  87. <!--数组-->
  88. <div v-if="item instanceof Array"
  89. style="display: flex;align-items: center;justify-content: space-between">
  90. <el-row>
  91. <el-col :span="item[0].span ? item[0].span : 12">
  92. <el-form-item :label="item[0].label" :prop="item[0].prop"
  93. :rules="item[0].rules" :label-width="item[0].labelWidth">
  94. <span slot="label" v-if="item[0].label">
  95. <span v-if="item[0].label == 'HB/L NO'"
  96. style="color: #4c9e44;cursor: pointer;text-decoration: underline;"
  97. @click="applyforfun(item[0].label)">{{ form.hblno ? '删除'
  98. : '申请'
  99. }} {{ item[0].label }}
  100. </span>
  101. <span v-else style="color: #1e9fff">{{ item[0].label
  102. }}</span>
  103. </span>
  104. <span v-if="item[0].type == 'button'"></span>
  105. <!--<el-button v-if="item[0].type == 'button'" :disabled="detailData.seeDisabled || item[0].disabled"-->
  106. <!-- size="mini" type="success" icon="el-icon-circle-plus" circle-->
  107. <!-- @click="applyforfun(item[0].label)" >-->
  108. <!--</el-button>-->
  109. <search-query v-else-if="item[0].type == 'select'"
  110. :datalist="item[0].dicData"
  111. :selectValue="form[item[0].prop]" :filterable="true"
  112. :allowCreate="item[0].allowCreate || false" :remote="true"
  113. :disabled="detailData.seeDisabled || item[0].disabled"
  114. :buttonIf="false" :placeholder="`${item[0].text || ''}`"
  115. :forParameter="item[0].forParameter"
  116. @remoteMethod="remoteMethod($event, item[0].prop)"
  117. @corpChange="corpChange($event, item[0].prop)"
  118. @corpFocus="remoteMethod($event, item[0].prop)">
  119. </search-query>
  120. <el-input v-else type="age" style="width: 100%;"
  121. v-model="form[item[0].prop]" size="small" autocomplete="off"
  122. :disabled="detailData.seeDisabled || item[0].disabled"
  123. :placeholder="item[0].text || ''"></el-input>
  124. </el-form-item>
  125. </el-col>
  126. <el-col :span="item[1].span ? item[1].span : 12">
  127. <el-form-item :label="item[1].label" :prop="item[1].prop"
  128. :rules="item[1].rules" :label-width="item[1].labelWidth">
  129. <span slot="label" v-if="item[1].label">
  130. <span style="color: #1e9fff">{{ item[1].label }}</span>
  131. </span>
  132. <el-date-picker v-if="item[1].type == 'date'"
  133. v-model="form[item[1].prop]" clearable style="width: 100%;"
  134. type="date" size="small"
  135. :disabled="detailData.seeDisabled || item[1].disabled"
  136. value-format="yyyy-MM-dd HH:mm" placeholder="选择日期">
  137. </el-date-picker>
  138. <search-query v-else-if="item[1].type == 'select'"
  139. :datalist="item[1].dicData"
  140. :selectValue="form[item[1].prop]" :filterable="true"
  141. :remote="true"
  142. :disabled="detailData.seeDisabled || item[1].disabled"
  143. :buttonIf="false" :placeholder="`${item[1].text || ''}`"
  144. :forParameter="item[1].forParameter"
  145. @remoteMethod="remoteMethod($event, item[1].prop)"
  146. @corpChange="corpChange($event, item[1].prop)"
  147. @corpFocus="remoteMethod($event, item[1].prop)">
  148. </search-query>
  149. <tree-select v-else-if="item[1].type == 'tree'"
  150. v-model="form[item[1].prop]" :data="item[1].dicData"
  151. :props="item[1].forParameter" nodeKey="title" size="small"
  152. :clearable="false"
  153. :disabled="detailData.seeDisabled || item[1].disabled"
  154. :multiple="false" :placeholder="`${item[1].text || ''}`"
  155. @input="corpChange($event, item[1].prop)">
  156. </tree-select>
  157. <el-input v-else type="age" style="width: 100%;"
  158. v-model="form[item[1].prop]" size="small" autocomplete="off"
  159. :disabled="detailData.seeDisabled || item[1].disabled"
  160. :placeholder="item[1].text || ''"></el-input>
  161. </el-form-item>
  162. </el-col>
  163. <el-col v-if="item[2]" :span="item[2].span ? item[2].span : 12">
  164. <el-form-item :label="item[2].label" :prop="item[2].prop"
  165. :rules="item[2].rules" :label-width="item[2].labelWidth">
  166. <span slot="label" v-if="item[2].label">
  167. <span style="color: #1e9fff">{{ item[2].label }}</span>
  168. </span>
  169. <search-query v-if="item[2].type == 'select'"
  170. :datalist="item[2].dicData"
  171. :selectValue="form[item[2].prop]" :filterable="true"
  172. :clearable="false" :remote="true"
  173. :disabled="detailData.seeDisabled || item[2].disabled"
  174. :buttonIf="false" :forParameter="item[2].forParameter"
  175. :placeholder="`${item[2].text || ''}`"
  176. @remoteMethod="remoteMethod($event, item[2].prop)"
  177. @corpChange="corpChange($event, item[2].prop)"
  178. @corpFocus="remoteMethod($event, item[2].prop)">
  179. </search-query>
  180. <el-input v-else type="age" style="width: 100%;"
  181. v-model="form[item[2].prop]" size="small" autocomplete="off"
  182. :disabled="detailData.seeDisabled || item[1].disabled"
  183. :placeholder="item[2].text || ''"></el-input>
  184. </el-form-item>
  185. </el-col>
  186. </el-row>
  187. </div>
  188. <!--对象-->
  189. <div v-else>
  190. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  191. <span slot="label" v-if="item.label">
  192. <span style="color: #1e9fff">{{ item.label }}</span>
  193. </span>
  194. <search-query v-if="item.type == 'select'" ref="searchQueryRef"
  195. :datalist="item.dicData" :selectValue="form[item.prop]"
  196. :filterable="true" :clearable="false" :remote="true"
  197. :disabled="detailData.seeDisabled || item.disabled"
  198. :buttonIf="item.buttonIf" :forParameter="item.forParameter"
  199. :placeholder="`${item.text || ''}`" :joinData="item.joinData"
  200. @remoteMethod="remoteMethod($event, item.prop)"
  201. @corpChange="corpChange($event, item.prop)"
  202. @corpFocus="remoteMethod($event, item.prop)"
  203. @eldialogConfirm="eldialogConfirm(item.slot)">
  204. <bcorps v-show="item.slot == 'bcorps'" ref="bcorps" :eldialog="true"
  205. @selectionChange="eldialogMultipleChoice($event, item.slot)">
  206. </bcorps>
  207. <bcorpstypedefine v-show="item.slot == 'bcorpstypedefine'">
  208. </bcorpstypedefine>
  209. </search-query>
  210. <el-input v-else type="age" style="width: 100%;"
  211. v-model="form[item.prop]" size="small" autocomplete="off"
  212. :disabled="detailData.seeDisabled || item.disabled"
  213. :placeholder="item.text || ''"></el-input>
  214. </el-form-item>
  215. </div>
  216. </el-col>
  217. </el-row>
  218. </basic-container>
  219. </el-form>
  220. </div>
  221. <div class="customer-main margintop">
  222. <containerTitle title="详细"></containerTitle>
  223. <basic-container :showBtn="true">
  224. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  225. <el-tab-pane label="委托详情" name="first">
  226. <entrustment-lnformation :assemblyForm="form" :detailData="detailData"
  227. :disabled="showLock" :generateBillsfalse="generateBillsfalse"
  228. @billsDetailfun="billsDetailfun(form.id)">
  229. </entrustment-lnformation>
  230. </el-tab-pane>
  231. <el-tab-pane label="配箱信息" name="second">
  232. <DistributionBox :assemblyForm="form" :detailData="detailData" :showLock="showLock"
  233. :pleasereviewType="pleasereviewType" @billsAddfun="billsAddfun"
  234. @billsDetailfun="billsDetailfun(form.id)">
  235. </DistributionBox>
  236. </el-tab-pane>
  237. <el-tab-pane label="MB/L信息" name="third">
  238. <mbinformation :assemblyForm="form" :detailData="detailData" :disabled="showLock">
  239. </mbinformation>
  240. </el-tab-pane>
  241. <el-tab-pane label="报表管理" name="fourth"
  242. v-if="roleName.indexOf('admin') != -1 ? true : roleName.indexOf('报表管理') != -1 ? true : false">
  243. <reports :id="form.id" :assemblyForm="form"
  244. :disabled="detailData.seeDisabled || showLock" businessValue="HYCK"></reports>
  245. </el-tab-pane>
  246. <el-tab-pane label="EDI 及其他" name="sixth">
  247. <edicode :assemblyForm="form" :detailData="detailData" :disabled="showLock">
  248. </edicode>
  249. </el-tab-pane>
  250. <el-tab-pane label="文件中心" name="seventh">
  251. <filescenter ref="filescenter" :assemblyForm="form" :pid="form.id"
  252. :detailData="detailData" :showLock="showLock"></filescenter>
  253. </el-tab-pane>
  254. </el-tabs>
  255. </basic-container>
  256. <basic-container :showBtn="true" v-if="activeName == 'first' || activeName == 'third'">
  257. <formbottom :assemblyForm="form" :generateBillsfalse="generateBillsfalse"
  258. :disabled="showLock" :detailData="detailData"></formbottom>
  259. </basic-container>
  260. </div>
  261. </el-tab-pane>
  262. <el-tab-pane label="费用信息" name="fy" class="scrollable-container"
  263. v-if="roleName.indexOf('admin') != -1 ? true : roleName.indexOf('应收修改') != -1 || roleName.indexOf('应付修改') != -1 || roleName.indexOf('应收查看') != -1 || roleName.indexOf('应付查看') != -1">
  264. <feecenter :assemblyForm="form" :copyFormData="copyFormData" :detailData="detailData"
  265. :disabled="detailData.seeDisabled || showLock" :pleasereviewType="pleasereviewType"
  266. :pid="form.id" @billsDetailfun="billsDetailfun(form.id)">
  267. </feecenter>
  268. </el-tab-pane>
  269. <el-tab-pane label="单证中心" name="dz" class="scrollable-container">
  270. <document-center ref="documentCenter" :detailData="detailData" :assemblyForm="form"
  271. :disabled="detailData.seeDisabled || showLock"></document-center>
  272. </el-tab-pane>
  273. <el-tab-pane label="分单列表" name="fd" v-if="form.billType == 'MM'" class="scrollable-container">
  274. <Split-list :detailData="detailData" :assemblyForm="form" :data="billsListAllData"
  275. :disabled="detailData.seeDisabled || showLock"
  276. @billsListAllfun="billsListAllfun(form.id)"></Split-list>
  277. </el-tab-pane>
  278. </el-tabs>
  279. </div>
  280. <!--导入模板-->
  281. <el-dialog title="导入模板" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
  282. v-dialog-drag>
  283. <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading"
  284. :upload-before="uploadBefore" :upload-after="onSuccess">
  285. </avue-form>
  286. </el-dialog>
  287. <!--审核弹窗-->
  288. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  289. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  290. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  291. </el-dialog>
  292. <!--预览报表弹窗-->
  293. <el-dialog append-to-body title="预览报表" class="el-dialogDeep" :visible.sync="previewDialog" width="60%"
  294. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  295. <business-reports :id="form.id" :classifycode="getReportTypeByBigHandle()"
  296. :disabled="detailData.seeDisabled"></business-reports>
  297. </el-dialog>
  298. </div>
  299. </template>
  300. <script>
  301. import EntrustmentLnformation from "@/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation.vue";
  302. import mbinformation from "@/views/iosBasicData/SeafreightExportF/bills/assembly/mbinformation.vue";
  303. import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
  304. import formbottom from "@/views/iosBasicData/SeafreightExportF/bills/assembly/formbottom.vue";
  305. import edicode from '@/views/iosBasicData/SeafreightExportF/bills/assembly/edicode.vue'
  306. import filescenter from "@/views/iosBasicData/SeafreightExportF/bills/assembly/filescenter.vue";
  307. import DistributionBox from "@/views/iosBasicData/SeafreightExportF/bills/assembly/DistributionBox.vue";
  308. import feecenter from '@/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue'
  309. import { getList as userGetList } from '@/api/system/user'
  310. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  311. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  312. import bcorps from "@/views/iosBasicData/bcorps/index.vue";
  313. import bcorpstypedefine from "@/views/iosBasicData/bcorps/bcorpstypedefine.vue";
  314. import SplitList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/SplitList.vue";
  315. import { getLazylist } from "@/api/basicData/agreement";
  316. import { getBcorpsList, getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  317. import { getBlocationsList } from "@/api/iosBasicData/blocations";
  318. import { getBcorpsattnList } from "@/api/iosBasicData/bcorpsattn";
  319. import { getWorkDicts } from "@/api/system/dictbiz";
  320. import { getDeptLazyTree, getDeptTree, getLazyList } from "@/api/system/dept";
  321. import {
  322. billsCheckBills, billsCopyBills,
  323. billsDetail,
  324. billsGetBillNo, removeHblNo,
  325. billsListAll, billsRevokeCheckBills, editypesSendingEdi,
  326. billsSubmit,
  327. billsAdd,
  328. deptGetDetailPol, postSelectByUser,
  329. } from '@/api/iosBasicData/bills'
  330. import { dateFormat } from "@/util/date";
  331. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  332. import { getBvesselsList } from "@/api/iosBasicData/bvessels";
  333. import DocumentCenter from "@/views/iosBasicData/SeafreightExportF/bills/assembly/DocumentCenter.vue";
  334. import businessReports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/businessReports.vue";
  335. import { popupReminder } from "@/util/messageReminder";
  336. import editypes from "@/views/iosBasicData/editypes/index.vue";
  337. import { editypesList } from "@/api/iosBasicData/editypes";
  338. import { verifyEnglish, checkFullWidthSymbols } from "@/util/date";
  339. import { contrastObj, contrastList } from "@/util/contrastData";
  340. import { selectListLos } from "@/api/approval/processConfig";
  341. import { isProcurement } from "@/api/basicData/configuration";
  342. import _ from "lodash";
  343. export default {
  344. components: {
  345. checkSchedule,
  346. SearchQuery,
  347. EntrustmentLnformation,
  348. formbottom,
  349. mbinformation,
  350. reports,
  351. edicode,
  352. filescenter,
  353. DistributionBox,
  354. feecenter,
  355. bcorps,
  356. bcorpstypedefine,
  357. SplitList,
  358. TreeSelect,
  359. DocumentCenter,
  360. businessReports,
  361. editypes,
  362. },
  363. props: {
  364. detailData: {
  365. type: Object
  366. }
  367. },
  368. data() {
  369. return {
  370. verifySymbolStatus: 0,
  371. showLock: false,
  372. ediData: [], // edi 列表数据
  373. ediData_SO: [], // edi SO 列表数据
  374. ediData_SI: [], // edi SI 列表数据
  375. previewDialog: false, // 预览报表弹窗开启
  376. generateBillsfalse: false, // 如果生成账单就禁用
  377. pleasereviewType: false, // 如果请核就禁用
  378. checkScheduleDialog: false, // 审核弹窗
  379. checkId: '', // 审核需要的id
  380. batchNo: '',
  381. billsListAllData: [], // 分单列表数据
  382. pageLoading: false, // 全屏的动画
  383. saveLoading: false,
  384. copyFormData: {}, // 详情的备份数据
  385. // 详情数据
  386. form: {
  387. billDate: dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00', // 单据日期 默认 当天
  388. operatorName: JSON.parse(localStorage.getItem('saber-userInfo')).content.user_name, // OP 默认登录人
  389. operatorId: JSON.parse(localStorage.getItem('saber-userInfo')).content.user_id, // OP 默认登录人
  390. businessType: 'SE', // 业务类型 默认 海运出口
  391. businessTypes: '海运',
  392. billType: 'DD', // 单据类型 默认 直单
  393. accDeptName: '',// 核算部门 默认登录人的部门
  394. issueType: "ORI", // 签单方式 默认 正本提单
  395. mpaymode: 'PP', // 主单付费方式 默认PP
  396. hpaymode: 'PP', // 分单付费方式 默认 PP
  397. loadType: JSON.parse(localStorage.getItem('saber-tenantId')).content == '409341' ? 'FCL' : '整箱', // 装箱方式默认整箱
  398. srcType: 'OWN', // 业务来源默认公司 来源 内容 默认登录人所属公司
  399. numberOfObl: 'THREE', // 正本份数 默认 THREE
  400. numberOfCopy: 'THREE', // 副本份数 默认 THREE
  401. seaType: 'E', // 进出口 默认出口 E=出口 I=进口"
  402. cargoType: 'dry', // 货物类型默认普货
  403. marks: 'N/M',
  404. dgPackingLevel: '0', // 危险品包装等级
  405. serviceTerms: 'CY-CY', // 服务方式
  406. filesList: [], // 文件中心
  407. feeCenterListD: [], // 收
  408. feeCenterListC: [], // 付
  409. preContainersList: [], // 箱
  410. feeCenterAmendList: [],
  411. placeReceiptName: '',
  412. placeReceiptNamePrint: '',
  413. polEnName: '',
  414. polNamePrint: '',
  415. podEnName: '',
  416. podNamePrint: '',
  417. destinationName: '',
  418. destinationNamePrint: '',
  419. placeDeliveryName: '',
  420. placeDeliveryNamePrint: '',
  421. potEnName: '',
  422. potNamePrint: '',
  423. detail: {},
  424. hmmEdi: {},
  425. },
  426. oldForm: {
  427. billDate: dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00', // 单据日期 默认 当天
  428. operatorName: JSON.parse(localStorage.getItem('saber-userInfo')).content.user_name, // OP 默认登录人
  429. operatorId: JSON.parse(localStorage.getItem('saber-userInfo')).content.user_id, // OP 默认登录人
  430. businessType: 'SE', // 业务类型 默认 海运出口
  431. businessTypes: '海运',
  432. billType: 'DD', // 单据类型 默认 直单
  433. accDeptName: '',// 核算部门 默认登录人的部门
  434. issueType: "ORI", // 签单方式 默认 正本提单
  435. mpaymode: 'PP', // 主单付费方式 默认PP
  436. hpaymode: 'PP', // 分单付费方式 默认 PP
  437. loadType: JSON.parse(localStorage.getItem('saber-tenantId')).content == '409341' ? 'FCL' : '整箱', // 装箱方式默认整箱
  438. srcType: 'OWN', // 业务来源默认公司 来源 内容 默认登录人所属公司
  439. numberOfObl: 'THREE', // 正本份数 默认 THREE
  440. numberOfCopy: 'THREE', // 副本份数 默认 THREE
  441. seaType: 'E', // 进出口 默认出口 E=出口 I=进口"
  442. cargoType: 'dry', // 货物类型默认普货
  443. marks: 'N/M',
  444. dgPackingLevel: '0', // 危险品包装等级
  445. serviceTerms: 'CY-CY', // 服务方式
  446. filesList: [], // 文件中心
  447. feeCenterListD: [], // 收
  448. feeCenterListC: [], // 付
  449. preContainersList: [], // 箱
  450. feeCenterAmendList: [],
  451. placeReceiptName: '',
  452. placeReceiptNamePrint: '',
  453. polEnName: '',
  454. polNamePrint: '',
  455. podEnName: '',
  456. podNamePrint: '',
  457. destinationName: '',
  458. destinationNamePrint: '',
  459. placeDeliveryName: '',
  460. placeDeliveryNamePrint: '',
  461. potEnName: '',
  462. potNamePrint: '',
  463. detail: {},
  464. hmmEdi: {},
  465. },
  466. // 循环的配置
  467. basicData: {
  468. column: [
  469. {
  470. label: "客户名称", // 调往来单位接口
  471. prop: "corpCnName",
  472. text: "请选择客户名称",
  473. type: 'select',
  474. dicData: [],
  475. disabled: false,
  476. buttonIf: true,
  477. joinData: true,
  478. slot: 'bcorps',
  479. forParameter: {
  480. key: 'id',
  481. label: 'cnName',
  482. value: 'cnName',
  483. short: 'shortName'
  484. },
  485. rules: [{
  486. required: true,
  487. message: " ",
  488. trigger: "blur"
  489. }]
  490. },
  491. [
  492. {
  493. label: "客户OP", // 客户联系人姓名 电话和邮箱带出来,可以修改 往来单位接口 需要传一个客户名称的值过去
  494. prop: "corpAttnName",
  495. text: "姓名",
  496. type: 'select',
  497. dicData: [],
  498. span: 10,
  499. disabled: false,
  500. clearable: false,
  501. allowCreate: true,
  502. forParameter: {
  503. key: 'id',
  504. label: 'cname',
  505. value: 'cname',
  506. },
  507. },
  508. {
  509. label: "", //客户联系人电话
  510. prop: "corpAttnTel",
  511. text: "电话",
  512. labelWidth: '10px',
  513. disabled: false,
  514. clearable: false,
  515. span: 7,
  516. // rules: [{
  517. // required: true,
  518. // message: "",
  519. // trigger: "blur"
  520. // }]
  521. },
  522. {
  523. label: "", // 客户联系人邮箱
  524. prop: "corpAttnEmail",
  525. text: "邮箱",
  526. labelWidth: '10px',
  527. disabled: false,
  528. clearable: false,
  529. span: 7,
  530. // rules: [{
  531. // required: true,
  532. // message: " ",
  533. // trigger: "blur"
  534. // }]
  535. },
  536. ],
  537. [
  538. {
  539. label: "业务来源", // OWN=公司 AGENT=代理 SALES=业务员
  540. prop: "srcType",
  541. text: "请选择业务来源",
  542. type: 'select',
  543. disabled: true,
  544. forParameter: {
  545. key: 'dictKey',
  546. label: 'dictValue',
  547. value: 'dictKey',
  548. },
  549. dicData: [],
  550. },
  551. {
  552. label: "",
  553. prop: "srcCnName", // 来源中文 公司不是下拉写死公司两字 业务员调用户管理列表 代理调往来单位四个代理数据
  554. text: "请选择来源",
  555. labelWidth: '30px',
  556. type: 'select',
  557. disabled: true,
  558. dicData: [],
  559. forParameter: {
  560. key: 'id',
  561. label: 'cnName',
  562. value: 'cnName',
  563. },
  564. },
  565. ],
  566. [
  567. {
  568. label: "MB/L NO",
  569. text: "请输入MB/L NO",
  570. prop: "mblno",
  571. span: 18,
  572. disabled: false,
  573. },
  574. {
  575. label: "", // MB/L 付款方式 PP=预付, CC=到付, FPA, Other
  576. text: "请选择付款方式",
  577. prop: "mpaymode",
  578. type: 'select',
  579. labelWidth: '30px',
  580. disabled: false,
  581. span: 6,
  582. dicData: [],
  583. forParameter: {
  584. key: 'dictKey',
  585. label: 'dictValue',
  586. value: 'dictKey',
  587. },
  588. },
  589. ],
  590. {
  591. label: "booking NO", // 订舱号
  592. text: "请输入booking NO",
  593. prop: "bookingNo",
  594. disabled: false,
  595. },
  596. [
  597. {
  598. label: "HB/L NO", //弹窗点击确认还是取消申请 调后台接口获取到一个编号
  599. prop: "HB/L NO",
  600. type: 'button',
  601. span: 4,
  602. disabled: false,
  603. },
  604. {
  605. label: "",
  606. text: "请输入HB/L NO",
  607. prop: "hblno",
  608. labelWidth: '26px',
  609. span: 14,
  610. disabled: true,
  611. },
  612. {
  613. label: "", // HB/L 付款方式 PP=预付, CC=到付, FPA, Other', 申请之后默认 PP
  614. text: "请选择付款方式",
  615. prop: "hpaymode",
  616. labelWidth: '30px',
  617. disabled: false,
  618. type: 'select',
  619. span: 6,
  620. dicData: [],
  621. forParameter: {
  622. key: 'dictKey',
  623. label: 'dictValue',
  624. value: 'dictKey',
  625. },
  626. },
  627. ],
  628. {
  629. label: "REF MBLNO", // Co-Loader 中文名称 往来单位 类别
  630. text: "请输入REF MBLNO",
  631. prop: "refno",
  632. disabled: false,
  633. },
  634. [
  635. {
  636. label: "业务编号",
  637. text: "业务编号",
  638. prop: "billNo",
  639. disabled: true,
  640. },
  641. {
  642. label: "所属团队",
  643. text: "请选择所属团队",
  644. prop: "teamName",
  645. disabled: false,
  646. type: 'select',
  647. dicData: [],
  648. forParameter: {
  649. key: 'id',
  650. label: 'postName',
  651. value: 'id',
  652. },
  653. rules: [{
  654. required: true,
  655. message: " ",
  656. trigger: "blur"
  657. }]
  658. },
  659. ],
  660. [
  661. {
  662. label: "OP", // 操作id 用户管理下拉 模糊搜索
  663. text: "请选择OP",
  664. prop: "operatorName",
  665. type: 'select',
  666. dicData: [],
  667. disabled: false,
  668. forParameter: {
  669. key: 'id',
  670. label: 'name',
  671. value: 'name',
  672. },
  673. rules: [{
  674. required: true,
  675. message: " ",
  676. trigger: "blur"
  677. }]
  678. },
  679. {
  680. label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
  681. text: "请选择核算部门",
  682. prop: "accDeptName",
  683. type: 'tree',
  684. dicData: [],
  685. disabled: false,
  686. clearable: false,
  687. forParameter: {
  688. label: "title",
  689. children: 'children'
  690. },
  691. rules: [{
  692. required: true,
  693. message: " ",
  694. trigger: "blur"
  695. }]
  696. },
  697. ],
  698. ]
  699. },
  700. activeName: 'first',
  701. bigtabs: 'wt',
  702. saberUserInfo: {}, // 当前登录人信息
  703. roleName: [], // 当前的角色权限
  704. // 需要加判断是否必填的数据
  705. messageData: [
  706. {
  707. name: '客户',
  708. value: 'corpCnName',
  709. },
  710. {
  711. name: '业务来源',
  712. value: 'srcType',
  713. },
  714. {
  715. name: 'MBLNO',
  716. value: 'mblno',
  717. },
  718. // {
  719. // name: 'booking NO',
  720. // value: 'bookingNo',
  721. // },
  722. // {
  723. // name: 'REF MBLNO',
  724. // value: 'refno',
  725. // },
  726. {
  727. name: '船名(VSL)',
  728. value: 'vesselCnName',
  729. },
  730. {
  731. name: '航次(VOY)',
  732. value: 'voyageNo',
  733. },
  734. {
  735. name: 'ETD',
  736. value: 'etd',
  737. },
  738. {
  739. name: '装货港',
  740. value: 'polCnName',
  741. },
  742. {
  743. name: '目的港',
  744. value: 'destinationNamePrint',
  745. },
  746. {
  747. name: '包装单位',
  748. value: 'packingUnit',
  749. },
  750. {
  751. name: '船公司',
  752. value: 'carrierCnName',
  753. },
  754. {
  755. name: '场站',
  756. value: 'cyCnName',
  757. },
  758. ],
  759. imporiData: [{ id: 0, name: '导入 ONE 模板' }, { id: 1, name: '导入 PIL 订舱模板' }, { id: 2, name: '导入截单格式' }, { id: 3, name: '导入海信提单' }],
  760. excelForm: {},
  761. excelLoading: false,
  762. excelOption: {
  763. submitBtn: false,
  764. emptyBtn: false,
  765. column: [
  766. {
  767. label: "模板上传",
  768. prop: "excelFile",
  769. type: "upload",
  770. drag: true,
  771. loadText: "模板上传中,请稍等",
  772. span: 24,
  773. propsHttp: {
  774. res: "data"
  775. },
  776. tip: "请上传 .xls,.xlsx 标准格式文件",
  777. action: "api/blade-los/templateImport/importOne"
  778. }
  779. ]
  780. },
  781. excelBox: false,
  782. saberTenantId: 0,
  783. }
  784. },
  785. watch: {
  786. // 监听业务类型 如果不是分单 可以编辑分单号
  787. 'form.billType': {
  788. // 执行方法
  789. handler(oldValue, newValue) {
  790. // if (oldValue == 'MM') {
  791. // this.form.hblno = ''
  792. // }
  793. // 只有分单不能编辑
  794. // if (oldValue == 'MH') {
  795. // this.columnforfun('hblno').disabled = true
  796. // } else {
  797. // this.columnforfun('hblno').disabled = false
  798. // }
  799. // 王风刚 2025-02-21 所有分单号都不能手动输入,都可以申请
  800. },
  801. deep: true, // 深度监听
  802. immediate: true // 第一次改变就执行
  803. },
  804. // 监听箱信息数据 箱信息中有温度 自动切换 冻货
  805. 'form.preContainersList': {
  806. // 执行方法
  807. handler(oldValue, newValue) {
  808. // 判断是否是数组
  809. if (oldValue instanceof Array) {
  810. // 循环 有温度反 true 没有反 false
  811. const arr = oldValue.map(item => {
  812. if (Number(item.temperature)) {
  813. return true
  814. } else {
  815. return false
  816. }
  817. })
  818. console.log(arr, 12345)
  819. // 判断是否有温度
  820. if (arr[0]) {
  821. // 判断之前是否是冻货
  822. if (this.form.cargoType == 'reefer') return
  823. this.$message({
  824. message: '箱信息里有温度已将货描切换为冻柜',
  825. type: 'warning'
  826. });
  827. this.$set(this.form, 'cargoType', 'reefer')
  828. }
  829. }
  830. },
  831. deep: true, // 深度监听
  832. immediate: true // 第一次改变就执行,
  833. }
  834. },
  835. created() {
  836. let Obj = JSON.parse(localStorage.getItem('saber-tenantId'))
  837. this.saberTenantId = Obj ? Obj.content : 0;
  838. this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
  839. this.roleName = localStorage.getItem('roleName').split(',')
  840. isProcurement({ "param": "verify.symbol" }).then(res => {
  841. this.verifySymbolStatus = res.data.data
  842. })
  843. if (this.detailData.billType) {
  844. this.form.billType = this.detailData.billType
  845. }
  846. // 判断是否员id, 有id 就不显示
  847. if (!this.form.id) {
  848. this.deptGetDetailPolfun() // 收货地 装货港 当前登录人的默认
  849. this.userGetListfun(undefined, true) // 获取用户管理数据
  850. }
  851. this.ownDeptLazyTreefun() // 获取公司数据
  852. this.getLazylistfun() // 获取审核数据
  853. this.mpaymodeWorkDictsfun() // 获取 付款方式字典
  854. this.srcTypeWorkDictsfun()
  855. // 获取EDI 数据
  856. this.editypesListfun()
  857. // 获取所属团队数据
  858. this.postSelectByUserfun()
  859. },
  860. methods: {
  861. inLock() {
  862. this.showLock = true;
  863. const data = {
  864. moduleName: "SE",
  865. tableName: "SE_order",
  866. billId: this.form.id,
  867. no: localStorage.getItem("browserID"),
  868. billNo: this.form.mblno
  869. };
  870. this.inDetailsKey(this.$route.name, {
  871. moduleName: "SE",
  872. tableName: "SE_order",
  873. billId: this.form.id,
  874. billNo: this.form.mblno
  875. });
  876. this.checkLock(data).then(res => {
  877. if (res.data.code == 200) {
  878. this.onLock(data).then(res => {
  879. if (res.data.code == 200) {
  880. this.showLock = false
  881. }
  882. });
  883. }
  884. });
  885. },
  886. addEdit() {
  887. if (this.form.billStatus >= 3) {
  888. this.$emit('toAddEdit')
  889. } else {
  890. if (contrastObj(this.form, this.oldForm)
  891. || contrastList(this.form.preContainersList, this.oldForm.preContainersList) || contrastList(this.form.containersList, this.oldForm.containersList)
  892. || contrastList(this.form.feeCenterListC, this.oldForm.feeCenterListC)
  893. || contrastList(this.form.feeCenterListD, this.oldForm.feeCenterListD)
  894. || contrastList(this.form.filesList, this.oldForm.filesList)
  895. || contrastList(this.form.waitingBoxList, this.oldForm.waitingBoxList)
  896. ) {
  897. this.$confirm('是否需要保存?', '提示', {
  898. confirmButtonText: '确定',
  899. cancelButtonText: '取消',
  900. type: 'warning'
  901. }).then(() => {
  902. this.editCustomer('toAddEdit')
  903. }).catch(() => {
  904. this.$emit('toAddEdit')
  905. });
  906. } else {
  907. this.$emit('toAddEdit')
  908. }
  909. }
  910. },
  911. CopyDocumentsfun() {
  912. if (!this.form.id) {
  913. return this.$message.error("请保存数据");
  914. }
  915. this.$DialogForm.show({
  916. title: '复制单据',
  917. width: '300px',
  918. menuPosition: 'right',
  919. data: { checkbox: '复制费用,复制箱型箱量' },
  920. option: {
  921. submitText: '确认',
  922. emptyText: '取消',
  923. span: 24,
  924. column: [{
  925. label: "复制类型",
  926. prop: "checkbox",
  927. type: 'checkbox',
  928. dicData: [{
  929. label: '复制费用',
  930. value: '复制费用',
  931. }, {
  932. label: '复制箱型箱量',
  933. value: '复制箱型箱量'
  934. }],
  935. dataType: 'string',
  936. span: 24,
  937. }]
  938. },
  939. beforeClose: (done) => {
  940. done()
  941. },
  942. callback: (res) => {
  943. res.done()
  944. this.billsCopyBillsfun(this.form.id, res.data.checkbox)
  945. res.close()
  946. }
  947. })
  948. },
  949. //文档导入
  950. importData(row) {
  951. if (row == 0) {
  952. this.excelOption.column[0].action = `/api/blade-los/templateImport/importOne?billId=${this.form.id}`
  953. } else if (row == 1) {
  954. this.excelOption.column[0].action = `/api/blade-los/templateImport/importPilBooking?billId=${this.form.id}`
  955. } else if (row == 2) {
  956. this.excelOption.column[0].action = `/api/blade-los/templateImport/importPilCutOffOrders?billId=${this.form.id}`
  957. } else if (row == 3) {
  958. this.excelOption.column[0].action = `/api/blade-los/templateImport/importHisenseBill?billId=${this.form.id}`
  959. }
  960. this.excelBox = true
  961. },
  962. uploadBefore(file, done, loading) {
  963. done();
  964. loading = true;
  965. },
  966. removeEmptyValues(obj) {
  967. Object.keys(obj).forEach(key => {
  968. if (obj[key] === null || obj[key] === undefined || obj[key] === '') {
  969. delete obj[key];
  970. }
  971. });
  972. return obj;
  973. },
  974. // 上传成功
  975. onSuccess(res, done, loading, column) {
  976. if (Object.keys(res).length) {
  977. this.$confirm('此操作将覆盖数据, 是否继续?', '提示', {
  978. confirmButtonText: '确定',
  979. cancelButtonText: '取消',
  980. type: 'warning'
  981. }).then(() => {
  982. // this.form = res;
  983. Object.keys(res).forEach(key => {
  984. if (res[key]) {
  985. if (key != 'detail') {
  986. // this.form[key] = res[key]
  987. this.$set(this.form, key, res[key])
  988. }
  989. if (key == 'detail') {
  990. Object.keys(res.detail).forEach(key => {
  991. if (res.detail[key]) {
  992. // this.form.detail[key] = res.detail[key]
  993. this.$set(this.form.detail, key, res.detail[key])
  994. }
  995. });
  996. }
  997. }
  998. });
  999. this.excelBox = false;
  1000. this.$message.success("导入成功!");
  1001. loading = false;
  1002. done();
  1003. }).catch(() => {
  1004. this.excelBox = false;
  1005. loading = false;
  1006. done();
  1007. });
  1008. } else {
  1009. loading = false;
  1010. done();
  1011. }
  1012. },
  1013. // 获取EDI列表数据
  1014. editypesListfun() {
  1015. editypesList(1, 1000).then(res => {
  1016. this.ediData = res.data.data.records
  1017. this.ediData_SO = res.data.data.records.filter(r => r.groupName == 'SO')
  1018. this.ediData_SI = res.data.data.records.filter(r => r.groupName == 'SI')
  1019. })
  1020. },
  1021. // 发送edi
  1022. editypesSendingEdifun(row) {
  1023. row.billId = this.form.id
  1024. let msgsList = []
  1025. if (checkFullWidthSymbols(this.form.detail.hshipperDetails).hasFullWidth) {
  1026. let msg = []
  1027. for (let item of checkFullWidthSymbols(this.form.detail.hshipperDetails).positions) {
  1028. msg.push(`第${item.row}行的"${item.symbol}"`)
  1029. }
  1030. this.$message({
  1031. dangerouslyUseHTMLString: true,
  1032. message: `发货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1033. type: 'error'
  1034. });
  1035. return
  1036. }
  1037. if (checkFullWidthSymbols(this.form.detail.hconsigneeDetails).hasFullWidth) {
  1038. let msg = []
  1039. for (let item of checkFullWidthSymbols(this.form.detail.hconsigneeDetails).positions) {
  1040. msg.push(`第${item.row}行的"${item.symbol}"`)
  1041. }
  1042. this.$message({
  1043. dangerouslyUseHTMLString: true,
  1044. message: `收货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1045. type: 'error'
  1046. });
  1047. return
  1048. }
  1049. if (checkFullWidthSymbols(this.form.detail.hnotifyDetails).hasFullWidth) {
  1050. let msg = []
  1051. for (let item of checkFullWidthSymbols(this.form.detail.hnotifyDetails).positions) {
  1052. msg.push(`第${item.row}行的"${item.symbol}"`)
  1053. }
  1054. this.$message({
  1055. dangerouslyUseHTMLString: true,
  1056. message: `通知人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1057. type: 'error'
  1058. });
  1059. return
  1060. }
  1061. if (checkFullWidthSymbols(this.form.detail.mshipperDetails).hasFullWidth) {
  1062. let msg = []
  1063. for (let item of checkFullWidthSymbols(this.form.detail.mshipperDetails).positions) {
  1064. msg.push(`第${item.row}行的"${item.symbol}"`)
  1065. }
  1066. if (msg.length > 0) {
  1067. this.$message({
  1068. dangerouslyUseHTMLString: true,
  1069. message: `MBL 发货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1070. type: 'error'
  1071. });
  1072. return
  1073. }
  1074. }
  1075. if (checkFullWidthSymbols(this.form.detail.mconsigneeDetails).hasFullWidth) {
  1076. let msg = []
  1077. for (let item of checkFullWidthSymbols(this.form.detail.mconsigneeDetails).positions) {
  1078. msg.push(`第${item.row}行的"${item.symbol}"`)
  1079. }
  1080. if (msg.length > 0) {
  1081. this.$message({
  1082. dangerouslyUseHTMLString: true,
  1083. message: `MBL 收货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1084. type: 'error'
  1085. });
  1086. return
  1087. }
  1088. }
  1089. if (checkFullWidthSymbols(this.form.detail.mnotifyDetails).hasFullWidth) {
  1090. let msg = []
  1091. for (let item of checkFullWidthSymbols(this.form.detail.mnotifyDetails).positions) {
  1092. msg.push(`第${item.row}行的"${item.symbol}"`)
  1093. }
  1094. if (msg.length > 0) {
  1095. this.$message({
  1096. dangerouslyUseHTMLString: true,
  1097. message: `MBL 通知人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1098. type: 'error'
  1099. });
  1100. return
  1101. }
  1102. }
  1103. if (checkFullWidthSymbols(this.form.marks).hasFullWidth) {
  1104. let msg = []
  1105. for (let item of checkFullWidthSymbols(this.form.marks).positions) {
  1106. msg.push(`第${item.row}行的"${item.symbol}"`)
  1107. }
  1108. this.$message({
  1109. dangerouslyUseHTMLString: true,
  1110. message: `唛头:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1111. type: 'error'
  1112. });
  1113. return
  1114. }
  1115. if (checkFullWidthSymbols(this.form.commodityDescr).hasFullWidth) {
  1116. let msg = []
  1117. for (let item of checkFullWidthSymbols(this.form.commodityDescr).positions) {
  1118. msg.push(`第${item.row}行的"${item.symbol}"`)
  1119. }
  1120. this.$message({
  1121. dangerouslyUseHTMLString: true,
  1122. message: `货描:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1123. type: 'error'
  1124. });
  1125. return
  1126. }
  1127. if (checkFullWidthSymbols(this.form.forwarding).hasFullWidth) {
  1128. let msg = []
  1129. for (let item of checkFullWidthSymbols(this.form.forwarding).positions) {
  1130. msg.push(`第${item.row}行的"${item.symbol}"`)
  1131. }
  1132. this.$message({
  1133. dangerouslyUseHTMLString: true,
  1134. message: `FORWARDING:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1135. type: 'error'
  1136. });
  1137. return
  1138. }
  1139. if (!verifyEnglish(this.form.detail.hshipperDetails)) {
  1140. msgsList.push('发货人')
  1141. }
  1142. if (!verifyEnglish(this.form.detail.hconsigneeDetails)) {
  1143. msgsList.push('收货人')
  1144. }
  1145. if (!verifyEnglish(this.form.detail.hnotifyDetails)) {
  1146. msgsList.push('通知人')
  1147. }
  1148. if (!verifyEnglish(this.form.detail.mshipperDetails)) {
  1149. msgsList.push('MBL 发货人')
  1150. }
  1151. if (!verifyEnglish(this.form.detail.mconsigneeDetails)) {
  1152. msgsList.push('MBL 收货人')
  1153. }
  1154. if (!verifyEnglish(this.form.detail.mnotifyDetails)) {
  1155. msgsList.push('MBL 通知人')
  1156. }
  1157. if (!verifyEnglish(this.form.marks)) {
  1158. msgsList.push('唛头')
  1159. }
  1160. if (!verifyEnglish(this.form.commodityDescr)) {
  1161. msgsList.push('货描')
  1162. }
  1163. if (!verifyEnglish(this.form.forwarding)) {
  1164. msgsList.push('FORWARDING')
  1165. }
  1166. if (msgsList.length > 0) {
  1167. this.$message.error(`请正确输入${msgsList.join(",")}的英文`);
  1168. return;
  1169. }
  1170. this.saveLoading = true
  1171. editypesSendingEdi(row).then(res => {
  1172. this.saveLoading = false
  1173. // 判断data是否有值,没有值说明不成功给个弹窗返回
  1174. if (!res.data.data) {
  1175. let text = res.data.msg.replace("\r\n", "<br>");
  1176. console.log(text)
  1177. this.$message({
  1178. type: 'warning',
  1179. dangerouslyUseHTMLString: true,
  1180. message: text,
  1181. // 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>`,
  1182. duration: 5000
  1183. });
  1184. } else {
  1185. this.$message.success('操作成功,请去文件中心查看')
  1186. this.billsDetailfun(this.form.id) // 详情接口
  1187. }
  1188. }).catch((err) => {
  1189. this.saveLoading = false
  1190. })
  1191. },
  1192. // 报表弹窗
  1193. previewDialogfun() {
  1194. this.previewDialog = true
  1195. },
  1196. //请核关闭
  1197. choceScheduleFun() {
  1198. this.checkScheduleDialog = false
  1199. },
  1200. // 收货地 装货港 当前登录人的默认
  1201. deptGetDetailPolfun() {
  1202. deptGetDetailPol(this.saberUserInfo.dept_pid.split(',')[0]).then(res => {
  1203. // 收货地
  1204. this.form.placeReceiptName = res.data.data.polEnName
  1205. this.form.placeReceiptId = res.data.data.polId
  1206. this.form.placeReceiptCode = res.data.data.polCode
  1207. this.form.placeReceiptNamePrint = res.data.data.polEnName
  1208. // 装货港
  1209. this.form.polCnName = res.data.data.polCnName
  1210. this.form.polEnName = res.data.data.polEnName
  1211. this.form.polId = res.data.data.polId
  1212. this.form.polCode = res.data.data.polCode
  1213. this.form.polNamePrint = res.data.data.polEnName
  1214. // 签单地点 默认 装货港
  1215. this.$set(this.form, 'issueAtId', this.form.polId)
  1216. this.$set(this.form, 'issueAt', this.form.polEnName)
  1217. // 主单单付费地点 默认 如果主单付费方式 为PP 取装货港 如果主单付费地点为CC 取卸货港
  1218. if (this.form.mpaymode == 'PP') {
  1219. this.$set(this.form, 'mpayplace', this.form.polEnName)
  1220. }
  1221. // 分单单付费地点 默认 如果分单付费方式 为PP 取装货港 如果分单付费地点为CC 取卸货港
  1222. if (this.form.hpaymode == 'PP') {
  1223. this.$set(this.form, 'hpayplace', this.form.polEnName)
  1224. }
  1225. })
  1226. },
  1227. // 获取用户管理数据
  1228. userGetListfun(account = undefined, type = false,) {
  1229. userGetList(1, 10, { account }, this.saberUserInfo.dept_pid.split(',')[0]).then(res => {
  1230. this.columnforfun('operatorName').dicData = res.data.data.records
  1231. if (type) {
  1232. // 核算部门 默认登录人的部门
  1233. for (let item of this.columnforfun('operatorName').dicData) {
  1234. if (item.name == this.form.operatorName) {
  1235. this.$set(this.form, 'accDeptName', item.deptName)
  1236. this.$set(this.form, 'accDept', item.deptId)
  1237. this.$set(this.form, 'operatorDept', item.deptId.split(',').pop())
  1238. this.$set(this.form, 'operatorDeptName', item.deptId)
  1239. }
  1240. }
  1241. }
  1242. })
  1243. },
  1244. // 获取所属岗位数据
  1245. postSelectByUserfun() {
  1246. postSelectByUser(JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id).then(res => {
  1247. this.columnforfun('teamName').dicData = res.data.data
  1248. // 判断是否有值,没有的话默认第一个
  1249. if (!this.form.teamName) {
  1250. this.$set(this.form, 'teamId', res.data.data[0].id)
  1251. this.$set(this.form, 'teamName', res.data.data[0].postName)
  1252. }
  1253. })
  1254. },
  1255. // 获取付款方式字典数据
  1256. mpaymodeWorkDictsfun() {
  1257. getWorkDicts('payment_method_los').then((res) => {
  1258. this.columnforfun('mpaymode').dicData = res.data.data
  1259. this.columnforfun('hpaymode').dicData = res.data.data
  1260. })
  1261. },
  1262. // 获取核算部分数据 // 机构管理接口
  1263. getLazylistfun() {
  1264. getDeptTree().then(res => {
  1265. this.columnforfun('accDeptName').dicData = res.data.data
  1266. })
  1267. },
  1268. // 获取客户名称数据 往来单位数据
  1269. getBcorpsListfun(cnName) {
  1270. getBcorpsList(1, 20, { shortName: cnName, status: 0 }).then(res => {
  1271. this.columnforfun('corpCnName').dicData = res.data.data.records
  1272. })
  1273. },
  1274. // 获取客户联系人 客户OP
  1275. getBcorpsattnListfun(cname) {
  1276. getBcorpsattnList(1, 10, { pid: this.form.corpId, cname }).then(res => {
  1277. this.columnforfun('corpAttnName').dicData = res.data.data.records
  1278. // if (res.data.data.records.length == 0) {
  1279. // this.form.corpAttnName = ''
  1280. // this.form.corpAttnId = ''
  1281. // this.$set(this.form, 'corpAttnTel', '')
  1282. // this.$set(this.form, 'corpAttnEmail', '')
  1283. // return
  1284. // }
  1285. // this.form.corpAttnName = res.data.data.records[0].cname
  1286. // this.form.corpAttnId = res.data.data.records[0].id
  1287. // this.$set(this.form, 'corpAttnTel', res.data.data.records[0].tel)
  1288. // this.$set(this.form, 'corpAttnEmail', res.data.data.records[0].email)
  1289. })
  1290. },
  1291. // 获取地点信息
  1292. getBlocationsListfun(cnName) {
  1293. getBlocationsList(1, 10, { cnName }).then(res => {
  1294. this.columnforfun('mPayplace').dicData = res.data.data.records
  1295. })
  1296. },
  1297. // 获取业务来源数据
  1298. srcTypeWorkDictsfun() {
  1299. getWorkDicts('src_type_los').then(res => {
  1300. this.columnforfun('srcType').dicData = res.data.data
  1301. })
  1302. },
  1303. // 获取业务来源代理数据
  1304. agentBcorpsListfun(cnName) {
  1305. let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  1306. getBcorpslistByType(1, 20, { cnName, status: 0, corpTypeName }).then(res => {
  1307. this.columnforfun('srcCnName').dicData = res.data.data.records
  1308. })
  1309. },
  1310. // 获取业务来源业务员数据
  1311. salesUserGetListfun(account) {
  1312. if (this.$store.getters.userInfo.tenant_id === "263057") {
  1313. userGetList(1, 10, { roleId: '业务员' }).then(res => {
  1314. this.columnforfun('srcCnName').dicData = res.data.data.records
  1315. })
  1316. } else {
  1317. selectListLos('业务员', account).then(res => {
  1318. this.columnforfun('srcCnName').dicData = res.data.data
  1319. })
  1320. }
  1321. },
  1322. // 获取公司名称 用户管理左侧
  1323. ownDeptLazyTreefun() {
  1324. getDeptLazyTree(0).then(res => {
  1325. this.columnforfun('srcCnName').dicData = res.data.data
  1326. // 来源 内容 默认登录人所属公司
  1327. for (let item of this.columnforfun('srcCnName').dicData) {
  1328. if (item.id == JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]) {
  1329. this.$set(this.form, 'srcId', item.id)
  1330. this.$set(this.form, 'srcCnName', item.title)
  1331. this.$set(this.form, 'srcEnName', item.title)
  1332. }
  1333. }
  1334. })
  1335. },
  1336. // 申请B/L NO
  1337. billsGetBillNofun() {
  1338. let billNoFormat = ''
  1339. if (this.form.cargoType == 'dry') {
  1340. billNoFormat = 'HYCK-PH'
  1341. } else if (this.form.cargoType == 'danger') {
  1342. billNoFormat = 'HYCK-WXP'
  1343. } else if (this.form.cargoType == 'reefer') {
  1344. billNoFormat = 'HYCK-DG'
  1345. }
  1346. billsGetBillNo({
  1347. businessTypeCode: 'HYCK',
  1348. billNoFormat: billNoFormat
  1349. }).then(res => {
  1350. this.columnforfun('hpaymode').disabled = false
  1351. this.$set(this.form, 'hblno', res.data.data)
  1352. this.billsSubmitfun()
  1353. })
  1354. },
  1355. // 下拉多选弹窗的确认
  1356. eldialogConfirm(name) {
  1357. if (name == 'bcorps') {
  1358. if (this.$refs.bcorps[0].isShow) {
  1359. console.log('列表确认')
  1360. this.form.corpCnName = this.$refs.bcorps[0].selectionList[0].cnName
  1361. this.form.corpEnName = this.$refs.bcorps[0].selectionList[0].enName
  1362. this.form.corpId = this.$refs.bcorps[0].selectionList[0].id
  1363. this.form.corpCode = this.$refs.bcorps[0].selectionList[0].code
  1364. this.form.corpSource = this.$refs.bcorps[0].selectionList[0].corpSource
  1365. // 获取 客户op数据
  1366. this.getBcorpsattnListfun()
  1367. // 业务来源参数带出
  1368. this.$set(this.form, 'srcType', this.$refs.bcorps[0].selectionList[0].sourceType)
  1369. this.$set(this.form, 'srcId', this.$refs.bcorps[0].selectionList[0].srcId)
  1370. this.$set(this.form, 'srcCnName', this.$refs.bcorps[0].selectionList[0].srcCnName)
  1371. this.$set(this.form, 'srcEnName', this.$refs.bcorps[0].selectionList[0].srcEnName)
  1372. this.columnforfun('srcType').disabled = false
  1373. this.columnforfun('srcCnName').disabled = false
  1374. // 航线带出往来单位的优势航线
  1375. this.$set(this.form, 'lineCnName', this.$refs.bcorps[0].selectionList[0].advantageRoute)
  1376. // 带出发货人数据
  1377. this.$set(this.form.detail, 'hshipperId', this.$refs.bcorps[0].selectionList[0].id)
  1378. this.$set(this.form.detail, 'hshipperCnName', this.$refs.bcorps[0].selectionList[0].cnName)
  1379. this.$set(this.form.detail, 'hshipperEnName', this.$refs.bcorps[0].selectionList[0].enName)
  1380. this.$set(this.form.detail, 'hshipperCode', this.$refs.bcorps[0].selectionList[0].code)
  1381. this.$set(this.form.detail, 'hshipperDetails', this.$refs.bcorps[0].selectionList[0].details)
  1382. this.$set(this.form.detail, 'hshipperCntyName', this.$refs.bcorps[0].selectionList[0].cntyName)
  1383. this.$set(this.form.detail, 'hshipperCntyCode', this.$refs.bcorps[0].selectionList[0].cntyCode)
  1384. this.columnforfun('corpAttnName').disabled = false
  1385. this.columnforfun('corpAttnTel').disabled = false
  1386. this.columnforfun('corpAttnEmail').disabled = false
  1387. } else {
  1388. console.log('详情确认')
  1389. console.log(this.$refs.bcorps, 962)
  1390. this.$refs.bcorps[0].$refs.detail.submitForm()
  1391. this.form.corpCnName = this.$refs.bcorps[0].$refs.detail.formData.cnName
  1392. this.form.corpEnName = this.$refs.bcorps[0].$refs.detail.formData.enName
  1393. this.form.corpId = this.$refs.bcorps[0].$refs.detail.formData.id
  1394. this.form.corpCode = this.$refs.bcorps[0].$refs.detail.formData.code
  1395. this.form.corpSource = this.$refs.bcorps[0].$refs.detail.formData.corpSource
  1396. // 获取 客户op数据
  1397. this.getBcorpsattnListfun()
  1398. // 业务来源参数带出
  1399. this.$set(this.form, 'srcType', this.$refs.bcorps[0].$refs.detail.formData.sourceType)
  1400. this.$set(this.form, 'srcId', this.$refs.bcorps[0].$refs.detail.formData.srcId)
  1401. this.$set(this.form, 'srcCnName', this.$refs.bcorps[0].$refs.detail.formData.srcCnName)
  1402. this.$set(this.form, 'srcEnName', this.$refs.bcorps[0].$refs.detail.formData.srcEnName)
  1403. this.columnforfun('srcType').disabled = false
  1404. this.columnforfun('srcCnName').disabled = false
  1405. // 航线带出往来单位的优势航线
  1406. this.$set(this.form, 'lineCnName', this.$refs.bcorps[0].$refs.detail.formData.advantageRoute)
  1407. // 带出发货人数据
  1408. this.$set(this.form.detail, 'hshipperId', this.$refs.bcorps[0].$refs.detail.formData.id)
  1409. this.$set(this.form.detail, 'hshipperCnName', this.$refs.bcorps[0].$refs.detail.formData.cnName)
  1410. this.$set(this.form.detail, 'hshipperEnName', this.$refs.bcorps[0].$refs.detail.formData.enName)
  1411. this.$set(this.form.detail, 'hshipperCode', this.$refs.bcorps[0].$refs.detail.formData.code)
  1412. this.$set(this.form.detail, 'hshipperDetails', this.$refs.bcorps[0].$refs.detail.formData.details)
  1413. this.$set(this.form.detail, 'hshipperCntyName', this.$refs.bcorps[0].$refs.detail.formData.cntyName)
  1414. this.$set(this.form.detail, 'hshipperCntyCode', this.$refs.bcorps[0].$refs.detail.formData.cntyCode)
  1415. this.columnforfun('corpAttnName').disabled = false
  1416. this.columnforfun('corpAttnTel').disabled = false
  1417. this.columnforfun('corpAttnEmail').disabled = false
  1418. }
  1419. }
  1420. this.$refs.searchQueryRef[0].corpVisible = false
  1421. },
  1422. // 下拉多选弹窗数据多选回调
  1423. eldialogMultipleChoice(list, name) {
  1424. if (name == 'bcorps') {
  1425. let arr = []
  1426. if (list.length > 1) {
  1427. this.$refs.bcorps[0].$refs.crud.toggleSelection() // 先清空所以选择的数据
  1428. arr = [list[list.length - 1]] // 获取最新点击的数组
  1429. this.$refs.bcorps[0].$refs.crud.toggleSelection(arr, true) // 把刚点击的数组变成选择状态
  1430. } else {
  1431. arr = list
  1432. }
  1433. this.$refs.bcorps[0].selectionList = arr
  1434. }
  1435. },
  1436. /* 远程模糊查询操作用户 */
  1437. remoteMethod(value, name) {
  1438. if (name == 'operatorName') {
  1439. this.userGetListfun(value)
  1440. } else if (name == 'accDeptName') {
  1441. this.getLazylistfun(value)
  1442. } else if (name == 'corpCnName') {
  1443. this.getBcorpsListfun(value)
  1444. } else if (name == 'mPayplace') {
  1445. this.getBlocationsListfun(value)
  1446. } else if (name == 'corpAttnName') {
  1447. this.getBcorpsattnListfun(value)
  1448. } else if (name == 'srcType') {
  1449. this.srcTypeWorkDictsfun()
  1450. } else if (name == 'srcCnName') {
  1451. if (this.form.srcType == 'SALES') {
  1452. // 业务员
  1453. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'name', value: 'name' }
  1454. this.salesUserGetListfun(value)
  1455. } else if (this.form.srcType == 'AGENT') {
  1456. // 代理
  1457. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  1458. this.agentBcorpsListfun(value)
  1459. } else if (this.form.srcType == 'OWN') {
  1460. // 公司
  1461. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'title', value: 'title' }
  1462. this.ownDeptLazyTreefun()
  1463. } else { }
  1464. } else if (name == 'teamName') {
  1465. this.postSelectByUserfun()
  1466. } else {
  1467. }
  1468. },
  1469. // 下拉的监听事件
  1470. corpChange(value, name) {
  1471. if (name == 'operatorName') {
  1472. // OP 下拉赋值 用户管理列表
  1473. for (let item of this.columnforfun('operatorName').dicData) {
  1474. if (item.name == value) {
  1475. this.form.operatorName = item.name
  1476. this.form.operatorId = item.id
  1477. this.form.operatorDept = item.deptId.split(',').pop()
  1478. this.form.operatorDeptName = item.deptName
  1479. }
  1480. }
  1481. }
  1482. else if (name == 'accDeptName') {
  1483. // OP 下拉赋值 用户管理列表
  1484. for (let item of this.columnforfun('accDeptName').dicData) {
  1485. if (item.title == value) {
  1486. this.form.accDeptName = item.title
  1487. this.form.accDept = item.id
  1488. }
  1489. }
  1490. }
  1491. else if (name == 'corpCnName') {
  1492. if (value) {
  1493. // this.columnforfun('corpAttnName').disabled = false
  1494. // this.columnforfun('corpAttnTel').disabled = false
  1495. // this.columnforfun('corpAttnEmail').disabled = false
  1496. } else {
  1497. // this.columnforfun('corpAttnName').disabled = true
  1498. // this.columnforfun('corpAttnTel').disabled = true
  1499. // this.columnforfun('corpAttnEmail').disabled = true
  1500. // 如果点击清空按钮把值赋值为空
  1501. this.form.corpCnName = ''
  1502. this.form.corpEnName = ''
  1503. this.form.corpId = ''
  1504. this.form.corpCode = ''
  1505. this.form.shortName = ''
  1506. this.form.corpSource = ""
  1507. // 清空 客户OP
  1508. // this.form.corpAttnName = ''
  1509. this.form.corpAttnId = ''
  1510. this.$set(this.form, 'corpAttnTel', '')
  1511. this.$set(this.form, 'corpAttnEmail', '')
  1512. // 清空 业务来源和来源详情
  1513. this.$set(this.form, 'srcType', '')
  1514. this.$set(this.form, 'srcId', '')
  1515. this.$set(this.form, 'srcCnName', '')
  1516. this.$set(this.form, 'srcEnName', '')
  1517. }
  1518. // 往来单位
  1519. for (let item of this.columnforfun('corpCnName').dicData) {
  1520. if (item.cnName == value) {
  1521. this.form.corpCnName = item.cnName
  1522. this.form.corpEnName = item.enName
  1523. this.form.corpId = item.id
  1524. this.form.corpCode = item.code
  1525. this.form.shortName = item.shortName
  1526. this.form.corpSource = item.corpSource
  1527. // 获取 客户op数据
  1528. this.getBcorpsattnListfun()
  1529. // 业务来源参数带出
  1530. this.$set(this.form, 'srcType', item.sourceType)
  1531. this.$set(this.form, 'srcId', item.srcId)
  1532. this.$set(this.form, 'srcCnName', item.srcCnName)
  1533. this.$set(this.form, 'srcEnName', item.srcEnName)
  1534. this.$set(this.form, 'srcDeptId', item.deptId.split(',').pop())
  1535. this.$set(this.form, 'srcDeptName', item.deptName)
  1536. this.columnforfun('srcType').disabled = false
  1537. this.columnforfun('srcCnName').disabled = false
  1538. // 航线带出往来单位的优势航线
  1539. this.$set(this.form, 'lineCnName', item.advantageRoute)
  1540. // 带出发货人数据
  1541. // this.$set(this.form,'hshipperId',item.id)
  1542. // this.$set(this.form,'hshipperCnName',item.cnName)
  1543. // this.$set(this.form,'hshipperEnName',item.enName)
  1544. // this.$set(this.form,'hshipperCode',item.code)
  1545. // this.$set(this.form,'hshipperDetails',item.details)
  1546. // this.$set(this.form,'hshipperCntyName',item.cntyName)
  1547. // this.$set(this.form,'hshipperCntyCode',item.cntyCode)
  1548. }
  1549. }
  1550. }
  1551. else if (name == 'corpAttnName') {
  1552. if (this.columnforfun('corpAttnName').dicData.length) {
  1553. for (let item of this.columnforfun('corpAttnName').dicData) {
  1554. if (item.cname == value) {
  1555. this.form.corpAttnName = item.cname
  1556. this.form.corpAttnId = item.id
  1557. this.$set(this.form, 'corpAttnTel', item.tel)
  1558. this.$set(this.form, 'corpAttnEmail', item.email)
  1559. }
  1560. }
  1561. } else {
  1562. if (value) {
  1563. this.form.corpAttnName = value
  1564. this.form.corpAttnId = null
  1565. }
  1566. }
  1567. }
  1568. else if (name == 'srcType') {
  1569. if (!value) {
  1570. this.$set(this.form, 'srcType', '')
  1571. // this.columnforfun('srcCnName').disabled = true
  1572. return
  1573. }
  1574. this.$set(this.form, 'srcId', '')
  1575. this.$set(this.form, 'srcCnName', '')
  1576. this.$set(this.form, 'srcEnName', '')
  1577. this.form[name] = value
  1578. if (value == 'OWN') {
  1579. // 公司
  1580. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'title', value: 'title' }
  1581. this.ownDeptLazyTreefun()
  1582. } else if (value == 'AGENT') {
  1583. // 代理
  1584. this.columnforfun('srcCnName').type = 'select'
  1585. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  1586. this.columnforfun('srcCnName').disabled = false
  1587. this.agentBcorpsListfun()
  1588. } else if (value == 'SALES') {
  1589. // 业务员
  1590. this.columnforfun('srcCnName').type = 'select'
  1591. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'name', value: 'name' }
  1592. this.columnforfun('srcCnName').disabled = false
  1593. this.salesUserGetListfun()
  1594. }
  1595. }
  1596. else if (name == 'srcCnName') {
  1597. for (let item of this.columnforfun('srcCnName').dicData) {
  1598. if (item[this.columnforfun('srcCnName').forParameter.value] == value) {
  1599. if (this.form.srcType == 'SALES') {
  1600. // 业务员
  1601. this.$set(this.form, 'srcId', item.id)
  1602. this.$set(this.form, 'srcCnName', item.name)
  1603. this.$set(this.form, 'srcEnName', item.name)
  1604. this.$set(this.form, 'srcDeptId', item.deptId.split(',').pop())
  1605. this.$set(this.form, 'srcDeptName', item.deptName)
  1606. } else if (this.form.srcType == 'AGENT') {
  1607. // 代理
  1608. this.$set(this.form, 'srcId', item.id)
  1609. this.$set(this.form, 'srcCnName', item.cnName)
  1610. this.$set(this.form, 'srcEnName', item.enName)
  1611. }
  1612. }
  1613. }
  1614. }
  1615. else if (name == 'coloaderCnName') {
  1616. for (let item of this.columnforfun('coloaderCnName').dicData) {
  1617. if (item.cnName == value) {
  1618. this.$set(this.form, 'coloaderId', item.id)
  1619. this.$set(this.form, 'coloaderCnName', item.cnName)
  1620. this.$set(this.form, 'coloaderEnName', item.enName)
  1621. }
  1622. }
  1623. }
  1624. else if (name == 'mpaymode') {
  1625. // 主单付费方式
  1626. this.form[name] = value
  1627. if (value == 'PP') {
  1628. this.$set(this.form, 'mpayplace', this.form.polEnName ? this.form.polEnName.split(' - ')[0] : '')
  1629. } else {
  1630. this.$set(this.form, 'mpayplace', this.form.podEnName ? this.form.podEnName.split(' - ')[0] : '')
  1631. }
  1632. }
  1633. else if (name == 'hpaymode') {
  1634. // 分单付费方式
  1635. this.form[name] = value
  1636. if (value == 'PP') {
  1637. this.$set(this.form, 'hpayplace', this.form.polEnName.split(' - ')[0])
  1638. } else {
  1639. this.$set(this.form, 'hpayplace', this.form.podEnName.split(' - ')[0])
  1640. }
  1641. }
  1642. else if (name == 'teamName') {
  1643. if (!value) {
  1644. this.$set(this.form, 'teamId', '')
  1645. this.$set(this.form, 'teamName', '')
  1646. }
  1647. for (let item of this.columnforfun('teamName').dicData) {
  1648. if (item.id == value) {
  1649. this.$set(this.form, 'teamId', item.id)
  1650. this.$set(this.form, 'teamName', item.postName)
  1651. }
  1652. }
  1653. }
  1654. else {
  1655. this.form[name] = value
  1656. }
  1657. },
  1658. // 申请B/L NO
  1659. applyforfun(text) {
  1660. if (!this.form.id) {
  1661. this.$message({
  1662. message: '请先保存数据',
  1663. type: 'warning'
  1664. });
  1665. return
  1666. }
  1667. // 如果不是分单
  1668. // 王风刚 2025-02-21 所有分单号都不能手动输入,都可以申请
  1669. // if (this.form.billType != 'MH') {
  1670. // this.$message({
  1671. // message: '只有分单需要申请',
  1672. // type: 'warning'
  1673. // });
  1674. // return
  1675. // }
  1676. if (!this.form.businessType) {
  1677. this.$message({
  1678. message: '请先选择业务类型',
  1679. type: 'warning'
  1680. });
  1681. return
  1682. }
  1683. if (!this.form.corpCnName) {
  1684. this.$message({
  1685. message: '请先选择客户名称',
  1686. type: 'warning'
  1687. });
  1688. return
  1689. }
  1690. if (this.form.hblno) {
  1691. this.$confirm(`确定删除${text}?`, {
  1692. confirmButtonText: "确定",
  1693. cancelButtonText: "取消",
  1694. type: "warning"
  1695. }).then(res => {
  1696. removeHblNo({ id: this.form.id }).then(res => {
  1697. this.form.hblno = null
  1698. this.billsSubmitfun()
  1699. })
  1700. })
  1701. } else {
  1702. if (!this.form.hblno) {
  1703. // 王风刚 2025-02-21 无需弹窗,直接申请分单号
  1704. // this.$confirm(`确定${text}?`, {
  1705. // confirmButtonText: "确定",
  1706. // cancelButtonText: "取消",
  1707. // type: "warning"
  1708. // }).then(res => {
  1709. // this.billsGetBillNofun()
  1710. // })
  1711. this.billsGetBillNofun()
  1712. }
  1713. }
  1714. },
  1715. // 配置项
  1716. columnforfun(value) {
  1717. for (let item of this.basicData.column) {
  1718. if (item instanceof Array) {
  1719. for (let ite of item) {
  1720. if (value == ite.prop) {
  1721. return ite
  1722. }
  1723. }
  1724. } else {
  1725. if (value == item.prop) {
  1726. return item
  1727. }
  1728. }
  1729. }
  1730. },
  1731. //返回列表
  1732. backToList() {
  1733. if (contrastObj(this.form, this.oldForm)
  1734. || contrastList(this.form.preContainersList, this.oldForm.preContainersList) || contrastList(this.form.containersList, this.oldForm.containersList)
  1735. || contrastList(this.form.feeCenterListC, this.oldForm.feeCenterListC)
  1736. || contrastList(this.form.feeCenterListD, this.oldForm.feeCenterListD)
  1737. || contrastList(this.form.filesList, this.oldForm.filesList)
  1738. || contrastList(this.form.waitingBoxList, this.oldForm.waitingBoxList)
  1739. ) {
  1740. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  1741. confirmButtonText: "确定",
  1742. cancelButtonText: "取消",
  1743. type: "warning"
  1744. })
  1745. .then(() => {
  1746. this.editCustomer('goBack')
  1747. })
  1748. .catch(() => {
  1749. if (this.form.id) {
  1750. this.unLock({
  1751. moduleName: "SE",
  1752. tableName: "SE_order",
  1753. billId: this.form.id,
  1754. billNo: this.form.mblno
  1755. });
  1756. }
  1757. this.$emit('goBack')
  1758. });
  1759. } else {
  1760. if (this.form.id) {
  1761. this.unLock({
  1762. moduleName: "SE",
  1763. tableName: "SE_order",
  1764. billId: this.form.id,
  1765. billNo: this.form.mblno
  1766. });
  1767. }
  1768. this.$emit('goBack')
  1769. }
  1770. },
  1771. // 单据请核
  1772. DocumentApproval() {
  1773. if (this.form.billType == 'MH') {
  1774. this.$message.warning('分单不能提交请核')
  1775. return
  1776. }
  1777. if (popupReminder(this.form, this.messageData)) {
  1778. this.$confirm(popupReminder(this.form, this.messageData), {
  1779. confirmButtonText: "确定",
  1780. cancelButtonText: "取消",
  1781. type: "warning"
  1782. })
  1783. }
  1784. if (popupReminder(this.form, this.messageData)) {
  1785. return;
  1786. }
  1787. if (this.form.feeCenterListC.length == 0 && this.form.feeCenterListD == 0) {
  1788. return this.$message.warning('请添加费用信息')
  1789. }
  1790. this.$confirm("确定要请核数据?", {
  1791. confirmButtonText: "确定",
  1792. cancelButtonText: "取消",
  1793. type: "warning"
  1794. }).then(() => {
  1795. this.pageLoading = true
  1796. billsCheckBills({
  1797. id: this.form.id,
  1798. url: '/iosBasicData/SeafreightExportF/bills/approvalDetails',
  1799. pageStatus: "this.$store.getters.approvalDetails",
  1800. pageLabel: "审批详情(F)",
  1801. }).then(res => {
  1802. this.pageLoading = false
  1803. this.$message({
  1804. type: "success",
  1805. message: "操作成功!"
  1806. });
  1807. // 详情
  1808. this.billsDetailfun(this.form.id)
  1809. }).catch(() => {
  1810. this.pageLoading = false
  1811. })
  1812. })
  1813. },
  1814. // 撤销单据请核
  1815. revokeDocumentApproval() {
  1816. this.$confirm("确定要撤销请核数据?", {
  1817. confirmButtonText: "确定",
  1818. cancelButtonText: "取消",
  1819. type: "warning"
  1820. }).then(() => {
  1821. this.pageLoading = true
  1822. billsRevokeCheckBills({
  1823. id: this.form.id
  1824. }).then(res => {
  1825. this.pageLoading = false
  1826. this.$message({
  1827. type: "success",
  1828. message: "操作成功!"
  1829. });
  1830. // 详情
  1831. this.billsDetailfun(this.form.id)
  1832. })
  1833. })
  1834. },
  1835. // 编辑按钮
  1836. editHandle() {
  1837. this.detailData.seeDisabled = false
  1838. },
  1839. //去除文本框的空格
  1840. getTextTirim(data) {
  1841. if (data) {
  1842. let obj = data.split('\n')
  1843. let res = []
  1844. obj.forEach(item => {
  1845. res.push(_.trimEnd(item))
  1846. })
  1847. return res.join('\n')
  1848. } else {
  1849. return null
  1850. }
  1851. },
  1852. // 大保存按钮
  1853. editCustomer(status) {
  1854. this.$refs.form.validate((valid) => {
  1855. if (valid) {
  1856. // 判断必填项
  1857. let msgs = []
  1858. if (!this.form.quantity) {
  1859. msgs.push('件数')
  1860. }
  1861. if (!this.form.packingUnit) {
  1862. msgs.push('包装')
  1863. }
  1864. if (!this.form.grossWeight) {
  1865. msgs.push('毛重')
  1866. }
  1867. if (!this.form.measurement) {
  1868. msgs.push('尺码')
  1869. }
  1870. if (!this.form.etd) {
  1871. msgs.push('ETD')
  1872. }
  1873. if (!this.form.teamName) {
  1874. msgs.push('所属团队')
  1875. }
  1876. for (let item of this.form.preContainersList) {
  1877. if (!item.cntrTypeCode) {
  1878. this.$message.warning('请选择尺码箱型')
  1879. return;
  1880. }
  1881. if (!item.quantity) {
  1882. this.$message.warning('请输入箱量')
  1883. return;
  1884. }
  1885. }
  1886. for (let item of this.form.feeCenterListD) {
  1887. if (!item.corpId || !item.feeId || !item.elementsId || !item.curCode) {
  1888. msgs.push(`应收第${item.$index + 1}行${!item.corpId ? ' 往来单位' : ''}${!item.feeId ? ' 费用简称' : ''}${!item.elementsId ? ' 核算要素' : ''}${!item.curCode ? ' 币种' : ''}`)
  1889. }
  1890. }
  1891. for (let item of this.form.feeCenterListC) {
  1892. if (!item.corpId || !item.feeId || !item.elementsId || !item.curCode) {
  1893. msgs.push(`应付第${item.$index + 1}行${!item.corpId ? ' 往来单位' : ''}${!item.feeId ? ' 费用简称' : ''}${!item.elementsId ? ' 核算要素' : ''}${!item.curCode ? ' 币种' : ''}`)
  1894. }
  1895. }
  1896. if (msgs.length > 0) {
  1897. this.$confirm(`请填写下列信息:${msgs.join(" ,")}!`, {
  1898. confirmButtonText: "确定",
  1899. cancelButtonText: "取消",
  1900. type: "warning"
  1901. })
  1902. return;
  1903. }
  1904. if (this.verifySymbolStatus == 1) {
  1905. let msgsList = []
  1906. if (checkFullWidthSymbols(this.form.detail.hshipperDetails).hasFullWidth) {
  1907. let msg = []
  1908. for (let item of checkFullWidthSymbols(this.form.detail.hshipperDetails).positions) {
  1909. msg.push(`第${item.row}行的"${item.symbol}"`)
  1910. }
  1911. if (msg.length > 0) {
  1912. this.$message({
  1913. dangerouslyUseHTMLString: true,
  1914. message: `发货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1915. type: 'error'
  1916. });
  1917. return
  1918. }
  1919. }
  1920. if (checkFullWidthSymbols(this.form.detail.hconsigneeDetails).hasFullWidth) {
  1921. let msg = []
  1922. for (let item of checkFullWidthSymbols(this.form.detail.hconsigneeDetails).positions) {
  1923. msg.push(`第${item.row}行的"${item.symbol}"`)
  1924. }
  1925. if (msg.length > 0) {
  1926. this.$message({
  1927. dangerouslyUseHTMLString: true,
  1928. message: `收货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1929. type: 'error'
  1930. });
  1931. return
  1932. }
  1933. }
  1934. if (checkFullWidthSymbols(this.form.detail.hnotifyDetails).hasFullWidth) {
  1935. let msg = []
  1936. for (let item of checkFullWidthSymbols(this.form.detail.hnotifyDetails).positions) {
  1937. msg.push(`第${item.row}行的"${item.symbol}"`)
  1938. }
  1939. if (msg.length > 0) {
  1940. this.$message({
  1941. dangerouslyUseHTMLString: true,
  1942. message: `通知人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1943. type: 'error'
  1944. });
  1945. return
  1946. }
  1947. }
  1948. if (checkFullWidthSymbols(this.form.detail.mshipperDetails).hasFullWidth) {
  1949. let msg = []
  1950. for (let item of checkFullWidthSymbols(this.form.detail.mshipperDetails).positions) {
  1951. msg.push(`第${item.row}行的"${item.symbol}"`)
  1952. }
  1953. if (msg.length > 0) {
  1954. this.$message({
  1955. dangerouslyUseHTMLString: true,
  1956. message: `MBL 发货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1957. type: 'error'
  1958. });
  1959. return
  1960. }
  1961. }
  1962. if (checkFullWidthSymbols(this.form.detail.mconsigneeDetails).hasFullWidth) {
  1963. let msg = []
  1964. for (let item of checkFullWidthSymbols(this.form.detail.mconsigneeDetails).positions) {
  1965. msg.push(`第${item.row}行的"${item.symbol}"`)
  1966. }
  1967. if (msg.length > 0) {
  1968. this.$message({
  1969. dangerouslyUseHTMLString: true,
  1970. message: `MBL 收货人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1971. type: 'error'
  1972. });
  1973. return
  1974. }
  1975. }
  1976. if (checkFullWidthSymbols(this.form.detail.mnotifyDetails).hasFullWidth) {
  1977. let msg = []
  1978. for (let item of checkFullWidthSymbols(this.form.detail.mnotifyDetails).positions) {
  1979. msg.push(`第${item.row}行的"${item.symbol}"`)
  1980. }
  1981. if (msg.length > 0) {
  1982. this.$message({
  1983. dangerouslyUseHTMLString: true,
  1984. message: `MBL 通知人:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1985. type: 'error'
  1986. });
  1987. return
  1988. }
  1989. }
  1990. if (checkFullWidthSymbols(this.form.marks).hasFullWidth) {
  1991. let msg = []
  1992. for (let item of checkFullWidthSymbols(this.form.marks).positions) {
  1993. msg.push(`第${item.row}行的"${item.symbol}"`)
  1994. }
  1995. if (msg.length > 0) {
  1996. this.$message({
  1997. dangerouslyUseHTMLString: true,
  1998. message: `唛头:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  1999. type: 'error'
  2000. });
  2001. return
  2002. }
  2003. }
  2004. if (checkFullWidthSymbols(this.form.commodityDescr).hasFullWidth) {
  2005. let msg = []
  2006. for (let item of checkFullWidthSymbols(this.form.commodityDescr).positions) {
  2007. msg.push(`第${item.row}行的"${item.symbol}"`)
  2008. }
  2009. if (msg.length > 0) {
  2010. this.$message({
  2011. dangerouslyUseHTMLString: true,
  2012. message: `货描:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,请确认`,
  2013. type: 'error'
  2014. });
  2015. return
  2016. }
  2017. }
  2018. if (checkFullWidthSymbols(this.form.forwarding).hasFullWidth) {
  2019. let msg = []
  2020. for (let item of checkFullWidthSymbols(this.form.forwarding).positions) {
  2021. msg.push(`第${item.row}行的"${item.symbol}"`)
  2022. }
  2023. if (msg.length > 0) {
  2024. this.$message({
  2025. dangerouslyUseHTMLString: true,
  2026. message: `FORWARDING:<br>${msg.join(";<br>")}<br>存在全角或汉字符号,,请修正后再保存!`,
  2027. type: 'error'
  2028. });
  2029. return
  2030. }
  2031. }
  2032. console.log(this.form.detail)
  2033. if (!verifyEnglish(this.form.detail.hshipperDetails)) {
  2034. msgsList.push('发货人')
  2035. }
  2036. if (!verifyEnglish(this.form.detail.hconsigneeDetails)) {
  2037. msgsList.push('收货人')
  2038. }
  2039. if (!verifyEnglish(this.form.detail.hnotifyDetails)) {
  2040. msgsList.push('通知人')
  2041. }
  2042. if (!verifyEnglish(this.form.detail.mshipperDetails)) {
  2043. msgsList.push('MBL 发货人')
  2044. }
  2045. if (!verifyEnglish(this.form.detail.mconsigneeDetails)) {
  2046. msgsList.push('MBL 收货人')
  2047. }
  2048. if (!verifyEnglish(this.form.detail.mnotifyDetails)) {
  2049. msgsList.push('MBL 通知人')
  2050. }
  2051. if (!verifyEnglish(this.form.marks)) {
  2052. msgsList.push('唛头')
  2053. }
  2054. if (!verifyEnglish(this.form.commodityDescr)) {
  2055. msgsList.push('货描')
  2056. }
  2057. if (!verifyEnglish(this.form.forwarding)) {
  2058. msgsList.push('FORWARDING')
  2059. }
  2060. if (msgsList.length > 0) {
  2061. // this.$message.error(`请正确输入${msgsList.join(",")}的英文`);
  2062. this.$message.error(`${msgsList.join(",")}存在非英文字符,如汉字等,请修正后再保存!`);
  2063. return;
  2064. }
  2065. }
  2066. this.form.detail.hshipperDetails = this.getTextTirim(this.form.detail.hshipperDetails)
  2067. this.form.detail.hconsigneeDetails = this.getTextTirim(this.form.detail.hconsigneeDetails)
  2068. this.form.detail.hnotifyDetails = this.getTextTirim(this.form.detail.hnotifyDetails)
  2069. this.form.detail.marks = this.getTextTirim(this.form.detail.marks)
  2070. this.form.detail.commodityDescr = this.getTextTirim(this.form.detail.commodityDescr)
  2071. this.form.forwarding = this.getTextTirim(this.form.forwarding)
  2072. // 赋值 ETD 日期
  2073. this.form.billDate = this.form.etd ? this.form.etd.slice(0, 10) + ' 00:00:00' : null // 单据日期
  2074. // 调用保存接口
  2075. this.billsSubmitfun(status)
  2076. }
  2077. })
  2078. },
  2079. // 主表保存接口大保存
  2080. billsSubmitfun(status) {
  2081. if (this.form.cargoType == 'dry') {
  2082. // 普货
  2083. this.form.billNoFormat = 'HYCK-PH'
  2084. } else if (this.form.cargoType == 'danger') {
  2085. // 危险品
  2086. this.form.billNoFormat = 'HYCK-WXP'
  2087. } else if (this.form.cargoType == 'reefer') {
  2088. // 冻柜
  2089. this.form.billNoFormat = 'HYCK-DG'
  2090. } else {
  2091. this.form.billNoFormat = 'HYCK'
  2092. }
  2093. this.form.businessTypeCode = 'HYCK'
  2094. delete this.form.extendedData
  2095. // 把拼接的数据拆开 开始 🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒
  2096. // this.searchSplit()
  2097. // 把拼接的数据拆开 结束 💩💩💩💩💩💩💩💩💩💩💩💩💩💩
  2098. // 费用 收 赋值数据
  2099. // this.form.shortName=this.form.corpCnName.split('-')[1]
  2100. this.form.feeCenterListD.map((row, index) => {
  2101. row.dc = 'D'
  2102. row.sort = Number(index) + 1
  2103. row.businessType = this.form.businessType // 业务类型
  2104. row.billType = this.form.billType // 单据类型
  2105. row.billNo = this.form.billNo // 单据编号
  2106. row.billDate = this.form.billDate
  2107. row.billCorpId = this.form.corpId // 主表客户 id
  2108. row.billCorpCnName = this.form.corpCnName // 主表客户中文名称
  2109. row.billCorpEnName = this.form.corpEnName // 主表客户英文名称
  2110. row.lineId = this.form.lineId // 航线 id
  2111. row.lineCnName = this.form.lineCnName // 航线中文名称
  2112. row.lineEnName = this.form.lineEnName // 航线英文名称
  2113. row.vesselId = this.form.vesselId // 船名 id
  2114. row.vesselCnName = this.form.vesselCnName // 中文船名
  2115. row.vesselEnName = this.form.vesselEnName // 英文船名
  2116. row.voyageNo = this.form.voyageNo // 航次
  2117. row.mblno = this.form.mblno // MB/L NO
  2118. row.hblno = this.form.hblno // HB/L NO
  2119. row.etd = this.form.etd // 开船日期
  2120. row.eta = this.form.eta // 到港日期
  2121. row.polId = this.form.polId // 装货港 id
  2122. row.polCode = this.form.polCode // 装货港代码
  2123. row.polCnName = this.form.polCnName // 装货港中文名称
  2124. row.polEnName = this.form.polEnName // 装货港英文名称
  2125. row.podId = this.form.podId // 卸货港 id
  2126. row.podCode = this.form.podCode // 卸货港代码
  2127. row.podCnName = this.form.podCnName // 卸货港中文名称
  2128. row.podEnName = this.form.podEnName // 卸货港英文名称
  2129. row.corpArgreementNo = this.form.corpArgreementNo // 客户约号
  2130. // 数量 * 单价 = 净额
  2131. // 总税率 = 税率 + 附件税率
  2132. // 税额 = 净额 * 总税率
  2133. // 含税
  2134. if (row.curCode == 'CNY') {
  2135. row.amount = row.rmbAmount ? row.rmbAmount : (Number(row.quantity) * Number(row.price)).toFixed(2)
  2136. } else {
  2137. row.amount = row.usdAmount ? row.usdAmount : (Number(row.quantity) * Number(row.price)).toFixed(2)
  2138. }
  2139. // 净额
  2140. if (row.curCode == 'CNY') {
  2141. row.amountNet = row.rmbAmountNet ? row.rmbAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2)
  2142. } else {
  2143. row.amountNet = row.usdAmountNet ? row.usdAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2)
  2144. }
  2145. })
  2146. // 费用 付 赋值数据
  2147. this.form.feeCenterListC.map((row, index) => {
  2148. row.dc = 'C'
  2149. row.sort = Number(index) + 1
  2150. row.businessType = this.form.businessType // 业务类型
  2151. row.billType = this.form.billType // 单据类型
  2152. row.billNo = this.form.billNo // 单据编号
  2153. row.billDate = this.form.billDate // 单据日期
  2154. row.billCorpId = this.form.corpId // 主表客户 id
  2155. row.billCorpCnName = this.form.corpCnName // 主表客户中文名称
  2156. row.billCorpEnName = this.form.corpEnName // 主表客户英文名称
  2157. row.lineId = this.form.lineId // 航线 id
  2158. row.lineCnName = this.form.lineCnName // 航线中文名称
  2159. row.lineEnName = this.form.lineEnName // 航线英文名称
  2160. row.vesselId = this.form.vesselId // 船名 id
  2161. row.vesselCnName = this.form.vesselCnName // 中文船名
  2162. row.vesselEnName = this.form.vesselEnName // 英文船名
  2163. row.voyageNo = this.form.voyageNo // 航次
  2164. row.mblno = this.form.mblno // MB/L NO
  2165. row.hblno = this.form.hblno // HB/L NO
  2166. row.etd = this.form.etd // 开船日期
  2167. row.eta = this.form.eta // 到港日期
  2168. row.polId = this.form.polId // 装货港 id
  2169. row.polCode = this.form.polCode // 装货港代码
  2170. row.polCnName = this.form.polCnName // 装货港中文名称
  2171. row.polEnName = this.form.polEnName // 装货港英文名称
  2172. row.podId = this.form.podId // 卸货港 id
  2173. row.podCode = this.form.podCode // 卸货港代码
  2174. row.podCnName = this.form.podCnName // 卸货港中文名称
  2175. row.podEnName = this.form.podEnName // 卸货港英文名称
  2176. row.corpArgreementNo = this.form.corpArgreementNo // 客户约号
  2177. // 数量 * 单价 = 净额
  2178. // 总税率 = 税率 + 附件税率
  2179. // 税额 = 净额 * 总税率
  2180. // 含税
  2181. if (row.curCode == 'CNY') {
  2182. row.amount = row.rmbAmount ? row.rmbAmount : (Number(row.quantity) * Number(row.price)).toFixed(2)
  2183. } else {
  2184. row.amount = row.usdAmount ? row.usdAmount : (Number(row.quantity) * Number(row.price)).toFixed(2)
  2185. }
  2186. // 净额
  2187. if (row.curCode == 'CNY') {
  2188. row.amountNet = row.rmbAmountNet ? row.rmbAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2)
  2189. } else {
  2190. row.amountNet = row.usdAmountNet ? row.usdAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2)
  2191. }
  2192. })
  2193. this.pageLoading = true
  2194. billsSubmit(this.form).then(res => {
  2195. this.pageLoading = false
  2196. if (res.data.code === 601) {
  2197. console.info('11111111111----', res)
  2198. this.billsDetailfun(this.form.id)
  2199. this.$message({
  2200. type: "error",
  2201. message: res.data.msg
  2202. });
  2203. return true
  2204. }
  2205. this.$message({
  2206. type: "success",
  2207. message: "操作成功!"
  2208. });
  2209. if (status == 'goBack') {
  2210. if (this.form.id) {
  2211. this.unLock({
  2212. moduleName: "SE",
  2213. tableName: "SE_order",
  2214. billId: this.form.id,
  2215. billNo: this.form.mblno
  2216. });
  2217. }
  2218. this.$emit('goBack')
  2219. }
  2220. // this.detailData.seeDisabled = true
  2221. this.billsDetailfun(res.data.data.id, status)
  2222. }).catch(err => {
  2223. this.pageLoading = false
  2224. }).finally(() => {
  2225. })
  2226. },
  2227. // 提取箱专用的保存
  2228. billsAddfun() {
  2229. billsAdd(this.form).then(res => {
  2230. this.pageLoading = false
  2231. this.$message({
  2232. type: "success",
  2233. message: "操作成功!"
  2234. });
  2235. // this.detailData.seeDisabled = true
  2236. this.billsDetailfun(res.data.data.id)
  2237. }).catch(err => {
  2238. this.pageLoading = false
  2239. })
  2240. },
  2241. // 复制单据接口
  2242. billsCopyBillsfun(id, type) {
  2243. const loading = this.$loading({
  2244. lock: true,
  2245. text: '加载中',
  2246. spinner: 'el-icon-loading',
  2247. background: 'rgba(255,255,255,0.7)'
  2248. });
  2249. billsCopyBills({ id }).then(res => {
  2250. let types = typeof type == "string" ? type.split(",") : []
  2251. // if (type == '复制费用' || type == '') {
  2252. // res.data.data.preContainersList = []
  2253. // }
  2254. // if (type == '复制箱型箱量' || type == '') {
  2255. // res.data.data.feeCenterListD = []
  2256. // res.data.data.feeCenterListC = []
  2257. // }
  2258. if (types.indexOf("复制箱型箱量") < 0) {
  2259. res.data.data.preContainersList = []
  2260. }
  2261. if (types.indexOf("复制费用") < 0) {
  2262. res.data.data.feeCenterListD = []
  2263. res.data.data.feeCenterListC = []
  2264. }
  2265. this.form = res.data.data;
  2266. this.pageLoading = false
  2267. // this.searchMontage() // 下拉 中文名称和编号拼接
  2268. // 配箱最上面可以编辑
  2269. for (let item of this.form.containersList) {
  2270. item.edit = false
  2271. }
  2272. // 先把状态改成可以编辑,然后判断是否可以编辑
  2273. this.generateBillsfalse = false
  2274. // 应收
  2275. for (let item of this.form.feeCenterListD) {
  2276. // 判断是否生成了账单
  2277. if (item.accStatus == 1) {
  2278. this.columnforfun('corpCnName').disabled = true
  2279. this.columnforfun('srcType').disabled = true
  2280. this.columnforfun('mblno').disabled = true
  2281. this.columnforfun('bookingNo').disabled = true
  2282. this.columnforfun('refno').disabled = true
  2283. this.generateBillsfalse = true
  2284. }
  2285. if (item.curCode == 'CNY') {
  2286. this.$set(item, 'rmbAmount', item.amount)
  2287. this.$set(item, 'usdAmount', '')
  2288. this.$set(item, 'rmbAmountNet', item.amountNet)
  2289. this.$set(item, 'usdAmountNet', '')
  2290. } else {
  2291. this.$set(item, 'usdAmount', item.amount)
  2292. this.$set(item, 'rmbAmount', '')
  2293. this.$set(item, 'usdAmountNet', item.amountNet)
  2294. this.$set(item, 'rmbAmountNet', '')
  2295. }
  2296. item.edit = false
  2297. }
  2298. // 应付
  2299. for (let item of this.form.feeCenterListC) {
  2300. // 判断是否生成了账单
  2301. if (item.accStatus == 1) {
  2302. this.generateBillsfalse = true
  2303. this.columnforfun('corpCnName').disabled = true
  2304. this.columnforfun('srcType').disabled = true
  2305. this.columnforfun('mblno').disabled = true
  2306. this.columnforfun('bookingNo').disabled = true
  2307. this.columnforfun('refno').disabled = true
  2308. }
  2309. if (item.curCode == 'CNY') {
  2310. this.$set(item, 'rmbAmount', item.amount)
  2311. this.$set(item, 'usdAmount', '')
  2312. this.$set(item, 'rmbAmountNet', item.amountNet)
  2313. this.$set(item, 'usdAmountNet', '')
  2314. } else {
  2315. this.$set(item, 'usdAmount', item.amount)
  2316. this.$set(item, 'rmbAmount', '')
  2317. this.$set(item, 'usdAmountNet', item.amountNet)
  2318. this.$set(item, 'rmbAmountNet', '')
  2319. }
  2320. item.edit = false
  2321. }
  2322. // 文件中心
  2323. for (let item of this.form.filesList) {
  2324. this.$set(item, 'edit', false)
  2325. }
  2326. }).finally(() => {
  2327. loading.close();
  2328. })
  2329. },
  2330. // 详情接口
  2331. async billsDetailfun(id, status) {
  2332. const res = await billsDetail(id)
  2333. // this.form = res.data.data;
  2334. this.$set(this, 'form', res.data.data)
  2335. this.inLock()
  2336. // console.log('form', this.form)
  2337. // console.log(this.$refs)
  2338. this.copyFormData = JSON.parse(JSON.stringify(res.data.data))
  2339. // 如果已经请核就禁用按钮
  2340. // if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
  2341. // this.detailData.seeDisabled = true
  2342. // }else {
  2343. // this.detailData.seeDisabled = false
  2344. // }
  2345. this.columnforfun('teamName').disabled = true
  2346. this.columnforfun('operatorName').disabled = true
  2347. this.columnforfun('accDeptName').disabled = true
  2348. if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
  2349. this.columnforfun('corpCnName').disabled = true
  2350. this.columnforfun('srcType').disabled = true
  2351. this.columnforfun('mblno').disabled = true
  2352. this.columnforfun('bookingNo').disabled = true
  2353. this.columnforfun('refno').disabled = true
  2354. // this.columnforfun('teamId').disabled = true
  2355. this.generateBillsfalse = true
  2356. this.pleasereviewType = true // 请核禁用
  2357. } else {
  2358. // 判断是否可以编辑
  2359. this.columnforfun('corpCnName').disabled = false
  2360. this.columnforfun('srcType').disabled = false
  2361. this.columnforfun('mblno').disabled = false
  2362. this.columnforfun('bookingNo').disabled = false
  2363. this.columnforfun('refno').disabled = false
  2364. if (this.saberTenantId == '607913') {
  2365. this.columnforfun('operatorName').disabled = false
  2366. this.columnforfun('accDeptName').disabled = false
  2367. }
  2368. // this.columnforfun('teamId').disabled = false
  2369. this.generateBillsfalse = false
  2370. this.pleasereviewType = false
  2371. }
  2372. this.pageLoading = false
  2373. // this.searchMontage() // 下拉 中文名称和编号拼接
  2374. // 配箱最上面可以编辑
  2375. for (let item of this.form.containersList) {
  2376. item.edit = false
  2377. }
  2378. // 配箱最下面的
  2379. for (let item of this.form.waitingBoxList) {
  2380. this.$set(item, 'editQuantity', item.quantity)
  2381. this.$set(item, 'editGrossWeight', item.grossWeight)
  2382. this.$set(item, 'editMeasurement', item.measurement)
  2383. this.$set(item, 'edit', false)
  2384. }
  2385. // 应收
  2386. for (let item of this.form.feeCenterListD) {
  2387. // 判断是否生成了账单
  2388. if (item.accStatus == 1) {
  2389. this.columnforfun('corpCnName').disabled = true
  2390. this.columnforfun('srcType').disabled = true
  2391. this.columnforfun('mblno').disabled = true
  2392. this.columnforfun('bookingNo').disabled = true
  2393. this.columnforfun('refno').disabled = true
  2394. this.columnforfun('teamName').disabled = true
  2395. this.generateBillsfalse = true
  2396. }
  2397. if (item.curCode == 'CNY') {
  2398. this.$set(item, 'rmbAmount', item.amount)
  2399. this.$set(item, 'usdAmount', '')
  2400. this.$set(item, 'rmbAmountNet', item.amountNet)
  2401. this.$set(item, 'usdAmountNet', '')
  2402. } else {
  2403. this.$set(item, 'usdAmount', item.amount)
  2404. this.$set(item, 'rmbAmount', '')
  2405. this.$set(item, 'usdAmountNet', item.amountNet)
  2406. this.$set(item, 'rmbAmountNet', '')
  2407. }
  2408. item.edit = false
  2409. }
  2410. // 应付
  2411. for (let item of this.form.feeCenterListC) {
  2412. // 判断是否生成了账单
  2413. if (item.accStatus == 1) {
  2414. this.generateBillsfalse = true
  2415. this.columnforfun('corpCnName').disabled = true
  2416. this.columnforfun('srcType').disabled = true
  2417. this.columnforfun('mblno').disabled = true
  2418. this.columnforfun('bookingNo').disabled = true
  2419. this.columnforfun('refno').disabled = true
  2420. this.columnforfun('teamName').disabled = true
  2421. }
  2422. if (item.curCode == 'CNY') {
  2423. this.$set(item, 'rmbAmount', item.amount)
  2424. this.$set(item, 'usdAmount', '')
  2425. this.$set(item, 'rmbAmountNet', item.amountNet)
  2426. this.$set(item, 'usdAmountNet', '')
  2427. } else {
  2428. this.$set(item, 'usdAmount', item.amount)
  2429. this.$set(item, 'rmbAmount', '')
  2430. this.$set(item, 'usdAmountNet', item.amountNet)
  2431. this.$set(item, 'rmbAmountNet', '')
  2432. }
  2433. item.edit = false
  2434. }
  2435. // 文件中心
  2436. this.$refs.filescenter.getData(res.data.data)
  2437. for (let item of this.form.filesList) {
  2438. this.$set(item, 'edit', false)
  2439. }
  2440. if (status == 'toAddEdit') {
  2441. this.$emit(status)
  2442. }
  2443. this.oldForm = this.deepClone(this.form);
  2444. },
  2445. // tbas切换
  2446. handleClick(tba, event) {
  2447. },
  2448. // 大tbas切换
  2449. bigHandleClick() {
  2450. if (this.bigtabs == 'fd') {
  2451. if (this.form.id) {
  2452. this.billsListAllfun(this.form.id)
  2453. }
  2454. }
  2455. if (this.bigtabs == 'dz') {
  2456. if (this.form.id) {
  2457. this.$refs.documentCenter.reportslogListfun({ currentPage: 1, pageSize: 10 })
  2458. }
  2459. }
  2460. },
  2461. getReportTypeByBigHandle() {
  2462. var rt = "";
  2463. if (this.bigtabs == 'wt') rt = "业务";
  2464. if (this.bigtabs == 'fy') rt = "费用";
  2465. if (this.bigtabs == 'dz') rt = "单证";
  2466. return rt;
  2467. },
  2468. // 获取不分页的分单列表
  2469. billsListAllfun(masterId) {
  2470. billsListAll({ masterId }).then(res => {
  2471. this.billsListAllData = res.data.data
  2472. })
  2473. }
  2474. },
  2475. }
  2476. </script>
  2477. <style scoped lang="scss">
  2478. ::v-deep .el-tabs--border-card>.el-tabs__content {
  2479. padding: 4px !important;
  2480. }
  2481. .scrollable-container {
  2482. height: 84vh;
  2483. /* 设置容器高度 */
  2484. overflow-y: auto;
  2485. /* 添加垂直滚动条 */
  2486. }
  2487. .borderless {
  2488. height: 100%;
  2489. box-sizing: border-box
  2490. }
  2491. .customer-main {
  2492. margin-bottom: 15px;
  2493. }
  2494. .demo-ruleForm {
  2495. font-size: 14px;
  2496. }
  2497. .margintop {
  2498. margin-top: 0px !important;
  2499. }
  2500. ::v-deep.el-form-item {
  2501. margin-bottom: 0;
  2502. }
  2503. ::v-deep .basic-container .el-card__body {
  2504. padding: 6px 20px;
  2505. }
  2506. ::v-deep .el-tabs__header {
  2507. margin: 0 05px;
  2508. }
  2509. .isShow {
  2510. display: none;
  2511. }
  2512. .dropdown-max {
  2513. top: 150px !important;
  2514. max-width: 600px;
  2515. display: flex;
  2516. flex-flow: row wrap;
  2517. li {
  2518. margin-right: 5px;
  2519. white-space: nowrap;
  2520. }
  2521. }
  2522. </style>