供应商分类等

master
yujialong 11 months ago
parent d12b749802
commit f9319ef4fb
  1. 11
      src/api/index.js
  2. 37
      src/layouts/navbar/index.vue
  3. 171
      src/pages/activity/add/index.vue
  4. 14
      src/pages/activity/list/index.vue
  5. 14
      src/pages/preschool/list/index.vue
  6. 14
      src/pages/supplier/list/index.vue
  7. 192
      src/pages/supplierClassification/list/index.vue
  8. 12
      src/pages/user/list/index.vue
  9. 23
      src/router/modules/supplierClassification.js

@ -43,4 +43,15 @@ export default {
transferAdmin: `nakadai/nakadai/partnerAccount/transferAdmin`, transferAdmin: `nakadai/nakadai/partnerAccount/transferAdmin`,
savePartnerAccount: `nakadai/nakadai/partnerAccount/savePartnerAccount`, savePartnerAccount: `nakadai/nakadai/partnerAccount/savePartnerAccount`,
platformTeamAccountList: `nakadai/kindergarten/platformTeamAccount/platformTeamAccountList`, platformTeamAccountList: `nakadai/kindergarten/platformTeamAccount/platformTeamAccountList`,
delSupplierClass: `nakadai/supplierClassification/batchDeletion`,
findSupplierClass: `nakadai/supplierClassification/findById`,
saveSupplierClass: `nakadai/supplierClassification/save`,
treeStructureList: `nakadai/supplierClassification/treeStructureList`,
updateSupplierClass: `nakadai/supplierClassification/update`,
delComClass: `competition/competitionClassification/batchDeletion`,
listComClass: `competition/competitionClassification/categoryList`,
saveComClass: `competition/competitionClassification/save`,
updateComClass: `competition/competitionClassification/update`,
} }

@ -24,9 +24,19 @@
alt=""> alt="">
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
</template> </template>
<el-menu-item v-for="(subItem, i) in item.subs" <template v-for="subItem in item.subs">
<el-submenu v-if="subItem.subs"
:index="subItem.index"
:key="subItem.index">
<template slot="title">{{ subItem.title }}</template>
<el-menu-item v-for="(threeItem,i) in subItem.subs"
:key="i" :key="i"
:index="subItem.index">{{ subItem.title }}</el-menu-item> :index="threeItem.index">{{ threeItem.title }}</el-menu-item>
</el-submenu>
<el-menu-item v-else
:index="subItem.index"
:key="subItem.index">{{ subItem.title }}</el-menu-item>
</template>
</el-submenu> </el-submenu>
</template> </template>
<template v-else> <template v-else>
@ -65,8 +75,18 @@ export default {
}, },
{ {
icon: 'supplier', icon: 'supplier',
index: '/supplier/list', index: 'supplier',
title: '供应商管理', title: '供应商管理',
subs: [
{
index: '/supplier/list',
title: '供应商列表'
},
{
index: '/supplierClassification/list',
title: '供应商分类'
},
]
}, },
{ {
icon: 'activity', icon: 'activity',
@ -81,15 +101,6 @@ export default {
'btns' 'btns'
]) ])
}, },
watch: {
"$route": {
handler (to, from) {
this.active = `/${this.$route.path.split('/')[1]}/list`
},
deep: true,
immediate: true
}
},
created () { created () {
this.initMenu() this.initMenu()
}, },
@ -157,7 +168,7 @@ export default {
} }
} }
.el-menu .el-menu-item { .el-menu .el-menu-item {
padding-left: 50px !important; padding-left: 63px !important;
} }
} }
.light { .light {

@ -29,6 +29,22 @@
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item prop="source"
label="活动分类">
<el-select v-model="classificationId"
clearable>
<template v-for="item in classifications">
<el-option v-if="item.id"
:key="item.id"
:label="item.classificationName"
:value="item.id">
</el-option>
</template>
</el-select>
<el-button class="set-btn"
type="primary"
@click="setClass">设置</el-button>
</el-form-item>
<el-form-item class="req" <el-form-item class="req"
label="活动名称"> label="活动名称">
<div class="d-inline-block"> <div class="d-inline-block">
@ -186,6 +202,57 @@
@click="preview">预览</el-button> @click="preview">预览</el-button>
<el-button @click="back">取消</el-button> <el-button @click="back">取消</el-button>
</div> </div>
<el-dialog title="所属分类设置"
:visible.sync="classVisible"
width="500px"
:close-on-click-modal="false"
class="manage-dia"
:before-close="closeClass">
<div class="plus">
<i class="el-icon-circle-plus-outline"
@click="addClass"></i>
</div>
<el-table :data="classifications"
ref="table"
header-align="center"
row-key="id">
<el-table-column type="index"
width="60"
label="序号"
align="center"></el-table-column>
<el-table-column prop="classificationName"
label="分类名称"
align="center"
min-width="130">
<template slot-scope="scope">
<el-input v-if="scope.row.edit"
placeholder="请输入分类名称"
v-model="scope.row.classificationName"
clearable
maxlength="30"></el-input>
<span v-else>{{ scope.row.classificationName }}</span>
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
min-width="60">
<template slot-scope="scope">
<i v-if="scope.row.edit"
class="el-icon-check edit"
@click="submitClass(scope.row)"></i>
<i v-else
class="el-icon-edit edit"
@click="editClass(scope.row)"></i>
<i class="el-icon-delete del"
@click="delClass(scope.row, scope.$index)"></i>
</template>
</el-table-column>
</el-table>
<span slot="footer">
<el-button @click="closeClass">返回</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -227,8 +294,11 @@ export default {
competitionRangeList: [], competitionRangeList: [],
competitionRegistration: {}, competitionRegistration: {},
createSource: 0, createSource: 0,
quantityLimit: '' quantityLimit: '',
classificationId: ''
}, },
classifications: [],
classVisible: false,
competitionScope: [], competitionScope: [],
scopes: [ scopes: [
{ {
@ -260,6 +330,17 @@ export default {
Editor, Editor,
Upload Upload
}, },
computed: {
classificationId: {
get () {
const data = this.classifications.find(item => item.id == this.form.classificationId)
return data ? data.id : ''
},
set (newVal) {
this.form.classificationId = newVal
}
},
},
watch: { watch: {
// , // ,
form: { form: {
@ -320,6 +401,7 @@ export default {
name: this.id ? this.name : '创建活动' name: this.id ? this.name : '创建活动'
}, },
]) ])
this.getClassification()
this.getData() this.getData()
}, },
methods: { methods: {
@ -353,6 +435,73 @@ export default {
}) })
}).catch(err => { }) }).catch(err => { })
}, },
//
async getClassification () {
const { page } = await this.$post(this.api.listComClass)
this.classifications = page
},
//
setClass () {
this.classVisible = true
},
//
addClass () {
this.classifications.push({
edit: true,
id: '',
classificationName: ''
})
},
//
editClass (row) {
this.$set(row, 'edit', 1)
},
//
delClass (row, i) {
if (row.id) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delComClass, [row.id]).then(res => {
Util.successMsg('删除成功')
this.getClassification()
}).catch(res => { })
}).catch(() => { })
} else {
this.classifications.splice(i, 1)
}
},
//
submitClass (row, showMsg = 1) {
if (!row.classificationName) return Util.errorMsg('请输入分类名称')
this.$post(this.api[row.id ? 'updateComClass' : 'saveComClass'], {
classificationName: row.classificationName,
id: row.id,
}).then(res => {
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getClassification()
}).catch(res => { })
},
//
closeClass () {
const list = this.classifications
if (list.find(e => e.edit && e.classificationName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
type: 'warning'
}).then(() => {
list.map(e => {
e.edit && e.classificationName && this.submitClass(e, 0)
})
this.classVisible = false
}).catch(() => {
this.classVisible = false
})
} else {
this.classVisible = false
}
},
handleExceed (files, fileList) { handleExceed (files, fileList) {
Util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); Util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
@ -614,6 +763,26 @@ $upload-lg-height: 150px;
} }
} }
.plus {
margin-bottom: 10px;
font-size: 18px;
color: #2962ff;
text-align: right;
cursor: pointer;
}
.set-btn {
margin-left: 10px !important;
}
.manage-dia {
.edit,
.del {
font-size: 14px;
cursor: pointer;
}
.edit {
margin-right: 10px;
}
}
.add-btn { .add-btn {
display: flex; display: flex;
justify-content: center; justify-content: center;

@ -25,13 +25,6 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
clearable></el-date-picker> clearable></el-date-picker>
</li> </li>
<li>
<el-input style="width: 200px"
placeholder="请输入活动名称/创建人"
suffix-icon="el-icon-search"
v-model="keyword"
clearable />
</li>
</ul> </ul>
</div> </div>
<div class="tool"> <div class="tool">
@ -59,6 +52,13 @@
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li>
<el-input style="width: 200px"
placeholder="请输入活动名称/创建人"
suffix-icon="el-icon-search"
v-model="keyword"
clearable />
</li>
</ul> </ul>
<div> <div>
<el-button type="primary" <el-button type="primary"

@ -26,6 +26,13 @@
:value="item.cityName"></el-option> :value="item.cityName"></el-option>
</el-select> </el-select>
</li> </li>
<li>
<el-input style="width: 300px"
placeholder="请输入园所名称、联系人、账号、手机号"
prefix-icon="el-icon-search"
v-model="form.keyWord"
clearable />
</li>
<!-- <li> <!-- <li>
<label>来源</label> <label>来源</label>
<el-select v-model="form.platformId" <el-select v-model="form.platformId"
@ -81,13 +88,6 @@
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li>
<el-input style="width: 300px"
placeholder="请输入园所名称、联系人、账号、手机号"
prefix-icon="el-icon-search"
v-model="form.keyWord"
clearable />
</li>
</ul> </ul>
</div> </div>

@ -26,6 +26,13 @@
:value="item.cityName"></el-option> :value="item.cityName"></el-option>
</el-select> </el-select>
</li> </li>
<li>
<el-input style="width: 300px"
placeholder="请输入供应商名称、联系人、账号、手机号"
prefix-icon="el-icon-search"
v-model="form.keyWord"
clearable />
</li>
<!-- <li> <!-- <li>
<label>来源</label> <label>来源</label>
<el-select v-model="form.platformId" <el-select v-model="form.platformId"
@ -81,13 +88,6 @@
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li>
<el-input style="width: 300px"
placeholder="请输入供应商名称、联系人、账号、手机号"
prefix-icon="el-icon-search"
v-model="form.keyWord"
clearable />
</li>
</ul> </ul>
</div> </div>

@ -0,0 +1,192 @@
<template>
<div class="page">
<div class="text-right m-b-20">
<el-button type="primary"
@click="handleColumn(false, 1)">添加分类
</el-button>
</div>
<div class="el-table">
<div class="list">
<div class="thead">
<span>分类名称</span>
<span>操作</span>
</div>
</div>
<el-tree :data="list"
node-key="id"
default-expand-all>
<span class="custom-tree-node"
slot-scope="{ node, data }">
<span class="name">{{ data.classificationName }}</span>
<span class="action">
<el-button type="text"
@click.stop="handleColumn(data)">编辑</el-button>
<el-divider direction="vertical"></el-divider>
<template v-if="node.level < 3">
<el-button type="text"
@click.stop="handleColumn(data, data.id)">新增</el-button>
<el-divider direction="vertical"></el-divider>
</template>
<el-button type="text"
@click.stop="delData(data)">删除</el-button>
</span>
</span>
</el-tree>
</div>
<el-dialog :title="!curRow.id ? '添加分类' : '编辑分类'"
:visible.sync="columnVisible"
width="400px"
:close-on-click-modal="false"
@close="closeColumn">
<el-form>
<el-form-item>
<el-input placeholder="分类名称"
v-model="curRow.classificationName"></el-input>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<el-button @click="columnVisible = false"> </el-button>
<el-button type="primary"
@click="columnSubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Util from "@/libs/util";
import Setting from '@/setting'
export default {
data () {
return {
list: [],
columnVisible: false,
curRow: {},
};
},
mounted () {
this.getData();
},
methods: {
async getData () {
const { list } = await this.$post(this.api.treeStructureList)
this.list = list
},
delData (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.delSupplierClass, [row.id]).then(res => {
Util.successMsg("删除成功");
this.getData();
}).catch(res => { });
}).catch(() => { });
},
handleColumn (row, parentId) {
this.columnVisible = true
if (row) {
this.curRow = JSON.parse(JSON.stringify(row))
}
if (typeof parentId === 'number') {
this.curRow = {
parentId,
classificationName: '',
}
}
},
columnSubmit () {
const row = this.curRow
if (!row.classificationName) return Util.warningMsg("请填写分类名称");
if (this.curRow.id) {
this.$post(this.api.updateSupplierClass, row).then(res => {
Util.successMsg("修改成功");
this.columnVisible = false;
this.getData();
}).catch(res => { });
} else {
this.$post(this.api.saveSupplierClass, row).then(res => {
Util.successMsg("添加成功");
this.columnVisible = false;
this.getData();
}).catch(res => { });
}
},
closeColumn () {
this.curRow = {}
},
}
};
</script>
<style lang="scss" scoped>
.list {
.thead {
display: flex;
align-items: center;
justify-content: space-between;
background: rgba(0, 0, 0, 0.04) !important;
span {
padding: 0.75rem 0.625rem;
text-align: center;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
font-weight: normal;
box-sizing: border-box;
&:first-child {
padding-left: 23.5vw;
@media (max-width: 1270px) {
padding-left: 25.5%;
}
}
&:last-child {
width: 16%;
}
}
}
}
/deep/ .el-tree {
.el-tree-node__expand-icon {
margin-left: 22.5vw;
@media (max-width: 1270px) {
margin-left: 23.5%;
}
}
.el-tree-node__content {
height: 35px;
padding: 5px;
border-bottom: 0.0625rem solid #ebeef5;
}
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
.name {
line-height: 44px;
}
.action {
width: 8.5vw;
text-align: left;
@media (max-width: 1270px) {
width: 16%;
}
}
}
.hide {
opacity: 0;
}
</style>

@ -26,6 +26,12 @@
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li>
<el-input placeholder="支持手机号,姓名"
prefix-icon="el-icon-search"
v-model="form.keyword"
clearable />
</li>
</ul> </ul>
</div> </div>
@ -55,12 +61,6 @@
clearable></el-date-picker> clearable></el-date-picker>
</el-radio-group> </el-radio-group>
</li> </li>
<li>
<el-input placeholder="支持手机号,姓名"
prefix-icon="el-icon-search"
v-model="form.keyword"
clearable />
</li>
</ul> </ul>
<div> <div>
<el-button @click="delAllSelection" <el-button @click="delAllSelection"

@ -0,0 +1,23 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'supplierClassification-'
export default {
path: '/supplierClassification',
name: 'supplierClassification',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/supplierClassification/list'),
meta: { title: '供应商分类' }
},
]
}
Loading…
Cancel
Save