shish 1 سال پیش
والد
کامیت
fab409fc5e
1فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 9 2
      ghs/src/views/in/add.vue

+ 9 - 2
ghs/src/views/in/add.vue

@@ -26,6 +26,11 @@
 			</template>
 
 			<template #slot-column-option="{scope}">
+
+				<el-upload class="upload-demo" style="display: inline-block;margin-right:20px;" :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="goCg(scope.row)" style="margin-left:30px;">新增采购</el-button>
 			</template>
 
@@ -61,7 +66,8 @@ export default {
 			drapShow: false,
 			confirmMobile1:'',
 			addPop:false,
-			name:''
+			name:'',
+			fileUrl:''
 		};
 	},
 	computed: {
@@ -69,6 +75,7 @@ export default {
 		...mapGetters(['token'])
 	},
 	created() {
+		this.fileUrl = baseUrl+'/upload/import-cg'
 		this.getLevel();
 	},
 	mounted() {
@@ -150,7 +157,7 @@ export default {
 					op: {
 						visible: true,
 						props: {
-							width: 180,
+							width: 260,
 							align: 'center',
 							fixed: 'left',
 							label: '操作'