feecenter.vue 124 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569
  1. <template>
  2. <div>
  3. <div>
  4. <el-form :model="assemblyForm" ref="form" label-width="90px" style="margin-bottom: 4px" class="demo-ruleForm">
  5. <el-row :gutter="10">
  6. <el-col :span="6">
  7. <el-form-item label="客户名称" prop="corpCnName" >
  8. <span slot="label">
  9. <span style="color: #1e9fff">客户名称</span>
  10. </span>
  11. <el-input type="age" style="width: 100%;" v-model="assemblyForm.corpCnName"
  12. size="small" autocomplete="off"
  13. disabled
  14. clearable placeholder="客户名称" ></el-input>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="6">
  18. <el-form-item label="提单号" prop="mblno" >
  19. <span slot="label">
  20. <span style="color: #1e9fff">提单号</span>
  21. </span>
  22. <el-input type="age" style="width: 100%;" v-model="assemblyForm.mblno"
  23. size="small" autocomplete="off"
  24. disabled
  25. clearable placeholder="提单号" ></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="6">
  29. <el-form-item label="箱型箱量" prop="containers" >
  30. <span slot="label">
  31. <span style="color: #1e9fff">箱型箱量</span>
  32. </span>
  33. <el-input type="age" style="width: 100%;" v-model="assemblyForm.quantityCntrDescr"
  34. size="small" autocomplete="off"
  35. disabled
  36. clearable placeholder="箱型箱量" ></el-input>
  37. </el-form-item>
  38. </el-col>
  39. </el-row>
  40. </el-form>
  41. </div>
  42. <!--显示 admin,应收修改,应收查看,应收查看只有打印账单一个功能 -->
  43. <el-card v-show="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1?true:roleName.indexOf('应收查看') != -1" class="box-card">
  44. <avue-crud :option="optionD"
  45. :table-loading="loadingD"
  46. :data="assemblyForm.feeCenterListD"
  47. v-model="formD"
  48. id="out-table"
  49. :header-cell-class-name="headerClassName"
  50. ref="crud"
  51. :row-style="{height:'20px'}"
  52. :cell-style="{padding:'0px'}"
  53. @selection-change="handleSelectionChange($event,'D')"
  54. @resetColumn="resetColumnTwo('crud', 'optionD', 'optionDBack', 309.2)"
  55. @saveColumn="saveColumnTwo('crud', 'optionD', 'optionDBack', 309.2)" >
  56. <template slot="menuLeft">
  57. <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
  58. <i class="el-icon-coin"></i>
  59. <span>应收费用</span>
  60. </div>
  61. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1"
  62. type="danger" plain size="small"
  63. :disabled="!selectionDList.length || detailData.seeDisabled || pleasereviewType"
  64. @click="batchDelete('D')">一键删除
  65. </el-button>
  66. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1"
  67. type="success" plain size="small"
  68. :disabled="!selectionDList.length || detailData.seeDisabled || pleasereviewType"
  69. @click="GenerateBillsfun('D')">生成账单
  70. </el-button>
  71. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1"
  72. type="danger" plain size="small"
  73. :disabled="!selectionDList.length || detailData.seeDisabled || pleasereviewType"
  74. @click="RevokingBillsfun('D')">撤销账单
  75. </el-button>
  76. <el-button type="primary" plain size="small" @click="printingCostsfun('D')">打印账单</el-button>
  77. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1"
  78. type="success" plain size="small"
  79. :disabled="!this.assemblyForm.id || detailData.seeDisabled || pleasereviewType"
  80. @click="templateClick('D')">应收模板</el-button>
  81. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1"
  82. type="info" plain size="small" :disabled="detailData.seeDisabled || pleasereviewType"
  83. @click="feecenterSubmitListfun">一键保存</el-button>
  84. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1"
  85. type="info" plain size="small"
  86. :disabled="detailData.seeDisabled || pleasereviewType"
  87. @click="feecenterEditfun('D')">一键编辑
  88. </el-button>
  89. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1"
  90. type="primary" plain size="small"
  91. :disabled="detailData.seeDisabled || pleasereviewType"
  92. @click="copyfun('D')">生成应付</el-button>
  93. </template>
  94. <template slot="indexHeader" slot-scope="scope">
  95. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应收修改') != -1"
  96. type="primary" size="small" icon="el-icon-plus" circle
  97. :disabled="detailData.seeDisabled || pleasereviewType"
  98. @click="addDfun"></el-button>
  99. </template>
  100. <template slot="index" slot-scope="scope">
  101. <span>{{scope.index + 1}}</span>
  102. </template>
  103. <template slot="accStatus" slot-scope="{row,size}">
  104. <span>{{row.accStatus?'是':'否'}}</span>
  105. </template>
  106. <template slot="corpCnName" slot-scope="{ row }">
  107. <search-query v-if="row.edit"
  108. :datalist="corpCnNameData"
  109. :selectValue="row.corpCnName"
  110. :filterable="true"
  111. :clearable="true"
  112. :remote="true"
  113. :buttonIf="false"
  114. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  115. @remoteMethod="getBcorpsListfun($event,'corpCnName')"
  116. @corpChange="corpChange($event,'corpCnName',row,'D')"
  117. @corpFocus="getBcorpsListfun($event,'corpCnName')" >
  118. </search-query>
  119. <span v-else style="color: #1e9fff" @click="corpClick(row)">{{row.corpCnName}}</span>
  120. </template>
  121. <template slot="feeCnName" slot-scope="{ row }">
  122. <search-query v-if="row.edit"
  123. :datalist="feeCnNameData"
  124. :selectValue="row.feeCnName"
  125. :filterable="true"
  126. :clearable="true"
  127. :remote="true"
  128. :buttonIf="false"
  129. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  130. @remoteMethod="bfeesListfun($event,'feeCnName')"
  131. @corpChange="corpChange($event,'feeCnName',row,'D')"
  132. @corpFocus="bfeesListfun($event,'feeCnName')" >
  133. </search-query>
  134. <span v-else >{{row.feeCnName}}</span>
  135. </template>
  136. <template slot="elementsCnName" slot-scope="{ row }">
  137. <search-query v-if="row.edit"
  138. :datalist="elementsData"
  139. :selectValue="row.elementsCnName"
  140. :filterable="true"
  141. :clearable="true"
  142. :remote="true"
  143. :buttonIf="false"
  144. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  145. @remoteMethod="getBaccelementsListfun($event,'elementsCnName')"
  146. @corpChange="corpChange($event,'elementsCnName',row,'D')"
  147. @corpFocus="getBaccelementsListfun($event,'elementsCnName')" >
  148. </search-query>
  149. <span v-else >{{row.elementsCnName}}</span>
  150. </template>
  151. <template slot="paymode" slot-scope="{ row }">
  152. <search-query v-if="row.edit"
  153. :datalist="paymodeData"
  154. :selectValue="row.paymode"
  155. :clearable="true"
  156. :buttonIf="false"
  157. :forParameter="{key:'dictKey',label:'dictValue',value:'dictKey'}"
  158. @corpChange="corpChange($event,'paymode',row,'D')"
  159. @corpFocus="paymodeWorkDictsfun" >
  160. </search-query>
  161. <span v-else>{{row.paymode}}</span>
  162. </template>
  163. <template slot="unitNo" slot-scope="{ row }">
  164. <search-query v-if="row.edit"
  165. :datalist="unitNoData"
  166. :selectValue="row.unitNo"
  167. :filterable="true"
  168. :clearable="true"
  169. :remote="true"
  170. :buttonIf="false"
  171. :forParameter="{key:'id',label:'code',value:'code',disabled:'status'}"
  172. @corpFocus="getBunitsPagefun"
  173. @corpChange="corpChange($event,'unitNo',row,'D')" >
  174. </search-query>
  175. <span v-else>{{row.unitNo}}</span>
  176. </template>
  177. <template slot="curCode" slot-scope="{ row }">
  178. <search-query v-if="row.edit"
  179. :datalist="curCodeData"
  180. :selectValue="row.curCode"
  181. :filterable="true"
  182. :clearable="true"
  183. :remote="true"
  184. :buttonIf="false"
  185. :forParameter="{key:'id',label:'code',value:'code'}"
  186. @remoteMethod="bcurrencyGetExratefun('D')"
  187. @corpChange="corpChange($event,'curCode',row,'D')"
  188. @corpFocus="bcurrencyGetExratefun('D')" >
  189. </search-query>
  190. <span v-else>{{row.curCode}}</span>
  191. </template>
  192. <template slot="isTax" slot-scope="{row}">
  193. <span>{{row.isTax?'是':'否'}}</span>
  194. </template>
  195. <template slot="price" slot-scope="{ row }">
  196. <el-input-number v-if="row.edit" v-model="row.price" size="small"
  197. :controls="false" :precision="2"
  198. placeholder="请输入" @blur="priceinputfun($event,row)"></el-input-number>
  199. <span v-else>{{row.price}}</span>
  200. </template>
  201. <template slot="quantity" slot-scope="{ row }">
  202. <el-input-number v-if="row.edit" v-model="row.quantity" size="small" :min="1"
  203. :controls="false" :precision="0"
  204. placeholder="请输入" @blur="quantityinputfun(row)"></el-input-number>
  205. <span v-else>{{row.quantity}}</span>
  206. </template>
  207. <template slot="remarks" slot-scope="{ row }">
  208. <el-input v-if="row.edit" v-model="row.remarks" size="small"
  209. placeholder="请输入" ></el-input>
  210. <span v-else>{{row.remarks}}</span>
  211. </template>
  212. <template slot-scope="scope" slot="menu">
  213. <!--<el-button v-if="scope.row.edit" type="text" size="small" @click="savefun(scope.row,scope.index,'D')">保存</el-button>-->
  214. <!--<el-button v-else type="text" size="small" :disabled="scope.row.accStatus || detailData.seeDisabled || pleasereviewType" @click="editDfun(scope.row,scope.index)">编辑</el-button>-->
  215. <el-button type="text" size="small" :disabled="scope.row.accStatus || detailData.seeDisabled || pleasereviewType" @click="deletefun(scope.row,scope.index,'D')">删除</el-button>
  216. </template>
  217. </avue-crud>
  218. </el-card>
  219. <!--显示 admin,应付修改,应付查看,应付查看只有打印账单一个功能 -->
  220. <el-card v-show="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1?true:roleName.indexOf('应付查看') != -1" class="box-card" style="margin: 20px 0">
  221. <avue-crud :option="optionC"
  222. :table-loading="loadingC"
  223. :data="assemblyForm.feeCenterListC"
  224. v-model="formC"
  225. id="out-table"
  226. :header-cell-class-name="headerClassName"
  227. ref="crud"
  228. :row-style="{height:'20px'}"
  229. :cell-style="{padding:'0px'}"
  230. @selection-change="handleSelectionChange($event,'C')"
  231. @resetColumn="resetColumnTwo('crud', 'optionC', 'optionCBack', 309.3)"
  232. @saveColumn="saveColumnTwo('crud', 'optionC', 'optionCBack', 309.3)" >
  233. <template slot="menuLeft">
  234. <div style="display: inline-block;margin-right: 20px" class="disabledBox meetSize">
  235. <i class="el-icon-coin"></i>
  236. <span>应付费用</span>
  237. </div>
  238. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1"
  239. type="danger" plain size="small"
  240. :disabled="!selectionCList.length || detailData.seeDisabled || pleasereviewType"
  241. @click="batchDelete('C')">一键删除
  242. </el-button>
  243. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1"
  244. type="primary" plain size="small"
  245. :disabled="!selectionCList.length || detailData.seeDisabled || pleasereviewType"
  246. @click="GenerateBillsfun('C')" >生成账单
  247. </el-button>
  248. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1"
  249. type="danger" plain size="small"
  250. :disabled="!selectionCList.length || detailData.seeDisabled || pleasereviewType"
  251. @click="RevokingBillsfun('C')">撤销账单
  252. </el-button>
  253. <el-button type="primary" plain size="small" @click="printingCostsfun('C')">打印账单</el-button>
  254. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1"
  255. type="success" plain size="small"
  256. :disabled="!this.assemblyForm.id || detailData.seeDisabled || pleasereviewType"
  257. @click="templateClick('C')">应付模板
  258. </el-button>
  259. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1"
  260. type="info" plain size="small"
  261. :disabled="detailData.seeDisabled || pleasereviewType"
  262. @click="feecenterSubmitListfun">一键保存
  263. </el-button>
  264. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1"
  265. type="info" plain size="small"
  266. :disabled="detailData.seeDisabled || pleasereviewType"
  267. @click="feecenterEditfun('C')">一键编辑
  268. </el-button>
  269. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1"
  270. type="primary" plain size="small"
  271. :disabled="detailData.seeDisabled || pleasereviewType"
  272. @click="copyfun('C')">生成应收
  273. </el-button>
  274. </template>
  275. <template slot="indexHeader" slot-scope="scope">
  276. <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1"
  277. type="primary" size="small" icon="el-icon-plus" circle
  278. :disabled="detailData.seeDisabled || pleasereviewType"
  279. @click="addCfun">
  280. </el-button>
  281. </template>
  282. <template slot="index" slot-scope="scope">
  283. <span>{{scope.index + 1}}</span>
  284. </template>
  285. <template slot="accStatus" slot-scope="{row,size}">
  286. <span>{{row.accStatus?'是':'否'}}</span>
  287. </template>
  288. <template slot="corpCnName" slot-scope="{ row }">
  289. <search-query v-if="row.edit"
  290. :datalist="corpCnNameData"
  291. :selectValue="row.corpCnName"
  292. :filterable="true"
  293. :clearable="true"
  294. :remote="true"
  295. :buttonIf="false"
  296. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  297. @remoteMethod="getBcorpsListfun($event,'corpCnName')"
  298. @corpChange="corpChange($event,'corpCnName',row,'C')"
  299. @corpFocus="getBcorpsListfun($event,'corpCnName')" >
  300. </search-query>
  301. <span v-else style="color: #1e9fff" @click="corpClick(row)">{{row.corpCnName}}</span>
  302. </template>
  303. <template slot="feeCnName" slot-scope="{ row }">
  304. <search-query v-if="row.edit"
  305. :datalist="feeCnNameData"
  306. :selectValue="row.feeCnName"
  307. :filterable="true"
  308. :clearable="true"
  309. :remote="true"
  310. :buttonIf="false"
  311. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  312. @remoteMethod="bfeesListfun($event,'feeCnName')"
  313. @corpChange="corpChange($event,'feeCnName',row,'C')"
  314. @corpFocus="bfeesListfun($event,'feeCnName')" >
  315. </search-query>
  316. <span v-else>{{row.feeCnName}}</span>
  317. </template>
  318. <template slot="elementsCnName" slot-scope="{ row }">
  319. <search-query v-if="row.edit"
  320. :datalist="elementsData"
  321. :selectValue="row.elementsCnName"
  322. :filterable="true"
  323. :clearable="true"
  324. :remote="true"
  325. :buttonIf="false"
  326. :forParameter="{key:'id',label:'cnName',value:'cnName'}"
  327. @remoteMethod="getBaccelementsListfun($event,'elementsCnName')"
  328. @corpChange="corpChange($event,'elementsCnName',row,'C')"
  329. @corpFocus="getBaccelementsListfun($event,'elementsCnName')" >
  330. </search-query>
  331. <span v-else >{{row.elementsCnName}}</span>
  332. </template>
  333. <template slot="paymode" slot-scope="{ row }">
  334. <search-query v-if="row.edit"
  335. :datalist="paymodeData"
  336. :selectValue="row.paymode"
  337. :clearable="true"
  338. :buttonIf="false"
  339. :forParameter="{key:'dictKey',label:'dictValue',value:'dictKey'}"
  340. @corpChange="corpChange($event,'paymode',row,'C')"
  341. @corpFocus="paymodeWorkDictsfun" >
  342. </search-query>
  343. <span v-else>{{row.paymode}}</span>
  344. </template>
  345. <template slot="unitNo" slot-scope="{ row }">
  346. <search-query v-if="row.edit"
  347. :datalist="unitNoData"
  348. :selectValue="row.unitNo"
  349. :filterable="true"
  350. :clearable="true"
  351. :remote="true"
  352. :buttonIf="false"
  353. :forParameter="{key:'id',label:'code',value:'code',disabled:'status'}"
  354. @corpFocus="getBunitsPagefun"
  355. @corpChange="corpChange($event,'unitNo',row,'C')">
  356. </search-query>
  357. <span v-else>{{row.unitNo}}</span>
  358. </template>
  359. <template slot="curCode" slot-scope="{ row }">
  360. <search-query v-if="row.edit"
  361. :datalist="curCodeData"
  362. :selectValue="row.curCode"
  363. :filterable="true"
  364. :clearable="true"
  365. :remote="true"
  366. :buttonIf="false"
  367. :forParameter="{key:'id',label:'code',value:'code'}"
  368. @remoteMethod="bcurrencyGetExratefun('C')"
  369. @corpChange="corpChange($event,'curCode',row,'C')"
  370. @corpFocus="bcurrencyGetExratefun('C')" >
  371. </search-query>
  372. <span v-else>{{row.curCode}}</span>
  373. </template>
  374. <template slot="isTax" slot-scope="{row}">
  375. <span>{{row.isTax?'是':'否'}}</span>
  376. </template>
  377. <template slot="price" slot-scope="{ row }">
  378. <el-input-number v-if="row.edit" v-model="row.price" size="small"
  379. :controls="false" :precision="2"
  380. placeholder="请输入" @blur="priceinputfun($event,row)"></el-input-number>
  381. <span v-else>{{row.price}}</span>
  382. </template>
  383. <template slot="quantity" slot-scope="{ row }">
  384. <el-input-number v-if="row.edit" type="number" v-model="row.quantity" size="small" :min="1"
  385. :controls="false" :precision="0"
  386. placeholder="请输入" @blur="quantityinputfun(row)"></el-input-number>
  387. <span v-else>{{row.quantity}}</span>
  388. </template>
  389. <template slot="remarks" slot-scope="{ row }">
  390. <el-input v-if="row.edit" v-model="row.remarks" size="small"
  391. placeholder="请输入" ></el-input>
  392. <span v-else>{{row.remarks}}</span>
  393. </template>
  394. <template slot-scope="scope" slot="menu">
  395. <!--<el-button v-if="scope.row.edit" type="text" size="small" @click="savefun(scope.row,scope.index,'C')">保存</el-button>-->
  396. <!--<el-button v-else type="text" size="small" :disabled="scope.row.accStatus || detailData.seeDisabled || pleasereviewType" @click="editCfun(scope.row,scope.index)">编辑</el-button>-->
  397. <el-button type="text" size="small" :disabled="scope.row.accStatus || detailData.seeDisabled || pleasereviewType" @click="deletefun(scope.row,scope.index,'C')">删除</el-button>
  398. </template>
  399. </avue-crud>
  400. </el-card>
  401. <!--有admin 显示,有收和付各一个也显示出来-->
  402. <div v-if="roleName.indexOf('admin') != -1 || ((roleName.indexOf('应收修改') != -1 || roleName.indexOf('应收查看') != -1) && (roleName.indexOf('应付修改') != -1 ||roleName.indexOf('应付查看') != -1))" style="display: flex;align-items: center;justify-content: space-around">
  403. <div style="width: 30%">
  404. <div class="bottomFlex" style="justify-content: space-around">
  405. <div style="text-align: center">
  406. <div class="weightfont">¥</div>
  407. <div>CNY</div>
  408. </div>
  409. <div>
  410. <div style="color: #81B337">
  411. <span>应收:</span>
  412. <span class="weightnum">¥{{assemblyForm.amountDr}}元</span>
  413. </div>
  414. <div style="color: #6BBCD1">
  415. <span>应付:</span>
  416. <span class="weightnum">¥{{assemblyForm.amountCr}}元</span>
  417. </div>
  418. </div>
  419. <div class="bottomFlex">
  420. <span>利润</span>
  421. <span>¥{{assemblyForm.amountProfit}}元</span>
  422. </div>
  423. </div>
  424. </div>
  425. <div style="width: 30%">
  426. <div class="bottomFlex" style="justify-content: space-around">
  427. <div style="text-align: center">
  428. <div class="weightfont">$</div>
  429. <div>USD</div>
  430. </div>
  431. <div>
  432. <div style="color: #81B337">
  433. <span>应收:</span>
  434. <span class="weightnum">${{assemblyForm.amountDrUsd}}元</span>
  435. </div>
  436. <div style="color: #6BBCD1">
  437. <span>应付:</span>
  438. <span class="weightnum">${{assemblyForm.amountCrUsd}}元</span>
  439. </div>
  440. </div>
  441. <div class="bottomFlex">
  442. <span>利润</span>
  443. <span>${{assemblyForm.amountProfitUsd}}元</span>
  444. </div>
  445. </div>
  446. </div>
  447. <div style="width: 30%">
  448. <div class="bottomFlex" style="justify-content: space-around">
  449. <div style="text-align: center">
  450. <div class="weightfont">¥</div>
  451. <div>CNY合计</div>
  452. </div>
  453. <div>
  454. <div style="color: #81B337">
  455. <span>应收:</span>
  456. <span class="weightnum">¥{{assemblyForm.amountDrLoc}}元</span>
  457. </div>
  458. <div style="color: #6BBCD1">
  459. <span>应付:</span>
  460. <span class="weightnum">¥{{assemblyForm.amountCrLoc}}元</span>
  461. </div>
  462. </div>
  463. <div class="bottomFlex">
  464. <span>利润</span>
  465. <span>¥{{assemblyForm.amountProfitLoc}}元</span>
  466. </div>
  467. </div>
  468. </div>
  469. </div>
  470. <!--模板弹窗-->
  471. <el-dialog
  472. title="提示"
  473. :visible.sync="templateVisible"
  474. append-to-body
  475. width="70%"
  476. :close-on-click-modal="false"
  477. :before-close="handleClose">
  478. <div>
  479. <el-row>
  480. <el-col :span="5">
  481. <div class="box">
  482. <el-scrollbar>
  483. <basic-container>
  484. <avue-tree :option="treeOption" :data="templateData" @node-click="nodeClick">
  485. </avue-tree>
  486. </basic-container>
  487. </el-scrollbar>
  488. </div>
  489. </el-col>
  490. <el-col :span="19">
  491. <basic-container>
  492. <avue-crud :option="templateOption"
  493. :data="templateRightData"
  494. ref="templateRef"
  495. @selection-change="feeselectionChange"
  496. @resetColumn="resetColumnTwo('templateRef', 'templateOption', 'templateOptionBack', 309.5)"
  497. @saveColumn="saveColumnTwo('templateRef', 'templateOption', 'templateOptionBack', 309.5)">
  498. <template slot="menuLeft">
  499. <el-button type="primary" size="small" @click="templateExport">导 入</el-button>
  500. </template>
  501. </avue-crud>
  502. </basic-container>
  503. </el-col>
  504. </el-row>
  505. </div>
  506. <span slot="footer" class="dialog-footer">
  507. <el-button @click="templateVisible = false;feesselectionList = [];templateRightData = []">取 消</el-button>
  508. <el-button type="primary" @click="templateExport">导 入</el-button>
  509. </span>
  510. </el-dialog>
  511. <!--往来单位弹窗-->
  512. <el-dialog
  513. title="提示"
  514. :visible.sync="corpVisible"
  515. append-to-body
  516. width="70%"
  517. :close-on-click-modal="false"
  518. :before-close="handleClose">
  519. <div style="padding-bottom: 30px;" >
  520. <el-table
  521. :data="corpDialog"
  522. border
  523. size="mini"
  524. :row-style="{height:'20px',padding:'0px',fontSize:'12px'}"
  525. :cell-style="{padding:'0px',fontSize:'12px'}"
  526. style="width: 100%">
  527. <el-table-column prop="corpCnName" label="客户名称" width="140px" >
  528. <template slot-scope="{ row }">
  529. <span class="textoverflow">{{row.corpCnName}}</span>
  530. </template>
  531. </el-table-column>
  532. <el-table-column prop="mblno" label="MB/L NO" width="140px" />
  533. <el-table-column prop="amountDr" label="应收金额" />
  534. <el-table-column prop="amountCr" label="应付金额" />
  535. <el-table-column prop="amountDrUsd" label="应收金额USD" width="140px" />
  536. <el-table-column prop="amountCrUsd" label="应付金额USD" width="140px" />
  537. <el-table-column prop="amountDrLoc" label="应收金额合计" width="140px" />
  538. <el-table-column prop="amountCrLoc" label="应付金额合计" width="140px" />
  539. <el-table-column prop="stlAmountDr" label="已结算应收金额" width="140px" />
  540. <el-table-column prop="stlAmountCr" label="已结算应付金额" width="140px" />
  541. <el-table-column prop="stlAmountDrUsd" label="已结算应收金额USD" width="140px" />
  542. <el-table-column prop="stlAmountCrUsd" label="已结算应付金额USD" width="140px" />
  543. <el-table-column prop="stlAmountDrLoc" label="已结算应收金额合计" width="140px" />
  544. <el-table-column prop="stlAmountCrLoc" label="已结算应付金额合计" width="140px" />
  545. </el-table>
  546. </div>
  547. </el-dialog>
  548. <!--往来单位弹窗-->
  549. <el-dialog
  550. title="打印"
  551. :visible.sync="printingDialog"
  552. append-to-body
  553. width="70%"
  554. :close-on-click-modal="false"
  555. :before-close="handleClose">
  556. <div>
  557. <el-row :gutter="10">
  558. <el-col :span="4">
  559. <avue-tree :option="reportOption" :data="reportTypeData" @node-click="reportNodeClick"></avue-tree>
  560. </el-col>
  561. <el-col :span="20">
  562. <avue-crud :option="optionPrinting"
  563. :table-loading="printingLoading"
  564. :data="PrintingData"
  565. id="out-table"
  566. :header-cell-class-name="headerClassName"
  567. :row-style="{height:'20px'}"
  568. :cell-style="{padding:'0px'}">
  569. <template slot-scope="scope" slot="menu">
  570. <el-button type="text" size="small" @click="dialogPreviewfun(scope.row)">打印预览</el-button>
  571. </template>
  572. </avue-crud>
  573. </el-col>
  574. </el-row>
  575. </div>
  576. <span slot="footer" class="dialog-footer">
  577. <el-button size="small" @click="printingDialog = false;">取 消</el-button>
  578. </span>
  579. </el-dialog>
  580. <el-dialog
  581. title="打印"
  582. :visible.sync="selectPrintingDialog"
  583. append-to-body
  584. width="70%"
  585. :close-on-click-modal="false"
  586. :before-close="handleClose">
  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. </div>
  597. </template>
  598. <script>
  599. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  600. import {getBcorpsList} from "@/api/iosBasicData/bcorps";
  601. import {bfeesList} from "@/api/iosBasicData/bfees";
  602. import {getBunitsPage} from "@/api/iosBasicData/bunits";
  603. import {bcurrencyGetExrate} from "@/api/iosBasicData/rateManagement";
  604. import {
  605. feecenterList,
  606. feecenterRemove,
  607. feecenterSubmit, feecenterSubmitList,
  608. finaccbillsGenerateBill, finaccbillsRevokeBill,getFeeCenterCorpIds
  609. } from "@/api/iosBasicData/feecenter";
  610. import {getWorkDicts} from "@/api/system/dictbiz";
  611. import {
  612. feecenterTemplateImport,
  613. listFeeCountByCorp,
  614. losbfeestemplateGetListTemplate
  615. } from "@/api/iosBasicData/bills";
  616. import {losbfeestemplateDetail} from "@/api/iosBasicData/losbfeestemplate";
  617. import {popupReminder, requiredMessage} from "@/util/messageReminder";
  618. import {getBaccelementsList} from "@/api/iosBasicData/baccelements";
  619. import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
  620. import {reportsGetReportData} from "@/api/iosBasicData/reports";
  621. import reportformsList from "@/views/iosBasicData/OceanFreightImport/bills/assembly/reportformsList.vue";
  622. import {getList as reportsList} from "@/api/iosBasicData/reports";
  623. import {dateFormat} from "@/util/date";
  624. export default {
  625. components: {reportContainer, SearchQuery,reportformsList},
  626. props:{
  627. pid:{
  628. },
  629. assemblyForm:{
  630. type:Object
  631. },
  632. detailData:{},
  633. // 请核之后禁用
  634. pleasereviewType:{
  635. type:Boolean,
  636. default:false,
  637. },
  638. },
  639. data(){
  640. return {
  641. reportOption: {
  642. nodeKey: "id",
  643. addBtn: false,
  644. menu: false,
  645. size: "small",
  646. props: {
  647. labelText: "标题",
  648. label: "cnName",
  649. value: "value",
  650. children: "children"
  651. }
  652. },
  653. reportTypeData:[], // 打印选择的数据
  654. reportformsObj:{}, // 打印选择的数据
  655. selectPrintingDialog:false, // 打印弹窗
  656. printingDialog:false, // 打印弹窗开关
  657. printingDC:'', // 打印弹窗选择是应收还是应付
  658. PrintingData:[], // 打印弹窗列表数据
  659. printingLoading:false, // 打印弹窗加载动画
  660. optionPrinting: {
  661. stripe: true,
  662. maxHeight: '250',
  663. calcHeight: 30,
  664. tip: false,
  665. searchShow: true,
  666. searchMenuSpan: 6,
  667. border: true,
  668. selection: true,
  669. dialogClickModal: false,
  670. refreshBtn:false,
  671. columnBtn:false,
  672. addBtn: false,
  673. viewBtn: false,
  674. delBtn: false,
  675. editBtn: false,
  676. menuWidth: '100',
  677. menu:false,
  678. column: [
  679. {
  680. label: "客户名称",
  681. prop: "cnName",
  682. overHidden:true,
  683. },
  684. {
  685. label: "客户编号",
  686. prop: "code",
  687. overHidden:true,
  688. },
  689. ]
  690. },
  691. corpVisible:false, // 往来单位弹窗
  692. corpDialog:[], // 往来单位弹窗数据
  693. optionD:{},
  694. optionDBack:{
  695. stripe:true,
  696. maxHeight:'250',
  697. calcHeight: 30,
  698. tip: false,
  699. searchShow: true,
  700. searchMenuSpan: 6,
  701. border: true,
  702. selection: true,
  703. dialogClickModal: false,
  704. addBtn:false,
  705. viewBtn:false,
  706. delBtn:false,
  707. editBtn:false,
  708. menuWidth:'100',
  709. menu:false,
  710. column:[
  711. {
  712. label: "index",
  713. prop: "index",
  714. width: "55",
  715. headerslot:true,
  716. },
  717. {
  718. label: "账单",
  719. prop: "accStatus",
  720. width: "60",
  721. },
  722. {
  723. label: "往来单位",
  724. prop: "corpCnName",
  725. width: "160",
  726. overHidden:true,
  727. },
  728. {
  729. label: "费用简称",
  730. prop: "feeCnName",
  731. width: "120",
  732. overHidden:true,
  733. },
  734. {
  735. label: "预付/到付",
  736. prop: "paymode",
  737. width: "120",
  738. },
  739. {
  740. label: "计量单位",
  741. prop: "unitNo",
  742. width: "120",
  743. },
  744. {
  745. label: "币种",
  746. prop: "curCode",
  747. width: "120",
  748. },
  749. {
  750. label: "汇率",
  751. prop: "exrate",
  752. width: "100",
  753. },
  754. {
  755. label: "单价",
  756. prop: "price",
  757. width: "120",
  758. },
  759. {
  760. label: "数量",
  761. prop: "quantity",
  762. width: "120",
  763. },
  764. {
  765. label: "CNY(含税)",
  766. prop: "rmbAmount",
  767. width: "100",
  768. },
  769. {
  770. label: "USD(含税)",
  771. prop: "usdAmount",
  772. width: "100",
  773. },
  774. {
  775. label: "CNY(净额)",
  776. prop: "rmbAmountNet",
  777. width: "100",
  778. },
  779. {
  780. label: "USD(净额)",
  781. prop: "usdAmountNet",
  782. width: "100",
  783. },
  784. {
  785. label: "核算要素",
  786. prop: "elementsCnName",
  787. width: "120",
  788. overHidden:true,
  789. },
  790. {
  791. label: "付费申请金额",
  792. prop: "appliedAmount",
  793. width: "120",
  794. },
  795. {
  796. label: "发票申请金额",
  797. prop: "appliedInvoiceAmount",
  798. width: "120",
  799. },
  800. {
  801. label: "已开票金额",
  802. prop: "uninvoicedAmount",
  803. width: "120",
  804. },
  805. {
  806. label: "已结算金额",
  807. prop: "stlTtlAmount",
  808. width: "120",
  809. },
  810. {
  811. label: "备注",
  812. prop: "remarks",
  813. width: "100",
  814. },
  815. // {
  816. // label: "税率",
  817. // prop: "taxRate",
  818. // width: "100",
  819. // },
  820. // {
  821. // label: "附加税率",
  822. // prop: "surchargeRate",
  823. // width: "100",
  824. // },
  825. {
  826. label: "单价是否含税",
  827. prop: "isTax",
  828. width: "120",
  829. },
  830. ]
  831. },
  832. loadingD:false,
  833. formD:{},
  834. optionC:{},
  835. optionCBack:{
  836. stripe:true,
  837. maxHeight:'250',
  838. calcHeight: 30,
  839. tip: false,
  840. searchShow: true,
  841. searchMenuSpan: 6,
  842. border: true,
  843. selection: true,
  844. dialogClickModal: false,
  845. addBtn:false,
  846. viewBtn:false,
  847. delBtn:false,
  848. editBtn:false,
  849. menuWidth:'100',
  850. column:[
  851. {
  852. label: "index",
  853. prop: "index",
  854. width: "55",
  855. headerslot:true,
  856. },
  857. {
  858. label: "账单",
  859. prop: "accStatus",
  860. width: "60",
  861. },
  862. {
  863. label: "往来单位",
  864. prop: "corpCnName",
  865. width: "160",
  866. overHidden:true,
  867. },
  868. {
  869. label: "费用简称",
  870. prop: "feeCnName",
  871. width: "120",
  872. overHidden:true,
  873. },
  874. {
  875. label: "预付/到付",
  876. prop: "paymode",
  877. width: "120",
  878. },
  879. {
  880. label: "计量单位",
  881. prop: "unitNo",
  882. width: "120",
  883. },
  884. {
  885. label: "币种",
  886. prop: "curCode",
  887. width: "120",
  888. },
  889. {
  890. label: "汇率",
  891. prop: "exrate",
  892. width: "100",
  893. },
  894. {
  895. label: "单价",
  896. prop: "price",
  897. width: "120",
  898. },
  899. {
  900. label: "数量",
  901. prop: "quantity",
  902. width: "120",
  903. },
  904. {
  905. label: "CNY(含税)",
  906. prop: "rmbAmount",
  907. width: "100",
  908. },
  909. {
  910. label: "USD(含税)",
  911. prop: "usdAmount",
  912. width: "100",
  913. },
  914. {
  915. label: "CNY(净额)",
  916. prop: "rmbAmountNet",
  917. width: "100",
  918. },
  919. {
  920. label: "USD(净额)",
  921. prop: "usdAmountNet",
  922. width: "100",
  923. },
  924. {
  925. label: "核算要素",
  926. prop: "elementsCnName",
  927. width: "120",
  928. overHidden:true,
  929. },
  930. {
  931. label: "付费申请金额",
  932. prop: "appliedAmount",
  933. width: "120",
  934. },
  935. {
  936. label: "发票申请金额",
  937. prop: "appliedInvoiceAmount",
  938. width: "120",
  939. },
  940. {
  941. label: "已开票金额",
  942. prop: "uninvoicedAmount",
  943. width: "120",
  944. },
  945. {
  946. label: "已结算金额",
  947. prop: "stlTtlAmount",
  948. width: "120",
  949. },
  950. {
  951. label: "备注",
  952. prop: "remarks",
  953. width: "100",
  954. },
  955. // {
  956. // label: "税率",
  957. // prop: "taxRate",
  958. // width: "100",
  959. // },
  960. // {
  961. // label: "附加税率",
  962. // prop: "surchargeRate",
  963. // width: "100",
  964. // },
  965. {
  966. label: "单价是否含税",
  967. prop: "isTax",
  968. width: "120",
  969. },
  970. ]
  971. },
  972. loadingC:false,
  973. formC:{},
  974. // 签单方式
  975. issuetypefData:[],
  976. value:'',
  977. feeCenterListD:[], // 收
  978. feeCenterListC:[], // 付
  979. // 客户数据
  980. corpCnNameData:[],
  981. // 费用数据
  982. feeCnNameData:[],
  983. elementsData:[], // 核算要素
  984. // 预付到付数据
  985. paymodeData:[],
  986. // 计算单位数据
  987. unitNoData:[],
  988. // 币别数据
  989. curCodeData:[],
  990. // 模板弹窗
  991. templateVisible:false,
  992. treeOption: {
  993. nodeKey: "id",
  994. // lazy: true,
  995. addBtn: false,
  996. menu: false,
  997. size: "small",
  998. props: {
  999. labelText: "标题",
  1000. label: "cnName",
  1001. value: "value",
  1002. children: "children"
  1003. }
  1004. },
  1005. // 右侧详情数据
  1006. templateRightData:[],
  1007. // 导入弹窗表格的配置
  1008. templateOption:{},
  1009. templateOptionBack:{
  1010. menu:false,
  1011. stripe:true,
  1012. addBtn:false,
  1013. editBtn:false,
  1014. delBtn:false,
  1015. viewBtn:false,
  1016. index:true,
  1017. selection:true,
  1018. column:[
  1019. {
  1020. label: '客户',
  1021. prop:'corpCnName',
  1022. overHidden:true,
  1023. },
  1024. {
  1025. label: '费用',
  1026. prop:'feeCnName',
  1027. overHidden:true,
  1028. },
  1029. {
  1030. label: '数量',
  1031. prop:'quantity',
  1032. overHidden:true,
  1033. },
  1034. {
  1035. label: '单价',
  1036. prop:'price',
  1037. overHidden:true,
  1038. },
  1039. {
  1040. label: '计量单位',
  1041. prop:'unitNo',
  1042. overHidden:true,
  1043. },
  1044. {
  1045. label: '币别',
  1046. prop:'curCode',
  1047. overHidden:true,
  1048. }
  1049. ]
  1050. },
  1051. // 左侧数据
  1052. templateData:[],
  1053. lefttemplate:{}, // 左侧选择的数据
  1054. // 选中的数据
  1055. feesselectionList:[],
  1056. selectionDList:[], // 收选择的
  1057. selectionCList:[], // 付选择的
  1058. // 需要加判断是否必填的数据
  1059. messageData:[
  1060. {
  1061. name:'客户',
  1062. value:'corpCnName',
  1063. },
  1064. {
  1065. name:'业务来源',
  1066. value:'srcType',
  1067. },
  1068. {
  1069. name:'MBLNO',
  1070. value:'mblno',
  1071. },
  1072. {
  1073. name:'船名(VSL)',
  1074. value:'vesselCnName',
  1075. },
  1076. {
  1077. name:'航次(VOY)',
  1078. value:'voyageNo',
  1079. },
  1080. {
  1081. name:'ETA',
  1082. value:'eta',
  1083. },
  1084. {
  1085. name:'装货港',
  1086. value:'polCnName',
  1087. },
  1088. {
  1089. name:'国外收货港',
  1090. value:'placeReceiptName',
  1091. },
  1092. {
  1093. name:'目的港',
  1094. value:'destinationNamePrint',
  1095. },
  1096. {
  1097. name:'包装单位',
  1098. value:'packingUnit',
  1099. },
  1100. {
  1101. name:'船公司',
  1102. value:'carrierCnName',
  1103. },
  1104. {
  1105. name:'场站',
  1106. value:'cyCnName',
  1107. },
  1108. {
  1109. name:'所属团队',
  1110. value:'teamId',
  1111. },
  1112. ],
  1113. roleName:[], // 当前登录人的角色权限
  1114. }
  1115. },
  1116. async created() {
  1117. this.roleName = localStorage.getItem('roleName').split(',') // 获取角色数据
  1118. this.optionD = await this.getColumnData(this.getColumnName(309.2), this.optionDBack);
  1119. this.optionC = await this.getColumnData(this.getColumnName(309.3), this.optionCBack);
  1120. // 导入弹窗的表格
  1121. this.templateOption = await this.getColumnData(this.getColumnName(309.5), this.templateOptionBack);
  1122. this.getBcorpsListfun() // 获取客户数据
  1123. this.paymodeWorkDictsfun() // 获取预付/到付数据
  1124. },
  1125. methods:{
  1126. // 费用弹窗里的打印
  1127. dialogPreviewfun(row){
  1128. if (!this.reportformsObj.id){
  1129. this.$message.warning('请选择打印类型')
  1130. return;
  1131. }
  1132. // 获取报表数据
  1133. reportsGetReportData({
  1134. billId:this.assemblyForm.id,
  1135. reportCode:this.reportformsObj.classifyCode,
  1136. groupCode:this.reportformsObj.groupCode,
  1137. corpIds:row.id,
  1138. type:'HYJK'
  1139. }).then(res=>{
  1140. this.handleReportPreview(this.reportformsObj.url,res.data.data.data)
  1141. })
  1142. },
  1143. // 打印弹窗里回调
  1144. reportRadio(val){
  1145. // 多选打印
  1146. let idArr = this.selectionDList.map(item=>{
  1147. return item.id
  1148. })
  1149. // 获取报表数据
  1150. reportsGetReportData({
  1151. billId:this.assemblyForm.id,
  1152. reportCode:val.classifyCode,
  1153. groupCode:val.groupCode,
  1154. itemIds:idArr.join(','),
  1155. type:'HYJK'
  1156. }).then(res=>{
  1157. this.handleReportPreview(val.url,res.data.data.data)
  1158. })
  1159. },
  1160. // 打印费用
  1161. printingCostsfun(dc){
  1162. this.printingDC = dc
  1163. let groupCode = ''
  1164. let selectionArr = []
  1165. if (dc == 'D') {
  1166. groupCode = '应收'
  1167. selectionArr = this.selectionDList
  1168. }else {
  1169. groupCode = '应付'
  1170. selectionArr = this.selectionCList
  1171. }
  1172. if(selectionArr.length > 0) {
  1173. // 打开选择弹窗
  1174. this.selectPrintingDialog = true
  1175. let page = {
  1176. pageSize: 10,
  1177. currentPage: 1,
  1178. total: 0
  1179. }
  1180. this.$nextTick(()=>{
  1181. this.$refs.reportformsList.onLoad(page,{
  1182. businessType:'HYJK',
  1183. classifyCode:'费用',
  1184. groupCode:groupCode
  1185. })
  1186. })
  1187. }else {
  1188. // 没有多选弹窗
  1189. this.printingLoading = true
  1190. getFeeCenterCorpIds({
  1191. billId:this.assemblyForm.id,
  1192. dc:dc,
  1193. type:'HYJK',
  1194. }).then(res=>{
  1195. this.printingLoading = false
  1196. this.PrintingData = res.data.data
  1197. })
  1198. this.reportsListfun({
  1199. businessType:'HYJK',
  1200. classifyCode:'费用',
  1201. groupCode:groupCode
  1202. })
  1203. this.printingDialog = true
  1204. }
  1205. },
  1206. // 获取打印表格数据
  1207. reportsListfun(obj){
  1208. reportsList(1,50,obj).then(res=>{
  1209. this.reportTypeData = res.data.data.records
  1210. // 获取第一项的值
  1211. this.reportformsObj = res.data.data.records[0]
  1212. })
  1213. },
  1214. // 打印表格选择
  1215. reportNodeClick(data){
  1216. this.reportformsObj = data
  1217. },
  1218. // 生成应收应付
  1219. copyfun(dc){
  1220. let selection = []
  1221. if (dc == 'D') {
  1222. selection = this.selectionDList
  1223. if (this.selectionDList.length == 0) {
  1224. this.$message.warning('请先选择要复制的数据')
  1225. return
  1226. }
  1227. }else {
  1228. selection = this.selectionCList
  1229. if (this.selectionCList.length == 0) {
  1230. this.$message.warning('请先选择要复制的数据')
  1231. return
  1232. }
  1233. }
  1234. let arr = selection.map(item=>{
  1235. let obj = {}
  1236. obj.feeId = item.feeId
  1237. obj.feeCnName = item.feeCnName
  1238. obj.feeEnName = item.feeEnName
  1239. obj.feeCode = item.feeCode
  1240. obj.elementsId = item.elementsId
  1241. obj.elementsCnName = item.elementsCnName
  1242. obj.elementsEnName = item.elementsEnName
  1243. obj.elementsCode = item.elementsCode
  1244. obj.curCode = item.curCode
  1245. obj.taxRate = item.taxRate
  1246. obj.paymode = item.paymode
  1247. obj.remarks = item.remarks
  1248. obj.amount = item.amount
  1249. obj.price = item.price
  1250. obj.quantity = item.quantity
  1251. obj.rmbAmount = item.rmbAmount
  1252. obj.taxRate = item.taxRate
  1253. obj.unitNo = item.unitNo
  1254. obj.usdAmount = item.usdAmount
  1255. obj.edit = true
  1256. obj.rmbAmountNet = item.rmbAmountNet
  1257. obj.usdAmountNet = item.usdAmountNet
  1258. obj.exrate = item.exrate
  1259. return obj
  1260. })
  1261. if (dc == 'D') {
  1262. this.assemblyForm.feeCenterListC = [...arr,...this.assemblyForm.feeCenterListC]
  1263. }else {
  1264. this.assemblyForm.feeCenterListD = [...arr,...this.assemblyForm.feeCenterListD]
  1265. }
  1266. },
  1267. // 往来单位弹窗开启
  1268. corpClick(row){
  1269. this.corpVisible = true
  1270. listFeeCountByCorp({
  1271. corpId:row.corpId,
  1272. dc:row.dc
  1273. }).then(res=>{
  1274. this.corpDialog = res.data.data
  1275. })
  1276. },
  1277. // 模板导入
  1278. templateExport(){
  1279. if (!this.lefttemplate.id) {
  1280. this.$message.warning('请选择左侧数据')
  1281. return
  1282. }
  1283. if (this.feesselectionList.length > 0) {
  1284. feecenterTemplateImport({
  1285. ...this.lefttemplate,
  1286. feesTemplateItemsList:this.feesselectionList,
  1287. billNoId:this.assemblyForm.id
  1288. }).then(res=>{
  1289. this.$message({
  1290. type: "success",
  1291. message: "操作成功!"
  1292. });
  1293. this.feesselectionList = [] // 清空多选
  1294. this.templateRightData = [] // 清空数据
  1295. this.$emit('billsDetailfun')
  1296. this.templateVisible = false
  1297. })
  1298. }else {
  1299. this.$message.warning('请先选择要导入的数据')
  1300. }
  1301. },
  1302. // 模板
  1303. templateClick(dc){
  1304. if (popupReminder(this.assemblyForm,this.messageData)){
  1305. this.$confirm(popupReminder(this.assemblyForm,this.messageData), {
  1306. confirmButtonText: "确定",
  1307. cancelButtonText: "取消",
  1308. type: "warning"
  1309. })
  1310. }
  1311. if (popupReminder(this.assemblyForm,this.messageData)) {
  1312. return;
  1313. }
  1314. this.templateVisible = true
  1315. losbfeestemplateGetListTemplate(1,50,{
  1316. dc:dc,
  1317. status:0,
  1318. type:'HYJK'
  1319. }).then(res=>{
  1320. this.templateData = res.data.data.records
  1321. // 查第一条的明细
  1322. losbfeestemplateDetail(this.templateData[0].id).then(res=>{
  1323. this.templateRightData = res.data.data.feesTemplateItemsList
  1324. })
  1325. })
  1326. },
  1327. // 左侧选择
  1328. nodeClick(e) {
  1329. this.lefttemplate = e
  1330. losbfeestemplateDetail(e.id).then(res=>{
  1331. this.templateRightData = res.data.data.feesTemplateItemsList
  1332. })
  1333. },
  1334. // 右侧选择回调
  1335. feeselectionChange(list) {
  1336. this.feesselectionList = list;
  1337. },
  1338. // 应收新增
  1339. addDfun(){
  1340. // 判断数据需要的数据是否有 有就弹窗
  1341. if (popupReminder(this.assemblyForm,this.messageData)){
  1342. this.$confirm(popupReminder(this.assemblyForm,this.messageData), {
  1343. confirmButtonText: "确定",
  1344. cancelButtonText: "取消",
  1345. type: "warning"
  1346. })
  1347. }
  1348. if (popupReminder(this.assemblyForm,this.messageData)) {
  1349. return;
  1350. }
  1351. // 如果是分单 判断是否有分单号
  1352. if (this.assemblyForm.billType == 'MH') {
  1353. if (!this.assemblyForm.hblno) {
  1354. this.$message({
  1355. message: '请先选择HBLNO',
  1356. type: 'warning'
  1357. });
  1358. return;
  1359. }
  1360. }
  1361. let obj = {
  1362. edit:true
  1363. }
  1364. if (this.assemblyForm.feeCenterListD.length != 0) {
  1365. // 往来单位
  1366. obj.corpId = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].corpId
  1367. obj.corpCnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].corpCnName
  1368. obj.corpEnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].corpEnName
  1369. // 费用简称
  1370. obj.feeId = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeId
  1371. obj.feeCnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeCnName
  1372. obj.feeEnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeEnName
  1373. obj.feeCode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeCode
  1374. // 核算要素
  1375. obj.elementsId = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsId
  1376. obj.elementsCnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsCnName
  1377. obj.elementsEnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsEnName
  1378. obj.elementsCode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsCode
  1379. // 预付/到付
  1380. obj.paymode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].paymode
  1381. // 计量单位
  1382. obj.unitNo = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].unitNo
  1383. // 币种
  1384. obj.curCode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].curCode
  1385. obj.taxRate = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].taxRate
  1386. // 汇率
  1387. obj.exrate = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].exrate
  1388. // 单价
  1389. obj.price = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].price
  1390. // 数量
  1391. obj.quantity = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].quantity
  1392. // 金额
  1393. obj.rmbAmount = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].rmbAmount
  1394. obj.usdAmount = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].usdAmount
  1395. obj.rmbAmountNet = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].rmbAmountNet
  1396. obj.usdAmountNet = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].usdAmountNet
  1397. }else {
  1398. // 往来单位拿主表客户名称
  1399. obj.corpId = this.assemblyForm.corpId
  1400. obj.corpCnName = this.assemblyForm.corpCnName
  1401. obj.corpEnName = this.assemblyForm.corpEnName
  1402. // 预付/到付
  1403. obj.paymode = this.assemblyForm.mpaymode
  1404. }
  1405. this.assemblyForm.feeCenterListD.unshift(obj)
  1406. },
  1407. // 应付新增
  1408. addCfun(){
  1409. // 判断数据需要的数据是否有
  1410. // 判断数据需要的数据是否有 有就弹窗
  1411. if (popupReminder(this.assemblyForm,this.messageData)){
  1412. this.$confirm(popupReminder(this.assemblyForm,this.messageData), {
  1413. confirmButtonText: "确定",
  1414. cancelButtonText: "取消",
  1415. type: "warning"
  1416. })
  1417. }
  1418. if (popupReminder(this.assemblyForm,this.messageData)) {
  1419. return;
  1420. }
  1421. // 如果是分单 判断是否有分单号
  1422. if (this.assemblyForm.billType == 'MH') {
  1423. if (!this.assemblyForm.hblno) {
  1424. this.$message({
  1425. message: '请先选择HBLNO',
  1426. type: 'warning'
  1427. });
  1428. return;
  1429. }
  1430. }
  1431. let obj = {
  1432. edit:true
  1433. }
  1434. if (this.assemblyForm.feeCenterListC.length != 0) {
  1435. // 往来单位
  1436. obj.corpId = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].corpId
  1437. obj.corpCnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].corpCnName
  1438. obj.corpEnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].corpEnName
  1439. // 费用简称
  1440. obj.feeId = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeId
  1441. obj.feeCnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeCnName
  1442. obj.feeEnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeEnName
  1443. obj.feeCode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeCode
  1444. // 核算要素
  1445. obj.elementsId = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsId
  1446. obj.elementsCnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsCnName
  1447. obj.elementsEnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsEnName
  1448. obj.elementsCode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsCode
  1449. // 预付/到付
  1450. obj.paymode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].paymode
  1451. // 计量单位
  1452. obj.unitNo = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].unitNo
  1453. // 币种
  1454. obj.curCode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].curCode
  1455. obj.taxRate = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].taxRate
  1456. // 汇率
  1457. obj.exrate = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].exrate
  1458. // 单价
  1459. obj.price = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].price
  1460. // 数量
  1461. obj.quantity = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].quantity
  1462. // 金额
  1463. obj.rmbAmount = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].rmbAmount
  1464. obj.usdAmount = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].usdAmount
  1465. obj.rmbAmountNet = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].rmbAmountNet
  1466. obj.usdAmountNet = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].usdAmountNet
  1467. }else {
  1468. // 往来单位拿主表客户名称
  1469. obj.corpId = this.assemblyForm.corpId
  1470. obj.corpCnName = this.assemblyForm.corpCnName
  1471. obj.corpEnName = this.assemblyForm.corpEnName
  1472. // 预付/到付
  1473. obj.paymode = this.assemblyForm.mpaymode
  1474. }
  1475. this.assemblyForm.feeCenterListC.unshift(obj)
  1476. },
  1477. // 应收编辑
  1478. editDfun(row,index){
  1479. this.$delete(this.assemblyForm.feeCenterListD[index], 'edit')
  1480. this.$set(this.assemblyForm.feeCenterListD[index],'edit',true)
  1481. },
  1482. // 应付编辑
  1483. editCfun(row,index){
  1484. this.$delete(this.assemblyForm.feeCenterListC[index], 'edit')
  1485. this.$set(this.assemblyForm.feeCenterListC[index],'edit',true)
  1486. },
  1487. // 应付应付保存
  1488. savefun(row,index,dc){
  1489. if (!this.pid) {
  1490. this.$message({
  1491. message: '请先保存数据之后才能添加',
  1492. type: 'warning'
  1493. });
  1494. return
  1495. }
  1496. let sum = '请输入'
  1497. if (!row.corpId) {
  1498. sum += ` 序号${index + 1}往来单位`
  1499. }
  1500. if (!row.feeId) {
  1501. sum += ` 序号${index + 1}费用简称`
  1502. }
  1503. if (!row.elementsId) {
  1504. sum += ` 序号${index + 1}核算要素`
  1505. }
  1506. if (!row.curCode) {
  1507. sum += ` 序号${index + 1}币种`
  1508. }
  1509. if(sum != '请输入') {
  1510. this.$confirm(sum, {
  1511. confirmButtonText: "确定",
  1512. cancelButtonText: "取消",
  1513. type: "warning"
  1514. })
  1515. return;
  1516. }
  1517. // 收付 D=收 C=付
  1518. row.dc = dc
  1519. row.pid = this.pid
  1520. row.sort = Number(index) + 1
  1521. row.businessType = this.assemblyForm.businessType // 业务类型
  1522. row.billType = this.assemblyForm.billType // 单据类型
  1523. row.billNo = this.assemblyForm.billNo // 单据编号
  1524. row.billDate = this.assemblyForm.billDate // 单据日期
  1525. row.billCorpId = this.assemblyForm.corpId // 主表客户 id
  1526. row.billCorpCnName = this.assemblyForm.corpCnName // 主表客户中文名称
  1527. row.billCorpEnName = this.assemblyForm.corpEnName // 主表客户英文名称
  1528. row.lineId = this.assemblyForm.lineId // 航线 id
  1529. row.lineCnName = this.assemblyForm.lineCnName // 航线中文名称
  1530. row.lineEnName = this.assemblyForm.lineEnName // 航线英文名称
  1531. row.vesselId = this.assemblyForm.vesselId // 船名 id
  1532. row.vesselCnName = this.assemblyForm.vesselCnName // 中文船名
  1533. row.vesselEnName = this.assemblyForm.vesselEnName // 英文船名
  1534. row.voyageNo = this.assemblyForm.voyageNo // 航次
  1535. row.mblno = this.assemblyForm.mblno // MB/L NO
  1536. row.hblno = this.assemblyForm.hblno // HB/L NO
  1537. row.etd = this.assemblyForm.etd // 开船日期
  1538. row.eta = this.assemblyForm.eta // 到港日期
  1539. row.polId = this.assemblyForm.polId // 装货港 id
  1540. row.polCode = this.assemblyForm.polCode // 装货港代码
  1541. row.polCnName = this.assemblyForm.polCnName // 装货港中文名称
  1542. row.polEnName = this.assemblyForm.polEnName // 装货港英文名称
  1543. row.podId = this.assemblyForm.podId // 卸货港 id
  1544. row.podCode = this.assemblyForm.podCode // 卸货港代码
  1545. row.podCnName = this.assemblyForm.podCnName // 卸货港中文名称
  1546. row.podEnName = this.assemblyForm.podEnName // 卸货港英文名称
  1547. row.corpArgreementNo = this.assemblyForm.corpArgreementNo // 客户约号
  1548. this.feecenterSubmitfun(row)
  1549. },
  1550. // 生成账单
  1551. GenerateBillsfun(dc){
  1552. let selectionArr = []
  1553. if (dc == 'D') {
  1554. selectionArr = this.selectionDList
  1555. }else {
  1556. selectionArr = this.selectionCList
  1557. }
  1558. // 判断必填项
  1559. let sum = '请输入'
  1560. for (let item of selectionArr) {
  1561. if (!item.id) {
  1562. this.$message.warning(`序号${item.$index + 1}请先保存再进行生成账单`)
  1563. return
  1564. }
  1565. if (!item.corpId) {
  1566. sum += ` 序号${item.$index + 1}往来单位`
  1567. }
  1568. if (!item.feeId) {
  1569. sum += ` 序号${item.$index + 1}费用简称`
  1570. }
  1571. if (!item.elementsId) {
  1572. sum += ` 序号${item.$index + 1}核算要素`
  1573. }
  1574. if (!item.curCode) {
  1575. sum += ` 序号${item.$index + 1}币种`
  1576. }
  1577. }
  1578. if(sum != '请输入') {
  1579. this.$confirm(sum, {
  1580. confirmButtonText: "确定",
  1581. cancelButtonText: "取消",
  1582. type: "warning"
  1583. })
  1584. return;
  1585. }
  1586. this.$confirm("确定将选择数据生成账单?", {
  1587. confirmButtonText: "确定",
  1588. cancelButtonText: "取消",
  1589. type: "warning"
  1590. }).then(()=>{
  1591. let billList = []
  1592. if (dc == 'D') {
  1593. for(let item of this.selectionDList) {
  1594. billList.push(item)
  1595. }
  1596. this.finaccbillsGenerateBillfun(billList)
  1597. }else {
  1598. for(let item of this.selectionCList) {
  1599. billList.push(item)
  1600. }
  1601. this.finaccbillsGenerateBillfun(billList)
  1602. }
  1603. })
  1604. },
  1605. // 撤销账单
  1606. RevokingBillsfun(dc){
  1607. this.$confirm("确定将选择数据撤销账单?", {
  1608. confirmButtonText: "确定",
  1609. cancelButtonText: "取消",
  1610. type: "warning"
  1611. }).then(()=>{
  1612. let billList = []
  1613. if (dc == 'D') {
  1614. for(let item of this.selectionDList) {
  1615. billList.push(item)
  1616. }
  1617. this.finaccbillsRevokeBillfun(billList)
  1618. }else {
  1619. for(let item of this.selectionCList) {
  1620. billList.push(item)
  1621. }
  1622. this.finaccbillsRevokeBillfun(billList)
  1623. }
  1624. })
  1625. },
  1626. // 多选
  1627. handleSelectionChange(list,dc){
  1628. if (dc == 'D') {
  1629. this.selectionDList = list
  1630. }else {
  1631. this.selectionCList = list
  1632. }
  1633. },
  1634. // 一键删除
  1635. batchDelete(dc){
  1636. if(dc == 'D') {
  1637. for(let item of this.selectionDList) {
  1638. if (item.accStatus == 1){
  1639. this.$message.warning('请选择没有生成账单的数据')
  1640. return
  1641. }
  1642. }
  1643. }else {
  1644. for(let item of this.feeCenterListC) {
  1645. if (item.accStatus == 1){
  1646. this.$message.warning('请选择没有生成账单的数据')
  1647. return
  1648. }
  1649. }
  1650. }
  1651. this.$confirm("确定将选择数据删除?", {
  1652. confirmButtonText: "确定",
  1653. cancelButtonText: "取消",
  1654. type: "warning"
  1655. }).then(()=>{
  1656. let multiList = []
  1657. let arr = []
  1658. if (dc == 'D') {
  1659. multiList = this.selectionDList
  1660. arr = this.assemblyForm.feeCenterListD
  1661. }else {
  1662. multiList = this.selectionCList
  1663. arr = this.assemblyForm.feeCenterListC
  1664. }
  1665. // 获取有id 的数据
  1666. const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
  1667. let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
  1668. // 把选中的删除掉
  1669. multiList.forEach((item)=>{
  1670. for (let index in arr) {
  1671. if (JSON.stringify(item) == JSON.stringify(arr[index])) {
  1672. arr.splice(Number(index),1)
  1673. }
  1674. }
  1675. })
  1676. // 有id 的处理
  1677. if(itemsWithId.length != 0) {
  1678. feecenterRemove(arrIds.join(',')).then(res=>{
  1679. this.$message.success('操作成功')
  1680. // this.$emit('billsDetailfun')
  1681. })
  1682. }
  1683. })
  1684. },
  1685. // 应收删除
  1686. deletefun(row,index,dc) {
  1687. console.log(row,index,1580)
  1688. this.$confirm("确定将选择数据删除?", {
  1689. confirmButtonText: "确定",
  1690. cancelButtonText: "取消",
  1691. type: "warning"
  1692. }).then(()=>{
  1693. if (row.id) {
  1694. // 删除接口
  1695. feecenterRemove(row.id).then(res=>{
  1696. this.$message({
  1697. type: "success",
  1698. message: "操作成功!"
  1699. });
  1700. this.$emit('billsDetailfun')
  1701. })
  1702. }else {
  1703. if(dc == 'D') {
  1704. this.assemblyForm.feeCenterListD.splice(index, 1)
  1705. }else {
  1706. this.assemblyForm.feeCenterListC.splice(index, 1)
  1707. }
  1708. }
  1709. })
  1710. },
  1711. // 客户的回调
  1712. corpChange(value,name,row,dc) {
  1713. if (name == 'corpCnName') {
  1714. if (!value) {
  1715. this.$set(row,'corpCnName','')
  1716. this.$set(row,'corpEnName','')
  1717. this.$set(row,'corpId','')
  1718. }
  1719. for(let item of this.corpCnNameData) {
  1720. if (item.cnName == value){
  1721. this.$set(row,'corpCnName',item.cnName)
  1722. this.$set(row,'corpEnName',item.enName)
  1723. this.$set(row,'corpId',item.id)
  1724. }
  1725. }
  1726. }else if (name == 'feeCnName') {
  1727. if (!value) {
  1728. this.$set(row,'feeCnName','')
  1729. this.$set(row,'feeEnName','')
  1730. this.$set(row,'feeId','')
  1731. this.$set(row,'feeCode','')
  1732. // 选择费用简称带出核算要素
  1733. this.$set(row,'elementsId','')
  1734. this.$set(row,'elementsCnName','')
  1735. this.$set(row,'elementsCode','')
  1736. this.$set(row,'elementsEnName','')
  1737. }
  1738. for(let item of this.feeCnNameData) {
  1739. if (item.cnName == value){
  1740. this.$set(row,'feeCnName',item.cnName)
  1741. this.$set(row,'feeEnName',item.enName)
  1742. this.$set(row,'feeId',item.id)
  1743. this.$set(row,'feeCode',item.code)
  1744. // 选择费用简称带出核算要素
  1745. this.$set(row,'elementsId',item.accElementId)
  1746. this.$set(row,'elementsCnName',item.accElementName)
  1747. this.$set(row,'elementsCode',item.elementsCode)
  1748. this.$set(row,'elementsEnName',item.elementsEnName)
  1749. // 拿取费用简称下的计量单位
  1750. this.getBunitsPagefun(true,item,row)
  1751. // 币别
  1752. this.$set(row,'curCode',item.curNo)
  1753. // 汇率
  1754. bcurrencyGetExrate({
  1755. date:this.assemblyForm.etd?this.assemblyForm.etd.slice(0,10) + ' 00:00:00':dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00:00', // 开船日期
  1756. dc:dc
  1757. }).then(res=>{
  1758. for (let item of res.data.data) {
  1759. if (item.code == row.curCode) {
  1760. this.$set(row,'exrate',item.exrate)
  1761. }
  1762. }
  1763. })
  1764. // 计算金额
  1765. this.$set(row,'amount',Number(row.price) * Number(row.quantity?row.quantity:0))
  1766. if (row.curCode == 'CNY') {
  1767. this.$set(row,'rmbAmount',row.amount)
  1768. this.$set(row,'usdAmount','')
  1769. this.$set(row,'rmbAmountNet',row.amount)
  1770. this.$set(row,'usdAmountNet','')
  1771. }else {
  1772. this.$set(row,'usdAmount',row.amount)
  1773. this.$set(row,'rmbAmount','')
  1774. this.$set(row,'usdAmountNet',row.amount)
  1775. this.$set(row,'rmbAmountNet','')
  1776. }
  1777. }
  1778. }
  1779. }else if (name == 'unitNo') {
  1780. // 计量单位
  1781. this.$set(row,name,value)
  1782. for (let item of this.unitNoData) {
  1783. if (item.code == value) {
  1784. // 按箱型
  1785. if (item.quantityRule == 1) {
  1786. // 选择的箱那边的数据
  1787. if (item.boxquantity) {
  1788. this.$set(row,'quantity',item.boxquantity)
  1789. }
  1790. }
  1791. // 按票
  1792. if (item.quantityRule == 2) {
  1793. this.$set(row,'quantity',1)
  1794. }
  1795. // 按重量
  1796. if (item.quantityRule == 3) {
  1797. this.$set(row,'quantity',this.assemblyForm.grossWeight)
  1798. }
  1799. // 按TEU
  1800. if (item.quantityRule == 4) {
  1801. this.$set(row,'quantity',item.boxquantity)
  1802. }
  1803. // 按尺码
  1804. if (item.quantityRule == 5) {
  1805. this.$set(row,'quantity',this.assemblyForm.measurement)
  1806. }
  1807. // 按件数
  1808. if (item.quantityRule == 6) {
  1809. this.$set(row,'quantity',this.assemblyForm.quantity)
  1810. }
  1811. }
  1812. }
  1813. this.$set(row,'amount',Number(row.price?row.price:0) * Number(row.quantity?row.quantity:0))
  1814. if (row.curCode == 'CNY') {
  1815. this.$set(row,'rmbAmount',row.amount)
  1816. this.$set(row,'usdAmount','')
  1817. this.$set(row,'rmbAmountNet',row.amount)
  1818. this.$set(row,'usdAmountNet','')
  1819. }else {
  1820. this.$set(row,'usdAmount',row.amount)
  1821. this.$set(row,'rmbAmount','')
  1822. this.$set(row,'usdAmountNet',row.amount)
  1823. this.$set(row,'rmbAmountNet','')
  1824. }
  1825. } else if (name == 'elementsCnName') {
  1826. if (!value) {
  1827. this.$set(row,'elementsId','')
  1828. this.$set(row,'elementsCnName','')
  1829. this.$set(row,'elementsCode','')
  1830. this.$set(row,'elementsEnName','')
  1831. }
  1832. // 核算要素
  1833. for (let item of this.elementsData) {
  1834. if (item.cnName == value) {
  1835. this.$set(row,'elementsId',item.id)
  1836. this.$set(row,'elementsCnName',item.cnName)
  1837. this.$set(row,'elementsCode',item.code)
  1838. this.$set(row,'elementsEnName',item.enName)
  1839. }
  1840. }
  1841. }else if (name == 'curCode') {
  1842. for(let item of this.curCodeData) {
  1843. if (item.code == value){
  1844. if (item.code == 'USD') {
  1845. if (Number(item.exrate) <= 1) {
  1846. this.$message.warning('当前选择的币别汇率不能小于零')
  1847. return
  1848. }
  1849. }else {
  1850. if (Number(item.exrate) == 0) {
  1851. this.$message.warning('当前选择的币别汇率不能为零')
  1852. return
  1853. }
  1854. }
  1855. this.$set(row,'curCode',item.code)
  1856. this.$set(row,'exrate',item.exrate)
  1857. this.$set(row,'amount',Number(row.price) * Number(row.quantity?row.quantity:0))
  1858. if (row.curCode == 'CNY') {
  1859. this.$set(row,'rmbAmount',row.amount)
  1860. this.$set(row,'usdAmount','')
  1861. this.$set(row,'rmbAmountNet',row.amount)
  1862. this.$set(row,'usdAmountNet','')
  1863. }else {
  1864. this.$set(row,'usdAmount',row.amount)
  1865. this.$set(row,'rmbAmount','')
  1866. this.$set(row,'usdAmountNet',row.amount)
  1867. this.$set(row,'rmbAmountNet','')
  1868. }
  1869. }
  1870. }
  1871. } else {
  1872. this.$set(row,name,value)
  1873. }
  1874. },
  1875. // 单价
  1876. priceinputfun(value,row){
  1877. if (Number(value) <= 0) {
  1878. this.$message({
  1879. type: "warning",
  1880. message: "单价不能输入负数!"
  1881. });
  1882. return
  1883. }
  1884. this.$set(row,'amount',Number(row.price) * Number(row.quantity?row.quantity:0))
  1885. // 判断是否有币种
  1886. if (!row.curCode) {
  1887. return;
  1888. }
  1889. if (row.curCode == 'CNY') {
  1890. this.$set(row,'rmbAmount',row.amount)
  1891. this.$set(row,'usdAmount','')
  1892. this.$set(row,'rmbAmountNet',row.amount)
  1893. this.$set(row,'usdAmountNet','')
  1894. }else {
  1895. this.$set(row,'usdAmount',row.amount)
  1896. this.$set(row,'rmbAmount','')
  1897. this.$set(row,'usdAmountNet',row.amount)
  1898. this.$set(row,'rmbAmountNet','')
  1899. }
  1900. },
  1901. // 数量
  1902. quantityinputfun(row) {
  1903. if (row.quantity <= 0) {
  1904. this.$message({
  1905. type: "warning",
  1906. message: "数量不能输入负数!"
  1907. });
  1908. this.$set(row,'quantity',1)
  1909. return
  1910. }
  1911. this.$set(row,'amount',Number(row.price?row.price:0) * Number(row.quantity))
  1912. // 判断是否有币种
  1913. if (!row.curCode) {
  1914. return;
  1915. }
  1916. if (row.curCode == 'CNY') {
  1917. this.$set(row,'rmbAmount',row.amount)
  1918. this.$set(row,'usdAmount','')
  1919. }else {
  1920. this.$set(row,'usdAmount',row.amount)
  1921. this.$set(row,'rmbAmount','')
  1922. }
  1923. },
  1924. // 保存接口
  1925. feecenterSubmitfun(row){
  1926. feecenterSubmit(row).then(res=>{
  1927. this.$message({
  1928. type: "success",
  1929. message: "操作成功!"
  1930. });
  1931. this.$emit('billsDetailfun')
  1932. })
  1933. },
  1934. // 获取客户数据
  1935. getBcorpsListfun(cnName){
  1936. getBcorpsList(1,10,{cnName}).then(res=>{
  1937. this.corpCnNameData = res.data.data.records
  1938. // this.corpCnNameData = res.data.data.records.map(item=>{
  1939. // // 创建自定义参数暂存
  1940. // item.cnNamecode = item.cnName + ' - ' + item.code + ' - ' + item.shortName
  1941. // return item
  1942. // })
  1943. })
  1944. },
  1945. // 获取费用数据
  1946. bfeesListfun(cnName){
  1947. bfeesList(1,10,{cnName}).then(res=>{
  1948. this.feeCnNameData = res.data.data.records
  1949. })
  1950. },
  1951. // 获取费用信息 核算要素信息
  1952. getBaccelementsListfun(cnName){
  1953. getBaccelementsList(1,10,{cnName}).then(res=>{
  1954. this.elementsData = res.data.data.records
  1955. })
  1956. },
  1957. // 获取计算属性
  1958. async getBunitsPagefun(type,feeRow,row){
  1959. let srcBillId = null
  1960. if (this.assemblyForm.billType == 'MH') {
  1961. srcBillId = this.assemblyForm.masterId
  1962. }else {
  1963. srcBillId = this.assemblyForm.id
  1964. }
  1965. const res = await getBunitsPage({srcBillId})
  1966. this.unitNoData = []
  1967. let boxarr40 = ['40HC','40GP']
  1968. let boxarr20 = ['20GP']
  1969. let teunum = 0
  1970. for (let item of res.data.data) {
  1971. // 按箱型
  1972. if (item.quantityRule != 1) {
  1973. // TEU
  1974. if (item.quantityRule == 4) {
  1975. for (let data of this.assemblyForm.preContainersList) {
  1976. // 40*2 20*1
  1977. if (boxarr40.indexOf(data.cntrTypeCode) != -1) {
  1978. teunum += Number(data.quantity) * 2
  1979. }else if (boxarr20.indexOf(data.cntrTypeCode) != -1) {
  1980. teunum += Number(data.quantity)
  1981. }
  1982. }
  1983. this.unitNoData.push({...item, boxquantity: teunum})
  1984. }else {
  1985. this.unitNoData.push(item) // 不是TEU和不是箱的走这个
  1986. }
  1987. }
  1988. }
  1989. let arr = this.assemblyForm.preContainersList.map(item=>{
  1990. return {
  1991. quantityRule:1, // 1 是按箱量
  1992. code:item.cntrTypeCode,
  1993. boxquantity:item.quantity,
  1994. }
  1995. })
  1996. this.unitNoData = [...arr,...this.unitNoData]
  1997. // 选择费用时带出第一条
  1998. if (type) {
  1999. let feeunitNodata = []
  2000. for (let item of this.unitNoData) {
  2001. if (item.quantityRule == feeRow.unitNo) {
  2002. feeunitNodata.push(item)
  2003. }
  2004. }
  2005. this.corpChange(feeunitNodata[0].code,'unitNo',row)
  2006. }
  2007. },
  2008. // 获取币别数据
  2009. bcurrencyGetExratefun(dc){
  2010. console.log(dc,1963)
  2011. bcurrencyGetExrate({
  2012. date:this.assemblyForm.etd?this.assemblyForm.etd.slice(0,10) + ' 00:00:00':dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00:00', // 开船日期
  2013. dc:dc
  2014. }).then(res=>{
  2015. this.curCodeData = res.data.data
  2016. })
  2017. },
  2018. // 获取签单方式字典数据
  2019. getWorkDictsfun(){
  2020. getWorkDicts('issue_type_F').then(res=>{
  2021. this.issuetypefData = res.data.data
  2022. })
  2023. },
  2024. // 获取预付到付字典数据
  2025. paymodeWorkDictsfun(){
  2026. getWorkDicts('payment_method_los').then((res) => {
  2027. this.paymodeData = res.data.data
  2028. })
  2029. },
  2030. // 预付到付货物显示值
  2031. paymodefun(value){
  2032. for(let item of this.paymodeData) {
  2033. if (item.value == value) {
  2034. return item.label
  2035. }
  2036. }
  2037. },
  2038. // 生成账单接口
  2039. finaccbillsGenerateBillfun(list){
  2040. const obj = {
  2041. feeCenterList:list,
  2042. businessTypeCode:'HYZD',
  2043. billNoFormat:'HYZD',
  2044. accountType:'LOCAL',
  2045. refno:this.assemblyForm.refno,
  2046. polNamePrint:this.assemblyForm.polNamePrint,
  2047. podNamePrint:this.assemblyForm.podNamePrint,
  2048. teamId:this.assemblyForm.teamId,
  2049. teamName:this.assemblyForm.teamName
  2050. }
  2051. finaccbillsGenerateBill(obj).then(res=>{
  2052. this.$message({
  2053. type: "success",
  2054. message: "操作成功!"
  2055. });
  2056. this.$emit('billsDetailfun')
  2057. })
  2058. },
  2059. // 撤销账单接口
  2060. finaccbillsRevokeBillfun(list){
  2061. const obj = {
  2062. feeCenterList:list,
  2063. }
  2064. finaccbillsRevokeBill(obj).then(res=>{
  2065. this.$message({
  2066. type: "success",
  2067. message: "操作成功!"
  2068. });
  2069. this.$emit('billsDetailfun')
  2070. })
  2071. },
  2072. // 一键编辑
  2073. feecenterEditfun(dc){
  2074. if (dc == 'D') {
  2075. for(let item of this.assemblyForm.feeCenterListD) {
  2076. if (item.accStatus != 1) {
  2077. this.$delete(item, 'edit')
  2078. this.$set(item,'edit',true)
  2079. }
  2080. }
  2081. }else {
  2082. for(let item of this.assemblyForm.feeCenterListC) {
  2083. if (item.accStatus != 1) {
  2084. this.$delete(item, 'edit')
  2085. this.$set(item,'edit',true)
  2086. }
  2087. }
  2088. }
  2089. },
  2090. // 费用信息明细保存按钮
  2091. feecenterSubmitListfun(){
  2092. if (!this.pid) {
  2093. this.$message({
  2094. message: '请先保存数据之后才能添加',
  2095. type: 'warning'
  2096. });
  2097. return
  2098. }
  2099. // 判断必填项
  2100. let sum = '请输入'
  2101. for (let item of this.assemblyForm.feeCenterListD) {
  2102. if (!item.corpId) {
  2103. sum += ` 应收序号${item.$index + 1}往来单位`
  2104. }
  2105. if (!item.feeId) {
  2106. sum += ` 应收序号${item.$index + 1}费用简称`
  2107. }
  2108. if (!item.elementsId) {
  2109. sum += ` 应收序号${item.$index + 1}核算要素`
  2110. }
  2111. if (!item.curCode) {
  2112. sum += ` 应收序号${item.$index + 1}币种`
  2113. }
  2114. }
  2115. for (let item of this.assemblyForm.feeCenterListC) {
  2116. if (!item.corpId) {
  2117. sum += ` 应付序号${item.$index + 1}往来单位`
  2118. }
  2119. if (!item.feeId) {
  2120. sum += ` 应付序号${item.$index + 1}费用简称`
  2121. }
  2122. if (!item.elementsId) {
  2123. sum += ` 应付序号${item.$index + 1}核算要素`
  2124. }
  2125. if (!item.curCode) {
  2126. sum += ` 应付序号${item.$index + 1}币种`
  2127. }
  2128. }
  2129. if(sum != '请输入') {
  2130. this.$confirm(sum, {
  2131. confirmButtonText: "确定",
  2132. cancelButtonText: "取消",
  2133. type: "warning"
  2134. })
  2135. return;
  2136. }
  2137. this.$confirm("确定保存全部的费用信息?", {
  2138. confirmButtonText: "确定",
  2139. cancelButtonText: "取消",
  2140. type: "warning"
  2141. }).then(()=>{
  2142. this.assemblyForm.feeCenterListD.map((row,index)=>{
  2143. row.dc = 'D'
  2144. row.pid = this.pid
  2145. row.sort = Number(index) + 1
  2146. row.businessType = this.assemblyForm.businessType // 业务类型
  2147. row.billType = this.assemblyForm.billType // 单据类型
  2148. row.billNo = this.assemblyForm.billNo // 单据编号
  2149. row.billDate = this.assemblyForm.billDate // 单据日期
  2150. row.billCorpId = this.assemblyForm.corpId // 主表客户 id
  2151. row.billCorpCnName = this.assemblyForm.corpCnName // 主表客户中文名称
  2152. row.billCorpEnName = this.assemblyForm.corpEnName // 主表客户英文名称
  2153. row.lineId = this.assemblyForm.lineId // 航线 id
  2154. row.lineCnName = this.assemblyForm.lineCnName // 航线中文名称
  2155. row.lineEnName = this.assemblyForm.lineEnName // 航线英文名称
  2156. row.vesselId = this.assemblyForm.vesselId // 船名 id
  2157. row.vesselCnName = this.assemblyForm.vesselCnName // 中文船名
  2158. row.vesselEnName = this.assemblyForm.vesselEnName // 英文船名
  2159. row.voyageNo = this.assemblyForm.voyageNo // 航次
  2160. row.mblno = this.assemblyForm.mblno // MB/L NO
  2161. row.hblno = this.assemblyForm.hblno // HB/L NO
  2162. row.etd = this.assemblyForm.etd // 开船日期
  2163. row.eta = this.assemblyForm.eta // 到港日期
  2164. row.polId = this.assemblyForm.polId // 装货港 id
  2165. row.polCode = this.assemblyForm.polCode // 装货港代码
  2166. row.polCnName = this.assemblyForm.polCnName // 装货港中文名称
  2167. row.polEnName = this.assemblyForm.polEnName // 装货港英文名称
  2168. row.podId = this.assemblyForm.podId // 卸货港 id
  2169. row.podCode = this.assemblyForm.podCode // 卸货港代码
  2170. row.podCnName = this.assemblyForm.podCnName // 卸货港中文名称
  2171. row.podEnName = this.assemblyForm.podEnName // 卸货港英文名称
  2172. row.corpArgreementNo = this.assemblyForm.corpArgreementNo // 客户约号
  2173. })
  2174. this.assemblyForm.feeCenterListC.map((row,index)=>{
  2175. row.dc = 'C'
  2176. row.pid = this.pid
  2177. row.sort = Number(index) + 1
  2178. row.businessType = this.assemblyForm.businessType // 业务类型
  2179. row.billType = this.assemblyForm.billType // 单据类型
  2180. row.billNo = this.assemblyForm.billNo // 单据编号
  2181. row.billDate = this.assemblyForm.billDate // 单据日期
  2182. row.billCorpId = this.assemblyForm.corpId // 主表客户 id
  2183. row.billCorpCnName = this.assemblyForm.corpCnName // 主表客户中文名称
  2184. row.billCorpEnName = this.assemblyForm.corpEnName // 主表客户英文名称
  2185. row.lineId = this.assemblyForm.lineId // 航线 id
  2186. row.lineCnName = this.assemblyForm.lineCnName // 航线中文名称
  2187. row.lineEnName = this.assemblyForm.lineEnName // 航线英文名称
  2188. row.vesselId = this.assemblyForm.vesselId // 船名 id
  2189. row.vesselCnName = this.assemblyForm.vesselCnName // 中文船名
  2190. row.vesselEnName = this.assemblyForm.vesselEnName // 英文船名
  2191. row.voyageNo = this.assemblyForm.voyageNo // 航次
  2192. row.mblno = this.assemblyForm.mblno // MB/L NO
  2193. row.hblno = this.assemblyForm.hblno // HB/L NO
  2194. row.etd = this.assemblyForm.etd // 开船日期
  2195. row.eta = this.assemblyForm.eta // 到港日期
  2196. row.polId = this.assemblyForm.polId // 装货港 id
  2197. row.polCode = this.assemblyForm.polCode // 装货港代码
  2198. row.polCnName = this.assemblyForm.polCnName // 装货港中文名称
  2199. row.polEnName = this.assemblyForm.polEnName // 装货港英文名称
  2200. row.podId = this.assemblyForm.podId // 卸货港 id
  2201. row.podCode = this.assemblyForm.podCode // 卸货港代码
  2202. row.podCnName = this.assemblyForm.podCnName // 卸货港中文名称
  2203. row.podEnName = this.assemblyForm.podEnName // 卸货港英文名称
  2204. row.corpArgreementNo = this.assemblyForm.corpArgreementNo // 客户约号
  2205. })
  2206. feecenterSubmitList([
  2207. ...this.assemblyForm.feeCenterListD,
  2208. ...this.assemblyForm.feeCenterListC
  2209. ]).then(res=>{
  2210. this.$message({
  2211. type: "success",
  2212. message: "操作成功!"
  2213. });
  2214. this.$emit('billsDetailfun')
  2215. })
  2216. })
  2217. },
  2218. // 预览报表
  2219. handleReportPreview(url,data){
  2220. console.log(url,1670)
  2221. console.log(data,1671)
  2222. Stimulsoft.Base.StiLicense.key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE'
  2223. // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
  2224. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile( '/reports/stimulsoft/Localization/zh-CHS.xml', true, 'zh-CHS')
  2225. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml' )
  2226. // 工具栏
  2227. var options = new Stimulsoft.Viewer.StiViewerOptions()
  2228. options.height = '100%'
  2229. options.appearance.scrollbarsMode = true // 滚动条模式
  2230. options.toolbar.showDesignButton = false // 显示设计按钮
  2231. options.toolbar.showAboutButton = false // 显示关于按钮
  2232. options.toolbar.showResourcesButton = false // 显示资源按钮
  2233. options.toolbar.showFullScreenButton = false // 显示全屏按钮
  2234. options.toolbar.showOpenButton = false // 显示打开按钮
  2235. options.appearance.showTooltips = false // 显示工具提示
  2236. options.appearance.showDialogsHelp = false // 显示对话框帮助
  2237. options.exports.showExportToDocument = false // 显示导出到文档
  2238. options.toolbar.showParametersButton = true // 显示参数按钮
  2239. options.appearance.bookmarksPrint = true // 书签打印
  2240. // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
  2241. // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
  2242. // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
  2243. // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
  2244. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct
  2245. // htmlRenderMode html渲染模式
  2246. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table
  2247. // 是创建一个 Stimulsoft 报表查看器的实例的代码
  2248. let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
  2249. // 报表
  2250. console.log("创建一个报表实例");
  2251. console.log()
  2252. let report = new window.Stimulsoft.Report.StiReport();
  2253. // 加载文件
  2254. console.log("从url加载报表");
  2255. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  2256. report.load(url)
  2257. data.pageOne = 'Page : 1 of 1'
  2258. // 处理超长数据
  2259. if (data.hshipperDetails) {
  2260. var consignerIndex2 = data.hshipperDetails.indexOf( '\n' )
  2261. for (let i = 0; i < 4; i++) {
  2262. consignerIndex2 = data.hshipperDetails.indexOf( '\n', consignerIndex2 + 1 );
  2263. }
  2264. if (consignerIndex2 != -1) {
  2265. var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length)
  2266. data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + ' *'
  2267. data.commodityDescr += '\n*' + hshipperDetails
  2268. }
  2269. }
  2270. if (data.hconsigneeDetails) {
  2271. var consigneeIndex2 = data.hconsigneeDetails.indexOf( '\n' )
  2272. for (let i = 0; i < 3; i++) {
  2273. consigneeIndex2 = data.hconsigneeDetails.indexOf( '\n', consigneeIndex2 + 1 );
  2274. }
  2275. if (consigneeIndex2 != -1) {
  2276. var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length)
  2277. data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + ' **'
  2278. data.commodityDescr += '\n**' + hconsigneeDetails
  2279. }
  2280. }
  2281. if (data.hnotifyDetails) {
  2282. var notifierIndex2 = data.hnotifyDetails.indexOf( '\n' )
  2283. for (let i = 0; i < 3; i++) {
  2284. notifierIndex2 = data.hnotifyDetails.indexOf( '\n', notifierIndex2 + 1 );
  2285. }
  2286. if (notifierIndex2 != -1) {
  2287. var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length)
  2288. data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + ' ***'
  2289. data.commodityDescr += '\n***' + hnotifyDetails
  2290. }
  2291. }
  2292. // 处理箱号
  2293. if (this.isPrintTheBoxNumber) {
  2294. data.commodityDescr += '\n.\n.\n'
  2295. }
  2296. // PLACE & DATE OF ISSUE
  2297. data.placeAndDateOfIssue = ''
  2298. if (data.issueAt) {
  2299. data.placeAndDateOfIssue += data.issueAt
  2300. }
  2301. if (data.issueDate) {
  2302. let date = new Date(data.issueDate.replace(/-/g,'/'));
  2303. let yyyy = date.getFullYear();
  2304. let mmmm = date.toDateString().split(" ")[1]
  2305. let dd = date.getDate()
  2306. data.placeAndDateOfIssue += ', ' + dd + '-' + mmmm + '-' + yyyy
  2307. }
  2308. // Total number of containers or packages received by the Carriers
  2309. if (data.preContainersList) {
  2310. let boxMap = new Map();
  2311. for (let boxQuantity of data.preContainersList) {
  2312. if (boxMap.get(boxQuantity.cntrTypeCode)) {
  2313. let v = boxMap.get(boxQuantity.cntrTypeCode)
  2314. boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity)
  2315. } else {
  2316. boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity)
  2317. }
  2318. }
  2319. let boxs = ''
  2320. boxMap.forEach(function (value, key, map) {
  2321. boxs += value + 'x' + key + ', '
  2322. })
  2323. boxs = boxs.substring(0, boxs.length - 2)
  2324. data.boxQuantity = boxs + ' CONTAINER(S) ONLY'
  2325. }
  2326. // Number of original B/Ls
  2327. if (data.numberOfObl) {
  2328. data.numberOfObl += ' (' + data.numberOfOblDigit + ')'
  2329. }
  2330. if (data.commodityDescr) {
  2331. var descriptionIndex2 = data.commodityDescr.indexOf( '\n' )
  2332. for (let i = 0; i < 19; i++) {
  2333. descriptionIndex2 = data.commodityDescr.indexOf( '\n', descriptionIndex2 + 1 );
  2334. }
  2335. if (descriptionIndex2 != -1) {
  2336. data.pageOne = 'Page : 1 of 2'
  2337. data.pageTwo = 'Page : 2 of 2'
  2338. var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length)
  2339. data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2)
  2340. data.extraLongTips = '** TO BE CONTINUED ON ATTACHED LIST **'
  2341. data.extraLongText = extraLongText
  2342. }
  2343. }
  2344. // console.log(data.hshipperDetails, 'hshipperDetails2')
  2345. // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
  2346. var dataSet = new Stimulsoft.System.Data.DataSet(
  2347. 'reportData'
  2348. )
  2349. dataSet.readJson(data) // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
  2350. // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
  2351. // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
  2352. report.regData('reportData', 'reportData', dataSet)
  2353. // 从模版和数据加载报表
  2354. // loadReport(report, '', {})
  2355. // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
  2356. viewer.report = report;
  2357. this.$refs.reportContainer.showContainer(
  2358. ()=> {
  2359. setTimeout(() => {
  2360. viewer.renderHtml('reportContainer')
  2361. this.createViewerButtons(viewer)
  2362. }, 50)
  2363. },
  2364. ()=>{
  2365. },
  2366. )
  2367. console.log("加载成功完成!");
  2368. },
  2369. createViewerButtons (viewer){
  2370. viewer.jsObject.collections.images['myClose.png'] =
  2371. 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg=='
  2372. const closeBtn = viewer.jsObject.SmallButton(
  2373. 'closeBtn',
  2374. '关闭',
  2375. 'myClose.png'
  2376. )
  2377. // 增加打印弹窗配置
  2378. const printBtn = viewer.jsObject.SmallButton(
  2379. 'printBtn',
  2380. '打印报表',
  2381. 'myClose.png'
  2382. )
  2383. // console.log(viewer.jsObject.print(),'1013')
  2384. // 获取 关闭按钮的dom元素位置
  2385. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild
  2386. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild
  2387. const userButtonCell = buttonsTable.rows[0].insertCell(0)
  2388. // 获取打印按钮的位置
  2389. const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
  2390. const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
  2391. userButtonPrint.addEventListener("click", (event)=>{
  2392. console.log("打印点击");
  2393. // event.preventDefault()
  2394. });
  2395. userButtonPrint.addEventListener("mouseover", (event) => {
  2396. console.log("移入打印按钮");
  2397. console.log(event,1035)
  2398. });
  2399. userButtonCell.className = 'stiJsViewerClearAllStyles'
  2400. userButtonCell.appendChild(closeBtn) // 添加关闭节点
  2401. // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
  2402. let that=this
  2403. // 关闭按钮的监听点击
  2404. closeBtn.action = function() {
  2405. console.log(that.$refs.ReportContainer,'1022')
  2406. if (that.$refs.reportContainer)
  2407. that.$refs.reportContainer.hideContainer()
  2408. }
  2409. // // // 打印按钮监听
  2410. // printBtn.action = (e)=>{
  2411. // console.log('打印')
  2412. // window.print()
  2413. // }
  2414. },
  2415. // 表头样式
  2416. tableHeaderCellStyle({row,column,rowIndex, columnIndex}){
  2417. return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff"
  2418. },
  2419. // 更改表格颜色
  2420. headerClassName(tab) {
  2421. //颜色间隔
  2422. let back = ""
  2423. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  2424. if (tab.columnIndex % 2 === 0) {
  2425. back = "back-one"
  2426. } else if (tab.columnIndex % 2 === 1) {
  2427. back = "back-two"
  2428. }
  2429. }
  2430. return back;
  2431. },
  2432. // 关闭弹窗
  2433. handleClose(done) {
  2434. this.$confirm('确认关闭?')
  2435. .then(_ => {
  2436. this.feesselectionList = [] // 清空多选
  2437. this.templateRightData = [] // 清空数据
  2438. done();
  2439. })
  2440. .catch(_ => {});
  2441. },
  2442. //自定义列保存
  2443. async saveColumnTwo(ref, option, optionBack, code) {
  2444. /**
  2445. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  2446. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  2447. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  2448. */
  2449. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  2450. if (inSave) {
  2451. this.$message.success("保存成功");
  2452. //关闭窗口
  2453. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  2454. }
  2455. },
  2456. //自定义列重置
  2457. async resetColumnTwo(ref, option, optionBack, code) {
  2458. this[option] = this[optionBack];
  2459. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  2460. if (inSave) {
  2461. this.$message.success("重置成功");
  2462. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  2463. }
  2464. },
  2465. },
  2466. }
  2467. </script>
  2468. <style scoped lang="scss">
  2469. .disabledBox {
  2470. display: flex;
  2471. align-items: center;
  2472. }
  2473. .fontSize {
  2474. font-size: 16px;
  2475. color: #81B337;
  2476. }
  2477. .meetSize {
  2478. font-size: 16px;
  2479. color: #54BCBD;
  2480. }
  2481. .bottomFlex {
  2482. display: flex;
  2483. align-items: center;
  2484. }
  2485. .weightfont {
  2486. font-size: 20px;
  2487. font-weight: bold;
  2488. }
  2489. .weightnum {
  2490. font-size: 15px;
  2491. font-weight: 500;
  2492. }
  2493. .fontText {
  2494. font-size: 16px;
  2495. font-weight: 500;
  2496. margin: 3px 0;
  2497. }
  2498. ::v-deep.el-form-item {
  2499. margin-bottom: 0px;
  2500. }
  2501. // 去掉弹框内容的默认padding值
  2502. /deep/.el-dialog .el-dialog__body {
  2503. padding: 0px 20px;
  2504. }
  2505. ::v-deep#out-table .back-one {
  2506. background: #ecf5ff !important;
  2507. text-align: center;
  2508. padding: 4px 0;
  2509. }
  2510. ::v-deep#out-table .back-two {
  2511. background: #ecf5ff !important;
  2512. text-align: center;
  2513. padding: 4px 0;
  2514. }
  2515. .textoverflow {
  2516. width: 100%;
  2517. overflow: hidden;
  2518. white-space: nowrap;
  2519. text-overflow: ellipsis;
  2520. }
  2521. </style>