|
@@ -1,11 +1,11 @@
|
|
|
<!-- 出入库管理 -->
|
|
|
<template>
|
|
|
<div class="stock-order">
|
|
|
- <template v-if="!updateVisible">
|
|
|
+ <template v-if="!updateVisible && !moveVisible">
|
|
|
<el-form :inline="true">
|
|
|
<el-form-item>
|
|
|
<el-button
|
|
|
- v-if="isAuth('wh:stock-mg-ctl:material-save')"
|
|
|
+ v-if="isAuth('wh:wh-category:save')"
|
|
|
type="primary"
|
|
|
@click="addHandle()"
|
|
|
>新增</el-button
|
|
@@ -31,7 +31,6 @@
|
|
|
prop="name"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- min-width="160"
|
|
|
:show-tooltip-when-overflow="true"
|
|
|
label="仓库类别名称"
|
|
|
>
|
|
@@ -40,7 +39,6 @@
|
|
|
prop="notes"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- width="100"
|
|
|
label="备注"
|
|
|
>
|
|
|
</el-table-column>
|
|
@@ -48,7 +46,6 @@
|
|
|
prop="parentName"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- width="100"
|
|
|
label="上级类别"
|
|
|
>
|
|
|
</el-table-column>
|
|
@@ -61,14 +58,21 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
- v-if="isAuth('wh:in:editor')"
|
|
|
+ v-if="isAuth('wh:wh-category:update')"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
@click="updateHandle(scope.row.id)"
|
|
|
>编辑</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
- v-if="isAuth('wh:in:editor')"
|
|
|
+ v-if="isAuth('wh:wh-category:move')"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="moveHandle(scope.row.id)"
|
|
|
+ >迁移</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="isAuth('wh:wh-category:delete')"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
@click="deleteHandle(scope.row.id)"
|
|
@@ -94,15 +98,22 @@
|
|
|
@onChose="onChose"
|
|
|
@refreshDataList="getDataList"
|
|
|
></category-add-or-update>
|
|
|
+ <category-move
|
|
|
+ v-if="moveVisible"
|
|
|
+ ref="move"
|
|
|
+ @onChose="onChose"
|
|
|
+ @refreshDataList="getDataList">
|
|
|
+ </category-move>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import CategoryAddOrUpdate from "./category-add-or-update";
|
|
|
+import CategoryMove from "./category-move";
|
|
|
|
|
|
export default {
|
|
|
name: "category",
|
|
|
- components: { CategoryAddOrUpdate },
|
|
|
+ components: { CategoryAddOrUpdate,CategoryMove },
|
|
|
created() {
|
|
|
this.queryData();
|
|
|
},
|
|
@@ -114,11 +125,13 @@ export default {
|
|
|
totalPage: 0,
|
|
|
dataListLoading: false,
|
|
|
updateVisible: false,
|
|
|
+ moveVisible: false
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
onChose() {
|
|
|
this.updateVisible = false;
|
|
|
+ this.moveVisible = false
|
|
|
},
|
|
|
queryData() {
|
|
|
this.pageIndex = 1;
|
|
@@ -169,6 +182,38 @@ export default {
|
|
|
this.$refs.update.init(id);
|
|
|
});
|
|
|
},
|
|
|
+ moveHandle(id) {
|
|
|
+ this.moveVisible = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.move.init(id);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deleteHandle(id){
|
|
|
+ this.$confirm(`确定进行删除操作?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(`/biz-service/wh-category/delete`),
|
|
|
+ method: 'DELETE',
|
|
|
+ data: [id]
|
|
|
+ }).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|