index.vue 31 KB

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