feecenter.vue 116 KB

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