feat: 门店档案接口
This commit is contained in:
@@ -247,7 +247,6 @@ export default {
|
|||||||
|
|
||||||
getCheckedTree() {
|
getCheckedTree() {
|
||||||
const nodes = this.$refs.treeRef.getCheckedNodes()
|
const nodes = this.$refs.treeRef.getCheckedNodes()
|
||||||
console.log(nodes)
|
|
||||||
if (!nodes.length) {
|
if (!nodes.length) {
|
||||||
return this.$message.error('请选择网格')
|
return this.$message.error('请选择网格')
|
||||||
}
|
}
|
||||||
@@ -282,14 +281,14 @@ export default {
|
|||||||
|
|
||||||
async addOrUpdate() {
|
async addOrUpdate() {
|
||||||
try {
|
try {
|
||||||
const {code, data} = await this.instance.post(`/app/appshoparchives/addOrUpdate`,{
|
const {code} = await this.instance.post(`/app/appshoparchives/addOrUpdate`,{
|
||||||
...this.form,
|
...this.form,
|
||||||
fileId:this.form.fileUrl[0]?.id,
|
fileId:this.form.fileUrl[0]?.id,
|
||||||
fileUrl:this.form.fileUrl[0]?.path,
|
fileUrl:this.form.fileUrl[0]?.path,
|
||||||
})
|
})
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
this.$message.success('保存成功');
|
this.$message.success('保存成功');
|
||||||
this.form = {...data}
|
this.cancel()
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<ai-list class="app-archives-list">
|
<ai-list class="app-archives-list">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<ai-title title="门店档案" isShowBottomBorder v-model="search.girdCode" isShowArea :hideLevel="hideLevel - 1"
|
<ai-title title="门店档案" isShowBottomBorder></ai-title>
|
||||||
@change="search.current = 1, getList()"></ai-title>
|
|
||||||
</template>
|
</template>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<ai-search-bar class="search-bar">
|
<ai-search-bar class="search-bar">
|
||||||
@@ -45,6 +44,11 @@
|
|||||||
placeholder="经营类型"
|
placeholder="经营类型"
|
||||||
:selectList="$dict.getDict('operatorType')">
|
:selectList="$dict.getDict('operatorType')">
|
||||||
</ai-select>
|
</ai-select>
|
||||||
|
<el-input disabled v-model="search.girdName" size="small" placeholder="请选择片区">
|
||||||
|
<template slot="append">
|
||||||
|
<el-button size="small" @click="district=true">选择片区</el-button>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -89,13 +93,13 @@
|
|||||||
slot="pic"
|
slot="pic"
|
||||||
align="left">
|
align="left">
|
||||||
<template v-slot="{ row }">
|
<template v-slot="{ row }">
|
||||||
<img :src="row.picUrl" alt="" v-viewer>
|
<img class="preview-img" v-if="row.fileUrl" :src="row.fileUrl" alt="" v-viewer>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="门店评分" slot="mark" align="center">
|
<el-table-column label="门店评分" slot="mark" align="center">
|
||||||
<template v-slot="{row}">
|
<template v-slot="{row}">
|
||||||
<el-rate :value="4" show-score text-color="#ff9900" disabled></el-rate>
|
<el-rate :value="row.storeScore" show-score text-color="#ff9900" disabled></el-rate>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@@ -118,12 +122,30 @@
|
|||||||
width="720px">
|
width="720px">
|
||||||
<img :src="qrSrc" class="qr-img" alt="">
|
<img :src="qrSrc" class="qr-img" alt="">
|
||||||
</ai-dialog>
|
</ai-dialog>
|
||||||
|
|
||||||
|
<ai-dialog title="选择片区" :visible.sync="district" :customFooter="true" border width="720px">
|
||||||
|
<div class="grid">
|
||||||
|
<el-tree
|
||||||
|
:data="treeList"
|
||||||
|
:props="defaultProps"
|
||||||
|
node-key="id"
|
||||||
|
ref="treeRef"
|
||||||
|
:check-strictly="true"
|
||||||
|
show-checkbox
|
||||||
|
:default-expanded-keys="currCheckedKeys"
|
||||||
|
:default-checked-keys="currCheckedKeys"
|
||||||
|
@check="onCheckChange">
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
<div class="dialog-footer" slot="footer">
|
||||||
|
<el-button size="medium" @click="district=false">取消</el-button>
|
||||||
|
<el-button type="primary" size="medium" @click="getCheckedTree">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {MessageBox} from 'element-ui'
|
|
||||||
import {mapState} from "vuex";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'List',
|
name: 'List',
|
||||||
@@ -138,6 +160,9 @@ export default {
|
|||||||
girdCode: '',
|
girdCode: '',
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
|
girdCode:'',
|
||||||
|
girdName:'',
|
||||||
|
girdInfoList:[]
|
||||||
},
|
},
|
||||||
ids: [],
|
ids: [],
|
||||||
userList: [],
|
userList: [],
|
||||||
@@ -157,31 +182,77 @@ export default {
|
|||||||
tableData: [],
|
tableData: [],
|
||||||
dateList: [],
|
dateList: [],
|
||||||
dialog: false,
|
dialog: false,
|
||||||
qrSrc: ''
|
district: false,
|
||||||
|
qrSrc: '',
|
||||||
|
currCheckedKeys: [],
|
||||||
|
treeList: [],
|
||||||
|
treeObj: {
|
||||||
|
checkedKeys: [],
|
||||||
|
},
|
||||||
|
defaultExpandedKeys: [],
|
||||||
|
defaultProps: {
|
||||||
|
children: "children",
|
||||||
|
label: "girdName",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
...mapState(['user']),
|
|
||||||
|
|
||||||
hideLevel() {
|
|
||||||
return this.user.info.areaList.length || 0
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.search.areaId = this.user.info.areaId
|
|
||||||
this.$dict.load('yesOrNo', 'storeLevel', 'operatorType').then(() => {
|
this.$dict.load('yesOrNo', 'storeLevel', 'operatorType').then(() => {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
this.beforeSelectTree()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
onCheckChange(){
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeSelectTree() {
|
||||||
|
this.treeObj.checkedKeys = [];
|
||||||
|
this.instance.post(`/app/appgirdinfo/listAll3`, null, null).then((res) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.search.girdInfoList.map((e) => {
|
||||||
|
this.treeObj.checkedKeys.push(e.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.treeList = res.data.filter(e => !e.parentGirdId)
|
||||||
|
const parentGirdId = this.treeList[0].id
|
||||||
|
|
||||||
|
this.treeList.map(p => this.addChild(p, res.data.map(v => {
|
||||||
|
if (v.id === parentGirdId) {
|
||||||
|
this.defaultExpandedKeys.push(v.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...v
|
||||||
|
}
|
||||||
|
}), {
|
||||||
|
parent: 'parentGirdId'
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
handleSelectionChange(e) {
|
handleSelectionChange(e) {
|
||||||
this.ids = e.map(v=>v.id)
|
this.ids = e.map(v=>v.id)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getCheckedTree() {
|
||||||
|
const nodes = this.$refs.treeRef.getCheckedNodes()
|
||||||
|
|
||||||
|
if (nodes.length > 1) {
|
||||||
|
return this.$message.error('不支持多选')
|
||||||
|
}
|
||||||
|
|
||||||
|
this.currCheckedKeys = [nodes[0]?.id]
|
||||||
|
this.search.girdCode = nodes[0]?.girdCode
|
||||||
|
this.search.girdName = nodes[0]?.girdName
|
||||||
|
this.district = false;
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.$emit('change', {
|
this.$emit('change', {
|
||||||
type: 'Add',
|
type: 'Add',
|
||||||
@@ -190,6 +261,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async handleDelBatch() {
|
async handleDelBatch() {
|
||||||
|
this.$confirm('确定删除该数据?').then(async ()=>{
|
||||||
try {
|
try {
|
||||||
const {code} = await this.instance.post('/app/appshoparchives/delete', null, {
|
const {code} = await this.instance.post('/app/appshoparchives/delete', null, {
|
||||||
params: {
|
params: {
|
||||||
@@ -203,6 +275,7 @@ export default {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onGridChange(e) {
|
onGridChange(e) {
|
||||||
@@ -257,7 +330,7 @@ export default {
|
|||||||
this.$confirm('确定删除该数据?').then(async () => {
|
this.$confirm('确定删除该数据?').then(async () => {
|
||||||
try {
|
try {
|
||||||
const {code} = await this.instance.post('/app/appshoparchives/delete', null, {
|
const {code} = await this.instance.post('/app/appshoparchives/delete', null, {
|
||||||
params: {id}
|
params: {ids:id}
|
||||||
})
|
})
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
this.$message.success("删除成功")
|
this.$message.success("删除成功")
|
||||||
@@ -304,5 +377,11 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.preview-img{
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user