feecenter.vue 129 KB

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