index.vue 30 KB

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