detail.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10" class="mb8">
  4. <div class="tabSetting">
  5. <el-col :span="1.5">
  6. <el-button
  7. type="warning"
  8. icon="el-icon-download"
  9. size="mini"
  10. @click="handleExport"
  11. v-hasPermi="['warehouseBusiness:payable:export']"
  12. >导出</el-button
  13. >
  14. </el-col>
  15. <right-toolbar
  16. :showSearch.sync="showSearch"
  17. @queryTable="getList"
  18. ></right-toolbar>
  19. <div style="margin: 0 12px">
  20. <el-button
  21. icon="el-icon-setting"
  22. size="mini"
  23. circle
  24. @click="showSetting = !showSetting"
  25. ></el-button>
  26. </div>
  27. </div>
  28. </el-row>
  29. <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px">
  30. <div>配置排序列数据(拖动调整顺序)</div>
  31. <div style="margin-left: 17px">
  32. <el-checkbox
  33. v-model="allCheck"
  34. label="全选"
  35. @change="allChecked"
  36. ></el-checkbox>
  37. </div>
  38. <div style="padding: 4px; display: flex; justify-content: center">
  39. <draggable
  40. v-model="setRowList"
  41. group="site"
  42. animation="300"
  43. @start="onStart"
  44. @end="onEnd"
  45. handle=".indraggable"
  46. >
  47. <transition-group>
  48. <div
  49. v-for="item in setRowList"
  50. :key="item.surface"
  51. class="listStyle"
  52. >
  53. <div style="width: 500px" class="indraggable">
  54. <div class="progress" :style="{ width: item.width + 'px' }">
  55. <el-checkbox
  56. :label="item.name"
  57. v-model="item.checked"
  58. :true-label="0"
  59. :false-label="1"
  60. >{{ item.name }}
  61. </el-checkbox>
  62. </div>
  63. </div>
  64. <el-input-number
  65. v-model.number="item.width"
  66. controls-position="right"
  67. :min="1"
  68. :max="500"
  69. size="mini"
  70. ></el-input-number>
  71. </div>
  72. </transition-group>
  73. </draggable>
  74. </div>
  75. <span slot="footer" class="dialog-footer">
  76. <el-button @click="showSetting = false">取 消</el-button>
  77. <el-button @click="delRow" type="danger">重 置</el-button>
  78. <el-button type="primary" @click="save()">确 定</el-button>
  79. </span>
  80. </el-dialog>
  81. <el-table
  82. v-loading="loading"
  83. :data="payableList"
  84. show-summary
  85. :summary-method="getSum"
  86. ref="table"
  87. :height="tableHeight"
  88. >
  89. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  90. <el-table-column type="index" label="行号" align="center" width="80" fixed=""/>
  91. <el-table-column
  92. v-for="(item, index) in getRowList"
  93. :key="index"
  94. :label="item.name"
  95. :width="item.width"
  96. :prop="item.label"
  97. align="center"
  98. :show-overflow-tooltip="true"
  99. sortable
  100. :fixed="item.fixed"
  101. />
  102. </el-table>
  103. <pagination
  104. v-show="total > 0"
  105. :total="total"
  106. :page.sync="queryParams.pageNum"
  107. :limit.sync="queryParams.pageSize"
  108. :page-sizes="[50, 100, 200, 500, 1000]"
  109. @pagination="getList"
  110. />
  111. <!-- 添加或修改库存总账对话框 -->
  112. <!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
  113. <!-- <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
  114. <!-- <el-form-item label="原始入库业务编号" prop="fOriginalbillno">-->
  115. <!-- <el-input v-model="form.fOriginalbillno" placeholder="请输入原始入库业务编号" />-->
  116. <!-- </el-form-item>-->
  117. <!-- <el-form-item label="上期件数" prop="fPreqty">-->
  118. <!-- <el-input v-model="form.fPreqty" placeholder="请输入上期件数" />-->
  119. <!-- </el-form-item>-->
  120. <!-- <el-form-item label="上期毛重,单位为吨,保留6位小数" prop="fPregrossweight">-->
  121. <!-- <el-input v-model="form.fPregrossweight" placeholder="请输入上期毛重,单位为吨,保留6位小数" />-->
  122. <!-- </el-form-item>-->
  123. <!-- <el-form-item label="上期净重," prop="fPrenetweight">-->
  124. <!-- <el-input v-model="form.fPrenetweight" placeholder="请输入上期净重," />-->
  125. <!-- </el-form-item>-->
  126. <!-- <el-form-item label="入库件数" prop="fQtyd">-->
  127. <!-- <el-input v-model="form.fQtyd" placeholder="请输入入库件数" />-->
  128. <!-- </el-form-item>-->
  129. <!-- <el-form-item label="入库尺码" prop="fVolumnd">-->
  130. <!-- <el-input v-model="form.fVolumnd" placeholder="请输入入库尺码" />-->
  131. <!-- </el-form-item>-->
  132. <!-- <el-form-item label="入库毛重" prop="fGrossweightd">-->
  133. <!-- <el-input v-model="form.fGrossweightd" placeholder="请输入入库毛重" />-->
  134. <!-- </el-form-item>-->
  135. <!-- <el-form-item label="入库净重" prop="fNetweightd">-->
  136. <!-- <el-input v-model="form.fNetweightd" placeholder="请输入入库净重" />-->
  137. <!-- </el-form-item>-->
  138. <!-- <el-form-item label="出口尺码" prop="fVolumnc">-->
  139. <!-- <el-input v-model="form.fVolumnc" placeholder="请输入出口尺码" />-->
  140. <!-- </el-form-item>-->
  141. <!-- <el-form-item label="出库件数" prop="fQtyc">-->
  142. <!-- <el-input v-model="form.fQtyc" placeholder="请输入出库件数" />-->
  143. <!-- </el-form-item>-->
  144. <!-- <el-form-item label="结余件数" prop="fQtyblc">-->
  145. <!-- <el-input v-model="form.fQtyblc" placeholder="请输入结余件数" />-->
  146. <!-- </el-form-item>-->
  147. <!-- <el-form-item label="出库毛重,单位为吨" prop="fGrossweightc">-->
  148. <!-- <el-input v-model="form.fGrossweightc" placeholder="请输入出库毛重,单位为吨" />-->
  149. <!-- </el-form-item>-->
  150. <!-- <el-form-item label="出库净重" prop="fNetweightc">-->
  151. <!-- <el-input v-model="form.fNetweightc" placeholder="请输入出库净重" />-->
  152. <!-- </el-form-item>-->
  153. <!-- <el-form-item label="结余毛重" prop="fGrossweightblc">-->
  154. <!-- <el-input v-model="form.fGrossweightblc" placeholder="请输入结余毛重" />-->
  155. <!-- </el-form-item>-->
  156. <!-- <el-form-item label="结余净重" prop="fNetweightblc">-->
  157. <!-- <el-input v-model="form.fNetweightblc" placeholder="请输入结余净重" />-->
  158. <!-- </el-form-item>-->
  159. <!-- <el-form-item label="箱号" prop="fCntrno">-->
  160. <!-- <el-input v-model="form.fCntrno" placeholder="请输入箱号" />-->
  161. <!-- </el-form-item>-->
  162. <!-- <el-form-item label="状态,默认 T ,正常T 停用F 下拉选择">-->
  163. <!-- <el-radio-group v-model="form.fStatus">-->
  164. <!-- <el-radio label="1">请选择字典生成</el-radio>-->
  165. <!-- </el-radio-group>-->
  166. <!-- </el-form-item>-->
  167. <!-- <el-form-item label="删除状态" prop="delFlag">-->
  168. <!-- <el-input v-model="form.delFlag" placeholder="请输入删除状态" />-->
  169. <!-- </el-form-item>-->
  170. <!-- <el-form-item label="唛头" prop="fMarks">-->
  171. <!-- <el-input v-model="form.fMarks" placeholder="请输入唛头" />-->
  172. <!-- </el-form-item>-->
  173. <!-- <el-form-item label="备注" prop="remark">-->
  174. <!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />-->
  175. <!-- </el-form-item>-->
  176. <!-- </el-form>-->
  177. <!-- <div slot="footer" class="dialog-footer">-->
  178. <!-- <el-button type="primary" @click="submitForm">确 定</el-button>-->
  179. <!-- <el-button @click="cancel">取 消</el-button>-->
  180. <!-- </div>-->
  181. <!-- </el-dialog>-->
  182. </div>
  183. </template>
  184. <script>
  185. import {
  186. listpayable,
  187. addWhgenleg,
  188. updateWhgenleg,
  189. exportWhgenleg,
  190. selectCrDetail,
  191. exportCrDetail
  192. } from "@/api/reportManagement/payable";
  193. import { listWarehouse } from "@/api/basicdata/warehouse";
  194. import { listArea } from "@/api/basicdata/area";
  195. import { listGoods } from "@/api/basicdata/goods";
  196. import { listCorps } from "@/api/basicdata/corps";
  197. import { addSet, select, resetModule } from "@/api/system/set";
  198. import Cookies from "js-cookie";
  199. import draggable from "vuedraggable";
  200. export default {
  201. name: "generalLedgerCr",
  202. components: {},
  203. data() {
  204. return {
  205. pickerOptions: {
  206. shortcuts: [{
  207. text: '最近一周',
  208. onClick(picker) {
  209. const end = new Date();
  210. const start = new Date();
  211. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  212. picker.$emit('pick', [start, end]);
  213. }
  214. }, {
  215. text: '最近一个月',
  216. onClick(picker) {
  217. const end = new Date();
  218. const start = new Date();
  219. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  220. picker.$emit('pick', [start, end]);
  221. }
  222. }, {
  223. text: '最近三个月',
  224. onClick(picker) {
  225. const end = new Date();
  226. const start = new Date();
  227. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  228. picker.$emit('pick', [start, end]);
  229. }
  230. }]
  231. },
  232. tableHeight: '0',
  233. payableList: [],
  234. // 货权方(客户数据)
  235. fMblnoOptions: [],
  236. // 贸易方式(数据字典),对应t_trademodels 字典
  237. fTrademodeidOptions: [],
  238. // 货物
  239. goodsOptions: [],
  240. // 仓库(仓库数据)
  241. warehouseOptions: [],
  242. kqhouseOptions: [],
  243. // 遮罩层
  244. loading: true,
  245. // 显示搜索条件
  246. showSearch: true,
  247. // 总条数
  248. total: 0,
  249. // 库存总账表格数据
  250. receivableList: [],
  251. // 弹出层标题
  252. title: "",
  253. // 是否显示弹出层
  254. open: false,
  255. // 查询参数
  256. queryParams: {
  257. pageNum: 1,
  258. pageSize: 50,
  259. fCorpid: null,
  260. fMblno: null,
  261. timeExamine: null,
  262. fToCorpid: null,
  263. fProductName: null,
  264. fMarks: null,
  265. fReconciliation: null,
  266. fBillstatus: null,
  267. },
  268. // 表单参数
  269. form: {},
  270. // 表单校验
  271. rules: {
  272. fMarks: [{ required: true, message: "唛头不能为空", trigger: "blur" }],
  273. },
  274. showSetting: false,
  275. drag: false,
  276. setRowList: [],
  277. getRowList: [],
  278. tableDate: [
  279. {
  280. surface: "2",
  281. label: "ffeesName",
  282. name: "结算单位",
  283. checked: 0,
  284. width: 130,
  285. },
  286. {
  287. surface: "3",
  288. label: "fmblno",
  289. name: "提单号",
  290. checked: 0,
  291. width: 130,
  292. },
  293. {
  294. surface: "4",
  295. label: "fproductName",
  296. name: "货物名称",
  297. checked: 0,
  298. width: 130,
  299. },
  300. {
  301. surface: "5",
  302. label: "fmarks",
  303. name: "品牌",
  304. checked: 0,
  305. width: 130,
  306. },
  307. {
  308. surface: "5",
  309. label: "fBilltype",
  310. name: "业务类型",
  311. checked: 0,
  312. width: 130,
  313. },
  314. {
  315. surface: "6",
  316. label: "fReviewDate",
  317. name: "审核日期",
  318. checked: 0,
  319. width: 130,
  320. },
  321. {
  322. surface: "6",
  323. label: "storageFee",
  324. name: "仓储费金额",
  325. checked: 0,
  326. width: 130,
  327. },
  328. {
  329. surface: "6",
  330. label: "otherFee",
  331. name: "其他金额",
  332. checked: 0,
  333. width: 130,
  334. },
  335. {
  336. surface: "7",
  337. label: "famount",
  338. name: "应付金额",
  339. checked: 0,
  340. width: 130,
  341. },
  342. {
  343. surface: "8",
  344. label: "fstlamount",
  345. name: "实付金额",
  346. checked: 0,
  347. width: 130,
  348. },
  349. {
  350. surface: "9",
  351. label: "nnfinished",
  352. name: "未付金额",
  353. checked: 0,
  354. width: 130,
  355. }
  356. ],
  357. allCheck: false,
  358. };
  359. },
  360. created() {
  361. this.setRowList = this.tableDate;
  362. this.getRowList = this.tableDate;
  363. // this.getList();
  364. this.getDicts("data_trademodes").then((response) => {
  365. this.fTrademodeidOptions = response.data;
  366. });
  367. this.getRow();
  368. },
  369. activated() {
  370. if (this.$route.query) {
  371. this.getList()
  372. }
  373. },
  374. mounted() {
  375. this.$nextTick(() => {
  376. // 监听浏览器高度变化,改变表格高度
  377. window.onresize = () => {
  378. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  379. }
  380. })
  381. },
  382. methods: {
  383. //列设置全选
  384. allChecked() {
  385. if (this.allCheck == true) {
  386. this.setRowList.map((e) => {
  387. return (e.checked = 0);
  388. });
  389. } else {
  390. this.setRowList.map((e) => {
  391. return (e.checked = 1);
  392. });
  393. }
  394. },
  395. //查询列数据
  396. getRow() {
  397. let that = this;
  398. this.data = {
  399. tableName: "应付总账",
  400. userId: Cookies.get("userName"),
  401. };
  402. select(this.data).then((res) => {
  403. if (res.data.length != 0) {
  404. this.getRowList = res.data.filter((e) => e.checked == 0);
  405. this.setRowList = res.data;
  406. this.setRowList = this.setRowList.reduce((res, item) => {
  407. res.push({
  408. surface: item.surface,
  409. label: item.label,
  410. name: item.name,
  411. checked: item.checked,
  412. width: item.width,
  413. fixed: item.fixed,
  414. });
  415. return res;
  416. }, []);
  417. }
  418. });
  419. },
  420. delRow() {
  421. this.data = {
  422. tableName: "应付总账",
  423. userId: Cookies.get("userName"),
  424. };
  425. resetModule(this.data).then((res) => {
  426. if (res.code == 200) {
  427. this.showSetting = false;
  428. this.setRowList = this.tableDate;
  429. this.getRowList = this.tableDate;
  430. }
  431. });
  432. },
  433. //保存列设置
  434. save() {
  435. this.showSetting = false;
  436. this.data = {
  437. tableName: "应付总账",
  438. userId: Cookies.get("userName"),
  439. sysTableSetList: this.setRowList,
  440. };
  441. addSet(this.data).then((res) => {
  442. if (res.code == 200) {
  443. this.showSetting = false;
  444. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  445. }
  446. });
  447. },
  448. //开始拖拽事件
  449. onStart() {
  450. this.drag = true;
  451. },
  452. //拖拽结束事件
  453. onEnd() {
  454. this.drag = false;
  455. },
  456. //合计
  457. getSum(param) {
  458. const { columns, data } = param;
  459. const sums = [];
  460. columns.forEach((column, index) => {
  461. if (index === 0) {
  462. sums[index] = "合计";
  463. } else if (index === 7 || index === 8 || index === 9) {
  464. const values = data.map((item) => Number(item[column.property]));
  465. if (!values.every((value) => isNaN(value))) {
  466. sums[index] = values.reduce((prev, curr) => {
  467. const value = Number(curr);
  468. if (!isNaN(value)) {
  469. return prev + curr;
  470. } else {
  471. return prev;
  472. }
  473. }, 0);
  474. }
  475. }
  476. });
  477. return sums;
  478. },
  479. // 贸易方式(数据字典),对���t_trademodels 字典翻译
  480. fTrademodeidFormat(row, column) {
  481. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid);
  482. },
  483. /* 远程模糊查询仓库 */
  484. warehouseRemoteMethod(name) {
  485. if (name == null || name === "") {
  486. return false;
  487. }
  488. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  489. listWarehouse(queryParams).then((response) => {
  490. this.warehouseOptions = response.rows;
  491. });
  492. },
  493. /* 远程模糊查询库区 */
  494. kqhouseRemoteMethod(name) {
  495. if (name == null || name === "") {
  496. return false;
  497. }
  498. if (!this.queryParams.fWarehouseid) {
  499. this.$message.error("请输入仓库!");
  500. return false;
  501. }
  502. let queryParams = {
  503. pageNum: 1,
  504. pageSize: 10,
  505. fWarehouseid: this.queryParams.fWarehouseid,
  506. fName: name,
  507. };
  508. listArea(queryParams).then((response) => {
  509. this.kqhouseOptions = response.rows;
  510. });
  511. },
  512. /* 远程模糊查询商品 */
  513. goodsRemoteMethod(name) {
  514. if (name == null || name === "") {
  515. return false;
  516. }
  517. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  518. listGoods(queryParams).then((response) => {
  519. this.goodsOptions = response.rows;
  520. });
  521. },
  522. /* 远程模糊查询用户 */
  523. corpsRemoteMethod(name) {
  524. if (name == null || name === "") {
  525. return false;
  526. }
  527. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  528. listCorps(queryParams).then((response) => {
  529. this.fMblnoOptions = response.rows;
  530. this.KHblnoOptions = response.rows;
  531. });
  532. },
  533. /** 查询库存总账列表 */
  534. getList() {
  535. this.loading = true;
  536. this.getDicts("approval_process").then((response) => {
  537. this.options = response.data;
  538. });
  539. selectCrDetail(this.$route.query).then((response) => {
  540. this.payableList = response.data;
  541. this.total = response.total;
  542. this.loading = false;
  543. // 根据浏览器高度设置初始高度
  544. setTimeout(() => {
  545. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  546. }, 300)
  547. });
  548. },
  549. // 取消按钮
  550. cancel() {
  551. this.open = false;
  552. this.reset();
  553. },
  554. // 表单重置
  555. reset() {
  556. this.form = {
  557. fAccyear: null,
  558. fId: null,
  559. fAccmonth: null,
  560. fCorpid: null,
  561. fMblno: null,
  562. fOriginalbillno: null,
  563. fWarehouseLocationid: null,
  564. fGoodsid: null,
  565. fTrademodeid: null,
  566. fPreqty: null,
  567. fPregrossweight: null,
  568. fPrenetweight: null,
  569. fQtyd: null,
  570. fVolumnd: null,
  571. fGrossweightd: null,
  572. fNetweightd: null,
  573. fVolumnc: null,
  574. fQtyc: null,
  575. fQtyblc: null,
  576. fGrossweightc: null,
  577. fNetweightc: null,
  578. fGrossweightblc: null,
  579. fNetweightblc: null,
  580. fCntrno: null,
  581. fStatus: "0",
  582. delFlag: null,
  583. createBy: null,
  584. fMarks: null,
  585. createTime: null,
  586. updateBy: null,
  587. updateTime: null,
  588. remark: null,
  589. };
  590. this.resetForm("form");
  591. },
  592. /** 搜索按钮操作 */
  593. handleQuery() {
  594. this.queryParams.pageNum = 1;
  595. this.getList();
  596. },
  597. /** 重置按钮操作 */
  598. resetQuery() {
  599. // this.resetForm("queryForm");
  600. this.resetQueryParams()
  601. this.handleQuery();
  602. },
  603. // 搜索重置
  604. resetQueryParams() {
  605. this.queryParams = {
  606. pageNum: 1,
  607. pageSize: 50,
  608. fCorpid: null,
  609. fMblno: null,
  610. timeExamine: null,
  611. fToCorpid: null,
  612. fProductName: null,
  613. fMarks: null,
  614. fReconciliation: null,
  615. fBillstatus: null,
  616. }
  617. },
  618. /** 新增按钮操作 */
  619. handleAdd() {
  620. this.reset();
  621. this.open = true;
  622. this.title = "添加库存总账";
  623. },
  624. /** 提交按钮 */
  625. submitForm() {
  626. this.$refs["form"].validate((valid) => {
  627. if (valid) {
  628. if (this.form.fAccyear != null) {
  629. updateWhgenleg(this.form).then((response) => {
  630. this.msgSuccess("修改成功");
  631. this.open = false;
  632. this.getList();
  633. });
  634. } else {
  635. addWhgenleg(this.form).then((response) => {
  636. this.msgSuccess("新增成功");
  637. this.open = false;
  638. this.getList();
  639. });
  640. }
  641. }
  642. });
  643. },
  644. /** 导出按钮操作 */
  645. handleExport() {
  646. // const queryParams = this.queryParams;
  647. const queryParams = this.$route.query;
  648. this.$confirm("是否确认导出所有应付总账数据项?", "警告", {
  649. confirmButtonText: "确定",
  650. cancelButtonText: "取消",
  651. type: "warning",
  652. })
  653. .then(function () {
  654. return exportCrDetail(queryParams);
  655. })
  656. .then((response) => {
  657. this.download(response.msg);
  658. });
  659. },
  660. },
  661. };
  662. </script>
  663. <style lang="scss">
  664. .tabSetting {
  665. display: flex;
  666. justify-content: flex-end;
  667. }
  668. .listStyle {
  669. display: flex;
  670. border-top: 1px solid #dcdfe6;
  671. border-left: 1px solid #dcdfe6;
  672. border-right: 1px solid #dcdfe6;
  673. }
  674. .listStyle:last-child {
  675. border-bottom: 1px solid #dcdfe6;
  676. }
  677. .progress {
  678. display: flex;
  679. align-items: center;
  680. padding: 2px;
  681. background-color: rgba(0, 0, 0, 0.05);
  682. height: 100%;
  683. }
  684. </style>