|
@@ -118,7 +118,7 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-button v-if="isAuth('wh:inventory:info')" type="text" size="small" @click="detailHandle(scope.row.inventoryId)">查看</el-button>
|
|
|
<el-button v-if="isAuth('wh:inventory:export') && Number(scope.row.state) === 0" type="text" size="small" @click="exportExcel(scope.row.inventoryId)">导出</el-button>
|
|
|
- <el-button v-if="isAuth('wh:inventory:import') && Number(scope.row.state) === 0" type="text" size="small" @click="importExcel()">导入</el-button>
|
|
|
+ <el-button v-if="isAuth('wh:inventory:import') && Number(scope.row.state) === 0" type="text" size="small" @click="importExcel(scope.row.inventoryId)">导入</el-button>
|
|
|
<!-- <el-button v-if="isAuth('wh:inventory:start') && Number(scope.row.state) === 0" type="text" size="small" @click="addOrUpdateHandle(scope.row.inventoryId, false)">盘点</el-button>-->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -180,7 +180,8 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
// 审批状态:0 待提交 1 待审批 2 审批中 3 审批完成 4 审批不通过
|
|
|
- optionsApproveState: []
|
|
|
+ optionsApproveState: [],
|
|
|
+ importInventoryId: 0
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
@@ -281,7 +282,8 @@ export default {
|
|
|
window.open(url + '?_token=' + Vue.cookie.get('token') + '&inventoryId=' + inventoryId, '_blank')
|
|
|
},
|
|
|
// 导入文件
|
|
|
- importExcel () {
|
|
|
+ importExcel (inventoryId) {
|
|
|
+ this.importInventoryId = inventoryId
|
|
|
this.$refs.fileRef.dispatchEvent(new MouseEvent('click'))
|
|
|
},
|
|
|
fileChange (e) {
|
|
@@ -289,7 +291,7 @@ export default {
|
|
|
const formData = new FormData()
|
|
|
formData.append('importFile', file)
|
|
|
this.$http({
|
|
|
- url: this.$http.adornUrl('/biz-service/inventory-checking-ctl/importExcel'),
|
|
|
+ url: this.$http.adornUrl(`/biz-service/inventory-checking-ctl/importExcel/${this.importInventoryId}`),
|
|
|
method: 'post',
|
|
|
data: formData
|
|
|
}).then(({data}) => {
|