index.vue 37 KB

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