amendsDetails.vue 67 KB

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