index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <div class="ele-border-lighter form-content" v-loading="loading">
  5. <search-table @search="reload"></search-table>
  6. <!-- 数据表格 -->
  7. <ele-pro-table
  8. ref="table"
  9. :columns="columns"
  10. :datasource="datasource"
  11. height="calc(100vh - 405px)"
  12. style="margin-bottom: 10px"
  13. full-height="calc(100vh - 116px)"
  14. tool-class="ele-toolbar-form"
  15. :selection.sync="selection"
  16. :page-size="20"
  17. @columns-change="handleColumnChange"
  18. :cache-key="cacheKeyUrl"
  19. >
  20. <!-- 表头工具栏 -->
  21. <template v-slot:toolbar>
  22. <el-button
  23. size="small"
  24. type="primary"
  25. icon="el-icon-plus"
  26. class="ele-btn-icon"
  27. @click="handleAddOrEditAccount('add',{})"
  28. >
  29. 新建
  30. </el-button>
  31. <el-button
  32. size="small"
  33. type="danger"
  34. el-icon-delete
  35. class="ele-btn-icon"
  36. @click="allDelBtn"
  37. :disabled="selection?.length===0"
  38. >
  39. 批量删除
  40. </el-button>
  41. </template>
  42. <!-- 查看详情列 -->
  43. <template v-slot:statementNo="{ row }">
  44. <el-link type="primary" :underline="false" @click="openorderDetail(row,'statementNo')"> {{
  45. row.statementNo
  46. }}
  47. </el-link>
  48. </template>
  49. <template v-slot:orderNo="{ row }">
  50. <el-link type="primary" :underline="false" @click="openorderDetail(row,'orderNo')"> {{
  51. row.orderNo
  52. }}
  53. </el-link>
  54. </template>
  55. <!-- 操作列 -->
  56. <template v-slot:action="{ row }">
  57. <el-link
  58. type="primary"
  59. :underline="false"
  60. icon="el-icon-edit"
  61. @click="handleAddOrEditAccount('edit',row)"
  62. v-if="(isNeed_process_is_close&&[0, 3].includes(row.reviewStatus))||!isNeed_process_is_close"
  63. >
  64. 修改
  65. </el-link>
  66. <el-link
  67. type="primary"
  68. :underline="false"
  69. icon="el-icon-plus"
  70. @click="accountstatementSubmit(row)"
  71. v-if="isNeed_process_is_close&&[0, 3].includes(row.reviewStatus)">
  72. 提交
  73. </el-link>
  74. <el-popconfirm
  75. class="ele-action"
  76. title="确定要删除此信息吗?"
  77. @confirm="remove([row.id])">
  78. <template v-slot:reference>
  79. <el-link
  80. type="danger"
  81. :underline="false"
  82. icon="el-icon-delete"
  83. v-if="(isNeed_process_is_close&&[0, 3].includes(row.reviewStatus))||!isNeed_process_is_close"
  84. >
  85. 删除
  86. </el-link>
  87. </template>
  88. </el-popconfirm>
  89. <!-- <el-link-->
  90. <!-- type="primary"-->
  91. <!-- :underline="false"-->
  92. <!-- icon="el-icon-download"-->
  93. <!-- @click="handleExport(row)"-->
  94. <!-- v-if="[2].includes(row.reviewStatus)">-->
  95. <!-- 导出-->
  96. <!-- </el-link>-->
  97. <el-link
  98. size="small"
  99. type="primary"
  100. :underline="false"
  101. icon="el-icon-plus"
  102. class="ele-btn-icon"
  103. v-if="[2].includes(row.reviewStatus)"
  104. @click="handleAddInvoice(row)"
  105. >
  106. 新增发票
  107. </el-link>
  108. </template>
  109. </ele-pro-table>
  110. </div>
  111. </el-card>
  112. <order-detail-dialog ref="orderDetailDialogRef"></order-detail-dialog>
  113. <add-account-dialog
  114. v-if="addAccountDialogFlag"
  115. :addAccountDialogFlag.sync="addAccountDialogFlag"
  116. ref="accountDialogRef"
  117. @done="reload"
  118. ></add-account-dialog>
  119. <!--对账单详情 -->
  120. <detail-dialog :detailDialogFlag.sync="detailDialogFlag" ref="detailDialogRef"></detail-dialog>
  121. <add-return-goods-dialog ref="addReturnGoodsRef" @done="reload"></add-return-goods-dialog>
  122. <!-- 多选删除弹窗 -->
  123. <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
  124. <!-- 创建发票选择采购对账单信息 对账明细 -->
  125. <accountInfoDialog ref="accountInfoDialogRef"
  126. v-if="accountInfoDialogFlag"
  127. :account-info-dialog-flag.sync="accountInfoDialogFlag"
  128. @getAccountInfo="getAccountInfo"></accountInfoDialog>
  129. <!-- 新增发票-->
  130. <add-invoice-dialog :add-or-edit-dialog-flag.sync="addInvoiceDialogFlag" ref="addInvoiceDialogRef"
  131. v-if="addInvoiceDialogFlag" @reload="reload"></add-invoice-dialog>
  132. <process-submit-dialog :processSubmitDialogFlag.sync="processSubmitDialogFlag" v-if="processSubmitDialogFlag" ref="processSubmitDialogRef" @reload="reload"></process-submit-dialog>
  133. </div>
  134. </template>
  135. <script>
  136. import searchTable from './components/searchTable.vue';
  137. import addAccountDialog from './components/addAccountDialog.vue';
  138. import detailDialog from './components/detailDialog.vue'
  139. import popModal from '@/components/pop-modal';
  140. import {reviewStatusEnum} from '@/enum/dict';
  141. import orderDetailDialog from '@/views/purchasingManage/purchaseOrder/components/detailDialog.vue'
  142. import addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
  143. import {
  144. getAccountstatementList,
  145. deletetAccountstatement,
  146. submitAccountStatementApproveAPI,
  147. accountStatementExportAPI
  148. } from '@/api/saleManage/accountstatement';
  149. import dictMixins from '@/mixins/dictMixins';
  150. import 'file-saver'
  151. import AccountInfoDialog from "@/views/financialManage/invoiceManage/components/accountInfoDialog.vue";
  152. import addInvoiceDialog from "@/views/financialManage/invoiceManage/components/addOrEditDialog.vue";
  153. import processSubmitDialog from "@/BIZComponents/processSubmitDialog/processSubmitDialog.vue";
  154. import tabMixins from '@/mixins/tableColumnsMixin';
  155. export default {
  156. mixins: [dictMixins,tabMixins],
  157. components: {
  158. processSubmitDialog,
  159. addInvoiceDialog,
  160. AccountInfoDialog,
  161. searchTable,
  162. popModal,
  163. addReturnGoodsDialog,
  164. orderDetailDialog,
  165. addAccountDialog,
  166. detailDialog,
  167. },
  168. provide() {
  169. return {
  170. invoiceType: () => '2'
  171. }
  172. },
  173. data() {
  174. return {
  175. activeComp: 'saleorder',
  176. addAccountDialogFlag: false,
  177. detailDialogFlag: false,
  178. processSubmitDialogFlag: false,
  179. addInvoiceDialogFlag: false,
  180. accountInfoDialogFlag: false,
  181. currentRow: {},
  182. selection: [], //单选中集合
  183. delVisible: false, //批量删除弹框状态
  184. loading: false, // 加载状态
  185. columns: [
  186. {
  187. width: 45,
  188. type: 'selection',
  189. columnKey: 'selection',
  190. align: 'center'
  191. },
  192. {
  193. columnKey: 'index',
  194. label: '序号',
  195. type: 'index',
  196. width: 55,
  197. align: 'center',
  198. showOverflowTooltip: true,
  199. fixed: 'left'
  200. },
  201. {
  202. prop: 'statementNo',
  203. label: '对账单编码',
  204. align: 'center',
  205. slot: 'statementNo',
  206. sortable: true,
  207. showOverflowTooltip: true,
  208. minWidth: 200
  209. },
  210. {
  211. prop: 'contactName',
  212. label: '供应商名称',
  213. align: 'center',
  214. showOverflowTooltip: true,
  215. minWidth: 180,
  216. },
  217. {
  218. prop: 'dateType',
  219. label: '对账方式',
  220. align: 'center',
  221. showOverflowTooltip: true,
  222. minWidth: 150,
  223. formatter: (_row, _column, cellValue) => {
  224. return cellValue==1?'按年度':cellValue==2?'按季度':cellValue==3?'按月度':'按时间段'
  225. }
  226. },
  227. {
  228. prop: 'startDate',
  229. label: '对账开始日期',
  230. align: 'center',
  231. slot: 'startDate',
  232. showOverflowTooltip: true,
  233. minWidth: 200
  234. },
  235. {
  236. prop: 'endDate',
  237. label: '对账结束日期',
  238. align: 'center',
  239. slot: 'endDate',
  240. showOverflowTooltip: true,
  241. minWidth: 200
  242. },
  243. {
  244. prop: 'amountTotalPrice',
  245. label: '总金额',
  246. align: 'center',
  247. showOverflowTooltip: true,
  248. minWidth: 130
  249. },
  250. {
  251. prop: 'amountReceivablePrice',
  252. label: '应收金额',
  253. align: 'center',
  254. showOverflowTooltip: true,
  255. minWidth: 130
  256. },
  257. {
  258. prop: 'amountPayablePrice',
  259. label: '应付金额',
  260. align: 'center',
  261. showOverflowTooltip: true,
  262. minWidth: 130
  263. },
  264. {
  265. prop: 'reviewStatus',
  266. label: '状态',
  267. align: 'center',
  268. showOverflowTooltip: true,
  269. minWidth: 200,
  270. formatter: (_row, _column, cellValue) => {
  271. return reviewStatusEnum[_row.reviewStatus].label;
  272. }
  273. },
  274. {
  275. prop: 'replied',
  276. label: '是否回执',
  277. align: 'center',
  278. slot: 'replied',
  279. showOverflowTooltip: true,
  280. minWidth: 200,
  281. formatter: (_row, _column, cellValue) => {
  282. return _row.replied ? '是' : '否';
  283. }
  284. },
  285. {
  286. prop: 'createTime',
  287. label: '创建时间',
  288. align: 'center',
  289. showOverflowTooltip: true,
  290. minWidth: 170
  291. },
  292. {
  293. columnKey: 'action',
  294. label: '操作',
  295. width: 230,
  296. align: 'center',
  297. resizable: false,
  298. slot: 'action',
  299. showOverflowTooltip: true,
  300. fixed: 'right',
  301. }
  302. ],
  303. cacheKeyUrl: 'eos-5c3f156d-purchaseOrder-accountstatement'
  304. };
  305. },
  306. computed: {},
  307. methods: {
  308. /* 表格数据源 */
  309. datasource({page, limit, where, order}) {
  310. return getAccountstatementList({
  311. pageNum: page,
  312. size: limit,
  313. type: 2,
  314. ...where
  315. });
  316. },
  317. /* 刷新表格 */
  318. reload(where) {
  319. this.$refs.table.reload({page: 1, where});
  320. },
  321. /*新增发票*/
  322. handleAddInvoice(row) {
  323. this.currentRow = row;
  324. this.accountInfoDialogFlag = true
  325. this.$nextTick(() => {
  326. this.$refs.accountInfoDialogRef.createInvoice(row, 'add', 'purchaseOrder')
  327. })
  328. },
  329. /*新增发票选择对账单信息回调*/
  330. getAccountInfo(row) {
  331. this.currentRow.children = row;
  332. setTimeout(() => {
  333. this.addInvoiceDialogFlag = true;
  334. this.$nextTick(() => {
  335. this.$refs.addInvoiceDialogRef.createInvoice({}, 1, this.currentRow)
  336. })
  337. }, 400)
  338. },
  339. //新增编辑
  340. handleAddOrEditAccount(type, row) {
  341. this.addAccountDialogFlag = true
  342. this.$nextTick(() => {
  343. this.$refs.accountDialogRef.open(type, row, '2')
  344. })
  345. },
  346. accountstatementSubmit(res) {
  347. this.processSubmitDialogFlag = true
  348. this.$nextTick(()=>{
  349. let params = {
  350. businessId: res.id,
  351. businessKey : 'purchase_account_statement_approve',
  352. formCreateUserId: res.createUserId,
  353. variables:{
  354. businessCode: res.statementNo,
  355. type: '2'
  356. },
  357. // callBackMethodType : '1',
  358. // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
  359. // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
  360. // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
  361. // miniHandle : '',
  362. // miniView : '',
  363. }
  364. this.$refs.processSubmitDialogRef.init(params)
  365. })
  366. // submitAccountStatementApproveAPI({
  367. // businessId: res.id,
  368. // type: '2'
  369. // }).then((res) => {
  370. // this.$message.success('提交成功!');
  371. // this.reload();
  372. // });
  373. },
  374. //导出
  375. async handleExport(row) {
  376. let data = await accountStatementExportAPI(row.id)
  377. saveAs(data.data, '应付对账单')
  378. },
  379. //批量删除
  380. allDelBtn() {
  381. if (this.selection.length === 0) return;
  382. let flag = this.selection.some(item => [1, 2].includes(item.reviewStatus))
  383. if (flag) return this.$message.warning('抱歉已审核、审核中的数据不能删除,请检查')
  384. this.delVisible = true;
  385. },
  386. //删除接口
  387. remove(delData) {
  388. deletetAccountstatement(delData).then((res) => {
  389. this.$message.success('删除成功!');
  390. this.reload();
  391. });
  392. },
  393. //删除弹框确定
  394. commitBtn() {
  395. const dataId = this.selection.map(v => v.id)
  396. this.remove(dataId)
  397. },
  398. //查看详情
  399. openorderDetail(row, type) {
  400. if (type === 'statementNo') {
  401. this.detailDialogFlag = true
  402. this.$nextTick(() => {
  403. this.$refs.detailDialogRef.open('view', row, '2')
  404. })
  405. }
  406. if (type === 'orderNo') {
  407. this.$refs.orderDetailDialogRef.open({id: row.orderId});
  408. }
  409. },
  410. }
  411. };
  412. </script>
  413. <style lang="scss" scoped>
  414. .ele-body {
  415. padding-top: 0;
  416. padding-bottom: 0;
  417. }
  418. :deep .el-card__body {
  419. padding: 0;
  420. }
  421. :deep(.el-link--inner) {
  422. margin-left: 0px !important;
  423. }
  424. .sys-organization-list {
  425. height: calc(100vh - 264px);
  426. box-sizing: border-box;
  427. border-width: 1px;
  428. border-style: solid;
  429. overflow: auto;
  430. }
  431. .sys-organization-list :deep(.el-tree-node__content) {
  432. height: 40px;
  433. & > .el-tree-node__expand-icon {
  434. margin-left: 10px;
  435. }
  436. }
  437. .switch_left ul .active {
  438. border-top: 4px solid var(--color-primary);
  439. color: var(--color-primary-5);
  440. }
  441. .switch {
  442. padding-bottom: 20px;
  443. }
  444. .el-dropdown-link {
  445. cursor: pointer;
  446. color: var(--color-primary-5);
  447. }
  448. .el-icon-arrow-down {
  449. font-size: 12px;
  450. }
  451. </style>