|
@@ -120,6 +120,8 @@
|
|
|
<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(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>-->
|
|
|
+ <el-button v-if="isAuth('wh:inventory:info') && Number(scope.row.state) === 1" type="text" size="small" @click="revokeHandle(scope.row.inventoryId)">撤回</el-button>
|
|
|
+ <el-button v-if="isAuth('wh:inventory:info') && Number(scope.row.state) === 0" type="text" size="small" @click="deleteHandle(scope.row.inventoryId)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -148,7 +150,7 @@
|
|
|
import inventoryAdd from './inventory-add'
|
|
|
import inventoryBegin from './inventory-begin'
|
|
|
import Detail from './inventory-detail'
|
|
|
- import {getInventoryList} from '@/api/warehouse'
|
|
|
+ import {getInventoryList, revokeInventory, delInventory} from '@/api/warehouse'
|
|
|
import PreviewComponent from '@/views/modules/common/preview-component'
|
|
|
import Vue from 'vue'
|
|
|
|
|
@@ -286,6 +288,60 @@ export default {
|
|
|
this.importInventoryId = inventoryId
|
|
|
this.$refs.fileRef.dispatchEvent(new MouseEvent('click'))
|
|
|
},
|
|
|
+ revokeHandle (inventoryId) {
|
|
|
+ this.$confirm('是否确认要撤回?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ revokeInventory({inventoryId}).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '撤回成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.queryData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消撤回'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deleteHandle (inventoryId) {
|
|
|
+ this.$confirm('是否确认要删除?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ delInventory({inventoryIds: [inventoryId]}).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '删除成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.queryData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
fileChange (e) {
|
|
|
const file = e.target.files[0]
|
|
|
const formData = new FormData()
|