feecenter.vue 126 KB

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