settlementDetails.vue 127 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135
  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" @click="backToList">返回列表 </el-button>
  6. <el-button v-if="form.id && pageIds.length" type="text" @click="lastPage">上一票</el-button>
  7. <el-button v-if="form.id && pageIds.length" type="text" @click="nextPage">下一票</el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button size="small" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id" @click="previewreportfun">预 览 </el-button>
  11. <el-button
  12. size="small"
  13. style="margin-right: 8px"
  14. v-if="roleName.indexOf('admin') != -1"
  15. :loading="saveLoading"
  16. :disabled="!form.id"
  17. @click="DesignreportDialog = true"
  18. >报表设计
  19. </el-button>
  20. <el-button type="success" size="small" :disabled="!form.id" plain @click="newbillFun">添加单据 </el-button>
  21. <el-button
  22. size="small"
  23. type="primary"
  24. style="margin-right: 8px"
  25. :disabled="!form.id || form.isCleared != 1"
  26. v-if="!form.voucherNo && whetheropen == 1"
  27. :loading="saveLoading"
  28. @click="generateVoucherfun"
  29. >生成凭证
  30. </el-button>
  31. <span v-if="form.voucherNo && voucher == 1" style="font-size: 12px;margin-right: 8px;">已生成凭证</span>
  32. <el-button
  33. size="small"
  34. type="warning"
  35. plain
  36. style="margin-right: 8px"
  37. :disabled="!form.id || editPower"
  38. v-if="form.isCleared == 1"
  39. :loading="saveLoading"
  40. @click="finstlbillsRevokeSettlementfun"
  41. >撤销结算
  42. </el-button>
  43. <el-button
  44. size="small"
  45. type="success"
  46. plain
  47. style="margin-right: 8px"
  48. :disabled="!form.id || editPower"
  49. v-else
  50. :loading="saveLoading"
  51. @click="submit('结算')"
  52. >确认结算
  53. </el-button>
  54. <el-button
  55. size="small"
  56. type="primary"
  57. style="margin-right: 8px"
  58. :disabled="form.isCleared == 1 || editPower"
  59. v-if="editSave"
  60. :loading="saveLoading"
  61. @click="editHandle"
  62. >编 辑
  63. </el-button>
  64. <el-button
  65. size="small"
  66. type="primary"
  67. style="margin-right: 8px"
  68. :disabled="form.isCleared == 1"
  69. v-else
  70. :loading="saveLoading"
  71. @click="editCustomer()"
  72. >保 存
  73. </el-button>
  74. </div>
  75. </div>
  76. <div style="margin: 55px 5px 0px 5px;'">
  77. <el-card class="box-card">
  78. <el-form :model="form" ref="form" label-width="90px" :rules="rules" class="demo-ruleForm">
  79. <el-row>
  80. <el-row>
  81. <el-col :span="5">
  82. <el-form-item label="往来单位" prop="corpCnName">
  83. <search-query
  84. :datalist="corpData"
  85. :selectValue="form.corpCnName"
  86. :clearable="true"
  87. :disabled="editSave || tableData.length != 0 || tableData.length > 0"
  88. :filterable="true"
  89. :remote="true"
  90. :buttonIf="false"
  91. placeholder="请选择往来单位"
  92. :forParameter="{
  93. key: 'id',
  94. label: 'cnName',
  95. value: 'cnName'
  96. }"
  97. @corpChange="corpChange($event, 'corpCnName')"
  98. @remoteMethod="corpBcorpsListfun"
  99. @corpFocus="corpBcorpsListfun"
  100. >
  101. </search-query>
  102. </el-form-item>
  103. </el-col>
  104. <el-col :span="5">
  105. <el-form-item label="开户帐号" prop="bankId">
  106. <search-query
  107. :datalist="bankData"
  108. :selectValue="form.bankId"
  109. :clearable="true"
  110. :disabled="editSave || !form.corpId"
  111. :filterable="true"
  112. :buttonIf="false"
  113. :allowCreate="true"
  114. placeholder="请选择开户帐号"
  115. :forParameter="{
  116. key: 'id',
  117. label: 'accountBankNo',
  118. value: 'id'
  119. }"
  120. @corpChange="corpChange($event, 'bankId')"
  121. @corpFocus="bcorpsbankListfun"
  122. >
  123. </search-query>
  124. </el-form-item>
  125. </el-col>
  126. <el-col :span="5">
  127. <el-form-item label="事由" prop="remarks">
  128. <el-input
  129. style="width: 100%;"
  130. v-model="form.remarks"
  131. size="small"
  132. autocomplete="off"
  133. :disabled="editSave"
  134. clearable
  135. placeholder="请输入事由"
  136. >
  137. </el-input>
  138. </el-form-item>
  139. </el-col>
  140. <el-col :span="5">
  141. <el-form-item label="费用名称" prop="feeCnName">
  142. <dic-select
  143. v-model="form.feeCnName"
  144. placeholder="费用名称"
  145. key="id"
  146. label="cnName"
  147. url="/blade-los/bfees/listAll"
  148. :filterable="true"
  149. :multiple="true"
  150. :collapseTags="true"
  151. :disabled="editSave"
  152. dataType="string"
  153. ></dic-select>
  154. </el-form-item>
  155. </el-col>
  156. <el-col :span="4">
  157. <el-form-item label="结算日期" prop="billDate">
  158. <el-date-picker
  159. v-model="form.billDate"
  160. clearable
  161. style="width: 100%;"
  162. type="date"
  163. size="small"
  164. :disabled="editSave"
  165. format="yyyy-MM-dd"
  166. value-format="yyyy-MM-dd"
  167. placeholder="选择结算日期"
  168. >
  169. </el-date-picker>
  170. </el-form-item>
  171. </el-col>
  172. <el-col :span="4">
  173. <el-form-item label="业务开始" prop="businessDateStart">
  174. <el-date-picker
  175. v-model="form.businessDateStart"
  176. clearable
  177. style="width: 100%;"
  178. type="date"
  179. size="small"
  180. :disabled="editSave || tableData.length > 0"
  181. format="yyyy-MM-dd"
  182. value-format="yyyy-MM-dd"
  183. placeholder="选择业务开始日期"
  184. >
  185. </el-date-picker>
  186. </el-form-item>
  187. </el-col>
  188. <el-col :span="4">
  189. <el-form-item label="业务结束" prop="businessDateEnd">
  190. <el-date-picker
  191. v-model="form.businessDateEnd"
  192. clearable
  193. style="width: 100%;"
  194. type="date"
  195. size="small"
  196. :disabled="editSave || tableData.length > 0"
  197. format="yyyy-MM-dd"
  198. value-format="yyyy-MM-dd"
  199. placeholder="选择业务结束日期"
  200. >
  201. </el-date-picker>
  202. </el-form-item>
  203. </el-col>
  204. <el-col :span="3">
  205. <el-form-item label="收/付" prop="queryAmount">
  206. <search-query
  207. :datalist="dcData"
  208. :selectValue="form.dc"
  209. :filterable="true"
  210. :clearable="true"
  211. :remote="true"
  212. :buttonIf="false"
  213. :disabled="editSave || tableData.length > 0"
  214. placeholder="请选择收/付"
  215. @corpChange="corpChange($event, 'dc')"
  216. >
  217. </search-query>
  218. </el-form-item>
  219. </el-col>
  220. <el-col :span="3">
  221. <el-form-item label="币别" prop="curCode">
  222. <search-query
  223. :datalist="curCodeData"
  224. :selectValue="form.curCode"
  225. :clearable="true"
  226. :disabled="editSave || tableData.length > 0"
  227. :buttonIf="false"
  228. :filterable="true"
  229. :remote="true"
  230. placeholder="请选择币别"
  231. :forParameter="{
  232. key: 'id',
  233. label: 'code',
  234. value: 'code'
  235. }"
  236. @corpChange="corpChange($event, 'curCode')"
  237. @remoteMethod="getRateListfun"
  238. @corpFocus="getRateListfun"
  239. >
  240. </search-query>
  241. </el-form-item>
  242. </el-col>
  243. <el-col :span="5">
  244. <el-form-item label="业务编号" prop="businessNo">
  245. <el-input
  246. style="width: 100%;"
  247. v-model="form.businessNo"
  248. size="small"
  249. autocomplete="off"
  250. :disabled="editSave || tableData.length > 0"
  251. clearable
  252. placeholder="请输入业务编号"
  253. >
  254. </el-input>
  255. </el-form-item>
  256. </el-col>
  257. <el-col :span="5">
  258. <el-form-item label="来源单号" prop="requestNo">
  259. <el-input
  260. style="width: 100%;"
  261. v-model="form.requestNo"
  262. size="small"
  263. autocomplete="off"
  264. :disabled="true"
  265. clearable
  266. placeholder="请输入来源单号"
  267. >
  268. </el-input>
  269. </el-form-item>
  270. </el-col>
  271. <el-col :span="5">
  272. <el-form-item label="ACCT NO" prop="accountNo">
  273. <el-input
  274. style="width: 100%;"
  275. v-model="form.accountNo"
  276. size="small"
  277. autocomplete="off"
  278. :disabled="editSave || tableData.length > 0"
  279. clearable
  280. placeholder="请输入ACCT NO"
  281. >
  282. </el-input>
  283. </el-form-item>
  284. </el-col>
  285. <el-col :span="5">
  286. <el-form-item label="MBL NO" prop="mblno">
  287. <el-input
  288. style="width: 100%;"
  289. v-model="form.mblno"
  290. size="small"
  291. autocomplete="off"
  292. :disabled="editSave || tableData.length > 0"
  293. clearable
  294. placeholder="请输入MBL NO"
  295. >
  296. </el-input>
  297. </el-form-item>
  298. </el-col>
  299. <el-col :span="5">
  300. <el-form-item label="HBL NO" prop="hblno">
  301. <el-input
  302. style="width: 100%;"
  303. v-model="form.hblno"
  304. size="small"
  305. autocomplete="off"
  306. :disabled="editSave || tableData.length > 0"
  307. clearable
  308. placeholder="请输入HBL NO"
  309. >
  310. </el-input>
  311. </el-form-item>
  312. </el-col>
  313. <el-col :span="4">
  314. <el-form-item label="对账单号" prop="checkNo">
  315. <el-input
  316. style="width: 100%;"
  317. v-model="form.checkNo"
  318. size="small"
  319. autocomplete="off"
  320. :disabled="editSave || tableData.length > 0"
  321. clearable
  322. placeholder="请输入对账单号"
  323. >
  324. </el-input>
  325. </el-form-item>
  326. </el-col>
  327. <el-col :span="5">
  328. <el-form-item label="业务类型" prop="businessTypes">
  329. <dic-select
  330. v-model="form.businessTypes"
  331. placeholder="业务类型"
  332. key="id"
  333. label="label"
  334. keyValue="value"
  335. :activateCreated="false"
  336. :mockData="businessTypesData"
  337. :filterable="true"
  338. :multiple="true"
  339. :collapseTags="true"
  340. :disabled="editSave"
  341. dataType="string"
  342. ></dic-select>
  343. </el-form-item>
  344. </el-col>
  345. </el-row>
  346. <expand :showBtn="true" :showSpan="true">
  347. <el-row>
  348. <el-col :span="5">
  349. <el-form-item label="船 名" prop="vesselCnName">
  350. <el-input
  351. style="width: 100%;"
  352. v-model="form.vesselCnName"
  353. size="small"
  354. autocomplete="off"
  355. :disabled="editSave || tableData.length > 0"
  356. clearable
  357. placeholder="请选择船名"
  358. ></el-input>
  359. </el-form-item>
  360. </el-col>
  361. <el-col :span="5">
  362. <el-form-item label="航 次" prop="voyageNo">
  363. <el-input
  364. style="width: 100%;"
  365. v-model="form.voyageNo"
  366. size="small"
  367. autocomplete="off"
  368. :disabled="editSave || tableData.length > 0"
  369. clearable
  370. placeholder="请输入航次"
  371. ></el-input>
  372. </el-form-item>
  373. </el-col>
  374. </el-row>
  375. </expand>
  376. <el-row>
  377. <el-col span="24">
  378. <div style="text-align: right">
  379. <!--<el-button size="small" type="" style="margin-right: 8px" :disabled="settlementdistar || editSave"-->
  380. <!-- :loading="saveLoading" @click="ResetFilter">重置条件-->
  381. <!--</el-button>-->
  382. <!-- <el-checkbox v-model="appendType" :disabled="settlementdistar || editSave" false-label="检索" true-label="追加">追加</el-checkbox> -->
  383. <el-button size="small" type="primary" :disabled="settlementdistar || editSave" :loading="saveLoading" @click="retrievalfun"
  384. >检 索
  385. </el-button>
  386. <el-button size="small" :disabled="tableData.length > 0" @click="ResetFilter">重置条件 </el-button>
  387. </div>
  388. </el-col>
  389. </el-row>
  390. </el-row>
  391. </el-form>
  392. </el-card>
  393. <el-card style="margin-top: 10px">
  394. <el-tabs v-model="activeName" @tab-click="handleClick">
  395. <el-tab-pane label="查询结果" name="1">
  396. <query-finstlbillsitems
  397. ref="finstlbillsitems"
  398. :queryData="queryData"
  399. :editSave="editSave"
  400. :settlementdistar="settlementdistar"
  401. :handleSelectionData="handleSelectionData"
  402. @handleSelectionChange="addSelectionChange"
  403. @deletefun="finstlbillsitemsRemovefun"
  404. >
  405. <template slot="menuLeft">
  406. <div>
  407. <el-button size="small" type="success" :disabled="editSave || generateStatus" :loading="saveLoading" @click="SelectedRows"
  408. >确认选定行
  409. </el-button>
  410. <el-input
  411. style="width: 10%;margin-left: 10px;"
  412. v-model="invoiceAmountCNY"
  413. size="small"
  414. autocomplete="off"
  415. type="numbers"
  416. clearable
  417. placeholder="开票金额"
  418. >
  419. <span style="line-height: 32px;" slot="suffix">CNY</span>
  420. </el-input>
  421. <el-input
  422. style="width: 10%;margin-left: 5px;"
  423. v-model="invoiceAmountUSD"
  424. size="small"
  425. autocomplete="off"
  426. type="numbers"
  427. clearable
  428. placeholder="开票金额"
  429. >
  430. <span style="line-height: 32px;" slot="suffix">USD</span>
  431. </el-input>
  432. <el-button style="margin-left: 10px" :disabled="editSave" size="small" type="primary" @click="invoiceMatchingfun()"
  433. >匹配金额</el-button
  434. >
  435. <span style="font-size: 18px;font-weight: 600;margin-left: 50px;">
  436. <span style="color: #67C23A;margin-right: 10px;"> CNY:¥{{ Number(amountSubSum).toFixed(2) }}元 </span>
  437. <span style="color: #E6A23C;"> USD:${{ Number(amountSubUsdSum).toFixed(2) }}元 </span>
  438. </span>
  439. </div>
  440. </template>
  441. </query-finstlbillsitems>
  442. </el-tab-pane>
  443. <el-tab-pane label="选定数据" name="2">
  444. <finstlbillsitems
  445. ref="finstlbillsitems"
  446. :tableData="tableData"
  447. :editSave="editSave || form.requestNo"
  448. :settlementdistar="settlementdistar"
  449. :handleSelectionData="handleSelectionData"
  450. @handleSelectionChange="handleSelectionChange"
  451. @deletefun="finstlbillsitemsRemovefun"
  452. >
  453. <template slot="menuLeft">
  454. <div>
  455. <el-button size="small" type="danger" style="margin-left: 10px" :disabled="editSave" :loading="saveLoading" @click="batchDeletefun"
  456. >一键删除
  457. </el-button>
  458. <span style="font-size: 18px;font-weight: 600;margin-left: 50px;">
  459. <span style="color: #67C23A;margin-right: 10px;"> CNY:¥{{ Number(amountSubSum).toFixed(2) }}元 </span>
  460. <span style="color: #E6A23C;"> USD:${{ Number(amountSubUsdSum).toFixed(2) }}元 </span>
  461. </span>
  462. </div>
  463. </template>
  464. </finstlbillsitems>
  465. </el-tab-pane>
  466. <el-tab-pane label="凭证数据" name="3">
  467. <div style="margin-bottom: 10px">
  468. <el-button
  469. size="small"
  470. type="primary"
  471. style="margin-right: 8px"
  472. :loading="saveLoading"
  473. @click="addEntryfun"
  474. :disabled="editSave || generateStatus"
  475. >添加分录
  476. </el-button>
  477. <el-button
  478. size="small"
  479. type="primary"
  480. style="margin-right: 8px"
  481. :loading="saveLoading"
  482. @click="oneClickSave"
  483. :disabled="editSave || generateStatus"
  484. >一键保存
  485. </el-button>
  486. <el-button
  487. size="small"
  488. type="danger"
  489. style="margin-right: 8px"
  490. :loading="saveLoading"
  491. @click="deleteEntryfun"
  492. :disabled="editSave || generateStatus"
  493. >删除分录
  494. </el-button>
  495. </div>
  496. <fromtable-details
  497. :assemblyForm="form"
  498. :tableData="form.finStlBillsVoucherItemsList"
  499. :handleSelectionData="handleSelectionData2"
  500. :disabled="editSave || generateStatus"
  501. @handleSelectionChange="handleSelectionChange2"
  502. @addRowsfun="addRowsfun"
  503. @deletefun="deletefun"
  504. @auxiliaryAccountingfun="auxiliaryAccountingfun"
  505. @showOffRecordsfun="showOffRecordsfun"
  506. >
  507. </fromtable-details>
  508. </el-tab-pane>
  509. </el-tabs>
  510. </el-card>
  511. </div>
  512. <el-card style="margin-top: 10px">
  513. <el-row>
  514. <el-col :span="3">
  515. <div class="bottomFlex" style="color: #6BBCD1">
  516. <span>应付:</span>
  517. <span class="weightnum">¥{{ form.amountCr || 0 }}</span>
  518. </div>
  519. </el-col>
  520. <el-col :span="3">
  521. <div class="bottomFlex" style="color: #6BBCD1">
  522. <span>应付:</span>
  523. <span class="weightnum">${{ form.amountCrUsd || 0 }}</span>
  524. </div>
  525. </el-col>
  526. <el-col :span="6">
  527. <div class="bottomFlex" style="color: #6BBCD1">
  528. <span>应付合计:</span>
  529. <span class="weightnum">¥{{ form.amountCrLoc || 0 }}</span>
  530. </div>
  531. </el-col>
  532. <el-col :span="3">
  533. <div class="bottomFlex" style="color: #81B337">
  534. <span>应收:</span>
  535. <span class="weightnum">¥{{ form.amountDr || 0 }}</span>
  536. </div>
  537. </el-col>
  538. <el-col :span="3">
  539. <div class="bottomFlex" style="color: #81B337">
  540. <span>应收:</span>
  541. <span class="weightnum">${{ form.amountDrUsd || 0 }}</span>
  542. </div>
  543. </el-col>
  544. <el-col :span="6">
  545. <div class="bottomFlex" style="color: #81B337">
  546. <span>应收合计:</span>
  547. <span class="weightnum">¥{{ form.amountDrLoc || 0 }}</span>
  548. </div>
  549. </el-col>
  550. </el-row>
  551. </el-card>
  552. <!--选择数据弹窗-->
  553. <el-dialog title="选择数据" class="el-dialogDeep" :visible.sync="retrievePopupsType" append-to-body width="70%" :close-on-click-modal="false">
  554. <div>
  555. <avue-crud :option="retrievePopupsOption" :data="retrievePopupsData" ref="retrievePopupsRef" id="out-table">
  556. <template slot="menu" slot-scope="{ row }">
  557. <el-button type="text" size="small" @click.stop="retrievePopupsSelect(row)">选择 </el-button>
  558. </template>
  559. </avue-crud>
  560. </div>
  561. </el-dialog>
  562. <!--设计报表弹窗-->
  563. <el-dialog
  564. append-to-body
  565. title="设计报表"
  566. class="el-dialogDeep"
  567. :visible.sync="DesignreportDialog"
  568. width="70%"
  569. :close-on-click-modal="false"
  570. :destroy-on-close="true"
  571. :close-on-press-escape="false"
  572. v-dialog-drag
  573. >
  574. <reports :id="form.id" :assemblyForm="form" businessValue="JSZX"></reports>
  575. </el-dialog>
  576. <!--预览-->
  577. <el-dialog
  578. title="打印"
  579. :visible.sync="selectPrintingDialog"
  580. append-to-body
  581. width="70%"
  582. :close-on-click-modal="false"
  583. :destroy-on-close="true"
  584. :close-on-press-escape="false"
  585. v-dialog-drag
  586. >
  587. <div>
  588. <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
  589. </div>
  590. <span slot="footer" class="dialog-footer">
  591. <el-button size="small" @click="selectPrintingDialog = false">取 消</el-button>
  592. </span>
  593. </el-dialog>
  594. <!--报表组件-->
  595. <reportContainer ref="reportContainer"></reportContainer>
  596. <!--辅助核算-->
  597. <el-dialog title="核算项目维护" append-to-body :visible.sync="auxiliaryVisible" class="el-dialogDeep" width="40%" :before-close="handleClose">
  598. <div>科目名称: {{ subjectRow.accountFullName }}</div>
  599. <div style="margin-top: 10px">
  600. <el-form :model="subjectRow" ref="subjectRow" label-width="70px" class="demo-ruleForm">
  601. <!--#region-->
  602. <!--<div>外币核算:</div>-->
  603. <!--<el-row>-->
  604. <!-- <el-col :span="4">-->
  605. <!-- <el-form-item label="币种:" prop="curCode">-->
  606. <!-- <el-input style="width: 100%;" v-model="subjectRow.curCode"-->
  607. <!-- size="small" autocomplete="off"-->
  608. <!-- clearable placeholder="请输入币种" >-->
  609. <!-- </el-input>-->
  610. <!-- </el-form-item>-->
  611. <!-- </el-col>-->
  612. <!-- <el-col :span="4">-->
  613. <!-- <el-form-item label="汇率:" prop="exrate">-->
  614. <!-- <el-input style="width: 100%;" v-model="subjectRow.exrate"-->
  615. <!-- size="small" autocomplete="off"-->
  616. <!-- clearable placeholder="请输入汇率" >-->
  617. <!-- </el-input>-->
  618. <!-- </el-form-item>-->
  619. <!-- </el-col>-->
  620. <!-- <el-col :span="4">-->
  621. <!-- <el-form-item label="借方金额:" prop="amountDrUsd">-->
  622. <!-- <el-input style="width: 100%;" v-model="subjectRow.amountDrUsd"-->
  623. <!-- size="small" autocomplete="off"-->
  624. <!-- clearable placeholder="请输入借方金额" >-->
  625. <!-- </el-input>-->
  626. <!-- </el-form-item>-->
  627. <!-- </el-col>-->
  628. <!-- <el-col :span="4">-->
  629. <!-- <el-form-item label="贷方金额:" prop="amountCrUsd">-->
  630. <!-- <el-input style="width: 100%;" v-model="subjectRow.amountCrUsd"-->
  631. <!-- size="small" autocomplete="off"-->
  632. <!-- clearable placeholder="请输入贷方金额" >-->
  633. <!-- </el-input>-->
  634. <!-- </el-form-item>-->
  635. <!-- </el-col>-->
  636. <!-- <el-col :span="4">-->
  637. <!-- <el-form-item label="本币借方:" prop="amountDr">-->
  638. <!-- <el-input style="width: 100%;" v-model="subjectRow.amountDr"-->
  639. <!-- size="small" autocomplete="off"-->
  640. <!-- clearable placeholder="请输入本币借方" >-->
  641. <!-- </el-input>-->
  642. <!-- </el-form-item>-->
  643. <!-- </el-col>-->
  644. <!-- <el-col :span="4">-->
  645. <!-- <el-form-item label="本币贷方:" prop="amountCr">-->
  646. <!-- <el-input style="width: 100%;" v-model="subjectRow.amountCr"-->
  647. <!-- size="small" autocomplete="off"-->
  648. <!-- clearable placeholder="请输入本币贷方" >-->
  649. <!-- </el-input>-->
  650. <!-- </el-form-item>-->
  651. <!-- </el-col>-->
  652. <!--</el-row>-->
  653. <!--#endregion-->
  654. <!--#region-->
  655. <!--<div>数量核算:</div>-->
  656. <!--<el-row>-->
  657. <!-- <el-col :span="4">-->
  658. <!-- <el-form-item label="单位:" prop="unitNo">-->
  659. <!-- <el-input style="width: 100%;" v-model="subjectRow.unitNo"-->
  660. <!-- size="small" autocomplete="off"-->
  661. <!-- clearable placeholder="请输入单位" >-->
  662. <!-- </el-input>-->
  663. <!-- </el-form-item>-->
  664. <!-- </el-col>-->
  665. <!-- <el-col :span="4">-->
  666. <!-- <el-form-item label="规格:" prop="voucherNo">-->
  667. <!-- <el-input style="width: 100%;" v-model="subjectRow.voucherNo"-->
  668. <!-- size="small" autocomplete="off"-->
  669. <!-- clearable placeholder="请输入规格" >-->
  670. <!-- </el-input>-->
  671. <!-- </el-form-item>-->
  672. <!-- </el-col>-->
  673. <!-- <el-col :span="4">-->
  674. <!-- <el-form-item label="借方数量:" prop="quantityDr">-->
  675. <!-- <el-input style="width: 100%;" v-model="subjectRow.quantityDr"-->
  676. <!-- size="small" autocomplete="off"-->
  677. <!-- clearable placeholder="请输入借方数量" >-->
  678. <!-- </el-input>-->
  679. <!-- </el-form-item>-->
  680. <!-- </el-col>-->
  681. <!-- <el-col :span="4">-->
  682. <!-- <el-form-item label="借方单价:" prop="voucherNo">-->
  683. <!-- <el-input style="width: 100%;" v-model="subjectRow.voucherNo"-->
  684. <!-- size="small" autocomplete="off"-->
  685. <!-- clearable placeholder="请输入借方单价" >-->
  686. <!-- </el-input>-->
  687. <!-- </el-form-item>-->
  688. <!-- </el-col>-->
  689. <!-- <el-col :span="4">-->
  690. <!-- <el-form-item label="贷方数量:" prop="quantityCr">-->
  691. <!-- <el-input style="width: 100%;" v-model="subjectRow.quantityCr"-->
  692. <!-- size="small" autocomplete="off"-->
  693. <!-- clearable placeholder="请输入贷方数量" >-->
  694. <!-- </el-input>-->
  695. <!-- </el-form-item>-->
  696. <!-- </el-col>-->
  697. <!-- <el-col :span="4">-->
  698. <!-- <el-form-item label="贷方单价:" prop="voucherNo">-->
  699. <!-- <el-input style="width: 100%;" v-model="subjectRow.voucherNo"-->
  700. <!-- size="small" autocomplete="off"-->
  701. <!-- clearable placeholder="请输入贷方单价" >-->
  702. <!-- </el-input>-->
  703. <!-- </el-form-item>-->
  704. <!-- </el-col>-->
  705. <!--</el-row>-->
  706. <!--#endregion-->
  707. <el-row :gutter="40">
  708. <el-col :span="12" v-if="subjectAccount.isCorp">
  709. <!--<div>客户核算:</div>-->
  710. <el-form-item label="客户名称:" prop="corpCnName">
  711. <search-query
  712. style="width: 100%"
  713. ref="searchQueryRef"
  714. :datalist="corpCnNameData"
  715. :selectValue="subjectRow.corpCnName"
  716. :filterable="true"
  717. :clearable="true"
  718. :remote="true"
  719. :buttonIf="true"
  720. placeholder="请选择客户名称"
  721. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  722. @corpFocus="getBcorpsListfun"
  723. @remoteMethod="getBcorpsListfun"
  724. @corpChange="corpChange2($event, 'corpCnName')"
  725. @eldialogConfirm="eldialogConfirm('bcorps')"
  726. @bottonSearchfun="bottonSearchfun('bcorps')"
  727. >
  728. <bcorps ref="bcorps" :eldialog="true" @selectionChange="eldialogMultipleChoice($event, 'bcorps')"></bcorps>
  729. </search-query>
  730. </el-form-item>
  731. </el-col>
  732. <el-col :span="12" v-if="subjectAccount.isDept">
  733. <!--<div>部门核算:</div>-->
  734. <el-form-item label="部门名称:" prop="deptName">
  735. <tree-select
  736. v-model="subjectRow.deptName"
  737. filterable
  738. :data="deptData"
  739. :props="{ label: 'title', children: 'children' }"
  740. nodeKey="title"
  741. size="small"
  742. :multiple="false"
  743. placeholder="请选择部门名称"
  744. @focus="getDeptTreefun"
  745. @input="corpChange2($event, 'deptName')"
  746. >
  747. </tree-select>
  748. </el-form-item>
  749. </el-col>
  750. <el-col :span="12" v-if="subjectAccount.isEmpl">
  751. <!--<div>职员核算:</div>-->
  752. <el-form-item label="职员名称:" prop="emplName">
  753. <search-query
  754. :datalist="emplData"
  755. :selectValue="subjectRow.emplName"
  756. :clearable="true"
  757. :buttonIf="false"
  758. :filterable="true"
  759. :remote="true"
  760. placeholder="请选择职员名称"
  761. :forParameter="{ key: 'id', label: 'name', value: 'name' }"
  762. @corpFocus="userGetListfun"
  763. @corpChange="corpChange2($event, 'emplName')"
  764. @remoteMethod="userGetListfun"
  765. >
  766. </search-query>
  767. </el-form-item>
  768. </el-col>
  769. <!--<el-col :span="12" v-if="subjectAccount.isItem">-->
  770. <!-- <div>项目核算:</div>-->
  771. <!-- <el-form-item label="项目名称:" prop="itemName">-->
  772. <!-- <el-input style="width: 100%;" v-model="subjectRow.itemName"-->
  773. <!-- size="small" autocomplete="off"-->
  774. <!-- clearable placeholder="请输入项目名称" >-->
  775. <!-- </el-input>-->
  776. <!-- <search-query :datalist="itemData"-->
  777. <!-- :selectValue="subjectRow.itemName"-->
  778. <!-- :clearable="true"-->
  779. <!-- :buttonIf="false"-->
  780. <!-- :filterable="true"-->
  781. <!-- :remote="true"-->
  782. <!-- placeholder="请选择项目名称"-->
  783. <!-- :forParameter="{ key:'id', label:'cnName', value:'cnName'}"-->
  784. <!-- @corpFocus="baccitemstypeListfun"-->
  785. <!-- @corpChange="corpChange($event,'itemName')"-->
  786. <!-- @remoteMethod="baccitemstypeListfun" >-->
  787. <!-- </search-query>-->
  788. <!-- </el-form-item>-->
  789. <!--</el-col>-->
  790. </el-row>
  791. </el-form>
  792. </div>
  793. <span slot="footer" class="dialog-footer">
  794. <el-button @click="auxiliaryVisible = false">取 消</el-button>
  795. <el-button type="primary" @click="auxiliaryDeterminefun">确 定</el-button>
  796. </span>
  797. </el-dialog>
  798. <!--预收预付核销-->
  799. <el-dialog
  800. title="预收预付核销管理"
  801. append-to-body
  802. :visible.sync="offRecordsVisible"
  803. class="el-dialogDeep"
  804. width="80%"
  805. :before-close="handleClose"
  806. >
  807. <div>
  808. 科目名称:
  809. {{
  810. subjectRow.accountCode +
  811. " " +
  812. subjectRow.accountFullName +
  813. (subjectRow.isEmpl === 1 && subjectRow.emplName ? "/" + subjectRow.emplName : "") +
  814. (subjectRow.isDept === 1 && subjectRow.deptName ? "/" + subjectRow.deptName : "") +
  815. (subjectRow.isCorp === 1 && subjectRow.corpShortName ? "/" + subjectRow.corpShortName : "") +
  816. (subjectRow.isItem === 1 ? "/" + subjectRow.itemClassify + "-" + (subjectRow.itemName ? subjectRow.itemName : "") : "")
  817. }}
  818. 方向:{{ subjectRow.dc === "D" ? "借" : "贷" }}
  819. </div>
  820. <div>
  821. 借方金额: CNY {{ fixedAmt(subjectRow.amountDr, 16) }} {{ subjectRow.isForeign === 1 ? "USD " + fixedAmt(subjectRow.amountDrUsd, 16) : "" }}
  822. </div>
  823. <div>
  824. 贷方金额: CNY {{ fixedAmt(subjectRow.amountCr, 16) }} {{ subjectRow.isForeign === 1 ? "USD " + fixedAmt(subjectRow.amountCrUsd, 16) : "" }}
  825. </div>
  826. <div style="margin-top: 10px; margin-bottom: 10px">
  827. <el-form :model="subjectRowOff" ref="subjectRowOff" label-width="70px" class="demo-ruleForm">
  828. <el-row :gutter="40">
  829. <el-col :span="12" v-if="subjectRowOff.isCorp">
  830. <!--<div>客户核算:</div>-->
  831. <el-form-item label="客户名称:" prop="corpCnName">
  832. <search-query
  833. style="width: 100%"
  834. ref="searchQueryRef"
  835. :datalist="corpCnNameData"
  836. :selectValue="subjectRowOff.corpCnName"
  837. :filterable="true"
  838. :clearable="true"
  839. :remote="true"
  840. :buttonIf="true"
  841. placeholder="请选择客户名称"
  842. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  843. @corpFocus="getBcorpsListfun"
  844. @remoteMethod="getBcorpsListfun"
  845. @corpChange="corpChangeOff($event, 'corpCnName')"
  846. @eldialogConfirm="eldialogConfirmOff('bcorps')"
  847. @bottonSearchfun="bottonSearchfun('bcorps')"
  848. >
  849. <bcorps ref="bcorps" :eldialog="true" @selectionChange="eldialogMultipleChoice($event, 'bcorps')"></bcorps>
  850. </search-query>
  851. </el-form-item>
  852. </el-col>
  853. <el-col :span="12" v-if="subjectRowOff.isCorp">
  854. <el-form-item label="" prop="">
  855. <el-button type="primary" @click="regetOffVoucherItems">查询</el-button>
  856. </el-form-item>
  857. </el-col>
  858. </el-row>
  859. </el-form>
  860. </div>
  861. <div style="margin-top: 10px">
  862. <!-- show-summary-->
  863. <!-- :summary-method="summaryMethodOff"-->
  864. <el-table
  865. ref="tableOffRecords"
  866. :cell-style="{ padding: '0px', fontSize: '12px' }"
  867. :header-cell-style="tableHeaderCellStyle"
  868. :close-on-click-modal="false"
  869. :data="offRecordsData"
  870. :border="true"
  871. style="width: 100%"
  872. show-summary
  873. :summary-method="summaryMethodOff"
  874. @selection-change="handleOffRecordsSelectionChange"
  875. :row-class-name="rowClassName"
  876. >
  877. <el-table-column fixed="left" type="selection" width="50"> </el-table-column>
  878. <el-table-column type="index" width="40" style="text-align: center"> </el-table-column>
  879. <el-table-column prop="voucherDate" label="凭证日期" width="120" style="padding: 0">
  880. <template slot-scope="{ row }">
  881. <span>{{ row.voucherDate }}</span>
  882. </template>
  883. </el-table-column>
  884. <el-table-column prop="descr" label="摘要" width="200" style="padding: 0">
  885. <template slot-scope="{ row }">
  886. <span>{{ row.descr }}</span>
  887. </template>
  888. </el-table-column>
  889. <el-table-column prop="accountCode" label="科目名称" width="240" style="padding: 0">
  890. <template slot-scope="{ row }">
  891. <span>
  892. {{
  893. row.accountCode +
  894. " " +
  895. row.accountFullName +
  896. (row.isEmpl === 1 && row.emplName ? "/" + row.emplName : "") +
  897. (row.isDept === 1 && row.deptName ? "/" + row.deptName : "") +
  898. (row.isCorp === 1 && row.corpShortName ? "/" + row.corpShortName : "") +
  899. (row.isItem === 1 ? "/" + row.itemClassify + "-" + (row.itemName ? row.itemName : "") : "")
  900. }}
  901. </span>
  902. </template>
  903. </el-table-column>
  904. <el-table-column prop="dc" label="借贷" width="40px" style="padding: 0">
  905. <template slot-scope="{ row }">
  906. <span>{{ row.dc === "C" ? "借" : "贷" }}</span>
  907. </template>
  908. </el-table-column>
  909. <el-table-column label="本币金额">
  910. <el-table-column label="借方">
  911. <el-table-column prop="amountDr" label="金额" width="100px" style="text-align: right">
  912. <template slot-scope="{ row }">
  913. <span>{{ displayAmt(row.amountDr) }}</span>
  914. </template>
  915. </el-table-column>
  916. <el-table-column prop="amountDrOffCurrent" label="本次可核销" width="120px" style="text-align: right">
  917. <template slot-scope="{ row }">
  918. <el-input-number
  919. v-if="subjectRow.dc === 'C' && row.amountDrBlc !== '0.00'"
  920. style="width: 100%"
  921. v-model="row.amountDrOffCurrent"
  922. size="small"
  923. autocomplete="off"
  924. :disabled="form.voucherStatus == 1"
  925. placeholder="请输入借方"
  926. :precision="2"
  927. @change="offAmountBlur(row, 'D')"
  928. :controls="false"
  929. >
  930. </el-input-number>
  931. <span v-if="subjectRow.dc === 'D' || row.amountDr === '0.00'">{{ displayAmt(row.amountDrOff) }}</span>
  932. </template>
  933. </el-table-column>
  934. <el-table-column prop="amountDrBlc" label="核销余额" width="100px" style="text-align: right">
  935. <template slot-scope="{ row }">
  936. <span>{{ displayAmt(row.amountDrBlc) }}</span>
  937. </template>
  938. </el-table-column>
  939. </el-table-column>
  940. <el-table-column label="货方">
  941. <el-table-column prop="amountCr" label="金额" width="100px" style="text-align: right">
  942. <template slot-scope="{ row }">
  943. <span>{{ displayAmt(row.amountCr) }}</span>
  944. </template>
  945. </el-table-column>
  946. <el-table-column prop="amountCrOffCurrent" label="本次可核销" width="120px" style="text-align: right">
  947. <template slot-scope="{ row }">
  948. <el-input-number
  949. v-if="subjectRow.dc !== 'C' && row.amountCrBlc !== '0.00'"
  950. style="width: 100%"
  951. v-model="row.amountCrOffCurrent"
  952. size="small"
  953. autocomplete="off"
  954. :disabled="form.voucherStatus == 1"
  955. placeholder="请输入货方"
  956. :precision="2"
  957. @change="offAmountBlur(row, 'C')"
  958. :controls="false"
  959. >
  960. </el-input-number>
  961. <span v-if="subjectRow.dc === 'C' || row.amountCrBlc === '0.00'">{{ displayAmt(row.amountCrOff) }}</span>
  962. </template>
  963. </el-table-column>
  964. <el-table-column prop="amountCrBlc" label="核销余额" width="100px" style="text-align: right">
  965. <template slot-scope="{ row }">
  966. <span>{{ displayAmt(row.amountCrBlc) }}</span>
  967. </template>
  968. </el-table-column>
  969. </el-table-column>
  970. </el-table-column>
  971. <el-table-column label="外币金额">
  972. <el-table-column prop="curCode" label="币种" width="50px" align="center"> </el-table-column>
  973. <el-table-column prop="exrate" label="汇率" width="80px" style="text-align: right">
  974. <template slot-scope="{ row }">
  975. <span>{{ row.exrate ? Number(row.exrate).toFixed(4) : "" }}</span>
  976. </template>
  977. </el-table-column>
  978. <el-table-column label="借方">
  979. <el-table-column prop="amountDrUsd" label="金额" width="100px" style="text-align: right">
  980. <template slot-scope="{ row }">
  981. <span>{{ displayAmt(row.amountDrUsd) }}</span>
  982. </template>
  983. </el-table-column>
  984. <el-table-column prop="amountDrUsdOffCurrent" label="本次可核销" width="120px" style="text-align: right">
  985. <template slot-scope="{ row }">
  986. <el-input-number
  987. v-if="subjectRow.dc === 'C' && row.amountDrUsdBlc !== '0.00'"
  988. style="width: 100%; text-align: right"
  989. v-model="row.amountDrUsdOffCurrent"
  990. size="small"
  991. autocomplete="off"
  992. :disabled="form.voucherStatus == 1 || row.curCode == 'CNY'"
  993. clearable
  994. placeholder="请输入借方"
  995. :precision="2"
  996. @change="offAmountUSDBlur(row, 'Dusd')"
  997. :controls="false"
  998. >
  999. </el-input-number>
  1000. <span v-if="subjectRow.dc === 'D' || row.amountDrUsdBlc === '0.00'">{{ displayAmt(row.amountDrUsdOff) }}</span>
  1001. </template>
  1002. </el-table-column>
  1003. <el-table-column prop="amountDrUsdBlc" label="核销余额" width="100px" style="text-align: right">
  1004. <template slot-scope="{ row }">
  1005. <span>{{ displayAmt(row.amountDrUsdBlc) }}</span>
  1006. </template>
  1007. </el-table-column>
  1008. </el-table-column>
  1009. <el-table-column label="货方">
  1010. <el-table-column prop="amountCrUsd" label="金额" width="100px" style="text-align: right">
  1011. <template slot-scope="{ row }">
  1012. <span>{{ displayAmt(row.amountCrUsd) }}</span>
  1013. </template>
  1014. </el-table-column>
  1015. <el-table-column prop="amountCrUsdOffCurrent" label="金额" width="120px" style="text-align: right">
  1016. <template slot-scope="{ row }">
  1017. <el-input-number
  1018. v-if="subjectRow.dc !== 'C' && row.amountCrUsdBlc !== '0.00'"
  1019. style="width: 100%"
  1020. v-model="row.amountCrUsdOffCurrent"
  1021. size="small"
  1022. autocomplete="off"
  1023. :disabled="form.voucherStatus == 1 || row.curCode == 'CNY'"
  1024. clearable
  1025. placeholder="请输入货方"
  1026. :precision="2"
  1027. @change="offAmountUSDBlur(row, 'Cusd')"
  1028. :controls="false"
  1029. >
  1030. </el-input-number>
  1031. <span v-if="subjectRow.dc === 'C' || row.amountCrUsdBlc === '0.00'">{{ displayAmt(row.amountCrUsdOff) }}</span>
  1032. </template>
  1033. </el-table-column>
  1034. <el-table-column prop="amountCrUsdBlc" label="核销余额" width="100px" style="text-align: right">
  1035. <template slot-scope="{ row }">
  1036. <span>{{ displayAmt(row.amountCrUsdBlc) }}</span>
  1037. </template>
  1038. </el-table-column>
  1039. </el-table-column>
  1040. </el-table-column>
  1041. </el-table>
  1042. </div>
  1043. <span slot="footer" class="dialog-footer">
  1044. <el-button @click="offRecordsVisible = false">取 消</el-button>
  1045. <el-button type="primary" @click="offRecordsDeterminefun">确 定</el-button>
  1046. </span>
  1047. </el-dialog>
  1048. </div>
  1049. </template>
  1050. <script>
  1051. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  1052. import { getRateList } from "@/api/iosBasicData/rateManagement";
  1053. import { bcorpsbankList, getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  1054. import {
  1055. finstlbillsDetail,
  1056. finstlbillsitemsRemove,
  1057. finstlbillslistAccBillV1,
  1058. finstlbillsSubmit,
  1059. finstlbillsConfirmSettlement,
  1060. finstlbillsRevokeSettlement,
  1061. finstlbillsGetByDetail,
  1062. finstlbillslistAccBillByCorp,
  1063. finstlbillsGenerateVoucher,
  1064. voucherRemove
  1065. } from "@/api/iosBasicData/finstlbills";
  1066. import { getDeptLazyTree } from "@/api/system/dept";
  1067. import expand from "@/components/basic-container/expand.vue";
  1068. import queryFinstlbillsitems from "@/views/iosBasicData/PaymentApplication/assembly/finstlbillsitems.vue";
  1069. import finstlbillsitems from "@/views/iosBasicData/PaymentApplication/assembly/finstlbillsitems2.vue";
  1070. import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
  1071. import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
  1072. import { getList as getreportsList, reportsGetReportData } from "@/api/iosBasicData/reports";
  1073. import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
  1074. import { generateFinStlBills } from "@/api/iosBasicData/fininvoices";
  1075. import { dateFormat } from "@/util/date";
  1076. import dicSelect from "@/components/dicSelect/main";
  1077. import { isProcurement } from "@/api/basicData/configuration";
  1078. import fromtableDetails from "./components/fromtableDetails.vue";
  1079. import { getCurrentDate } from "@/util/date";
  1080. import { accountsDetail } from "@/api/iosBasicData/accounts";
  1081. import { getOffVoucherItems } from "@/api/iosBasicData/finvouchers";
  1082. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  1083. import { selectEmpls } from "@/api/approval/processConfig";
  1084. import { getBcorpsList } from "@/api/iosBasicData/bcorps";
  1085. import bcorps from "@/views/iosBasicData/bcorps/index.vue";
  1086. export default {
  1087. components: {
  1088. reportContainer,
  1089. reportformsList,
  1090. reports,
  1091. SearchQuery,
  1092. expand,
  1093. finstlbillsitems,
  1094. dicSelect,
  1095. queryFinstlbillsitems,
  1096. fromtableDetails,
  1097. TreeSelect,
  1098. bcorps
  1099. },
  1100. props: {
  1101. // 编辑还是保存
  1102. editSave: {
  1103. type: Boolean,
  1104. default: true
  1105. },
  1106. pageIds: {
  1107. type: Array, // 指定 prop 的类型为 Array
  1108. default: () => [] // 提供一个默认值,这里使用函数形式返回一个空数组
  1109. }
  1110. },
  1111. data() {
  1112. return {
  1113. handleSelectionData2: [], // 分录多选的数据
  1114. removedFinvouchersitems: [],
  1115. voucherTypeData: [], // 凭证字数据
  1116. voucherSourceData: [], // 业务类型
  1117. auxiliaryVisible: false, // 辅助核算弹窗
  1118. offRecordsVisible: false, // 预收预付核销弹窗
  1119. offRecordsData: [], // 预收预付核销数据
  1120. offRecordsSelectionData: [],
  1121. subjectRowOff: {}, // 核销科目弹窗的显示数据
  1122. subjectRow: {}, // 科目弹窗的显示数据
  1123. subjectAccount: {}, // 当前选择科目的数据
  1124. corpCnNameData: [], // 客户核算 下拉数据
  1125. deptData: [], // 部门核算 下拉数据
  1126. emplData: [], // 职员核算 下拉数据
  1127. itemData: [], // 项目核算 下拉数据
  1128. generateStatus: false,
  1129. amountSubSum: 0,
  1130. amountDSubSum: 0,
  1131. amountCSubSum: 0,
  1132. amountSubUsdSum: 0,
  1133. amountDSubUsdSum: 0,
  1134. amountCSubUsdSum: 0,
  1135. retrievePopupsType: false, // 弹窗开启关闭
  1136. retrievePopupsData: [], // 选择弹窗数据
  1137. retrievePopupsOption: {
  1138. border: true,
  1139. calcHeight: 30,
  1140. tip: false,
  1141. height: "auto",
  1142. index: true,
  1143. addBtn: false,
  1144. viewBtn: false,
  1145. delBtn: false,
  1146. editBtn: false,
  1147. refreshBtn: false,
  1148. columnBtn: false,
  1149. menuWidth: "60",
  1150. column: [
  1151. {
  1152. label: "客户中文名",
  1153. prop: "cnName",
  1154. overHidden: true
  1155. },
  1156. {
  1157. label: "客户英文文名",
  1158. prop: "cnName",
  1159. overHidden: true
  1160. }
  1161. ]
  1162. },
  1163. invoiceAmountCNY: 0, // 费用明细开票金额输入框CNY
  1164. invoiceAmountUSD: 0, // 费用明细开票金额输入框USD
  1165. settlementdistar: false, // 结算挑进来的
  1166. DesignreportDialog: false, // 设计报表弹窗
  1167. selectPrintingDialog: false, // 预览报表
  1168. // 收/付数据
  1169. dcData: [
  1170. {
  1171. label: "全部",
  1172. value: null
  1173. },
  1174. {
  1175. label: "收",
  1176. value: "D"
  1177. },
  1178. {
  1179. label: "付",
  1180. value: "C"
  1181. }
  1182. ],
  1183. appendType: "检索", // 是否追加
  1184. activeName: "1",
  1185. queryData: [],
  1186. tableData: [],
  1187. pageLoading: false, // 全屏加载动画
  1188. saveLoading: false, // 按钮动画
  1189. // 绑定的数据
  1190. form: {
  1191. dc: null,
  1192. billDate: dateFormat(new Date()),
  1193. voucherSource: "MANUAL",
  1194. voucherSourceName: "手工凭证",
  1195. voucherType: "VOUNO-TRANS", // 凭证类型
  1196. voucherTypeName: "转账凭证",
  1197. voucherDate: getCurrentDate(),
  1198. finStlBillsVoucherItemsList: []
  1199. },
  1200. addData: [],
  1201. handleSelectionData: [], // 表格选择的数据
  1202. corpData: [], // 结算单位 数据
  1203. bankData: [], // 查询银行数据
  1204. curCodeData: [], // 币别
  1205. srcforParameter: {},
  1206. // 业务类型
  1207. businessTypesData: [
  1208. {
  1209. label: "海运出口",
  1210. value: "SE"
  1211. },
  1212. {
  1213. label: "海运进口",
  1214. value: "SI"
  1215. }
  1216. ],
  1217. rules: {
  1218. corpCnName: [
  1219. {
  1220. required: true,
  1221. message: "请输入付费对象",
  1222. trigger: "blur"
  1223. }
  1224. ],
  1225. // bankId: [
  1226. // { required: true, message: '请输入开户银行', trigger: 'blur' },
  1227. // ],
  1228. remarks: [
  1229. {
  1230. required: true,
  1231. message: "请输入付费事由",
  1232. trigger: "blur"
  1233. }
  1234. ],
  1235. billDate: [
  1236. {
  1237. required: true,
  1238. message: "请选择结算日期",
  1239. trigger: "blur"
  1240. }
  1241. ],
  1242. estimatedTime: [
  1243. {
  1244. required: true,
  1245. message: "请输入预计收回",
  1246. trigger: "blur"
  1247. }
  1248. ],
  1249. collectionSituation: [
  1250. {
  1251. required: true,
  1252. message: "请输入收款情况",
  1253. trigger: "blur"
  1254. }
  1255. ]
  1256. },
  1257. roleName: [], // 当前的角色权限
  1258. saberUserInfo: {}, // 当前登录人信息
  1259. editPower: false, // 当前是否可以编辑
  1260. voucher: 0,
  1261. auditing: 0,
  1262. whetheropen: 0
  1263. };
  1264. },
  1265. created() {
  1266. this.roleName = localStorage.getItem("roleName").split(",");
  1267. // 获取当前登录人个人信息
  1268. this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content;
  1269. isProcurement({ param: "automatic.generate.voucher" }).then(res => {
  1270. // res.data.data === '1'
  1271. this.voucher = res.data.data;
  1272. });
  1273. isProcurement({ param: "whether.open" }).then(res => {
  1274. res.data.data = "1";
  1275. this.whetheropen = res.data.data;
  1276. });
  1277. isProcurement({ param: "whether.auditing" }).then(res => {
  1278. // res.data.data === '1'
  1279. this.auditing = res.data.data;
  1280. });
  1281. },
  1282. methods: {
  1283. corpChange2(value, name) {
  1284. let found = false;
  1285. // 客户名称客户名称
  1286. if (name == "corpCnName") {
  1287. for (let item of this.corpCnNameData) {
  1288. if (item.cnName == value) {
  1289. found = true;
  1290. this.$set(this.subjectRow, "corpEnName", item.enName);
  1291. this.$set(this.subjectRow, "corpCnName", item.cnName);
  1292. this.$set(this.subjectRow, "corpShortName", item.shortName);
  1293. this.$set(this.subjectRow, "corpId", item.id);
  1294. }
  1295. }
  1296. if (!found) {
  1297. this.$set(this.subjectRow, "corpEnName", "");
  1298. this.$set(this.subjectRow, "corpCnName", "");
  1299. this.$set(this.subjectRow, "corpShortName", "");
  1300. this.$set(this.subjectRow, "corpId", 0);
  1301. }
  1302. }
  1303. // 核算
  1304. else if (name == "deptName") {
  1305. for (let item of this.deptData) {
  1306. if (item.title == value) {
  1307. found = true;
  1308. this.$set(this.subjectRow, "deptName", item.title);
  1309. this.$set(this.subjectRow, "deptId", item.id);
  1310. }
  1311. }
  1312. if (!found) {
  1313. this.$set(this.subjectRow, "deptName", "");
  1314. this.$set(this.subjectRow, "deptId", 0);
  1315. }
  1316. }
  1317. // 职员
  1318. else if (name == "emplName") {
  1319. for (let item of this.emplData) {
  1320. if (item.name == value) {
  1321. found = true;
  1322. this.$set(this.subjectRow, "emplName", item.name);
  1323. this.$set(this.subjectRow, "emplId", item.id);
  1324. }
  1325. }
  1326. if (!found) {
  1327. this.$set(this.subjectRow, "emplName", "");
  1328. this.$set(this.subjectRow, "emplId", 0);
  1329. }
  1330. }
  1331. // 项目核算
  1332. else if (name == "itemName") {
  1333. for (let item of this.itemData) {
  1334. if (item.cnName == value) {
  1335. found = true;
  1336. this.$set(this.subjectRow, "itemName", item.cnName);
  1337. this.$set(this.subjectRow, "itemId", item.id);
  1338. }
  1339. }
  1340. if (!found) {
  1341. this.$set(this.subjectRow, "itemName", "");
  1342. this.$set(this.subjectRow, "itemId", 0);
  1343. }
  1344. } else if (name == "voucherType") {
  1345. this.$set(this.form, name, value);
  1346. for (let item of this.voucherTypeData) {
  1347. if (item.dictKey == value) {
  1348. found = true;
  1349. this.$set(this.form, "voucherTypeName", item.dictValue + "凭证");
  1350. }
  1351. }
  1352. if (!found) {
  1353. this.$set(this.subjectRow, "voucherTypeName", "");
  1354. }
  1355. } else if (name == "voucherSource") {
  1356. this.$set(this.form, name, value);
  1357. }
  1358. },
  1359. corpChangeOff(value, name) {
  1360. let found = false;
  1361. // 客户名称
  1362. if (name == "corpCnName") {
  1363. for (let item of this.corpCnNameData) {
  1364. if (item.cnName == value) {
  1365. found = true;
  1366. this.$set(this.subjectRowOff, "corpEnName", item.enName);
  1367. this.$set(this.subjectRowOff, "corpCnName", item.cnName);
  1368. this.$set(this.subjectRowOff, "corpShortName", item.shortName);
  1369. this.$set(this.subjectRowOff, "corpId", item.id);
  1370. }
  1371. }
  1372. if (!found) {
  1373. this.$set(this.subjectRowOff, "corpEnName", "");
  1374. this.$set(this.subjectRowOff, "corpCnName", "");
  1375. this.$set(this.subjectRowOff, "corpShortName", "");
  1376. this.$set(this.subjectRowOff, "corpId", 0);
  1377. }
  1378. }
  1379. // 核算
  1380. else if (name == "deptName") {
  1381. for (let item of this.deptData) {
  1382. if (item.title == value) {
  1383. found = true;
  1384. this.$set(this.subjectRowOff, "deptName", item.title);
  1385. this.$set(this.subjectRowOff, "deptId", item.id);
  1386. }
  1387. }
  1388. if (!found) {
  1389. this.$set(this.subjectRowOff, "deptName", "");
  1390. this.$set(this.subjectRowOff, "deptId", 0);
  1391. }
  1392. }
  1393. // 职员
  1394. else if (name == "emplName") {
  1395. for (let item of this.emplData) {
  1396. if (item.name == value) {
  1397. found = true;
  1398. this.$set(this.subjectRowOff, "emplName", item.name);
  1399. this.$set(this.subjectRowOff, "emplId", item.id);
  1400. }
  1401. }
  1402. if (!found) {
  1403. this.$set(this.subjectRowOff, "emplName", "");
  1404. this.$set(this.subjectRowOff, "emplId", 0);
  1405. }
  1406. }
  1407. // 项目核算
  1408. else if (name == "itemName") {
  1409. for (let item of this.itemData) {
  1410. if (item.cnName == value) {
  1411. found = true;
  1412. this.$set(this.subjectRowOff, "itemName", item.cnName);
  1413. this.$set(this.subjectRowOff, "itemId", item.id);
  1414. }
  1415. }
  1416. if (!found) {
  1417. this.$set(this.subjectRowOff, "itemName", "");
  1418. this.$set(this.subjectRowOff, "itemId", 0);
  1419. }
  1420. } else if (name == "voucherType") {
  1421. this.$set(this.form, name, value);
  1422. for (let item of this.voucherTypeData) {
  1423. if (item.dictKey == value) {
  1424. found = true;
  1425. this.$set(this.form, "voucherTypeName", item.dictValue + "凭证");
  1426. }
  1427. }
  1428. if (!found) {
  1429. this.$set(this.subjectRowOff, "voucherTypeName", "");
  1430. }
  1431. } else if (name == "voucherSource") {
  1432. this.$set(this.form, name, value);
  1433. }
  1434. },
  1435. bottonSearchfun(name) {
  1436. this.$nextTick(() => {
  1437. if (this.$refs.bcorps.selectionList.length == 0) return;
  1438. this.$refs.bcorps.$refs.crud.toggleSelection(); // 先清空所以选择的数据
  1439. });
  1440. },
  1441. // 下拉多选弹窗数据多选回调
  1442. eldialogMultipleChoice(list, name) {
  1443. if (name == "bcorps") {
  1444. let arr = [];
  1445. if (list.length > 1) {
  1446. this.$refs.bcorps.$refs.crud.toggleSelection(); // 先清空所以选择的数据
  1447. arr = [list[list.length - 1]]; // 获取最新点击的数组
  1448. this.$refs.bcorps.$refs.crud.toggleSelection(arr, true); // 把刚点击的数组变成选择状态
  1449. } else {
  1450. arr = list;
  1451. }
  1452. this.$refs.bcorps.selectionList = arr;
  1453. } else {
  1454. console.log("其他的组件");
  1455. }
  1456. },
  1457. // 下拉多选弹窗的确认
  1458. eldialogConfirm(name) {
  1459. if (name == "bcorps") {
  1460. if (this.$refs.bcorps.isShow) {
  1461. console.log("列表确认");
  1462. this.$set(this.subjectRow, "corpCnName", this.$refs.bcorps.selectionList[0].cnName);
  1463. this.$set(this.subjectRow, "corpEnName", this.$refs.bcorps.selectionList[0].enName);
  1464. this.$set(this.subjectRow, "corpId", this.$refs.bcorps.selectionList[0].id);
  1465. } else {
  1466. console.log("详情确认");
  1467. this.$refs.bcorps.$refs.detail.submitForm();
  1468. this.$set(this.subjectRow, "corpCnName", this.$refs.bcorps.$refs.detail.formData.cnName);
  1469. this.$set(this.subjectRow, "corpEnName", this.$refs.bcorps.$refs.detail.formData.enName);
  1470. this.$set(this.subjectRow, "corpId", this.$refs.bcorps.$refs.detail.formData.id);
  1471. }
  1472. } else {
  1473. console.log("其他的组件");
  1474. }
  1475. this.$refs.searchQueryRef.corpVisible = false;
  1476. },
  1477. // 下拉多选弹窗的确认
  1478. eldialogConfirmOff(name) {
  1479. if (name == "bcorps") {
  1480. if (this.$refs.bcorps.isShow) {
  1481. console.log("列表确认");
  1482. this.$set(this.subjectRowOff, "corpCnName", this.$refs.bcorps.selectionList[0].cnName);
  1483. this.$set(this.subjectRowOff, "corpEnName", this.$refs.bcorps.selectionList[0].enName);
  1484. this.$set(this.subjectRowOff, "corpId", this.$refs.bcorps.selectionList[0].id);
  1485. } else {
  1486. console.log("详情确认");
  1487. this.$refs.bcorps.$refs.detail.submitForm();
  1488. this.$set(this.subjectRowOff, "corpCnName", this.$refs.bcorps.$refs.detail.formData.cnName);
  1489. this.$set(this.subjectRowOff, "corpEnName", this.$refs.bcorps.$refs.detail.formData.enName);
  1490. this.$set(this.subjectRowOff, "corpId", this.$refs.bcorps.$refs.detail.formData.id);
  1491. }
  1492. } else {
  1493. console.log("其他的组件");
  1494. }
  1495. this.$refs.searchQueryRef.corpVisible = false;
  1496. },
  1497. fixedAmt(amt, len) {
  1498. let N = Number(amt);
  1499. let S = isNaN(N) ? "0.00" : N.toFixed(2);
  1500. while (S.length < len) {
  1501. S = "_" + S;
  1502. }
  1503. return S;
  1504. },
  1505. displayAmt(amt, len) {
  1506. let N = Number(amt);
  1507. let S = isNaN(N) ? "" : N.toFixed(len ? len : 2);
  1508. let Z = 0;
  1509. return S === Z.toFixed(len ? len : 2) ? "" : S;
  1510. },
  1511. // 表头样式
  1512. tableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
  1513. return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff;text-align:center";
  1514. },
  1515. summaryMethodOff(param) {
  1516. const { columns, data } = param;
  1517. const sums = [];
  1518. columns.forEach((column, index) => {
  1519. if (index === 2) {
  1520. sums[index] = "合计";
  1521. return;
  1522. }
  1523. const values = data.map(item => Number(item[column.property]));
  1524. // 显示列的统计 金额
  1525. let arr = ["amountDrOffCurrent", "amountCrOffCurrent", "amountDrUsdOffCurrent", "amountCrUsdOffCurrent"];
  1526. // 判断是否有这个数据
  1527. if (arr.indexOf(column.property) != -1) {
  1528. if (!values.every(value => isNaN(value))) {
  1529. sums[index] = values.reduce((prev, curr) => {
  1530. const value = Number(curr);
  1531. if (!isNaN(value)) {
  1532. return prev + curr;
  1533. } else {
  1534. return prev;
  1535. }
  1536. }, 0);
  1537. sums[index] = this.displayAmt(sums[index]); // 把合计的参数保留两位小数
  1538. // sums[index] += " 元";
  1539. } else {
  1540. sums[index] = " ";
  1541. }
  1542. }
  1543. });
  1544. return sums;
  1545. },
  1546. rowClassName({ row, rowIndex }) {
  1547. let rowName = "",
  1548. findRow = this.handleSelectionData.find(c => c.rowIndex === row.rowIndex);
  1549. if (findRow) {
  1550. rowName = "current-row "; // elementUI 默认高亮行的class类 不用再样式了^-^,也可通过css覆盖改变背景颜色
  1551. }
  1552. return rowName; //也可以再加上其他类名 如果有需求的话
  1553. },
  1554. // 表格多选数据
  1555. handleOffRecordsSelectionChange(list) {
  1556. this.offRecordsSelectionData = list;
  1557. },
  1558. handleClose(done) {
  1559. done();
  1560. },
  1561. newGuid() {
  1562. let vd = "0123456789abcdefghijklmnopqrstuvwxyz".split("");
  1563. var i = vd,
  1564. o = [],
  1565. s = Math.random,
  1566. n;
  1567. (o[8] = o[13] = o[18] = o[23] = "-"), (o[14] = "4");
  1568. for (var r = 0; r < 36; r++) o[r] || ((n = 0 | (16 * s())), (o[r] = i[19 == r ? (3 & n) | 8 : 15 & n]));
  1569. return o.join("");
  1570. },
  1571. // 添加分录
  1572. addEntryfun() {
  1573. let obj = {
  1574. dynUID: this.newGuid().replace(/-/g, "")
  1575. };
  1576. console.log(obj);
  1577. if (this.form.finStlBillsVoucherItemsList.length > 0) {
  1578. obj.descr = this.form.finStlBillsVoucherItemsList[this.form.finStlBillsVoucherItemsList.length - 1].descr;
  1579. }
  1580. this.form.finStlBillsVoucherItemsList.push(obj);
  1581. },
  1582. forceNumber(n) {
  1583. try {
  1584. let N = parseFloat(n);
  1585. if (isNaN(N)) {
  1586. N = 0.0;
  1587. } else {
  1588. let S = N.toFixed(2);
  1589. N = Number(S);
  1590. }
  1591. return N;
  1592. } catch (e) {
  1593. return 0.0;
  1594. }
  1595. },
  1596. oneClickSave() {
  1597. if (this.form.finStlBillsVoucherItemsList.length < 2) {
  1598. return this.$message.warning("请填写至少凭证两笔分录后再保存!");
  1599. }
  1600. this.editCustomer();
  1601. },
  1602. // 行添加
  1603. addRowsfun(row, index) {
  1604. //第二个参数为0的时候,是可以添加参数的,1的时候是删除
  1605. let obj = {
  1606. dynUID: this.newGuid().replace(/-/g, "")
  1607. };
  1608. this.form.finStlBillsVoucherItemsList.splice(index, 0, obj);
  1609. },
  1610. // 行删除
  1611. deletefun(row, index) {
  1612. let offVouItems = Array.isArray(row.offVouItems) ? row.offVouItems : [];
  1613. if (row.id) {
  1614. this.$set(row, "changeMode", row.changeMode === "d" ? "u" : "d");
  1615. // this.finvouchersitemsRemovefun(row.id);
  1616. this.removedFinvouchersitems.push(row);
  1617. voucherRemove(row.id).then(res => {
  1618. this.form.finStlBillsVoucherItemsList.splice(index, 1);
  1619. });
  1620. } else {
  1621. this.form.finStlBillsVoucherItemsList.splice(index, 1);
  1622. }
  1623. offVouItems.forEach(item => {
  1624. let rowIdx = this.form.finStlBillsVoucherItemsList.indexOf(item);
  1625. if (rowIdx >= 0) {
  1626. if (item.id) {
  1627. this.$set(item, "changeMode", item.changeMode === "d" ? "u" : "d");
  1628. // this.finvouchersitemsRemovefun(row.id);
  1629. this.removedFinvouchersitems.push(item);
  1630. this.form.finStlBillsVoucherItemsList.splice(rowIdx, 1);
  1631. } else this.form.finStlBillsVoucherItemsList.splice(rowIdx, 1);
  1632. }
  1633. });
  1634. },
  1635. // 删除分录
  1636. deleteEntryfun() {
  1637. if (this.handleSelectionData2.length == 0) {
  1638. return this.$message.warning("请选择至少一条数据");
  1639. }
  1640. let offVouItems = [];
  1641. let multiList = this.handleSelectionData2;
  1642. let arr = this.form.finStlBillsVoucherItemsList;
  1643. // 获取有id 的数据
  1644. const itemsWithId = multiList.filter(item => item.id);
  1645. let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
  1646. console.log(arrIds);
  1647. // 把选中的删除掉
  1648. multiList.forEach(item => {
  1649. offVouItems = offVouItems.concat(Array.isArray(item.offVouItems) ? item.offVouItems : []);
  1650. if (!item.hasOwnProperty("id")) {
  1651. for (let index in arr) {
  1652. if (JSON.stringify(item) == JSON.stringify(arr[index])) {
  1653. arr.splice(Number(index), 1);
  1654. }
  1655. }
  1656. }
  1657. });
  1658. // 有id 的处理
  1659. if (itemsWithId.length != 0) {
  1660. voucherRemove(arrIds.join(",")).then(res => {
  1661. arrIds.forEach(id => {
  1662. let i = this.form.finStlBillsVoucherItemsList.findIndex(item => item.id === id);
  1663. if (i >= 0) {
  1664. let row = this.form.finStlBillsVoucherItemsList[i];
  1665. this.$set(row, "changeMode", "d");
  1666. this.removedFinvouchersitems.push();
  1667. this.form.finStlBillsVoucherItemsList.splice(i, 1);
  1668. }
  1669. });
  1670. this.$message.success("删除成功");
  1671. });
  1672. }
  1673. offVouItems.forEach(item => {
  1674. let rowIdx = this.form.finStlBillsVoucherItemsList.indexOf(item);
  1675. if (rowIdx >= 0) {
  1676. if (item.id) {
  1677. this.$set(item, "changeMode", item.changeMode === "d" ? "u" : "d");
  1678. // this.finvouchersitemsRemovefun(row.id);
  1679. this.removedFinvouchersitems.push(item);
  1680. this.form.finStlBillsVoucherItemsList.splice(rowIdx, 1);
  1681. } else this.form.finStlBillsVoucherItemsList.splice(rowIdx, 1);
  1682. }
  1683. });
  1684. },
  1685. // 借方/贷方 本币的计算
  1686. offAmountBlur(row, name) {
  1687. if (name === "D") {
  1688. this.$set(row, "amountCrOffCurrent", 0);
  1689. }
  1690. if (name === "C") {
  1691. this.$set(row, "amountDrOffCurrent", 0);
  1692. }
  1693. let a = row.amountCrOffCurrent ? Number(row.amountCrOffCurrent) : 0;
  1694. this.$set(row, "amountCrOffCurrent", a > Number(row.amountCrBlc) ? Number(row.amountCrBlc) : a);
  1695. a = row.amountDrOff ? Number(row.amountDrOff) : 0;
  1696. this.$set(row, "amountDrOffCurrent", a > Number(row.amountDrBlc) ? Number(row.amountDrBlc) : a);
  1697. if (row.curCode === "USD") {
  1698. this.$set(row, "exrate", row.exrate ? Number(row.exrate) : 1);
  1699. this.$set(row, "amountCrUsdOffCurrent", (row.amountCrOffCurrent / row.exrate).toFixed(2));
  1700. this.$set(row, "amountDrUsdOffCurrent", (row.amountDrOffCurrent / row.exrate).toFixed(2));
  1701. }
  1702. },
  1703. // 外币的计算
  1704. offAmountUSDBlur(row, name) {
  1705. if (name === "Dusd") {
  1706. this.$set(row, "amountCrUsdOffCurrent", 0);
  1707. }
  1708. if (name === "Cusd") {
  1709. this.$set(row, "amountDrUsdOffCurrent", 0);
  1710. }
  1711. let a = row.amountCrUsdOffCurrent ? Number(row.amountCrUsdOffCurrent) : 0;
  1712. this.$set(row, "amountCrUsdOffCurrent", a > Number(row.amountCrUsdBlc) ? Number(row.amountCrUsdBlc) : a);
  1713. a = row.amountDrUsdOffCurrent ? Number(row.amountDrUsdOffCurrent) : 0;
  1714. this.$set(row, "amountDrUsdOffCurrent", a > Number(row.amountDrUsdBlc) ? Number(row.amountDrUsdBlc) : a);
  1715. this.$set(row, "exrate", row.exrate ? Number(row.exrate) : 1);
  1716. this.$set(row, "amountCrOffCurrent", (row.amountCrUsdOffCurrent * row.exrate).toFixed(2));
  1717. this.$set(row, "amountDrOffCurrent", (row.amountDrUsdOffCurrent * row.exrate).toFixed(2));
  1718. },
  1719. // 客户
  1720. getBcorpsListfun(cnName) {
  1721. getBcorpsList(1, 10, { cnName }).then(res => {
  1722. this.corpCnNameData = res.data.data.records;
  1723. });
  1724. },
  1725. // 部门
  1726. getDeptTreefun() {
  1727. getDeptLazyTree(JSON.parse(localStorage.getItem("saber-userInfo")).content.dept_pid.split(",")[0]).then(res => {
  1728. this.deptData = res.data.data;
  1729. });
  1730. },
  1731. // 职员
  1732. userGetListfun(account = undefined, type = false) {
  1733. // userGetList(1, 10, { account }, JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]).then(res => {
  1734. // this.emplData = res.data.data.records
  1735. // })
  1736. selectEmpls(1, 10, { cname: account, whetherEmployedOrNot: 1 }).then(res => {
  1737. if (Array.isArray(res.data.data.records)) {
  1738. res.data.data.records.forEach(item => {
  1739. item.name = item.cname;
  1740. });
  1741. }
  1742. this.emplData = res.data.data.records;
  1743. });
  1744. },
  1745. handleSelectionChange2(list) {
  1746. this.handleSelectionData2 = list;
  1747. },
  1748. // 科目编辑打开辅助核算弹窗
  1749. auxiliaryAccountingfun(row) {
  1750. // 获取状态
  1751. accountsDetail(row.accountId).then(res => {
  1752. this.subjectAccount = res.data.data;
  1753. this.subjectRow = row;
  1754. // 如果三个都没有勾选 直接不自动打开弹窗
  1755. if (res.data.data.isCorp || res.data.data.isDept || res.data.data.isEmpl || res.data.data.isItem) {
  1756. this.auxiliaryVisible = true;
  1757. }
  1758. });
  1759. },
  1760. regetOffVoucherItems() {
  1761. getOffVoucherItems(this.subjectRowOff).then(res => {
  1762. let list = Array.isArray(res.data.data) ? res.data.data : [];
  1763. list.forEach(item => {
  1764. if (this.offRecordsData.findIndex(i => i.id === item.id) === -1) {
  1765. this.offRecordsData.push(item);
  1766. }
  1767. });
  1768. });
  1769. },
  1770. offRecordsDeterminefun() {
  1771. if (!Array.isArray(this.offRecordsData)) {
  1772. this.offRecordsVisible = false;
  1773. return;
  1774. }
  1775. if (this.offRecordsSelectionData.length === 0) {
  1776. return this.$message.warning("请选择至少一条数据");
  1777. }
  1778. let row = this.subjectRow;
  1779. let amt = row.dc === "D" ? Number(row.amountCr) : Number(row.amountDr);
  1780. let usd = row.dc === "D" ? Number(row.amountCrUsd) : Number(row.amountDrUsd);
  1781. let amtOff = 0.0,
  1782. usdOff = 0;
  1783. let rows = [];
  1784. this.offRecordsSelectionData.forEach(item => {
  1785. let currAmt = 0;
  1786. if (row.dc === "D") {
  1787. currAmt = Number(item.amountCrOffCurrent);
  1788. amtOff = amtOff + currAmt;
  1789. if (item.curCode === "USD") {
  1790. usdOff = usdOff + Number(item.amountCrUsdOffCurrent);
  1791. }
  1792. } else {
  1793. currAmt = Number(item.amountDrOffCurrent);
  1794. amtOff = amtOff + currAmt;
  1795. if (item.curCode === "USD") {
  1796. usdOff = usdOff + Number(item.amountDrUsdOffCurrent);
  1797. }
  1798. }
  1799. currAmt = currAmt > 0.0 ? currAmt.toFixed(2) : "0.00";
  1800. if (currAmt !== "0.00") {
  1801. rows.push(item);
  1802. }
  1803. });
  1804. if (amt.toFixed(2) !== amtOff.toFixed(2)) {
  1805. return this.$message({
  1806. dangerouslyUseHTMLString: true,
  1807. message: "<div>选定核销金额与应核销金额不一致!</div>",
  1808. type: "warning"
  1809. });
  1810. }
  1811. rows.forEach(item => {
  1812. let obj = {
  1813. dynUID: this.newGuid().replace(/-/g, "")
  1814. };
  1815. let flds = "accountId,accountCode,accountCnName,accountEnName,accountFullName,accountLevel,accountProperty,dc,";
  1816. flds += "isArAp,isCorp,isDc,isDept,isEmpl,isForeign,curCode,isQuantity,unitNo,isItem,itemClassify,itemClassifyId,itemId,itemName,";
  1817. flds += "corpId,corpShortName,corpCnName,corpEnName,deptId,deptName,emplId,emplName,exrate";
  1818. flds.split(",").forEach(name => {
  1819. obj[name] = item[name];
  1820. });
  1821. obj.descr = row.descr;
  1822. if (row.dc === "D") {
  1823. obj.amountDr = item.amountCrOffCurrent;
  1824. obj.amountCr = 0.0;
  1825. if (item.curCode === "USD") {
  1826. obj.amountDrUsd = item.amountCrUsdOffCurrent;
  1827. obj.amountCrUsd = 0.0;
  1828. }
  1829. } else {
  1830. obj.amountCr = item.amountDrOffCurrent;
  1831. obj.amountDr = 0.0;
  1832. if (item.curCode === "USD") {
  1833. obj.amountCrUsd = item.amountDrUsdOffCurrent;
  1834. obj.amountDrUsd = 0.0;
  1835. }
  1836. }
  1837. obj.isOff = 1;
  1838. obj.offSrcItemId = item.id;
  1839. obj.offVouItemId = row.id;
  1840. if (!Array.isArray(row.offVouItems)) row.offVouItems = [];
  1841. row.offVouItems.push(obj);
  1842. this.form.finStlBillsVoucherItemsList.push(obj);
  1843. });
  1844. this.offRecordsVisible = false;
  1845. },
  1846. // 辅助核算弹窗确认按钮
  1847. auxiliaryDeterminefun() {
  1848. this.auxiliaryVisible = false;
  1849. },
  1850. // 获取核销记录
  1851. showOffRecordsfun(row) {
  1852. // 获取状态
  1853. this.subjectRowOff = JSON.parse(JSON.stringify(row));
  1854. getOffVoucherItems(this.subjectRowOff).then(res => {
  1855. this.offRecordsSelectionData = [];
  1856. this.offRecordsData = Array.isArray(res.data.data) ? res.data.data : [];
  1857. this.subjectRow = row;
  1858. this.offRecordsVisible = true;
  1859. });
  1860. },
  1861. lastPage() {
  1862. if (this.pageIds.length) {
  1863. const index = this.pageIds.indexOf(this.form.id);
  1864. if (index == 0) {
  1865. return this.$message.error("没有上一票了");
  1866. }
  1867. const lastIndex = index - 1;
  1868. // if (this.form.id) {
  1869. // this.unLock({
  1870. // moduleName: "SE",
  1871. // tableName: "SE_order",
  1872. // billId: this.form.id,
  1873. // billNo: this.form.mblno
  1874. // });
  1875. // }
  1876. this.finstlbillsDetailfun(this.pageIds[lastIndex]);
  1877. }
  1878. },
  1879. nextPage() {
  1880. if (this.pageIds.length) {
  1881. const index = this.pageIds.indexOf(this.form.id);
  1882. if (this.pageIds[this.pageIds.length - 1] == this.form.id) {
  1883. return this.$message.error("没有下一票了");
  1884. }
  1885. const nextIndex = index + 1;
  1886. // if (this.form.id) {
  1887. // this.unLock({
  1888. // moduleName: "SE",
  1889. // tableName: "SE_order",
  1890. // billId: this.form.id,
  1891. // billNo: this.form.mblno
  1892. // });
  1893. // }
  1894. this.finstlbillsDetailfun(this.pageIds[nextIndex]);
  1895. }
  1896. },
  1897. // 打印
  1898. reportRadio(val) {
  1899. // 获取报表数据
  1900. reportsGetReportData({
  1901. billId: this.form.id,
  1902. reportCode: val.classifyCode,
  1903. groupCode: val.groupCode,
  1904. type: "JSZX"
  1905. }).then(res => {
  1906. this.handleReportPreview(val.url, res.data.data.data);
  1907. });
  1908. },
  1909. // 报表预览
  1910. previewreportfun() {
  1911. getreportsList(1, 10, {
  1912. businessType: "JSZX"
  1913. // classifyCode:'结算中心',
  1914. // groupCode:'付费结算'
  1915. }).then(res => {
  1916. if (res.data.data.records.length == 1) {
  1917. this.reportRadio(res.data.data.records[0]);
  1918. } else {
  1919. this.saveLoading = true;
  1920. this.selectPrintingDialog = true;
  1921. this.saveLoading = false;
  1922. let page = {
  1923. pageSize: 10,
  1924. currentPage: 1,
  1925. total: 0
  1926. };
  1927. this.$nextTick(() => {
  1928. this.$refs.reportformsList.onLoad(page, {
  1929. businessType: "JSZX"
  1930. // classifyCode:'结算中心',
  1931. // groupCode:'付费结算'
  1932. });
  1933. });
  1934. }
  1935. });
  1936. },
  1937. submit(type) {
  1938. this.$confirm("确定进行结算操作?", {
  1939. confirmButtonText: "确定",
  1940. cancelButtonText: "取消",
  1941. type: "warning"
  1942. })
  1943. .then(() => {
  1944. this.editCustomer(type);
  1945. })
  1946. .catch(() => {
  1947. this.saveLoading = false; // 关闭按钮动画
  1948. });
  1949. },
  1950. // 费用明细开票匹配
  1951. invoiceMatchingfun() {
  1952. if (this.invoiceAmountCNY != 0 || this.invoiceAmountUSD != 0) {
  1953. let dataCNY = JSON.parse(JSON.stringify(this.invoiceAmountCNY));
  1954. let dataUSD = JSON.parse(JSON.stringify(this.invoiceAmountUSD));
  1955. for (let item of this.tableData) {
  1956. this.$refs.finstlbillsitems.$refs.tableRef.toggleRowSelection(item, false);
  1957. if (this.invoiceAmountCNY != 0) {
  1958. if (dataCNY < 0) {
  1959. dataCNY = 0;
  1960. }
  1961. if (dataCNY > 1500) {
  1962. if (item.currentStlCurCode == "CNY") {
  1963. this.$set(item, "currentStlAmountRMB", 1500);
  1964. this.$refs.finstlbillsitems.$refs.tableRef.toggleRowSelection(item, true);
  1965. dataCNY -= 1500;
  1966. }
  1967. } else {
  1968. if (item.currentStlCurCode == "CNY") {
  1969. if (dataCNY != 0) {
  1970. this.$refs.finstlbillsitems.$refs.tableRef.toggleRowSelection(item, true);
  1971. }
  1972. this.$set(item, "currentStlAmountRMB", dataCNY);
  1973. dataCNY -= 1500;
  1974. }
  1975. }
  1976. }
  1977. if (this.invoiceAmountUSD != 0) {
  1978. if (dataUSD < 0) {
  1979. dataUSD = 0;
  1980. }
  1981. if (dataUSD > 1500) {
  1982. if (item.currentStlCurCode == "USD") {
  1983. this.$set(item, "currentStlAmountUSD", 1500);
  1984. this.$refs.finstlbillsitems.$refs.tableRef.toggleRowSelection(item, true);
  1985. dataUSD -= 1500;
  1986. }
  1987. } else {
  1988. if (item.currentStlCurCode == "USD") {
  1989. this.$set(item, "currentStlAmountUSD", dataUSD);
  1990. if (dataUSD != 0) {
  1991. this.$refs.finstlbillsitems.$refs.tableRef.toggleRowSelection(item, true);
  1992. }
  1993. dataUSD -= 1500;
  1994. }
  1995. }
  1996. }
  1997. }
  1998. }
  1999. },
  2000. // 一键删除
  2001. batchDeletefun() {
  2002. if (this.handleSelectionData.length == 0) {
  2003. return this.$message.warning("请选择要删除的数据");
  2004. }
  2005. this.$confirm("确定将选择数据删除?", {
  2006. confirmButtonText: "确定",
  2007. cancelButtonText: "取消",
  2008. type: "warning"
  2009. }).then(() => {
  2010. // 获取有id 的数据
  2011. const itemsWithId = this.handleSelectionData.filter(item => item.hasOwnProperty("id"));
  2012. let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
  2013. // 把选中的删除掉
  2014. this.handleSelectionData.forEach(item => {
  2015. for (let index in this.tableData) {
  2016. if (item.accBillNo == this.tableData[index].accBillNo) {
  2017. this.tableData.splice(Number(index), 1);
  2018. this.form.finStlBillsItemsList = this.tableData;
  2019. }
  2020. }
  2021. });
  2022. // 有id 的处理
  2023. if (itemsWithId.length != 0) {
  2024. finstlbillsitemsRemove(arrIds.join(",")).then(res => {
  2025. this.$message.success("操作成功");
  2026. });
  2027. }
  2028. });
  2029. },
  2030. // 删除
  2031. finstlbillsitemsRemovefun(id, index) {
  2032. this.$confirm("确定将选择数据删除?", {
  2033. confirmButtonText: "确定",
  2034. cancelButtonText: "取消",
  2035. type: "warning"
  2036. }).then(() => {
  2037. if (id) {
  2038. finstlbillsitemsRemove(id).then(res => {
  2039. this.$message.success("操作成功");
  2040. });
  2041. }
  2042. this.tableData.splice(index, 1);
  2043. this.form.finStlBillsItemsList = this.tableData;
  2044. });
  2045. },
  2046. // 下拉回调
  2047. corpChange(value, name) {
  2048. // 结算单位
  2049. if (name == "corpCnName") {
  2050. // 开户银行
  2051. this.$set(this.form, "bankId", "");
  2052. this.$set(this.form, "bankAccountName", "");
  2053. this.$set(this.form, "bankAccountBank", "");
  2054. this.$set(this.form, "bankAccountNo", "");
  2055. if (!value) {
  2056. this.$set(this.form, "corpId", "");
  2057. this.$set(this.form, "corpCnName", "");
  2058. this.$set(this.form, "corpEnName", "");
  2059. this.$set(this.form, "corpArgreementNo", "");
  2060. }
  2061. for (let item of this.corpData) {
  2062. if (item.cnName == value) {
  2063. this.$set(this.form, "corpId", item.id);
  2064. this.$set(this.form, "corpCnName", item.cnName);
  2065. this.$set(this.form, "corpEnName", item.enName);
  2066. this.$set(this.form, "corpArgreementNo", item.enName);
  2067. this.bcorpsbankListfun();
  2068. }
  2069. }
  2070. } else if (name == "bankId") {
  2071. if (!value) {
  2072. this.$set(this.form, "bankId", "");
  2073. this.$set(this.form, "bankAccountName", "");
  2074. this.$set(this.form, "bankAccountBank", "");
  2075. this.$set(this.form, "bankAccountNo", "");
  2076. }
  2077. for (let item of this.bankData) {
  2078. if (item.id == value) {
  2079. this.$set(this.form, "bankId", item.id);
  2080. this.$set(this.form, "bankAccountName", item.accountName);
  2081. this.$set(this.form, "bankAccountBank", item.accountBank);
  2082. this.$set(this.form, "bankAccountNo", item.accountNo);
  2083. }
  2084. }
  2085. } else {
  2086. this.$set(this.form, name, value);
  2087. }
  2088. },
  2089. // 编辑
  2090. editHandle() {
  2091. this.editSave = false;
  2092. },
  2093. // 保存
  2094. newbillFun() {
  2095. if (this.form.isCleared == 1) {
  2096. this.$emit("toAddEdit");
  2097. } else {
  2098. this.$confirm("是否需要保存?", "提示", {
  2099. confirmButtonText: "确定",
  2100. cancelButtonText: "取消",
  2101. type: "warning"
  2102. })
  2103. .then(() => {
  2104. this.editCustomer("toAddEdit");
  2105. })
  2106. .catch(() => {
  2107. this.$emit("toAddEdit");
  2108. });
  2109. }
  2110. },
  2111. editCustomer(type) {
  2112. this.$refs.form.validate(valid => {
  2113. if (!valid) return;
  2114. if (!this.generateStatus) {
  2115. if (!this.form.id) {
  2116. // 是否选择从表数据
  2117. if (this.addData.length == 0) {
  2118. this.$message.warning("请选择结算数据");
  2119. return;
  2120. }
  2121. }
  2122. }
  2123. if (type == "结算") {
  2124. if (this.auditing == 1) {
  2125. for (let [index, row] of this.tableData.entries()) {
  2126. if (row.feeCnName == "增值税") {
  2127. if (!row.taxInvoiceNumber || !row.taxInvoiceDate || !row.deductionTime) {
  2128. this.pageLoading = false;
  2129. this.saveLoading = false;
  2130. return this.$message.error("请完善第" + Number(index + 1) + "行增值税明细信息");
  2131. }
  2132. }
  2133. }
  2134. }
  2135. }
  2136. // 判断借方金额合计 是否等于 贷方金额合计
  2137. let msgs = [];
  2138. let amountDrSum = 0;
  2139. let amountCrSum = 0;
  2140. let index = 0;
  2141. if (this.form.finStlBillsVoucherItemsList && this.form.finStlBillsVoucherItemsList.length) {
  2142. for (let item of this.form.finStlBillsVoucherItemsList) {
  2143. index++;
  2144. let amtDr = this.forceNumber(item.amountDr);
  2145. let amtCr = this.forceNumber(item.amountCr);
  2146. amountDrSum += amtDr;
  2147. amountCrSum += amtCr;
  2148. let descr = item.descr ? item.descr.trim() : "";
  2149. if (!descr) {
  2150. msgs.push(`第 ${index} 行分录请填写摘要!`);
  2151. } else {
  2152. item.descr = descr;
  2153. }
  2154. if (!item.accountId) {
  2155. msgs.push(`第 ${index} 行分录缺少科目代码!`);
  2156. } else {
  2157. if (item.isCorp === 1 && !item.corpId) {
  2158. msgs.push(`第 ${index} 行分录科目 ${item.accountCode} ${item.accountFullName} 核算客户,请选择客户名称!`);
  2159. }
  2160. if (item.isDept === 1 && !item.deptId) {
  2161. msgs.push(`第 ${index} 行分录科目 ${item.accountCode} ${item.accountFullName} 核算部门,请选择部门名称!`);
  2162. }
  2163. if (item.isEmpl === 1 && !item.emplId) {
  2164. msgs.push(`第 ${index} 行分录科目 ${item.accountCode} ${item.accountFullName} 核算职员,请选择职员名称!`);
  2165. }
  2166. // if (item.isItem === 1 && !item.itemId) {
  2167. // msgs.push(`第 ${index} 行分录科目 ${item.accountCode} ${item.accountFullName} 核算项目,请选择项目名称!`);
  2168. // }
  2169. if (amtDr.toFixed(2) === "0.00" && amtCr.toFixed(2) === "0.00") {
  2170. msgs.push(`第 ${index} 行分录科目 ${item.accountCode} ${item.accountFullName} 请填写金额!`);
  2171. }
  2172. }
  2173. }
  2174. if (amountDrSum !== amountCrSum) {
  2175. msgs.push(`凭证借贷金额不平衡!`);
  2176. }
  2177. if (msgs.length > 0) {
  2178. return this.$message({
  2179. dangerouslyUseHTMLString: true,
  2180. message: msgs.join("<br /><br />"),
  2181. type: "warning"
  2182. });
  2183. }
  2184. }
  2185. // this.form.finStlBillsVoucherItemsList = this.form.finStlBillsVoucherItemsList.concat(this.removedFinvouchersitems);
  2186. this.saveLoading = true; // 打开按钮动画
  2187. if (this.form.estimatedTime) {
  2188. this.form.estimatedTime = this.form.estimatedTime + " 00:00:00";
  2189. }
  2190. this.saveLoading = true; // 加载动画
  2191. this.form.billNoFormat = "STL";
  2192. this.form.businessTypeCode = "STL";
  2193. this.form.businessType = "STL"; // 结算单
  2194. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2195. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2196. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  2197. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  2198. this.form.voucherDate = this.form.voucherDate ? this.form.voucherDate.slice(0, 10) + " 00:00:00" : null;
  2199. this.form.settlementType = this.settlementType;
  2200. if (this.form.id) {
  2201. if (type == "选定行") {
  2202. this.form.finStlBillsItemsList = this.addData.map((item, index) => {
  2203. if (item.currentStlCurCode == "CNY") {
  2204. item.currentStlAmount = item.currentStlAmountRMB;
  2205. } else {
  2206. item.currentStlAmount = item.currentStlAmountUSD;
  2207. }
  2208. if (!this.form.id) {
  2209. // delete item.businessType
  2210. delete item.billDate;
  2211. delete item.accountDc;
  2212. }
  2213. return item;
  2214. });
  2215. }
  2216. if (this.form.finStlBillsItemsList.length != 0) {
  2217. this.form.finStlBillsItemsList = this.form.finStlBillsItemsList.map((item, index) => {
  2218. if (item.currentStlCurCode == "CNY") {
  2219. item.currentStlAmount = item.currentStlAmountRMB;
  2220. console.log(1, item.currentStlAmount, item.currentStlAmountRMB);
  2221. } else {
  2222. item.currentStlAmount = item.currentStlAmountUSD;
  2223. }
  2224. return item;
  2225. });
  2226. } else {
  2227. this.form.finStlBillsItemsList = this.addData.map((item, index) => {
  2228. if (item.currentStlCurCode == "CNY") {
  2229. item.currentStlAmount = item.currentStlAmountRMB;
  2230. } else {
  2231. item.currentStlAmount = item.currentStlAmountUSD;
  2232. }
  2233. if (!this.form.id) {
  2234. // delete item.businessType
  2235. delete item.billDate;
  2236. delete item.accountDc;
  2237. }
  2238. return item;
  2239. });
  2240. }
  2241. } else {
  2242. this.form.finStlBillsItemsList = this.addData.map((item, index) => {
  2243. if (item.currentStlCurCode == "CNY") {
  2244. item.currentStlAmount = item.currentStlAmountRMB;
  2245. } else {
  2246. item.currentStlAmount = item.currentStlAmountUSD;
  2247. }
  2248. if (!this.form.id) {
  2249. // delete item.businessType
  2250. delete item.billDate;
  2251. delete item.accountDc;
  2252. }
  2253. return item;
  2254. });
  2255. }
  2256. // 判断是结算还是保存
  2257. if (type == "结算") {
  2258. finstlbillsSubmit(this.form).then(res => {
  2259. this.form = res.data.data;
  2260. this.tableData = this.form.finStlBillsItemsList.map(item => {
  2261. item.stlTtlAmountNet = Number(item.stlTtlAmount) - Number(item.stlTtlAmount) * (Number(item.taxRate) + Number(item.surchargeRate));
  2262. item.currentStlAmountNet =
  2263. Number(item.unsettledAmount) - Number(item.unsettledAmount) * (Number(item.taxRate) + Number(item.surchargeRate));
  2264. if (item.curCode == "CNY") {
  2265. this.$set(item, "currentInvoiceAmountRMB", item.currentInvoiceAmount);
  2266. this.$set(item, "amountRMB", item.amount);
  2267. this.$set(item, "amountNetRMB", item.amountNet);
  2268. this.$set(item, "stlTtlAmountRMB", item.stlTtlAmount);
  2269. this.$set(item, "stlTtlAmountNetRMB", item.stlTtlAmountNet);
  2270. this.$set(item, "currentStlAmountNetRMB", item.currentStlAmountNet);
  2271. this.$set(item, "currentStlAmountRMB", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  2272. this.$set(item, "currentStlAmountUSD", Number(0));
  2273. } else {
  2274. this.$set(item, "currentInvoiceAmountUSD", item.currentInvoiceAmount);
  2275. this.$set(item, "amountUSD", item.amount);
  2276. this.$set(item, "amountNetUSD", item.amountNet);
  2277. this.$set(item, "stlTtlAmountNetUSD", item.stlTtlAmountNet);
  2278. this.$set(item, "stlTtlAmountUSD", item.stlTtlAmount);
  2279. this.$set(item, "currentStlAmountNetUSD", item.currentStlAmountNet);
  2280. this.$set(item, "currentStlAmountUSD", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  2281. this.$set(item, "currentStlAmountRMB", Number(0));
  2282. }
  2283. if (item.srcIdInvoices) {
  2284. this.settlementdistar = true;
  2285. }
  2286. return item;
  2287. });
  2288. this.finstlbillsConfirmSettlementfun();
  2289. });
  2290. } else if (type == "toAddEdit") {
  2291. finstlbillsSubmit(this.form)
  2292. .then(res => {
  2293. this.$message.success("操作成功");
  2294. this.saveLoading = false; // 关闭按钮动画
  2295. this.$emit(type);
  2296. this.finstlbillsDetailfun(this.form.id, type);
  2297. })
  2298. .catch(() => {
  2299. this.saveLoading = false;
  2300. });
  2301. } else {
  2302. if (this.generateStatus) {
  2303. this.form.finStlBillsItemsList = this.tableData.map((item, index) => {
  2304. if (item.currentStlCurCode == "CNY") {
  2305. item.currentStlAmount = item.currentStlAmountRMB;
  2306. } else {
  2307. item.currentStlAmount = item.currentStlAmountUSD;
  2308. }
  2309. if (!this.form.id) {
  2310. // delete item.businessType
  2311. delete item.billDate;
  2312. delete item.accountDc;
  2313. }
  2314. return item;
  2315. });
  2316. }
  2317. finstlbillsSubmit(this.form)
  2318. .then(res => {
  2319. this.$message.success("操作成功");
  2320. this.finstlbillsDetailfun(res.data.data.id, type);
  2321. })
  2322. .catch(() => {
  2323. this.saveLoading = false;
  2324. });
  2325. }
  2326. });
  2327. },
  2328. // 详情接口
  2329. finstlbillsDetailfun(id, type) {
  2330. this.activeName = "2";
  2331. this.pageLoading = true;
  2332. finstlbillsDetail(id)
  2333. .then(res => {
  2334. this.form = res.data.data;
  2335. if (
  2336. this.roleName.indexOf("admin") == -1
  2337. ? this.roleName.indexOf("允许修改他人业务") == -1
  2338. ? this.saberUserInfo.user_id != this.form.createUser
  2339. : false
  2340. : false
  2341. ) {
  2342. this.editPower = true;
  2343. } else {
  2344. this.editPower = false;
  2345. }
  2346. this.tableData = this.form.finStlBillsItemsList.map(item => {
  2347. item.stlTtlAmountNet = Number(item.stlTtlAmount) - Number(item.stlTtlAmount) * (Number(item.taxRate) + Number(item.surchargeRate));
  2348. item.currentStlAmountNet =
  2349. Number(item.unsettledAmount) - Number(item.unsettledAmount) * (Number(item.taxRate) + Number(item.surchargeRate));
  2350. if (item.curCode == "CNY") {
  2351. this.$set(item, "currentInvoiceAmountRMB", item.currentInvoiceAmount);
  2352. this.$set(item, "amountRMB", item.amount);
  2353. this.$set(item, "amountNetRMB", item.amountNet);
  2354. this.$set(item, "stlTtlAmountRMB", item.stlTtlAmount);
  2355. this.$set(item, "stlTtlAmountNetRMB", item.stlTtlAmountNet);
  2356. this.$set(item, "currentStlAmountNetRMB", item.currentStlAmountNet);
  2357. this.$set(item, "currentStlAmountRMB", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  2358. this.$set(item, "currentStlAmountUSD", Number(0));
  2359. } else {
  2360. this.$set(item, "currentInvoiceAmountUSD", item.currentInvoiceAmount);
  2361. this.$set(item, "amountUSD", item.amount);
  2362. this.$set(item, "amountNetUSD", item.amountNet);
  2363. this.$set(item, "stlTtlAmountNetUSD", item.stlTtlAmountNet);
  2364. this.$set(item, "stlTtlAmountUSD", item.stlTtlAmount);
  2365. this.$set(item, "currentStlAmountNetUSD", item.currentStlAmountNet);
  2366. this.$set(item, "currentStlAmountUSD", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  2367. this.$set(item, "currentStlAmountRMB", Number(0));
  2368. }
  2369. if (item.srcIdInvoices) {
  2370. this.settlementdistar = true;
  2371. }
  2372. return item;
  2373. });
  2374. if (type == "选定行") {
  2375. this.finstlbillslistAccBillV1fun();
  2376. }
  2377. this.bcorpsbankListfun(); // 查银行数据
  2378. })
  2379. .finally(() => {
  2380. setTimeout(() => {
  2381. this.saveLoading = false;
  2382. }, 500);
  2383. this.pageLoading = false;
  2384. });
  2385. },
  2386. // 结算按钮
  2387. generateFinStlBillsfun(id, dc, type) {
  2388. this.activeName = "2";
  2389. let typeName = null;
  2390. this.generateStatus = true;
  2391. this.pageLoading = true;
  2392. this.settlementType = dc;
  2393. if (type == "CHK-D") {
  2394. typeName = "收费结算";
  2395. }
  2396. if (type == "CHK-C") {
  2397. typeName = "对账付款";
  2398. }
  2399. if (type == "FFSQ") {
  2400. typeName = "付费结算";
  2401. }
  2402. if (type == "DCDD") {
  2403. typeName = "收付相抵";
  2404. }
  2405. if (type == "XXFP") {
  2406. typeName = "销项发票";
  2407. }
  2408. if (type == "GZXZ") {
  2409. typeName = "其他结算";
  2410. }
  2411. generateFinStlBills({
  2412. billId: id,
  2413. dc: dc,
  2414. type: typeName
  2415. })
  2416. .then(res => {
  2417. res.data.data.finStlBillsItemsList = res.data.data.finStlBillsItemsList ? res.data.data.finStlBillsItemsList : [];
  2418. this.form = res.data.data;
  2419. this.tableData = this.form.finStlBillsItemsList.map(item => {
  2420. item.stlTtlAmountNet = Number(item.stlTtlAmount) - Number(item.stlTtlAmount) * (Number(item.taxRate) + Number(item.surchargeRate));
  2421. item.currentStlAmountNet =
  2422. Number(item.unsettledAmount) - Number(item.unsettledAmount) * (Number(item.taxRate) + Number(item.surchargeRate));
  2423. if (item.curCode == "CNY") {
  2424. this.$set(item, "currentInvoiceAmountRMB", item.currentInvoiceAmount);
  2425. this.$set(item, "amountRMB", item.amount);
  2426. this.$set(item, "amountNetRMB", item.amountNet);
  2427. this.$set(item, "stlTtlAmountRMB", item.stlTtlAmount);
  2428. this.$set(item, "stlTtlAmountNetRMB", item.stlTtlAmountNet);
  2429. this.$set(item, "currentStlAmountNetRMB", item.currentStlAmountNet);
  2430. this.$set(item, "currentStlAmountRMB", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  2431. this.$set(item, "currentStlAmountUSD", Number(0));
  2432. } else {
  2433. this.$set(item, "currentInvoiceAmountUSD", item.currentInvoiceAmount);
  2434. this.$set(item, "amountUSD", item.amount);
  2435. this.$set(item, "amountNetUSD", item.amountNet);
  2436. this.$set(item, "stlTtlAmountNetUSD", item.stlTtlAmountNet);
  2437. this.$set(item, "stlTtlAmountUSD", item.stlTtlAmount);
  2438. this.$set(item, "currentStlAmountNetUSD", item.currentStlAmountNet);
  2439. this.$set(item, "currentStlAmountUSD", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  2440. this.$set(item, "currentStlAmountRMB", Number(0));
  2441. }
  2442. if (item.srcIdInvoices) {
  2443. this.settlementdistar = true;
  2444. }
  2445. return item;
  2446. });
  2447. this.bcorpsbankListfun(); // 查银行数据
  2448. })
  2449. .finally(() => {
  2450. this.pageLoading = false;
  2451. });
  2452. },
  2453. // 重置条件
  2454. ResetFilter() {
  2455. this.form = {
  2456. dc: null,
  2457. billDate: dateFormat(new Date())
  2458. };
  2459. },
  2460. // 弹窗选择
  2461. retrievePopupsSelect(row) {
  2462. // this.form = row
  2463. this.$set(this.form, "corpId", row.id);
  2464. this.$set(this.form, "corpCnName", row.cnName);
  2465. this.$set(this.form, "corpEnName", row.enName);
  2466. this.$set(this.form, "corpArgreementNo", row.enName);
  2467. this.retrievePopupsType = false;
  2468. this.bcorpsbankListfun();
  2469. this.finstlbillslistAccBillV1fun('检索');
  2470. },
  2471. // 检索
  2472. retrievalfun() {
  2473. this.activeName = "1";
  2474. // 判断是否有对账单位
  2475. if (!this.form.corpId && (this.form.businessNo || this.form.accountNo || this.form.hblno || this.form.mblno)) {
  2476. console.log("新接口");
  2477. this.finstlbillslistAccBillByCorpfun();
  2478. } else {
  2479. if (!this.form.corpId) {
  2480. return this.$message.warning("请填写对账单位");
  2481. }
  2482. console.log("原来的接口");
  2483. this.finstlbillslistAccBillV1fun('检索');
  2484. }
  2485. },
  2486. // 检索弹窗数据
  2487. finstlbillslistAccBillByCorpfun() {
  2488. let obj = {};
  2489. obj.type = "2";
  2490. obj.curCode = this.form.curCode; // 币别
  2491. obj.dc = this.form.dc; // 收付 D=收 C=付
  2492. obj.accBillNo = this.form.accountNo; // 账单编号 ACCT NO
  2493. obj.billNo = this.form.businessNo; // 单据编号 JOB NO
  2494. obj.mblno = this.form.mblno; // MB/L NO
  2495. obj.hblno = this.form.hblno; // HB/L NO
  2496. obj.queryAmount = this.form.queryAmount; // 查询金额
  2497. obj.businessType = this.form.businessTypes; // 业务类型
  2498. obj.feeCnName = this.form.feeCnName;
  2499. obj.vesselCnName = this.form.vesselCnName; // 中文船名
  2500. obj.receivableAdvance = this.form.receivableAdvance; // 预收帐款
  2501. obj.voyageNo = this.form.voyageNo; // 航次
  2502. obj.signforDateList = this.form.signforDateList; // 签收日期
  2503. obj.auditStatus = "0";
  2504. obj.businessDateStart = this.form.businessDateStart; // 业务开始日期
  2505. obj.businessDateEnd = this.form.businessDateEnd; // 业务开始日期
  2506. finstlbillslistAccBillByCorp(obj).then(res => {
  2507. this.retrievePopupsType = true;
  2508. this.retrievePopupsData = res.data.data;
  2509. });
  2510. },
  2511. // 检索接口
  2512. finstlbillslistAccBillV1fun(type) {
  2513. // 对账单位
  2514. if (!this.form.corpId) {
  2515. this.$message.warning("请选择对账单位");
  2516. return;
  2517. }
  2518. let obj = {};
  2519. obj.type = "2";
  2520. obj.curCode = this.form.curCode; // 币别
  2521. obj.dc = this.form.dc; // 收付 D=收 C=付
  2522. obj.accBillNo = this.form.accountNo; // 账单编号 ACCT NO
  2523. obj.billNo = this.form.businessNo; // 单据编号 JOB NO
  2524. obj.mblno = this.form.mblno; // MB/L NO
  2525. obj.hblno = this.form.hblno; // HB/L NO
  2526. obj.queryAmount = this.form.queryAmount; // 查询金额
  2527. obj.businessType = this.form.businessTypes; // 业务类型
  2528. obj.feeCnName = this.form.feeCnName;
  2529. obj.vesselCnName = this.form.vesselCnName; // 中文船名
  2530. obj.receivableAdvance = this.form.receivableAdvance; // 预收帐款
  2531. obj.voyageNo = this.form.voyageNo; // 航次
  2532. obj.signforDateList = this.form.signforDateList; // 签收日期
  2533. obj.auditStatus = "0";
  2534. obj.businessDateStart = this.form.businessDateStart; // 业务开始日期
  2535. obj.businessDateEnd = this.form.businessDateEnd; // 业务开始日期
  2536. // 判断是否有对账单号
  2537. if (this.form.checkNo) {
  2538. obj.corpId = this.form.corpId; // 结算单位
  2539. obj.checkNo = this.form.checkNo; // CHK NO 对账单号
  2540. finstlbillsGetByDetail(obj).then(res => {
  2541. let arr = res.data.data.finStlBillsItemsList.map(item => {
  2542. delete item.id;
  2543. if (item.curCode == "CNY") {
  2544. // 发票
  2545. this.$set(item, "currentInvoiceAmountRMB", item.currentInvoiceAmount);
  2546. // 应结算金额
  2547. this.$set(item, "amountRMB", item.amount);
  2548. // 已结算金额
  2549. this.$set(item, "stlTtlAmountRMB", item.stlTtlAmount);
  2550. if (item.dc == "D") {
  2551. // 本次金额
  2552. this.$set(item, "currentStlAmountRMB", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  2553. } else {
  2554. // 本次金额
  2555. this.$set(item, "currentStlAmountRMB", Number(item.appliedCurrentStlAmount ? item.appliedCurrentStlAmount : 0));
  2556. }
  2557. this.$set(item, "currentStlAmountUSD", Number(0));
  2558. } else {
  2559. // 发票
  2560. this.$set(item, "currentInvoiceAmountUSD", item.currentInvoiceAmount);
  2561. // 应结算金额
  2562. this.$set(item, "amountUSD", item.amount);
  2563. // 已结算金额
  2564. this.$set(item, "stlTtlAmountUSD", item.stlTtlAmount);
  2565. // 本次金额
  2566. if (item.dc == "D") {
  2567. // 本次金额
  2568. this.$set(item, "currentStlAmountUSD", Number(item.currentStlAmount ? item.currentStlAmount : 0));
  2569. } else {
  2570. // 本次金额
  2571. this.$set(item, "currentStlAmountUSD", Number(item.appliedCurrentStlAmount ? item.appliedCurrentStlAmount : 0));
  2572. }
  2573. this.$set(item, "currentStlAmountRMB", Number(0));
  2574. }
  2575. return item;
  2576. });
  2577. if (type == "追加") {
  2578. // let a = [...this.queryData, ...arr];
  2579. // this.queryData = a.filter((obj, index) => {
  2580. // return (
  2581. // a.findIndex(elem => {
  2582. // return elem.accBillNo === obj.accBillNo;
  2583. // }) === index
  2584. // );
  2585. // });
  2586. this.queryData = [];
  2587. for (let item of arr) {
  2588. if (this.tableData.filter(row => row.accBillNo == item.accBillNo).length == 0) {
  2589. this.queryData.push(item);
  2590. }
  2591. }
  2592. } else {
  2593. // 获取有id 的数据
  2594. const itemsWithId = this.queryData.filter(item => item.hasOwnProperty("id"));
  2595. let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
  2596. // 有id 的处理
  2597. if (itemsWithId.length != 0) {
  2598. finstlbillsitemsRemove(arrIds.join(",")).then(res => {
  2599. this.$message.success("操作成功");
  2600. });
  2601. }
  2602. // if (arr.length == 0) {
  2603. // this.$message.warning("当前检索暂无数据!");
  2604. // }
  2605. this.queryData = [];
  2606. for (let item of arr) {
  2607. if (this.tableData.filter(row => row.accBillNo == item.accBillNo).length == 0) {
  2608. this.queryData.push(item);
  2609. }
  2610. }
  2611. if (this.queryData.length == 0&&type=='检索') {
  2612. this.$message.warning("当前检索暂无数据!");
  2613. }
  2614. }
  2615. });
  2616. } else {
  2617. obj.corpCnName = this.form.corpId; // 结算单位
  2618. obj.checkBillNo = this.form.checkNo; // CHK NO 对账单号
  2619. finstlbillslistAccBillV1(obj).then(res => {
  2620. let arr = res.data.data.map((item, index) => {
  2621. item.accBillId = item.id;
  2622. delete item.id;
  2623. // 账单编号
  2624. item.accBillNo = item.billNo;
  2625. item.currentStlCurCode = item.curCode; // 币别
  2626. item.currentStlExrate = item.exrate;
  2627. // isCleared
  2628. item.lineNo = Number(index) + 1;
  2629. item.pType = item.businessType;
  2630. item.billNo = item.businessBillDivideNo ? item.businessBillDivideNo : item.businessBillNo;
  2631. item.accDate = item.billDate;
  2632. item.dc = item.accountDc; // 收付
  2633. if (item.curCode == "CNY") {
  2634. // 发票
  2635. this.$set(item, "currentInvoiceAmountRMB", item.currentInvoiceAmount);
  2636. // 应结算金额
  2637. this.$set(item, "amountRMB", item.amount);
  2638. // 已结算金额
  2639. this.$set(item, "stlTtlAmountRMB", item.stlTtlAmount);
  2640. // 本次金额
  2641. if (item.dc == "D") {
  2642. // 本次金额
  2643. this.$set(item, "currentStlAmountRMB", Number(item.reconciliationCurrentAmount ? item.reconciliationCurrentAmount : 0));
  2644. } else {
  2645. // 本次金额
  2646. this.$set(item, "currentStlAmountRMB", Number(item.reconciliationCurrentAmount ? item.reconciliationCurrentAmount : 0));
  2647. }
  2648. this.$set(item, "currentStlAmountUSD", Number(0));
  2649. } else {
  2650. // 发票
  2651. this.$set(item, "currentInvoiceAmountUSD", item.currentInvoiceAmount);
  2652. // 应结算金额
  2653. this.$set(item, "amountUSD", item.amount);
  2654. // 已结算金额
  2655. this.$set(item, "stlTtlAmountUSD", item.stlTtlAmount);
  2656. // 本次金额
  2657. if (item.dc == "D") {
  2658. // 本次金额
  2659. this.$set(item, "currentStlAmountUSD", Number(item.reconciliationCurrentAmount ? item.reconciliationCurrentAmount : 0));
  2660. } else {
  2661. // 本次金额
  2662. this.$set(item, "currentStlAmountUSD", Number(item.reconciliationCurrentAmount ? item.reconciliationCurrentAmount : 0));
  2663. }
  2664. this.$set(item, "currentStlAmountRMB", Number(0));
  2665. }
  2666. return item;
  2667. });
  2668. if (type == "追加") {
  2669. // let a = [...this.queryData, ...arr];
  2670. // this.queryData = a.filter((obj, index) => {
  2671. // return (
  2672. // a.findIndex(elem => {
  2673. // return elem.accBillNo === obj.accBillNo;
  2674. // }) === index
  2675. // );
  2676. // });
  2677. this.queryData = [];
  2678. for (let item of arr) {
  2679. if (this.tableData.filter(row => row.accBillNo == item.accBillNo).length == 0) {
  2680. this.queryData.push(item);
  2681. }
  2682. }
  2683. } else {
  2684. // 获取有id 的数据
  2685. const itemsWithId = this.queryData.filter(item => item.hasOwnProperty("id"));
  2686. let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
  2687. // 有id 的处理
  2688. if (itemsWithId.length != 0) {
  2689. finstlbillsitemsRemove(arrIds.join(",")).then(res => {
  2690. this.$message.success("操作成功");
  2691. });
  2692. }
  2693. // if (arr.length == 0) {
  2694. // this.$message.warning("当前检索暂无数据!");
  2695. // }
  2696. this.queryData = [];
  2697. for (let item of arr) {
  2698. if (this.tableData.filter(row => row.accBillNo == item.accBillNo).length == 0) {
  2699. this.queryData.push(item);
  2700. }
  2701. }
  2702. if (this.queryData.length == 0&&type=='检索') {
  2703. this.$message.warning("当前检索暂无数据!");
  2704. }
  2705. }
  2706. });
  2707. }
  2708. },
  2709. // 结算确认
  2710. finstlbillsConfirmSettlementfun() {
  2711. this.pageLoading = true;
  2712. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2713. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2714. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  2715. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  2716. (this.form.url = "/iosBasicData/ComputationCenter/index"), (this.form.pageStatus = "this.$store.getters.SettlementCenterF");
  2717. this.form.pageLabel = "结算中心(F)";
  2718. finstlbillsConfirmSettlement(this.form)
  2719. .then(res => {
  2720. this.$message.success("操作成功");
  2721. this.finstlbillsDetailfun(res.data.data.id);
  2722. this.editSave = true;
  2723. })
  2724. .finally(() => {
  2725. this.pageLoading = false;
  2726. this.saveLoading = false;
  2727. });
  2728. },
  2729. // 生成凭证
  2730. generateVoucherfun() {
  2731. this.$confirm("确定要生成凭证?", {
  2732. confirmButtonText: "确定",
  2733. cancelButtonText: "取消",
  2734. type: "warning"
  2735. }).then(() => {
  2736. this.pageLoading = true;
  2737. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2738. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2739. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  2740. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  2741. finstlbillsGenerateVoucher(this.form)
  2742. .then(res => {
  2743. this.$message.success("操作成功");
  2744. this.finstlbillsDetailfun(this.form.id);
  2745. })
  2746. .finally(() => {
  2747. this.pageLoading = false;
  2748. });
  2749. });
  2750. },
  2751. // 结算撤销
  2752. finstlbillsRevokeSettlementfun() {
  2753. this.$confirm("确定进行撤销对账操作?", {
  2754. confirmButtonText: "确定",
  2755. cancelButtonText: "取消",
  2756. type: "warning"
  2757. }).then(() => {
  2758. this.pageLoading = true;
  2759. this.form.businessDateStart = this.form.businessDateStart ? this.form.businessDateStart.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2760. this.form.businessDateEnd = this.form.businessDateEnd ? this.form.businessDateEnd.slice(0, 10) + " 00:00:00" : null; // 财务开始日期
  2761. this.form.billDate = this.form.billDate ? this.form.billDate.slice(0, 10) + " 00:00:00" : null;
  2762. this.form.auditDateTo = this.form.auditDateTo ? this.form.auditDateTo.slice(0, 10) + " 00:00:00" : null;
  2763. finstlbillsRevokeSettlement(this.form)
  2764. .then(res => {
  2765. this.$message.success("操作成功");
  2766. this.finstlbillsDetailfun(res.data.data.id);
  2767. })
  2768. .finally(() => {
  2769. this.pageLoading = false;
  2770. this.saveLoading = false;
  2771. });
  2772. });
  2773. },
  2774. // 确认选定行
  2775. SelectedRows() {
  2776. this.editCustomer("选定行");
  2777. },
  2778. addSelectionChange(list) {
  2779. this.amountSubSum = 0;
  2780. this.amountDSubSum = 0;
  2781. this.amountCSubSum = 0;
  2782. this.amountSubUsdSum = 0;
  2783. this.amountDSubUsdSum = 0;
  2784. this.amountCSubUsdSum = 0;
  2785. if (list.length) {
  2786. list.forEach(e => {
  2787. console.log(e.accountDc);
  2788. if (e.dc == "D") {
  2789. this.amountDSubSum += Number(e.currentStlAmountRMB ? e.currentStlAmountRMB : 0);
  2790. this.amountDSubUsdSum += Number(e.currentStlAmountUSD ? e.currentStlAmountUSD : 0);
  2791. }
  2792. if (e.dc == "C") {
  2793. this.amountCSubSum += Number(e.currentStlAmountRMB ? e.currentStlAmountRMB : 0);
  2794. this.amountCSubUsdSum += Number(e.currentStlAmountUSD ? e.currentStlAmountUSD : 0);
  2795. }
  2796. });
  2797. }
  2798. this.amountSubSum = Number(this.amountDSubSum - this.amountCSubSum);
  2799. this.amountSubUsdSum = Number(this.amountDSubUsdSum - this.amountCSubUsdSum);
  2800. this.addData = list;
  2801. },
  2802. // 下面表格多选
  2803. handleSelectionChange(list) {
  2804. this.amountSubSum = 0;
  2805. this.amountDSubSum = 0;
  2806. this.amountCSubSum = 0;
  2807. this.amountSubUsdSum = 0;
  2808. this.amountDSubUsdSum = 0;
  2809. this.amountCSubUsdSum = 0;
  2810. if (list.length) {
  2811. list.forEach(e => {
  2812. if (e.dc == "D") {
  2813. this.amountDSubSum += Number(e.currentStlAmountRMB ? e.currentStlAmountRMB : 0);
  2814. this.amountDSubUsdSum += Number(e.currentStlAmountUSD ? e.currentStlAmountUSD : 0);
  2815. }
  2816. if (e.dc == "C") {
  2817. this.amountCSubSum += Number(e.currentStlAmountRMB ? e.currentStlAmountRMB : 0);
  2818. this.amountCSubUsdSum += Number(e.currentStlAmountUSD ? e.currentStlAmountUSD : 0);
  2819. }
  2820. });
  2821. }
  2822. this.amountSubSum = Number(this.amountDSubSum - this.amountCSubSum);
  2823. this.amountSubUsdSum = Number(this.amountDSubUsdSum - this.amountCSubUsdSum);
  2824. this.handleSelectionData = list;
  2825. },
  2826. //返回列表
  2827. backToList() {
  2828. this.$emit("goBack");
  2829. },
  2830. // 请求的接口
  2831. // 获取币别数据
  2832. getRateListfun(cnName) {
  2833. getRateList({ current: 1, size: 10, cnName }).then(res => {
  2834. this.curCodeData = res.data.data.records;
  2835. });
  2836. },
  2837. // 获取结算单位数据
  2838. corpBcorpsListfun(cnName) {
  2839. getBcorpslistByType(1, 10, { cnName }).then(res => {
  2840. this.corpData = res.data.data.records;
  2841. });
  2842. },
  2843. // 获取银行数据
  2844. bcorpsbankListfun() {
  2845. bcorpsbankList(1, 50, { pid: this.form.corpId }).then(res => {
  2846. this.bankData = res.data.data.records.map(item => {
  2847. item.accountBankNo = item.accountBank + " - " + item.accountNo;
  2848. return item;
  2849. });
  2850. if (this.bankData.length > 0) {
  2851. this.$set(this.form, "bankId", res.data.data.records[0].id);
  2852. this.$set(this.form, "bankAccountName", res.data.data.records[0].accountName);
  2853. this.$set(this.form, "bankAccountBank", res.data.data.records[0].accountBank);
  2854. this.$set(this.form, "bankAccountNo", res.data.data.records[0].accountNo);
  2855. }
  2856. if (this.bankData.length == 0) {
  2857. this.$set(this.form, "bankId", null);
  2858. this.$set(this.form, "bankAccountName", null);
  2859. this.$set(this.form, "bankAccountBank", null);
  2860. this.$set(this.form, "bankAccountNo", null);
  2861. }
  2862. });
  2863. },
  2864. // 预览报表
  2865. handleReportPreview(url, data) {
  2866. console.log(url, 1670);
  2867. console.log(data, 1671);
  2868. Stimulsoft.Base.StiLicense.key =
  2869. "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE";
  2870. // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
  2871. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile("/reports/stimulsoft/Localization/zh-CHS.xml", true, "zh-CHS");
  2872. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile("/reports/stimulsoft/Localization/zh-CHS.xml");
  2873. // 工具栏
  2874. var options = new Stimulsoft.Viewer.StiViewerOptions();
  2875. options.height = "100%";
  2876. options.appearance.scrollbarsMode = true; // 滚动条模式
  2877. options.toolbar.showDesignButton = false; // 显示设计按钮
  2878. options.toolbar.showAboutButton = false; // 显示关于按钮
  2879. options.toolbar.showResourcesButton = false; // 显示资源按钮
  2880. options.toolbar.showFullScreenButton = false; // 显示全屏按钮
  2881. options.toolbar.showOpenButton = false; // 显示打开按钮
  2882. options.appearance.showTooltips = false; // 显示工具提示
  2883. options.appearance.showDialogsHelp = false; // 显示对话框帮助
  2884. options.exports.showExportToDocument = false; // 显示导出到文档
  2885. options.toolbar.showParametersButton = true; // 显示参数按钮
  2886. options.appearance.bookmarksPrint = true; // 书签打印
  2887. // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
  2888. // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
  2889. // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
  2890. // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
  2891. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct;
  2892. // htmlRenderMode html渲染模式
  2893. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table;
  2894. // 是创建一个 Stimulsoft 报表查看器的实例的代码
  2895. let viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
  2896. // 报表
  2897. console.log("创建一个报表实例");
  2898. console.log();
  2899. let report = new window.Stimulsoft.Report.StiReport();
  2900. // 加载文件
  2901. console.log("从url加载报表");
  2902. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  2903. report.load(url);
  2904. data.pageOne = "Page : 1 of 1";
  2905. // 处理超长数据
  2906. if (data.hshipperDetails) {
  2907. var consignerIndex2 = data.hshipperDetails.indexOf("\n");
  2908. for (let i = 0; i < 4; i++) {
  2909. consignerIndex2 = data.hshipperDetails.indexOf("\n", consignerIndex2 + 1);
  2910. }
  2911. if (consignerIndex2 != -1) {
  2912. var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length);
  2913. data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + " *";
  2914. data.commodityDescr += "\n*" + hshipperDetails;
  2915. }
  2916. }
  2917. if (data.hconsigneeDetails) {
  2918. var consigneeIndex2 = data.hconsigneeDetails.indexOf("\n");
  2919. for (let i = 0; i < 3; i++) {
  2920. consigneeIndex2 = data.hconsigneeDetails.indexOf("\n", consigneeIndex2 + 1);
  2921. }
  2922. if (consigneeIndex2 != -1) {
  2923. var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length);
  2924. data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + " **";
  2925. data.commodityDescr += "\n**" + hconsigneeDetails;
  2926. }
  2927. }
  2928. if (data.hnotifyDetails) {
  2929. var notifierIndex2 = data.hnotifyDetails.indexOf("\n");
  2930. for (let i = 0; i < 3; i++) {
  2931. notifierIndex2 = data.hnotifyDetails.indexOf("\n", notifierIndex2 + 1);
  2932. }
  2933. if (notifierIndex2 != -1) {
  2934. var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length);
  2935. data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + " ***";
  2936. data.commodityDescr += "\n***" + hnotifyDetails;
  2937. }
  2938. }
  2939. // 处理箱号
  2940. if (this.isPrintTheBoxNumber) {
  2941. data.commodityDescr += "\n.\n.\n";
  2942. }
  2943. // PLACE & DATE OF ISSUE
  2944. data.placeAndDateOfIssue = "";
  2945. if (data.issueAt) {
  2946. data.placeAndDateOfIssue += data.issueAt;
  2947. }
  2948. if (data.issueDate) {
  2949. let date = new Date(data.issueDate.replace(/-/g, "/"));
  2950. let yyyy = date.getFullYear();
  2951. let mmmm = date.toDateString().split(" ")[1];
  2952. let dd = date.getDate();
  2953. data.placeAndDateOfIssue += ", " + dd + "-" + mmmm + "-" + yyyy;
  2954. }
  2955. // Total number of containers or packages received by the Carriers
  2956. if (data.preContainersList) {
  2957. let boxMap = new Map();
  2958. for (let boxQuantity of data.preContainersList) {
  2959. if (boxMap.get(boxQuantity.cntrTypeCode)) {
  2960. let v = boxMap.get(boxQuantity.cntrTypeCode);
  2961. boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity);
  2962. } else {
  2963. boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity);
  2964. }
  2965. }
  2966. let boxs = "";
  2967. boxMap.forEach(function(value, key, map) {
  2968. boxs += value + "x" + key + ", ";
  2969. });
  2970. boxs = boxs.substring(0, boxs.length - 2);
  2971. data.boxQuantity = boxs + " CONTAINER(S) ONLY";
  2972. }
  2973. // Number of original B/Ls
  2974. if (data.numberOfObl) {
  2975. data.numberOfObl += " (" + data.numberOfOblDigit + ")";
  2976. }
  2977. if (data.commodityDescr) {
  2978. var descriptionIndex2 = data.commodityDescr.indexOf("\n");
  2979. for (let i = 0; i < 19; i++) {
  2980. descriptionIndex2 = data.commodityDescr.indexOf("\n", descriptionIndex2 + 1);
  2981. }
  2982. if (descriptionIndex2 != -1) {
  2983. data.pageOne = "Page : 1 of 2";
  2984. data.pageTwo = "Page : 2 of 2";
  2985. var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length);
  2986. data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2);
  2987. data.extraLongTips = "** TO BE CONTINUED ON ATTACHED LIST **";
  2988. data.extraLongText = extraLongText;
  2989. }
  2990. }
  2991. // console.log(data.hshipperDetails, 'hshipperDetails2')
  2992. // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
  2993. var dataSet = new Stimulsoft.System.Data.DataSet("reportData");
  2994. dataSet.readJson(data); // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
  2995. // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
  2996. // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
  2997. report.regData("reportData", "reportData", dataSet);
  2998. // 从模版和数据加载报表
  2999. // loadReport(report, '', {})
  3000. // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
  3001. viewer.report = report;
  3002. this.$refs.reportContainer.showContainer(
  3003. () => {
  3004. setTimeout(() => {
  3005. viewer.renderHtml("reportContainer");
  3006. this.createViewerButtons(viewer);
  3007. }, 50);
  3008. },
  3009. () => {}
  3010. );
  3011. console.log("加载成功完成!");
  3012. },
  3013. createViewerButtons(viewer) {
  3014. viewer.jsObject.collections.images["myClose.png"] =
  3015. "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg==";
  3016. const closeBtn = viewer.jsObject.SmallButton("closeBtn", "关闭", "myClose.png");
  3017. // 增加打印弹窗配置
  3018. const printBtn = viewer.jsObject.SmallButton("printBtn", "打印报表", "myClose.png");
  3019. // console.log(viewer.jsObject.print(),'1013')
  3020. // 获取 关闭按钮的dom元素位置
  3021. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild;
  3022. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild;
  3023. const userButtonCell = buttonsTable.rows[0].insertCell(0);
  3024. // 获取打印按钮的位置
  3025. const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild; // 打印按钮
  3026. const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0]; // 打印按钮dom位置
  3027. userButtonPrint.addEventListener("click", event => {
  3028. console.log("打印点击");
  3029. // event.preventDefault()
  3030. });
  3031. userButtonPrint.addEventListener("mouseover", event => {
  3032. console.log("移入打印按钮");
  3033. console.log(event, 1035);
  3034. });
  3035. userButtonCell.className = "stiJsViewerClearAllStyles";
  3036. userButtonCell.appendChild(closeBtn); // 添加关闭节点
  3037. // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
  3038. let that = this;
  3039. // 关闭按钮的监听点击
  3040. closeBtn.action = function() {
  3041. console.log(that.$refs.ReportContainer, "1022");
  3042. if (that.$refs.reportContainer) that.$refs.reportContainer.hideContainer();
  3043. };
  3044. // // // 打印按钮监听
  3045. // printBtn.action = (e)=>{
  3046. // console.log('打印')
  3047. // window.print()
  3048. // }
  3049. }
  3050. }
  3051. };
  3052. </script>
  3053. <style scoped>
  3054. ::v-deep.el-form-item {
  3055. margin-bottom: 0;
  3056. }
  3057. .bottomFlex {
  3058. display: flex;
  3059. align-items: center;
  3060. }
  3061. .weightfont {
  3062. font-size: 20px;
  3063. font-weight: bold;
  3064. }
  3065. .weightnum {
  3066. font-size: 18px;
  3067. font-weight: 500;
  3068. }
  3069. /deep/.el-dialog .el-dialog__body {
  3070. padding: 0px 20px;
  3071. }
  3072. ::v-deep .el-form-item__error {
  3073. display: none;
  3074. }
  3075. </style>