index.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
  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: 0,
  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. response.rows.map((e) => {
  867. e.fCntrno=this.queryParams.isCntrno == 1 ? null:e.fCntrno
  868. })
  869. this.whgenlegList = response.rows;
  870. this.total = response.total;
  871. this.loading = false;
  872. });
  873. },
  874. // 取消按钮
  875. cancel() {
  876. this.open = false;
  877. this.reset();
  878. },
  879. // 表单重置
  880. reset() {
  881. this.form = {
  882. fAccyear: null,
  883. fId: null,
  884. fAccmonth: null,
  885. fCorpid: null,
  886. fMblno: null,
  887. fOriginalbillno: null,
  888. fWarehouseLocationid: null,
  889. fGoodsid: null,
  890. fTrademodeid: null,
  891. fPreqty: null,
  892. fPregrossweight: null,
  893. fPrenetweight: null,
  894. fQtyd: null,
  895. fVolumnd: null,
  896. fGrossweightd: null,
  897. fNetweightd: null,
  898. fVolumnc: null,
  899. fQtyc: null,
  900. fQtyblc: null,
  901. fGrossweightc: null,
  902. fNetweightc: null,
  903. fGrossweightblc: null,
  904. fNetweightblc: null,
  905. fCntrno: null,
  906. fStatus: "0",
  907. delFlag: null,
  908. createBy: null,
  909. fMarks: null,
  910. createTime: null,
  911. updateBy: null,
  912. updateTime: null,
  913. remark: null,
  914. };
  915. this.resetForm("form");
  916. },
  917. /** 搜索按钮操作 */
  918. handleQuery() {
  919. this.queryParams.pageNum = 1;
  920. this.getList();
  921. },
  922. /** 重置按钮操作 */
  923. resetQuery() {
  924. this.queryParams = {
  925. pageNum: 1,
  926. pageSize: 10,
  927. fOriginalbillno: null,
  928. fPreqty: null,
  929. fPregrossweight: null,
  930. fPrenetweight: null,
  931. fQtyd: null,
  932. fVolumnd: null,
  933. fGrossweightd: null,
  934. fNetweightd: null,
  935. fVolumnc: null,
  936. fQtyc: null,
  937. fQtyblc: null,
  938. fGrossweightc: null,
  939. fNetweightc: null,
  940. fGrossweightblc: null,
  941. fNetweightblc: null,
  942. fCntrno: null,
  943. fStatus: null,
  944. fMarks: null,
  945. fBusinessType: null,
  946. fBusinessTypes: null,
  947. fBilltype: null,
  948. fwarehouseid: null,
  949. };
  950. // this.resetForm("queryForm");
  951. this.handleQuery();
  952. },
  953. /** 新增按钮操作 */
  954. handleAdd() {
  955. this.reset();
  956. this.open = true;
  957. this.title = "添加库存总账";
  958. },
  959. /** 提交按钮 */
  960. submitForm() {
  961. this.$refs["form"].validate((valid) => {
  962. if (valid) {
  963. if (this.form.fAccyear != null) {
  964. updateWhgenleg(this.form).then((response) => {
  965. this.msgSuccess("修改成功");
  966. this.open = false;
  967. this.getList();
  968. });
  969. } else {
  970. addWhgenleg(this.form).then((response) => {
  971. this.msgSuccess("新增成功");
  972. this.open = false;
  973. this.getList();
  974. });
  975. }
  976. }
  977. });
  978. },
  979. /** 导出按钮操作 */
  980. handleExport() {
  981. const queryParams = this.queryParams;
  982. this.$confirm("是否确认导出所有库存总账数据项?", "警告", {
  983. confirmButtonText: "确定",
  984. cancelButtonText: "取消",
  985. type: "warning",
  986. })
  987. .then(function () {
  988. return exportWhgenleg(queryParams);
  989. })
  990. .then((response) => {
  991. this.download(response.msg);
  992. });
  993. },
  994. goDetail(row) {
  995. this.$router.push({
  996. path: "/analysis/stockDetail",
  997. query: {
  998. fWarehouseLocationid: row.fWarehouseLocationid,
  999. fTrademodeids: row.fTrademodeids,
  1000. fBusinessType: row.fBusinessType,
  1001. fGoodsid: row.fGoodsid,
  1002. fCorpIds: row.fCorpIds,
  1003. fMarks: row.fMarks,
  1004. fMblno: row.fMblno,
  1005. },
  1006. });
  1007. },
  1008. },
  1009. };
  1010. </script>
  1011. <style lang="scss">
  1012. .el-table {
  1013. .el-table__body-wrapper {
  1014. z-index: 2;
  1015. }
  1016. }
  1017. .tabSetting {
  1018. display: flex;
  1019. justify-content: flex-end;
  1020. }
  1021. .listStyle {
  1022. display: flex;
  1023. border-top: 1px solid #dcdfe6;
  1024. border-left: 1px solid #dcdfe6;
  1025. border-right: 1px solid #dcdfe6;
  1026. }
  1027. .listStyle:last-child {
  1028. border-bottom: 1px solid #dcdfe6;
  1029. }
  1030. .progress {
  1031. display: flex;
  1032. align-items: center;
  1033. padding: 2px;
  1034. background-color: rgba(0, 0, 0, 0.05);
  1035. height: 100%;
  1036. }
  1037. </style>