index.vue 31 KB

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