fee-oceanFreight.vue 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480
  1. <template>
  2. <div>
  3. <avue-crud :option="optionD" :table-loading="loading" :data="form.feeCenterListD" id="out-table" ref="crudD"
  4. @selection-change="selectionDChange" @resetColumn="resetColumn('crudD', 'optionD', 'optionDBack', 392)"
  5. @saveColumn="saveColumn('crudD', 'optionD', 'optionDBack', 392)" :row-class-name="tableRowClassName">
  6. <template slot="menuLeft">
  7. <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
  8. <i class="el-icon-coin"></i>
  9. <span>应收费用</span>
  10. </div>
  11. <el-button type="info" plain size="small" :disabled="disabled"
  12. @click="allClick('一键保存', 'D')">一键保存</el-button>
  13. <el-button type="info" plain size="small" :disabled="disabled"
  14. @click="allClick('一键编辑', 'D')">一键编辑</el-button>
  15. <el-button type="danger" plain size="small" :disabled="disabled || selectionDList.length == 0"
  16. @click="allClick('批量删除', 'D')">批量删除</el-button>
  17. <el-button type="primary" plain size="small" :disabled="disabled || selectionDList.length == 0"
  18. @click="allClick('生成账单', 'D')">生成账单</el-button>
  19. <el-button type="danger" plain size="small" :disabled="disabled || selectionDList.length == 0"
  20. @click="allClick('撤销账单', 'D')">撤销账单</el-button>
  21. <el-button type="primary" plain size="small" @click="$refs.printD.openDialog()">打印账单</el-button>
  22. <el-button type="success" plain size="small" :disabled="disabled"
  23. @click="allClick('应收模板', 'D')">应收模板</el-button>
  24. <el-button type="primary" plain size="small" :disabled="disabled || selectionDList.length == 0"
  25. @click="allClick('生成应付', 'D')">生成应付</el-button>
  26. </template>
  27. <template slot="indexHeader" slot-scope="{row,index}">
  28. <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="disabled" circle @click="addRow('D')">
  29. </el-button>
  30. </template>
  31. <template slot="index" slot-scope="{row,index}">
  32. <span>{{ index + 1 }}</span>
  33. </template>
  34. <template slot="corpCnNameForm" slot-scope="{ row }">
  35. <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" placeholder="往来单位" key="id" label="cnName"
  36. res="records" url="/blade-los/bcorps/listByType?corpTypeName=客户" :filterable="true" :remote="true"
  37. dataName="cnName" @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
  38. <span v-else>{{ row.corpCnName }}</span>
  39. </template>
  40. <template slot="feeCnNameForm" slot-scope="{ row }">
  41. <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" placeholder="费用名称" key="id" label="cnName"
  42. res="records" url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"
  43. @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
  44. <span v-else>{{ row.feeCnName }}</span>
  45. </template>
  46. <template slot="unitNo" slot-scope="{ row }">
  47. <dic-select v-if="row.$cellEdit" v-model="row.unitNo" placeholder="收费标准" key="id" label="code"
  48. url="/blade-los/bunits/selectList" :filterable="true"
  49. @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
  50. <span v-else>{{ row.unitNo }}</span>
  51. </template>
  52. <tempalte slot="quantityForm" slot-scope="{ row }">
  53. <el-input-number v-if="row.$cellEdit" v-model="row.quantity" @change="countChange(row)" :controls="false"
  54. placeholder="请输入 数量" size="small" style="width: 100%;"></el-input-number>
  55. <span v-else>{{ row.quantity }}</span>
  56. </tempalte>
  57. <tempalte slot="priceForm" slot-scope="{ row }">
  58. <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)" :controls="false"
  59. placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
  60. <span v-else>{{ row.price }}</span>
  61. </tempalte>
  62. <template slot="curCodeForm" slot-scope="{ row }">
  63. <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" key="id" label="code"
  64. :url="'/blade-los/bcurrency/getExrate?date=' + defaultDate + '&dc=' + row.dc" :filterable="true"
  65. @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
  66. <span v-else>{{ row.curCode }}</span>
  67. </template>
  68. <tempalte slot="exrate" slot-scope="{ row }">
  69. <el-input-number v-if="row.$cellEdit" v-model="row.exrate" @change="countChange(row)" :controls="false"
  70. placeholder="请输入 汇率" size="small" style="width: 100%;"></el-input-number>
  71. <span v-else>{{ row.exrate }}</span>
  72. </tempalte>
  73. <tempalte slot="stlExrate" slot-scope="{ row }">
  74. <el-input-number v-if="row.$cellEdit" v-model="row.stlExrate" :controls="false" placeholder="请输入 结算汇率"
  75. size="small" style="width: 100%;"></el-input-number>
  76. <span v-else>{{ row.stlExrate }}</span>
  77. </tempalte>
  78. </avue-crud>
  79. <avue-crud style="margin-top: 10px;" :option="optionC" :table-loading="loading" :data="form.feeCenterListC"
  80. id="out-table" ref="crudC" @selection-change="selectionCChange"
  81. @resetColumn="resetColumn('crudC', 'optionC', 'optionCBack', 393)"
  82. @saveColumn="saveColumn('crudC', 'optionC', 'optionCBack', 393)" :row-class-name="tableRowClassName">
  83. <template slot="menuLeft">
  84. <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
  85. <i class="el-icon-coin"></i>
  86. <span>应付费用</span>
  87. </div>
  88. <el-button type="info" plain size="small" :disabled="disabled"
  89. @click="allClick('一键保存', 'C')">一键保存</el-button>
  90. <el-button type="info" plain size="small" :disabled="disabled"
  91. @click="allClick('一键编辑', 'C')">一键编辑</el-button>
  92. <el-button type="danger" plain size="small" :disabled="disabled || selectionCList.length == 0"
  93. @click="allClick('批量删除', 'C')">批量删除</el-button>
  94. <el-button type="primary" plain size="small" :disabled="disabled || selectionCList.length == 0"
  95. @click="allClick('生成账单', 'C')">生成账单</el-button>
  96. <el-button type="danger" plain size="small" :disabled="disabled || selectionCList.length == 0"
  97. @click="allClick('撤销账单', 'C')">撤销账单</el-button>
  98. <el-button type="primary" plain size="small" :disabled="disabled"
  99. @click="allClick('增值税', 'C')">增值税</el-button>
  100. <el-button type="danger" plain size="small" :disabled="disabled" @click="allClick('关税', 'C')">关税</el-button>
  101. <el-button type="primary" plain size="small" @click="$refs.printC.openDialog()">打印账单</el-button>
  102. <el-button type="success" plain size="small" :disabled="disabled"
  103. @click="allClick('应付模板', 'C')">应付模板</el-button>
  104. <el-button type="primary" plain size="small" :disabled="disabled || selectionCList.length == 0"
  105. @click="allClick('生成应收', 'C')">生成应收</el-button>
  106. <el-button type="success" plain size="small" :disabled="disabled"
  107. @click="allClick('转押', 'C')">转押</el-button>
  108. <el-button plain size="small" :disabled="disabled" @click="allClick('撤销转押', 'C')">撤销转押</el-button>
  109. </template>
  110. <template slot="indexHeader" slot-scope="{row,index}">
  111. <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="disabled" circle @click="addRow('C')">
  112. </el-button>
  113. </template>
  114. <template slot="index" slot-scope="{row,index}">
  115. <span>{{ index + 1 }}</span>
  116. </template>
  117. <template slot="corpCnNameForm" slot-scope="{ row }">
  118. <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" placeholder="往来单位" key="id" label="cnName"
  119. res="records" url="/blade-los/bcorps/listByType?corpTypeName=客户" :filterable="true" :remote="true"
  120. dataName="cnName" @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
  121. <span v-else>{{ row.corpCnName }}</span>
  122. </template>
  123. <template slot="feeCnNameForm" slot-scope="{ row }">
  124. <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" placeholder="费用名称" key="id" label="cnName"
  125. res="records" url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"
  126. @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
  127. <span v-else>{{ row.feeCnName }}</span>
  128. </template>
  129. <template slot="unitNo" slot-scope="{ row }">
  130. <dic-select v-if="row.$cellEdit" v-model="row.unitNo" placeholder="付费标准" key="id" label="code"
  131. url="/blade-los/bunits/selectList" :filterable="true"
  132. @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
  133. <span v-else>{{ row.unitNo }}</span>
  134. </template>
  135. <tempalte slot="quantityForm" slot-scope="{ row }">
  136. <el-input-number v-if="row.$cellEdit" v-model="row.quantity" @change="countChange(row)" :controls="false"
  137. placeholder="请输入 数量" size="small" style="width: 100%;"></el-input-number>
  138. <span v-else>{{ row.quantity }}</span>
  139. </tempalte>
  140. <tempalte slot="priceForm" slot-scope="{ row }">
  141. <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)" :controls="false"
  142. placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
  143. <span v-else>{{ row.price }}</span>
  144. </tempalte>
  145. <template slot="curCodeForm" slot-scope="{ row }">
  146. <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" key="id" label="code"
  147. :url="'/blade-los/bcurrency/getExrate?date=' + defaultDate + '&dc=' + row.dc" :filterable="true"
  148. @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
  149. <span v-else>{{ row.curCode }}</span>
  150. </template>
  151. <tempalte slot="exrate" slot-scope="{ row }">
  152. <el-input-number v-if="row.$cellEdit" v-model="row.exrate" @change="countChange(row)" :controls="false"
  153. placeholder="请输入 汇率" size="small" style="width: 100%;"></el-input-number>
  154. <span v-else>{{ row.exrate }}</span>
  155. </tempalte>
  156. <tempalte slot="stlExrate" slot-scope="{ row }">
  157. <el-input-number v-if="row.$cellEdit" v-model="row.stlExrate" :controls="false" placeholder="请输入 结算汇率"
  158. size="small" style="width: 100%;"></el-input-number>
  159. <span v-else>{{ row.stlExrate }}</span>
  160. </tempalte>
  161. </avue-crud>
  162. <el-dialog title="提示" :visible.sync="templateVisible" append-to-body width="70%" :close-on-click-modal="false"
  163. :before-close="handleClose">
  164. <div>
  165. <el-row>
  166. <el-col :span="5">
  167. <basic-container>
  168. <avue-tree :option="treeOption" :data="templateData" @node-click="nodeClick">
  169. </avue-tree>
  170. </basic-container>
  171. </el-col>
  172. <el-col :span="19">
  173. <avue-crud :option="templateOption" :data="templateRightData" ref="templateRef"
  174. @selection-change="feeselectionChange">
  175. </avue-crud>
  176. </el-col>
  177. </el-row>
  178. </div>
  179. <span slot="footer" class="dialog-footer">
  180. <el-button size="mini" @click="templateVisible = false; feesselectionList = []; templateRightData = []">取
  181. 消</el-button>
  182. <el-button type="primary" size="mini" @click="templateExport">导 入</el-button>
  183. </span>
  184. </el-dialog>
  185. <el-dialog append-to-body title="转押" class="el-dialogDeep" :visible.sync="subDialog" width="70%"
  186. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @closed="subClosed"
  187. v-dialog-drag>
  188. <avue-crud ref="subCrud" :table-loading="loading" :data="subData" :option="subOptions" :page.sync="page"
  189. :search.sync="query" @search-change="searchChange" @search-reset="searchReset"
  190. @selection-change="subselectionChange" @current-change="currentChange" @size-change="sizeChange"
  191. @row-click="rowClick" @on-load="onLoad">
  192. </avue-crud>
  193. <span slot="footer" class="dialog-footer">
  194. <el-button size="mini" @click="subDialog = false">取 消</el-button>
  195. <el-button size="mini" :disabled="subselectionList.length != 1" type="primary" @click="subSubmit">确
  196. 认</el-button>
  197. </span>
  198. </el-dialog>
  199. <business-reports :id="form.id" :itemIds="itemIds" ref="printD" businessValue="HYJK" classifyCode="费用"
  200. groupCode="应收" :selecList="selectionDList"></business-reports>
  201. <business-reports :id="form.id" :itemIds="itemIds" ref="printC" businessValue="HYJK" classifyCode="费用"
  202. groupCode="应付" :selecList="selectionCList"></business-reports>
  203. </div>
  204. </template>
  205. <script>
  206. import dicSelect from "@/components/dicSelect/main";
  207. import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
  208. import { submitListTrade, feeRemove, generateBill, revokeBill, synchronization, feecenterTemplateImport } from "@/api/tradeAgency/tradeAgency";
  209. import { defaultDate } from "@/util/date";
  210. import { losbfeestemplateDetail } from "@/api/iosBasicData/losbfeestemplate";
  211. import { losbfeestemplateGetListTemplate } from "@/api/iosBasicData/bills";
  212. import businessReports from "@/components/tradeAgency/businessReportsJK.vue";
  213. import { getListTradeV1, transferOfPledge, revokeTransferOfPledge } from "@/api/tradeAgency/oceanFreightImport";
  214. import _ from "lodash";
  215. export default {
  216. components: {
  217. dicSelect,
  218. businessReports
  219. },
  220. props: {
  221. detailData: {},
  222. disabled: {
  223. type: Boolean,
  224. default: false,
  225. },
  226. form: {
  227. type: Object,
  228. default: () => {
  229. }
  230. }
  231. },
  232. data() {
  233. return {
  234. loading: false,
  235. query: {},
  236. page: {
  237. pageSize: 10,
  238. currentPage: 1,
  239. total: 0
  240. },
  241. subData: [],
  242. subOptions: {
  243. header: false,
  244. tip: false,
  245. border: true,
  246. index: true,
  247. menu: false,
  248. selection: true,
  249. align: 'center',
  250. searchMenuSpan: 18,
  251. height: '450',
  252. column: [
  253. {
  254. label: "客户名称",
  255. prop: "corpCnName",
  256. width: "120",
  257. overHidden: true,
  258. },
  259. {
  260. label: "提单号",
  261. prop: "mblno",
  262. width: "120",
  263. overHidden: true,
  264. search: true,
  265. },
  266. {
  267. label: "预计到港",
  268. prop: "bookingDate",
  269. width: "120",
  270. overHidden: true,
  271. type: "date",
  272. format: "yyyy-MM-dd",
  273. valueFormat: "yyyy-MM-dd HH:mm:ss"
  274. },
  275. {
  276. label: "箱型箱量",
  277. prop: "quantityCntrDescr",
  278. width: "100",
  279. overHidden: true
  280. },
  281. {
  282. label: "船代",
  283. prop: "bookingAgentCnName",
  284. overHidden: true
  285. },
  286. {
  287. label: "船公司",
  288. prop: "carrierCnName",
  289. overHidden: true
  290. },
  291. {
  292. label: "制单人",
  293. prop: "createUserName",
  294. overHidden: true
  295. },
  296. ]
  297. },
  298. subDialog: false,
  299. subselectionList: [],
  300. treeOption: {
  301. nodeKey: "id",
  302. // lazy: true,
  303. addBtn: false,
  304. menu: false,
  305. size: "small",
  306. props: {
  307. labelText: "标题",
  308. label: "cnName",
  309. value: "value",
  310. children: "children"
  311. }
  312. },
  313. templateOption: {
  314. height: 400,
  315. menu: false,
  316. tip: false,
  317. stripe: true,
  318. addBtn: false,
  319. editBtn: false,
  320. delBtn: false,
  321. viewBtn: false,
  322. index: true,
  323. selection: true,
  324. header: false,
  325. column: [
  326. {
  327. label: '客户',
  328. prop: 'corpCnName',
  329. overHidden: true,
  330. },
  331. {
  332. label: '客户类型',
  333. prop: 'corpType',
  334. overHidden: true,
  335. },
  336. {
  337. label: '费用',
  338. prop: 'feeCnName',
  339. overHidden: true,
  340. },
  341. {
  342. label: '数量',
  343. prop: 'quantity',
  344. overHidden: true,
  345. },
  346. {
  347. label: '单价',
  348. prop: 'price',
  349. overHidden: true,
  350. },
  351. {
  352. label: '计量单位',
  353. prop: 'unitNo',
  354. overHidden: true,
  355. },
  356. {
  357. label: '币别',
  358. prop: 'curCode',
  359. overHidden: true,
  360. }
  361. ]
  362. },
  363. templateVisible: false,
  364. defaultDate: defaultDate(new Date()),
  365. optionD: {},
  366. optionDBack: {
  367. height: 'auto',
  368. calcHeight: 30,
  369. menuWidth: 140,
  370. tip: false,
  371. border: true,
  372. addBtn: false,
  373. viewBtn: false,
  374. editBtn: false,
  375. delBtn: false,
  376. menu: false,
  377. refreshBtn: false,
  378. selection: true,
  379. align: 'center',
  380. column: [
  381. {
  382. label: "index",
  383. prop: "index",
  384. width: "55",
  385. headerslot: true,
  386. },
  387. {
  388. label: "账单",
  389. prop: "accStatus",
  390. width: '80',
  391. overHidden: true,
  392. dicData: [{
  393. label: '否',
  394. value: 0
  395. }, {
  396. label: '是',
  397. value: 1
  398. }]
  399. },
  400. {
  401. label: "结算状态",
  402. prop: "stlStatus",
  403. width: '80',
  404. overHidden: true,
  405. dicData: [{
  406. label: '否',
  407. value: 0
  408. }, {
  409. label: '是',
  410. value: 1
  411. }]
  412. },
  413. {
  414. label: "往来单位",
  415. prop: "corpCnName",
  416. width: '160',
  417. cell: true,
  418. slot: true,
  419. formslot: true,
  420. overHidden: true,
  421. rules: [
  422. {
  423. required: true,
  424. message: '请选择往来单位',
  425. trigger: 'blur'
  426. }
  427. ]
  428. },
  429. {
  430. label: "提单号",
  431. prop: "mblno",
  432. width: '160',
  433. overHidden: true,
  434. },
  435. {
  436. label: "费用名称",
  437. prop: "feeCnName",
  438. width: '120',
  439. cell: true,
  440. slot: true,
  441. formslot: true,
  442. overHidden: true,
  443. rules: [
  444. {
  445. required: true,
  446. message: '请选择费用名称',
  447. trigger: 'blur'
  448. }
  449. ]
  450. },
  451. {
  452. label: "收费标准",
  453. prop: "unitNo",
  454. width: '120',
  455. overHidden: true,
  456. },
  457. {
  458. label: "单价",
  459. prop: "price",
  460. cell: true,
  461. slot: true,
  462. formslot: true,
  463. overHidden: true,
  464. rules: [
  465. {
  466. required: true,
  467. message: '请输入单价',
  468. trigger: 'blur'
  469. }
  470. ]
  471. },
  472. {
  473. label: "数量",
  474. prop: "quantity",
  475. cell: true,
  476. slot: true,
  477. formslot: true,
  478. overHidden: true,
  479. rules: [
  480. {
  481. required: true,
  482. message: '请输入数量',
  483. trigger: 'blur'
  484. }
  485. ]
  486. },
  487. {
  488. label: "金额",
  489. prop: "amount",
  490. overHidden: true,
  491. },
  492. {
  493. label: "币别",
  494. prop: "curCode",
  495. cell: true,
  496. slot: true,
  497. formslot: true,
  498. overHidden: true,
  499. rules: [
  500. {
  501. required: true,
  502. message: '请选择币别',
  503. trigger: 'blur'
  504. }
  505. ]
  506. },
  507. {
  508. label: "外币金额",
  509. prop: "amountLoc",
  510. overHidden: true,
  511. },
  512. {
  513. label: "汇率",
  514. prop: "exrate",
  515. overHidden: true,
  516. },
  517. {
  518. label: "结算汇率",
  519. prop: "stlExrate",
  520. overHidden: true,
  521. },
  522. {
  523. label: "结算日期",
  524. prop: "stlDate",
  525. width: "120",
  526. cell: true,
  527. type: "date",
  528. format: "yyyy-MM-dd",
  529. valueFormat: "yyyy-MM-dd 00:00:00",
  530. overHidden: true
  531. },
  532. {
  533. label: "天数",
  534. prop: "days",
  535. overHidden: true,
  536. },
  537. {
  538. label: "入库日期",
  539. prop: "storageDate",
  540. overHidden: true,
  541. },
  542. {
  543. label: "出库日期",
  544. prop: "outboundDate",
  545. overHidden: true,
  546. },
  547. {
  548. label: "备注",
  549. prop: "remarks",
  550. cell: true,
  551. width: '200',
  552. overHidden: true,
  553. },
  554. ]
  555. },
  556. optionC: {},
  557. optionCBack: {
  558. maxHeight: 400,
  559. calcHeight: 30,
  560. menuWidth: 140,
  561. tip: false,
  562. border: true,
  563. addBtn: false,
  564. viewBtn: false,
  565. editBtn: false,
  566. delBtn: false,
  567. menu: false,
  568. refreshBtn: false,
  569. selection: true,
  570. align: 'center',
  571. column: [
  572. {
  573. label: "index",
  574. prop: "index",
  575. width: "55",
  576. headerslot: true,
  577. },
  578. {
  579. label: "账单",
  580. prop: "accStatus",
  581. width: '80',
  582. overHidden: true,
  583. dicData: [{
  584. label: '否',
  585. value: 0
  586. }, {
  587. label: '是',
  588. value: 1
  589. }]
  590. },
  591. {
  592. label: "结算状态",
  593. prop: "stlStatus",
  594. width: '80',
  595. overHidden: true,
  596. dicData: [{
  597. label: '否',
  598. value: 0
  599. }, {
  600. label: '是',
  601. value: 1
  602. }]
  603. },
  604. {
  605. label: "往来单位",
  606. prop: "corpCnName",
  607. width: '160',
  608. cell: true,
  609. slot: true,
  610. formslot: true,
  611. overHidden: true,
  612. rules: [
  613. {
  614. required: true,
  615. message: '请选择往来单位',
  616. trigger: 'blur'
  617. }
  618. ]
  619. },
  620. {
  621. label: "提单号",
  622. prop: "mblno",
  623. width: '160',
  624. overHidden: true,
  625. },
  626. {
  627. label: "费用名称",
  628. prop: "feeCnName",
  629. width: '120',
  630. cell: true,
  631. slot: true,
  632. formslot: true,
  633. overHidden: true,
  634. rules: [
  635. {
  636. required: true,
  637. message: '请选择费用名称',
  638. trigger: 'blur'
  639. }
  640. ]
  641. },
  642. {
  643. label: "付费标准",
  644. prop: "unitNo",
  645. width: '120',
  646. overHidden: true,
  647. },
  648. {
  649. label: "单价",
  650. prop: "price",
  651. cell: true,
  652. slot: true,
  653. formslot: true,
  654. overHidden: true,
  655. rules: [
  656. {
  657. required: true,
  658. message: '请输入单价',
  659. trigger: 'blur'
  660. }
  661. ]
  662. },
  663. {
  664. label: "数量",
  665. prop: "quantity",
  666. cell: true,
  667. slot: true,
  668. formslot: true,
  669. overHidden: true,
  670. rules: [
  671. {
  672. required: true,
  673. message: '请输入数量',
  674. trigger: 'blur'
  675. }
  676. ]
  677. },
  678. {
  679. label: "金额",
  680. prop: "amount",
  681. overHidden: true,
  682. },
  683. {
  684. label: "币别",
  685. prop: "curCode",
  686. cell: true,
  687. slot: true,
  688. formslot: true,
  689. overHidden: true,
  690. rules: [
  691. {
  692. required: true,
  693. message: '请选择币别',
  694. trigger: 'blur'
  695. }
  696. ]
  697. },
  698. {
  699. label: "外币金额",
  700. prop: "amountLoc",
  701. overHidden: true,
  702. },
  703. {
  704. label: "汇率",
  705. prop: "exrate",
  706. overHidden: true,
  707. },
  708. {
  709. label: "结算汇率",
  710. prop: "stlExrate",
  711. overHidden: true,
  712. },
  713. {
  714. label: "结算日期",
  715. prop: "stlDate",
  716. width: "120",
  717. cell: true,
  718. type: "date",
  719. format: "yyyy-MM-dd",
  720. valueFormat: "yyyy-MM-dd 00:00:00",
  721. overHidden: true
  722. },
  723. {
  724. label: "天数",
  725. prop: "days",
  726. overHidden: true,
  727. },
  728. {
  729. label: "入库日期",
  730. prop: "storageDate",
  731. overHidden: true,
  732. },
  733. {
  734. label: "出库日期",
  735. prop: "outboundDate",
  736. overHidden: true,
  737. },
  738. {
  739. label: "备注",
  740. prop: "remarks",
  741. cell: true,
  742. width: '200',
  743. overHidden: true,
  744. },
  745. ]
  746. },
  747. selectionDList: [],
  748. selectionCList: [],
  749. templateData: [],
  750. lefttemplate: {}, // 左侧选择的数据
  751. feesselectionList: [], // 清空多选
  752. templateRightData: [],
  753. itemIds: null,
  754. }
  755. },
  756. async created() {
  757. this.optionD = await this.getColumnData(this.getColumnName(392), this.optionDBack);
  758. this.optionC = await this.getColumnData(this.getColumnName(393), this.optionCBack);
  759. },
  760. methods: {
  761. // 模板导入
  762. templateExport() {
  763. if (!this.lefttemplate.id) {
  764. this.$message.warning('请选择左侧客户')
  765. return
  766. }
  767. if (this.feesselectionList.length > 0) {
  768. feecenterTemplateImport({
  769. ...this.lefttemplate,
  770. feesTemplateItemsList: this.feesselectionList,
  771. billNoId: this.form.id
  772. }).then(res => {
  773. if (res.data.msg.indexOf('未导入') >= 0) {
  774. this.$message({
  775. type: "error",
  776. message: res.data.msg
  777. });
  778. } else {
  779. this.$message({
  780. type: "success",
  781. message: res.data.msg
  782. });
  783. }
  784. this.feesselectionList = [] // 清空多选
  785. this.templateRightData = [] // 清空数据
  786. this.lefttemplate = {}//左侧数据
  787. this.$emit('getDetails', this.form.id)
  788. this.templateVisible = false
  789. })
  790. } else {
  791. this.$message.warning('请先选择要导入的数据')
  792. }
  793. },
  794. // 模板
  795. // 左侧选择
  796. nodeClick(e) {
  797. this.lefttemplate = e
  798. losbfeestemplateDetail(e.id).then(res => {
  799. this.templateRightData = res.data.data.feesTemplateItemsList
  800. })
  801. },
  802. // 关闭弹窗
  803. handleClose(done) {
  804. this.feesselectionList = [] // 清空多选
  805. this.templateRightData = [] // 清空数据
  806. done();
  807. },
  808. subSubmit() {
  809. let obj = {}
  810. obj = {
  811. id: this.form.id,
  812. billId: this.subselectionList[0].id
  813. }
  814. transferOfPledge(obj).then(res => {
  815. this.$message.success("确认成功");
  816. this.$emit('getDetails', this.form.id)
  817. this.subDialog = false
  818. })
  819. },
  820. subselectionChange(list) {
  821. this.subselectionList = list;
  822. },
  823. subClosed() {
  824. this.subData = []
  825. this.subselectionList = []
  826. },
  827. searchReset() {
  828. this.query = this.$options.data().query;
  829. this.onLoad(this.page);
  830. },
  831. onLoad(page, params = {}) {
  832. let obj = {}
  833. obj = {
  834. ...Object.assign(params, this.query),
  835. id: this.form.id
  836. }
  837. console.log(obj)
  838. this.loading = true;
  839. getListTradeV1(page.currentPage, page.pageSize, obj).then(res => {
  840. this.subData = res.data.data.records;
  841. this.page.total = res.data.data.total;
  842. this.$nextTick(() => {
  843. this.$refs.subCrud.doLayout();
  844. });
  845. }).finally(() => {
  846. this.loading = false;
  847. })
  848. },
  849. // 搜索按钮点击
  850. searchChange(params, done) {
  851. this.page.currentPage = 1;
  852. this.onLoad(this.page, this.query);
  853. done();
  854. },
  855. feeselectionChange(list) {
  856. this.feesselectionList = list;
  857. },
  858. addRow(type) {
  859. if (!this.form.id) return this.$message.error('请保存数据');
  860. if (type == 'D') {
  861. if (this.form.feeCenterListD.length == 0) {
  862. this.form.feeCenterListD.push({
  863. $cellEdit: true,
  864. pid: this.form.id,
  865. dc: type,
  866. accStatus: 0,
  867. corpCnName: this.form.corpCnName,
  868. corpId: this.form.corpId,
  869. businessType: this.form.businessType,
  870. billNo: this.form.businessNo,
  871. billDate: this.form.businessDate,
  872. })
  873. } else {
  874. this.form.feeCenterListD.push({
  875. $cellEdit: true,
  876. pid: this.form.id,
  877. dc: type,
  878. accStatus: 0,
  879. businessType: this.form.businessType,
  880. billNo: this.form.businessNo,
  881. billDate: this.form.businessDate,
  882. corpCnName: this.form.feeCenterListD[this.form.feeCenterListD.length - 1].corpCnName,
  883. corpId: this.form.feeCenterListD[this.form.feeCenterListD.length - 1].corpId,
  884. corpEnName: this.form.feeCenterListD[this.form.feeCenterListD.length - 1].corpEnName,
  885. billCorpId: this.form.feeCenterListD[this.form.feeCenterListD.length - 1].billCorpId,
  886. billCorpCnName: this.form.feeCenterListD[this.form.feeCenterListD.length - 1].billCorpCnName,
  887. })
  888. }
  889. }
  890. if (type == 'C') {
  891. if (this.form.feeCenterListC.length == 0) {
  892. this.form.feeCenterListC.push({
  893. $cellEdit: true,
  894. pid: this.form.id,
  895. dc: type,
  896. accStatus: 0,
  897. corpCnName: this.form.corpCnName,
  898. corpId: this.form.corpId,
  899. businessType: this.form.businessType,
  900. billNo: this.form.businessNo,
  901. billDate: this.form.businessDate,
  902. })
  903. } else {
  904. this.form.feeCenterListC.push({
  905. $cellEdit: true,
  906. pid: this.form.id,
  907. dc: type,
  908. accStatus: 0,
  909. businessType: this.form.businessType,
  910. billNo: this.form.businessNo,
  911. billDate: this.form.businessDate,
  912. corpCnName: this.form.feeCenterListC[this.form.feeCenterListC.length - 1].corpCnName,
  913. corpId: this.form.feeCenterListC[this.form.feeCenterListC.length - 1].corpId,
  914. corpEnName: this.form.feeCenterListC[this.form.feeCenterListC.length - 1].corpEnName,
  915. billCorpId: this.form.feeCenterListC[this.form.feeCenterListC.length - 1].billCorpId,
  916. billCorpCnName: this.form.feeCenterListC[this.form.feeCenterListC.length - 1].billCorpCnName,
  917. })
  918. }
  919. }
  920. },
  921. countChange(row) {
  922. row.amount = _.multiply(Number(row.quantity ? row.quantity : 0), Number(row.price ? row.price : 0))
  923. if (row.feeCode == 'SFK' || row.feeCode == 'WK') {
  924. row.amount = _.multiply(Number(row.amountLoc ? row.amountLoc : 0), Number(row.exrate ? row.exrate : 0))
  925. }
  926. },
  927. selectionDChange(list) {
  928. let ids = []
  929. list.forEach(e => {
  930. ids.push(e.id)
  931. })
  932. if (ids.length) {
  933. this.itemIds = ids.join(',')
  934. } else {
  935. this.itemIds = null
  936. }
  937. this.selectionDList = list
  938. },
  939. selectionCChange(list) {
  940. let ids = []
  941. list.forEach(e => {
  942. ids.push(e.id)
  943. })
  944. if (ids.length) {
  945. this.itemIds = ids.join(',')
  946. } else {
  947. this.itemIds = null
  948. }
  949. this.selectionCList = list
  950. },
  951. rowDicChange(name, row, el) {
  952. if (name == 'corpCnName') {
  953. if (row) {
  954. el.corpId = row.id
  955. el.corpEnName = row.enName
  956. el.billCorpId = row.id
  957. el.billCorpCnName = row.cnName
  958. } else {
  959. el.corpId = null
  960. el.corpEnName = null
  961. el.billCorpId = null
  962. el.billCorpCnName = null
  963. }
  964. }
  965. if (name == 'feeCnName') {
  966. if (row) {
  967. el.feeId = row.id
  968. el.feeCode = row.code
  969. el.feeEnName = row.enName
  970. el.curCode = row.curNo
  971. el.elementsId = row.accElementId
  972. el.elementsCode = row.elementsCode
  973. el.elementsCnName = row.accElementName
  974. el.elementsEnName = row.elementsEnName
  975. bcurrencyGetExrate({ date: this.form.contractDate, dc: el.dc }).then(res => {
  976. res.data.data.forEach(e => {
  977. if (row.curNo == e.code) {
  978. this.$set(el, 'exrate', e.exrate)
  979. }
  980. })
  981. })
  982. } else {
  983. el.feeId = null
  984. el.feeCode = null
  985. el.feeEnName = null
  986. el.curCode = null
  987. el.elementsId = null
  988. el.elementsCode = null
  989. el.elementsCnName = null
  990. el.elementsEnName = null
  991. }
  992. }
  993. if (name == 'curCode') {
  994. if (row) {
  995. bcurrencyGetExrate({ date: this.form.contractDate, dc: el.dc }).then(res => {
  996. res.data.data.forEach(e => {
  997. if (el.curCode == e.code) {
  998. this.$set(el, 'exrate', e.exrate)
  999. }
  1000. })
  1001. })
  1002. } else {
  1003. el.exrate = null
  1004. }
  1005. }
  1006. },
  1007. allClick(name, type) {
  1008. if (name == '一键保存') {
  1009. if (type == 'D') {
  1010. for (let row of this.form.feeCenterListD) {
  1011. if (!row.corpCnName || !row.feeCnName || !row.price || !row.quantity || !row.curCode) {
  1012. this.$refs.crudD.rowCell(row, row.$index)
  1013. return this.$message.error((!row.corpCnName ? "往来单位," : '') + (!row.feeCnName ? "费用名称," : '') + (!row.price ? "单价," : '') + (!row.quantity ? "数量," : '') + (!row.curCode ? "币别," : '') + "不能为空");
  1014. }
  1015. }
  1016. this.form.feeCenterListD.forEach(e => {
  1017. this.$set(e, '$cellEdit', false)
  1018. })
  1019. const loading = this.$loading({
  1020. lock: true,
  1021. text: '加载中',
  1022. spinner: 'el-icon-loading',
  1023. background: 'rgba(255,255,255,0.7)'
  1024. });
  1025. submitListTrade(this.form.feeCenterListD).then(res => {
  1026. this.form.feeCenterListD = res.data.data
  1027. this.$message.success("保存成功");
  1028. }).finally(() => {
  1029. loading.close();
  1030. })
  1031. }
  1032. if (type == 'C') {
  1033. for (let row of this.form.feeCenterListC) {
  1034. if (!row.corpCnName || !row.feeCnName || !row.price || !row.quantity || !row.curCode) {
  1035. this.$refs.crudC.rowCell(row, row.$index)
  1036. return this.$message.error((!row.corpCnName ? "往来单位," : '') + (!row.feeCnName ? "费用名称," : '') + (!row.price ? "单价," : '') + (!row.quantity ? "数量," : '') + (!row.curCode ? "币别," : '') + "不能为空");
  1037. }
  1038. }
  1039. this.form.feeCenterListC.forEach(e => {
  1040. this.$set(e, '$cellEdit', false)
  1041. })
  1042. const loading = this.$loading({
  1043. lock: true,
  1044. text: '加载中',
  1045. spinner: 'el-icon-loading',
  1046. background: 'rgba(255,255,255,0.7)'
  1047. });
  1048. submitListTrade(this.form.feeCenterListC).then(res => {
  1049. this.form.feeCenterListC = res.data.data
  1050. this.$message.success("保存成功");
  1051. }).finally(() => {
  1052. loading.close();
  1053. })
  1054. }
  1055. }
  1056. if (name == '一键编辑') {
  1057. if (type == 'D') {
  1058. this.form.feeCenterListD.forEach(e => {
  1059. this.$set(e, '$cellEdit', true)
  1060. })
  1061. }
  1062. if (type == 'C') {
  1063. this.form.feeCenterListC.forEach(e => {
  1064. this.$set(e, '$cellEdit', true)
  1065. })
  1066. }
  1067. }
  1068. if (name == '批量删除') {
  1069. let multiList = []
  1070. let arr = []
  1071. for (let index in this.selectionDList) {
  1072. if (this.selectionDList[index].accStatus == 1) return this.$message.error("第" + (Number(this.selectionDList[index].$index) + 1) + "行不允许删除");
  1073. }
  1074. for (let index in this.selectionCList) {
  1075. if (this.selectionCList[index].accStatus == 1) return this.$message.error("第" + (Number(this.selectionCList[index].$index) + 1) + "行不允许删除");
  1076. }
  1077. if (type == 'D') {
  1078. this.$confirm("确定将选择数据删除?", {
  1079. confirmButtonText: "确定",
  1080. cancelButtonText: "取消",
  1081. type: "warning"
  1082. }).then(() => {
  1083. multiList = this.selectionDList
  1084. arr = this.form.feeCenterListD
  1085. // 获取有id 的数据
  1086. const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
  1087. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  1088. // 把选中的删除掉
  1089. multiList.forEach((item) => {
  1090. for (let index in arr) {
  1091. if (JSON.stringify(item) == JSON.stringify(arr[index])) {
  1092. arr.splice(Number(index), 1)
  1093. }
  1094. }
  1095. })
  1096. if (itemsWithId.length != 0) {
  1097. const loading = this.$loading({
  1098. lock: true,
  1099. text: '加载中',
  1100. spinner: 'el-icon-loading',
  1101. background: 'rgba(255,255,255,0.7)'
  1102. });
  1103. feeRemove({ ids: arrIds.join(',') }).then(res => {
  1104. this.$message.success("删除成功");
  1105. }).finally(() => {
  1106. loading.close();
  1107. })
  1108. }
  1109. })
  1110. }
  1111. if (type == 'C') {
  1112. this.$confirm("确定将选择数据删除?", {
  1113. confirmButtonText: "确定",
  1114. cancelButtonText: "取消",
  1115. type: "warning"
  1116. }).then(() => {
  1117. multiList = this.selectionCList
  1118. arr = this.form.feeCenterListC
  1119. // 获取有id 的数据
  1120. const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
  1121. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  1122. // 把选中的删除掉
  1123. multiList.forEach((item) => {
  1124. for (let index in arr) {
  1125. if (JSON.stringify(item) == JSON.stringify(arr[index])) {
  1126. arr.splice(Number(index), 1)
  1127. }
  1128. }
  1129. })
  1130. if (itemsWithId.length != 0) {
  1131. const loading = this.$loading({
  1132. lock: true,
  1133. text: '加载中',
  1134. spinner: 'el-icon-loading',
  1135. background: 'rgba(255,255,255,0.7)'
  1136. });
  1137. feeRemove({ ids: arrIds.join(',') }).then(res => {
  1138. this.$message.success("删除成功");
  1139. }).finally(() => {
  1140. loading.close();
  1141. })
  1142. }
  1143. })
  1144. }
  1145. }
  1146. if (name == '生成账单') {
  1147. if (type == 'D') {
  1148. for (let index in this.selectionDList) {
  1149. if (this.selectionDList[index].accStatus != 0) {
  1150. return this.$message.error("已生成账单");
  1151. }
  1152. if (this.selectionDList[index].whetherSynchronizationZzs == 1) {
  1153. return this.$message.error("增值税已同步,不能生成账单");
  1154. }
  1155. if (this.selectionDList[index].whetherSynchronizationTariff == 1) {
  1156. return this.$message.error("关税已同步,不能生成账单");
  1157. }
  1158. }
  1159. this.$confirm("确定将选择数据生成账单?", {
  1160. confirmButtonText: "确定",
  1161. cancelButtonText: "取消",
  1162. type: "warning"
  1163. }).then(() => {
  1164. const loading = this.$loading({
  1165. lock: true,
  1166. text: '加载中',
  1167. spinner: 'el-icon-loading',
  1168. background: 'rgba(255,255,255,0.7)'
  1169. });
  1170. generateBill({ id: this.form.id, feeCenterListD: this.selectionDList }).then(res => {
  1171. this.$message.success("成功生成账单");
  1172. this.$emit('getDetails', this.form.id)
  1173. }).finally(() => {
  1174. loading.close();
  1175. })
  1176. })
  1177. }
  1178. if (type == 'C') {
  1179. for (let index in this.selectionCList) {
  1180. if (this.selectionCList[index].accStatus != 0) {
  1181. return this.$message.error("已生成账单");
  1182. }
  1183. }
  1184. this.$confirm("确定将选择数据生成账单?", {
  1185. confirmButtonText: "确定",
  1186. cancelButtonText: "取消",
  1187. type: "warning"
  1188. }).then(() => {
  1189. const loading = this.$loading({
  1190. lock: true,
  1191. text: '加载中',
  1192. spinner: 'el-icon-loading',
  1193. background: 'rgba(255,255,255,0.7)'
  1194. });
  1195. generateBill({ id: this.form.id, feeCenterListC: this.selectionCList }).then(res => {
  1196. this.$message.success("成功生成账单");
  1197. this.$emit('getDetails', this.form.id)
  1198. }).finally(() => {
  1199. loading.close();
  1200. })
  1201. })
  1202. }
  1203. }
  1204. if (name == '撤销账单') {
  1205. if (type == 'D') {
  1206. for (let index in this.selectionDList) {
  1207. if (this.selectionDList[index].accStatus != 1) {
  1208. return this.$message.error("未生成账单");
  1209. }
  1210. }
  1211. this.$confirm("确定将选择数据撤销账单?", {
  1212. confirmButtonText: "确定",
  1213. cancelButtonText: "取消",
  1214. type: "warning"
  1215. }).then(() => {
  1216. const loading = this.$loading({
  1217. lock: true,
  1218. text: '加载中',
  1219. spinner: 'el-icon-loading',
  1220. background: 'rgba(255,255,255,0.7)'
  1221. });
  1222. revokeBill({ id: this.form.id, feeCenterListD: this.selectionDList }).then(res => {
  1223. this.$message.success("成功撤销账单");
  1224. this.$emit('getDetails', this.form.id)
  1225. }).finally(() => {
  1226. loading.close();
  1227. })
  1228. })
  1229. }
  1230. if (type == 'C') {
  1231. for (let index in this.selectionCList) {
  1232. if (this.selectionCList[index].accStatus != 1) {
  1233. return this.$message.error("未生成账单");
  1234. }
  1235. }
  1236. this.$confirm("确定将选择数据撤销账单?", {
  1237. confirmButtonText: "确定",
  1238. cancelButtonText: "取消",
  1239. type: "warning"
  1240. }).then(() => {
  1241. const loading = this.$loading({
  1242. lock: true,
  1243. text: '加载中',
  1244. spinner: 'el-icon-loading',
  1245. background: 'rgba(255,255,255,0.7)'
  1246. });
  1247. revokeBill({ id: this.form.id, feeCenterListC: this.selectionCList }).then(res => {
  1248. this.$message.success("成功撤销账单");
  1249. this.$emit('getDetails', this.form.id)
  1250. }).finally(() => {
  1251. loading.close();
  1252. })
  1253. })
  1254. }
  1255. }
  1256. if (name == '增值税') {
  1257. if (type == 'C') {
  1258. let obj = {}
  1259. obj = {
  1260. id: this.form.id,
  1261. type: 1
  1262. }
  1263. const loading = this.$loading({
  1264. lock: true,
  1265. text: '加载中',
  1266. spinner: 'el-icon-loading',
  1267. background: 'rgba(255,255,255,0.7)'
  1268. });
  1269. synchronization(obj).then(res => {
  1270. this.$message.success("操作成功");
  1271. this.$emit('getDetails', this.form.id)
  1272. }).finally(() => {
  1273. loading.close();
  1274. })
  1275. }
  1276. }
  1277. if (name == '关税') {
  1278. if (type == 'C') {
  1279. let obj = {}
  1280. obj = {
  1281. id: this.form.id,
  1282. type: 2
  1283. }
  1284. const loading = this.$loading({
  1285. lock: true,
  1286. text: '加载中',
  1287. spinner: 'el-icon-loading',
  1288. background: 'rgba(255,255,255,0.7)'
  1289. });
  1290. synchronization(obj).then(res => {
  1291. this.$message.success("操作成功");
  1292. this.$emit('getDetails', this.form.id)
  1293. }).finally(() => {
  1294. loading.close();
  1295. })
  1296. }
  1297. }
  1298. if (name == '应收模板') {
  1299. this.templateVisible = true
  1300. losbfeestemplateGetListTemplate(1, 50, {
  1301. dc: type,
  1302. status: 0,
  1303. type: 'HYJK'
  1304. }).then(res => {
  1305. this.templateData = res.data.data.records
  1306. // 查第一条的明细
  1307. losbfeestemplateDetail(this.templateData[0].id).then(res => {
  1308. this.templateRightData = res.data.data.feesTemplateItemsList
  1309. })
  1310. })
  1311. }
  1312. if (name == '应付模板') {
  1313. this.templateVisible = true
  1314. losbfeestemplateGetListTemplate(1, 50, {
  1315. dc: type,
  1316. status: 0,
  1317. type: 'HYJK'
  1318. }).then(res => {
  1319. this.templateData = res.data.data.records
  1320. // 查第一条的明细
  1321. losbfeestemplateDetail(this.templateData[0].id).then(res => {
  1322. this.templateRightData = res.data.data.feesTemplateItemsList
  1323. })
  1324. })
  1325. }
  1326. if (name == '生成应付') {
  1327. if (this.selectionDList.length == 0) return this.$message.error("请选择费用");
  1328. let arr = this.deepClone(this.selectionDList)
  1329. arr.forEach(e => {
  1330. e.dc = 'C'
  1331. delete e.id
  1332. delete e.createTime
  1333. delete e.createUser
  1334. delete e.createUserName
  1335. delete e.updateTime
  1336. delete e.updateUser
  1337. delete e.updateUserName
  1338. })
  1339. this.form.feeCenterListC = this.form.feeCenterListC.concat(arr)
  1340. }
  1341. if (name == '生成应收') {
  1342. if (this.selectionCList.length == 0) return this.$message.error("请选择费用");
  1343. let arr = this.deepClone(this.selectionCList)
  1344. arr.forEach(e => {
  1345. e.dc = 'D'
  1346. delete e.id
  1347. delete e.createTime
  1348. delete e.createUser
  1349. delete e.createUserName
  1350. delete e.updateTime
  1351. delete e.updateUser
  1352. delete e.updateUserName
  1353. })
  1354. this.form.feeCenterListD = this.form.feeCenterListD.concat(arr)
  1355. }
  1356. if (name == '转押') {
  1357. if (type == 'C') {
  1358. this.subDialog = true
  1359. this.onLoad(this.page, this.query);
  1360. }
  1361. }
  1362. if (name == '撤销转押') {
  1363. revokeTransferOfPledge({ id: this.form.id }).then(res => {
  1364. this.$message.success("撤销成功");
  1365. this.$emit('getDetails', this.form.id)
  1366. })
  1367. }
  1368. },
  1369. submitValidate() {
  1370. if (this.form.feeCenterListD.length) {
  1371. for (let row of this.form.feeCenterListD) {
  1372. if (!row.corpCnName || !row.feeCnName || !row.price || !row.quantity || !row.curCode) {
  1373. this.$refs.crudD.rowCell(row, row.$index)
  1374. this.$message.error((!row.corpCnName ? "往来单位," : '') + (!row.feeCnName ? "费用名称," : '') + (!row.price ? "单价," : '') + (!row.quantity ? "数量," : '') + (!row.curCode ? "币别," : '') + "不能为空");
  1375. return false
  1376. }
  1377. }
  1378. }
  1379. if (this.form.feeCenterListC.length) {
  1380. for (let row of this.form.feeCenterListC) {
  1381. if (!row.corpCnName || !row.feeCnName || !row.price || !row.quantity || !row.curCode) {
  1382. this.$refs.crudC.rowCell(row, row.$index)
  1383. this.$message.error((!row.corpCnName ? "往来单位," : '') + (!row.feeCnName ? "费用名称," : '') + (!row.price ? "单价," : '') + (!row.quantity ? "数量," : '') + (!row.curCode ? "币别," : '') + "不能为空");
  1384. return false
  1385. }
  1386. }
  1387. for (let index in this.form.feeCenterListC) {
  1388. if (this.form.feeCenterListC[index].feeCnName == '首款' || this.form.feeCenterListC[index].feeCnName == '尾款' || this.form.feeCenterListC[index].feeCnName == '手续费') {
  1389. if (!this.form.feeCenterListC[index].discountExrate) {
  1390. this.$message.error("第" + (Number(index) + 1) + "行" + this.form.feeCenterListC[index].feeCnName + "费用优惠汇率不能为空");
  1391. return false
  1392. }
  1393. }
  1394. }
  1395. }
  1396. return true
  1397. },
  1398. //自定义列保存
  1399. async saveColumn(ref, option, optionBack, code) {
  1400. /**
  1401. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1402. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1403. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1404. */
  1405. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1406. if (inSave) {
  1407. this.$message.success("保存成功");
  1408. //关闭窗口
  1409. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1410. }
  1411. },
  1412. //自定义列重置
  1413. async resetColumn(ref, option, optionBack, code) {
  1414. this[option] = this[optionBack];
  1415. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1416. if (inSave) {
  1417. this.$message.success("重置成功");
  1418. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1419. }
  1420. },
  1421. tableRowClassName({ row }) {
  1422. if (row.stlStatus == 1) {
  1423. return 'class-row2';
  1424. } else if (row.accStatus == 1) {
  1425. return 'class-row1';
  1426. }
  1427. return '';
  1428. }
  1429. },
  1430. }
  1431. </script>
  1432. <style>
  1433. .class-row1 {
  1434. color: #67C23A !important;
  1435. }
  1436. .class-row2 {
  1437. color: #F56C6C !important;
  1438. }
  1439. </style>
  1440. <style scoped lang="scss">
  1441. .disabledBox {
  1442. display: flex;
  1443. align-items: center;
  1444. }
  1445. .fontSize {
  1446. font-size: 16px;
  1447. color: #81B337;
  1448. }
  1449. .meetSize {
  1450. font-size: 16px;
  1451. color: #54BCBD;
  1452. }
  1453. ::v-deep#out-table .back-one {
  1454. background: #ecf5ff !important;
  1455. text-align: center;
  1456. padding: 4px 0;
  1457. }
  1458. ::v-deep#out-table .back-two {
  1459. background: #ecf5ff !important;
  1460. text-align: center;
  1461. padding: 4px 0;
  1462. }
  1463. ::v-deep .el-table--small td,
  1464. .el-table--small th {
  1465. padding: 2px !important;
  1466. }
  1467. </style>