index.vue 32 KB

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