billsDetails.vue 115 KB

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