finstlbillsDetails.vue 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546
  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"
  6. @click="backToList">返回列表
  7. </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"
  14. @click="previewreportfun">预 览
  15. </el-button>
  16. <el-button size="small" style="margin-right: 8px" v-if="roleName.indexOf('admin') != -1"
  17. :loading="saveLoading" :disabled="!form.id" @click="DesignreportDialog = true">报表设计
  18. </el-button>
  19. <el-button size="small" type="warning" plain style="margin-right: 8px" :disabled="!form.id || editPower"
  20. v-if="form.billStatus == 1" :loading="saveLoading" @click="finstlbillsRevokeReconciliationfun">撤销对账
  21. </el-button>
  22. <el-button size="small" type="success" plain style="margin-right: 8px" :disabled="!form.id || editPower"
  23. v-else :loading="saveLoading" @click="editCustomer('对账')">确认对账
  24. </el-button>
  25. <el-button size="small" type="primary" style="margin-right: 8px" v-if="editSave"
  26. :disabled="submitType || editPower" :loading="saveLoading" @click="editHandle">编 辑
  27. </el-button>
  28. <el-button size="small" type="primary" style="margin-right: 8px" v-else :disabled="submitType"
  29. :loading="saveLoading" @click="editCustomer()">保 存
  30. </el-button>
  31. </div>
  32. </div>
  33. <div style="margin: 55px 5px 0px 5px;'">
  34. <el-card class="box-card">
  35. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
  36. <el-row>
  37. <el-row>
  38. <el-col :span="11">
  39. <el-form-item label="对账单位" prop="corpCnName">
  40. <el-col :span="10">
  41. <search-query :datalist="corpData" :selectValue="form.corpCnName"
  42. :clearable="true" :disabled="editSave" :filterable="true" :remote="true"
  43. :buttonIf="false" placeholder="请选择对账单位"
  44. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  45. @corpChange="corpChange($event, 'corpCnName')"
  46. @remoteMethod="corpBcorpsListfun" @corpFocus="corpBcorpsListfun">
  47. </search-query>
  48. </el-col>
  49. <el-col :span="9">
  50. <span style="padding-left: 20px"></span>
  51. <el-input style="width: 100%;" v-model="form.corpEnName" size="small"
  52. autocomplete="off" :disabled="editSave" clearable placeholder="对账单位">
  53. </el-input>
  54. </el-col>
  55. <el-col :span="5">
  56. <el-checkbox style="width: 100%;text-align: right" size="medium" :true-label="1"
  57. :false-label="0" :disabled="editSave" v-model="form.corpIsSigned">已签约
  58. </el-checkbox>
  59. </el-col>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="5">
  63. <el-form-item label="船 名" prop="vesselCnName">
  64. <el-input style="width: 100%;" v-model="form.vesselCnName" size="small"
  65. autocomplete="off" :disabled="editSave" clearable
  66. placeholder="请输入船名"></el-input>
  67. </el-form-item>
  68. </el-col>
  69. <el-col :span="5">
  70. <el-form-item label="航 次" prop="voyageNo">
  71. <el-input style="width: 100%;" v-model="form.voyageNo" size="small"
  72. autocomplete="off" :disabled="editSave" clearable
  73. placeholder="请输入航次"></el-input>
  74. </el-form-item>
  75. </el-col>
  76. <el-col :span="3">
  77. <el-form-item label="审核" prop="isApproved" label-width="50px">
  78. <search-query :datalist="allyesnoData" :selectValue="form.isApproved"
  79. :clearable="true" :disabled="editSave" :buttonIf="false"
  80. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  81. @corpChange="corpChange($event, 'isApproved')"
  82. @corpFocus="allyesnoWorkDictsfun">
  83. </search-query>
  84. </el-form-item>
  85. </el-col>
  86. <el-col :span="5">
  87. <el-form-item label="费用名称" prop="feeCnName">
  88. <dic-select v-model="form.feeCnName" placeholder="费用名称" key="id" label="cnName"
  89. url="/blade-los/bfees/listAll" :filterable="true" :multiple="true" :collapseTags="true"
  90. :disabled="editSave"></dic-select>
  91. </el-form-item>
  92. </el-col>
  93. <el-col :span="4">
  94. <el-form-item label="业务编号" prop="businessNo">
  95. <el-input style="width: 100%;" v-model="form.businessNo" size="small"
  96. autocomplete="off" :disabled="editSave" clearable placeholder="请输入业务编号">
  97. </el-input>
  98. </el-form-item>
  99. </el-col>
  100. <el-col :span="4">
  101. <el-form-item label="账单编号" prop="accountNo">
  102. <el-input style="width: 100%;" v-model="form.accountNo" size="small"
  103. autocomplete="off" :disabled="editSave" clearable placeholder="请输入账单编号">
  104. </el-input>
  105. </el-form-item>
  106. </el-col>
  107. <el-col :span="4">
  108. <el-form-item label="MBL NO" prop="mblno">
  109. <el-input style="width: 100%;" v-model="form.mblno" size="small" autocomplete="off"
  110. :disabled="editSave" clearable placeholder="请输入MBL NO">
  111. </el-input>
  112. </el-form-item>
  113. </el-col>
  114. <el-col :span="4">
  115. <el-form-item label="HBL NO" prop="hblno">
  116. <el-input style="width: 100%;" v-model="form.hblno" size="small" autocomplete="off"
  117. :disabled="editSave" clearable placeholder="请输入HBL NO">
  118. </el-input>
  119. </el-form-item>
  120. </el-col>
  121. <el-col :span="3">
  122. <el-form-item label="对账" prop="isChecked" label-width="50px">
  123. <search-query :datalist="isCheckedData" :selectValue="form.isChecked"
  124. :clearable="true" :disabled="editSave" :buttonIf="false"
  125. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  126. @corpChange="corpChange($event, 'isChecked')" @corpFocus="allyesnoWorkDictsfun">
  127. </search-query>
  128. </el-form-item>
  129. </el-col>
  130. <!--<el-col :span="4">-->
  131. <!-- <el-form-item label="对账" prop="isChecked" label-width="50px">-->
  132. <!-- <search-query :datalist="allyesnoData"-->
  133. <!-- :selectValue="form.isChecked"-->
  134. <!-- :clearable="true"-->
  135. <!-- :disabled="editSave"-->
  136. <!-- :buttonIf="false"-->
  137. <!-- :forParameter="{ key:'dictKey', label:'dictValue', value:'dictKey'}"-->
  138. <!-- @corpChange="corpChange($event,'isChecked')"-->
  139. <!-- @corpFocus="allyesnoWorkDictsfun" >-->
  140. <!-- </search-query>-->
  141. <!-- </el-form-item>-->
  142. <!--</el-col>-->
  143. <el-col :span="4">
  144. <el-form-item label="业务开始日期" prop="businessDateStart">
  145. <el-date-picker v-model="form.businessDateStart" clearable style="width: 100%;"
  146. type="date" size="small" :disabled="editSave" format="yyyy-MM-dd"
  147. value-format="yyyy-MM-dd" placeholder="请选择业务开始日期">
  148. </el-date-picker>
  149. </el-form-item>
  150. </el-col>
  151. <el-col :span="4">
  152. <el-form-item label="业务结束日期" prop="businessDateEnd">
  153. <el-date-picker v-model="form.businessDateEnd" clearable style="width: 100%;"
  154. type="date" size="small" :disabled="editSave" format="yyyy-MM-dd"
  155. value-format="yyyy-MM-dd" placeholder="请选择业务结束日期">
  156. </el-date-picker>
  157. </el-form-item>
  158. </el-col>
  159. <el-col :span="4">
  160. <el-form-item label="财务开始日期" prop="accountDateFrom">
  161. <el-date-picker v-model="form.accountDateFrom" clearable style="width: 100%;"
  162. type="date" size="small" :disabled="editSave" format="yyyy-MM-dd"
  163. value-format="yyyy-MM-dd" placeholder="请选择财务开始日期">
  164. </el-date-picker>
  165. </el-form-item>
  166. </el-col>
  167. <el-col :span="4">
  168. <el-form-item label="财务结束日期" prop="accountDateTo">
  169. <el-date-picker v-model="form.accountDateTo" clearable style="width: 100%;"
  170. type="date" size="small" :disabled="editSave" format="yyyy-MM-dd"
  171. value-format="yyyy-MM-dd" placeholder="请选择财务结束日期">
  172. </el-date-picker>
  173. </el-form-item>
  174. </el-col>
  175. <el-col :span="4">
  176. <el-form-item label="审核开始期间" prop="auditDateFrom">
  177. <el-date-picker v-model="form.auditDateFrom" clearable style="width: 100%;"
  178. type="date" size="small" :disabled="editSave" format="yyyy-MM-dd"
  179. value-format="yyyy-MM-dd" placeholder="请选择审核开始日期">
  180. </el-date-picker>
  181. </el-form-item>
  182. </el-col>
  183. <el-col :span="4">
  184. <el-form-item label="审核结束期间" prop="auditDateTo">
  185. <el-date-picker v-model="form.auditDateTo" clearable style="width: 100%;"
  186. type="date" size="small" :disabled="editSave" format="yyyy-MM-dd"
  187. value-format="yyyy-MM-dd" placeholder="请选择审核结束日期">
  188. </el-date-picker>
  189. </el-form-item>
  190. </el-col>
  191. </el-row>
  192. <expand :showBtn="true" :showSpan="true">
  193. <el-row>
  194. <el-col :span="5">
  195. <el-form-item label="操作员" prop="updateUserName">
  196. <search-query :datalist="updateUserData" :selectValue="form.updateUserName"
  197. :clearable="true" :disabled="editSave" :buttonIf="false" :filterable="true"
  198. :remote="true" :forParameter="{ key: 'id', label: 'name', value: 'name' }"
  199. @corpChange="corpChange($event, 'updateUserName')"
  200. @remoteMethod="updateUserUserGetListfun"
  201. @corpFocus="updateUserUserGetListfun">
  202. </search-query>
  203. </el-form-item>
  204. </el-col>
  205. <el-col :span="5">
  206. <el-form-item label="BKNO" prop="bookingNo">
  207. <el-input style="width: 100%;" v-model="form.bookingNo" size="small"
  208. autocomplete="off" :disabled="editSave" clearable
  209. placeholder="请输入BKNO"></el-input>
  210. </el-form-item>
  211. </el-col>
  212. <el-col :span="5">
  213. <el-form-item label="协议签订人" prop="corpAccRemarks">
  214. <el-input style="width: 100%;" v-model="form.corpAccRemarks" size="small"
  215. autocomplete="off" :disabled="editSave" clearable placeholder="请输入协议签订人">
  216. </el-input>
  217. </el-form-item>
  218. </el-col>
  219. <el-col :span="5">
  220. <el-form-item label="业务类型" prop="businessTypes">
  221. <search-query :datalist="businessTypesData" :selectValue="form.businessTypes"
  222. :clearable="true" :disabled="editSave" :buttonIf="false" :multiple="true"
  223. placeholder="请选择业务类型" @corpChange="corpChange($event, 'businessTypes')">
  224. </search-query>
  225. </el-form-item>
  226. </el-col>
  227. <el-col :span="4">
  228. <el-form-item label="发票" prop="isInvoice" label-width="50px">
  229. <search-query :datalist="isInvoiceData" :selectValue="form.isInvoice"
  230. :clearable="true" :disabled="editSave" :buttonIf="false"
  231. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  232. @corpChange="corpChange($event, 'isInvoice')"
  233. @corpFocus="invoiceWorkDictsfun">
  234. </search-query>
  235. </el-form-item>
  236. </el-col>
  237. <el-col :span="5">
  238. <el-form-item label="收 / 付" prop="dc">
  239. <search-query :datalist="dcData" :selectValue="form.dc" :clearable="true"
  240. :disabled="editSave" :buttonIf="false" placeholder="请选择收/付"
  241. @corpChange="corpChange($event, 'dc')">
  242. </search-query>
  243. </el-form-item>
  244. </el-col>
  245. <el-col :span="5">
  246. <el-form-item label="币别" prop="curCode">
  247. <search-query :datalist="curCodeData" :selectValue="form.curCode"
  248. :clearable="true" :disabled="editSave" :buttonIf="false" :filterable="true"
  249. :remote="true" placeholder="请选择币别"
  250. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  251. @corpChange="corpChange($event, 'curCode')" @remoteMethod="getRateListfun"
  252. @corpFocus="getRateListfun">
  253. </search-query>
  254. </el-form-item>
  255. </el-col>
  256. <el-col :span="10">
  257. <el-form-item label="业务来源" prop="srcType">
  258. <el-col :span="10">
  259. <search-query :datalist="srcTypeData" :selectValue="form.srcType"
  260. :clearable="true" :disabled="editSave" :buttonIf="false"
  261. placeholder="请选择业务来源" @corpChange="corpChange($event, 'srcType')">
  262. </search-query>
  263. </el-col>
  264. <el-col :span="13" :offset="1">
  265. <search-query :datalist="srcData" :selectValue="form.srcCnName"
  266. :clearable="true" :disabled="editSave" :buttonIf="false"
  267. :filterable="true" :remote="true" placeholder="请选择详情"
  268. :forParameter="srcforParameter"
  269. @corpChange="corpChange($event, 'srcCnName')"
  270. @remoteMethod="salesuserGetListfun">
  271. </search-query>
  272. </el-col>
  273. </el-form-item>
  274. </el-col>
  275. <el-col :span="4">
  276. <el-form-item label="签收" prop="isSignfor" label-width="50px">
  277. <search-query :datalist="allyesnoData" :selectValue="form.isSignfor"
  278. :clearable="true" :disabled="editSave" :buttonIf="false"
  279. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  280. @corpChange="corpChange($event, 'isSignfor')"
  281. @corpFocus="allyesnoWorkDictsfun">
  282. </search-query>
  283. </el-form-item>
  284. </el-col>
  285. <el-col :span="5">
  286. <el-form-item label="对账单号" prop="checkNo">
  287. <el-input style="width: 100%;" v-model="form.billNo" size="small"
  288. autocomplete="off" :disabled="true" clearable placeholder="请输入对账单号">
  289. </el-input>
  290. </el-form-item>
  291. </el-col>
  292. <el-col :span="5">
  293. <el-form-item label="对账日期" prop="billDate">
  294. <el-date-picker v-model="form.billDate" clearable style="width: 100%;"
  295. type="date" size="small" :disabled="editSave"
  296. value-format="yyyy-MM-dd HH:mm" placeholder="请选择对账日期">
  297. </el-date-picker>
  298. </el-form-item>
  299. </el-col>
  300. <el-col :span="5">
  301. <el-form-item label="限定金额" prop="limitedAmount">
  302. <el-input style="width: 100%;" v-model="form.limitedAmount" size="small"
  303. autocomplete="off" :disabled="editSave" clearable placeholder="请输入限定金额">
  304. </el-input>
  305. </el-form-item>
  306. </el-col>
  307. <el-col :span="5">
  308. <el-form-item label="备注" prop="remarks">
  309. <el-input style="width: 100%;" v-model="form.remarks" size="small"
  310. autocomplete="off" :disabled="editSave" clearable placeholder="请输入备注">
  311. </el-input>
  312. </el-form-item>
  313. </el-col>
  314. <el-col :span="4">
  315. <el-form-item label="销账" prop="isCleared" label-width="50px">
  316. <search-query :datalist="isClearedData" :selectValue="form.isCleared"
  317. :clearable="true" :disabled="editSave" :buttonIf="false"
  318. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  319. @corpChange="corpChange($event, 'isCleared')"
  320. @corpFocus="allyesnoWorkDictsfun">
  321. </search-query>
  322. </el-form-item>
  323. </el-col>
  324. </el-row>
  325. </expand>
  326. <el-row>
  327. <el-col span="24">
  328. <div style="text-align: right">
  329. <!--<el-button size="small" type="" style="margin-right: 8px" :disabled="editSave"-->
  330. <!-- :loading="saveLoading" @click="ResetFilter">重置条件-->
  331. <!--</el-button>-->
  332. <el-button size="small" type="primary" style="margin-right: 8px"
  333. :disabled="editSave" :loading="saveLoading" @click="retrievalfun">检 索
  334. </el-button>
  335. </div>
  336. </el-col>
  337. </el-row>
  338. </el-row>
  339. </el-form>
  340. </el-card>
  341. <el-card style="margin-top: 10px">
  342. <el-row>
  343. <el-col :span="4">
  344. <div class="bottomFlex" style="color: #81B337">
  345. <span>应收CNY:</span>
  346. <span class="weightnum">¥{{ form.amountDr || 0 }}元</span>
  347. </div>
  348. </el-col>
  349. <el-col :span="4">
  350. <div class="bottomFlex" style="color: #6BBCD1">
  351. <span>应付CNY:</span>
  352. <span class="weightnum">¥{{ form.amountCr || 0 }}元</span>
  353. </div>
  354. </el-col>
  355. <el-col :span="4">
  356. <div class="bottomFlex" style="color: #81B337">
  357. <span>应收USD:</span>
  358. <span class="weightnum">${{ form.amountDrUsd || 0 }}元</span>
  359. </div>
  360. </el-col>
  361. <el-col :span="4">
  362. <div class="bottomFlex" style="color: #6BBCD1">
  363. <span>应付USD:</span>
  364. <span class="weightnum">${{ form.amountCrUsd || 0 }}元</span>
  365. </div>
  366. </el-col>
  367. <el-col :span="8">
  368. <div style="text-align: right">
  369. <!--<el-button size="small" type="primary" style="margin-right: 8px"-->
  370. <!-- :loading="saveLoading" >计算合计值-->
  371. <!--</el-button>-->
  372. <el-button size="small" type="primary" style="margin-right: 8px"
  373. :disabled="!form.id || editSave" :loading="saveLoading" @click="ConfirmReceiptfun">批量签收
  374. </el-button>
  375. <el-button size="small" type="danger" style="margin-right: 8px"
  376. :disabled="!form.id || editSave" :loading="saveLoading" @click="RevokeReceiptfun">撤销签收
  377. </el-button>
  378. </div>
  379. </el-col>
  380. </el-row>
  381. </el-card>
  382. <el-card style="margin-top: 10px">
  383. <div style="margin-bottom: 10px">
  384. <el-button size="small" type="info" style="margin-right: 8px" :disabled="editSave"
  385. :loading="saveLoading" @click="SelectedRows">确认选定行
  386. </el-button>
  387. <el-button size="small" type="danger" style="margin-left: 10px" :disabled="editSave"
  388. :loading="saveLoading" @click="batchDeletefun">一键删除
  389. </el-button>
  390. <el-button size="small" type="primary" style="margin-left: 10px" :disabled="editPower"
  391. :loading="saveLoading" @click="editHandle">一键编辑
  392. </el-button>
  393. <el-button size="small" type="primary" style="margin-right: 8px" :disabled="editSave"
  394. :loading="saveLoading" @click="Confirminvoicefun">禁止开票
  395. </el-button>
  396. <el-button size="small" type="warning" style="margin-right: 8px" :disabled="editSave"
  397. :loading="saveLoading" @click="Notinvoicingfun">取消禁止开票
  398. </el-button>
  399. </div>
  400. <finstlbillsitems :tableData="tableData" :form="form" :handleSelectionData="handleSelectionData"
  401. :brfalse="!editSave" @handleSelectionChange="handleSelectionChange">
  402. </finstlbillsitems>
  403. </el-card>
  404. </div>
  405. <!--选择数据弹窗-->
  406. <el-dialog title="选择数据" class="el-dialogDeep" :visible.sync="retrievePopupsType" append-to-body width="70%"
  407. :close-on-click-modal="false">
  408. <div>
  409. <avue-crud :option="retrievePopupsOption" :data="retrievePopupsData" ref="retrievePopupsRef"
  410. id="out-table">
  411. <template slot="menu" slot-scope="{ row }">
  412. <el-button type="text" icon="" size="small" @click.stop="retrievePopupsSelect(row)">选择
  413. </el-button>
  414. </template>
  415. </avue-crud>
  416. </div>
  417. </el-dialog>
  418. <!--设计报表弹窗-->
  419. <el-dialog append-to-body title="设计报表" class="el-dialogDeep" :visible.sync="DesignreportDialog" width="70%"
  420. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  421. <reports :id="form.id" :assemblyForm="form" businessValue="DZZX"></reports>
  422. </el-dialog>
  423. <!--预览-->
  424. <el-dialog title="打印" :visible.sync="selectPrintingDialog" append-to-body width="70%"
  425. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  426. <div>
  427. <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
  428. </div>
  429. <span slot="footer" class="dialog-footer">
  430. <el-button size="small" @click="selectPrintingDialog = false;">取 消</el-button>
  431. </span>
  432. </el-dialog>
  433. <!--报表组件-->
  434. <reportContainer ref="reportContainer"></reportContainer>
  435. </div>
  436. </template>
  437. <script>
  438. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  439. import { getWorkDicts } from "@/api/system/dictbiz";
  440. import { getRateList } from "@/api/iosBasicData/rateManagement";
  441. import { getList as userGetList } from '@/api/system/user'
  442. import { getBvesselsList } from "@/api/iosBasicData/bvessels";
  443. import { getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  444. import { getDeptLazyTree } from "@/api/system/dept";
  445. import {
  446. finstlbillsConfirmReconciliation,
  447. finstlbillsConfirmSignFor,
  448. finstlbillsDetail,
  449. finstlbillslistAccBillV1, finstlbillsRevokeReconciliation, finstlbillsRevokeSignFor,
  450. finstlbillsSubmit,
  451. finstlbillsitemsRemove, finstlbillslistAccBillByCorp, finstlbillsConfirmInvoicing, finstlbillsRevokeInvoicing
  452. } from '@/api/iosBasicData/finstlbills'
  453. import expand from "@/components/basic-container/expand.vue";
  454. import finstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems.vue";
  455. import { dateFormat } from "@/util/date";
  456. import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
  457. import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
  458. import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
  459. import { getList as getreportsList, reportsGetReportData } from "@/api/iosBasicData/reports";
  460. import dicSelect from "@/components/dicSelect/main";
  461. export default {
  462. components: { reportContainer, reportformsList, reports, SearchQuery, expand, finstlbillsitems, dicSelect },
  463. props: {
  464. // 编辑还是保存
  465. editSave: {
  466. type: Boolean,
  467. default: true
  468. }
  469. },
  470. data() {
  471. return {
  472. retrievePopupsType: false, // 弹窗开启关闭
  473. retrievePopupsData: [], // 选择弹窗数据
  474. retrievePopupsOption: {
  475. border: true,
  476. calcHeight: 30,
  477. tip: false,
  478. height: 'auto',
  479. index: true,
  480. addBtn: false,
  481. viewBtn: false,
  482. delBtn: false,
  483. editBtn: false,
  484. refreshBtn: false,
  485. columnBtn: false,
  486. menuWidth: '60',
  487. column: [
  488. {
  489. label: "客户中文名",
  490. prop: "cnName",
  491. overHidden: true,
  492. },
  493. {
  494. label: "客户英文文名",
  495. prop: "cnName",
  496. overHidden: true,
  497. },
  498. ]
  499. },
  500. DesignreportDialog: false, // 设计报表弹窗
  501. selectPrintingDialog: false, // 预览报表
  502. statusType: false, // 确认发票
  503. tableData: [],
  504. pageLoading: false, // 全屏加载动画
  505. saveLoading: false, // 按钮动画
  506. // 绑定的数据
  507. form: {
  508. billDate: dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00', // 对账日期 默认 当天
  509. isApproved: '0',
  510. isSignfor: '0',
  511. isCleared: null, // 销账
  512. isChecked: '0',
  513. isInvoice: '0',
  514. accountDate: [],
  515. approvedDate: [],
  516. },
  517. handleSelectionData: [], // 表格选择的数据
  518. corpData: [], // 对账单位 数据
  519. allyesnoData: [], // 全部是否字典数据
  520. isCheckedData: [], // 对账状态字典数据
  521. isClearedData: [], // 销项
  522. isInvoiceData: [],// 发票字典
  523. // 收 / 付
  524. dcData: [
  525. {
  526. label: '收',
  527. value: 'D'
  528. }, {
  529. label: '付',
  530. value: 'C'
  531. }
  532. ],
  533. curCodeData: [],// 币别
  534. updateUserData: [], // 操作员
  535. srcTypeData: [
  536. {
  537. label: '公司',
  538. value: 'OWN'
  539. },
  540. {
  541. label: '代理',
  542. value: 'AGENT'
  543. },
  544. {
  545. label: '业务员',
  546. value: 'SALES'
  547. }
  548. ], // 业务来源
  549. srcData: [], // 业务来源数据
  550. srcforParameter: {},
  551. // 业务类型
  552. businessTypesData: [
  553. {
  554. label: '海运出口',
  555. value: 'SE'
  556. }, {
  557. label: '海运进口',
  558. value: 'SI'
  559. }
  560. ],
  561. submitType: false, // 是否提交
  562. roleName: [], // 当前的角色权限
  563. saberUserInfo: {}, // 当前登录人信息
  564. editPower: false, // 当前是否可以编辑
  565. }
  566. },
  567. created() {
  568. this.roleName = localStorage.getItem('roleName').split(',')
  569. // 获取当前登录人个人信息
  570. this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
  571. this.allyesnoWorkDictsfun() // 获取 字典数据
  572. this.invoiceWorkDictsfun() // 获取 发票的数据
  573. },
  574. methods: {
  575. // 打印
  576. reportRadio(val) {
  577. // 获取报表数据
  578. reportsGetReportData({
  579. billId: this.form.id,
  580. reportCode: val.classifyCode,
  581. groupCode: val.groupCode,
  582. type: 'DZZX'
  583. }).then(res => {
  584. this.handleReportPreview(val.url, res.data.data.data)
  585. })
  586. },
  587. // 报表预览
  588. previewreportfun() {
  589. getreportsList(1, 10, {
  590. businessType: 'DZZX',
  591. // classifyCode:'结算中心',
  592. // groupCode:'付费结算'
  593. }).then(res => {
  594. if (res.data.data.records.length == 1) {
  595. this.reportRadio(res.data.data.records[0])
  596. } else {
  597. this.saveLoading = true
  598. this.selectPrintingDialog = true
  599. this.saveLoading = false
  600. let page = {
  601. pageSize: 10,
  602. currentPage: 1,
  603. total: 0
  604. }
  605. this.$nextTick(() => {
  606. this.$refs.reportformsList.onLoad(page, {
  607. businessType: 'DZZX',
  608. // classifyCode:'结算中心',
  609. // groupCode:'付费结算'
  610. })
  611. })
  612. }
  613. })
  614. },
  615. finstlbillsRevokeReconciliation,
  616. // 下拉回调
  617. corpChange(value, name) {
  618. // 对账单位
  619. if (name == 'corpCnName') {
  620. if (!value) {
  621. this.$set(this.form, 'corpId', '')
  622. this.$set(this.form, 'corpCnName', '')
  623. this.$set(this.form, 'corpEnName', '')
  624. this.$set(this.form, 'corpArgreementNo', '')
  625. }
  626. for (let item of this.corpData) {
  627. if (item.cnName == value) {
  628. this.$set(this.form, 'corpId', item.id)
  629. this.$set(this.form, 'corpCnName', item.cnName)
  630. this.$set(this.form, 'corpEnName', item.enName)
  631. this.$set(this.form, 'corpArgreementNo', item.enName)
  632. }
  633. }
  634. }
  635. // 业务来源
  636. else if (name == 'srcType') {
  637. if (!value) {
  638. this.$set(this.form, 'srcType', '')
  639. return;
  640. }
  641. this.$set(this.form, name, value)
  642. if (value == 'OWN') {
  643. this.srcforParameter = { key: 'id', label: 'title', value: 'title' }
  644. this.ownDeptLazyTreefun()
  645. } else if (value == 'AGENT') {
  646. this.srcforParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  647. this.srcBcorpsListfun()
  648. } else if (value == 'SALES') {
  649. this.srcforParameter = { key: 'id', label: 'name', value: 'name' }
  650. this.salesuserGetListfun()
  651. } else { }
  652. }
  653. // 业务来源选择
  654. else if (name == 'srcCnName') {
  655. if (!value) {
  656. this.$set(this.form, 'srcId', '')
  657. this.$set(this.form, 'srcCnName', '')
  658. this.$set(this.form, 'srcEnName', '')
  659. return
  660. }
  661. for (let item of this.srcData) {
  662. if (item[this.srcforParameter.value] == value) {
  663. if (this.form.srcType == 'OWN') {
  664. // 公司
  665. this.$set(this.form, 'srcId', item.id)
  666. this.$set(this.form, 'srcCnName', item.title)
  667. this.$set(this.form, 'srcEnName', item.title)
  668. }
  669. else if (this.form.srcType == 'SALES') {
  670. // 业务员
  671. this.$set(this.form, 'srcId', item.id)
  672. this.$set(this.form, 'srcCnName', item.name)
  673. this.$set(this.form, 'srcEnName', item.name)
  674. } else if (this.form.srcType == 'AGENT') {
  675. // 代理
  676. this.$set(this.form, 'srcId', item.id)
  677. this.$set(this.form, 'srcCnName', item.cnName)
  678. this.$set(this.form, 'srcEnName', item.enName)
  679. } else { }
  680. }
  681. }
  682. }
  683. // 操作员
  684. else if (name == 'updateUserName') {
  685. for (let item of this.updateUserData) {
  686. if (item.name == value) {
  687. this.$set(this.form, 'updateUser', item.id)
  688. this.$set(this.form, 'updateUserName', item.name)
  689. }
  690. }
  691. }
  692. else {
  693. this.$set(this.form, name, value)
  694. }
  695. },
  696. // 编辑
  697. editHandle() {
  698. this.editSave = false
  699. },
  700. // 保存
  701. editCustomer(type) {
  702. // 对账单位
  703. if (!this.form.corpId) {
  704. this.$message.warning('请选择对账单位');
  705. return
  706. }
  707. if (!this.form.id) {
  708. // 是否选择从表数据
  709. if (this.handleSelectionData.length == 0) {
  710. this.$message.warning('请选择对账数据');
  711. return;
  712. }
  713. }
  714. for (let item of this.handleSelectionData) {
  715. if (!item.currentStlCurCode) {
  716. this.$message.warning('请选择本次结算币种');
  717. return;
  718. }
  719. }
  720. this.form.billNoFormat = 'HYDZ'
  721. this.form.businessTypeCode = 'HYDZ'
  722. this.form.businessType = 'CHK' // 对账单
  723. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  724. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  725. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  726. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + ' 00:00:00' : null
  727. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + ' 00:00:00' : null
  728. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + ' 00:00:00' : null
  729. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + ' 00:00:00' : null
  730. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + ' 00:00:00' : null
  731. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  732. if (!this.form.id) {
  733. this.form.finStlBillsItemsList = this.handleSelectionData.map((item, index) => {
  734. item.lineNo = Number(index) + 1
  735. item.pType = item.businessType
  736. item.accDate = item.billDate
  737. if (item.currentStlCurCode == 'CNY') {
  738. item.currentStlAmount = item.currentStlAmountRMB
  739. } else {
  740. item.currentStlAmount = item.currentStlAmountUSD
  741. }
  742. delete item.businessType
  743. if (!this.form.id) {
  744. delete item.id
  745. }
  746. delete item.accountDc
  747. return item
  748. })
  749. } else {
  750. this.form.finStlBillsItemsList = this.form.finStlBillsItemsList.map((item, index) => {
  751. if (item.currentStlCurCode == 'CNY') {
  752. item.currentStlAmount = item.currentStlAmountRMB
  753. } else {
  754. item.currentStlAmount = item.currentStlAmountUSD
  755. }
  756. return item
  757. })
  758. }
  759. this.saveLoading = true // 加载动画
  760. this.pageLoading = true
  761. // 判断是单独点击保存还是点击确认对账
  762. if (type == '对账') {
  763. this.$confirm("确定进行对账操作?", {
  764. confirmButtonText: "确定",
  765. cancelButtonText: "取消",
  766. type: "warning"
  767. }).then(() => {
  768. finstlbillsSubmit(this.form).then(res => {
  769. this.form = res.data.data
  770. this.finstlbillsConfirmReconciliationfun()
  771. }).finally(() => {
  772. this.pageLoading = false
  773. this.saveLoading = false
  774. })
  775. })
  776. } else {
  777. finstlbillsSubmit(this.form).then(res => {
  778. this.$message.success('操作成功');
  779. this.finstlbillsDetailfun(res.data.data.id)
  780. }).finally(() => {
  781. this.pageLoading = false
  782. this.saveLoading = false
  783. })
  784. }
  785. },
  786. // 详情接口
  787. finstlbillsDetailfun(id) {
  788. this.pageLoading = true
  789. finstlbillsDetail(id).then(res => {
  790. this.form = res.data.data
  791. if (this.roleName.indexOf('admin') == -1 ? this.roleName.indexOf('允许修改他人业务') == -1 ? this.saberUserInfo.user_id != this.form.createUser : false : false) {
  792. this.editPower = true
  793. } else {
  794. this.editPower = false
  795. }
  796. // 判断是否已经提交过了
  797. if (this.form.billStatus == 1) {
  798. this.submitType = true
  799. } else {
  800. this.submitType = false
  801. }
  802. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.split(',') :[] // 业务类型转换成数组显示
  803. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.split(',') : [] // 业务类型转换成数组显示
  804. this.tableData = this.form.finStlBillsItemsList.map(item => {
  805. if (item.curCode == 'CNY') {
  806. this.$set(item, 'amountRMB', item.amount)
  807. this.$set(item, 'currentInvoiceAmountRMB', item.currentInvoiceAmount)
  808. this.$set(item, 'unsettledAmountRMB', item.unsettledAmount)
  809. this.$set(item, 'currentStlAmountRMB', item.currentStlAmount)
  810. } else {
  811. this.$set(item, 'amountUSD', item.amount)
  812. this.$set(item, 'currentInvoiceAmountUSD', item.currentInvoiceAmount)
  813. this.$set(item, 'unsettledAmountUSD', item.unsettledAmount)
  814. this.$set(item, 'currentStlAmountUSD', item.currentStlAmount)
  815. }
  816. this.$set(item, 'costDate', [])
  817. return item
  818. })
  819. this.form.isSignfor = this.form.isSignfor + ''
  820. this.form.isApproved = this.form.isApproved + ''
  821. this.form.isCleared = this.form.isCleared + ''
  822. this.form.isChecked = this.form.isChecked + ''
  823. this.form.billStatus = this.form.billStatus + ''
  824. this.form.isInvoice = this.form.isInvoice + ''
  825. }).finally(() => {
  826. this.pageLoading = false
  827. })
  828. },
  829. // 重置条件
  830. ResetFilter() {
  831. this.form = {}
  832. },
  833. // 弹窗选择
  834. retrievePopupsSelect(row) {
  835. // this.form = row
  836. this.$set(this.form, 'corpId', row.id)
  837. this.$set(this.form, 'corpCnName', row.cnName)
  838. this.$set(this.form, 'corpEnName', row.enName)
  839. this.$set(this.form, 'corpArgreementNo', row.enName)
  840. this.retrievePopupsType = false
  841. this.finstlbillslistAccBillV1fun()
  842. },
  843. // 检索
  844. retrievalfun() {
  845. // 判断是否有对账单位
  846. if (!this.form.corpId && (this.form.businessNo || this.form.accountNo || this.form.hblno || this.form.mblno)) {
  847. console.log('新接口')
  848. this.finstlbillslistAccBillByCorpfun()
  849. } else {
  850. if (!this.form.corpId) {
  851. return this.$message.warning('请填写对账单位')
  852. }
  853. console.log('原来的接口')
  854. this.finstlbillslistAccBillV1fun()
  855. }
  856. },
  857. // 检索出的弹窗
  858. finstlbillslistAccBillByCorpfun() {
  859. delete this.form.id
  860. // let obj = JSON.parse(JSON.stringify(this.form))
  861. let obj = {}
  862. obj.type = '1'
  863. obj.auditStatus = this.form.isApproved // 审核状态 0 新建费用 1 已请核 2 审核中 3 驳回 4 通过
  864. obj.corpCnName = this.form.corpId // 对账单位
  865. obj.isSignfor = this.form.isSignfor // 是否已签收(0 否 1是)
  866. obj.dc = this.form.dc // 收付 D=收 C=付
  867. obj.curCode = this.form.curCode // 币别
  868. obj.srcType = this.form.srcType // 业务来源
  869. obj.srcCnName = this.form.srcId // 业务员id
  870. obj.isCleared = this.form.isCleared // 是否销账(0 未销账 3 部分销账 9 销账)
  871. obj.accBillNo = this.form.accountNo // 账单编号 ACCT NO
  872. obj.billNo = this.form.businessNo // 单据编号 JOB NO
  873. obj.mblno = this.form.mblno // MB/L NO
  874. obj.hblno = this.form.hblno // HB/L NO
  875. obj.isChecked = this.form.isChecked // 是否对账(0 未对账 1 已对账)
  876. obj.queryAmount = this.form.queryAmount // 查询金额
  877. obj.businessType = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  878. obj.invoiceStatus = this.form.isInvoice // 发票状态 0 = 未开 9=已开 2 待开 3 不开
  879. obj.vesselCnName = this.form.vesselCnName // 中文船名
  880. obj.invoiceNo = this.form.invoiceNo // 发票号
  881. obj.bookingNo = this.form.bookingNo // 订舱号 BKNO
  882. obj.createUserName = this.form.updateUser ? this.form.updateUser : null // 操作员id
  883. obj.receivableAdvance = this.form.receivableAdvance // 预收帐款
  884. obj.threeInspectionsNo = this.form.threeInspectionsNo // 三检单号
  885. obj.voyageNo = this.form.voyageNo // 航次
  886. obj.businessDateStart = this.form.businessDateStart // 业务开始日期
  887. obj.businessDateEnd = this.form.businessDateEnd // 业务结束日期
  888. obj.billDateStart = this.form.accountDateFrom // 财务开始日期
  889. obj.billDateEnd = this.form.accountDateTo // 财务开始日期
  890. obj.approveTimeStart = this.form.auditDateFrom // 审核开始日期
  891. obj.approveTimeEnd = this.form.auditDateTo // 审核结束日期
  892. obj.feeCnName = this.form.feeCnName
  893. finstlbillslistAccBillByCorp(obj).then(res => {
  894. this.retrievePopupsType = true
  895. this.retrievePopupsData = res.data.data
  896. })
  897. },
  898. // 检索接口
  899. finstlbillslistAccBillV1fun() {
  900. delete this.form.id
  901. // let obj = JSON.parse(JSON.stringify(this.form))
  902. let obj = {}
  903. obj.type = '1'
  904. obj.auditStatus = this.form.isApproved // 审核状态 0 新建费用 1 已请核 2 审核中 3 驳回 4 通过
  905. obj.corpCnName = this.form.corpId // 对账单位
  906. obj.isSignfor = this.form.isSignfor // 是否已签收(0 否 1是)
  907. obj.dc = this.form.dc // 收付 D=收 C=付
  908. obj.curCode = this.form.curCode // 币别
  909. obj.srcType = this.form.srcType // 业务来源
  910. obj.srcCnName = this.form.srcId // 业务员id
  911. obj.isCleared = this.form.isCleared // 是否销账(0 未销账 3 部分销账 9 销账)
  912. obj.accBillNo = this.form.accountNo // 账单编号 ACCT NO
  913. obj.billNo = this.form.businessNo // 单据编号 JOB NO
  914. obj.mblno = this.form.mblno // MB/L NO
  915. obj.hblno = this.form.hblno // HB/L NO
  916. obj.isChecked = this.form.isChecked // 是否对账(0 未对账 1 已对账)
  917. obj.queryAmount = this.form.queryAmount // 查询金额
  918. obj.businessType = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  919. obj.invoiceStatus = this.form.isInvoice // 发票状态 0 = 未开 9=已开 2 待开 3 不开
  920. obj.vesselCnName = this.form.vesselCnName // 中文船名
  921. obj.invoiceNo = this.form.invoiceNo // 发票号
  922. obj.bookingNo = this.form.bookingNo // 订舱号 BKNO
  923. obj.createUserName = this.form.updateUser ? this.form.updateUser : null // 操作员id
  924. obj.receivableAdvance = this.form.receivableAdvance // 预收帐款
  925. obj.threeInspectionsNo = this.form.threeInspectionsNo // 三检单号
  926. obj.voyageNo = this.form.voyageNo // 航次
  927. obj.businessDateStart = this.form.businessDateStart // 业务开始日期
  928. obj.businessDateEnd = this.form.businessDateEnd // 业务结束日期
  929. obj.billDateStart = this.form.accountDateFrom // 财务开始日期
  930. obj.billDateEnd = this.form.accountDateTo // 财务开始日期
  931. obj.approveTimeStart = this.form.auditDateFrom // 审核开始日期
  932. obj.approveTimeEnd = this.form.auditDateTo // 审核结束日期
  933. obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  934. finstlbillslistAccBillV1(obj).then(res => {
  935. this.tableData = res.data.data.map((item, index) => {
  936. item.accBillId = item.id
  937. delete item.id
  938. item.lineNo = Number(index) + 1
  939. this.$set(item, 'currentStlCurCode', item.curCode)
  940. this.$set(item, 'currentStlExrate', item.exrate)
  941. item.accBillNo = item.billNo
  942. item.billNo = item.businessBillDivideNo ? item.businessBillDivideNo : item.businessBillNo
  943. item.dc = item.accountDc // 收付
  944. if (item.curCode == 'CNY') {
  945. this.$set(item, 'amountRMB', item.amount)
  946. this.$set(item, 'currentInvoiceAmountRMB', item.currentInvoiceAmount)
  947. this.$set(item, 'unsettledAmountRMB', item.unsettledAmount)
  948. this.$set(item, 'currentStlAmountRMB', item.reconciliationCurrentAmount)
  949. } else {
  950. this.$set(item, 'amountUSD', item.amount)
  951. this.$set(item, 'currentInvoiceAmountUSD', item.currentInvoiceAmount)
  952. this.$set(item, 'unsettledAmountUSD', item.unsettledAmount)
  953. this.$set(item, 'currentStlAmountUSD', item.reconciliationCurrentAmount)
  954. }
  955. return item
  956. })
  957. if (this.tableData.length == 0) {
  958. this.$message.warning('当前检索暂无数据!')
  959. }
  960. })
  961. },
  962. // 确认发票
  963. Confirminvoicefun() {
  964. if (this.handleSelectionData.length === 0) {
  965. this.$message.warning("请选择至少一条数据");
  966. return;
  967. }
  968. this.$confirm("确定将选择数据确认开票?", {
  969. confirmButtonText: "确定",
  970. cancelButtonText: "取消",
  971. type: "warning"
  972. }).then(() => {
  973. this.finstlbillsConfirmInvoicingfun()
  974. })
  975. },
  976. // 不开发票
  977. Notinvoicingfun() {
  978. if (this.handleSelectionData.length === 0) {
  979. this.$message.warning("请选择至少一条数据");
  980. return;
  981. }
  982. this.$confirm("确定将选择数据撤销签收?", {
  983. confirmButtonText: "确定",
  984. cancelButtonText: "取消",
  985. type: "warning"
  986. }).then(() => {
  987. this.finstlbillsRevokeInvoicingfun()
  988. })
  989. },
  990. // 确认发票接口
  991. finstlbillsConfirmInvoicingfun() {
  992. this.form.billNoFormat = 'HYDZ'
  993. this.form.businessTypeCode = 'HYDZ'
  994. this.form.businessType = 'CHK' //对账单
  995. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  996. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  997. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  998. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  999. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + ' 00:00:00' : null
  1000. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + ' 00:00:00' : null
  1001. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + ' 00:00:00' : null
  1002. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + ' 00:00:00' : null
  1003. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + ' 00:00:00' : null
  1004. // 保留id
  1005. this.form.finStlBillsItemsList = this.handleSelectionData
  1006. this.pageLoading = true
  1007. finstlbillsConfirmInvoicing(this.form).then(res => {
  1008. this.$message.success('操作成功');
  1009. this.finstlbillsDetailfun(res.data.data.id)
  1010. }).finally(() => {
  1011. this.pageLoading = false
  1012. })
  1013. },
  1014. // 撤销发票接口
  1015. finstlbillsRevokeInvoicingfun() {
  1016. this.form.billNoFormat = 'HYDZ'
  1017. this.form.businessTypeCode = 'HYDZ'
  1018. this.form.businessType = 'CHK' // 对账单
  1019. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  1020. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1021. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  1022. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  1023. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + ' 00:00:00' : null
  1024. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + ' 00:00:00' : null
  1025. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + ' 00:00:00' : null
  1026. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + ' 00:00:00' : null
  1027. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + ' 00:00:00' : null
  1028. this.form.finStlBillsItemsList = this.handleSelectionData
  1029. this.pageLoading = true
  1030. finstlbillsRevokeInvoicing(this.form).then(res => {
  1031. this.$message.success('操作成功');
  1032. this.finstlbillsDetailfun(res.data.data.id)
  1033. }).finally(() => {
  1034. this.pageLoading = false
  1035. })
  1036. },
  1037. // 对账确认
  1038. finstlbillsConfirmReconciliationfun() {
  1039. this.pageLoading = true
  1040. this.saveLoading = true
  1041. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  1042. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1043. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  1044. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  1045. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + ' 00:00:00' : null
  1046. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + ' 00:00:00' : null
  1047. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + ' 00:00:00' : null
  1048. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + ' 00:00:00' : null
  1049. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + ' 00:00:00' : null
  1050. this.form.url = '/iosBasicData/finstlbills/index',
  1051. this.form.pageStatus = "this.$store.getters.paidapplication"
  1052. this.form.pageLabel = "对账中心(F)"
  1053. finstlbillsConfirmReconciliation(this.form).then(res => {
  1054. this.$message.success('操作成功');
  1055. this.editSave = true
  1056. this.finstlbillsDetailfun(res.data.data.id)
  1057. }).finally(() => {
  1058. this.pageLoading = false
  1059. this.saveLoading = false
  1060. })
  1061. },
  1062. // 对账撤销
  1063. finstlbillsRevokeReconciliationfun() {
  1064. this.$confirm("确定进行撤销对账操作?", {
  1065. confirmButtonText: "确定",
  1066. cancelButtonText: "取消",
  1067. type: "warning"
  1068. }).then(() => {
  1069. this.pageLoading = true
  1070. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  1071. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1072. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  1073. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  1074. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + ' 00:00:00' : null
  1075. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + ' 00:00:00' : null
  1076. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + ' 00:00:00' : null
  1077. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + ' 00:00:00' : null
  1078. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + ' 00:00:00' : null
  1079. finstlbillsRevokeReconciliation(this.form).then(res => {
  1080. this.$message.success('操作成功');
  1081. this.finstlbillsDetailfun(res.data.data.id)
  1082. }).finally(() => {
  1083. this.pageLoading = false
  1084. })
  1085. })
  1086. },
  1087. // 确认签收
  1088. ConfirmReceiptfun() {
  1089. if (this.handleSelectionData.length === 0) {
  1090. this.$message.warning("请选择至少一条数据");
  1091. return;
  1092. }
  1093. for (let item of this.handleSelectionData) {
  1094. if (item.isSignfor == 1) {
  1095. this.$message.warning('请选择未签收的数据进行签收');
  1096. return;
  1097. }
  1098. }
  1099. this.$confirm("确定将选择数据签收?", {
  1100. confirmButtonText: "确定",
  1101. cancelButtonText: "取消",
  1102. type: "warning"
  1103. }).then(() => {
  1104. this.finstlbillsConfirmSignForfun()
  1105. })
  1106. },
  1107. // 撤销签收
  1108. RevokeReceiptfun() {
  1109. if (this.handleSelectionData.length === 0) {
  1110. this.$message.warning("请选择至少一条数据");
  1111. return;
  1112. }
  1113. for (let item of this.handleSelectionData) {
  1114. if (item.isSignfor == 0) {
  1115. this.$message.warning('请选择已签收的数据进行撤销');
  1116. return;
  1117. }
  1118. }
  1119. this.$confirm("确定将选择数据撤销签收?", {
  1120. confirmButtonText: "确定",
  1121. cancelButtonText: "取消",
  1122. type: "warning"
  1123. }).then(() => {
  1124. this.finstlbillsRevokeSignForfun()
  1125. })
  1126. },
  1127. // 确认选定行
  1128. SelectedRows() {
  1129. this.editCustomer()
  1130. },
  1131. // 一键删除
  1132. batchDeletefun() {
  1133. if (this.handleSelectionData.length == 0) {
  1134. return this.$message.warning('请选择要删除的数据')
  1135. }
  1136. this.$confirm("确定将选择数据删除?", {
  1137. confirmButtonText: "确定",
  1138. cancelButtonText: "取消",
  1139. type: "warning"
  1140. }).then(() => {
  1141. // 获取有id 的数据
  1142. const itemsWithId = this.handleSelectionData.filter(item => item.hasOwnProperty('id'));
  1143. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  1144. // 把选中的删除掉
  1145. this.handleSelectionData.forEach((item) => {
  1146. for (let index in this.tableData) {
  1147. if (item.accBillNo == this.tableData[index].accBillNo) {
  1148. this.tableData.splice(Number(index), 1)
  1149. }
  1150. }
  1151. })
  1152. // 有id 的处理
  1153. if (itemsWithId.length != 0) {
  1154. finstlbillsitemsRemove(arrIds.join(',')).then(res => {
  1155. this.$message.success('操作成功')
  1156. })
  1157. }
  1158. })
  1159. },
  1160. // 下面表格多选
  1161. handleSelectionChange(arr) {
  1162. this.handleSelectionData = arr
  1163. },
  1164. //返回列表
  1165. backToList() {
  1166. this.$emit('goBack')
  1167. },
  1168. // 请求的接口
  1169. // 确认签收接口
  1170. finstlbillsConfirmSignForfun() {
  1171. this.form.billNoFormat = 'HYDZ'
  1172. this.form.businessTypeCode = 'HYDZ'
  1173. this.form.businessType = 'CHK' //对账单
  1174. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  1175. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1176. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  1177. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  1178. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + ' 00:00:00' : null
  1179. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + ' 00:00:00' : null
  1180. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + ' 00:00:00' : null
  1181. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + ' 00:00:00' : null
  1182. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + ' 00:00:00' : null
  1183. // 保留id
  1184. this.form.finStlBillsItemsList = this.handleSelectionData
  1185. this.pageLoading = true
  1186. finstlbillsConfirmSignFor(this.form).then(res => {
  1187. this.$message.success('操作成功');
  1188. this.finstlbillsDetailfun(res.data.data.id)
  1189. }).finally(() => {
  1190. this.pageLoading = false
  1191. })
  1192. },
  1193. // 撤销签收接口
  1194. finstlbillsRevokeSignForfun() {
  1195. this.form.billNoFormat = 'HYDZ'
  1196. this.form.businessTypeCode = 'HYDZ'
  1197. this.form.businessType = 'CHK' // 对账单
  1198. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  1199. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1200. this.form.accountDateFrom = this.form.accountDateFrom ? this.form.accountDateFrom.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  1201. this.form.accountDateTo = this.form.accountDateTo ? this.form.accountDateTo.slice(0, 10) + ' 00:00:00' : null // 财务开始日期
  1202. this.form.auditDateFrom = this.form.auditDateFrom ? this.form.auditDateFrom.slice(0, 10) + ' 00:00:00' : null
  1203. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + ' 00:00:00' : null
  1204. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + ' 00:00:00' : null
  1205. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + ' 00:00:00' : null
  1206. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + ' 00:00:00' : null
  1207. this.form.finStlBillsItemsList = this.handleSelectionData
  1208. this.pageLoading = true
  1209. finstlbillsRevokeSignFor(this.form).then(res => {
  1210. this.$message.success('操作成功');
  1211. this.finstlbillsDetailfun(res.data.data.id)
  1212. }).finally(() => {
  1213. this.pageLoading = false
  1214. })
  1215. },
  1216. // 获取 全部是否 接口
  1217. allyesnoWorkDictsfun() {
  1218. // 全部/是/否
  1219. getWorkDicts('all_yes_no').then(res => {
  1220. this.allyesnoData = res.data.data;
  1221. })
  1222. // 对账字典
  1223. getWorkDicts('los_check_status').then(res => {
  1224. this.isCheckedData = res.data.data;
  1225. })
  1226. // 销账(F)
  1227. getWorkDicts('write_off_los').then(res => {
  1228. this.isClearedData = [{ dictValue: '全部', dictKey: null }, ...res.data.data]
  1229. })
  1230. },
  1231. // 获取发票的字典数据
  1232. invoiceWorkDictsfun() {
  1233. getWorkDicts('invoice_los').then(res => {
  1234. this.isInvoiceData = res.data.data;
  1235. })
  1236. },
  1237. // 获取币别数据
  1238. getRateListfun(cnName) {
  1239. getRateList({ current: 1, size: 10, cnName }).then(res => {
  1240. this.curCodeData = res.data.data.records
  1241. })
  1242. },
  1243. // 获取操作员数据
  1244. updateUserUserGetListfun(account) {
  1245. userGetList(1, 10, { account }).then(res => {
  1246. this.updateUserData = res.data.data.records
  1247. })
  1248. },
  1249. // 获取公司名称 用户管理左侧
  1250. ownDeptLazyTreefun() {
  1251. getDeptLazyTree(0).then(res => {
  1252. this.srcData = res.data.data
  1253. })
  1254. },
  1255. // 获取业务来源代理数据
  1256. srcBcorpsListfun(cnName) {
  1257. let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  1258. getBcorpslistByType(1, 10, { cnName, corpTypeName }).then(res => {
  1259. this.srcData = res.data.data.records
  1260. })
  1261. },
  1262. // 获取业务员数据
  1263. salesuserGetListfun(account = undefined, type = false,) {
  1264. userGetList(1, 10, { account }).then(res => {
  1265. this.srcData = res.data.data.records
  1266. })
  1267. },
  1268. // 获取对账单位数据
  1269. corpBcorpsListfun(cnName) {
  1270. getBcorpslistByType(1, 10, { cnName }).then(res => {
  1271. this.corpData = res.data.data.records
  1272. })
  1273. },
  1274. // 预览报表
  1275. handleReportPreview(url, data) {
  1276. console.log(url, 1670)
  1277. console.log(data, 1671)
  1278. Stimulsoft.Base.StiLicense.key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE'
  1279. // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
  1280. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml', true, 'zh-CHS')
  1281. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml')
  1282. // 工具栏
  1283. var options = new Stimulsoft.Viewer.StiViewerOptions()
  1284. options.height = '100%'
  1285. options.appearance.scrollbarsMode = true // 滚动条模式
  1286. options.toolbar.showDesignButton = false // 显示设计按钮
  1287. options.toolbar.showAboutButton = false // 显示关于按钮
  1288. options.toolbar.showResourcesButton = false // 显示资源按钮
  1289. options.toolbar.showFullScreenButton = false // 显示全屏按钮
  1290. options.toolbar.showOpenButton = false // 显示打开按钮
  1291. options.appearance.showTooltips = false // 显示工具提示
  1292. options.appearance.showDialogsHelp = false // 显示对话框帮助
  1293. options.exports.showExportToDocument = false // 显示导出到文档
  1294. options.toolbar.showParametersButton = true // 显示参数按钮
  1295. options.appearance.bookmarksPrint = true // 书签打印
  1296. // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
  1297. // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
  1298. // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
  1299. // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
  1300. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct
  1301. // htmlRenderMode html渲染模式
  1302. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table
  1303. // 是创建一个 Stimulsoft 报表查看器的实例的代码
  1304. let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
  1305. // 报表
  1306. console.log("创建一个报表实例");
  1307. console.log()
  1308. let report = new window.Stimulsoft.Report.StiReport();
  1309. // 加载文件
  1310. console.log("从url加载报表");
  1311. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  1312. report.load(url)
  1313. data.pageOne = 'Page : 1 of 1'
  1314. // 处理超长数据
  1315. if (data.hshipperDetails) {
  1316. var consignerIndex2 = data.hshipperDetails.indexOf('\n')
  1317. for (let i = 0; i < 4; i++) {
  1318. consignerIndex2 = data.hshipperDetails.indexOf('\n', consignerIndex2 + 1);
  1319. }
  1320. if (consignerIndex2 != -1) {
  1321. var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length)
  1322. data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + ' *'
  1323. data.commodityDescr += '\n*' + hshipperDetails
  1324. }
  1325. }
  1326. if (data.hconsigneeDetails) {
  1327. var consigneeIndex2 = data.hconsigneeDetails.indexOf('\n')
  1328. for (let i = 0; i < 3; i++) {
  1329. consigneeIndex2 = data.hconsigneeDetails.indexOf('\n', consigneeIndex2 + 1);
  1330. }
  1331. if (consigneeIndex2 != -1) {
  1332. var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length)
  1333. data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + ' **'
  1334. data.commodityDescr += '\n**' + hconsigneeDetails
  1335. }
  1336. }
  1337. if (data.hnotifyDetails) {
  1338. var notifierIndex2 = data.hnotifyDetails.indexOf('\n')
  1339. for (let i = 0; i < 3; i++) {
  1340. notifierIndex2 = data.hnotifyDetails.indexOf('\n', notifierIndex2 + 1);
  1341. }
  1342. if (notifierIndex2 != -1) {
  1343. var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length)
  1344. data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + ' ***'
  1345. data.commodityDescr += '\n***' + hnotifyDetails
  1346. }
  1347. }
  1348. // 处理箱号
  1349. if (this.isPrintTheBoxNumber) {
  1350. data.commodityDescr += '\n.\n.\n'
  1351. }
  1352. // PLACE & DATE OF ISSUE
  1353. data.placeAndDateOfIssue = ''
  1354. if (data.issueAt) {
  1355. data.placeAndDateOfIssue += data.issueAt
  1356. }
  1357. if (data.issueDate) {
  1358. let date = new Date(data.issueDate.replace(/-/g, '/'));
  1359. let yyyy = date.getFullYear();
  1360. let mmmm = date.toDateString().split(" ")[1]
  1361. let dd = date.getDate()
  1362. data.placeAndDateOfIssue += ', ' + dd + '-' + mmmm + '-' + yyyy
  1363. }
  1364. // Total number of containers or packages received by the Carriers
  1365. if (data.preContainersList) {
  1366. let boxMap = new Map();
  1367. for (let boxQuantity of data.preContainersList) {
  1368. if (boxMap.get(boxQuantity.cntrTypeCode)) {
  1369. let v = boxMap.get(boxQuantity.cntrTypeCode)
  1370. boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity)
  1371. } else {
  1372. boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity)
  1373. }
  1374. }
  1375. let boxs = ''
  1376. boxMap.forEach(function (value, key, map) {
  1377. boxs += value + 'x' + key + ', '
  1378. })
  1379. boxs = boxs.substring(0, boxs.length - 2)
  1380. data.boxQuantity = boxs + ' CONTAINER(S) ONLY'
  1381. }
  1382. // Number of original B/Ls
  1383. if (data.numberOfObl) {
  1384. data.numberOfObl += ' (' + data.numberOfOblDigit + ')'
  1385. }
  1386. if (data.commodityDescr) {
  1387. var descriptionIndex2 = data.commodityDescr.indexOf('\n')
  1388. for (let i = 0; i < 19; i++) {
  1389. descriptionIndex2 = data.commodityDescr.indexOf('\n', descriptionIndex2 + 1);
  1390. }
  1391. if (descriptionIndex2 != -1) {
  1392. data.pageOne = 'Page : 1 of 2'
  1393. data.pageTwo = 'Page : 2 of 2'
  1394. var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length)
  1395. data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2)
  1396. data.extraLongTips = '** TO BE CONTINUED ON ATTACHED LIST **'
  1397. data.extraLongText = extraLongText
  1398. }
  1399. }
  1400. // console.log(data.hshipperDetails, 'hshipperDetails2')
  1401. // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
  1402. var dataSet = new Stimulsoft.System.Data.DataSet(
  1403. 'reportData'
  1404. )
  1405. dataSet.readJson(data) // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
  1406. // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
  1407. // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
  1408. report.regData('reportData', 'reportData', dataSet)
  1409. // 从模版和数据加载报表
  1410. // loadReport(report, '', {})
  1411. // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
  1412. viewer.report = report;
  1413. this.$refs.reportContainer.showContainer(
  1414. () => {
  1415. setTimeout(() => {
  1416. viewer.renderHtml('reportContainer')
  1417. this.createViewerButtons(viewer)
  1418. }, 50)
  1419. },
  1420. () => {
  1421. },
  1422. )
  1423. console.log("加载成功完成!");
  1424. },
  1425. createViewerButtons(viewer) {
  1426. viewer.jsObject.collections.images['myClose.png'] =
  1427. 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg=='
  1428. const closeBtn = viewer.jsObject.SmallButton(
  1429. 'closeBtn',
  1430. '关闭',
  1431. 'myClose.png'
  1432. )
  1433. // 增加打印弹窗配置
  1434. const printBtn = viewer.jsObject.SmallButton(
  1435. 'printBtn',
  1436. '打印报表',
  1437. 'myClose.png'
  1438. )
  1439. // console.log(viewer.jsObject.print(),'1013')
  1440. // 获取 关闭按钮的dom元素位置
  1441. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild
  1442. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild
  1443. const userButtonCell = buttonsTable.rows[0].insertCell(0)
  1444. // 获取打印按钮的位置
  1445. const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
  1446. const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
  1447. userButtonPrint.addEventListener("click", (event) => {
  1448. console.log("打印点击");
  1449. // event.preventDefault()
  1450. });
  1451. userButtonPrint.addEventListener("mouseover", (event) => {
  1452. console.log("移入打印按钮");
  1453. console.log(event, 1035)
  1454. });
  1455. userButtonCell.className = 'stiJsViewerClearAllStyles'
  1456. userButtonCell.appendChild(closeBtn) // 添加关闭节点
  1457. // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
  1458. let that = this
  1459. // 关闭按钮的监听点击
  1460. closeBtn.action = function () {
  1461. console.log(that.$refs.ReportContainer, '1022')
  1462. if (that.$refs.reportContainer)
  1463. that.$refs.reportContainer.hideContainer()
  1464. }
  1465. // // // 打印按钮监听
  1466. // printBtn.action = (e)=>{
  1467. // console.log('打印')
  1468. // window.print()
  1469. // }
  1470. },
  1471. }
  1472. }
  1473. </script>
  1474. <style scoped>
  1475. ::v-deep.el-form-item {
  1476. margin-bottom: 0;
  1477. }
  1478. .bottomFlex {
  1479. display: flex;
  1480. align-items: center;
  1481. }
  1482. .weightfont {
  1483. font-size: 20px;
  1484. font-weight: bold;
  1485. }
  1486. .weightnum {
  1487. font-size: 15px;
  1488. font-weight: 500;
  1489. }
  1490. </style>