index.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="客户" prop="fCorpid">
  5. <el-select
  6. v-model="queryParams.fCorpid"
  7. filterable
  8. remote
  9. clearable
  10. style="width: 200px"
  11. size="small"
  12. @keyup.enter.native="handleQuery"
  13. :remote-method="corpsRemoteMethod"
  14. placeholder="请选择客户"
  15. >
  16. <el-option
  17. v-for="(dict, index) in fMblnoOptions"
  18. :key="index.fId"
  19. :label="dict.fName"
  20. :value="dict.fId"
  21. ></el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="提单号" prop="fMblno">
  25. <el-input
  26. v-model="queryParams.fMblno"
  27. placeholder="请输入提单号"
  28. clearable
  29. style="width: 200px"
  30. size="small"
  31. @keyup.enter.native="handleQuery"
  32. />
  33. </el-form-item>
  34. <!-- <el-form-item label="结算单位" prop="fToCorpid">-->
  35. <!-- <el-select-->
  36. <!-- v-model="queryParams.fToCorpid"-->
  37. <!-- placeholder="请选择结算单位"-->
  38. <!-- filterable-->
  39. <!-- remote-->
  40. <!-- clearable-->
  41. <!-- style="width: 200px"-->
  42. <!-- size="small"-->
  43. <!-- @keyup.enter.native="handleQuery"-->
  44. <!-- :remote-method="corpsRemoteMethod"-->
  45. <!-- >-->
  46. <!-- <el-option-->
  47. <!-- v-for="(dict, index) in fMblnoOptions"-->
  48. <!-- :key="index.fId"-->
  49. <!-- :label="dict.fName"-->
  50. <!-- :value="dict.fId"-->
  51. <!-- ></el-option>-->
  52. <!-- </el-select>-->
  53. <!-- </el-form-item>-->
  54. <el-form-item label="货物名称" prop="fProductName">
  55. <el-select
  56. v-model="queryParams.fProductName"
  57. filterable
  58. remote
  59. clearable
  60. size="small"
  61. style="width: 200px"
  62. :remote-method="goodsRemoteMethod"
  63. @keyup.enter.native="handleQuery"
  64. placeholder="请选择货物名称"
  65. >
  66. <el-option
  67. v-for="(dict, index) in goodsOptions"
  68. :key="index.fId"
  69. :label="dict.fName"
  70. :value="dict.fName"
  71. ></el-option>
  72. </el-select>
  73. </el-form-item>
  74. <el-form-item label="品牌" prop="fMarks">
  75. <el-input
  76. v-model="queryParams.fMarks"
  77. placeholder="请输入品牌"
  78. clearable
  79. style="width: 200px"
  80. size="small"
  81. @keyup.enter.native="handleQuery"
  82. />
  83. </el-form-item>
  84. <el-form-item label="结算状态" prop="fReconciliation">
  85. <el-select
  86. v-model="queryParams.fReconciliation"
  87. clearable
  88. style="width: 200px"
  89. size="small"
  90. @keyup.enter.native="handleQuery"
  91. >
  92. <el-option label="未收" value="0"/>
  93. <el-option label="全部" value="1"/>
  94. </el-select>
  95. </el-form-item>
  96. <el-form-item label="费用状态" prop="fBillstatus">
  97. <el-select
  98. v-model="queryParams.fBillstatus"
  99. clearable
  100. style="width: 200px"
  101. size="small"
  102. @keyup.enter.native="handleQuery"
  103. >
  104. <el-option label="录入" value="0"/>
  105. <el-option label="审核通过" value="1"/>
  106. </el-select>
  107. </el-form-item>
  108. <el-form-item label="作业类型" prop="fBusinessType">
  109. <el-select
  110. style="width: 200px"
  111. multiple
  112. v-model="queryParams.fBusinessType"
  113. filterable
  114. >
  115. <el-option
  116. v-for="(dict, index) in businessTypeOption"
  117. :key="index.dictValue"
  118. :label="dict.dictLabel"
  119. :value="dict.dictValue"
  120. ></el-option>
  121. </el-select>
  122. </el-form-item>
  123. <el-form-item label="费用名称" prop="fFeeid">
  124. <el-select
  125. style="width: 200px"
  126. multiple
  127. :remote-method="fWRemoteMethod"
  128. v-model="queryParams.fFeeid"
  129. filterable
  130. >
  131. <el-option
  132. v-for="(dict, index) in fWbuOptions"
  133. :key="index.fId"
  134. :label="dict.fName"
  135. :value="dict.fId"
  136. ></el-option>
  137. </el-select>
  138. </el-form-item>
  139. <el-form-item label="审核日期" prop="timeExamine">
  140. <el-date-picker
  141. v-model="queryParams.timeExamine"
  142. type="daterange"
  143. value-format="yyyy-MM-dd"
  144. clearable
  145. style="width: 280px"
  146. range-separator="至"
  147. start-placeholder="开始日期"
  148. end-placeholder="结束日期"
  149. @keyup.enter.native="handleQuery"
  150. :picker-options="pickerOptions"
  151. unlink-panels
  152. >
  153. </el-date-picker>
  154. </el-form-item>
  155. <el-form-item label="审核状态">
  156. <el-select
  157. v-model="queryParams.fBillProfits"
  158. placeholder="请选择状态"
  159. clearable
  160. size="small"
  161. filterable
  162. >
  163. <el-option label="全部" :value="1"></el-option>
  164. <el-option label="待审" :value="4"></el-option>
  165. <el-option label="审核通过" :value="6"></el-option>
  166. </el-select>
  167. </el-form-item>
  168. <el-form-item label="船名" prop="fVslid" v-if="sysType == 3">
  169. <el-select
  170. v-model="queryParams.fVslid"
  171. placeholder="请选择船名"
  172. clearable
  173. size="small"
  174. filterable
  175. >
  176. <el-option
  177. v-for="item in vesselOptions"
  178. :key="item.fId"
  179. :label="item.fName"
  180. :value="item.fId"
  181. />
  182. </el-select>
  183. </el-form-item>
  184. <el-form-item label="航次" prop="fVoyid" v-if="sysType == 3">
  185. <el-select
  186. v-model="queryParams.fVoyid"
  187. placeholder="请选择航次"
  188. clearable
  189. size="small"
  190. filterable
  191. >
  192. <el-option
  193. v-for="item in voyageOptions"
  194. :key="item.fId"
  195. :label="item.fNo"
  196. :value="item.fId"/>
  197. </el-select>
  198. </el-form-item>
  199. <el-form-item>
  200. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  201. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  202. </el-form-item>
  203. </el-form>
  204. <el-row :gutter="10" class="mb8">
  205. <div class="tabSetting">
  206. <el-col :span="1.5">
  207. <el-button
  208. type="warning"
  209. icon="el-icon-download"
  210. size="mini"
  211. @click="handleExport"
  212. v-hasPermi="['warehouseBusiness:profit:export']"
  213. >导出
  214. </el-button>
  215. </el-col>
  216. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  217. <div style="margin: 0 12px">
  218. <el-button
  219. icon="el-icon-setting"
  220. size="mini"
  221. circle
  222. @click="showSetting = !showSetting"
  223. ></el-button>
  224. </div>
  225. </div>
  226. </el-row>
  227. <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px">
  228. <div>配置排序列数据(拖动调整顺序)</div>
  229. <div style="margin-left: 17px">
  230. <el-checkbox
  231. v-model="allCheck"
  232. label="全选"
  233. @change="allChecked"
  234. ></el-checkbox>
  235. </div>
  236. <div style="padding: 4px; display: flex; justify-content: center">
  237. <draggable
  238. v-model="setRowList"
  239. group="site"
  240. animation="300"
  241. @start="onStart"
  242. @end="onEnd"
  243. handle=".indraggable"
  244. >
  245. <transition-group>
  246. <div
  247. v-for="item in setRowList"
  248. :key="item.surface"
  249. class="listStyle"
  250. >
  251. <div style="width: 500px" class="indraggable">
  252. <div class="progress" :style="{ width: item.width + 'px' }">
  253. <el-checkbox
  254. :label="item.name"
  255. v-model="item.checked"
  256. :true-label="0"
  257. :false-label="1"
  258. >{{ item.name }}
  259. </el-checkbox>
  260. </div>
  261. </div>
  262. <el-input-number
  263. v-model.number="item.width"
  264. controls-position="right"
  265. :min="1"
  266. :max="500"
  267. size="mini"
  268. ></el-input-number>
  269. </div>
  270. </transition-group>
  271. </draggable>
  272. </div>
  273. <span slot="footer" class="dialog-footer">
  274. <el-button @click="showSetting = false">取 消</el-button>
  275. <el-button @click="delRow" type="danger">重 置</el-button>
  276. <el-button type="primary" @click="save()">确 定</el-button>
  277. </span>
  278. </el-dialog>
  279. <el-table v-loading="loading" :data="receivableList" show-summary :summary-method="getSum" ref="table" :height="tableHeight" @expand-change="expandChange">
  280. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  281. <el-table-column type="expand" fixed="left" v-if="sysType == 3">
  282. <template slot-scope="props">
  283. <el-table
  284. :data="props.row.dataList"
  285. v-loading="props.row.loading"
  286. >
  287. <el-table-column label="客户名称" prop="fCorpid" align="center" show-overflow-tooltip width="180">
  288. <template slot-scope="scope">
  289. <span>{{ scope.row.fCorpid | nameFormat(nameOptions) }}</span>
  290. </template>
  291. </el-table-column>
  292. <el-table-column label="费用名称" prop="fFeeid" align="center" show-overflow-tooltip width="100">
  293. <template slot-scope="scope">
  294. <span v-if="scope.row.fDc == 'D'">
  295. {{ scope.row.fFeeid | fDNameFormat(fDNameOptions) }}
  296. </span>
  297. <span v-if="scope.row.fDc == 'C'">
  298. {{ scope.row.fFeeid | fDNameFormat(fCNameOptions) }}
  299. </span>
  300. </template>
  301. </el-table-column>
  302. <el-table-column label="计价单位" prop="fFeeunitid" align="center" show-overflow-tooltip width="100">
  303. <template slot-scope="scope">
  304. <span>{{ scope.row.fFeeunitid | jFeetunitFormat(jFeetunitOptions) }}</span>
  305. </template>
  306. </el-table-column>
  307. <el-table-column label="数量" prop="fQty" align="center" show-overflow-tooltip width="100">
  308. </el-table-column>
  309. <el-table-column label="单价" prop="fUnitprice" align="center" show-overflow-tooltip width="100">
  310. </el-table-column>
  311. <el-table-column label="金额" prop="fAmount" align="center" show-overflow-tooltip width="100">
  312. </el-table-column>
  313. <el-table-column label="收付" prop="fDc" align="center" show-overflow-tooltip width="100">
  314. <template slot-scope="scope">
  315. <span v-if="scope.row.fDc == 'D'">收款</span>
  316. <span v-if="scope.row.fDc == 'C'">付款</span>
  317. </template>
  318. </el-table-column>
  319. </el-table>
  320. </template>
  321. </el-table-column>
  322. <el-table-column type="index" label="行号" align="center" width="100"/>
  323. <el-table-column
  324. v-for="(item, index) in getRowList"
  325. :key="index"
  326. :label="item.name"
  327. :width="item.width"
  328. :prop="item.label"
  329. align="center"
  330. :show-overflow-tooltip="true"
  331. sortable
  332. :fixed="item.fixed"
  333. />
  334. <!-- <el-table-column label="货权方" sortable align="center" prop="fName" width="220"/>
  335. <el-table-column label="结算单位" sortable align="center" prop="fFeesName" width="220"/>
  336. <el-table-column label="提单号" sortable align="center" prop="fMblno" width="216" show-overflow-tooltip/>
  337. <el-table-column label="货物名称" align="center" prop="fProductName" show-overflow-tooltip/>
  338. <el-table-column label="品牌" align="center" prop="fMarks" width="120"/>
  339. <el-table-column label="审核日期" align="center" prop="fReviewDate">
  340. <template slot-scope="scope">
  341. <span>{{ parseTime(scope.row.fReviewDate, '{y}-{m}-{d}') }}</span>
  342. </template>
  343. </el-table-column>
  344. <el-table-column label="应收金额" align="center" prop="fAmount"/>
  345. <el-table-column label="应付金额" align="center" prop="fStlamount"/>
  346. <el-table-column label="利润" align="center" prop="nnfinished"/> -->
  347. </el-table>
  348. <pagination
  349. v-show="total>0"
  350. :total="total"
  351. :page.sync="queryParams.pageNum"
  352. :limit.sync="queryParams.pageSize"
  353. :page-sizes="[50,100, 200, 500, 1000]"
  354. @pagination="getList"
  355. />
  356. </div>
  357. </template>
  358. <script>
  359. import {
  360. listpayable,
  361. listWhgenleg,
  362. getWhgenleg,
  363. delWhgenleg,
  364. addWhgenleg,
  365. updateWhgenleg,
  366. exportWhgenleg,
  367. selectListDC,
  368. } from '@/api/reportManagement/profit'
  369. import { listWarehouse } from '@/api/basicdata/warehouse'
  370. import { listArea } from '@/api/basicdata/area'
  371. import { listGoods } from '@/api/basicdata/goods'
  372. import { listCorps } from '@/api/basicdata/corps'
  373. import { listFees } from '@/api/basicdata/fees'
  374. import { addSet, select, resetModule } from "@/api/system/set";
  375. import Cookies from "js-cookie";
  376. import draggable from "vuedraggable";
  377. import { getVesselName } from '@/api/finance/applyForInvoice/chargeInvoice';
  378. import { getVoyageName } from '@/api/finance/applyForInvoice/feeDetail';
  379. import {
  380. getFName,
  381. } from '@/api/kaihe/domesticTrade/orderInformation'
  382. export default {
  383. name: 'profitGeneralLedger',
  384. components: {draggable},
  385. data() {
  386. return {
  387. pickerOptions: {
  388. shortcuts: [{
  389. text: '最近一周',
  390. onClick(picker) {
  391. const end = new Date();
  392. const start = new Date();
  393. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  394. picker.$emit('pick', [start, end]);
  395. }
  396. }, {
  397. text: '最近一个月',
  398. onClick(picker) {
  399. const end = new Date();
  400. const start = new Date();
  401. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  402. picker.$emit('pick', [start, end]);
  403. }
  404. }, {
  405. text: '最近三个月',
  406. onClick(picker) {
  407. const end = new Date();
  408. const start = new Date();
  409. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  410. picker.$emit('pick', [start, end]);
  411. }
  412. }]
  413. },
  414. tableHeight: '0',
  415. //费用名称
  416. fWbuOptions:[],
  417. businessInTypeOption:[],
  418. businessOutTypeOption:[],
  419. businessTransTypeOption:[],
  420. businessTypeOption: [],
  421. // 货权方(客户数据)
  422. fMblnoOptions: [],
  423. // 贸易方式(数据字典),对应t_trademodels 字典
  424. fTrademodeidOptions: [],
  425. // 货物
  426. goodsOptions: [],
  427. // 仓库(仓库数据)
  428. warehouseOptions: [],
  429. kqhouseOptions: [],
  430. // 遮罩层
  431. loading: true,
  432. // 显示搜索条件
  433. showSearch: true,
  434. // 总条数
  435. total: 0,
  436. // 库存总账表格数据
  437. receivableList: [],
  438. // 弹出层标题
  439. title: '',
  440. // 是否显示弹出层
  441. open: false,
  442. // 查询参数
  443. queryParams: {
  444. pageNum: 1,
  445. pageSize: 50,
  446. fCorpid: null,
  447. fMblno: null,
  448. timeExamine: null,
  449. fToCorpid: null,
  450. fProductName: null,
  451. fMarks: null,
  452. fReconciliation: null,
  453. fBillstatus: null,
  454. fBusinessType:null,
  455. fFeeid:null
  456. },
  457. // 表单参数
  458. form: {},
  459. // 表单校验
  460. rules: {
  461. fMarks: [
  462. { required: true, message: '唛头不能为空', trigger: 'blur' }
  463. ]
  464. },
  465. showSetting: false,
  466. drag: false,
  467. setRowList: [],
  468. getRowList: [],
  469. tableDate: [
  470. {
  471. surface: "1",
  472. label: "fName",
  473. name: "客户",
  474. checked: 0,
  475. width: 150,
  476. },
  477. // {
  478. // surface: "2",
  479. // label: "fFeesName",
  480. // name: "结算单位",
  481. // checked: 0,
  482. // width: 120,
  483. // },
  484. {
  485. surface: "3",
  486. label: "fMblno",
  487. name: "提单号",
  488. checked: 0,
  489. width: 150,
  490. },
  491. {
  492. surface: "4",
  493. label: "fProductName",
  494. name: "货物名称",
  495. checked: 0,
  496. width: 150,
  497. },
  498. {
  499. surface: "5",
  500. label: "fMarks",
  501. name: "品牌",
  502. checked: 0,
  503. width: 150,
  504. },
  505. {
  506. surface: "6",
  507. label: "fReviewDate",
  508. name: "审核日期",
  509. checked: 0,
  510. width: 150,
  511. },
  512. {
  513. surface: "7",
  514. label: "fAmount",
  515. name: "应收金额",
  516. checked: 0,
  517. width: 120,
  518. },
  519. {
  520. surface: "8",
  521. label: "fStlamount",
  522. name: "应付金额",
  523. checked: 0,
  524. width: 120,
  525. },
  526. {
  527. surface: "9",
  528. label: "nnfinished",
  529. name: "利润",
  530. checked: 0,
  531. width: 120,
  532. },
  533. {
  534. surface: "10",
  535. label: "salesmanName",
  536. name: "业务员",
  537. checked: 0,
  538. width: 120,
  539. },
  540. ],
  541. allCheck: false,
  542. // 船名
  543. vesselOptions: [],
  544. // 航次
  545. voyageOptions: [],
  546. sysType: '',
  547. nameOptions: [],
  548. fDNameOptions: [],
  549. fCNameOptions: [],
  550. jFeetunitOptions: [],
  551. }
  552. },
  553. filters: {
  554. nameFormat(row, nameOptions) {
  555. let name;
  556. nameOptions.map((e) => {
  557. if (row == e.fId) {
  558. name = e.fName;
  559. }
  560. });
  561. return name;
  562. },
  563. fDNameFormat(row, fDNameOptions) {
  564. let name;
  565. fDNameOptions.map((e) => {
  566. if (row == e.fId) {
  567. name = e.fName;
  568. }
  569. });
  570. return name;
  571. },
  572. fCNameFormat(row, fCNameOptions) {
  573. let name;
  574. fCNameOptions.map((e) => {
  575. if (row == e.fId) {
  576. name = e.fName;
  577. }
  578. });
  579. return name;
  580. },
  581. jFeetunitFormat(row, jFeetunitOptions) {
  582. let label;
  583. jFeetunitOptions.map((e) => {
  584. if (row == e.dictValue) {
  585. label = e.dictLabel;
  586. }
  587. });
  588. return label;
  589. }
  590. },
  591. created() {
  592. // let date = new Date();
  593. // let year = parseInt(date.getFullYear())
  594. // let month = parseInt(date.getMonth() + 1)
  595. // let currentMonth = date.getMonth()
  596. // let nextMonth = ++currentMonth
  597. // let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1) // 下个月的第一天
  598. // let oneDay = 1000*60*60*24
  599. // let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
  600. // let day = lastTime.getDate()
  601. // if (day < 10) {
  602. // day = '0' + day
  603. // }
  604. // this.queryParams.timeExamine = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
  605. this.sysType = Cookies.get("sysType");
  606. this.setRowList = this.tableDate;
  607. this.getRowList = this.tableDate;
  608. this.vessleRemthod();
  609. this.voyageRemthods();
  610. /* 远程模糊查询费用名称 */
  611. this.fWRemoteMethod()
  612. let this_ = this
  613. this_.getList()
  614. this_.getDicts('data_trademodes').then((response) => {
  615. this_.fTrademodeidOptions = response.data
  616. })
  617. this_.getDicts('st_in_type').then((response) => {
  618. this_.businessInTypeOption = response.data
  619. this_.getDicts('st_out_type').then((response) => {
  620. this_.businessOutTypeOption = response.data
  621. this_.getDicts('st_trans_type').then((response) => {
  622. this_.businessTransTypeOption = response.data
  623. this_.merge(this_.businessOutTypeOption,this_.businessInTypeOption,this_.businessTransTypeOption)
  624. })
  625. })
  626. })
  627. let queryParams = { pageNum: 1, fDc: 'C' }
  628. listFees(queryParams).then((response) => {
  629. this.fCNameOptions = response.rows
  630. })
  631. let query = { pageNum: 1, fDc: 'D' }
  632. listFees(query).then((response) => {
  633. this.fDNameOptions = response.rows
  634. })
  635. // 获取客户名称下拉
  636. getFName(queryParams).then(response => {
  637. this.nameOptions = response.data
  638. })
  639. this.getDicts('data_unitfees').then((response) => {
  640. if (response.data) {
  641. this.jFeetunitOptions = response.data
  642. }
  643. })
  644. this.getRow();
  645. if (this.sysType == 3) {
  646. this.tableDate.push(
  647. {
  648. surface: "10",
  649. label: "fVslid",
  650. name: "船名",
  651. checked: 0,
  652. width: 120,
  653. },
  654. {
  655. surface: "11",
  656. label: "fVoyid",
  657. name: "航次",
  658. checked: 0,
  659. width: 120,
  660. }
  661. )
  662. }
  663. },
  664. mounted() {
  665. this.$nextTick(() => {
  666. // 监听浏览器高度变化,改变表格高度
  667. window.onresize = () => {
  668. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  669. }
  670. })
  671. },
  672. methods: {
  673. //列设置全选
  674. allChecked() {
  675. if (this.allCheck == true) {
  676. this.setRowList.map((e) => {
  677. return (e.checked = 0);
  678. });
  679. } else {
  680. this.setRowList.map((e) => {
  681. return (e.checked = 1);
  682. });
  683. }
  684. },
  685. //查询列数据
  686. getRow() {
  687. let that = this;
  688. this.data = {
  689. tableName: "利润总账",
  690. userId: Cookies.get("userName"),
  691. };
  692. select(this.data).then((res) => {
  693. if (res.data.length != 0) {
  694. this.getRowList = res.data.filter((e) => e.checked == 0);
  695. this.setRowList = res.data;
  696. this.setRowList = this.setRowList.reduce((res, item) => {
  697. res.push({
  698. surface: item.surface,
  699. label: item.label,
  700. name: item.name,
  701. checked: item.checked,
  702. width: item.width,
  703. fixed: item.fixed,
  704. });
  705. return res;
  706. }, []);
  707. }
  708. });
  709. },
  710. delRow() {
  711. this.data = {
  712. tableName: "利润总账",
  713. userId: Cookies.get("userName"),
  714. };
  715. resetModule(this.data).then((res) => {
  716. if (res.code == 200) {
  717. this.showSetting = false;
  718. this.setRowList = this.tableDate;
  719. this.getRowList = this.tableDate;
  720. }
  721. });
  722. },
  723. //保存列设置
  724. save() {
  725. this.showSetting = false;
  726. this.data = {
  727. tableName: "利润总账",
  728. userId: Cookies.get("userName"),
  729. sysTableSetList: this.setRowList,
  730. };
  731. addSet(this.data).then((res) => {
  732. if (res.code == 200) {
  733. this.showSetting = false;
  734. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  735. }
  736. });
  737. },
  738. //开始拖拽事件
  739. onStart() {
  740. this.drag = true;
  741. },
  742. //拖拽结束事件
  743. onEnd() {
  744. this.drag = false;
  745. },
  746. getSum(param) {
  747. const { columns, data } = param
  748. const sums = []
  749. columns.forEach((column, index) => {
  750. if (index === 0) {
  751. sums[index] = '总计'
  752. } else if (index === 7 || index === 8 || index === 9) {
  753. const values = data.map(item => Number(item[column.property]))
  754. if (!values.every(value => isNaN(value))) {
  755. sums[index] = values.reduce((prev, curr) => {
  756. const value = Number(curr)
  757. if (!isNaN(value)) {
  758. return prev + curr
  759. } else {
  760. return prev
  761. }
  762. }, 0)
  763. }
  764. }
  765. })
  766. return sums
  767. },
  768. // 贸易方式(数据字典),对���t_trademodels 字典翻译
  769. fTrademodeidFormat(row, column) {
  770. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid)
  771. },
  772. /* 远程模糊查询仓库 */
  773. warehouseRemoteMethod(name) {
  774. if (name == null || name === '') {
  775. return false
  776. }
  777. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  778. listWarehouse(queryParams).then((response) => {
  779. this.warehouseOptions = response.rows
  780. })
  781. },
  782. /* 远程模糊查询费用名称 */
  783. fWRemoteMethod(name) {
  784. // if (name == null || name === "") {
  785. // return false;
  786. // }
  787. let queryParams = { pageNum: 1, fName: name };
  788. console.log(queryParams)
  789. listFees(queryParams).then((response) => {
  790. this.fWbuOptions = response.rows
  791. console.log(response)
  792. });
  793. },
  794. /* 远程模糊查询库区 */
  795. kqhouseRemoteMethod(name) {
  796. if (name == null || name === '') {
  797. return false
  798. }
  799. if (!this.queryParams.fWarehouseid) {
  800. this.$message.error('请输入仓库!')
  801. return false
  802. }
  803. let queryParams = {
  804. pageNum: 1,
  805. pageSize: 10,
  806. fWarehouseid: this.queryParams.fWarehouseid,
  807. fName: name
  808. }
  809. listArea(queryParams).then((response) => {
  810. this.kqhouseOptions = response.rows
  811. })
  812. },
  813. /* 远程模糊查询商品 */
  814. goodsRemoteMethod(name) {
  815. if (name == null || name === '') {
  816. return false
  817. }
  818. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  819. listGoods(queryParams).then((response) => {
  820. this.goodsOptions = response.rows
  821. })
  822. },
  823. /* 远程模糊查询用户 */
  824. corpsRemoteMethod(name) {
  825. if (name == null || name === '') {
  826. return false
  827. }
  828. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  829. listCorps(queryParams).then((response) => {
  830. this.fMblnoOptions = response.rows
  831. this.KHblnoOptions = response.rows
  832. })
  833. },
  834. merge(index,list,err){
  835. this.businessTypeOption = this.businessTypeOption.concat(index,list,err)
  836. },
  837. /** 查询库存总账列表 */
  838. getList() {
  839. this.loading = true
  840. this.getDicts('approval_process').then((response) => {
  841. this.options = response.data
  842. })
  843. listpayable(this.queryParams).then(response => {
  844. this.receivableList = response.rows
  845. this.total = response.total
  846. if (this.sysType == 3) {
  847. this.receivableList.forEach(item => {
  848. this.$set(item,'dataList',[])
  849. this.$set(item,'loading', true)
  850. })
  851. }
  852. this.loading = false
  853. // 根据浏览器高度设置初始高度
  854. setInterval(() => {
  855. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  856. }, 300)
  857. })
  858. },
  859. // 取消按钮
  860. cancel() {
  861. this.open = false
  862. this.reset()
  863. },
  864. // 表单重置
  865. reset() {
  866. this.form = {
  867. fAccyear: null,
  868. fId: null,
  869. fAccmonth: null,
  870. fCorpid: null,
  871. fMblno: null,
  872. fOriginalbillno: null,
  873. fWarehouseLocationid: null,
  874. fGoodsid: null,
  875. fTrademodeid: null,
  876. fPreqty: null,
  877. fPregrossweight: null,
  878. fPrenetweight: null,
  879. fQtyd: null,
  880. fVolumnd: null,
  881. fGrossweightd: null,
  882. fNetweightd: null,
  883. fVolumnc: null,
  884. fQtyc: null,
  885. fQtyblc: null,
  886. fGrossweightc: null,
  887. fNetweightc: null,
  888. fGrossweightblc: null,
  889. fNetweightblc: null,
  890. fCntrno: null,
  891. fStatus: '0',
  892. delFlag: null,
  893. createBy: null,
  894. fMarks: null,
  895. createTime: null,
  896. updateBy: null,
  897. updateTime: null,
  898. remark: null,
  899. }
  900. this.resetForm('form')
  901. },
  902. // 搜索重置
  903. resetQueryParams() {
  904. this.queryParams = {
  905. pageNum: 1,
  906. pageSize: 50,
  907. fCorpid: null,
  908. fMblno: null,
  909. timeExamine: null,
  910. fToCorpid: null,
  911. fProductName: null,
  912. fMarks: null,
  913. fReconciliation: null,
  914. fBillstatus: null,
  915. fBusinessType:null,
  916. fFeeid:null
  917. }
  918. },
  919. /** 搜索按钮操作 */
  920. handleQuery() {
  921. this.queryParams.pageNum = 1
  922. this.getList()
  923. },
  924. /** 重置按钮操作 */
  925. resetQuery() {
  926. // this.resetForm('queryForm')
  927. this.resetQueryParams()
  928. this.handleQuery()
  929. },
  930. /** 新增按钮操作 */
  931. handleAdd() {
  932. this.reset()
  933. this.open = true
  934. this.title = '添加库存总账'
  935. },
  936. /** 提交按钮 */
  937. submitForm() {
  938. this.$refs['form'].validate(valid => {
  939. if (valid) {
  940. if (this.form.fAccyear != null) {
  941. updateWhgenleg(this.form).then(response => {
  942. this.msgSuccess('修改成功')
  943. this.open = false
  944. this.getList()
  945. })
  946. } else {
  947. addWhgenleg(this.form).then(response => {
  948. this.msgSuccess('新增成功')
  949. this.open = false
  950. this.getList()
  951. })
  952. }
  953. }
  954. })
  955. },
  956. /** 导出按钮操作 */
  957. handleExport() {
  958. const queryParams = this.queryParams
  959. this.$confirm('是否确认导出所有利润总账数据项?', '警告', {
  960. confirmButtonText: '确定',
  961. cancelButtonText: '取消',
  962. type: 'warning'
  963. }).then(function() {
  964. return exportWhgenleg(queryParams)
  965. }).then(response => {
  966. this.download(response.msg)
  967. })
  968. },
  969. //获取船名
  970. vessleRemthod() {
  971. getVesselName().then(response => {
  972. this.vesselOptions = response.rows;
  973. })
  974. },
  975. // 获取航次
  976. voyageRemthods(){
  977. getVoyageName().then(response=>{
  978. this.voyageOptions = response.rows;
  979. })
  980. },
  981. // 表格展开
  982. expandChange(row,index) {
  983. console.log(row.fMblno)
  984. if (row.loading == true) {
  985. selectListDC(row.fMblno).then(res => {
  986. row.dataList = res.data
  987. row.loading = false;
  988. })
  989. }
  990. },
  991. }
  992. }
  993. </script>
  994. <style lang="scss">
  995. .tabSetting {
  996. display: flex;
  997. justify-content: flex-end;
  998. }
  999. .listStyle {
  1000. display: flex;
  1001. border-top: 1px solid #dcdfe6;
  1002. border-left: 1px solid #dcdfe6;
  1003. border-right: 1px solid #dcdfe6;
  1004. }
  1005. .listStyle:last-child {
  1006. border-bottom: 1px solid #dcdfe6;
  1007. }
  1008. .progress {
  1009. display: flex;
  1010. align-items: center;
  1011. padding: 2px;
  1012. background-color: rgba(0, 0, 0, 0.05);
  1013. height: 100%;
  1014. }
  1015. </style>