|
@@ -12,7 +12,7 @@
|
|
|
</module-view>
|
|
|
</div>
|
|
|
<!-- 新增/编辑弹窗 -->
|
|
|
- <el-dialog :title="popTitle+'品牌'" :visible.sync="dialogFormVisible" width="30%">
|
|
|
+ <el-dialog :title="popTitle+'机构商品分类'" :visible.sync="dialogFormVisible" width="30%">
|
|
|
<by-form :propConfig="addConfig" ref="addFormId">
|
|
|
<template v-slot:logo>
|
|
|
<el-upload :limit='1' :action="baseURL+'/file/upload'" list-type="picture-card"
|
|
@@ -21,8 +21,8 @@
|
|
|
</el-upload>
|
|
|
</template>
|
|
|
<template v-slot:status class="clearfix">
|
|
|
- <el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">启用</el-radio>
|
|
|
- <el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="0">禁用</el-radio>
|
|
|
+ <el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="0">正常</el-radio>
|
|
|
+ <el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="1">禁用</el-radio>
|
|
|
</template>
|
|
|
</by-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -35,8 +35,9 @@
|
|
|
<script lang="ts">
|
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
|
import api from "@/api/currency";
|
|
|
+ import Assembly from "@/benyun/components/Assembly/material.vue";
|
|
|
@Component
|
|
|
- export default class Virtually extends Vue {
|
|
|
+ export default class AgencyGoods extends Vue {
|
|
|
// 左边
|
|
|
data : any = []
|
|
|
props = {
|
|
@@ -48,7 +49,7 @@
|
|
|
timeNum = 0;
|
|
|
timer : any = null
|
|
|
popTitle : any = ''
|
|
|
- radio : any = 1
|
|
|
+ radio : any = 0
|
|
|
dialogFormVisible : boolean = false
|
|
|
config : any = {
|
|
|
search: {
|
|
@@ -93,28 +94,15 @@
|
|
|
placeholder: '请选择数据',
|
|
|
clearable: true,
|
|
|
data: [{
|
|
|
+ value: 1,
|
|
|
+ label: '正常'
|
|
|
+ }, {
|
|
|
value: 0,
|
|
|
label: '禁用'
|
|
|
- }, {
|
|
|
- value: 1,
|
|
|
- label: '启用'
|
|
|
}]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- span: 6,
|
|
|
- label: '备注',
|
|
|
- prop: 'remark',
|
|
|
- component: 'by-input',
|
|
|
- labelWidth: '70px',
|
|
|
- compConfig: {
|
|
|
- attr: {
|
|
|
- placeholder: '请输入备注',
|
|
|
- clearable: true
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
]
|
|
|
]
|
|
|
},
|
|
@@ -136,17 +124,18 @@
|
|
|
height: 600
|
|
|
},
|
|
|
columns: [{
|
|
|
+ width: 300,
|
|
|
title: '名称',
|
|
|
field: 'name',
|
|
|
isDetail: true,
|
|
|
- width: 150,
|
|
|
}, {
|
|
|
title: '简称',
|
|
|
field: 'shortName'
|
|
|
}, {
|
|
|
+ width: 80,
|
|
|
title: '状态',
|
|
|
field: 'status',
|
|
|
- prop: 'status',
|
|
|
+ component: Assembly,
|
|
|
},
|
|
|
{
|
|
|
title: '备注',
|
|
@@ -184,26 +173,26 @@
|
|
|
columns: [
|
|
|
[
|
|
|
{
|
|
|
- span: 20,
|
|
|
+ span: 24,
|
|
|
label: '名称',
|
|
|
prop: 'name',
|
|
|
component: 'by-input',
|
|
|
},
|
|
|
{
|
|
|
- span: 20,
|
|
|
+ span: 24,
|
|
|
label: '简称',
|
|
|
slot: true,
|
|
|
prop: 'shortName',
|
|
|
component: 'by-input',
|
|
|
},
|
|
|
{
|
|
|
- span: 20,
|
|
|
+ span: 24,
|
|
|
label: '显示状态',
|
|
|
slot: true,
|
|
|
prop: 'status',
|
|
|
},
|
|
|
{
|
|
|
- span: 20,
|
|
|
+ span: 24,
|
|
|
label: '备注',
|
|
|
slot: true,
|
|
|
prop: 'remark',
|
|
@@ -221,9 +210,8 @@
|
|
|
// 获取树型导航数据
|
|
|
getTreeList() {
|
|
|
api.treeList('maindataMaterialOrganizationCategory').then((res : any) => {
|
|
|
- // console.log(res.data[0]);
|
|
|
if (res.code === 200) {
|
|
|
- this.data = res.data[0].children;
|
|
|
+ this.data = res.data;
|
|
|
} else this.failHandle(res)
|
|
|
})
|
|
|
}
|
|
@@ -291,6 +279,7 @@
|
|
|
onAdd() {
|
|
|
this.popTitle = '新增'
|
|
|
this.dialogFormVisible = true;
|
|
|
+ this.radio = 0
|
|
|
setTimeout(() => {
|
|
|
if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue({});
|
|
|
}, 0)
|
|
@@ -299,6 +288,7 @@
|
|
|
openEdit(e : any) {
|
|
|
this.popTitle = '编辑'
|
|
|
this.dialogFormVisible = true;
|
|
|
+ this.radio = e.status
|
|
|
setTimeout(() => {
|
|
|
if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
|
|
|
}, 0)
|
|
@@ -313,48 +303,65 @@
|
|
|
})
|
|
|
} else return this.$message({ type: 'warning', message: '请选择删除数据' })
|
|
|
ids = ids.slice(0, ids.length - 1);
|
|
|
- api.deleteList({ ids: ids }, 'maindataMaterialOrganizationCategory').then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.getDataList();
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
- });
|
|
|
- } else this.failHandle(res)
|
|
|
- })
|
|
|
+ this.$confirm('确定删除吗,此操作不能撤销!', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
+ }).then(() => {
|
|
|
+ api.deleteList({ ids: ids }, 'maindataMaterialOrganizationCategory').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.getDataList();
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ });
|
|
|
+ } else this.failHandle(res)
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
// 操作删除
|
|
|
doDelete2(item : any) {
|
|
|
- api.deleteList({ ids: item.id }, 'maindataMaterialOrganizationCategory').then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.getDataList();
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
- });
|
|
|
- } else this.failHandle(res)
|
|
|
- })
|
|
|
- }
|
|
|
- handleRemove(file : any, fileList : any) {
|
|
|
- console.log(file, fileList);
|
|
|
- }
|
|
|
- handlePictureCardPreview(file : any) {
|
|
|
- console.log(file);
|
|
|
+ this.$confirm('确定删除吗,此操作不能撤销!', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
+ }).then(() => {
|
|
|
+ api.deleteList({ ids: item.id }, 'maindataMaterialOrganizationCategory').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.getDataList();
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ });
|
|
|
+ } else this.failHandle(res)
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
// 导航切换
|
|
|
handleNodeClick(e : any) {
|
|
|
- console.log('导航id ==> ',e.id);
|
|
|
- // api.single({ categoryId: e.id }).then((res : any) => {
|
|
|
- // if (res.code === 200) {
|
|
|
- // (this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
|
- // let page = {
|
|
|
- // pageNo: res.data.current, //当前页
|
|
|
- // pageSize: res.data.size, //每页条数
|
|
|
- // total: res.data.total //总条数
|
|
|
- // };
|
|
|
- // (this.$refs.moduleView as any).setPage(page)
|
|
|
- // }
|
|
|
- // })
|
|
|
+ api.childrenTreeList({ id: e.id }, 'maindataMaterialOrganizationCategory').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ (this.$refs.moduleView as any).setTableValue(res.data);
|
|
|
+ let page = {
|
|
|
+ pageNo: res.data.current, //当前页
|
|
|
+ pageSize: res.data.size, //每页条数
|
|
|
+ total: res.data.total //总条数
|
|
|
+ };
|
|
|
+ (this.$refs.moduleView as any).setPage(page)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
//导出
|
|
|
onExport() {
|