|
@@ -10,17 +10,32 @@ import TemplatePage from '@/components/template/template-page-1.vue'
|
|
|
import import_mixin from '@/components/template/import_mixin.js'
|
|
|
import { workerStockListP, workerStockListPExport, workerStockImportP, } from "@/api/inventoryManagement";
|
|
|
import { commonTemplateDownload } from '@/api/common.js'
|
|
|
+import operation_mixin from '@/components/template/operation_mixin.js'
|
|
|
export default {
|
|
|
components: { TemplatePage },
|
|
|
- mixins: [import_mixin],
|
|
|
+ mixins: [import_mixin, operation_mixin],
|
|
|
data() {
|
|
|
return {
|
|
|
- // 事件组合
|
|
|
- optionsEvensGroup: [
|
|
|
+ // 表格属性
|
|
|
+ tableAttributes: {
|
|
|
+ // 启用勾选列
|
|
|
+ selectColumn: false
|
|
|
+ },
|
|
|
+ // 表格事件
|
|
|
+ tableEvents: {
|
|
|
+ 'selection-change': this.selectionChange
|
|
|
+ },
|
|
|
+ // 勾选选中行
|
|
|
+ recordSelected: [],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 事件组合
|
|
|
+ optionsEvensGroup() {
|
|
|
+ return [
|
|
|
[
|
|
|
[
|
|
|
- {
|
|
|
- name: '配件师傅库存模板',
|
|
|
+ this.optionsEvensAuth("template", {
|
|
|
click: () => {
|
|
|
commonTemplateDownload({ name: '配件师傅库存.xlsx' }, `${this.$route.meta.title}`)
|
|
|
.then(res => {
|
|
@@ -33,32 +48,21 @@ export default {
|
|
|
this.$message.error('下载失败')
|
|
|
})
|
|
|
}
|
|
|
- }
|
|
|
+ }),
|
|
|
],
|
|
|
[
|
|
|
- {
|
|
|
- name: '导入模板',
|
|
|
- render: () => {
|
|
|
- return this.importButton(workerStockImportP, '导入模板')
|
|
|
+ this.optionsEvensAuth("imp", ({ moduleName }) => {
|
|
|
+ return {
|
|
|
+ name: moduleName,
|
|
|
+ render: () => {
|
|
|
+ return this.importButton(workerStockImportP, moduleName)
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ }),
|
|
|
],
|
|
|
- ],
|
|
|
- ],
|
|
|
- // 表格属性
|
|
|
- tableAttributes: {
|
|
|
- // 启用勾选列
|
|
|
- selectColumn: false
|
|
|
- },
|
|
|
- // 表格事件
|
|
|
- tableEvents: {
|
|
|
- 'selection-change': this.selectionChange
|
|
|
- },
|
|
|
- // 勾选选中行
|
|
|
- recordSelected: [],
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ },
|
|
|
// 更多参数
|
|
|
moreParameters() {
|
|
|
return []
|
|
@@ -77,12 +81,6 @@ export default {
|
|
|
selectionChange(data) {
|
|
|
this.recordSelected = data
|
|
|
},
|
|
|
- // 表格操作列
|
|
|
- operation(h, { row, index, column }) {
|
|
|
- return (
|
|
|
- <div class='operation-btns'></div>
|
|
|
- )
|
|
|
- },
|
|
|
}
|
|
|
}
|
|
|
</script>
|