index.vue 33 KB

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