index.vue 31 KB

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