finstlbillsDetails.vue 84 KB

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