index.vue 30 KB

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