finstlbillsDetails.vue 91 KB

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