finstlbillsDetails.vue 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left" @click="backToList">返回列表 </el-button>
  6. <el-button v-if="form.id && pageIds.length" type="text" @click="lastPage">上一票</el-button>
  7. <el-button v-if="form.id && pageIds.length" type="text" @click="nextPage">下一票</el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <!--<el-button size="small" type="success" style="margin-right: 8px"-->
  11. <!-- :loading="saveLoading" >提取利润及放单-->
  12. <!--</el-button>-->
  13. <el-button size="small" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id" @click="previewreportfun">预 览 </el-button>
  14. <el-button
  15. size="small"
  16. style="margin-right: 8px"
  17. v-if="roleName.indexOf('admin') != -1"
  18. :loading="saveLoading"
  19. :disabled="!form.id"
  20. @click="DesignreportDialog = true"
  21. >报表设计
  22. </el-button>
  23. <el-button type="success" size="small" :disabled="!form.id" plain @click="newbillFun">新建账单 </el-button>
  24. <el-button
  25. size="small"
  26. type="danger"
  27. plain
  28. style="margin-right: 8px"
  29. :disabled="!form.id || editPower"
  30. v-if="form.status == 3"
  31. :loading="saveLoading"
  32. @click="finstlbillsRevokeReconciliationfun"
  33. >撤销完成
  34. </el-button>
  35. <el-button
  36. size="small"
  37. type="success"
  38. plain
  39. style="margin-right: 8px"
  40. :disabled="!form.id || editPower"
  41. v-if="form.status == 2"
  42. :loading="saveLoading"
  43. @click="submit('确认完成')"
  44. >确认完成
  45. </el-button>
  46. <el-button
  47. size="small"
  48. type="primary"
  49. style="margin-right: 8px"
  50. v-if="editSave"
  51. :disabled="submitType || editPower"
  52. :loading="saveLoading"
  53. @click="editHandle"
  54. >编 辑
  55. </el-button>
  56. <el-button size="small" type="primary" style="margin-right: 8px" v-else :disabled="submitType" :loading="saveLoading" @click="editCustomer()"
  57. >保 存
  58. </el-button>
  59. </div>
  60. </div>
  61. <div style="margin: 55px 5px 0px 5px;'">
  62. <el-card class="box-card">
  63. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
  64. <el-row>
  65. <el-row>
  66. <el-col :span="11">
  67. <el-form-item label="对账单位" prop="corpCnName">
  68. <el-col :span="10">
  69. <search-query
  70. :datalist="corpData"
  71. :selectValue="form.corpCnName"
  72. :clearable="true"
  73. :disabled="editSave"
  74. :filterable="true"
  75. :remote="true"
  76. :buttonIf="false"
  77. placeholder="请选择对账单位"
  78. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  79. @corpChange="corpChange($event, 'corpCnName')"
  80. @remoteMethod="corpBcorpsListfun"
  81. @corpFocus="corpBcorpsListfun"
  82. >
  83. </search-query>
  84. </el-col>
  85. <el-col :span="9">
  86. <span style="padding-left: 20px"></span>
  87. <el-input
  88. style="width: 100%;"
  89. v-model="form.corpEnName"
  90. size="small"
  91. autocomplete="off"
  92. :disabled="editSave"
  93. clearable
  94. placeholder="对账单位"
  95. >
  96. </el-input>
  97. </el-col>
  98. <el-col :span="5">
  99. <el-checkbox
  100. style="width: 100%;text-align: right"
  101. size="medium"
  102. :true-label="1"
  103. :false-label="0"
  104. :disabled="editSave"
  105. v-model="form.corpIsSigned"
  106. >已签约
  107. </el-checkbox>
  108. </el-col>
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="5">
  112. <el-form-item label="船 名" prop="vesselCnName">
  113. <el-input
  114. style="width: 100%;"
  115. v-model="form.vesselCnName"
  116. size="small"
  117. autocomplete="off"
  118. :disabled="editSave"
  119. clearable
  120. placeholder="请输入船名"
  121. ></el-input>
  122. </el-form-item>
  123. </el-col>
  124. <el-col :span="5">
  125. <el-form-item label="航 次" prop="voyageNo">
  126. <el-input
  127. style="width: 100%;"
  128. v-model="form.voyageNo"
  129. size="small"
  130. autocomplete="off"
  131. :disabled="editSave"
  132. clearable
  133. placeholder="请输入航次"
  134. ></el-input>
  135. </el-form-item>
  136. </el-col>
  137. <el-col :span="3">
  138. <el-form-item label="审核" prop="isApproved" label-width="50px">
  139. <search-query
  140. :datalist="allyesnoData"
  141. :selectValue="form.isApproved"
  142. :clearable="true"
  143. :disabled="editSave"
  144. :buttonIf="false"
  145. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  146. @corpChange="corpChange($event, 'isApproved')"
  147. @corpFocus="allyesnoWorkDictsfun"
  148. >
  149. </search-query>
  150. </el-form-item>
  151. </el-col>
  152. <el-col :span="5">
  153. <el-form-item label="费用名称" prop="feeCnName">
  154. <dic-select
  155. v-model="form.feeCnName"
  156. placeholder="费用名称"
  157. key="id"
  158. label="cnName"
  159. url="/blade-los/bfees/listAll"
  160. :filterable="true"
  161. :multiple="true"
  162. :collapseTags="true"
  163. :disabled="editSave"
  164. ></dic-select>
  165. </el-form-item>
  166. </el-col>
  167. <el-col :span="4">
  168. <el-form-item label="业务编号" prop="businessNo">
  169. <el-input
  170. style="width: 100%;"
  171. v-model="form.businessNo"
  172. size="small"
  173. autocomplete="off"
  174. :disabled="editSave"
  175. clearable
  176. placeholder="请输入业务编号"
  177. >
  178. </el-input>
  179. </el-form-item>
  180. </el-col>
  181. <el-col :span="4">
  182. <el-form-item label="账单编号" prop="accountNo">
  183. <el-input
  184. style="width: 100%;"
  185. v-model="form.accountNo"
  186. size="small"
  187. autocomplete="off"
  188. :disabled="editSave"
  189. clearable
  190. placeholder="请输入账单编号"
  191. >
  192. </el-input>
  193. </el-form-item>
  194. </el-col>
  195. <el-col :span="4">
  196. <el-form-item label="MBL NO" prop="mblno">
  197. <el-input
  198. style="width: 100%;"
  199. v-model="form.mblno"
  200. size="small"
  201. autocomplete="off"
  202. :disabled="editSave"
  203. clearable
  204. placeholder="请输入MBL NO"
  205. >
  206. </el-input>
  207. </el-form-item>
  208. </el-col>
  209. <el-col :span="4">
  210. <el-form-item label="HBL NO" prop="hblno">
  211. <el-input
  212. style="width: 100%;"
  213. v-model="form.hblno"
  214. size="small"
  215. autocomplete="off"
  216. :disabled="editSave"
  217. clearable
  218. placeholder="请输入HBL NO"
  219. >
  220. </el-input>
  221. </el-form-item>
  222. </el-col>
  223. <el-col :span="3">
  224. <el-form-item label="对账" prop="isChecked" label-width="50px">
  225. <search-query
  226. :datalist="isCheckedData"
  227. :selectValue="form.isChecked"
  228. :clearable="true"
  229. :disabled="editSave"
  230. :buttonIf="false"
  231. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  232. @corpChange="corpChange($event, 'isChecked')"
  233. @corpFocus="allyesnoWorkDictsfun"
  234. >
  235. </search-query>
  236. </el-form-item>
  237. </el-col>
  238. <!--<el-col :span="4">-->
  239. <!-- <el-form-item label="对账" prop="isChecked" label-width="50px">-->
  240. <!-- <search-query :datalist="allyesnoData"-->
  241. <!-- :selectValue="form.isChecked"-->
  242. <!-- :clearable="true"-->
  243. <!-- :disabled="editSave"-->
  244. <!-- :buttonIf="false"-->
  245. <!-- :forParameter="{ key:'dictKey', label:'dictValue', value:'dictKey'}"-->
  246. <!-- @corpChange="corpChange($event,'isChecked')"-->
  247. <!-- @corpFocus="allyesnoWorkDictsfun" >-->
  248. <!-- </search-query>-->
  249. <!-- </el-form-item>-->
  250. <!--</el-col>-->
  251. <el-col :span="4">
  252. <el-form-item label="业务开始日期" prop="businessDateStart">
  253. <el-date-picker
  254. v-model="form.businessDateStart"
  255. clearable
  256. style="width: 100%;"
  257. type="date"
  258. size="small"
  259. :disabled="editSave"
  260. format="yyyy-MM-dd"
  261. value-format="yyyy-MM-dd"
  262. placeholder="请选择业务开始日期"
  263. >
  264. </el-date-picker>
  265. </el-form-item>
  266. </el-col>
  267. <el-col :span="4">
  268. <el-form-item label="业务结束日期" prop="businessDateEnd">
  269. <el-date-picker
  270. v-model="form.businessDateEnd"
  271. clearable
  272. style="width: 100%;"
  273. type="date"
  274. size="small"
  275. :disabled="editSave"
  276. format="yyyy-MM-dd"
  277. value-format="yyyy-MM-dd"
  278. placeholder="请选择业务结束日期"
  279. >
  280. </el-date-picker>
  281. </el-form-item>
  282. </el-col>
  283. <el-col :span="4">
  284. <el-form-item label="财务开始日期" prop="accountDateFrom">
  285. <el-date-picker
  286. v-model="form.accountDateFrom"
  287. clearable
  288. style="width: 100%;"
  289. type="date"
  290. size="small"
  291. :disabled="editSave"
  292. format="yyyy-MM-dd"
  293. value-format="yyyy-MM-dd"
  294. placeholder="请选择财务开始日期"
  295. >
  296. </el-date-picker>
  297. </el-form-item>
  298. </el-col>
  299. <el-col :span="4">
  300. <el-form-item label="财务结束日期" prop="accountDateTo">
  301. <el-date-picker
  302. v-model="form.accountDateTo"
  303. clearable
  304. style="width: 100%;"
  305. type="date"
  306. size="small"
  307. :disabled="editSave"
  308. format="yyyy-MM-dd"
  309. value-format="yyyy-MM-dd"
  310. placeholder="请选择财务结束日期"
  311. >
  312. </el-date-picker>
  313. </el-form-item>
  314. </el-col>
  315. <el-col :span="4">
  316. <el-form-item label="审核开始期间" prop="auditDateFrom">
  317. <el-date-picker
  318. v-model="form.auditDateFrom"
  319. clearable
  320. style="width: 100%;"
  321. type="date"
  322. size="small"
  323. :disabled="editSave"
  324. format="yyyy-MM-dd"
  325. value-format="yyyy-MM-dd"
  326. placeholder="请选择审核开始日期"
  327. >
  328. </el-date-picker>
  329. </el-form-item>
  330. </el-col>
  331. <el-col :span="4">
  332. <el-form-item label="审核结束期间" prop="auditDateTo">
  333. <el-date-picker
  334. v-model="form.auditDateTo"
  335. clearable
  336. style="width: 100%;"
  337. type="date"
  338. size="small"
  339. :disabled="editSave"
  340. format="yyyy-MM-dd"
  341. value-format="yyyy-MM-dd"
  342. placeholder="请选择审核结束日期"
  343. >
  344. </el-date-picker>
  345. </el-form-item>
  346. </el-col>
  347. </el-row>
  348. <expand :showBtn="true" :showSpan="true">
  349. <el-row>
  350. <el-col :span="5">
  351. <el-form-item label="操作员" prop="updateUserName">
  352. <search-query
  353. :datalist="updateUserData"
  354. :selectValue="form.updateUserName"
  355. :clearable="true"
  356. :disabled="editSave"
  357. :buttonIf="false"
  358. :filterable="true"
  359. :remote="true"
  360. :forParameter="{ key: 'id', label: 'name', value: 'name' }"
  361. @corpChange="corpChange($event, 'updateUserName')"
  362. @remoteMethod="updateUserUserGetListfun"
  363. @corpFocus="updateUserUserGetListfun"
  364. >
  365. </search-query>
  366. </el-form-item>
  367. </el-col>
  368. <el-col :span="5">
  369. <el-form-item label="BKNO" prop="bookingNo">
  370. <el-input
  371. style="width: 100%;"
  372. v-model="form.bookingNo"
  373. size="small"
  374. autocomplete="off"
  375. :disabled="editSave"
  376. clearable
  377. placeholder="请输入BKNO"
  378. ></el-input>
  379. </el-form-item>
  380. </el-col>
  381. <el-col :span="5">
  382. <el-form-item label="协议签订人" prop="corpAccRemarks">
  383. <el-input
  384. style="width: 100%;"
  385. v-model="form.corpAccRemarks"
  386. size="small"
  387. autocomplete="off"
  388. :disabled="editSave"
  389. clearable
  390. placeholder="请输入协议签订人"
  391. >
  392. </el-input>
  393. </el-form-item>
  394. </el-col>
  395. <el-col :span="5">
  396. <el-form-item label="业务类型" prop="businessTypes">
  397. <search-query
  398. :datalist="businessTypesData"
  399. :selectValue="form.businessTypes"
  400. :clearable="true"
  401. :disabled="editSave"
  402. :buttonIf="false"
  403. :multiple="true"
  404. placeholder="请选择业务类型"
  405. @corpChange="corpChange($event, 'businessTypes')"
  406. >
  407. </search-query>
  408. </el-form-item>
  409. </el-col>
  410. <el-col :span="4">
  411. <el-form-item label="发票" prop="isInvoice" label-width="50px">
  412. <search-query
  413. :datalist="isInvoiceData"
  414. :selectValue="form.isInvoice"
  415. :clearable="true"
  416. :disabled="editSave"
  417. :buttonIf="false"
  418. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  419. @corpChange="corpChange($event, 'isInvoice')"
  420. @corpFocus="invoiceWorkDictsfun"
  421. >
  422. </search-query>
  423. </el-form-item>
  424. </el-col>
  425. <el-col :span="5">
  426. <el-form-item label="收 / 付" prop="dc">
  427. <search-query
  428. :datalist="dcData"
  429. :selectValue="form.dc"
  430. :clearable="true"
  431. :disabled="editSave"
  432. :buttonIf="false"
  433. placeholder="请选择收/付"
  434. @corpChange="corpChange($event, 'dc')"
  435. >
  436. </search-query>
  437. </el-form-item>
  438. </el-col>
  439. <el-col :span="5">
  440. <el-form-item label="币别" prop="curCode">
  441. <search-query
  442. :datalist="curCodeData"
  443. :selectValue="form.curCode"
  444. :clearable="true"
  445. :disabled="editSave"
  446. :buttonIf="false"
  447. :filterable="true"
  448. :remote="true"
  449. placeholder="请选择币别"
  450. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  451. @corpChange="corpChange($event, 'curCode')"
  452. @remoteMethod="getRateListfun"
  453. @corpFocus="getRateListfun"
  454. >
  455. </search-query>
  456. </el-form-item>
  457. </el-col>
  458. <el-col :span="10">
  459. <el-form-item label="业务来源" prop="srcType">
  460. <el-col :span="10">
  461. <search-query
  462. :datalist="srcTypeData"
  463. :selectValue="form.srcType"
  464. :clearable="true"
  465. :disabled="editSave"
  466. :buttonIf="false"
  467. placeholder="请选择业务来源"
  468. @corpChange="corpChange($event, 'srcType')"
  469. >
  470. </search-query>
  471. </el-col>
  472. <el-col :span="13" :offset="1">
  473. <search-query
  474. :datalist="srcData"
  475. :selectValue="form.srcCnName"
  476. :clearable="true"
  477. :disabled="editSave"
  478. :buttonIf="false"
  479. :filterable="true"
  480. :remote="true"
  481. placeholder="请选择详情"
  482. :forParameter="srcforParameter"
  483. @corpChange="corpChange($event, 'srcCnName')"
  484. @remoteMethod="salesuserGetListfun"
  485. >
  486. </search-query>
  487. </el-col>
  488. </el-form-item>
  489. </el-col>
  490. <el-col :span="4">
  491. <el-form-item label="签收" prop="isSignfor" label-width="50px">
  492. <search-query
  493. :datalist="allyesnoData"
  494. :selectValue="form.isSignfor"
  495. :clearable="true"
  496. :disabled="editSave"
  497. :buttonIf="false"
  498. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  499. @corpChange="corpChange($event, 'isSignfor')"
  500. @corpFocus="allyesnoWorkDictsfun"
  501. >
  502. </search-query>
  503. </el-form-item>
  504. </el-col>
  505. <el-col :span="5">
  506. <el-form-item label="对账单号" prop="checkNo">
  507. <el-input
  508. style="width: 100%;"
  509. v-model="form.billNo"
  510. size="small"
  511. autocomplete="off"
  512. :disabled="true"
  513. clearable
  514. placeholder="请输入对账单号"
  515. >
  516. </el-input>
  517. </el-form-item>
  518. </el-col>
  519. <el-col :span="5">
  520. <el-form-item label="对账日期" prop="billDate">
  521. <el-date-picker
  522. v-model="form.billDate"
  523. clearable
  524. style="width: 100%;"
  525. type="date"
  526. size="small"
  527. :disabled="editSave"
  528. value-format="yyyy-MM-dd HH:mm"
  529. placeholder="请选择对账日期"
  530. >
  531. </el-date-picker>
  532. </el-form-item>
  533. </el-col>
  534. <el-col :span="5">
  535. <el-form-item label="限定金额" prop="limitedAmount">
  536. <el-input
  537. style="width: 100%;"
  538. v-model="form.limitedAmount"
  539. size="small"
  540. autocomplete="off"
  541. :disabled="editSave"
  542. clearable
  543. placeholder="请输入限定金额"
  544. >
  545. </el-input>
  546. </el-form-item>
  547. </el-col>
  548. <el-col :span="5">
  549. <el-form-item label="备注" prop="remarks">
  550. <el-input
  551. style="width: 100%;"
  552. v-model="form.remarks"
  553. size="small"
  554. autocomplete="off"
  555. :disabled="editSave"
  556. clearable
  557. placeholder="请输入备注"
  558. >
  559. </el-input>
  560. </el-form-item>
  561. </el-col>
  562. <el-col :span="4">
  563. <el-form-item label="销账" prop="isCleared" label-width="50px">
  564. <search-query
  565. :datalist="isClearedData"
  566. :selectValue="form.isCleared"
  567. :clearable="true"
  568. :disabled="editSave"
  569. :buttonIf="false"
  570. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  571. @corpChange="corpChange($event, 'isCleared')"
  572. @corpFocus="allyesnoWorkDictsfun"
  573. >
  574. </search-query>
  575. </el-form-item>
  576. </el-col>
  577. </el-row>
  578. </expand>
  579. <el-row>
  580. <el-col span="24">
  581. <div style="text-align: right">
  582. <el-button size="small" type="primary" :disabled="editSave" :loading="saveLoading" @click="retrievalfun">检 索 </el-button>
  583. <el-button size="small" :disabled="queryData.length > 0" @click="ResetFilter">重置条件 </el-button>
  584. </div>
  585. </el-col>
  586. </el-row>
  587. </el-row>
  588. </el-form>
  589. </el-card>
  590. <!-- <el-card style="margin-top: 10px">
  591. </el-card> -->
  592. <el-card style="margin-top: 10px">
  593. <el-tabs v-model="activeName" @tab-click="handleClick">
  594. <el-tab-pane label="查询结果" name="1">
  595. <queryfinstlbillsitems
  596. :queryData="queryData"
  597. :tableData="tableData"
  598. :form="form"
  599. :handleSelectionData="handleSelectionData"
  600. :brfalse="!editSave"
  601. @handleSelectionChange="addSelectionChange"
  602. >
  603. <template slot="menuLeft">
  604. <div style="display: flex;">
  605. <el-button size="small" type="success" style="margin-right: 8px" :disabled="editSave" :loading="saveLoading" @click="allCell"
  606. >确认选定行
  607. </el-button>
  608. <div class="bottomFlex" style="color: #81B337;margin-right: 20px;">
  609. <span>应收:</span>
  610. <span class="weightnum">¥{{ amountDSubSum || 0 }}</span>
  611. </div>
  612. <div class="bottomFlex" style="color: #81B337;margin-right: 20px;">
  613. <span></span>
  614. <span class="weightnum">${{ amountDSubUsdSum || 0 }}</span>
  615. </div>
  616. <div class="bottomFlex" style="color: #6BBCD1;margin-right: 20px;">
  617. <span>应付:</span>
  618. <span class="weightnum">¥{{ amountCSubSum || 0 }}</span>
  619. </div>
  620. <div class="bottomFlex" style="color: #6BBCD1;margin-right: 20px;">
  621. <span></span>
  622. <span class="weightnum">${{ amountCSubUsdSum || 0 }}</span>
  623. </div>
  624. </div>
  625. </template>
  626. </queryfinstlbillsitems>
  627. </el-tab-pane>
  628. <el-tab-pane label="选定数据" name="2">
  629. <finstlbillsitems
  630. :tableData="tableData"
  631. :form="form"
  632. :handleSelectionData="handleSelectionData"
  633. :brfalse="!editSave"
  634. @handleSelectionChange="handleSelectionChange"
  635. >
  636. <template slot="menuLeft">
  637. <div style="display: flex;">
  638. <el-button size="small" type="danger" style="margin-left: 10px" :disabled="editSave" :loading="saveLoading" @click="batchDeletefun"
  639. >一键删除
  640. </el-button>
  641. <el-button size="small" type="primary" style="margin-left: 10px" :disabled="editSave" :loading="saveLoading" @click="editHandle"
  642. >一键编辑
  643. </el-button>
  644. <el-button size="small" type="primary" style="margin-right: 8px" :loading="saveLoading" @click="Confirminvoicefun('2')"
  645. >不开发票
  646. </el-button>
  647. <el-button size="small" type="warning" style="margin-right: 8px" :loading="saveLoading" @click="Notinvoicingfun('2')"
  648. >取消不开发票
  649. </el-button>
  650. <el-button size="small" type="primary" style="margin-right: 8px" :loading="saveLoading" @click="Confirminvoicefun('1')"
  651. >确认开票
  652. </el-button>
  653. <el-button size="small" type="warning" style="margin-right: 8px" :loading="saveLoading" @click="Notinvoicingfun('1')"
  654. >撤销开票
  655. </el-button>
  656. <el-button
  657. size="small"
  658. type="primary"
  659. style="margin-right: 8px"
  660. :disabled="!form.id || editSave || handleSelectionData.length == 0"
  661. :loading="saveLoading"
  662. @click="ConfirmReceiptfun"
  663. >批量签收
  664. </el-button>
  665. <el-button
  666. size="small"
  667. type="danger"
  668. style="margin-right: 8px"
  669. :disabled="!form.id || editSave || handleSelectionData.length == 0"
  670. :loading="saveLoading"
  671. @click="RevokeReceiptfun"
  672. >撤销签收
  673. </el-button>
  674. <el-button
  675. size="small"
  676. type="primary"
  677. style="margin-right: 8px"
  678. :disabled="!form.id || editSave || handleSelectionData.length == 0"
  679. :loading="saveLoading"
  680. @click="batchConfirm"
  681. >批量对账
  682. </el-button>
  683. <el-button
  684. size="small"
  685. type="danger"
  686. style="margin-right: 8px"
  687. :disabled="!form.id || editSave || handleSelectionData.length == 0"
  688. :loading="saveLoading"
  689. @click="batchRevoke"
  690. >撤销对账
  691. </el-button>
  692. <div class="bottomFlex" style="color: #81B337;margin-right: 20px;">
  693. <span>应收:</span>
  694. <span class="weightnum">¥{{ form.amountDr || 0 }}</span>
  695. </div>
  696. <div class="bottomFlex" style="color: #81B337;margin-right: 20px;">
  697. <span></span>
  698. <span class="weightnum">${{ form.amountDrUsd || 0 }}</span>
  699. </div>
  700. <div class="bottomFlex" style="color: #6BBCD1;margin-right: 20px;">
  701. <span>应付:</span>
  702. <span class="weightnum">¥{{ form.amountCr || 0 }}</span>
  703. </div>
  704. <div class="bottomFlex" style="color: #6BBCD1;margin-right: 20px;">
  705. <span></span>
  706. <span class="weightnum">${{ form.amountCrUsd || 0 }}</span>
  707. </div>
  708. </div>
  709. </template>
  710. </finstlbillsitems>
  711. </el-tab-pane>
  712. </el-tabs>
  713. </el-card>
  714. </div>
  715. <!--选择数据弹窗-->
  716. <el-dialog title="选择数据" class="el-dialogDeep" :visible.sync="retrievePopupsType" append-to-body width="70%" :close-on-click-modal="false">
  717. <div>
  718. <avue-crud :option="retrievePopupsOption" :data="retrievePopupsData" ref="retrievePopupsRef" id="out-table">
  719. <template slot="menu" slot-scope="{ row }">
  720. <el-button type="text" icon="" size="small" @click.stop="retrievePopupsSelect(row)">选择 </el-button>
  721. </template>
  722. </avue-crud>
  723. </div>
  724. </el-dialog>
  725. <!--设计报表弹窗-->
  726. <el-dialog
  727. append-to-body
  728. title="设计报表"
  729. class="el-dialogDeep"
  730. :visible.sync="DesignreportDialog"
  731. width="70%"
  732. :close-on-click-modal="false"
  733. :destroy-on-close="true"
  734. :close-on-press-escape="false"
  735. v-dialog-drag
  736. >
  737. <reports :id="form.id" :assemblyForm="form" businessValue="DZZX"></reports>
  738. </el-dialog>
  739. <!--预览-->
  740. <el-dialog
  741. title="打印"
  742. :visible.sync="selectPrintingDialog"
  743. append-to-body
  744. width="70%"
  745. :close-on-click-modal="false"
  746. :destroy-on-close="true"
  747. :close-on-press-escape="false"
  748. v-dialog-drag
  749. >
  750. <div>
  751. <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
  752. </div>
  753. <span slot="footer" class="dialog-footer">
  754. <el-button size="small" @click="selectPrintingDialog = false">取 消</el-button>
  755. </span>
  756. </el-dialog>
  757. <!--报表组件-->
  758. <reportContainer ref="reportContainer"></reportContainer>
  759. </div>
  760. </template>
  761. <script>
  762. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  763. import { getWorkDicts } from "@/api/system/dictbiz";
  764. import { getRateList } from "@/api/iosBasicData/rateManagement";
  765. import { getList as userGetList } from "@/api/system/user";
  766. import { getBvesselsList } from "@/api/iosBasicData/bvessels";
  767. import { getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  768. import { getDeptLazyTree } from "@/api/system/dept";
  769. import {
  770. finstlbillsConfirmReconciliation,
  771. finstlbillsConfirmSignFor,
  772. finstlbillsDetail,
  773. finstlbillslistAccBillV1,
  774. finstlbillsRevokeReconciliation,
  775. finstlbillsRevokeSignFor,
  776. finstlbillsSubmit,
  777. finstlbillsitemsRemove,
  778. finstlbillslistAccBillByCorp,
  779. finstlbillsConfirmInvoicing,
  780. finstlbillsRevokeInvoicing,
  781. batchConfirmReconciliation,
  782. batchRevokeReconciliation
  783. } from "@/api/iosBasicData/finstlbills";
  784. import expand from "@/components/basic-container/expand.vue";
  785. import queryfinstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems.vue";
  786. import finstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems2.vue";
  787. import { dateFormat } from "@/util/date";
  788. import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
  789. import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
  790. import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
  791. import { getList as getreportsList, reportsGetReportData } from "@/api/iosBasicData/reports";
  792. import dicSelect from "@/components/dicSelect/main";
  793. export default {
  794. components: { reportContainer, reportformsList, reports, SearchQuery, expand, finstlbillsitems, dicSelect, queryfinstlbillsitems },
  795. props: {
  796. // 编辑还是保存
  797. editSave: {
  798. type: Boolean,
  799. default: true
  800. },
  801. pageIds: {
  802. type: Array, // 指定 prop 的类型为 Array
  803. default: () => [] // 提供一个默认值,这里使用函数形式返回一个空数组
  804. }
  805. },
  806. data() {
  807. return {
  808. amountDSubSum:0,
  809. amountDSubUsdSum:0,
  810. amountCSubSum:0,
  811. amountCSubUsdSum:0,
  812. activeName: "1",
  813. retrievePopupsType: false, // 弹窗开启关闭
  814. retrievePopupsData: [], // 选择弹窗数据
  815. retrievePopupsOption: {
  816. border: true,
  817. calcHeight: 30,
  818. tip: false,
  819. height: "auto",
  820. index: true,
  821. addBtn: false,
  822. viewBtn: false,
  823. delBtn: false,
  824. editBtn: false,
  825. refreshBtn: false,
  826. columnBtn: false,
  827. menuWidth: "60",
  828. column: [
  829. {
  830. label: "客户中文名",
  831. prop: "cnName",
  832. overHidden: true
  833. },
  834. {
  835. label: "客户英文文名",
  836. prop: "cnName",
  837. overHidden: true
  838. }
  839. ]
  840. },
  841. DesignreportDialog: false, // 设计报表弹窗
  842. selectPrintingDialog: false, // 预览报表
  843. statusType: false, // 确认发票
  844. tableData: [],
  845. queryData: [],
  846. addData: [],
  847. pageLoading: false, // 全屏加载动画
  848. saveLoading: false, // 按钮动画
  849. // 绑定的数据
  850. form: {
  851. billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00", // 对账日期 默认 当天
  852. isApproved: "0",
  853. isSignfor: "0",
  854. isCleared: null, // 销账
  855. isChecked: "0",
  856. isInvoice: "0",
  857. accountDate: [],
  858. approvedDate: []
  859. },
  860. handleSelectionData: [], // 表格选择的数据
  861. corpData: [], // 对账单位 数据
  862. allyesnoData: [], // 全部是否字典数据
  863. isCheckedData: [], // 对账状态字典数据
  864. isClearedData: [], // 销项
  865. isInvoiceData: [], // 发票字典
  866. // 收 / 付
  867. dcData: [
  868. {
  869. label: "收",
  870. value: "D"
  871. },
  872. {
  873. label: "付",
  874. value: "C"
  875. }
  876. ],
  877. curCodeData: [], // 币别
  878. updateUserData: [], // 操作员
  879. srcTypeData: [
  880. {
  881. label: "公司",
  882. value: "OWN"
  883. },
  884. {
  885. label: "代理",
  886. value: "AGENT"
  887. },
  888. {
  889. label: "业务员",
  890. value: "SALES"
  891. }
  892. ], // 业务来源
  893. srcData: [], // 业务来源数据
  894. srcforParameter: {},
  895. // 业务类型
  896. businessTypesData: [
  897. {
  898. label: "海运出口",
  899. value: "SE"
  900. },
  901. {
  902. label: "海运进口",
  903. value: "SI"
  904. }
  905. ],
  906. submitType: false, // 是否提交
  907. roleName: [], // 当前的角色权限
  908. saberUserInfo: {}, // 当前登录人信息
  909. editPower: false // 当前是否可以编辑
  910. };
  911. },
  912. created() {
  913. this.roleName = localStorage.getItem("roleName").split(",");
  914. // 获取当前登录人个人信息
  915. this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content;
  916. this.allyesnoWorkDictsfun(); // 获取 字典数据
  917. this.invoiceWorkDictsfun(); // 获取 发票的数据
  918. },
  919. methods: {
  920. lastPage() {
  921. if (this.pageIds.length) {
  922. const index = this.pageIds.indexOf(this.form.id);
  923. if (index == 0) {
  924. return this.$message.error("没有上一票了");
  925. }
  926. const lastIndex = index - 1;
  927. // if (this.form.id) {
  928. // this.unLock({
  929. // moduleName: "SE",
  930. // tableName: "SE_order",
  931. // billId: this.form.id,
  932. // billNo: this.form.mblno
  933. // });
  934. // }
  935. this.finstlbillsDetailfun(this.pageIds[lastIndex]);
  936. }
  937. },
  938. nextPage() {
  939. if (this.pageIds.length) {
  940. const index = this.pageIds.indexOf(this.form.id);
  941. if (this.pageIds[this.pageIds.length - 1] == this.form.id) {
  942. return this.$message.error("没有下一票了");
  943. }
  944. const nextIndex = index + 1;
  945. // if (this.form.id) {
  946. // this.unLock({
  947. // moduleName: "SE",
  948. // tableName: "SE_order",
  949. // billId: this.form.id,
  950. // billNo: this.form.mblno
  951. // });
  952. // }
  953. this.finstlbillsDetailfun(this.pageIds[nextIndex]);
  954. }
  955. },
  956. // 打印
  957. reportRadio(val) {
  958. // 获取报表数据
  959. reportsGetReportData({
  960. billId: this.form.id,
  961. reportCode: val.classifyCode,
  962. groupCode: val.groupCode,
  963. type: "DZZX"
  964. }).then(res => {
  965. this.handleReportPreview(val.url, res.data.data.data);
  966. });
  967. },
  968. // 报表预览
  969. previewreportfun() {
  970. getreportsList(1, 10, {
  971. businessType: "DZZX"
  972. // classifyCode:'结算中心',
  973. // groupCode:'付费结算'
  974. }).then(res => {
  975. if (res.data.data.records.length == 1) {
  976. this.reportRadio(res.data.data.records[0]);
  977. } else {
  978. this.saveLoading = true;
  979. this.selectPrintingDialog = true;
  980. this.saveLoading = false;
  981. let page = {
  982. pageSize: 10,
  983. currentPage: 1,
  984. total: 0
  985. };
  986. this.$nextTick(() => {
  987. this.$refs.reportformsList.onLoad(page, {
  988. businessType: "DZZX"
  989. // classifyCode:'结算中心',
  990. // groupCode:'付费结算'
  991. });
  992. });
  993. }
  994. });
  995. },
  996. finstlbillsRevokeReconciliation,
  997. // 下拉回调
  998. corpChange(value, name) {
  999. // 对账单位
  1000. if (name == "corpCnName") {
  1001. if (!value) {
  1002. this.$set(this.form, "corpId", "");
  1003. this.$set(this.form, "corpCnName", "");
  1004. this.$set(this.form, "corpEnName", "");
  1005. this.$set(this.form, "corpArgreementNo", "");
  1006. }
  1007. for (let item of this.corpData) {
  1008. if (item.cnName == value) {
  1009. this.$set(this.form, "corpId", item.id);
  1010. this.$set(this.form, "corpCnName", item.cnName);
  1011. this.$set(this.form, "corpEnName", item.enName);
  1012. this.$set(this.form, "corpArgreementNo", item.enName);
  1013. }
  1014. }
  1015. }
  1016. // 业务来源
  1017. else if (name == "srcType") {
  1018. if (!value) {
  1019. this.$set(this.form, "srcType", "");
  1020. return;
  1021. }
  1022. this.$set(this.form, name, value);
  1023. if (value == "OWN") {
  1024. this.srcforParameter = { key: "id", label: "title", value: "title" };
  1025. this.ownDeptLazyTreefun();
  1026. } else if (value == "AGENT") {
  1027. this.srcforParameter = { key: "id", label: "cnName", value: "cnName" };
  1028. this.srcBcorpsListfun();
  1029. } else if (value == "SALES") {
  1030. this.srcforParameter = { key: "id", label: "name", value: "name" };
  1031. this.salesuserGetListfun();
  1032. } else {
  1033. }
  1034. }
  1035. // 业务来源选择
  1036. else if (name == "srcCnName") {
  1037. if (!value) {
  1038. this.$set(this.form, "srcId", "");
  1039. this.$set(this.form, "srcCnName", "");
  1040. this.$set(this.form, "srcEnName", "");
  1041. return;
  1042. }
  1043. for (let item of this.srcData) {
  1044. if (item[this.srcforParameter.value] == value) {
  1045. if (this.form.srcType == "OWN") {
  1046. // 公司
  1047. this.$set(this.form, "srcId", item.id);
  1048. this.$set(this.form, "srcCnName", item.title);
  1049. this.$set(this.form, "srcEnName", item.title);
  1050. } else if (this.form.srcType == "SALES") {
  1051. // 业务员
  1052. this.$set(this.form, "srcId", item.id);
  1053. this.$set(this.form, "srcCnName", item.name);
  1054. this.$set(this.form, "srcEnName", item.name);
  1055. } else if (this.form.srcType == "AGENT") {
  1056. // 代理
  1057. this.$set(this.form, "srcId", item.id);
  1058. this.$set(this.form, "srcCnName", item.cnName);
  1059. this.$set(this.form, "srcEnName", item.enName);
  1060. } else {
  1061. }
  1062. }
  1063. }
  1064. }
  1065. // 操作员
  1066. else if (name == "updateUserName") {
  1067. for (let item of this.updateUserData) {
  1068. if (item.name == value) {
  1069. this.$set(this.form, "updateUser", item.id);
  1070. this.$set(this.form, "updateUserName", item.name);
  1071. }
  1072. }
  1073. } else {
  1074. this.$set(this.form, name, value);
  1075. }
  1076. },
  1077. // 编辑
  1078. editHandle() {
  1079. if (this.form.status != 3) {
  1080. this.editSave = false;
  1081. }
  1082. },
  1083. // 保存
  1084. editCustomer(type) {
  1085. // 对账单位
  1086. if (!this.form.corpId) {
  1087. this.$message.warning("请选择对账单位");
  1088. return;
  1089. }
  1090. if (!this.form.id) {
  1091. // 是否选择从表数据
  1092. if (this.addData.length == 0) {
  1093. this.$message.warning("请选择对账数据");
  1094. return;
  1095. }
  1096. }
  1097. // for (let item of this.handleSelectionData) {
  1098. // if (!item.currentStlCurCode) {
  1099. // this.$message.warning("请选择本次结算币种");
  1100. // return;
  1101. // }
  1102. // }
  1103. this.form.billNoFormat = "HYDZ";
  1104. this.form.businessTypeCode = "HYDZ";
  1105. this.form.businessType = "CHK"; // 对账单
  1106. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(",") : ""; // 业务类型
  1107. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1108. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1109. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1110. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1111. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1112. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1113. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1114. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(",") : "";
  1115. let addList = this.addData.map((item, index) => {
  1116. item.lineNo = Number(index) + 1;
  1117. item.pType = item.businessType;
  1118. item.accDate = item.billDate;
  1119. if (item.currentStlCurCode == "CNY") {
  1120. item.currentStlAmount = item.currentStlAmountRMB;
  1121. } else {
  1122. item.currentStlAmount = item.currentStlAmountUSD;
  1123. }
  1124. delete item.id;
  1125. delete item.accountDc;
  1126. return item;
  1127. });
  1128. this.form.finStlBillsItemsList = this.tableData.concat(addList);
  1129. this.form.finStlBillsItemsList = this.form.finStlBillsItemsList.map((item, index) => {
  1130. if (item.currentStlCurCode == "CNY") {
  1131. item.currentStlAmount = item.currentStlAmountRMB;
  1132. } else {
  1133. item.currentStlAmount = item.currentStlAmountUSD;
  1134. }
  1135. return item;
  1136. });
  1137. this.saveLoading = true; // 加载动画
  1138. this.pageLoading = true;
  1139. // 判断是单独点击保存还是点击确认对账
  1140. if (type == "toAddEdit") {
  1141. finstlbillsSubmit(this.form)
  1142. .then(res => {
  1143. this.$message.success("操作成功");
  1144. this.$emit(type);
  1145. })
  1146. .finally(() => {
  1147. this.pageLoading = false;
  1148. this.saveLoading = false;
  1149. });
  1150. } else if (type == "确认完成") {
  1151. finstlbillsSubmit(this.form)
  1152. .then(res => {
  1153. this.form = res.data.data;
  1154. this.finstlbillsConfirmReconciliationfun();
  1155. })
  1156. .catch(() => {
  1157. this.pageLoading = false;
  1158. this.saveLoading = false;
  1159. });
  1160. } else {
  1161. finstlbillsSubmit(this.form)
  1162. .then(res => {
  1163. this.$message.success("操作成功");
  1164. this.finstlbillsDetailfun(res.data.data.id, type);
  1165. })
  1166. .finally(() => {
  1167. this.pageLoading = false;
  1168. this.saveLoading = false;
  1169. });
  1170. }
  1171. },
  1172. newbillFun() {
  1173. if (this.submitType) {
  1174. this.$emit("toAddEdit");
  1175. } else {
  1176. this.$confirm("是否需要保存?", "提示", {
  1177. confirmButtonText: "确定",
  1178. cancelButtonText: "取消",
  1179. type: "warning"
  1180. })
  1181. .then(() => {
  1182. this.editCustomer("toAddEdit");
  1183. })
  1184. .catch(() => {
  1185. this.$emit("toAddEdit");
  1186. });
  1187. }
  1188. },
  1189. submit(type) {
  1190. for (let item of this.tableData) {
  1191. if (item.isChecked != 1) {
  1192. return this.$message.error("明细数据未完成对账!");
  1193. }
  1194. }
  1195. this.$confirm("确定进行确认完成操作?", {
  1196. confirmButtonText: "确定",
  1197. cancelButtonText: "取消",
  1198. type: "warning"
  1199. })
  1200. .then(() => {
  1201. this.editCustomer(type);
  1202. })
  1203. .catch(() => {
  1204. this.pageLoading = false;
  1205. this.saveLoading = false;
  1206. });
  1207. },
  1208. // 详情接口
  1209. finstlbillsDetailfun(id, type) {
  1210. this.pageLoading = true;
  1211. finstlbillsDetail(id)
  1212. .then(res => {
  1213. this.form = res.data.data;
  1214. if (type == "query") {
  1215. this.finstlbillslistAccBillV1fun();
  1216. }
  1217. if (
  1218. this.roleName.indexOf("admin") == -1
  1219. ? this.roleName.indexOf("允许修改他人业务") == -1
  1220. ? this.saberUserInfo.user_id != this.form.createUser
  1221. : false
  1222. : false
  1223. ) {
  1224. this.editPower = true;
  1225. } else {
  1226. this.editPower = false;
  1227. }
  1228. // 判断是否已经提交过了
  1229. if (this.form.billStatus == 1) {
  1230. this.submitType = true;
  1231. } else {
  1232. this.submitType = false;
  1233. }
  1234. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.split(",") : []; // 业务类型转换成数组显示
  1235. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.split(",") : []; // 业务类型转换成数组显示
  1236. this.tableData = this.form.finStlBillsItemsList.map(item => {
  1237. if (item.curCode == "CNY") {
  1238. this.$set(item, "amountRMB", item.amount);
  1239. this.$set(item, "currentInvoiceAmountRMB", Number(item.currentInvoiceAmount ? item.currentInvoiceAmount : 0));
  1240. this.$set(item, "unsettledAmountRMB", Number(item.unsettledAmount ? item.unsettledAmount : 0));
  1241. this.$set(item, "currentStlAmountRMB", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  1242. this.$set(item, "currentStlAmountUSD", Number(0));
  1243. } else {
  1244. this.$set(item, "amountUSD", item.amount);
  1245. this.$set(item, "currentInvoiceAmountUSD", item.currentInvoiceAmount);
  1246. this.$set(item, "unsettledAmountUSD", Number(item.unsettledAmount ? item.unsettledAmount : 0));
  1247. this.$set(item, "currentStlAmountUSD", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  1248. this.$set(item, "currentStlAmountRMB", Number(0));
  1249. }
  1250. this.$set(item, "costDate", []);
  1251. return item;
  1252. });
  1253. this.form.isSignfor = this.form.isSignfor + "";
  1254. this.form.isApproved = this.form.isApproved + "";
  1255. this.form.isCleared = this.form.isCleared + "";
  1256. this.form.isChecked = this.form.isChecked + "";
  1257. this.form.billStatus = this.form.billStatus + "";
  1258. this.form.isInvoice = this.form.isInvoice + "";
  1259. })
  1260. .finally(() => {
  1261. this.pageLoading = false;
  1262. });
  1263. },
  1264. // 重置条件
  1265. ResetFilter() {
  1266. this.form = {
  1267. billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00", // 对账日期 默认 当天
  1268. isApproved: "0",
  1269. isSignfor: "0",
  1270. isCleared: null, // 销账
  1271. isChecked: "0",
  1272. isInvoice: "0",
  1273. accountDate: [],
  1274. approvedDate: []
  1275. };
  1276. },
  1277. // 弹窗选择
  1278. retrievePopupsSelect(row) {
  1279. // this.form = row
  1280. this.$set(this.form, "corpId", row.id);
  1281. this.$set(this.form, "corpCnName", row.cnName);
  1282. this.$set(this.form, "corpEnName", row.enName);
  1283. this.$set(this.form, "corpArgreementNo", row.enName);
  1284. this.retrievePopupsType = false;
  1285. this.finstlbillslistAccBillV1fun();
  1286. },
  1287. // 检索
  1288. retrievalfun() {
  1289. // 判断是否有对账单位
  1290. if (!this.form.corpId && (this.form.businessNo || this.form.accountNo || this.form.hblno || this.form.mblno)) {
  1291. console.log("新接口");
  1292. this.finstlbillslistAccBillByCorpfun();
  1293. } else {
  1294. if (!this.form.corpId) {
  1295. return this.$message.warning("请填写对账单位");
  1296. }
  1297. console.log("原来的接口");
  1298. this.finstlbillslistAccBillV1fun();
  1299. }
  1300. },
  1301. // 检索出的弹窗
  1302. finstlbillslistAccBillByCorpfun() {
  1303. // delete this.form.id;
  1304. // let obj = JSON.parse(JSON.stringify(this.form))
  1305. let obj = {};
  1306. obj.type = "1";
  1307. obj.auditStatus = this.form.isApproved; // 审核状态 0 新建费用 1 已请核 2 审核中 3 驳回 4 通过
  1308. obj.corpCnName = this.form.corpId; // 对账单位
  1309. obj.isSignfor = this.form.isSignfor; // 是否已签收(0 否 1是)
  1310. obj.dc = this.form.dc; // 收付 D=收 C=付
  1311. obj.curCode = this.form.curCode; // 币别
  1312. obj.srcType = this.form.srcType; // 业务来源
  1313. obj.srcCnName = this.form.srcId; // 业务员id
  1314. obj.isCleared = this.form.isCleared; // 是否销账(0 未销账 3 部分销账 9 销账)
  1315. obj.accBillNo = this.form.accountNo; // 账单编号 ACCT NO
  1316. obj.billNo = this.form.businessNo; // 单据编号 JOB NO
  1317. obj.mblno = this.form.mblno; // MB/L NO
  1318. obj.hblno = this.form.hblno; // HB/L NO
  1319. obj.isChecked = this.form.isChecked; // 是否对账(0 未对账 1 已对账)
  1320. obj.queryAmount = this.form.queryAmount; // 查询金额
  1321. obj.businessType = this.form.businessTypes ? this.form.businessTypes.join(",") : ""; // 业务类型
  1322. obj.invoiceStatus = this.form.isInvoice; // 发票状态 0 = 未开 9=已开 2 待开 3 不开
  1323. obj.vesselCnName = this.form.vesselCnName; // 中文船名
  1324. obj.invoiceNo = this.form.invoiceNo; // 发票号
  1325. obj.bookingNo = this.form.bookingNo; // 订舱号 BKNO
  1326. obj.createUserName = this.form.updateUser ? this.form.updateUser : null; // 操作员id
  1327. obj.receivableAdvance = this.form.receivableAdvance; // 预收帐款
  1328. obj.threeInspectionsNo = this.form.threeInspectionsNo; // 三检单号
  1329. obj.voyageNo = this.form.voyageNo; // 航次
  1330. obj.businessDateStart = this.form.businessDateStart; // 业务开始日期
  1331. obj.businessDateEnd = this.form.businessDateEnd; // 业务结束日期
  1332. obj.billDateStart = this.form.accountDateFrom; // 财务开始日期
  1333. obj.billDateEnd = this.form.accountDateTo; // 财务开始日期
  1334. obj.approveTimeStart = this.form.auditDateFrom; // 审核开始日期
  1335. obj.approveTimeEnd = this.form.auditDateTo; // 审核结束日期
  1336. obj.feeCnName = this.form.feeCnName;
  1337. finstlbillslistAccBillByCorp(obj).then(res => {
  1338. this.retrievePopupsType = true;
  1339. this.retrievePopupsData = res.data.data;
  1340. });
  1341. },
  1342. // 检索接口
  1343. finstlbillslistAccBillV1fun() {
  1344. // delete this.form.id;
  1345. // let obj = JSON.parse(JSON.stringify(this.form))
  1346. let obj = {};
  1347. obj.type = "1";
  1348. obj.auditStatus = this.form.isApproved; // 审核状态 0 新建费用 1 已请核 2 审核中 3 驳回 4 通过
  1349. obj.corpCnName = this.form.corpId; // 对账单位
  1350. obj.isSignfor = this.form.isSignfor; // 是否已签收(0 否 1是)
  1351. obj.dc = this.form.dc; // 收付 D=收 C=付
  1352. obj.curCode = this.form.curCode; // 币别
  1353. obj.srcType = this.form.srcType; // 业务来源
  1354. obj.srcCnName = this.form.srcId; // 业务员id
  1355. obj.isCleared = this.form.isCleared; // 是否销账(0 未销账 3 部分销账 9 销账)
  1356. obj.accBillNo = this.form.accountNo; // 账单编号 ACCT NO
  1357. obj.billNo = this.form.businessNo; // 单据编号 JOB NO
  1358. obj.mblno = this.form.mblno; // MB/L NO
  1359. obj.hblno = this.form.hblno; // HB/L NO
  1360. obj.isChecked = this.form.isChecked; // 是否对账(0 未对账 1 已对账)
  1361. obj.queryAmount = this.form.queryAmount; // 查询金额
  1362. obj.businessType = this.form.businessTypes ? this.form.businessTypes.join(",") : ""; // 业务类型
  1363. obj.invoiceStatus = this.form.isInvoice; // 发票状态 0 = 未开 9=已开 2 待开 3 不开
  1364. obj.vesselCnName = this.form.vesselCnName; // 中文船名
  1365. obj.invoiceNo = this.form.invoiceNo; // 发票号
  1366. obj.bookingNo = this.form.bookingNo; // 订舱号 BKNO
  1367. obj.createUserName = this.form.updateUser ? this.form.updateUser : null; // 操作员id
  1368. obj.receivableAdvance = this.form.receivableAdvance; // 预收帐款
  1369. obj.threeInspectionsNo = this.form.threeInspectionsNo; // 三检单号
  1370. obj.voyageNo = this.form.voyageNo; // 航次
  1371. obj.businessDateStart = this.form.businessDateStart; // 业务开始日期
  1372. obj.businessDateEnd = this.form.businessDateEnd; // 业务结束日期
  1373. obj.billDateStart = this.form.accountDateFrom; // 财务开始日期
  1374. obj.billDateEnd = this.form.accountDateTo; // 财务开始日期
  1375. obj.approveTimeStart = this.form.auditDateFrom; // 审核开始日期
  1376. obj.approveTimeEnd = this.form.auditDateTo; // 审核结束日期
  1377. obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(",") : "";
  1378. finstlbillslistAccBillV1(obj).then(res => {
  1379. res.data.data.forEach((item, index) => {
  1380. item.accBillId = item.id;
  1381. delete item.id;
  1382. item.lineNo = Number(index) + 1;
  1383. this.$set(item, "currentStlCurCode", item.curCode);
  1384. this.$set(item, "currentStlExrate", item.exrate);
  1385. item.accBillNo = item.billNo;
  1386. item.billNo = item.businessBillDivideNo ? item.businessBillDivideNo : item.businessBillNo;
  1387. item.dc = item.accountDc; // 收付
  1388. if (item.curCode == "CNY") {
  1389. this.$set(item, "amountRMB", item.amount);
  1390. this.$set(item, "currentInvoiceAmountRMB", Number(item.currentInvoiceAmount ? item.currentInvoiceAmount : 0));
  1391. this.$set(item, "unsettledAmountRMB", Number(item.unsettledAmount ? item.unsettledAmount : 0));
  1392. this.$set(item, "currentStlAmountRMB", Number(item.reconciliationCurrentAmount ? item.reconciliationCurrentAmount : 0));
  1393. this.$set(item, "currentStlAmountUSD", Number(0));
  1394. } else {
  1395. this.$set(item, "amountUSD", item.amount);
  1396. this.$set(item, "currentInvoiceAmountUSD", Number(item.currentInvoiceAmount ? item.currentInvoiceAmount : 0));
  1397. this.$set(item, "unsettledAmountUSD", Number(item.unsettledAmount ? item.unsettledAmount : 0));
  1398. this.$set(item, "currentStlAmountUSD", Number(item.reconciliationCurrentAmount ? item.reconciliationCurrentAmount : 0));
  1399. this.$set(item, "currentStlAmountRMB", Number(0));
  1400. }
  1401. });
  1402. this.queryData = [];
  1403. for (let item of res.data.data) {
  1404. if (this.tableData.filter(row => row.accBillNo == item.accBillNo).length == 0) {
  1405. this.queryData.push(item);
  1406. }
  1407. }
  1408. if (this.queryData.length == 0) {
  1409. this.$message.warning("当前检索暂无数据!");
  1410. }
  1411. });
  1412. },
  1413. // 确认发票
  1414. Confirminvoicefun(type) {
  1415. if (this.handleSelectionData.length === 0) {
  1416. this.$message.warning("请选择至少一条数据");
  1417. return;
  1418. }
  1419. for (let item of this.handleSelectionData) {
  1420. if (item.isInvoice == 3) {
  1421. this.$message.error("已不开发票,请重新选择");
  1422. return;
  1423. }
  1424. }
  1425. for (let item of this.handleSelectionData) {
  1426. if (item.isInvoice == 2) {
  1427. this.$message.error("已确认开票,请重新选择");
  1428. return;
  1429. }
  1430. }
  1431. this.$confirm("确定将选择数据确认开票?", {
  1432. confirmButtonText: "确定",
  1433. cancelButtonText: "取消",
  1434. type: "warning"
  1435. }).then(() => {
  1436. this.finstlbillsConfirmInvoicingfun(type);
  1437. });
  1438. },
  1439. // 不开发票
  1440. Notinvoicingfun(type) {
  1441. if (this.handleSelectionData.length === 0) {
  1442. this.$message.warning("请选择至少一条数据");
  1443. return;
  1444. }
  1445. if (type == 1) {
  1446. for (let item of this.handleSelectionData) {
  1447. if (item.isInvoice == 1) {
  1448. this.$message.error("未确认开票,请重新选择");
  1449. return;
  1450. }
  1451. if (item.isInvoice == 3) {
  1452. this.$message.error("已不开发票,请重新选择");
  1453. return;
  1454. }
  1455. }
  1456. }
  1457. if (type == 2) {
  1458. for (let item of this.handleSelectionData) {
  1459. if (item.isInvoice == 1) {
  1460. this.$message.error("未不开发票,请重新选择");
  1461. return;
  1462. }
  1463. if (item.isInvoice == 2) {
  1464. this.$message.error("已确认开票,请重新选择");
  1465. return;
  1466. }
  1467. }
  1468. }
  1469. this.$confirm("确定将选择数据撤销签收?", {
  1470. confirmButtonText: "确定",
  1471. cancelButtonText: "取消",
  1472. type: "warning"
  1473. }).then(() => {
  1474. this.finstlbillsRevokeInvoicingfun();
  1475. });
  1476. },
  1477. // 确认发票接口
  1478. finstlbillsConfirmInvoicingfun(type) {
  1479. this.form.billNoFormat = "HYDZ";
  1480. this.form.businessTypeCode = "HYDZ";
  1481. this.form.businessType = "CHK"; //对账单
  1482. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(",") : ""; // 业务类型
  1483. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(",") : "";
  1484. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1485. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1486. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1487. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1488. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1489. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1490. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1491. // 保留id
  1492. this.form.finStlBillsItemsList = this.handleSelectionData;
  1493. let obj = {
  1494. ...this.form,
  1495. type: type
  1496. };
  1497. this.pageLoading = true;
  1498. finstlbillsConfirmInvoicing(obj)
  1499. .then(res => {
  1500. this.$message.success("操作成功");
  1501. this.finstlbillsDetailfun(res.data.data.id);
  1502. })
  1503. .finally(() => {
  1504. this.pageLoading = false;
  1505. });
  1506. },
  1507. // 撤销发票接口
  1508. finstlbillsRevokeInvoicingfun() {
  1509. this.form.billNoFormat = "HYDZ";
  1510. this.form.businessTypeCode = "HYDZ";
  1511. this.form.businessType = "CHK"; // 对账单
  1512. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(",") : ""; // 业务类型
  1513. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(",") : "";
  1514. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1515. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1516. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1517. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1518. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1519. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1520. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1521. this.form.finStlBillsItemsList = this.handleSelectionData;
  1522. this.pageLoading = true;
  1523. finstlbillsRevokeInvoicing(this.form)
  1524. .then(res => {
  1525. this.$message.success("操作成功");
  1526. this.finstlbillsDetailfun(res.data.data.id);
  1527. })
  1528. .finally(() => {
  1529. this.pageLoading = false;
  1530. });
  1531. },
  1532. // 对账确认
  1533. finstlbillsConfirmReconciliationfun() {
  1534. this.pageLoading = true;
  1535. this.saveLoading = true;
  1536. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(",") : ""; // 业务类型
  1537. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(",") : "";
  1538. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1539. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1540. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1541. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1542. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1543. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1544. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1545. (this.form.url = "/iosBasicData/finstlbills/index"), (this.form.pageStatus = "this.$store.getters.paidapplication");
  1546. this.form.pageLabel = "对账中心(F)";
  1547. finstlbillsConfirmReconciliation(this.form)
  1548. .then(res => {
  1549. this.$message.success("操作成功");
  1550. this.editSave = true;
  1551. this.finstlbillsDetailfun(res.data.data.id);
  1552. })
  1553. .finally(() => {
  1554. this.pageLoading = false;
  1555. this.saveLoading = false;
  1556. });
  1557. },
  1558. // 对账撤销
  1559. finstlbillsRevokeReconciliationfun() {
  1560. this.$confirm("确定进行撤销对账操作?", {
  1561. confirmButtonText: "确定",
  1562. cancelButtonText: "取消",
  1563. type: "warning"
  1564. }).then(() => {
  1565. this.pageLoading = true;
  1566. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(",") : ""; // 业务类型
  1567. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(",") : "";
  1568. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1569. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1570. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1571. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1572. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1573. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1574. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1575. finstlbillsRevokeReconciliation(this.form)
  1576. .then(res => {
  1577. this.$message.success("操作成功");
  1578. this.finstlbillsDetailfun(res.data.data.id);
  1579. })
  1580. .finally(() => {
  1581. this.pageLoading = false;
  1582. });
  1583. });
  1584. },
  1585. // 确认签收
  1586. ConfirmReceiptfun() {
  1587. if (this.handleSelectionData.length === 0) {
  1588. this.$message.warning("请选择至少一条数据");
  1589. return;
  1590. }
  1591. for (let item of this.handleSelectionData) {
  1592. if (item.isSignfor == 1) {
  1593. this.$message.warning("请选择未签收的数据进行签收");
  1594. return;
  1595. }
  1596. }
  1597. this.$confirm("确定将选择数据签收?", {
  1598. confirmButtonText: "确定",
  1599. cancelButtonText: "取消",
  1600. type: "warning"
  1601. }).then(() => {
  1602. this.finstlbillsConfirmSignForfun();
  1603. });
  1604. },
  1605. // 撤销签收
  1606. RevokeReceiptfun() {
  1607. if (this.handleSelectionData.length === 0) {
  1608. this.$message.warning("请选择至少一条数据");
  1609. return;
  1610. }
  1611. for (let item of this.handleSelectionData) {
  1612. if (item.isSignfor == 0) {
  1613. this.$message.warning("请选择已签收的数据进行撤销");
  1614. return;
  1615. }
  1616. }
  1617. this.$confirm("确定将选择数据撤销签收?", {
  1618. confirmButtonText: "确定",
  1619. cancelButtonText: "取消",
  1620. type: "warning"
  1621. }).then(() => {
  1622. this.finstlbillsRevokeSignForfun();
  1623. });
  1624. },
  1625. batchConfirm() {
  1626. if (this.handleSelectionData.length === 0) {
  1627. this.$message.warning("请选择至少一条数据");
  1628. return;
  1629. }
  1630. for (let item of this.handleSelectionData) {
  1631. if (item.isSignfor == 0) {
  1632. return this.$message.error("请选择已签收的数据");
  1633. }
  1634. if (item.isChecked == 1) {
  1635. return this.$message.error("请选择未对账的数据");
  1636. }
  1637. }
  1638. this.$confirm("是否对账?", {
  1639. confirmButtonText: "确定",
  1640. cancelButtonText: "取消",
  1641. type: "warning"
  1642. }).then(() => {
  1643. this.form.billNoFormat = "HYDZ";
  1644. this.form.businessTypeCode = "HYDZ";
  1645. this.form.businessType = "CHK"; //对账单
  1646. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(",") : ""; // 业务类型
  1647. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(",") : "";
  1648. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1649. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1650. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1651. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1652. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1653. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1654. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1655. // 保留id
  1656. this.form.finStlBillsItemsList = this.handleSelectionData;
  1657. this.pageLoading = true;
  1658. batchConfirmReconciliation(this.form)
  1659. .then(res => {
  1660. this.$message.success("操作成功");
  1661. this.finstlbillsDetailfun(this.form.id);
  1662. })
  1663. .finally(() => {
  1664. this.pageLoading = false;
  1665. });
  1666. });
  1667. },
  1668. batchRevoke() {
  1669. if (this.handleSelectionData.length === 0) {
  1670. this.$message.error("请选择至少一条数据");
  1671. return;
  1672. }
  1673. for (let item of this.handleSelectionData) {
  1674. if (item.isChecked == 0) {
  1675. return this.$message.error("请选择已对账的数据");
  1676. }
  1677. }
  1678. this.$confirm("是否撤销对账?", {
  1679. confirmButtonText: "确定",
  1680. cancelButtonText: "取消",
  1681. type: "warning"
  1682. }).then(() => {
  1683. this.form.billNoFormat = "HYDZ";
  1684. this.form.businessTypeCode = "HYDZ";
  1685. this.form.businessType = "CHK"; // 对账单
  1686. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(",") : ""; // 业务类型
  1687. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(",") : "";
  1688. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1689. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1690. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1691. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1692. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1693. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1694. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1695. this.form.finStlBillsItemsList = this.handleSelectionData;
  1696. this.pageLoading = true;
  1697. batchRevokeReconciliation(this.form)
  1698. .then(res => {
  1699. this.$message.success("操作成功");
  1700. this.finstlbillsDetailfun(res.data.data.id);
  1701. })
  1702. .finally(() => {
  1703. this.pageLoading = false;
  1704. });
  1705. });
  1706. },
  1707. // 一键删除
  1708. batchDeletefun() {
  1709. if (this.handleSelectionData.length == 0) {
  1710. return this.$message.warning("请选择要删除的数据");
  1711. }
  1712. for (let item of this.handleSelectionData) {
  1713. if (item.isInvoice == 3) {
  1714. this.$message.error("已不开发票,请重新选择");
  1715. return;
  1716. }
  1717. }
  1718. for (let item of this.handleSelectionData) {
  1719. if (item.isInvoice == 2) {
  1720. this.$message.error("已确认开票,请重新选择");
  1721. return;
  1722. }
  1723. }
  1724. this.$confirm("确定将选择数据删除?", {
  1725. confirmButtonText: "确定",
  1726. cancelButtonText: "取消",
  1727. type: "warning"
  1728. }).then(() => {
  1729. // 获取有id 的数据
  1730. const itemsWithId = this.handleSelectionData.filter(item => item.hasOwnProperty("id"));
  1731. let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
  1732. // 把选中的删除掉
  1733. this.handleSelectionData.forEach(item => {
  1734. for (let index in this.tableData) {
  1735. if (item.accBillNo == this.tableData[index].accBillNo) {
  1736. this.tableData.splice(Number(index), 1);
  1737. }
  1738. }
  1739. });
  1740. // 有id 的处理
  1741. if (itemsWithId.length != 0) {
  1742. finstlbillsitemsRemove(arrIds.join(",")).then(res => {
  1743. this.$message.success("操作成功");
  1744. this.finstlbillsDetailfun(this.form.id);
  1745. });
  1746. }
  1747. });
  1748. },
  1749. // 确认选定行
  1750. allCell() {
  1751. this.editCustomer("query");
  1752. },
  1753. // 确认选定行
  1754. addSelectionChange(arr) {
  1755. this.amountDSubSum = 0;
  1756. this.amountDSubUsdSum = 0;
  1757. this.amountCSubSum = 0;
  1758. this.amountCSubUsdSum = 0;
  1759. if (arr.length) {
  1760. arr.forEach(e => {
  1761. console.log(e.accountDc);
  1762. if (e.accountDc == "D") {
  1763. this.amountDSubSum += Number(e.currentStlAmountRMB ? e.currentStlAmountRMB : 0);
  1764. this.amountDSubUsdSum += Number(e.currentStlAmountUSD ? e.currentStlAmountUSD : 0);
  1765. }
  1766. if (e.accountDc == "C") {
  1767. this.amountCSubSum += Number(e.currentStlAmountRMB ? e.currentStlAmountRMB : 0);
  1768. this.amountCSubUsdSum += Number(e.currentStlAmountUSD ? e.currentStlAmountUSD : 0);
  1769. }
  1770. });
  1771. }
  1772. this.addData = arr;
  1773. },
  1774. // 下面表格多选
  1775. handleSelectionChange(arr) {
  1776. this.handleSelectionData = arr;
  1777. },
  1778. //返回列表
  1779. backToList() {
  1780. this.$emit("goBack");
  1781. },
  1782. // 请求的接口
  1783. // 确认签收接口
  1784. finstlbillsConfirmSignForfun() {
  1785. this.form.billNoFormat = "HYDZ";
  1786. this.form.businessTypeCode = "HYDZ";
  1787. this.form.businessType = "CHK"; //对账单
  1788. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(",") : ""; // 业务类型
  1789. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(",") : "";
  1790. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1791. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1792. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1793. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1794. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1795. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1796. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1797. // 保留id
  1798. this.form.finStlBillsItemsList = this.handleSelectionData;
  1799. this.pageLoading = true;
  1800. finstlbillsConfirmSignFor(this.form)
  1801. .then(res => {
  1802. this.$message.success("操作成功");
  1803. this.finstlbillsDetailfun(res.data.data.id);
  1804. })
  1805. .finally(() => {
  1806. this.pageLoading = false;
  1807. });
  1808. },
  1809. // 撤销签收接口
  1810. finstlbillsRevokeSignForfun() {
  1811. this.form.billNoFormat = "HYDZ";
  1812. this.form.businessTypeCode = "HYDZ";
  1813. this.form.businessType = "CHK"; // 对账单
  1814. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(",") : ""; // 业务类型
  1815. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(",") : "";
  1816. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1817. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  1818. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + " 00:00:00" : null;
  1819. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  1820. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null;
  1821. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null;
  1822. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  1823. this.form.finStlBillsItemsList = this.handleSelectionData;
  1824. this.pageLoading = true;
  1825. finstlbillsRevokeSignFor(this.form)
  1826. .then(res => {
  1827. this.$message.success("操作成功");
  1828. this.finstlbillsDetailfun(res.data.data.id);
  1829. })
  1830. .finally(() => {
  1831. this.pageLoading = false;
  1832. });
  1833. },
  1834. // 获取 全部是否 接口
  1835. allyesnoWorkDictsfun() {
  1836. // 全部/是/否
  1837. getWorkDicts("all_yes_no").then(res => {
  1838. this.allyesnoData = res.data.data;
  1839. });
  1840. // 对账字典
  1841. getWorkDicts("los_check_status").then(res => {
  1842. this.isCheckedData = res.data.data;
  1843. });
  1844. // 销账(F)
  1845. getWorkDicts("write_off_los").then(res => {
  1846. this.isClearedData = [{ dictValue: "全部", dictKey: null }, ...res.data.data];
  1847. });
  1848. },
  1849. // 获取发票的字典数据
  1850. invoiceWorkDictsfun() {
  1851. getWorkDicts("invoice_los").then(res => {
  1852. this.isInvoiceData = res.data.data;
  1853. });
  1854. },
  1855. // 获取币别数据
  1856. getRateListfun(cnName) {
  1857. getRateList({ current: 1, size: 10, cnName }).then(res => {
  1858. this.curCodeData = res.data.data.records;
  1859. });
  1860. },
  1861. // 获取操作员数据
  1862. updateUserUserGetListfun(account) {
  1863. userGetList(1, 10, { account }).then(res => {
  1864. this.updateUserData = res.data.data.records;
  1865. });
  1866. },
  1867. // 获取公司名称 用户管理左侧
  1868. ownDeptLazyTreefun() {
  1869. getDeptLazyTree(0).then(res => {
  1870. this.srcData = res.data.data;
  1871. });
  1872. },
  1873. // 获取业务来源代理数据
  1874. srcBcorpsListfun(cnName) {
  1875. let corpTypeName = "国内直接客户,国内同行及代理,国外直接客户,国外同行及代理";
  1876. getBcorpslistByType(1, 10, { cnName, corpTypeName }).then(res => {
  1877. this.srcData = res.data.data.records;
  1878. });
  1879. },
  1880. // 获取业务员数据
  1881. salesuserGetListfun(account = undefined, type = false) {
  1882. userGetList(1, 10, { account }).then(res => {
  1883. this.srcData = res.data.data.records;
  1884. });
  1885. },
  1886. // 获取对账单位数据
  1887. corpBcorpsListfun(cnName) {
  1888. getBcorpslistByType(1, 10, { cnName }).then(res => {
  1889. this.corpData = res.data.data.records;
  1890. });
  1891. },
  1892. // 预览报表
  1893. handleReportPreview(url, data) {
  1894. console.log(url, 1670);
  1895. console.log(data, 1671);
  1896. Stimulsoft.Base.StiLicense.key =
  1897. "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE";
  1898. // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
  1899. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile("/reports/stimulsoft/Localization/zh-CHS.xml", true, "zh-CHS");
  1900. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile("/reports/stimulsoft/Localization/zh-CHS.xml");
  1901. // 工具栏
  1902. var options = new Stimulsoft.Viewer.StiViewerOptions();
  1903. options.height = "100%";
  1904. options.appearance.scrollbarsMode = true; // 滚动条模式
  1905. options.toolbar.showDesignButton = false; // 显示设计按钮
  1906. options.toolbar.showAboutButton = false; // 显示关于按钮
  1907. options.toolbar.showResourcesButton = false; // 显示资源按钮
  1908. options.toolbar.showFullScreenButton = false; // 显示全屏按钮
  1909. options.toolbar.showOpenButton = false; // 显示打开按钮
  1910. options.appearance.showTooltips = false; // 显示工具提示
  1911. options.appearance.showDialogsHelp = false; // 显示对话框帮助
  1912. options.exports.showExportToDocument = false; // 显示导出到文档
  1913. options.toolbar.showParametersButton = true; // 显示参数按钮
  1914. options.appearance.bookmarksPrint = true; // 书签打印
  1915. // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
  1916. // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
  1917. // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
  1918. // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
  1919. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct;
  1920. // htmlRenderMode html渲染模式
  1921. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table;
  1922. // 是创建一个 Stimulsoft 报表查看器的实例的代码
  1923. let viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
  1924. // 报表
  1925. console.log("创建一个报表实例");
  1926. console.log();
  1927. let report = new window.Stimulsoft.Report.StiReport();
  1928. // 加载文件
  1929. console.log("从url加载报表");
  1930. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  1931. report.load(url);
  1932. data.pageOne = "Page : 1 of 1";
  1933. // 处理超长数据
  1934. if (data.hshipperDetails) {
  1935. var consignerIndex2 = data.hshipperDetails.indexOf("\n");
  1936. for (let i = 0; i < 4; i++) {
  1937. consignerIndex2 = data.hshipperDetails.indexOf("\n", consignerIndex2 + 1);
  1938. }
  1939. if (consignerIndex2 != -1) {
  1940. var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length);
  1941. data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + " *";
  1942. data.commodityDescr += "\n*" + hshipperDetails;
  1943. }
  1944. }
  1945. if (data.hconsigneeDetails) {
  1946. var consigneeIndex2 = data.hconsigneeDetails.indexOf("\n");
  1947. for (let i = 0; i < 3; i++) {
  1948. consigneeIndex2 = data.hconsigneeDetails.indexOf("\n", consigneeIndex2 + 1);
  1949. }
  1950. if (consigneeIndex2 != -1) {
  1951. var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length);
  1952. data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + " **";
  1953. data.commodityDescr += "\n**" + hconsigneeDetails;
  1954. }
  1955. }
  1956. if (data.hnotifyDetails) {
  1957. var notifierIndex2 = data.hnotifyDetails.indexOf("\n");
  1958. for (let i = 0; i < 3; i++) {
  1959. notifierIndex2 = data.hnotifyDetails.indexOf("\n", notifierIndex2 + 1);
  1960. }
  1961. if (notifierIndex2 != -1) {
  1962. var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length);
  1963. data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + " ***";
  1964. data.commodityDescr += "\n***" + hnotifyDetails;
  1965. }
  1966. }
  1967. // 处理箱号
  1968. if (this.isPrintTheBoxNumber) {
  1969. data.commodityDescr += "\n.\n.\n";
  1970. }
  1971. // PLACE & DATE OF ISSUE
  1972. data.placeAndDateOfIssue = "";
  1973. if (data.issueAt) {
  1974. data.placeAndDateOfIssue += data.issueAt;
  1975. }
  1976. if (data.issueDate) {
  1977. let date = new Date(data.issueDate.replace(/-/g, "/"));
  1978. let yyyy = date.getFullYear();
  1979. let mmmm = date.toDateString().split(" ")[1];
  1980. let dd = date.getDate();
  1981. data.placeAndDateOfIssue += ", " + dd + "-" + mmmm + "-" + yyyy;
  1982. }
  1983. // Total number of containers or packages received by the Carriers
  1984. if (data.preContainersList) {
  1985. let boxMap = new Map();
  1986. for (let boxQuantity of data.preContainersList) {
  1987. if (boxMap.get(boxQuantity.cntrTypeCode)) {
  1988. let v = boxMap.get(boxQuantity.cntrTypeCode);
  1989. boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity);
  1990. } else {
  1991. boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity);
  1992. }
  1993. }
  1994. let boxs = "";
  1995. boxMap.forEach(function(value, key, map) {
  1996. boxs += value + "x" + key + ", ";
  1997. });
  1998. boxs = boxs.substring(0, boxs.length - 2);
  1999. data.boxQuantity = boxs + " CONTAINER(S) ONLY";
  2000. }
  2001. // Number of original B/Ls
  2002. if (data.numberOfObl) {
  2003. data.numberOfObl += " (" + data.numberOfOblDigit + ")";
  2004. }
  2005. if (data.commodityDescr) {
  2006. var descriptionIndex2 = data.commodityDescr.indexOf("\n");
  2007. for (let i = 0; i < 19; i++) {
  2008. descriptionIndex2 = data.commodityDescr.indexOf("\n", descriptionIndex2 + 1);
  2009. }
  2010. if (descriptionIndex2 != -1) {
  2011. data.pageOne = "Page : 1 of 2";
  2012. data.pageTwo = "Page : 2 of 2";
  2013. var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length);
  2014. data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2);
  2015. data.extraLongTips = "** TO BE CONTINUED ON ATTACHED LIST **";
  2016. data.extraLongText = extraLongText;
  2017. }
  2018. }
  2019. // console.log(data.hshipperDetails, 'hshipperDetails2')
  2020. // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
  2021. var dataSet = new Stimulsoft.System.Data.DataSet("reportData");
  2022. dataSet.readJson(data); // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
  2023. // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
  2024. // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
  2025. report.regData("reportData", "reportData", dataSet);
  2026. // 从模版和数据加载报表
  2027. // loadReport(report, '', {})
  2028. // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
  2029. viewer.report = report;
  2030. this.$refs.reportContainer.showContainer(
  2031. () => {
  2032. setTimeout(() => {
  2033. viewer.renderHtml("reportContainer");
  2034. this.createViewerButtons(viewer);
  2035. }, 50);
  2036. },
  2037. () => {}
  2038. );
  2039. console.log("加载成功完成!");
  2040. },
  2041. createViewerButtons(viewer) {
  2042. viewer.jsObject.collections.images["myClose.png"] =
  2043. "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg==";
  2044. const closeBtn = viewer.jsObject.SmallButton("closeBtn", "关闭", "myClose.png");
  2045. // 增加打印弹窗配置
  2046. const printBtn = viewer.jsObject.SmallButton("printBtn", "打印报表", "myClose.png");
  2047. // console.log(viewer.jsObject.print(),'1013')
  2048. // 获取 关闭按钮的dom元素位置
  2049. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild;
  2050. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild;
  2051. const userButtonCell = buttonsTable.rows[0].insertCell(0);
  2052. // 获取打印按钮的位置
  2053. const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild; // 打印按钮
  2054. const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0]; // 打印按钮dom位置
  2055. userButtonPrint.addEventListener("click", event => {
  2056. console.log("打印点击");
  2057. // event.preventDefault()
  2058. });
  2059. userButtonPrint.addEventListener("mouseover", event => {
  2060. console.log("移入打印按钮");
  2061. console.log(event, 1035);
  2062. });
  2063. userButtonCell.className = "stiJsViewerClearAllStyles";
  2064. userButtonCell.appendChild(closeBtn); // 添加关闭节点
  2065. // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
  2066. let that = this;
  2067. // 关闭按钮的监听点击
  2068. closeBtn.action = function() {
  2069. console.log(that.$refs.ReportContainer, "1022");
  2070. if (that.$refs.reportContainer) that.$refs.reportContainer.hideContainer();
  2071. };
  2072. // // // 打印按钮监听
  2073. // printBtn.action = (e)=>{
  2074. // console.log('打印')
  2075. // window.print()
  2076. // }
  2077. }
  2078. }
  2079. };
  2080. </script>
  2081. <style scoped>
  2082. ::v-deep.el-form-item {
  2083. margin-bottom: 0;
  2084. }
  2085. .bottomFlex {
  2086. display: flex;
  2087. align-items: center;
  2088. }
  2089. .weightfont {
  2090. font-size: 20px;
  2091. font-weight: bold;
  2092. }
  2093. .weightnum {
  2094. font-size: 15px;
  2095. font-weight: 500;
  2096. }
  2097. </style>