|
@@ -111,7 +111,7 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-button v-if="isAuth('wh:inbound-record-ctl:info')" type="text" size="small" @click="inBound(scope.row.id, true)">查看</el-button>
|
|
|
<el-button type="text" size="small" @click="exportItem(scope.row.id)">导出</el-button>
|
|
|
- <el-button type="text" size="small" @click="cancelItem(scope.row.id)">撤回</el-button>
|
|
|
+ <el-button type="text" size="small" @click="cancelItem(scope.row)">撤回</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -134,6 +134,8 @@
|
|
|
import UserComponent from '../common/user-component'
|
|
|
import StockOrderInbound from './stock-order-inbound'
|
|
|
import StockOrderOutbound from './stock-order-outbound'
|
|
|
+ import { revokeInOutBound } from '@/api/warehouse'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'stock-order',
|
|
|
components: {StockOrderInbound, UserComponent, StockOrderOutbound},
|
|
@@ -258,9 +260,35 @@
|
|
|
},
|
|
|
// 转换属性“状态”
|
|
|
formatState (row) {
|
|
|
- if (!row.purchaseState) return ''
|
|
|
- const item1 = this.optionsState.find((item) => item.code === row.purchaseState.toString())
|
|
|
+ if (!row.state) return ''
|
|
|
+ const item1 = this.optionsState.find((item) => item.code === row.state.toString())
|
|
|
return item1 ? item1.value : ''
|
|
|
+ },
|
|
|
+ // 导出
|
|
|
+ exportItem (id) {
|
|
|
+ // todo
|
|
|
+ this.$message.warning('功能暂未开放')
|
|
|
+ },
|
|
|
+ // 撤回
|
|
|
+ async cancelItem (row) {
|
|
|
+ if (row.state === '0') {
|
|
|
+ this.$message.warning('不允许撤回,请先提交!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ await revokeInOutBound({'id': row.id}).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|