index.vue 30 KB

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