index.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
  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: 200px"
  13. v-model="queryParams.fWarehouseLocationid"
  14. :options="fWarehouseidOption"
  15. @select="treeseLect"
  16. :show-count="true"
  17. size="small"
  18. placeholder="请选择归属库区"
  19. />
  20. </el-form-item>
  21. <el-form-item label="货物名称" prop="fgoodsid">
  22. <el-select
  23. v-model="queryParams.fGoodsid"
  24. filterable
  25. remote
  26. style="width: 200px"
  27. clearable
  28. size="small"
  29. :remote-method="goodsRemoteMethod"
  30. @keyup.enter.native="handleQuery"
  31. placeholder="请选择货物名称"
  32. >
  33. <el-option
  34. v-for="(dict, index) in goodsOptions"
  35. :key="index.fId"
  36. :label="dict.fName"
  37. :value="dict.fId"
  38. ></el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item label="贸易方式" prop="fTrademodeid">
  42. <el-select
  43. v-model="queryParams.fTrademodeid"
  44. placeholder="请选择贸易方式"
  45. clearable
  46. style="width: 200px"
  47. size="small"
  48. @keyup.enter.native="handleQuery"
  49. >
  50. <el-option
  51. v-for="(dict, index) in fTrademodeidOptions"
  52. :key="index.dictValue"
  53. :label="dict.dictLabel"
  54. :value="dict.dictValue"
  55. />
  56. </el-select>
  57. </el-form-item>
  58. <el-form-item label="货权方" prop="fCorpid">
  59. <el-select
  60. v-model="queryParams.fCorpid"
  61. filterable
  62. remote
  63. style="width: 200px"
  64. clearable
  65. size="small"
  66. @keyup.enter.native="handleQuery"
  67. :remote-method="corpsRemoteMethod"
  68. placeholder="请选择货权方"
  69. >
  70. <el-option
  71. v-for="(dict, index) in fMblnoOptions"
  72. :key="index.fId"
  73. :label="dict.fName"
  74. :value="dict.fId"
  75. ></el-option>
  76. </el-select>
  77. </el-form-item>
  78. <el-form-item label="提单号" prop="fMblno">
  79. <el-input
  80. v-model="queryParams.fMblno"
  81. placeholder="请输入提单号"
  82. clearable
  83. style="width: 200px"
  84. size="small"
  85. @keyup.enter.native="handleQuery"
  86. />
  87. </el-form-item>
  88. <el-form-item label="箱号" prop="fCntrno">
  89. <el-input
  90. v-model="queryParams.fCntrno"
  91. placeholder="请输入箱号"
  92. clearable
  93. style="width: 200px"
  94. size="small"
  95. @keyup.enter.native="handleQuery"
  96. />
  97. </el-form-item>
  98. <el-form-item label="按照箱号">
  99. <el-select
  100. v-model="queryParams.isCntrno"
  101. filterable
  102. remote
  103. style="width: 200px"
  104. clearable
  105. size="small"
  106. >
  107. <el-option
  108. v-for="(dict, index) in isCntrnoOptions"
  109. :key="index.id"
  110. :label="dict.name"
  111. :value="dict.id"
  112. ></el-option>
  113. </el-select>
  114. </el-form-item>
  115. <el-form-item label="入库日期" prop="createTime">
  116. <el-date-picker
  117. v-model="queryParams.timeInterval"
  118. type="daterange"
  119. value-format="yyyy-MM-dd"
  120. clearable
  121. size="small"
  122. style="width: 240px"
  123. range-separator="至"
  124. start-placeholder="开始日期"
  125. end-placeholder="结束日期"
  126. @keyup.enter.native="handleQuery"
  127. >
  128. </el-date-picker>
  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. surface: "0",
  613. label: "fMblno",
  614. name: "提单号",
  615. checked: 0,
  616. width: 100,
  617. fixed: "left",
  618. }, {
  619. surface: "1",
  620. label: "fCorpid",
  621. name: "客户",
  622. checked: 0,
  623. width: 100,
  624. fixed: "left",
  625. }, {
  626. surface: "2",
  627. label: "fOriginalbilldate",
  628. name: "入库日期",
  629. checked: 0,
  630. width: 100,
  631. fixed: "left",
  632. }, {
  633. surface: "3",
  634. label: "fChargedate",
  635. name: "仓储费计算日期",
  636. checked: 0,
  637. width: 100,
  638. fixed: "left",
  639. }, {
  640. surface: "4",
  641. label: "fBusinessTypes",
  642. name: "货物属性",
  643. checked: 0,
  644. width: 100,
  645. }, {
  646. surface: "5",
  647. label: "fMarks",
  648. name: "属性详情",
  649. checked: 0,
  650. width: 100,
  651. }, {
  652. surface: "6",
  653. label: "fGoodsids",
  654. name: "品名",
  655. checked: 0,
  656. width: 100,
  657. }, {
  658. surface: "8",
  659. label: "fWarehouseids",
  660. name: "仓库",
  661. checked: 0,
  662. width: 100,
  663. }, {
  664. surface: "9",
  665. label: "fTrademodeid",
  666. name: "贸易方式",
  667. checked: 0,
  668. width: 100,
  669. }, {
  670. surface: "10",
  671. label: "fQtyD",
  672. name: "入库件数",
  673. checked: 0,
  674. width: 100,
  675. }, {
  676. surface: "11",
  677. label: "fGrossweightD",
  678. name: "入库毛重(kg)",
  679. checked: 0,
  680. width: 100,
  681. }, {
  682. surface: "12",
  683. label: "fNetweightD",
  684. name: "入库净重(kg)",
  685. checked: 0,
  686. width: 100,
  687. }, {
  688. surface: "13",
  689. label: "fQtyC",
  690. name: "出库件数",
  691. checked: 0,
  692. width: 100,
  693. }, {
  694. surface: "14",
  695. label: "fGrossweightC",
  696. name: "出库毛重(kg)",
  697. checked: 0,
  698. width: 100,
  699. }, {
  700. surface: "15",
  701. label: "fNetweightC",
  702. name: "出库净重(kg)",
  703. checked: 0,
  704. width: 100,
  705. }, {
  706. surface: "16",
  707. label: "fQtyblc",
  708. name: "结余件数",
  709. checked: 0,
  710. width: 100,
  711. }, {
  712. surface: "17",
  713. label: "fGrossweightblc",
  714. name: "结余毛重(kg)",
  715. checked: 0,
  716. width: 100,
  717. }, {
  718. surface: "18",
  719. label: "fNetweightblc",
  720. name: "结余净重(kg)",
  721. checked: 0,
  722. width: 100,
  723. }, {
  724. surface: "19",
  725. label: "fCntrno",
  726. name: "箱号",
  727. checked: 0,
  728. width: 100,
  729. }, {
  730. surface: "20",
  731. label: "remark",
  732. name: "备注",
  733. checked: 0,
  734. width: 100,
  735. },],
  736. allCheck: false,
  737. isCntrnoOptions: [{
  738. id: 0,
  739. name: '否'
  740. }, {
  741. id: 1,
  742. name: '是'
  743. }]
  744. };
  745. },
  746. created() {
  747. this.setRowList = this.tableDate;
  748. this.getRowList = this.tableDate;
  749. this.getList();
  750. this.getDicts("data_trademodes").then((response) => {
  751. this.fTrademodeidOptions = response.data;
  752. });
  753. treeselect().then((response) => {
  754. this.fWarehouseidOption = response.data;
  755. });
  756. this.getRow();
  757. },
  758. methods: {
  759. //列设置全选
  760. allChecked() {
  761. if (this.allCheck == true) {
  762. this.setRowList.map((e) => {
  763. return (e.checked = 0);
  764. });
  765. } else {
  766. this.setRowList.map((e) => {
  767. return (e.checked = 1);
  768. });
  769. }
  770. },
  771. //查询列数据
  772. getRow() {
  773. let that = this;
  774. this.data = {
  775. tableName: "库存总账",
  776. userId: Cookies.get("userName"),
  777. };
  778. select(this.data).then((res) => {
  779. if (res.data.length != 0) {
  780. this.getRowList = res.data.filter((e) => e.checked == 0);
  781. this.setRowList = res.data;
  782. this.setRowList = this.setRowList.reduce((res, item) => {
  783. res.push({
  784. surface: item.surface,
  785. label: item.label,
  786. name: item.name,
  787. checked: item.checked,
  788. width: item.width,
  789. fixed: item.fixed,
  790. });
  791. return res;
  792. }, []);
  793. }
  794. console.log(this.getRowList);
  795. });
  796. },
  797. delRow() {
  798. this.data = {
  799. tableName: "库存总账",
  800. userId: Cookies.get("userName"),
  801. };
  802. resetModule(this.data).then((res) => {
  803. if (res.code == 200) {
  804. this.showSetting = false;
  805. this.setRowList = this.tableDate;
  806. this.getRowList = this.tableDate;
  807. console.log(this.getRowList);
  808. }
  809. });
  810. },
  811. //保存列设置
  812. save() {
  813. this.showSetting = false;
  814. this.data = {
  815. tableName: "库存总账",
  816. userId: Cookies.get("userName"),
  817. sysTableSetList: this.setRowList,
  818. };
  819. addSet(this.data).then((res) => {
  820. if (res.code == 200) {
  821. this.showSetting = false;
  822. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  823. }
  824. });
  825. },
  826. //开始拖拽事件
  827. onStart() {
  828. this.drag = true;
  829. },
  830. //拖拽结束事件
  831. onEnd() {
  832. this.drag = false;
  833. },
  834. //合计
  835. getSum(param) {
  836. const { columns, data } = param;
  837. const sums = [];
  838. columns.forEach((column, index) => {
  839. if (index === 0) {
  840. sums[index] = "总计";
  841. } else if (
  842. index === 13 ||
  843. index === 10 ||
  844. index === 11 ||
  845. index === 12 ||
  846. index === 14 ||
  847. index === 15 ||
  848. index === 16 ||
  849. index === 17 ||
  850. index === 18
  851. ) {
  852. const values = data.map((item) => Number(item[column.property]));
  853. if (!values.every((value) => isNaN(value))) {
  854. sums[index] = values.reduce((prev, curr) => {
  855. const value = Number(curr);
  856. if (!isNaN(value)) {
  857. return prev + curr;
  858. } else {
  859. return prev;
  860. }
  861. }, 0);
  862. if (
  863. index === 11 ||
  864. index === 12 ||
  865. index === 14 ||
  866. index === 15 ||
  867. index === 17 ||
  868. index === 18
  869. ) {
  870. sums[index] = (sums[index] / 1000).toFixed(2) + "(吨)";
  871. }
  872. }
  873. }
  874. });
  875. return sums;
  876. },
  877. treeseLect(tree) {
  878. this.queryParams.fWarehouseLocationid = tree.id;
  879. },
  880. getTreeselect() {
  881. treeselect().then((response) => {
  882. this.warehousesOptions = response.data;
  883. });
  884. },
  885. // 贸易方式(数据字典),对���t_trademodels 字典翻译
  886. fTrademodeidFormat(row, column) {
  887. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid);
  888. },
  889. /* 远程模糊查询仓库 */
  890. warehouseRemoteMethod(name) {
  891. if (name == null || name === "") {
  892. return false;
  893. }
  894. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  895. listWarehouse(queryParams).then((response) => {
  896. this.warehouseOptions = response.rows;
  897. });
  898. },
  899. /* 远程模糊查询库区 */
  900. kqhouseRemoteMethod(name) {
  901. if (name == null || name === "") {
  902. return false;
  903. }
  904. if (!this.queryParams.fWarehouseid) {
  905. this.$message.error("请输入仓库!");
  906. return false;
  907. }
  908. let queryParams = {
  909. pageNum: 1,
  910. pageSize: 10,
  911. fWarehouseid: this.queryParams.fWarehouseid,
  912. fName: name,
  913. };
  914. listArea(queryParams).then((response) => {
  915. this.kqhouseOptions = response.rows;
  916. });
  917. },
  918. /* 远程模糊查询商品 */
  919. goodsRemoteMethod(name) {
  920. if (name == null || name === "") {
  921. return false;
  922. }
  923. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  924. listGoods(queryParams).then((response) => {
  925. this.goodsOptions = response.rows;
  926. });
  927. },
  928. /* 远程模糊查询用户 */
  929. corpsRemoteMethod(name) {
  930. if (name == null || name === "") {
  931. return false;
  932. }
  933. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  934. listCorps(queryParams).then((response) => {
  935. this.fMblnoOptions = response.rows;
  936. this.KHblnoOptions = response.rows;
  937. });
  938. },
  939. /** 查询库存总账列表 */
  940. getList() {
  941. this.loading = true;
  942. mapListWhgenleg(this.queryParams).then((response) => {
  943. console.log(response);
  944. this.whgenlegList = response.rows;
  945. this.total = response.total;
  946. this.loading = false;
  947. });
  948. },
  949. // 取消按钮
  950. cancel() {
  951. this.open = false;
  952. this.reset();
  953. },
  954. // 表单重置
  955. reset() {
  956. this.form = {
  957. fAccyear: null,
  958. fId: null,
  959. fAccmonth: null,
  960. fCorpid: null,
  961. fMblno: null,
  962. fOriginalbillno: null,
  963. fWarehouseLocationid: null,
  964. fGoodsid: null,
  965. fTrademodeid: null,
  966. fPreqty: null,
  967. fPregrossweight: null,
  968. fPrenetweight: null,
  969. fQtyd: null,
  970. fVolumnd: null,
  971. fGrossweightd: null,
  972. fNetweightd: null,
  973. fVolumnc: null,
  974. fQtyc: null,
  975. fQtyblc: null,
  976. fGrossweightc: null,
  977. fNetweightc: null,
  978. fGrossweightblc: null,
  979. fNetweightblc: null,
  980. fCntrno: null,
  981. fStatus: "0",
  982. delFlag: null,
  983. createBy: null,
  984. fMarks: null,
  985. createTime: null,
  986. updateBy: null,
  987. updateTime: null,
  988. remark: null,
  989. };
  990. this.resetForm("form");
  991. },
  992. /** 搜索按钮操作 */
  993. handleQuery() {
  994. this.queryParams.pageNum = 1;
  995. this.getList();
  996. },
  997. /** 重置按钮操作 */
  998. resetQuery() {
  999. this.queryParams = {
  1000. pageNum: 1,
  1001. pageSize: 10,
  1002. fOriginalbillno: null,
  1003. fPreqty: null,
  1004. fPregrossweight: null,
  1005. fPrenetweight: null,
  1006. fQtyd: null,
  1007. fVolumnd: null,
  1008. fGrossweightd: null,
  1009. fNetweightd: null,
  1010. fVolumnc: null,
  1011. fQtyc: null,
  1012. fQtyblc: null,
  1013. fGrossweightc: null,
  1014. fNetweightc: null,
  1015. fGrossweightblc: null,
  1016. fNetweightblc: null,
  1017. fCntrno: null,
  1018. fStatus: null,
  1019. fMarks: null,
  1020. fBusinessType: null,
  1021. fBusinessTypes: null,
  1022. fBilltype: null,
  1023. fwarehouseid: null,
  1024. };
  1025. // this.resetForm("queryForm");
  1026. this.handleQuery();
  1027. },
  1028. /** 新增按钮操作 */
  1029. handleAdd() {
  1030. this.reset();
  1031. this.open = true;
  1032. this.title = "添加库存总账";
  1033. },
  1034. /** 提交按钮 */
  1035. submitForm() {
  1036. this.$refs["form"].validate((valid) => {
  1037. if (valid) {
  1038. if (this.form.fAccyear != null) {
  1039. updateWhgenleg(this.form).then((response) => {
  1040. this.msgSuccess("修改成功");
  1041. this.open = false;
  1042. this.getList();
  1043. });
  1044. } else {
  1045. addWhgenleg(this.form).then((response) => {
  1046. this.msgSuccess("新增成功");
  1047. this.open = false;
  1048. this.getList();
  1049. });
  1050. }
  1051. }
  1052. });
  1053. },
  1054. /** 导出按钮操作 */
  1055. handleExport() {
  1056. const queryParams = this.queryParams;
  1057. this.$confirm("是否确认导出所有库存总账数据项?", "警告", {
  1058. confirmButtonText: "确定",
  1059. cancelButtonText: "取消",
  1060. type: "warning",
  1061. })
  1062. .then(function () {
  1063. return exportWhgenleg(queryParams);
  1064. })
  1065. .then((response) => {
  1066. this.download(response.msg);
  1067. });
  1068. },
  1069. goDetail(row) {
  1070. this.$router.push({
  1071. path: "/analysis/stockDetail",
  1072. query: {
  1073. fWarehouseLocationid: row.fWarehouseLocationid,
  1074. fTrademodeids: row.fTrademodeids,
  1075. fBusinessType: row.fBusinessType,
  1076. fGoodsid: row.fGoodsid,
  1077. fCorpIds: row.fCorpIds,
  1078. fMarks: row.fMarks,
  1079. fMblno: row.fMblno,
  1080. },
  1081. });
  1082. },
  1083. },
  1084. };
  1085. </script>
  1086. <style lang="scss">
  1087. .el-table {
  1088. .el-table__body-wrapper {
  1089. z-index: 2;
  1090. }
  1091. }
  1092. .tabSetting {
  1093. display: flex;
  1094. justify-content: flex-end;
  1095. }
  1096. .listStyle {
  1097. display: flex;
  1098. border-top: 1px solid #dcdfe6;
  1099. border-left: 1px solid #dcdfe6;
  1100. border-right: 1px solid #dcdfe6;
  1101. }
  1102. .listStyle:last-child {
  1103. border-bottom: 1px solid #dcdfe6;
  1104. }
  1105. .progress {
  1106. display: flex;
  1107. align-items: center;
  1108. padding: 2px;
  1109. background-color: rgba(0, 0, 0, 0.05);
  1110. height: 100%;
  1111. }
  1112. </style>