shish 1 éve
szülő
commit
4ce12ad574
1 módosított fájl, 12 hozzáadás és 2 törlés
  1. 12 2
      ghs/src/views/order/add.vue

+ 12 - 2
ghs/src/views/order/add.vue

@@ -32,6 +32,11 @@
 			</template>
 
 			<template #slot-column-option="{scope}">
+
+				<el-upload class="upload-demo" style="display: inline-block;margin-right:30px;" :action="`${fileUrl}?id=${scope.row.id}`" :headers="{ token: token }" multiple :show-file-list="false" :on-success="fileUpSuccess" accept=".xls,.xlsx" :limit="1">
+  					<el-button size="small" type="primary">批量导入</el-button>
+				</el-upload>
+
 				<el-button size="small" type="primary" @click="kd(scope.row,1)">开预订单</el-button>
 				<el-button size="small" type="primary" @click="kd(scope.row,0)" style="margin-left:30px;">开单</el-button>
 			</template>
@@ -77,7 +82,8 @@ export default {
 			drapShow: false,
 			confirmMobile1:'',
 			addPop:false,
-			name:''
+			name:'',
+			fileUrl:''
 		};
 	},
 	computed: {
@@ -85,6 +91,7 @@ export default {
 		...mapGetters(['token'])
 	},
 	created() {
+		this.fileUrl = baseUrl+'/upload/excel'
 		this.getLevel();
 	},
 	mounted() {
@@ -96,6 +103,9 @@ export default {
 	},
 	methods: {
 		...mapActions(['getLevel']),
+		fileUpSuccess(){
+			this.$notify({ title: '已提交,请稍等', message: 'success', type: 'success'})
+		},
 		changeText(){
 			this.app.refresh({ type: this.tabIndex,name:this.name })
 		},
@@ -197,7 +207,7 @@ export default {
 					op: {
 						visible: true,
 						props: {
-							width: 220,
+							width: 360,
 							align: 'center',
 							fixed: 'left',
 							label: '操作'