billsDetails.vue 130 KB

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