fininvoicesDetails.vue 92 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740
  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" :loading="saveLoading" :disabled="!form.id"
  11. @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 type="success" size="small" :disabled="!form.id" plain @click="newbillFun">新建发票申请
  17. </el-button>
  18. <el-button size="small" type="warning" plain style="margin-right: 8px" :disabled="!form.id || editPower"
  19. v-if="form.status == 3" :loading="saveLoading" @click="revokeFinInvoicesApprovefun">撤销
  20. </el-button>
  21. <el-button size="small" type="success" plain style="margin-right: 8px" :disabled="!form.id || editPower"
  22. v-else :loading="saveLoading" @click="submit('提交')">提交
  23. </el-button>
  24. <el-button size="small" type="primary" :disabled="statusType || editPower" style="margin-right: 8px"
  25. v-if="editSave" :loading="saveLoading" @click="editHandle">编 辑
  26. </el-button>
  27. <el-button size="small" type="primary" :disabled="statusType" style="margin-right: 8px" v-else
  28. :loading="saveLoading" @click="editCustomer()">保 存
  29. </el-button>
  30. <!-- <el-dropdown style="line-height: 0">
  31. <el-button type="warning" :loading="saveLoading" :disabled="!form.id" size="small">
  32. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  33. </el-button>
  34. <el-dropdown-menu slot="dropdown">
  35. <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
  36. </el-dropdown-item>
  37. </el-dropdown-menu>
  38. </el-dropdown> -->
  39. </div>
  40. </div>
  41. <div style="margin: 55px 5px 0px 5px;'">
  42. <el-form :model="form" ref="form" :rules="rules" label-width="90px" class="demo-ruleForm">
  43. <trade-card title="基础信息" styleIocup="color:#4b9fe9">
  44. <el-row>
  45. <el-col :span="10">
  46. <div class="flexBoxLeft">
  47. <el-row>
  48. <el-col :span="12">
  49. <el-form-item label="发票号码" prop="invoiceNo">
  50. <el-input style="width: 100%;" v-model="form.invoiceNo" size="small"
  51. autocomplete="off" :disabled="true" clearable placeholder="发票号码">
  52. </el-input>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :span="12">
  56. <el-form-item label="开票日期" prop="invoiceDate">
  57. <el-date-picker v-model="form.invoiceDate" clearable style="width: 100%;"
  58. type="date" size="small" :disabled="editSave" value-format="yyyy-MM-dd"
  59. placeholder="请选择开票日期">
  60. </el-date-picker>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="24">
  64. <el-form-item label="开票单位" prop="invCorpCnName">
  65. <search-query :datalist="invCorpData" :selectValue="form.invCorpCnName"
  66. :clearable="true" :disabled="editSave || !form.corpId" :buttonIf="false"
  67. :remote="true" :filterable="true" placeholder="请选择开票单位"
  68. :forParameter="{ key: 'id', label: 'invoiceHeader', value: 'id' }"
  69. @corpChange="corpChange($event, 'invCorpCnName')"
  70. @remoteMethod="invcorpsinvoiceheaderListfun"
  71. @corpFocus="invcorpsinvoiceheaderListfun">
  72. </search-query>
  73. </el-form-item>
  74. </el-col>
  75. <el-col :span="12">
  76. <el-form-item label="税号" prop="invCorpTaxNo">
  77. <el-input style="width: 100%;" v-model="form.invCorpTaxNo" size="small"
  78. autocomplete="off" :disabled="true" clearable placeholder="请输入税号">
  79. </el-input>
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="12">
  83. <el-form-item label="发票币种" prop="invCurCode">
  84. <search-query :datalist="invCurCodeData" :selectValue="form.invCurCode"
  85. :filterable="true" :clearable="true" :disabled="editSave"
  86. :buttonIf="false" placeholder="请选择发票币种"
  87. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  88. @corpChange="corpChange($event, 'invCurCode')"
  89. @corpFocus="invCurCodeRateListfun">
  90. </search-query>
  91. </el-form-item>
  92. </el-col>
  93. <el-col :span="12">
  94. <el-form-item label="美元银行" prop="invCorpAccountBankUsd">
  95. <el-input style="width: 100%;" v-model="form.invCorpAccountBankUsd"
  96. size="small" autocomplete="off" :disabled="true" clearable
  97. placeholder="请输入美元银行">
  98. </el-input>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="12">
  102. <el-form-item label="美元账户" prop="invCorpAccountNoUsd">
  103. <el-input style="width: 100%;" v-model="form.invCorpAccountNoUsd"
  104. size="small" autocomplete="off" :disabled="true" clearable
  105. placeholder="请输入美元账户">
  106. </el-input>
  107. </el-form-item>
  108. </el-col>
  109. </el-row>
  110. <el-row v-show="showForm">
  111. <el-col :span="12">
  112. <el-form-item label="人民币银行" prop="invCorpAccountBankCny">
  113. <el-input style="width: 100%;" v-model="form.invCorpAccountBankCny"
  114. size="small" autocomplete="off" :disabled="true" clearable
  115. placeholder="请输入美元银行">
  116. </el-input>
  117. </el-form-item>
  118. </el-col>
  119. <el-col :span="12">
  120. <el-form-item label="人民币账户" prop="invCorpAccountNoCny">
  121. <el-input style="width: 100%;" v-model="form.invCorpAccountNoCny"
  122. size="small" autocomplete="off" :disabled="true" clearable
  123. placeholder="请输入人民币账户">
  124. </el-input>
  125. </el-form-item>
  126. </el-col>
  127. <el-col :span="12">
  128. <el-form-item label="船名/航次" prop="vesselVoyno">
  129. <el-input style="width: 100%;" v-model="form.vesselVoyno" size="small"
  130. autocomplete="off" :disabled="editSave" clearable
  131. placeholder="请输入船名/航次">
  132. </el-input>
  133. </el-form-item>
  134. </el-col>
  135. <el-col :span="12">
  136. <el-form-item label="开航日期" prop="etd">
  137. <el-date-picker v-model="form.etd" clearable style="width: 100%;"
  138. type="date" size="small" :disabled="editSave"
  139. value-format="yyyy-MM-dd HH:mm:ss" placeholder="请输入开航日期">
  140. </el-date-picker>
  141. </el-form-item>
  142. </el-col>
  143. <el-col :span="12">
  144. <el-form-item label="装货港" prop="pol">
  145. <search-query :datalist="polData" :selectValue="form.pol" :filterable="true"
  146. :clearable="true" :remote="true" :disabled="editSave" :buttonIf="false"
  147. placeholder="请选择装货港"
  148. :forParameter="{ key: 'id', label: 'enName', value: 'enName' }"
  149. @corpChange="corpChange($event, 'pol')" @remoteMethod="polBportsListfun"
  150. @corpFocus="polBportsListfun">
  151. </search-query>
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="12">
  155. <el-form-item label="卸货港" prop="pod">
  156. <search-query :datalist="podData" :selectValue="form.pod" :filterable="true"
  157. :clearable="true" :remote="true" :disabled="editSave" :buttonIf="false"
  158. placeholder="请选择卸货港"
  159. :forParameter="{ key: 'id', label: 'enName', value: 'enName' }"
  160. @corpChange="corpChange($event, 'pod')" @remoteMethod="podBportsListfun"
  161. @corpFocus="podBportsListfun">
  162. </search-query>
  163. </el-form-item>
  164. </el-col>
  165. <el-col :span="12">
  166. <el-form-item label="目的地" prop="destination">
  167. <search-query :datalist="destinationData" :selectValue="form.destination"
  168. :filterable="true" :clearable="true" :remote="true" :disabled="editSave"
  169. :buttonIf="false" placeholder="请选择目的地"
  170. :forParameter="{ key: 'id', label: 'enName', value: 'enName' }"
  171. @corpChange="corpChange($event, 'destination')"
  172. @remoteMethod="destinationBportsListfun"
  173. @corpFocus="destinationBportsListfun">
  174. </search-query>
  175. </el-form-item>
  176. </el-col>
  177. <el-col :span="12">
  178. <el-form-item label="箱型箱量" prop="containers">
  179. <el-input style="width: 100%;" v-model="form.containers" size="small"
  180. autocomplete="off" :disabled="editSave" clearable placeholder="请输入箱型箱量">
  181. </el-input>
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="8">
  185. <el-form-item label="开票CNY:" prop="amountCny">
  186. <span>¥{{ form.amountCny }}</span>
  187. </el-form-item>
  188. </el-col>
  189. <el-col :span="8">
  190. <el-form-item label="开票USD:" prop="amountUsd">
  191. <span>${{ form.amountUsd }}</span>
  192. </el-form-item>
  193. </el-col>
  194. <el-col :span="8">
  195. <el-form-item label="开票合计:" prop="amountLoc">
  196. <span>¥{{ form.amountLoc }}</span>
  197. </el-form-item>
  198. </el-col>
  199. </el-row>
  200. </div>
  201. </el-col>
  202. <el-col :span="14">
  203. <div class="flexBoxRight">
  204. <!--<el-row>-->
  205. <!-- <el-col :span="6">-->
  206. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  207. <!-- :disabled="editSave"-->
  208. <!-- v-model="form.isDk">整票(不列费用明细)-->
  209. <!-- </el-checkbox>-->
  210. <!-- </el-col>-->
  211. <!-- <el-col :span="5">-->
  212. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  213. <!-- :disabled="editSave"-->
  214. <!-- v-model="form.isRp">只提取开票费用-->
  215. <!-- </el-checkbox>-->
  216. <!-- </el-col>-->
  217. <!-- <el-col :span="3">-->
  218. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  219. <!-- :disabled="editSave"-->
  220. <!-- v-model="form.isExportMblno">主单号-->
  221. <!-- </el-checkbox>-->
  222. <!-- </el-col>-->
  223. <!-- <el-col :span="3">-->
  224. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  225. <!-- :disabled="editSave"-->
  226. <!-- v-model="form.isExportVslvoy">船名航次-->
  227. <!-- </el-checkbox>-->
  228. <!-- </el-col>-->
  229. <!-- <el-col :span="3">-->
  230. <!-- <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"-->
  231. <!-- :disabled="editSave"-->
  232. <!-- v-model="form.isExportHblno">分单号-->
  233. <!-- </el-checkbox>-->
  234. <!-- </el-col>-->
  235. <!--</el-row>-->
  236. <el-row>
  237. <el-col :span="8">
  238. <el-form-item label="结算单位" prop="corpCnName">
  239. <search-query :datalist="corpData" :selectValue="form.corpCnName"
  240. :clearable="true" :disabled="editSave" :buttonIf="false" :remote="true"
  241. :filterable="true" placeholder="请输入结算单位"
  242. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  243. @corpChange="corpChange($event, 'corpCnName')"
  244. @remoteMethod="corpBcorpsListfun" @corpFocus="corpBcorpsListfun">
  245. </search-query>
  246. </el-form-item>
  247. </el-col>
  248. <el-col :span="8">
  249. <el-form-item label="费用名称" prop="feeCnName">
  250. <dic-select v-model="form.feeCnName" placeholder="费用名称" key="id"
  251. label="cnName" url="/blade-los/bfees/listAll" :filterable="true"
  252. :multiple="true" :collapseTags="true" :disabled="editSave"></dic-select>
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="8">
  256. <el-form-item label="税控发票号" prop="taxInvoiceNo">
  257. <el-input style="width: 100%;" v-model="form.taxInvoiceNo" size="small"
  258. autocomplete="off" :disabled="editSave" clearable
  259. placeholder="请输入税控发票号">
  260. </el-input>
  261. </el-form-item>
  262. </el-col>
  263. <el-col :span="9">
  264. <el-form-item label="业务日期" prop="accountDateFrom">
  265. <el-date-picker v-model="form.accountDateFrom" clearable
  266. style="width: 100%;" type="date" size="small" :disabled="editSave"
  267. value-format="yyyy-MM-dd" placeholder="选择业务日期">
  268. </el-date-picker>
  269. </el-form-item>
  270. </el-col>
  271. <el-col :span="7">
  272. <el-form-item label="-" prop="accountDateTo" label-width="30px">
  273. <el-date-picker v-model="form.accountDateTo" clearable style="width: 100%;"
  274. type="date" size="small" :disabled="editSave" value-format="yyyy-MM-dd"
  275. placeholder="选择业务日期">
  276. </el-date-picker>
  277. </el-form-item>
  278. </el-col>
  279. <el-col :span="8">
  280. <el-form-item label="发票汇率" prop="exrate">
  281. <el-input style="width: 100%;" v-model="form.exrate" size="small"
  282. autocomplete="off" :disabled="editSave" clearable placeholder="请输入发票汇率">
  283. </el-input>
  284. </el-form-item>
  285. </el-col>
  286. <el-col :span="16">
  287. <el-form-item label="业务编号" prop="businessNo">
  288. <el-input style="width: 100%;" v-model="form.businessNo" size="small"
  289. autocomplete="off" :disabled="editSave" clearable placeholder="请输入业务编号">
  290. </el-input>
  291. </el-form-item>
  292. </el-col>
  293. <el-col :span="8">
  294. <el-form-item label="发票类型" prop="invType">
  295. <search-query :datalist="invTypeData" :selectValue="form.invType"
  296. :clearable="true" :disabled="editSave" :buttonIf="false"
  297. placeholder="请输入发票类型"
  298. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  299. @corpChange="corpChange($event, 'invType')"
  300. @corpFocus="invTypeWorkDictsfun">
  301. </search-query>
  302. </el-form-item>
  303. </el-col>
  304. <el-col :span="16">
  305. <el-form-item label="主单编号" prop="mblno">
  306. <el-input style="width: 100%;" v-model="form.mblno" size="small"
  307. autocomplete="off" :disabled="editSave" clearable placeholder="请输入主单编号">
  308. </el-input>
  309. </el-form-item>
  310. </el-col>
  311. <el-col :span="8">
  312. <el-form-item label="对账单号" prop="checkNo">
  313. <el-input style="width: 100%;" v-model="form.checkNo" size="small"
  314. autocomplete="off" :disabled="editSave" clearable placeholder="请输入对账单号">
  315. </el-input>
  316. </el-form-item>
  317. </el-col>
  318. </el-row>
  319. <el-row v-show="showForm">
  320. <el-col :span="16">
  321. <el-form-item label="分单编号" prop="hblno">
  322. <el-input style="width: 100%;" v-model="form.hblno" size="small"
  323. autocomplete="off" :disabled="editSave" clearable placeholder="请输入分单编号">
  324. </el-input>
  325. </el-form-item>
  326. </el-col>
  327. <el-col :span="8">
  328. <el-form-item label="BOOK NO" prop="bookingNo">
  329. <el-input style="width: 100%;" v-model="form.bookingNo" size="small"
  330. autocomplete="off" :disabled="editSave" clearable
  331. placeholder="请输入BOOK NO">
  332. </el-input>
  333. </el-form-item>
  334. </el-col>
  335. <el-col :span="8">
  336. <el-form-item label="业务类型" prop="businessTypes">
  337. <search-query :datalist="businessTypesData"
  338. :selectValue="form.businessTypes" :clearable="true" :disabled="editSave"
  339. :buttonIf="false" :multiple="true" :collapseTags="true"
  340. placeholder="请输入业务类型" @corpChange="corpChange($event, 'businessTypes')">
  341. </search-query>
  342. </el-form-item>
  343. </el-col>
  344. <el-col :span="8">
  345. <el-form-item label="税率(%)" prop="taxRate">
  346. <el-input style="width: 100%;" v-model="form.taxRate" size="small"
  347. autocomplete="off" :disabled="editSave" clearable placeholder="请输入税率">
  348. </el-input>
  349. </el-form-item>
  350. </el-col>
  351. <el-col :span="8">
  352. <el-form-item label="选择币种" prop="curCode">
  353. <search-query :datalist="curData" :selectValue="form.curCode"
  354. :filterable="true" :clearable="true" :disabled="editSave" :remote="true"
  355. :buttonIf="false" placeholder="请输入选择币种"
  356. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  357. @remoteMethod="getRateListfun"
  358. @corpChange="corpChange($event, 'curCode')" @corpFocus="getRateListfun">
  359. </search-query>
  360. </el-form-item>
  361. </el-col>
  362. <el-col :span="12">
  363. <el-form-item label="邮箱" prop="yx">
  364. <el-input style="width: 100%;" v-model="form.yx" size="small"
  365. autocomplete="off" :disabled="editSave" clearable placeholder="请输入邮箱">
  366. </el-input>
  367. </el-form-item>
  368. </el-col>
  369. <el-col :span="24">
  370. <el-form-item label="全电发票:" prop="elecRemarks">
  371. <el-input style="width: 100%;" v-model="form.elecRemarks" size="small"
  372. autocomplete="off" type="textarea" clearable placeholder="请输入全电发票备注">
  373. </el-input>
  374. </el-form-item>
  375. </el-col>
  376. </el-row>
  377. </div>
  378. </el-col>
  379. </el-row>
  380. <div style="display: flex;justify-content: flex-end;align-items: center;">
  381. <el-checkbox style="margin-left: 10%" size="medium" :true-label="1" :false-label="0"
  382. :disabled="editSave" v-model="form.isExchangeToCny">转换成人民币
  383. </el-checkbox>
  384. <el-checkbox v-model="appendType" :disabled="statusType" false-label="检索"
  385. true-label="追加">追加</el-checkbox>
  386. <el-button type="primary" size="small"
  387. :disabled="statusType || (tableData.length > 0 && appendType == '检索')" plain
  388. @click="finstlbillslistAccBillV1fun(appendType)">提取费用
  389. </el-button>
  390. <el-button size="small" :disabled="tableData.length > 0" @click="ResetFilter">重置条件
  391. </el-button>
  392. <el-button icon="el-icon-arrow-down" type="text" size="small" v-if="!showForm"
  393. @click="showForm = true">开展</el-button>
  394. <el-button icon="el-icon-arrow-up" type="text" size="small" v-if="showForm"
  395. @click="showForm = false">收缩</el-button>
  396. </div>
  397. </trade-card>
  398. <el-card style="margin-top: 10px">
  399. <el-tabs v-model="detailTabs" type="card">
  400. <el-tab-pane label="费用明细" name="first">
  401. <div style="margin-bottom: 10px;display: flex;">
  402. <search-query :datalist="serverData" :selectValue="form.serverName" :clearable="true"
  403. :buttonIf="false" :filterable="true"
  404. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictValue' }"
  405. placeholder="请选择开票项目" @corpChange="corpChange($event, 'serverName')"
  406. @corpFocus="serverWorkDictsfun">
  407. </search-query>
  408. <el-button style="margin-left: 10px" :disabled="!form.id || statusType" size="small"
  409. type="primary" @click="invoicingfun">生成开票明细</el-button>
  410. <el-button style="margin-left: 10px" :disabled="!form.id || statusType" size="small"
  411. type="warning" @click="invoicingRevokefun">撤销开票明细</el-button>
  412. <el-button size="small" :disabled="statusType" type="danger"
  413. @click="batchDeletefun">一键删除</el-button>
  414. <el-input style="width: 10%;margin-left: 10px;" v-model="invoiceAmountCNY" size="small"
  415. autocomplete="off" type="numbers" clearable placeholder="开票金额">
  416. <span style="line-height: 32px;" slot="suffix">CNY</span>
  417. </el-input>
  418. <el-input style="width: 10%;margin-left: 5px;" v-model="invoiceAmountUSD" size="small"
  419. autocomplete="off" type="numbers" clearable placeholder="开票金额">
  420. <span style="line-height: 32px;" slot="suffix">USD</span>
  421. </el-input>
  422. <el-button style="margin-left: 10px" :disabled="statusType" size="small" type="primary"
  423. @click="invoiceMatchingfun()">匹配金额</el-button>
  424. </div>
  425. <fininvoicesitems ref="fininvoicesitems" :tableData="tableData"
  426. :handleSelectionData="handleSelectionData" :editSave="editSave" :form="form"
  427. @handleSelectionChange="handleSelectionChange" @deletefun="detailsdeletionfun">
  428. </fininvoicesitems>
  429. </el-tab-pane>
  430. <el-tab-pane label="开票明细" name="second">
  431. <div style="margin-bottom: 10px;display: flex;">
  432. <el-button :disabled="statusType" size="small" type="danger"
  433. @click="invoicingBatchDelete">一键删除</el-button>
  434. </div>
  435. <fininvoiceitemdetail :tableData="InvoicingList"
  436. :handleSelectionData="invoicingCheckboxData"
  437. @handleSelectionChange="invoicingCheckboxChange" @deletefun="invoiceDeletionfun"
  438. @savefun="invoiceSavefun">
  439. </fininvoiceitemdetail>
  440. </el-tab-pane>
  441. </el-tabs>
  442. </el-card>
  443. <el-card class="box-card" style="margin-top: 10px">
  444. <el-row>
  445. <el-col :span="5">
  446. <el-form-item label="业务编号" prop="billNo">
  447. <el-input style="width: 100%;" v-model="form.billNo" size="small" autocomplete="off"
  448. :disabled="true" clearable placeholder="请输入业务编号">
  449. </el-input>
  450. </el-form-item>
  451. </el-col>
  452. <el-col :span="5">
  453. <el-form-item label="单据日期" prop="billDate">
  454. <el-date-picker v-model="form.billDate" clearable style="width: 100%;" type="date"
  455. size="small" :disabled="true" value-format="yyyy-MM-dd HH:mm" placeholder="选择单据日期">
  456. </el-date-picker>
  457. </el-form-item>
  458. </el-col>
  459. <el-col :span="5">
  460. <el-form-item label="制单人" prop="createUserName">
  461. <el-input style="width: 100%;" v-model="form.createUserName" size="small"
  462. autocomplete="off" :disabled="true" clearable placeholder="请输入制单人">
  463. </el-input>
  464. </el-form-item>
  465. </el-col>
  466. </el-row>
  467. </el-card>
  468. </el-form>
  469. </div>
  470. <!--设计报表弹窗-->
  471. <el-dialog append-to-body title="设计报表" class="el-dialogDeep" :visible.sync="DesignreportDialog" width="70%"
  472. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  473. <reports :id="form.id" :assemblyForm="form" businessValue="FPSQ"></reports>
  474. </el-dialog>
  475. <!--预览-->
  476. <el-dialog title="打印" :visible.sync="selectPrintingDialog" append-to-body width="70%"
  477. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  478. <div>
  479. <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
  480. </div>
  481. <span slot="footer" class="dialog-footer">
  482. <el-button size="small" @click="selectPrintingDialog = false;">取 消</el-button>
  483. </span>
  484. </el-dialog>
  485. <el-dialog title="选择数据" :visible.sync="retrievePopupsType" append-to-body width="70%"
  486. :close-on-click-modal="false">
  487. <div>
  488. <avue-crud :option="retrievePopupsOption" :data="retrievePopupsData" ref="retrievePopupsRef"
  489. id="out-table">
  490. <template slot="menu" slot-scope="{ row }">
  491. <el-button type="text" size="small" @click.stop="retrievePopupsSelect(row)">选择
  492. </el-button>
  493. </template>
  494. </avue-crud>
  495. </div>
  496. </el-dialog>
  497. <!--审核弹窗-->
  498. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  499. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  500. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  501. </el-dialog>
  502. <!--报表组件-->
  503. <reportContainer ref="reportContainer"></reportContainer>
  504. </div>
  505. </template>
  506. <script>
  507. import fininvoicesitems from "@/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoicesitems.vue";
  508. import fininvoiceitemdetail from "@/views/iosBasicData/fininvoicesApplyfor/assembly/fininvoiceitemdetail.vue";
  509. import { getRateList } from "@/api/iosBasicData/rateManagement";
  510. import { finstlbillsGetByDetail, finstlbillsitemsRemove, finstlbillslistAccBillV1 } from "@/api/iosBasicData/finstlbills";
  511. import { bcorpsbankList, corpsinvoiceheaderList, getBcorpsList } from "@/api/iosBasicData/bcorps";
  512. import { bportsList } from "@/api/iosBasicData/bports";
  513. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  514. import {
  515. finInvoicesApprove,
  516. fininvoicesDetail,
  517. revokeFinInvoicesApprove,
  518. fininvoicesSubmit,
  519. fininvoicesitemsRemove,
  520. generateFinInvoicesDetail,
  521. fininvoiceitemdetailRemove, revokeFinInvoicesDetail, fininvoiceitemdetailSubmit
  522. } from "@/api/iosBasicData/fininvoices";
  523. import { getWorkDicts } from "@/api/system/dictbiz";
  524. import { getCurrentDate } from "@/util/date";
  525. import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
  526. import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
  527. import { getList as getreportsList, reportsGetReportData } from "@/api/iosBasicData/reports";
  528. import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
  529. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  530. import dicSelect from "@/components/dicSelect/main";
  531. import { finstlbillslistAccBillByCorp } from '@/api/iosBasicData/finstlbills'
  532. export default {
  533. components: { checkSchedule, reportContainer, reportformsList, reports, SearchQuery, fininvoicesitems, fininvoiceitemdetail, dicSelect },
  534. data() {
  535. return {
  536. showForm: false,
  537. retrievePopupsType: false, // 弹窗开启关闭
  538. retrievePopupsData: [], // 选择弹窗数据
  539. retrievePopupsOption: {
  540. border: true,
  541. calcHeight: 30,
  542. tip: false,
  543. height: '500px',
  544. index: true,
  545. addBtn: false,
  546. viewBtn: false,
  547. delBtn: false,
  548. editBtn: false,
  549. refreshBtn: false,
  550. columnBtn: false,
  551. menuWidth: '60',
  552. header: false,
  553. column: [
  554. {
  555. label: "客户中文名",
  556. prop: "cnName",
  557. overHidden: true,
  558. },
  559. {
  560. label: "客户英文文名",
  561. prop: "cnName",
  562. overHidden: true,
  563. },
  564. ]
  565. },
  566. checkId: '', // 审核需要的id
  567. batchNo: '',
  568. checkScheduleDialog: false,
  569. DesignreportDialog: false, // 设计报表弹窗
  570. selectPrintingDialog: false, // 预览报表
  571. invoiceAmountCNY: 0, // 费用明细开票金额输入框CNY
  572. invoiceAmountUSD: 0, // 费用明细开票金额输入框USD
  573. statusType: false, // 是否已经提交
  574. serverData: [], // 开票项目数据
  575. detailTabs: 'first',
  576. appendType: '检索',
  577. pageLoading: false, // 全屏加载
  578. saveLoading: false, // 按钮加载
  579. form: {
  580. invCurCode: 'CNY',
  581. isRp: 1,
  582. invType: '全电发票',
  583. taxRate: 0,
  584. invoiceDate: getCurrentDate(),
  585. isExchangeToCny: 0,
  586. billDate: getCurrentDate(),
  587. },
  588. tableData: [], // 费用明细数据
  589. InvoicingList: [], // 开票明细数据
  590. handleSelectionData: [], // 费用明细选择的数据
  591. invoicingCheckboxData: [], // 开票明细选择的数据
  592. corpData: [], // 结算单位数据
  593. invCorpData: [], // 开票单位
  594. bankReceiptData: [], // 结算单位银行账号数据
  595. // 业务类型
  596. businessTypesData: [
  597. {
  598. label: '海运出口',
  599. value: 'SE'
  600. }, {
  601. label: '海运进口',
  602. value: 'SI'
  603. }
  604. ],
  605. curData: [], // 币别
  606. destinationData: [], // 目的港
  607. podData: [], // 卸货港
  608. polData: [], // 装货港
  609. invCurCodeData: [], // 发票币种
  610. invTypeData: [], // 发票类型
  611. rules: {
  612. corpCnName: [
  613. { required: true, message: '请输入付费对象', trigger: 'blur' },
  614. ],
  615. invoiceDate: [
  616. { required: true, message: '请输入开票日期', trigger: 'blur' },
  617. ],
  618. exrate: [
  619. { required: true, message: '请输入导入汇率', trigger: 'blur' },
  620. ],
  621. taxRate: [
  622. { required: true, message: '请输入所属税率', trigger: 'blur' },
  623. ],
  624. invCurCode: [
  625. { required: true, message: '请输入所属发票币别', trigger: 'blur' },
  626. ],
  627. },
  628. roleName: [], // 当前的角色权限
  629. saberUserInfo: {}, // 当前登录人信息
  630. editPower: false, // 当前是否可以编辑
  631. }
  632. },
  633. props: {
  634. editSave: {
  635. type: Boolean,
  636. default: false
  637. }
  638. },
  639. watch: {
  640. // 监听 状态
  641. "form.status": {
  642. // 执行方法
  643. handler(oldValue, newValue) {
  644. if (oldValue == 3) {
  645. this.statusType = true
  646. } else {
  647. this.statusType = false
  648. }
  649. },
  650. deep: true, // 深度监听
  651. immediate: true // 第一次改变就执行
  652. },
  653. },
  654. created() {
  655. this.roleName = localStorage.getItem('roleName').split(',')
  656. // 获取当前登录人个人信息
  657. this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
  658. if (!this.form.id) {
  659. getRateList({ current: 1, size: 30 }).then(res => {
  660. for (let item of res.data.data.records) {
  661. if (item.code == "USD") {
  662. this.$set(this.form, 'exrate', item.exrate)
  663. }
  664. }
  665. })
  666. }
  667. if (this.$route.query.mblno) {
  668. // console.log(111111)
  669. this.form.mblno = this.$route.query.mblno
  670. this.form.corpCnName = this.$route.query.corpCnName
  671. this.form.corpId = this.$route.query.corpId
  672. }
  673. },
  674. methods: {
  675. ResetFilter() {
  676. this.form = {
  677. invCurCode: 'CNY',
  678. isRp: 1,
  679. invType: '全电发票',
  680. taxRate: 0,
  681. invoiceDate: getCurrentDate(),
  682. isExchangeToCny: 0,
  683. billDate: getCurrentDate(),
  684. }
  685. getRateList({ current: 1, size: 30 }).then(res => {
  686. for (let item of res.data.data.records) {
  687. if (item.code == "USD") {
  688. this.$set(this.form, 'exrate', item.exrate)
  689. }
  690. }
  691. })
  692. },
  693. //请核关闭
  694. choceScheduleFun() {
  695. this.checkScheduleDialog = false
  696. },
  697. // 打印
  698. reportRadio(val) {
  699. // 获取报表数据
  700. reportsGetReportData({
  701. billId: this.form.id,
  702. reportCode: val.classifyCode,
  703. groupCode: val.groupCode,
  704. type: 'FPSQ'
  705. }).then(res => {
  706. this.handleReportPreview(val.url, res.data.data.data)
  707. })
  708. },
  709. // 报表预览
  710. previewreportfun() {
  711. getreportsList(1, 10, {
  712. businessType: 'FPSQ',
  713. // classifyCode:'结算中心',
  714. // groupCode:'付费结算'
  715. }).then(res => {
  716. if (res.data.data.records.length == 1) {
  717. this.reportRadio(res.data.data.records[0])
  718. } else {
  719. this.saveLoading = true
  720. this.selectPrintingDialog = true
  721. this.saveLoading = false
  722. let page = {
  723. pageSize: 10,
  724. currentPage: 1,
  725. total: 0
  726. }
  727. this.$nextTick(() => {
  728. this.$refs.reportformsList.onLoad(page, {
  729. businessType: 'FPSQ',
  730. // classifyCode:'结算中心',
  731. // groupCode:'付费结算'
  732. })
  733. })
  734. }
  735. })
  736. },
  737. // 开票明细编辑完成保存
  738. invoiceSavefun(row) {
  739. row.amountRate = this.form.taxRate
  740. // 销售额/(1+税率)×税率
  741. row.amountTax = (row.amount / (1 + (Number(row.amountRate) / 100)) * (Number(row.amountRate) / 100)).toFixed(2)
  742. fininvoiceitemdetailSubmit(row).then(res => {
  743. this.$message.success('操作成功')
  744. this.fininvoicesDetailfun(this.form.id)
  745. })
  746. },
  747. // 确认开票信息
  748. invoicingfun() {
  749. if (this.handleSelectionData.length == 0) {
  750. this.$message.warning('请选择数据')
  751. return;
  752. }
  753. if (!this.form.serverName) {
  754. this.$message.warning('请选择开票项目')
  755. return
  756. }
  757. let obj = this.form
  758. obj.finInvoicesItemsList = []
  759. obj.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
  760. obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  761. //开票日期
  762. if (this.form.invoiceDate) {
  763. obj.invoiceDate = this.form.invoiceDate.slice(0, 10) + ' 00:00:00'
  764. }
  765. // 业务日期
  766. if (this.form.accountDateFrom) {
  767. this.form.accountDateFrom = this.form.accountDateFrom.slice(0, 10) + ' 00:00:00'
  768. }
  769. if (this.form.accountDateTo) {
  770. this.form.accountDateTo = this.form.accountDateTo.slice(0, 10) + ' 00:00:00'
  771. }
  772. for (let item of this.handleSelectionData) {
  773. // 拿未开票的数据
  774. if (item.status == 0) {
  775. if (item.currentCurCode == 'CNY') {
  776. item.currentAmount = item.currentAmountCNY
  777. } else {
  778. item.currentAmount = item.currentAmountUSD
  779. }
  780. obj.finInvoicesItemsList.push(item)
  781. }
  782. }
  783. if (obj.finInvoicesItemsList.length == 0) {
  784. this.$message.warning('请选择未生成发票的数据')
  785. return
  786. }
  787. // 开票项目
  788. generateFinInvoicesDetail(obj).then(res => {
  789. this.$message.warning('操作成功')
  790. this.fininvoicesDetailfun(this.form.id)
  791. })
  792. this.detailTabs = 'second'
  793. },
  794. // 撤销开票信息
  795. invoicingRevokefun() {
  796. if (this.handleSelectionData.length == 0) {
  797. this.$message.warning('请选择数据')
  798. return;
  799. }
  800. let obj = this.form
  801. obj.finInvoicesItemsList = []
  802. obj.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
  803. obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  804. //开票日期
  805. if (this.form.invoiceDate) {
  806. obj.invoiceDate = this.form.invoiceDate.slice(0, 10) + ' 00:00:00'
  807. }
  808. // 业务日期
  809. if (this.form.accountDateFrom) {
  810. obj.accountDateFrom = this.form.accountDateFrom.slice(0, 10) + ' 00:00:00'
  811. }
  812. if (this.form.accountDateTo) {
  813. obj.accountDateTo = this.form.accountDateTo.slice(0, 10) + ' 00:00:00'
  814. }
  815. for (let item of this.handleSelectionData) {
  816. // 拿未开票的数据
  817. if (item.status == 1) {
  818. if (item.currentCurCode == 'CNY') {
  819. item.currentAmount = item.currentAmountCNY
  820. } else {
  821. item.currentAmount = item.currentAmountUSD
  822. }
  823. obj.finInvoicesItemsList.push(item)
  824. }
  825. }
  826. if (obj.finInvoicesItemsList.length == 0) {
  827. this.$message.warning('请选择已生成发票的数据')
  828. return
  829. }
  830. // 撤销开票项目
  831. revokeFinInvoicesDetail(obj).then(res => {
  832. this.$message.warning('操作成功')
  833. this.fininvoicesDetailfun(this.form.id)
  834. })
  835. },
  836. // 费用明细一键删除
  837. batchDeletefun() {
  838. if (this.handleSelectionData.length == 0) {
  839. return this.$message.warning('请选择要删除的数据')
  840. }
  841. this.$confirm("确定将选择数据删除?", {
  842. confirmButtonText: "确定",
  843. cancelButtonText: "取消",
  844. type: "warning"
  845. }).then(() => {
  846. // 获取有id 的数据
  847. const itemsWithId = this.handleSelectionData.filter(item => item.hasOwnProperty('id'));
  848. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  849. // 把选中的删除掉
  850. this.handleSelectionData.forEach((item) => {
  851. for (let index in this.tableData) {
  852. if (item.accBillNo == this.tableData[index].accBillNo) {
  853. this.tableData.splice(Number(index), 1)
  854. }
  855. }
  856. })
  857. // 有id 的处理
  858. if (itemsWithId.length != 0) {
  859. fininvoicesitemsRemove(arrIds.join(',')).then(res => {
  860. this.$message.success('操作成功')
  861. })
  862. }
  863. })
  864. },
  865. // 费用明细开票匹配
  866. invoiceMatchingfun() {
  867. if (this.invoiceAmountCNY != 0 || this.invoiceAmountUSD != 0) {
  868. let dataCNY = JSON.parse(JSON.stringify(this.invoiceAmountCNY))
  869. let dataUSD = JSON.parse(JSON.stringify(this.invoiceAmountUSD))
  870. for (let item of this.tableData) {
  871. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, false)
  872. if (this.invoiceAmountCNY != 0) {
  873. if (dataCNY < 0) {
  874. dataCNY = 0
  875. }
  876. if (dataCNY > 1500) {
  877. if (item.currentCurCode == 'CNY') {
  878. this.$set(item, 'currentAmountCNY', 1500)
  879. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
  880. dataCNY -= 1500
  881. }
  882. } else {
  883. if (item.currentCurCode == 'CNY') {
  884. if (dataCNY != 0) {
  885. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
  886. }
  887. this.$set(item, 'currentAmountCNY', dataCNY)
  888. dataCNY -= 1500
  889. }
  890. }
  891. }
  892. if (this.invoiceAmountUSD != 0) {
  893. if (dataUSD < 0) {
  894. dataUSD = 0
  895. }
  896. if (dataUSD > 1500) {
  897. if (item.currentCurCode == 'USD') {
  898. this.$set(item, 'currentAmountUSD', 1500)
  899. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
  900. dataUSD -= 1500
  901. }
  902. } else {
  903. if (item.currentCurCode == 'USD') {
  904. this.$set(item, 'currentAmountUSD', dataUSD)
  905. if (dataUSD != 0) {
  906. this.$refs.fininvoicesitems.$refs.tableRef.toggleRowSelection(item, true)
  907. }
  908. dataUSD -= 1500
  909. }
  910. }
  911. }
  912. }
  913. }
  914. },
  915. // 费用明细单个删除
  916. detailsdeletionfun(id, index) {
  917. this.$confirm("确定将选择数据删除?", {
  918. confirmButtonText: "确定",
  919. cancelButtonText: "取消",
  920. type: "warning"
  921. }).then(() => {
  922. if (id) {
  923. fininvoicesitemsRemove(id).then(res => {
  924. this.$message.success('操作成功')
  925. })
  926. }
  927. console.log(index, 794)
  928. this.tableData.splice(index, 1)
  929. })
  930. },
  931. // 开票一键删除
  932. invoicingBatchDelete() {
  933. if (this.invoicingCheckboxData.length == 0) {
  934. return this.$message.warning('请选择要删除的数据')
  935. }
  936. this.$confirm("确定将选择数据删除?", {
  937. confirmButtonText: "确定",
  938. cancelButtonText: "取消",
  939. type: "warning"
  940. }).then(() => {
  941. // 获取有id 的数据
  942. const itemsWithId = this.invoicingCheckboxData.filter(item => item.hasOwnProperty('id'));
  943. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  944. // 把选中的删除掉
  945. this.invoicingCheckboxData.forEach((item) => {
  946. for (let index in this.InvoicingList) {
  947. if (item.id == this.InvoicingList[index].id) {
  948. this.InvoicingList.splice(Number(index), 1)
  949. }
  950. }
  951. })
  952. // 有id 的处理
  953. if (itemsWithId.length != 0) {
  954. fininvoiceitemdetailRemove(arrIds.join(',')).then(res => {
  955. this.$message.success('操作成功')
  956. })
  957. }
  958. })
  959. },
  960. // 开票明细单个删除
  961. invoiceDeletionfun(id, index) {
  962. this.$confirm("确定将选择数据删除?", {
  963. confirmButtonText: "确定",
  964. cancelButtonText: "取消",
  965. type: "warning"
  966. }).then(() => {
  967. if (id) {
  968. fininvoiceitemdetailRemove(id).then(res => {
  969. this.$message.success('操作成功')
  970. })
  971. }
  972. this.InvoicingList.splice(index, 1)
  973. })
  974. },
  975. // 下拉框的回调
  976. corpChange(value, name) {
  977. // 结算单位
  978. if (name == 'corpCnName') {
  979. if (!value) {
  980. this.$set(this.form, 'corpId', '')
  981. this.$set(this.form, 'corpCnName', '')
  982. this.$set(this.form, 'corpEnName', '')
  983. return
  984. }
  985. for (let item of this.corpData) {
  986. if (item.cnName == value) {
  987. this.$set(this.form, 'corpId', item.id)
  988. this.$set(this.form, 'corpCnName', item.cnName)
  989. this.$set(this.form, 'corpEnName', item.enName)
  990. bcorpsbankList(1, 10, { pid: this.form.corpId }).then(res => {
  991. if (res.data.data.records.length != 0) {
  992. this.$set(this.form, 'bankReceiptAccountNo', res.data.data.records[0].accountNo)
  993. this.$set(this.form, 'bankReceiptBankName', res.data.data.records[0].accountBank)
  994. }
  995. })
  996. // 带出开票单位数据
  997. corpsinvoiceheaderList(1, 20, { pid: this.form.corpId }).then(res => {
  998. if (res.data.data.records.length != 0) {
  999. this.$set(this.form, 'invCorpId', res.data.data.records[0].id)
  1000. this.$set(this.form, 'invCorpCnName', res.data.data.records[0].invoiceHeader)
  1001. this.$set(this.form, 'invCorpTaxNo', res.data.data.records[0].uscc) // 税号
  1002. this.$set(this.form, 'invCorpAccountBankUsd', res.data.data.records[0].accountBankUsd) // 美元银行
  1003. this.$set(this.form, 'invCorpAccountNoUsd', res.data.data.records[0].accountNoUsd) // 美元账户
  1004. this.$set(this.form, 'invCorpAccountBankCny', res.data.data.records[0].accountBankUsd) // 人民币银行
  1005. this.$set(this.form, 'invCorpAccountNoCny', res.data.data.records[0].accountNoUsd) // 人民币账户
  1006. }
  1007. })
  1008. }
  1009. }
  1010. }
  1011. // 开票单位
  1012. else if (name == 'invCorpCnName') {
  1013. this.$set(this.form, 'invCorpAccountBankUsd', '')
  1014. this.$set(this.form, 'invCorpAccountNoUsd', '')
  1015. this.$set(this.form, 'invCorpAccountBankCny', '')
  1016. this.$set(this.form, 'invCorpAccountNoCny', '')
  1017. if (!value) {
  1018. this.$set(this.form, 'invCorpId', '')
  1019. this.$set(this.form, 'invCorpCnName', '')
  1020. return
  1021. }
  1022. for (let item of this.invCorpData) {
  1023. if (item.id == value) {
  1024. this.$set(this.form, 'invCorpId', item.id)
  1025. this.$set(this.form, 'invCorpCnName', item.invoiceHeader)
  1026. this.$set(this.form, 'invCorpTaxNo', item.uscc) // 税号
  1027. this.$set(this.form, 'invCorpAccountBankUsd', item.accountBankUsd) // 美元银行
  1028. this.$set(this.form, 'invCorpAccountNoUsd', item.accountNoUsd) // 美元账户
  1029. this.$set(this.form, 'invCorpAccountBankCny', item.accountBankUsd) // 人民币银行
  1030. this.$set(this.form, 'invCorpAccountNoCny', item.accountNoUsd) // 人民币账户
  1031. }
  1032. }
  1033. }
  1034. // 结算单位银行账户
  1035. else if (name == 'bankReceiptAccountNo') {
  1036. for (let item of this.bankReceiptData) {
  1037. if (item.accountNo == value) {
  1038. this.$set(this.form, 'bankReceiptAccountNo', item.accountNo)
  1039. this.$set(this.form, 'bankReceiptBankName', item.accountBank)
  1040. }
  1041. }
  1042. }
  1043. else {
  1044. this.$set(this.form, name, value)
  1045. }
  1046. },
  1047. // 费用明细表格多选
  1048. handleSelectionChange(arr) {
  1049. this.handleSelectionData = arr
  1050. },
  1051. // 开票明细表格多选
  1052. invoicingCheckboxChange(arr) {
  1053. this.invoicingCheckboxData = arr
  1054. },
  1055. // 编辑事件
  1056. editHandle() {
  1057. this.editSave = false
  1058. },
  1059. submit(type) {
  1060. this.$confirm("确定进行发票申请操作?", {
  1061. confirmButtonText: "确定",
  1062. cancelButtonText: "取消",
  1063. type: "warning"
  1064. }).then(() => {
  1065. this.editCustomer(type)
  1066. }).finally(() => {
  1067. this.saveLoading = false
  1068. });
  1069. },
  1070. newbillFun() {
  1071. if (this.statusType) {
  1072. this.$emit('toAddEdit')
  1073. } else {
  1074. this.$confirm('是否需要保存?', '提示', {
  1075. confirmButtonText: '确定',
  1076. cancelButtonText: '取消',
  1077. type: 'warning'
  1078. }).then(() => {
  1079. this.editCustomer('toAddEdit')
  1080. }).catch(() => {
  1081. this.$emit('toAddEdit')
  1082. });
  1083. }
  1084. },
  1085. // 保存按钮事件
  1086. editCustomer(type) {
  1087. this.$refs.form.validate((valid) => {
  1088. if (!valid) return
  1089. if (!this.form.id) {
  1090. // 是否选择从表数据
  1091. if (this.handleSelectionData.length == 0) {
  1092. this.$message.warning('请选择结算数据');
  1093. return;
  1094. }
  1095. }
  1096. this.form.type = '申请'
  1097. this.form.billNoFormat = 'FPSQ'
  1098. this.form.businessTypeCode = 'FPSQ'
  1099. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
  1100. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1101. //开票日期
  1102. if (this.form.invoiceDate) {
  1103. this.form.invoiceDate = this.form.invoiceDate.slice(0, 10) + ' 00:00:00'
  1104. }
  1105. // 业务日期
  1106. if (this.form.accountDateFrom) {
  1107. this.form.accountDateFrom = this.form.accountDateFrom.slice(0, 10) + ' 00:00:00'
  1108. }
  1109. if (this.form.accountDateTo) {
  1110. this.form.accountDateTo = this.form.accountDateTo.slice(0, 10) + ' 00:00:00'
  1111. }
  1112. if (this.form.id) {
  1113. if (this.handleSelectionData.length) {
  1114. this.form.finInvoicesItemsList = this.handleSelectionData.map(item => {
  1115. if (item.currentCurCode == 'CNY') {
  1116. item.currentAmount = item.currentAmountCNY
  1117. } else {
  1118. item.currentAmount = item.currentAmountUSD
  1119. }
  1120. return item
  1121. })
  1122. }
  1123. this.form.finInvoicesItemsList = this.form.finInvoicesItemsList.map(item => {
  1124. if (item.currentCurCode == 'CNY') {
  1125. item.currentAmount = item.currentAmountCNY
  1126. } else {
  1127. item.currentAmount = item.currentAmountUSD
  1128. }
  1129. return item
  1130. })
  1131. } else {
  1132. this.form.finInvoicesItemsList = this.handleSelectionData.map(item => {
  1133. if (item.currentCurCode == 'CNY') {
  1134. item.currentAmount = item.currentAmountCNY
  1135. } else {
  1136. item.currentAmount = item.currentAmountUSD
  1137. }
  1138. return item
  1139. })
  1140. }
  1141. this.form.finInvoiceItemDetailList = this.InvoicingList
  1142. this.saveLoading = true
  1143. if (type == '提交') {
  1144. fininvoicesSubmit(this.form).then(res => {
  1145. res.data.data.businessTypes = res.data.data.businessTypes ? res.data.data.businessTypes.split(',') : []
  1146. res.data.data.feeCnName = res.data.data.feeCnName ? res.data.data.feeCnName.split(',') : []
  1147. this.form = res.data.data
  1148. this.finInvoicesApprovefun()
  1149. })
  1150. } else if (type == 'toAddEdit') {
  1151. fininvoicesSubmit(this.form).then(res => {
  1152. this.$message.success('操作成功');
  1153. this.$emit(type)
  1154. }).finally(() => {
  1155. this.pageLoading = false
  1156. this.saveLoading = false
  1157. })
  1158. } else {
  1159. this.fininvoicesSubmitfun(this.form)
  1160. }
  1161. })
  1162. },
  1163. retrievePopupsSelect(row) {
  1164. this.$set(this.form, 'corpId', row.id)
  1165. this.$set(this.form, 'corpCnName', row.cnName)
  1166. this.$set(this.form, 'corpEnName', row.enName)
  1167. bcorpsbankList(1, 10, { pid: row.id }).then(res => {
  1168. if (res.data.data.records.length != 0) {
  1169. this.$set(this.form, 'bankReceiptAccountNo', res.data.data.records[0].accountNo)
  1170. this.$set(this.form, 'bankReceiptBankName', res.data.data.records[0].accountBank)
  1171. }
  1172. })
  1173. // 带出开票单位数据
  1174. corpsinvoiceheaderList(1, 20, { pid: row.id }).then(res => {
  1175. if (res.data.data.records.length != 0) {
  1176. this.$set(this.form, 'invCorpId', res.data.data.records[0].id)
  1177. this.$set(this.form, 'invCorpCnName', res.data.data.records[0].invoiceHeader)
  1178. this.$set(this.form, 'invCorpTaxNo', res.data.data.records[0].uscc) // 税号
  1179. this.$set(this.form, 'invCorpAccountBankUsd', res.data.data.records[0].accountBankUsd) // 美元银行
  1180. this.$set(this.form, 'invCorpAccountNoUsd', res.data.data.records[0].accountNoUsd) // 美元账户
  1181. this.$set(this.form, 'invCorpAccountBankCny', res.data.data.records[0].accountBankUsd) // 人民币银行
  1182. this.$set(this.form, 'invCorpAccountNoCny', res.data.data.records[0].accountNoUsd) // 人民币账户
  1183. }
  1184. })
  1185. this.retrievePopupsType = false
  1186. this.finstlbillslistAccBillV1fun(this.appendType)
  1187. },
  1188. finstlbillslistAccBillByCorpfun() {
  1189. let obj = {}
  1190. if (this.form.accountDateFrom) {
  1191. obj.accountDateFrom = this.form.accountDateFrom.slice(0, 10) + ' 00:00:00'
  1192. }
  1193. if (this.form.accountDateTo) {
  1194. obj.accountDateTo = this.form.accountDateTo.slice(0, 10) + ' 00:00:00'
  1195. }
  1196. obj.type = '3'
  1197. obj.billNo = this.form.businessNo // 业务编号
  1198. obj.businessBillNo = this.form.billNo // 业务编号
  1199. obj.mblno = this.form.mblno // 主单编号
  1200. obj.hblno = this.form.hblno // 分单编号
  1201. obj.bookingNo = this.form.bookingNo // 订舱号(BOOK NO)
  1202. obj.curCode = this.form.curCode // 币种
  1203. obj.businessType = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  1204. obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1205. finstlbillslistAccBillByCorp(obj).then(res => {
  1206. this.retrievePopupsType = true
  1207. this.retrievePopupsData = res.data.data
  1208. })
  1209. },
  1210. // 检索
  1211. finstlbillslistAccBillV1fun(type) {
  1212. if (this.form.businessNo || this.form.mblno || this.form.checkNo) {
  1213. if (!this.form.corpId) {
  1214. this.finstlbillslistAccBillByCorpfun()
  1215. return
  1216. }
  1217. } else {
  1218. if (!this.form.corpId) {
  1219. this.$message.warning('请选择结算单位');
  1220. return
  1221. }
  1222. }
  1223. let obj = {}
  1224. // //开票日期
  1225. // if(this.form.invoiceDate) {
  1226. // obj.invoiceDate = this.form.invoiceDate.slice(0,10) + ' 00:00:00'
  1227. // }
  1228. // 业务日期
  1229. if (this.form.accountDateFrom) {
  1230. obj.accountDateFrom = this.form.accountDateFrom.slice(0, 10) + ' 00:00:00'
  1231. }
  1232. if (this.form.accountDateTo) {
  1233. obj.accountDateTo = this.form.accountDateTo.slice(0, 10) + ' 00:00:00'
  1234. }
  1235. obj.type = '3'
  1236. obj.billNo = this.form.businessNo // 业务编号
  1237. obj.businessBillNo = this.form.billNo // 业务编号
  1238. obj.mblno = this.form.mblno // 主单编号
  1239. obj.hblno = this.form.hblno // 分单编号
  1240. obj.bookingNo = this.form.bookingNo // 订舱号(BOOK NO)
  1241. obj.curCode = this.form.curCode // 币种
  1242. obj.businessType = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
  1243. obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1244. // 判断是否有对账单号
  1245. if (this.form.checkNo) {
  1246. obj.corpId = this.form.corpId // 结算单位
  1247. obj.checkNo = this.form.checkNo // CHK NO 对账单号
  1248. finstlbillsGetByDetail(obj).then(res => {
  1249. let arr = res.data.data.finStlBillsItemsList.map((item, index) => {
  1250. item.lineNo = Number(index) + 1 // 行号
  1251. item.currentCurCode = item.curCode
  1252. item.currentExrate = item.exrate
  1253. if (item.currentCurCode == 'CNY') {
  1254. // 本次发票金额
  1255. this.$set(item, 'currentAmountCNY', item.appliedInvoiceCurrentAmount)
  1256. } else {
  1257. // 本次发票金额
  1258. this.$set(item, 'currentAmountUSD', item.appliedInvoiceCurrentAmount)
  1259. }
  1260. delete item.id
  1261. return item
  1262. })
  1263. if (type == '追加') {
  1264. let a = [...this.tableData, ...arr,]
  1265. this.tableData = a.filter((obj, index) => {
  1266. return a.findIndex((elem) => {
  1267. return elem.accBillNo === obj.accBillNo
  1268. }) === index;
  1269. });
  1270. } else {
  1271. // 获取有id 的数据
  1272. const itemsWithId = this.tableData.filter(item => item.hasOwnProperty('id'));
  1273. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  1274. // 有id 的处理
  1275. if (itemsWithId.length != 0) {
  1276. fininvoicesitemsRemove(arrIds.join(',')).then(res => {
  1277. this.$message.success('操作成功')
  1278. })
  1279. }
  1280. if (arr.length == 0) {
  1281. this.$message.warning('当前检索暂无数据!')
  1282. }
  1283. this.tableData = arr
  1284. }
  1285. })
  1286. } else {
  1287. obj.corpCnName = this.form.corpId // 结算单位
  1288. obj.checkBillNo = this.form.checkNo // 对账单号
  1289. finstlbillslistAccBillV1(obj).then(res => {
  1290. let arr = res.data.data.map((item, index) => {
  1291. item.lineNo = Number(index) + 1 // 行号
  1292. item.accBillId = item.id
  1293. item.accBillNo = item.billNo // JOB NO
  1294. item.billNo = item.businessBillNo
  1295. item.billNo = item.businessBillNo // 账单编号
  1296. item.accDate = item.createTime
  1297. item.currentCurCode = item.curCode
  1298. item.currentExrate = item.exrate
  1299. item.dc = item.accountDc
  1300. if (item.currentCurCode == 'CNY') {
  1301. // 本次发票金额
  1302. this.$set(item, 'currentAmountCNY', item.appliedInvoiceCurrentAmount)
  1303. } else {
  1304. // 本次发票金额
  1305. this.$set(item, 'currentAmountUSD', item.appliedInvoiceCurrentAmount)
  1306. }
  1307. delete item.id
  1308. return item
  1309. })
  1310. if (type == '追加') {
  1311. let a = [...this.tableData, ...arr,]
  1312. this.tableData = a.filter((obj, index) => {
  1313. return a.findIndex((elem) => {
  1314. return elem.accBillNo === obj.accBillNo
  1315. }) === index;
  1316. });
  1317. } else {
  1318. // 获取有id 的数据
  1319. const itemsWithId = this.tableData.filter(item => item.hasOwnProperty('id'));
  1320. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  1321. // 有id 的处理
  1322. if (itemsWithId.length != 0) {
  1323. fininvoicesitemsRemove(arrIds.join(',')).then(res => {
  1324. this.$message.success('操作成功')
  1325. })
  1326. }
  1327. if (arr.length == 0) {
  1328. this.$message.warning('当前检索暂无数据!')
  1329. }
  1330. this.tableData = arr
  1331. }
  1332. })
  1333. }
  1334. },
  1335. // 保存接口
  1336. fininvoicesSubmitfun(obj) {
  1337. fininvoicesSubmit(obj).then(res => {
  1338. this.saveLoading = false
  1339. this.$message.success('操作成功');
  1340. this.fininvoicesDetailfun(res.data.data.id)
  1341. }).catch(() => {
  1342. this.saveLoading = false
  1343. });
  1344. },
  1345. // 详情接口
  1346. fininvoicesDetailfun(id) {
  1347. this.pageLoading = true
  1348. fininvoicesDetail(id).then(res => {
  1349. this.form = res.data.data
  1350. if (this.roleName.indexOf('admin') == -1 ? this.roleName.indexOf('允许修改他人业务') == -1 ? this.saberUserInfo.user_id != this.form.createUser : false : false) {
  1351. this.editPower = true
  1352. } else {
  1353. this.editPower = false
  1354. }
  1355. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.split(',') : [] // 业务类型转换成数组显示
  1356. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.split(',') : []
  1357. this.tableData = this.form.finInvoicesItemsList.map(item => {
  1358. if (item.currentCurCode == 'CNY') {
  1359. this.$set(item, 'currentAmountCNY', item.currentAmount)
  1360. } else {
  1361. this.$set(item, 'currentAmountUSD', item.currentAmount)
  1362. }
  1363. return item
  1364. })
  1365. this.InvoicingList = this.form.finInvoiceItemDetailList.map(item => {
  1366. item.edit = false
  1367. return item
  1368. })
  1369. }).finally(() => {
  1370. this.pageLoading = false
  1371. })
  1372. },
  1373. // 确认申请
  1374. finInvoicesApprovefun() {
  1375. this.pageLoading = true
  1376. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
  1377. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1378. finInvoicesApprove(this.form).then(res => {
  1379. this.$message.success('操作成功');
  1380. this.fininvoicesDetailfun(res.data.data.id)
  1381. this.editSave = true // 提交之后编辑按钮显示出来
  1382. }).finally(() => {
  1383. this.pageLoading = false
  1384. })
  1385. },
  1386. // 撤销申请
  1387. revokeFinInvoicesApprovefun() {
  1388. this.$confirm("确定进行撤销发票申请操作?", {
  1389. confirmButtonText: "确定",
  1390. cancelButtonText: "取消",
  1391. type: "warning"
  1392. }).then(res => {
  1393. this.pageLoading = true
  1394. this.form.businessTypes = this.form.businessTypes ? this.form.businessTypes.join(',') : ''
  1395. this.form.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
  1396. revokeFinInvoicesApprove(this.form).then(res => {
  1397. this.$message.success('操作成功');
  1398. this.fininvoicesDetailfun(res.data.data.id)
  1399. }).finally(() => {
  1400. this.pageLoading = false
  1401. })
  1402. })
  1403. },
  1404. //返回列表
  1405. backToList() {
  1406. this.$emit('goBack')
  1407. },
  1408. // 获取客户名称数据 往来单位数据
  1409. corpBcorpsListfun(cnName) {
  1410. getBcorpsList(1, 10, { cnName }).then(res => {
  1411. this.corpData = res.data.data.records
  1412. })
  1413. },
  1414. // 根据往来单位选择调用获取银行数据
  1415. bcorpsbankListfun(accountNo) {
  1416. bcorpsbankList(1, 10, {
  1417. // curNo:this.cntyCode,
  1418. pid: this.form.corpId,
  1419. accountNo: accountNo
  1420. }).then(res => {
  1421. this.bankReceiptData = res.data.data.records
  1422. })
  1423. },
  1424. // 根据往来单位选择调用获取发票抬头数据 开票单位数据
  1425. invcorpsinvoiceheaderListfun(cnName) {
  1426. corpsinvoiceheaderList(1, 20, { pid: this.form.corpId, cnName }).then(res => {
  1427. this.invCorpData = res.data.data.records
  1428. })
  1429. },
  1430. // 获取币别数据
  1431. getRateListfun(cnName) {
  1432. getRateList({ current: 1, size: 10, cnName }).then(res => {
  1433. this.curData = res.data.data.records
  1434. })
  1435. },
  1436. // 获取发票币别数据
  1437. invCurCodeRateListfun(cnName) {
  1438. getRateList({ current: 1, size: 20, cnName }).then(res => {
  1439. this.invCurCodeData = res.data.data.records
  1440. })
  1441. },
  1442. // 目的地
  1443. destinationBportsListfun(enName) {
  1444. bportsList(1, 10, { enName }).then(res => {
  1445. this.destinationData = res.data.data.records
  1446. })
  1447. },
  1448. // 卸货港
  1449. podBportsListfun(enName) {
  1450. bportsList(1, 10, { enName }).then(res => {
  1451. this.podData = res.data.data.records
  1452. })
  1453. },
  1454. // 装货港
  1455. polBportsListfun(enName) {
  1456. bportsList(1, 10, { enName }).then(res => {
  1457. this.polData = res.data.data.records
  1458. })
  1459. },
  1460. // 发票类型字典数据
  1461. invTypeWorkDictsfun() {
  1462. getWorkDicts('inv_type_los').then(res => {
  1463. this.invTypeData = res.data.data;
  1464. })
  1465. },
  1466. serverWorkDictsfun() {
  1467. getWorkDicts('Invoice_information_los').then(res => {
  1468. this.serverData = res.data.data;
  1469. })
  1470. },
  1471. // 预览报表
  1472. handleReportPreview(url, data) {
  1473. console.log(url, 1670)
  1474. console.log(data, 1671)
  1475. Stimulsoft.Base.StiLicense.key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE'
  1476. // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
  1477. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml', true, 'zh-CHS')
  1478. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml')
  1479. // 工具栏
  1480. var options = new Stimulsoft.Viewer.StiViewerOptions()
  1481. options.height = '100%'
  1482. options.appearance.scrollbarsMode = true // 滚动条模式
  1483. options.toolbar.showDesignButton = false // 显示设计按钮
  1484. options.toolbar.showAboutButton = false // 显示关于按钮
  1485. options.toolbar.showResourcesButton = false // 显示资源按钮
  1486. options.toolbar.showFullScreenButton = false // 显示全屏按钮
  1487. options.toolbar.showOpenButton = false // 显示打开按钮
  1488. options.appearance.showTooltips = false // 显示工具提示
  1489. options.appearance.showDialogsHelp = false // 显示对话框帮助
  1490. options.exports.showExportToDocument = false // 显示导出到文档
  1491. options.toolbar.showParametersButton = true // 显示参数按钮
  1492. options.appearance.bookmarksPrint = true // 书签打印
  1493. // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
  1494. // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
  1495. // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
  1496. // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
  1497. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct
  1498. // htmlRenderMode html渲染模式
  1499. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table
  1500. // 是创建一个 Stimulsoft 报表查看器的实例的代码
  1501. let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
  1502. // 报表
  1503. console.log("创建一个报表实例");
  1504. console.log()
  1505. let report = new window.Stimulsoft.Report.StiReport();
  1506. // 加载文件
  1507. console.log("从url加载报表");
  1508. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  1509. report.load(url)
  1510. data.pageOne = 'Page : 1 of 1'
  1511. // 处理超长数据
  1512. if (data.hshipperDetails) {
  1513. var consignerIndex2 = data.hshipperDetails.indexOf('\n')
  1514. for (let i = 0; i < 4; i++) {
  1515. consignerIndex2 = data.hshipperDetails.indexOf('\n', consignerIndex2 + 1);
  1516. }
  1517. if (consignerIndex2 != -1) {
  1518. var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length)
  1519. data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + ' *'
  1520. data.commodityDescr += '\n*' + hshipperDetails
  1521. }
  1522. }
  1523. if (data.hconsigneeDetails) {
  1524. var consigneeIndex2 = data.hconsigneeDetails.indexOf('\n')
  1525. for (let i = 0; i < 3; i++) {
  1526. consigneeIndex2 = data.hconsigneeDetails.indexOf('\n', consigneeIndex2 + 1);
  1527. }
  1528. if (consigneeIndex2 != -1) {
  1529. var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length)
  1530. data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + ' **'
  1531. data.commodityDescr += '\n**' + hconsigneeDetails
  1532. }
  1533. }
  1534. if (data.hnotifyDetails) {
  1535. var notifierIndex2 = data.hnotifyDetails.indexOf('\n')
  1536. for (let i = 0; i < 3; i++) {
  1537. notifierIndex2 = data.hnotifyDetails.indexOf('\n', notifierIndex2 + 1);
  1538. }
  1539. if (notifierIndex2 != -1) {
  1540. var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length)
  1541. data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + ' ***'
  1542. data.commodityDescr += '\n***' + hnotifyDetails
  1543. }
  1544. }
  1545. // 处理箱号
  1546. if (this.isPrintTheBoxNumber) {
  1547. data.commodityDescr += '\n.\n.\n'
  1548. }
  1549. // PLACE & DATE OF ISSUE
  1550. data.placeAndDateOfIssue = ''
  1551. if (data.issueAt) {
  1552. data.placeAndDateOfIssue += data.issueAt
  1553. }
  1554. if (data.issueDate) {
  1555. let date = new Date(data.issueDate.replace(/-/g, '/'));
  1556. let yyyy = date.getFullYear();
  1557. let mmmm = date.toDateString().split(" ")[1]
  1558. let dd = date.getDate()
  1559. data.placeAndDateOfIssue += ', ' + dd + '-' + mmmm + '-' + yyyy
  1560. }
  1561. // Total number of containers or packages received by the Carriers
  1562. if (data.preContainersList) {
  1563. let boxMap = new Map();
  1564. for (let boxQuantity of data.preContainersList) {
  1565. if (boxMap.get(boxQuantity.cntrTypeCode)) {
  1566. let v = boxMap.get(boxQuantity.cntrTypeCode)
  1567. boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity)
  1568. } else {
  1569. boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity)
  1570. }
  1571. }
  1572. let boxs = ''
  1573. boxMap.forEach(function (value, key, map) {
  1574. boxs += value + 'x' + key + ', '
  1575. })
  1576. boxs = boxs.substring(0, boxs.length - 2)
  1577. data.boxQuantity = boxs + ' CONTAINER(S) ONLY'
  1578. }
  1579. // Number of original B/Ls
  1580. if (data.numberOfObl) {
  1581. data.numberOfObl += ' (' + data.numberOfOblDigit + ')'
  1582. }
  1583. if (data.commodityDescr) {
  1584. var descriptionIndex2 = data.commodityDescr.indexOf('\n')
  1585. for (let i = 0; i < 19; i++) {
  1586. descriptionIndex2 = data.commodityDescr.indexOf('\n', descriptionIndex2 + 1);
  1587. }
  1588. if (descriptionIndex2 != -1) {
  1589. data.pageOne = 'Page : 1 of 2'
  1590. data.pageTwo = 'Page : 2 of 2'
  1591. var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length)
  1592. data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2)
  1593. data.extraLongTips = '** TO BE CONTINUED ON ATTACHED LIST **'
  1594. data.extraLongText = extraLongText
  1595. }
  1596. }
  1597. // console.log(data.hshipperDetails, 'hshipperDetails2')
  1598. // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
  1599. var dataSet = new Stimulsoft.System.Data.DataSet(
  1600. 'reportData'
  1601. )
  1602. dataSet.readJson(data) // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
  1603. // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
  1604. // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
  1605. report.regData('reportData', 'reportData', dataSet)
  1606. // 从模版和数据加载报表
  1607. // loadReport(report, '', {})
  1608. // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
  1609. viewer.report = report;
  1610. this.$refs.reportContainer.showContainer(
  1611. () => {
  1612. setTimeout(() => {
  1613. viewer.renderHtml('reportContainer')
  1614. this.createViewerButtons(viewer)
  1615. }, 50)
  1616. },
  1617. () => {
  1618. },
  1619. )
  1620. console.log("加载成功完成!");
  1621. },
  1622. createViewerButtons(viewer) {
  1623. viewer.jsObject.collections.images['myClose.png'] =
  1624. 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg=='
  1625. const closeBtn = viewer.jsObject.SmallButton(
  1626. 'closeBtn',
  1627. '关闭',
  1628. 'myClose.png'
  1629. )
  1630. // 增加打印弹窗配置
  1631. const printBtn = viewer.jsObject.SmallButton(
  1632. 'printBtn',
  1633. '打印报表',
  1634. 'myClose.png'
  1635. )
  1636. // console.log(viewer.jsObject.print(),'1013')
  1637. // 获取 关闭按钮的dom元素位置
  1638. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild
  1639. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild
  1640. const userButtonCell = buttonsTable.rows[0].insertCell(0)
  1641. // 获取打印按钮的位置
  1642. const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
  1643. const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
  1644. userButtonPrint.addEventListener("click", (event) => {
  1645. console.log("打印点击");
  1646. // event.preventDefault()
  1647. });
  1648. userButtonPrint.addEventListener("mouseover", (event) => {
  1649. console.log("移入打印按钮");
  1650. console.log(event, 1035)
  1651. });
  1652. userButtonCell.className = 'stiJsViewerClearAllStyles'
  1653. userButtonCell.appendChild(closeBtn) // 添加关闭节点
  1654. // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
  1655. let that = this
  1656. // 关闭按钮的监听点击
  1657. closeBtn.action = function () {
  1658. console.log(that.$refs.ReportContainer, '1022')
  1659. if (that.$refs.reportContainer)
  1660. that.$refs.reportContainer.hideContainer()
  1661. }
  1662. // // // 打印按钮监听
  1663. // printBtn.action = (e)=>{
  1664. // console.log('打印')
  1665. // window.print()
  1666. // }
  1667. },
  1668. },
  1669. }
  1670. </script>
  1671. <style scoped>
  1672. ::v-deep.el-form-item {
  1673. margin-bottom: 0;
  1674. }
  1675. .cardBox {
  1676. background: #fff;
  1677. width: 100%;
  1678. height: 100%;
  1679. padding: 20px;
  1680. box-sizing: border-box;
  1681. border-radius: 4px;
  1682. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
  1683. }
  1684. .flexBox {
  1685. display: flex;
  1686. }
  1687. .flexBoxLeft {
  1688. flex: 2;
  1689. margin-right: 10px;
  1690. //padding-bottom: 40px;
  1691. }
  1692. .flexBoxRight {
  1693. flex: 3;
  1694. //padding-bottom: 40px;
  1695. }
  1696. </style>