Browse Source

增加导入

pengyh 1 year ago
parent
commit
cc8edcf152

+ 4 - 0
src/api/auxiliaryFittings/auxiliarySalesOrder.js

@@ -18,6 +18,10 @@ export function pageExport(data, name) {
   })
 }
 
+export function listImport(data) {
+	return handleImport('/websit/sales/list/import', data.formdata, data.id || '')
+}
+
 // 新增
 export function add(data) {
   return request({

+ 26 - 2
src/views/auxiliaryFittings/salesManagement/attachmentSalesOrder/index.vue

@@ -30,11 +30,12 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+import { listPageV2, pageExport, getDetail, add, edit, submit, listImport } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
 import { getWebsit } from "@/api/customerManagement";
 import printPreview from '../components/preview.vue'
 import { disAutoConnect, hiprint } from 'vue-plugin-hiprint'
 import operation_mixin from '@/components/template/operation_mixin.js'
+import { commonTemplateDownload } from '@/api/common.js'
 disAutoConnect()
 export default {
 	components: { TemplatePage, ImageUpload, attachmentSalesOrderDetail, printPreview },
@@ -74,6 +75,22 @@ export default {
 							click: this.addData
 						}),
 					]
+				],
+				[
+					[
+						this.optionsEvensAuth("imp", {
+							render: () => {
+							  return this.importButton(listImport, '导入')
+							}
+						})
+					],
+					[
+						this.optionsEvensAuth("template", {
+							click: () => {
+								this.handleDownload()
+							}
+						})
+					]
 				]
 			]
 		},
@@ -381,7 +398,14 @@ export default {
 		},
 		// 下载导入模版
 		handleDownload() {
-			// downloadFiles('charging/standard/download');
+			commonTemplateDownload({ name: '师傅分销员资料初始化.xlsx' }, `${this.$route.meta.title}`).then(res => {
+			    this.$message({
+			        message: '下载成功',
+			        type: 'success'
+			    })
+			}).catch(err => {
+			    this.$message.error('下载失败')
+			})
 		},
 	}
 }

+ 26 - 2
src/views/auxiliaryFittings/salesManagement/auxiliarySalesOrder/index.vue

@@ -30,11 +30,12 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, getDetail, add, edit, submit } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+import { listPageV2, pageExport, getDetail, add, edit, submit, listImport } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
 import { getWebsit } from "@/api/customerManagement";
 import printPreview from '../components/preview.vue'
 import { disAutoConnect, hiprint } from 'vue-plugin-hiprint'
 import operation_mixin from '@/components/template/operation_mixin.js'
+import { commonTemplateDownload } from '@/api/common.js'
 disAutoConnect()
 export default {
 	components: { TemplatePage, ImageUpload, auxiliarySalesOrderDetail, printPreview },
@@ -74,6 +75,22 @@ export default {
 							click: this.addData
 						}),
 					]
+				],
+				[
+					[
+						this.optionsEvensAuth("imp", {
+							render: () => {
+							  return this.importButton(listImport, '导入')
+							}
+						})
+					],
+					[
+						this.optionsEvensAuth("template", {
+							click: () => {
+								this.handleDownload()
+							}
+						})
+					]
 				]
 			]
 		},
@@ -378,7 +395,14 @@ export default {
 		},
 		// 下载导入模版
 		handleDownload() {
-			// downloadFiles('charging/standard/download');
+			commonTemplateDownload({ name: '师傅分销员资料初始化.xlsx' }, `${this.$route.meta.title}`).then(res => {
+			    this.$message({
+			        message: '下载成功',
+			        type: 'success'
+			    })
+			}).catch(err => {
+			    this.$message.error('下载失败')
+			})
 		},
 	}
 }