index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  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="fCorpid">
  5. <el-select
  6. v-model="queryParams.fCorpid"
  7. filterable
  8. remote
  9. clearable
  10. style="width: 200px"
  11. size="small"
  12. @keyup.enter.native="handleQuery"
  13. :remote-method="corpsRemoteMethod"
  14. placeholder="请选择货权方"
  15. >
  16. <el-option
  17. v-for="(dict, index) in fMblnoOptions"
  18. :key="index.fId"
  19. :label="dict.fName"
  20. :value="dict.fId"
  21. ></el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="提单号" prop="fMblno">
  25. <el-input
  26. v-model="queryParams.fMblno"
  27. placeholder="请输入提单号"
  28. clearable
  29. style="width: 200px"
  30. size="small"
  31. @keyup.enter.native="handleQuery"
  32. />
  33. </el-form-item>
  34. <el-form-item label="结算单位" prop="fToCorpid">
  35. <el-select
  36. v-model="queryParams.fToCorpid"
  37. placeholder="请选择结算单位"
  38. filterable
  39. remote
  40. clearable
  41. style="width: 200px"
  42. size="small"
  43. @keyup.enter.native="handleQuery"
  44. :remote-method="corpsRemoteMethod"
  45. >
  46. <el-option
  47. v-for="(dict, index) in fMblnoOptions"
  48. :key="index.fId"
  49. :label="dict.fName"
  50. :value="dict.fId"
  51. ></el-option>
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item label="货物名称" prop="fProductName">
  55. <el-select
  56. v-model="queryParams.fProductName"
  57. filterable
  58. remote
  59. clearable
  60. size="small"
  61. style="width: 200px"
  62. :remote-method="goodsRemoteMethod"
  63. @keyup.enter.native="handleQuery"
  64. placeholder="请选择货物名称"
  65. >
  66. <el-option
  67. v-for="(dict, index) in goodsOptions"
  68. :key="index.fId"
  69. :label="dict.fName"
  70. :value="dict.fName"
  71. ></el-option>
  72. </el-select>
  73. </el-form-item>
  74. <el-form-item label="品牌" prop="fMarks">
  75. <el-input
  76. v-model="queryParams.fMarks"
  77. placeholder="请输入品牌"
  78. clearable
  79. style="width: 200px"
  80. size="small"
  81. @keyup.enter.native="handleQuery"
  82. />
  83. </el-form-item>
  84. <el-form-item label="结算状态" prop="fReconciliation">
  85. <el-select
  86. v-model="queryParams.fReconciliation"
  87. clearable
  88. style="width: 200px"
  89. size="small"
  90. @keyup.enter.native="handleQuery"
  91. >
  92. <el-option label="未收" value="0"/>
  93. <el-option label="全部" value="1"/>
  94. </el-select>
  95. </el-form-item>
  96. <el-form-item label="费用状态" prop="fBillstatus">
  97. <el-select
  98. v-model="queryParams.fBillstatus"
  99. clearable
  100. style="width: 200px"
  101. size="small"
  102. @keyup.enter.native="handleQuery"
  103. >
  104. <el-option label="录入" value="0"/>
  105. <el-option label="审核通过" value="1"/>
  106. </el-select>
  107. </el-form-item>
  108. <el-form-item label="作业类型" prop="fBusinessType">
  109. <el-select
  110. style="width: 200px"
  111. multiple
  112. v-model="queryParams.fBusinessType"
  113. filterable
  114. >
  115. <el-option
  116. v-for="(dict, index) in businessTypeOption"
  117. :key="dict.dictValue"
  118. :label="dict.dictLabel"
  119. :value="dict.dictValue"
  120. ></el-option>
  121. </el-select>
  122. </el-form-item>
  123. <el-form-item label="费用名称" prop="fFeeid">
  124. <el-select
  125. style="width: 200px"
  126. multiple
  127. :remote-method="fWRemoteMethod"
  128. v-model="queryParams.fFeeid"
  129. filterable
  130. >
  131. <el-option
  132. v-for="(dict, index) in fWbuOptions"
  133. :key="index.fId"
  134. :label="dict.fName"
  135. :value="dict.fId"
  136. ></el-option>
  137. </el-select>
  138. </el-form-item>
  139. <el-form-item label="审核日期" prop="timeExamine">
  140. <el-date-picker
  141. v-model="queryParams.timeExamine"
  142. type="daterange"
  143. value-format="yyyy-MM-dd"
  144. clearable
  145. style="width: 280px"
  146. range-separator="至"
  147. start-placeholder="开始日期"
  148. end-placeholder="结束日期"
  149. @keyup.enter.native="handleQuery"
  150. >
  151. </el-date-picker>
  152. </el-form-item>
  153. <el-form-item>
  154. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  155. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  156. </el-form-item>
  157. </el-form>
  158. <el-row :gutter="10" class="mb8">
  159. <el-col :span="1.5">
  160. <el-button
  161. type="warning"
  162. icon="el-icon-download"
  163. size="mini"
  164. @click="handleExport"
  165. v-hasPermi="['warehouseBusiness:whgenleg:export']"
  166. >导出
  167. </el-button>
  168. </el-col>
  169. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  170. </el-row>
  171. <el-table v-loading="loading" :data="receivableList" show-summary :summary-method="getSum">
  172. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  173. <el-table-column type="index" label="行号" align="center" width="100"/>
  174. <el-table-column label="货权方" sortable align="center" prop="fName" width="220"/>
  175. <el-table-column label="结算单位" sortable align="center" prop="fFeesName" width="220"/>
  176. <el-table-column label="提单号" sortable align="center" prop="fMblno" width="216" show-overflow-tooltip/>
  177. <el-table-column label="货物名称" align="center" prop="fProductName" show-overflow-tooltip/>
  178. <el-table-column label="品牌" align="center" prop="fMarks" width="120"/>
  179. <el-table-column label="审核日期" align="center" prop="fReviewDate">
  180. <template slot-scope="scope">
  181. <span>{{ parseTime(scope.row.fReviewDate, '{y}-{m}-{d}') }}</span>
  182. </template>
  183. </el-table-column>
  184. <el-table-column label="应收金额" align="center" prop="fAmount"/>
  185. <el-table-column label="应付金额" align="center" prop="fStlamount"/>
  186. <el-table-column label="利润" align="center" prop="nnfinished"/>
  187. </el-table>
  188. <pagination
  189. v-show="total>0"
  190. :total="total"
  191. :page.sync="queryParams.pageNum"
  192. :limit.sync="queryParams.pageSize"
  193. :page-sizes="[50,100, 200, 500, 1000]"
  194. @pagination="getList"
  195. />
  196. </div>
  197. </template>
  198. <script>
  199. import {
  200. listpayable,
  201. listWhgenleg,
  202. getWhgenleg,
  203. delWhgenleg,
  204. addWhgenleg,
  205. updateWhgenleg,
  206. exportWhgenleg
  207. } from '@/api/reportManagement/profit'
  208. import { listWarehouse } from '@/api/basicdata/warehouse'
  209. import { listArea } from '@/api/basicdata/area'
  210. import { listGoods } from '@/api/basicdata/goods'
  211. import { listCorps } from '@/api/basicdata/corps'
  212. import { listFees } from '@/api/basicdata/fees'
  213. export default {
  214. name: 'generalLedgerDr',
  215. components: {},
  216. data() {
  217. return {
  218. //费用名称
  219. fWbuOptions:[],
  220. businessInTypeOption:[],
  221. businessOutTypeOption:[],
  222. businessTransTypeOption:[],
  223. businessTypeOption: [],
  224. // 货权方(客户数据)
  225. fMblnoOptions: [],
  226. // 贸易方式(数据字典),对应t_trademodels 字典
  227. fTrademodeidOptions: [],
  228. // 货物
  229. goodsOptions: [],
  230. // 仓库(仓库数据)
  231. warehouseOptions: [],
  232. kqhouseOptions: [],
  233. // 遮罩层
  234. loading: true,
  235. // 显示搜索条件
  236. showSearch: true,
  237. // 总条数
  238. total: 0,
  239. // 库存总账表格数据
  240. receivableList: [],
  241. // 弹出层标题
  242. title: '',
  243. // 是否显示弹出层
  244. open: false,
  245. // 查询参数
  246. queryParams: {
  247. pageNum: 1,
  248. pageSize: 50,
  249. fCorpid: null,
  250. fMblno: null,
  251. timeExamine: null,
  252. fToCorpid: null,
  253. fProductName: null,
  254. fMarks: null,
  255. fReconciliation: null,
  256. fBillstatus: null,
  257. fBusinessType:null,
  258. fFeeid:null
  259. },
  260. // 表单参数
  261. form: {},
  262. // 表单校验
  263. rules: {
  264. fMarks: [
  265. { required: true, message: '唛头不能为空', trigger: 'blur' }
  266. ]
  267. }
  268. }
  269. },
  270. created() {
  271. /* 远程模糊查询费用名称 */
  272. this.fWRemoteMethod()
  273. let this_ = this
  274. this_.getList()
  275. this_.getDicts('data_trademodes').then((response) => {
  276. this_.fTrademodeidOptions = response.data
  277. })
  278. this_.getDicts('st_in_type').then((response) => {
  279. this_.businessInTypeOption = response.data
  280. this_.getDicts('st_out_type').then((response) => {
  281. this_.businessOutTypeOption = response.data
  282. this_.getDicts('st_trans_type').then((response) => {
  283. this_.businessTransTypeOption = response.data
  284. this_.merge(this_.businessOutTypeOption,this_.businessInTypeOption,this_.businessTransTypeOption)
  285. })
  286. })
  287. })
  288. },
  289. methods: {
  290. getSum(param) {
  291. const { columns, data } = param
  292. const sums = []
  293. columns.forEach((column, index) => {
  294. if (index === 0) {
  295. sums[index] = '总计'
  296. } else if (index === 7 || index === 8 || index === 9) {
  297. const values = data.map(item => Number(item[column.property]))
  298. if (!values.every(value => isNaN(value))) {
  299. sums[index] = values.reduce((prev, curr) => {
  300. const value = Number(curr)
  301. if (!isNaN(value)) {
  302. return prev + curr
  303. } else {
  304. return prev
  305. }
  306. }, 0)
  307. }
  308. }
  309. })
  310. return sums
  311. },
  312. // 贸易方式(数据字典),对���t_trademodels 字典翻译
  313. fTrademodeidFormat(row, column) {
  314. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid)
  315. },
  316. /* 远程模糊查询仓库 */
  317. warehouseRemoteMethod(name) {
  318. if (name == null || name === '') {
  319. return false
  320. }
  321. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  322. listWarehouse(queryParams).then((response) => {
  323. this.warehouseOptions = response.rows
  324. })
  325. },
  326. /* 远程模糊查询费用名称 */
  327. fWRemoteMethod(name) {
  328. // if (name == null || name === "") {
  329. // return false;
  330. // }
  331. let queryParams = { pageNum: 1, fName: name };
  332. console.log(queryParams)
  333. listFees(queryParams).then((response) => {
  334. this.fWbuOptions = response.rows
  335. console.log(response)
  336. });
  337. },
  338. /* 远程模糊查询库区 */
  339. kqhouseRemoteMethod(name) {
  340. if (name == null || name === '') {
  341. return false
  342. }
  343. if (!this.queryParams.fWarehouseid) {
  344. this.$message.error('请输入仓库!')
  345. return false
  346. }
  347. let queryParams = {
  348. pageNum: 1,
  349. pageSize: 10,
  350. fWarehouseid: this.queryParams.fWarehouseid,
  351. fName: name
  352. }
  353. listArea(queryParams).then((response) => {
  354. this.kqhouseOptions = response.rows
  355. })
  356. },
  357. /* 远程模糊查询商品 */
  358. goodsRemoteMethod(name) {
  359. if (name == null || name === '') {
  360. return false
  361. }
  362. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  363. listGoods(queryParams).then((response) => {
  364. this.goodsOptions = response.rows
  365. })
  366. },
  367. /* 远程模糊查询用户 */
  368. corpsRemoteMethod(name) {
  369. if (name == null || name === '') {
  370. return false
  371. }
  372. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  373. listCorps(queryParams).then((response) => {
  374. this.fMblnoOptions = response.rows
  375. this.KHblnoOptions = response.rows
  376. })
  377. },
  378. merge(index,list,err){
  379. this.businessTypeOption = this.businessTypeOption.concat(index,list,err)
  380. },
  381. /** 查询库存总账列表 */
  382. getList() {
  383. this.loading = true
  384. this.getDicts('approval_process').then((response) => {
  385. this.options = response.data
  386. })
  387. listpayable(this.queryParams).then(response => {
  388. this.receivableList = response.rows
  389. this.total = response.total
  390. this.loading = false
  391. })
  392. },
  393. // 取消按钮
  394. cancel() {
  395. this.open = false
  396. this.reset()
  397. },
  398. // 表单重置
  399. reset() {
  400. this.form = {
  401. fAccyear: null,
  402. fId: null,
  403. fAccmonth: null,
  404. fCorpid: null,
  405. fMblno: null,
  406. fOriginalbillno: null,
  407. fWarehouseLocationid: null,
  408. fGoodsid: null,
  409. fTrademodeid: null,
  410. fPreqty: null,
  411. fPregrossweight: null,
  412. fPrenetweight: null,
  413. fQtyd: null,
  414. fVolumnd: null,
  415. fGrossweightd: null,
  416. fNetweightd: null,
  417. fVolumnc: null,
  418. fQtyc: null,
  419. fQtyblc: null,
  420. fGrossweightc: null,
  421. fNetweightc: null,
  422. fGrossweightblc: null,
  423. fNetweightblc: null,
  424. fCntrno: null,
  425. fStatus: '0',
  426. delFlag: null,
  427. createBy: null,
  428. fMarks: null,
  429. createTime: null,
  430. updateBy: null,
  431. updateTime: null,
  432. remark: null
  433. }
  434. this.resetForm('form')
  435. },
  436. /** 搜索按钮操作 */
  437. handleQuery() {
  438. this.queryParams.pageNum = 1
  439. this.getList()
  440. },
  441. /** 重置按钮操作 */
  442. resetQuery() {
  443. this.resetForm('queryForm')
  444. this.handleQuery()
  445. },
  446. /** 新增按钮操作 */
  447. handleAdd() {
  448. this.reset()
  449. this.open = true
  450. this.title = '添加库存总账'
  451. },
  452. /** 提交按钮 */
  453. submitForm() {
  454. this.$refs['form'].validate(valid => {
  455. if (valid) {
  456. if (this.form.fAccyear != null) {
  457. updateWhgenleg(this.form).then(response => {
  458. this.msgSuccess('修改成功')
  459. this.open = false
  460. this.getList()
  461. })
  462. } else {
  463. addWhgenleg(this.form).then(response => {
  464. this.msgSuccess('新增成功')
  465. this.open = false
  466. this.getList()
  467. })
  468. }
  469. }
  470. })
  471. },
  472. /** 导出按钮操作 */
  473. handleExport() {
  474. const queryParams = this.queryParams
  475. this.$confirm('是否确认导出所有库存总账数据项?', '警告', {
  476. confirmButtonText: '确定',
  477. cancelButtonText: '取消',
  478. type: 'warning'
  479. }).then(function() {
  480. return exportWhgenleg(queryParams)
  481. }).then(response => {
  482. this.download(response.msg)
  483. })
  484. }
  485. }
  486. }
  487. </script>