billsDetails.vue 153 KB

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