accountstatementList.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. <!-- 数据表格 -->
  6. <ele-pro-table
  7. ref="table"
  8. :columns="columns"
  9. :datasource="datasource"
  10. height="calc(100vh - 385px)"
  11. full-height="calc(100vh - 116px)"
  12. tool-class="ele-toolbar-form"
  13. :selection.sync="selection"
  14. cache-key="eomContactPageTable"
  15. >
  16. <!-- 查看详情列 -->
  17. <template v-slot:statementNo="{ row }">
  18. <el-link
  19. type="primary"
  20. :underline="false"
  21. @click="openorderDetail(row, 'statementNo')"
  22. >
  23. {{ row.statementNo }}</el-link
  24. >
  25. </template>
  26. <template v-slot:orderNo="{ row }">
  27. <el-link
  28. type="primary"
  29. :underline="false"
  30. @click="openorderDetail(row, 'orderNo')"
  31. >
  32. {{ row.orderNo }}</el-link
  33. >
  34. </template>
  35. </ele-pro-table>
  36. </div>
  37. </el-card>
  38. <detail-dialog ref="DetailDialogRef"></detail-dialog>
  39. </div>
  40. </template>
  41. <script>
  42. import detailDialog from '@/views/purchasingManage/purchaseOrder/accountstatement/components/detailDialog.vue';
  43. import { reviewStatus } from '@/enum/dict';
  44. import { getAccountstatementList } from '@/api/saleManage/accountstatement';
  45. import dictMixins from '@/mixins/dictMixins';
  46. export default {
  47. mixins: [dictMixins],
  48. components: {
  49. detailDialog
  50. },
  51. props: {
  52. orderId: String
  53. },
  54. data() {
  55. return {
  56. activeComp: 'saleorder',
  57. selection: [], //单选中集合
  58. delVisible: false, //批量删除弹框状态
  59. loading: false, // 加载状态
  60. columns: [
  61. {
  62. width: 45,
  63. type: 'selection',
  64. columnKey: 'selection',
  65. align: 'center'
  66. },
  67. {
  68. columnKey: 'index',
  69. label: '序号',
  70. type: 'index',
  71. width: 55,
  72. align: 'center',
  73. showOverflowTooltip: true,
  74. fixed: 'left'
  75. },
  76. {
  77. prop: 'statementNo',
  78. label: '对账单编码',
  79. align: 'center',
  80. slot: 'statementNo',
  81. showOverflowTooltip: true,
  82. minWidth: 200
  83. },
  84. {
  85. prop: 'contactName',
  86. label: '供应商名称',
  87. align: 'center',
  88. showOverflowTooltip: true,
  89. minWidth: 180
  90. },
  91. {
  92. prop: 'projectName',
  93. label: '项目名称',
  94. align: 'center',
  95. showOverflowTooltip: true,
  96. minWidth: 200
  97. },
  98. {
  99. prop: 'accountPeriod',
  100. label: '账期',
  101. align: 'center',
  102. slot: 'accountPeriod',
  103. showOverflowTooltip: true,
  104. minWidth: 200
  105. },
  106. {
  107. prop: 'orderNum',
  108. label: '订单量',
  109. align: 'center',
  110. showOverflowTooltip: true,
  111. minWidth: 200
  112. },
  113. {
  114. prop: 'productNum',
  115. label: '产品总数量',
  116. align: 'center',
  117. showOverflowTooltip: true,
  118. minWidth: 200
  119. },
  120. {
  121. prop: 'totalPrice',
  122. label: '产品总金额',
  123. align: 'center',
  124. showOverflowTooltip: true,
  125. minWidth: 200
  126. },
  127. {
  128. prop: 'reviewStatus',
  129. label: '状态',
  130. align: 'center',
  131. showOverflowTooltip: true,
  132. minWidth: 200,
  133. formatter: (_row, _column, cellValue) => {
  134. return reviewStatus[_row.reviewStatus];
  135. }
  136. },
  137. {
  138. prop: 'createTime',
  139. label: '创建时间',
  140. align: 'center',
  141. showOverflowTooltip: true,
  142. minWidth: 170
  143. },
  144. ]
  145. };
  146. },
  147. computed: {},
  148. methods: {
  149. /* 表格数据源 */
  150. datasource({ page, limit, where, order }) {
  151. return getAccountstatementList({
  152. pageNum: page,
  153. size: limit,
  154. orderId: this.orderId,
  155. type:2,
  156. ...where
  157. });
  158. },
  159. /* 刷新表格 */
  160. reload(where) {
  161. this.$refs.table.reload({ page: 1, where });
  162. },
  163. //新增编辑
  164. openEdit(type, row) {
  165. this.$refs.accountDialogRef.open(type, row);
  166. this.$refs.accountDialogRef.$refs.form &&
  167. this.$refs.accountDialogRef.$refs.form.clearValidate();
  168. },
  169. //批量删除
  170. allDelBtn() {
  171. if (this.selection.length === 0) return;
  172. this.delVisible = true;
  173. },
  174. //删除接口
  175. remove(delData) {
  176. deletetAccountstatement(delData).then((res) => {
  177. this.$message.success('删除成功!');
  178. this.reload();
  179. });
  180. },
  181. //删除弹框确定
  182. commitBtn() {
  183. const dataId = this.selection.map((v) => v.id);
  184. this.remove(dataId);
  185. },
  186. //查看详情
  187. openorderDetail(row, type) {
  188. if (type === 'statementNo') {
  189. this.$refs.DetailDialogRef.open(row);
  190. }
  191. if (type === 'orderNo') {
  192. this.$refs.orderDetailDialogRef.open({ id: row.orderId });
  193. }
  194. }
  195. }
  196. };
  197. </script>
  198. <style lang="scss" scoped>
  199. .ele-body {
  200. padding-top: 0;
  201. padding-bottom: 0;
  202. }
  203. :deep .el-card__body {
  204. padding: 0;
  205. }
  206. :deep(.el-link--inner) {
  207. margin-left: 0px !important;
  208. }
  209. .sys-organization-list {
  210. height: calc(100vh - 264px);
  211. box-sizing: border-box;
  212. border-width: 1px;
  213. border-style: solid;
  214. overflow: auto;
  215. }
  216. .sys-organization-list :deep(.el-tree-node__content) {
  217. height: 40px;
  218. & > .el-tree-node__expand-icon {
  219. margin-left: 10px;
  220. }
  221. }
  222. .switch_left ul .active {
  223. border-top: 4px solid var(--color-primary);
  224. color: var(--color-primary-5);
  225. }
  226. .switch {
  227. padding-bottom: 20px;
  228. }
  229. .el-dropdown-link {
  230. cursor: pointer;
  231. color: var(--color-primary-5);
  232. }
  233. .el-icon-arrow-down {
  234. font-size: 12px;
  235. }
  236. </style>