index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title+'-列表', essential: true }]">
  3. <template slot-scope="{activeKey, data}">
  4. <template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
  5. :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing" :operationColumnWidth="80"
  6. :operation="operation()" :exportList="exportList">
  7. </template-page>
  8. </template>
  9. </zj-tab-page>
  10. </template>
  11. <script>
  12. import TemplatePage from '@/components/template/template-page-1.vue'
  13. import import_mixin from '@/components/template/import_mixin.js'
  14. import ImageUpload from '@/components/file-upload'
  15. import { downloadFiles } from '@/utils/util'
  16. import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
  17. import { listPageV2, pageExport, getDetail, listImport } from "@/api/salesPurchasing/inventoryIIIMachineAccount";
  18. import { commonTemplateDownload } from '@/api/common.js'
  19. import operation_mixin from '@/components/template/operation_mixin.js'
  20. export default {
  21. components: { TemplatePage, ImageUpload },
  22. mixins: [import_mixin, operation_mixin],
  23. data() {
  24. return {
  25. // 表格属性
  26. tableAttributes: {
  27. // 启用勾选列
  28. selectColumn: true
  29. },
  30. // 表格事件
  31. tableEvents: {
  32. 'selection-change': this.selectionChange
  33. },
  34. // 勾选选中行
  35. recordSelected: [],
  36. /** 表单变量 */
  37. formDialogType: 0,
  38. formDialogTitles: ["新增", "编辑", "详情"],
  39. formDialog: false,
  40. formData: {},
  41. formType: 'add',
  42. formVisible: false,
  43. }
  44. },
  45. computed: {
  46. // 事件组合
  47. optionsEvensGroup() {
  48. return []
  49. },
  50. // 更多参数
  51. moreParameters() {
  52. return []
  53. },
  54. formItems() {
  55. return []
  56. }
  57. },
  58. created(){
  59. },
  60. methods: {
  61. // 列表请求函数
  62. getList(p, cb) {
  63. try {
  64. var pam = JSON.parse(JSON.stringify(p))
  65. cb && cb(pam)
  66. return listPageV2(pam)
  67. } catch (error) {
  68. console.log(error)
  69. }
  70. },
  71. // 列表导出函数
  72. exportList: pageExport,
  73. // 表格列解析渲染数据更改
  74. columnParsing(item, defaultData) {
  75. return defaultData
  76. },
  77. // 监听勾选变化
  78. selectionChange(data) {
  79. this.recordSelected = data
  80. },
  81. operation() {
  82. return this.operationBtn({
  83. })
  84. },
  85. formCancel() {
  86. this.formVisible = false
  87. this.$refs?.formRef?.resetFields()
  88. this.$data.formData = this.$options.data().formData
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .tab {
  95. padding: 20px 20px 0 20px;
  96. }
  97. </style>