index.vue 18 KB

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