index.vue 28 KB

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