index.vue 30 KB

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