finstlbillsDetails.vue 88 KB

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