deal.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div id="deal">
  3. <data-table :fields="fields" :opera="opera" :operaWidth="150" :data="list" :total="total" @query="search"></data-table>
  4. </div>
  5. </template>
  6. <script>
  7. import dataTable from '@common/src/components/frame/filter-page-table.vue';
  8. import { mapState, createNamespacedHelpers } from 'vuex';
  9. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  10. export default {
  11. name: 'deal',
  12. props: {},
  13. components: { dataTable },
  14. data: function() {
  15. return {
  16. opera: [],
  17. fields: [
  18. { label: '商品名称', prop: 'product' },
  19. { label: '购买人名称', prop: 'd_name' },
  20. { label: '营销人名称', prop: 's_name' },
  21. {
  22. label: '状态',
  23. prop: 'status',
  24. format: i => {
  25. let word = '正在洽谈';
  26. if (i == '1') word = '达成意向';
  27. else if (i == '2') word = '待确定';
  28. else if (i == '3') word = '交易完成';
  29. else if (i == '4') word = '交易失败';
  30. return word;
  31. },
  32. },
  33. ],
  34. list: [],
  35. total: 0,
  36. };
  37. },
  38. created() {
  39. this.search();
  40. },
  41. methods: {
  42. ...transaction(['query']),
  43. async search({ skip = 0, limit = 10, ...info } = {}) {
  44. const res = await this.query({ skip, limit, dock_id: this.user.id, status: '2' });
  45. if (this.$checkRes(res)) {
  46. this.$set(this, `list`, res.data);
  47. this.$set(this, `total`, res.total);
  48. }
  49. },
  50. },
  51. computed: {
  52. ...mapState(['user', 'menuParams']),
  53. pageTitle() {
  54. return `${this.$route.meta.title}`;
  55. },
  56. },
  57. metaInfo() {
  58. return { title: this.$route.meta.title };
  59. },
  60. };
  61. </script>
  62. <style lang="less" scoped></style>