index.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  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. window.onresize = () => {
  671. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  672. }
  673. })
  674. },
  675. methods: {
  676. //列设置全选
  677. allChecked() {
  678. if (this.allCheck == true) {
  679. this.setRowList.map((e) => {
  680. return (e.checked = 0);
  681. });
  682. } else {
  683. this.setRowList.map((e) => {
  684. return (e.checked = 1);
  685. });
  686. }
  687. },
  688. //查询列数据
  689. getRow() {
  690. let that = this;
  691. this.data = {
  692. tableName: "出入库统计",
  693. userId: Cookies.get("userName"),
  694. };
  695. select(this.data).then((res) => {
  696. if (res.data.length != 0) {
  697. this.getRowList = res.data.filter((e) => e.checked == 0);
  698. this.setRowList = res.data;
  699. this.setRowList = this.setRowList.reduce((res, item) => {
  700. res.push({
  701. surface: item.surface,
  702. label: item.label,
  703. name: item.name,
  704. checked: item.checked,
  705. width: item.width,
  706. fixed: item.fixed,
  707. });
  708. return res;
  709. }, []);
  710. }
  711. });
  712. },
  713. delRow() {
  714. this.data = {
  715. tableName: "出入库统计",
  716. userId: Cookies.get("userName"),
  717. };
  718. resetModule(this.data).then((res) => {
  719. if (res.code == 200) {
  720. this.showSetting = false;
  721. this.setRowList = this.tableDate;
  722. this.getRowList = this.tableDate;
  723. }
  724. });
  725. },
  726. //保存列设置
  727. save() {
  728. this.showSetting = false;
  729. this.data = {
  730. tableName: "出入库统计",
  731. userId: Cookies.get("userName"),
  732. sysTableSetList: this.setRowList,
  733. };
  734. addSet(this.data).then((res) => {
  735. if (res.code == 200) {
  736. this.showSetting = false;
  737. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  738. }
  739. });
  740. },
  741. //开始拖拽事件
  742. onStart() {
  743. this.drag = true;
  744. },
  745. //拖拽结束事件
  746. onEnd() {
  747. this.drag = false;
  748. },
  749. //合计
  750. getSum(param) {
  751. const { columns, data } = param;
  752. const sums = [];
  753. columns.forEach((column, index) => {
  754. if (index === 0) {
  755. sums[index] = "总计";
  756. } else if (index === 12 || index === 10 || index === 11) {
  757. const values = data.map((item) => Number(item[column.property]));
  758. if (!values.every((value) => isNaN(value))) {
  759. sums[index] = values.reduce((prev, curr) => {
  760. const value = Number(curr);
  761. if (!isNaN(value)) {
  762. return prev + curr;
  763. } else {
  764. return prev;
  765. }
  766. }, 0);
  767. if (index === 12 || index === 11) {
  768. sums[index] = (sums[index] / 1000).toFixed(2) + "(吨)";
  769. }
  770. }
  771. }
  772. });
  773. return sums;
  774. },
  775. treeseLect(tree) {
  776. this.queryParams.fWarehouseid = tree.id;
  777. },
  778. getTreeselect() {
  779. treeselect().then((response) => {
  780. this.warehousesOptions = response.data;
  781. });
  782. },
  783. // 贸易方式(数据字典),对���t_trademodels 字典翻译
  784. fTrademodeidFormat(row, column) {
  785. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid);
  786. },
  787. /* 远程模糊查询仓库 */
  788. warehouseRemoteMethod(name) {
  789. if (name == null || name === "") {
  790. return false;
  791. }
  792. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  793. listWarehouse(queryParams).then((response) => {
  794. this.warehouseOptions = response.rows;
  795. });
  796. },
  797. /* 远程模糊查询库区 */
  798. kqhouseRemoteMethod(name) {
  799. if (name == null || name === "") {
  800. return false;
  801. }
  802. if (!this.queryParams.fWarehouseid) {
  803. this.$message.error("请输入仓库!");
  804. return false;
  805. }
  806. let queryParams = {
  807. pageNum: 1,
  808. pageSize: 10,
  809. fWarehouseid: this.queryParams.fWarehouseid,
  810. fName: name,
  811. };
  812. listArea(queryParams).then((response) => {
  813. this.kqhouseOptions = response.rows;
  814. });
  815. },
  816. /* 远程模糊查询商品 */
  817. goodsRemoteMethod(name) {
  818. if (name == null || name === "") {
  819. return false;
  820. }
  821. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  822. listGoods(queryParams).then((response) => {
  823. this.goodsOptions = response.rows;
  824. });
  825. },
  826. /* 远程模糊查询用户 */
  827. corpsRemoteMethod(name) {
  828. if (name == null || name === "") {
  829. return false;
  830. }
  831. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  832. listCorps(queryParams).then((response) => {
  833. this.fMblnoOptions = response.rows;
  834. this.KHblnoOptions = response.rows;
  835. });
  836. },
  837. /** 查询库存总账列表 */
  838. getList() {
  839. this.loading = true;
  840. listWhgenleg(this.queryParams).then((response) => {
  841. this.whgenlegList = response.rows;
  842. this.total = response.total;
  843. this.loading = false;
  844. // 根据浏览器高度设置初始高度
  845. setTimeout(() => {
  846. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  847. }, 300)
  848. });
  849. },
  850. // 取消按钮
  851. cancel() {
  852. this.open = false;
  853. this.reset();
  854. },
  855. // 表单重置
  856. reset() {
  857. this.form = {
  858. fAccyear: null,
  859. fId: null,
  860. fAccmonth: null,
  861. fCorpid: null,
  862. fMblno: null,
  863. fOriginalbillno: null,
  864. fWarehouseLocationid: null,
  865. fGoodsid: null,
  866. fwarehouseid: null,
  867. fTrademodeid: null,
  868. fPreqty: null,
  869. fPregrossweight: null,
  870. fPrenetweight: null,
  871. fQtyd: null,
  872. fVolumnd: null,
  873. fGrossweightd: null,
  874. fNetweightd: null,
  875. fVolumnc: null,
  876. fQtyc: null,
  877. fQtyblc: null,
  878. fGrossweightc: null,
  879. fNetweightc: null,
  880. fGrossweightblc: null,
  881. fNetweightblc: null,
  882. fCntrno: null,
  883. fStatus: "0",
  884. delFlag: null,
  885. createBy: null,
  886. fMarks: null,
  887. createTime: null,
  888. updateBy: null,
  889. updateTime: null,
  890. remark: null,
  891. };
  892. this.resetForm("form");
  893. },
  894. /** 搜索按钮操作 */
  895. handleQuery() {
  896. this.queryParams.pageNum = 1;
  897. this.getList();
  898. },
  899. /** 重置按钮操作 */
  900. resetQuery() {
  901. this.queryParams = {
  902. pageNum: 1,
  903. pageSize: 10,
  904. fOriginalbillno: null,
  905. fPreqty: null,
  906. fPregrossweight: null,
  907. fPrenetweight: null,
  908. fQtyd: null,
  909. fVolumnd: null,
  910. fGrossweightd: null,
  911. fNetweightd: null,
  912. fVolumnc: null,
  913. fQtyc: null,
  914. fQtyblc: null,
  915. fGrossweightc: null,
  916. fNetweightc: null,
  917. fGrossweightblc: null,
  918. fNetweightblc: null,
  919. fCntrno: null,
  920. fStatus: null,
  921. fMarks: null,
  922. fBusinessType: null,
  923. fBusinessTypes: null,
  924. fBilltype: "SJRK",
  925. fwarehouseid: null,
  926. };
  927. // this.resetForm("queryForm");
  928. this.handleQuery();
  929. },
  930. /** 新增按钮操作 */
  931. handleAdd() {
  932. this.reset();
  933. this.open = true;
  934. this.title = "添加库存总账";
  935. },
  936. /** 提交按钮 */
  937. submitForm() {
  938. this.$refs["form"].validate((valid) => {
  939. if (valid) {
  940. if (this.form.fAccyear != null) {
  941. updateWhgenleg(this.form).then((response) => {
  942. this.msgSuccess("修改成功");
  943. this.open = false;
  944. this.getList();
  945. });
  946. } else {
  947. addWhgenleg(this.form).then((response) => {
  948. this.msgSuccess("新增成功");
  949. this.open = false;
  950. this.getList();
  951. });
  952. }
  953. }
  954. });
  955. },
  956. /** 导出按钮操作 */
  957. handleExport() {
  958. const queryParams = this.queryParams;
  959. this.$confirm("是否确认导出所出入库统计数据项?", "警告", {
  960. confirmButtonText: "确定",
  961. cancelButtonText: "取消",
  962. type: "warning",
  963. })
  964. .then(function () {
  965. return exportWhgenleg(queryParams);
  966. })
  967. .then((response) => {
  968. this.download(response.msg);
  969. });
  970. },
  971. },
  972. };
  973. </script>
  974. <style lang="scss">
  975. .el-table {
  976. .el-table__body-wrapper {
  977. z-index: 2;
  978. }
  979. }
  980. .tabSetting {
  981. display: flex;
  982. justify-content: flex-end;
  983. }
  984. .listStyle {
  985. display: flex;
  986. border-top: 1px solid #dcdfe6;
  987. border-left: 1px solid #dcdfe6;
  988. border-right: 1px solid #dcdfe6;
  989. }
  990. .listStyle:last-child {
  991. border-bottom: 1px solid #dcdfe6;
  992. }
  993. .progress {
  994. display: flex;
  995. align-items: center;
  996. padding: 2px;
  997. background-color: rgba(0, 0, 0, 0.05);
  998. height: 100%;
  999. }
  1000. </style>