index.vue 12 KB

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