index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="仓库" prop="fwarehouseid">
  5. <treeselect style="width:200px"
  6. v-model="queryParams.fWarehouseLocationid"
  7. :options="fWarehouseidOption"
  8. @select="treeseLect"
  9. :show-count="true"
  10. size="small"
  11. placeholder="请选择归属库区" />
  12. </el-form-item>
  13. <el-form-item label="货物名称" prop="fgoodsid">
  14. <el-select
  15. v-model="queryParams.fGoodsid"
  16. filterable
  17. remote
  18. style="width:200px"
  19. clearable
  20. size="small"
  21. :remote-method="goodsRemoteMethod"
  22. @keyup.enter.native="handleQuery"
  23. placeholder="请选择货物名称"
  24. >
  25. <el-option
  26. v-for="(dict, index) in goodsOptions"
  27. :key="index.fId"
  28. :label="dict.fName"
  29. :value="dict.fId"
  30. ></el-option>
  31. </el-select>
  32. </el-form-item>
  33. <el-form-item label="贸易方式" prop="fTrademodeid">
  34. <el-select
  35. v-model="queryParams.fTrademodeid"
  36. placeholder="请选择贸易方式"
  37. clearable
  38. style="width:200px"
  39. size="small"
  40. @keyup.enter.native="handleQuery"
  41. >
  42. <el-option
  43. v-for="(dict, index) in fTrademodeidOptions"
  44. :key="index.dictValue"
  45. :label="dict.dictLabel"
  46. :value="dict.dictValue"
  47. />
  48. </el-select>
  49. </el-form-item>
  50. <el-form-item label="货权方" prop="fCorpid">
  51. <el-select
  52. v-model="queryParams.fCorpid"
  53. filterable
  54. remote
  55. style="width:200px"
  56. clearable
  57. size="small"
  58. @keyup.enter.native="handleQuery"
  59. :remote-method="corpsRemoteMethod"
  60. placeholder="请选择货权方"
  61. >
  62. <el-option
  63. v-for="(dict, index) in fMblnoOptions"
  64. :key="index.fId"
  65. :label="dict.fName"
  66. :value="dict.fId"
  67. ></el-option>
  68. </el-select>
  69. </el-form-item>
  70. <el-form-item label="提单号" prop="fMblno">
  71. <el-input
  72. v-model="queryParams.fMblno"
  73. placeholder="请输入提单号"
  74. clearable
  75. style="width:200px"
  76. size="small"
  77. @keyup.enter.native="handleQuery"
  78. />
  79. </el-form-item>
  80. <el-form-item label="箱号" prop="fCntrno">
  81. <el-input
  82. v-model="queryParams.fCntrno"
  83. placeholder="请输入箱号"
  84. clearable
  85. style="width:200px"
  86. size="small"
  87. @keyup.enter.native="handleQuery"
  88. />
  89. </el-form-item>
  90. <el-form-item label="入库日期" prop="createTime">
  91. <el-date-picker
  92. v-model="queryParams.timeInterval"
  93. type="daterange"
  94. value-format="yyyy-MM-dd"
  95. clearable
  96. size="small"
  97. style="width: 240px"
  98. range-separator="至"
  99. start-placeholder="开始日期"
  100. end-placeholder="结束日期"
  101. @keyup.enter.native="handleQuery">
  102. </el-date-picker>
  103. </el-form-item>
  104. <el-form-item>
  105. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  106. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  107. </el-form-item>
  108. </el-form>
  109. <el-row :gutter="10" class="mb8">
  110. <el-col :span="1.5">
  111. <el-button
  112. type="warning"
  113. icon="el-icon-download"
  114. size="mini"
  115. @click="handleExport"
  116. v-hasPermi="['warehouseBusiness:whgenleg:export']"
  117. >导出</el-button>
  118. </el-col>
  119. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  120. </el-row>
  121. <el-table v-loading="loading" :data="whgenlegList">
  122. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  123. <el-table-column type="index" label="行号" align="center" width="120"/>
  124. <el-table-column label="客户" align="center" prop="fCorpid" show-overflow-tooltip width="120"/>
  125. <el-table-column label="入库日期" align="center" prop="fReviewDate" width="120">
  126. <template slot-scope="scope">
  127. <span>{{ parseTime(scope.row.fOriginalbilldate , "{y}-{m}-{d}") }}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column label="仓储费计算日期" align="center" prop="fChargedate" width="120">
  131. <template slot-scope="scope">
  132. <span>{{ parseTime(scope.row.fChargedate , "{y}-{m}-{d}") }}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="提单号" align="center" prop="fMblno" show-overflow-tooltip width="120"/>
  136. <el-table-column label="货物属性" align="center" prop="fBusinessTypes" width="120"/>
  137. <el-table-column label="属性详情" align="center" prop="fMarks" width="120"/>
  138. <el-table-column label="品名" align="center" prop="fGoodsids" width="120"/>
  139. <el-table-column label="仓库" align="center" prop="fWarehouseids" width="120"/>
  140. <el-table-column
  141. label="贸易方式"
  142. align="center"
  143. prop="fTrademodeid"
  144. :formatter="fTrademodeidFormat"
  145. width="120"
  146. />
  147. <el-table-column label="入库件数" align="center" prop="fQtyD" width="120"/>
  148. <!-- <el-table-column label="入库尺码" align="center" prop="fVolumnD" />-->
  149. <el-table-column label="入库毛重(kg)" align="center" prop="fGrossweightD" width="120"/>
  150. <el-table-column label="入库净重(kg)" align="center" prop="fNetweightD" width="120"/>
  151. <!-- <el-table-column label="出库尺码" align="center" prop="fVolumnC" />-->
  152. <el-table-column label="出库件数" align="center" prop="fQtyC" width="120"/>
  153. <el-table-column label="出库毛重(kg)" align="center" prop="fGrossweightC" width="120"/>
  154. <el-table-column label="出库净重(kg)" align="center" prop="fNetweightC" width="120"/>
  155. <el-table-column label="结余件数" align="center" prop="fQtyblc" width="120"/>
  156. <el-table-column label="结余毛重(kg)" align="center" prop="fGrossweightblc" width="120"/>
  157. <el-table-column label="结余净重(kg)" align="center" prop="fNetweightblc" width="120"/>
  158. <el-table-column label="箱号" align="center" prop="fCntrno" width="120"/>
  159. <el-table-column label="备注" align="center" prop="remark" width="120"/>
  160. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  161. <template slot-scope="scope">
  162. <el-button
  163. size="mini"
  164. type="text"
  165. icon="el-icon-edit"
  166. @click="handleUpdate(scope.row)"
  167. v-hasPermi="['warehouseBusiness:whgenleg:edit']"
  168. >修改</el-button>
  169. <el-button
  170. size="mini"
  171. type="text"
  172. icon="el-icon-delete"
  173. @click="handleDelete(scope.row)"
  174. v-hasPermi="['warehouseBusiness:whgenleg:remove']"
  175. >删除</el-button>
  176. </template>
  177. </el-table-column> -->
  178. </el-table>
  179. <pagination
  180. v-show="total>0"
  181. :total="total"
  182. :page.sync="queryParams.pageNum"
  183. :limit.sync="queryParams.pageSize"
  184. :page-sizes="[50,100, 200, 500, 1000]"
  185. @pagination="getList"
  186. />
  187. <!-- 添加或修改库存总账对话框 -->
  188. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  189. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  190. <el-form-item label="原始入库业务编号" prop="fOriginalbillno">
  191. <el-input v-model="form.fOriginalbillno" placeholder="请输入原始入库业务编号" />
  192. </el-form-item>
  193. <el-form-item label="上期件数" prop="fPreqty">
  194. <el-input v-model="form.fPreqty" placeholder="请输入上期件数" />
  195. </el-form-item>
  196. <el-form-item label="上期毛重,单位为吨,保留6位小数" prop="fPregrossweight">
  197. <el-input v-model="form.fPregrossweight" placeholder="请输入上期毛重,单位为吨,保留6位小数" />
  198. </el-form-item>
  199. <el-form-item label="上期净重," prop="fPrenetweight">
  200. <el-input v-model="form.fPrenetweight" placeholder="请输入上期净重," />
  201. </el-form-item>
  202. <el-form-item label="入库件数" prop="fQtyd">
  203. <el-input v-model="form.fQtyd" placeholder="请输入入库件数" />
  204. </el-form-item>
  205. <el-form-item label="入库尺码" prop="fVolumnd">
  206. <el-input v-model="form.fVolumnd" placeholder="请输入入库尺码" />
  207. </el-form-item>
  208. <el-form-item label="入库毛重" prop="fGrossweightd">
  209. <el-input v-model="form.fGrossweightd" placeholder="请输入入库毛重" />
  210. </el-form-item>
  211. <el-form-item label="入库净重" prop="fNetweightd">
  212. <el-input v-model="form.fNetweightd" placeholder="请输入入库净重" />
  213. </el-form-item>
  214. <el-form-item label="出口尺码" prop="fVolumnc">
  215. <el-input v-model="form.fVolumnc" placeholder="请输入出口尺码" />
  216. </el-form-item>
  217. <el-form-item label="出库件数" prop="fQtyc">
  218. <el-input v-model="form.fQtyc" placeholder="请输入出库件数" />
  219. </el-form-item>
  220. <el-form-item label="结余件数" prop="fQtyblc">
  221. <el-input v-model="form.fQtyblc" placeholder="请输入结余件数" />
  222. </el-form-item>
  223. <el-form-item label="出库毛重,单位为吨" prop="fGrossweightc">
  224. <el-input v-model="form.fGrossweightc" placeholder="请输入出库毛重,单位为吨" />
  225. </el-form-item>
  226. <el-form-item label="出库净重" prop="fNetweightc">
  227. <el-input v-model="form.fNetweightc" placeholder="请输入出库净重" />
  228. </el-form-item>
  229. <el-form-item label="结余毛重" prop="fGrossweightblc">
  230. <el-input v-model="form.fGrossweightblc" placeholder="请输入结余毛重" />
  231. </el-form-item>
  232. <el-form-item label="结余净重" prop="fNetweightblc">
  233. <el-input v-model="form.fNetweightblc" placeholder="请输入结余净重" />
  234. </el-form-item>
  235. <el-form-item label="箱号" prop="fCntrno">
  236. <el-input v-model="form.fCntrno" placeholder="请输入箱号" />
  237. </el-form-item>
  238. <el-form-item label="状态,默认 T ,正常T 停用F 下拉选择">
  239. <el-radio-group v-model="form.fStatus">
  240. <el-radio label="1">请选择字典生成</el-radio>
  241. </el-radio-group>
  242. </el-form-item>
  243. <el-form-item label="删除状态" prop="delFlag">
  244. <el-input v-model="form.delFlag" placeholder="请输入删除状态" />
  245. </el-form-item>
  246. <el-form-item label="唛头" prop="fMarks">
  247. <el-input v-model="form.fMarks" placeholder="请输入唛头" />
  248. </el-form-item>
  249. <el-form-item label="备注" prop="remark">
  250. <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
  251. </el-form-item>
  252. </el-form>
  253. <div slot="footer" class="dialog-footer">
  254. <el-button type="primary" @click="submitForm">确 定</el-button>
  255. <el-button @click="cancel">取 消</el-button>
  256. </div>
  257. </el-dialog>
  258. </div>
  259. </template>
  260. <script>
  261. import { listWhgenleg, getWhgenleg, delWhgenleg, addWhgenleg, updateWhgenleg, exportWhgenleg } from "@/api/reportManagement/whgenleg";
  262. import { listWarehouse, treeselect } from '@/api/basicdata/warehouse'
  263. import {listArea} from "@/api/basicdata/area";
  264. import {listGoods} from "@/api/basicdata/goods";
  265. import {listCorps} from "@/api/basicdata/corps";
  266. import Treeselect from '@riophae/vue-treeselect'
  267. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  268. export default {
  269. name: "Whgenleg",
  270. components: {
  271. Treeselect
  272. },
  273. data() {
  274. return {
  275. //仓库树状下拉
  276. fWarehouseidOption:[],
  277. // 货权方(客户数据)
  278. fMblnoOptions: [],
  279. // 贸易方式(数据字典),对应t_trademodels 字典
  280. fTrademodeidOptions: [],
  281. // 货物
  282. goodsOptions: [],
  283. // 仓库(仓库数据)
  284. warehouseOptions: [],
  285. kqhouseOptions: [],
  286. // 遮罩层
  287. loading: true,
  288. // 显示搜索条件
  289. showSearch: true,
  290. // 总条数
  291. total: 0,
  292. // 库存总账表格数据
  293. whgenlegList: [],
  294. // 弹出层标题
  295. title: "",
  296. // 是否显示弹出层
  297. open: false,
  298. // 查询参数
  299. queryParams: {
  300. pageNum: 1,
  301. pageSize: 50,
  302. fOriginalbillno: null,
  303. fPreqty: null,
  304. fPregrossweight: null,
  305. fPrenetweight: null,
  306. fQtyd: null,
  307. fVolumnd: null,
  308. fGrossweightd: null,
  309. fNetweightd: null,
  310. fVolumnc: null,
  311. fQtyc: null,
  312. fQtyblc: null,
  313. fGrossweightc: null,
  314. fNetweightc: null,
  315. fGrossweightblc: null,
  316. fNetweightblc: null,
  317. fCntrno: null,
  318. fStatus: null,
  319. fMarks: null,
  320. fBusinessType:null,
  321. fBusinessTypes:null
  322. },
  323. // 表单参数
  324. form: {},
  325. // 表单校验
  326. rules: {
  327. fMarks: [
  328. { required: true, message: "唛头不能为空", trigger: "blur" }
  329. ],
  330. }
  331. };
  332. },
  333. created() {
  334. this.getList();
  335. this.getDicts("data_trademodes").then((response) => {
  336. this.fTrademodeidOptions = response.data;
  337. });
  338. treeselect().then(response => {
  339. this.fWarehouseidOption = response.data
  340. })
  341. },
  342. methods: {
  343. treeseLect(tree){
  344. this.queryParams.fWarehouseLocationid = tree.id
  345. },
  346. getTreeselect() {
  347. treeselect().then(response => {
  348. this.warehousesOptions = response.data;
  349. });
  350. },
  351. // 贸易方式(数据字典),对���t_trademodels 字典翻译
  352. fTrademodeidFormat(row, column) {
  353. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid);
  354. },
  355. /* 远程模糊查询仓库 */
  356. warehouseRemoteMethod(name) {
  357. if (name == null || name === "") {
  358. return false;
  359. }
  360. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  361. listWarehouse(queryParams).then((response) => {
  362. this.warehouseOptions = response.rows;
  363. });
  364. },
  365. /* 远程模糊查询库区 */
  366. kqhouseRemoteMethod(name) {
  367. if (name == null || name === "") {
  368. return false;
  369. }
  370. if (!this.queryParams.fWarehouseid) {
  371. this.$message.error("请输入仓库!");
  372. return false;
  373. }
  374. let queryParams = {
  375. pageNum: 1,
  376. pageSize: 10,
  377. fWarehouseid: this.queryParams.fWarehouseid,
  378. fName: name,
  379. };
  380. listArea(queryParams).then((response) => {
  381. this.kqhouseOptions = response.rows;
  382. });
  383. },
  384. /* 远程模糊查询商品 */
  385. goodsRemoteMethod(name) {
  386. if (name == null || name === "") {
  387. return false;
  388. }
  389. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  390. listGoods(queryParams).then((response) => {
  391. this.goodsOptions = response.rows;
  392. });
  393. },
  394. /* 远程模糊查询用户 */
  395. corpsRemoteMethod(name) {
  396. if (name == null || name === "") {
  397. return false;
  398. }
  399. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  400. listCorps(queryParams).then((response) => {
  401. this.fMblnoOptions = response.rows;
  402. this.KHblnoOptions = response.rows;
  403. });
  404. },
  405. /** 查询库存总账列表 */
  406. getList() {
  407. this.loading = true;
  408. listWhgenleg(this.queryParams).then(response => {
  409. console.log(response)
  410. this.whgenlegList = response.rows;
  411. this.total = response.total;
  412. this.loading = false;
  413. });
  414. },
  415. // 取消按钮
  416. cancel() {
  417. this.open = false;
  418. this.reset();
  419. },
  420. // 表单重置
  421. reset() {
  422. this.form = {
  423. fAccyear: null,
  424. fId: null,
  425. fAccmonth: null,
  426. fCorpid: null,
  427. fMblno: null,
  428. fOriginalbillno: null,
  429. fWarehouseLocationid: null,
  430. fGoodsid: null,
  431. fTrademodeid: null,
  432. fPreqty: null,
  433. fPregrossweight: null,
  434. fPrenetweight: null,
  435. fQtyd: null,
  436. fVolumnd: null,
  437. fGrossweightd: null,
  438. fNetweightd: null,
  439. fVolumnc: null,
  440. fQtyc: null,
  441. fQtyblc: null,
  442. fGrossweightc: null,
  443. fNetweightc: null,
  444. fGrossweightblc: null,
  445. fNetweightblc: null,
  446. fCntrno: null,
  447. fStatus: "0",
  448. delFlag: null,
  449. createBy: null,
  450. fMarks: null,
  451. createTime: null,
  452. updateBy: null,
  453. updateTime: null,
  454. remark: null
  455. };
  456. this.resetForm("form");
  457. },
  458. /** 搜索按钮操作 */
  459. handleQuery() {
  460. this.queryParams.pageNum = 1;
  461. this.getList();
  462. },
  463. /** 重置按钮操作 */
  464. resetQuery() {
  465. this.queryParams = {
  466. pageNum: 1,
  467. pageSize: 10,
  468. fOriginalbillno: null,
  469. fPreqty: null,
  470. fPregrossweight: null,
  471. fPrenetweight: null,
  472. fQtyd: null,
  473. fVolumnd: null,
  474. fGrossweightd: null,
  475. fNetweightd: null,
  476. fVolumnc: null,
  477. fQtyc: null,
  478. fQtyblc: null,
  479. fGrossweightc: null,
  480. fNetweightc: null,
  481. fGrossweightblc: null,
  482. fNetweightblc: null,
  483. fCntrno: null,
  484. fStatus: null,
  485. fMarks: null,
  486. fBusinessType:null,
  487. fBusinessTypes:null,
  488. fBilltype:null,
  489. fwarehouseid:null
  490. }
  491. // this.resetForm("queryForm");
  492. this.handleQuery();
  493. },
  494. /** 新增按钮操作 */
  495. handleAdd() {
  496. this.reset();
  497. this.open = true;
  498. this.title = "添加库存总账";
  499. },
  500. /** 提交按钮 */
  501. submitForm() {
  502. this.$refs["form"].validate(valid => {
  503. if (valid) {
  504. if (this.form.fAccyear != null) {
  505. updateWhgenleg(this.form).then(response => {
  506. this.msgSuccess("修改成功");
  507. this.open = false;
  508. this.getList();
  509. });
  510. } else {
  511. addWhgenleg(this.form).then(response => {
  512. this.msgSuccess("新增成功");
  513. this.open = false;
  514. this.getList();
  515. });
  516. }
  517. }
  518. });
  519. },
  520. /** 导出按钮操作 */
  521. handleExport() {
  522. const queryParams = this.queryParams;
  523. this.$confirm('是否确认导出所有库存总账数据项?', "警告", {
  524. confirmButtonText: "确定",
  525. cancelButtonText: "取消",
  526. type: "warning"
  527. }).then(function() {
  528. return exportWhgenleg(queryParams);
  529. }).then(response => {
  530. this.download(response.msg);
  531. })
  532. }
  533. }
  534. };
  535. </script>