index.vue 30 KB

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