amendsDetails.vue 68 KB

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