feecenter.vue 125 KB

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