Merge remote-tracking branch 'origin/build' into build
This commit is contained in:
@@ -129,6 +129,7 @@
|
|||||||
show-checkbox
|
show-checkbox
|
||||||
:default-expanded-keys="currCheckedKeys"
|
:default-expanded-keys="currCheckedKeys"
|
||||||
:default-checked-keys="currCheckedKeys"
|
:default-checked-keys="currCheckedKeys"
|
||||||
|
@check-change="handleCheckChange"
|
||||||
@check="onCheckChange">
|
@check="onCheckChange">
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</div>
|
</div>
|
||||||
@@ -171,6 +172,7 @@ export default {
|
|||||||
currCheckedKeys: [],
|
currCheckedKeys: [],
|
||||||
dialog: false,
|
dialog: false,
|
||||||
treeList: [],
|
treeList: [],
|
||||||
|
treeArray:[],
|
||||||
treeObj: {
|
treeObj: {
|
||||||
checkedKeys: [],
|
checkedKeys: [],
|
||||||
},
|
},
|
||||||
@@ -209,6 +211,7 @@ export default {
|
|||||||
this.treeObj.checkedKeys = [];
|
this.treeObj.checkedKeys = [];
|
||||||
this.instance.post(`/app/appgirdinfo/listAll3`, null, null).then((res) => {
|
this.instance.post(`/app/appgirdinfo/listAll3`, null, null).then((res) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
|
this.treeArray = res.data
|
||||||
this.form.girdInfoList.map((e) => {
|
this.form.girdInfoList.map((e) => {
|
||||||
this.treeObj.checkedKeys.push(e.id);
|
this.treeObj.checkedKeys.push(e.id);
|
||||||
});
|
});
|
||||||
@@ -238,7 +241,12 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
this.form = {...data}
|
this.form = {...data,girdInfoList:[]}
|
||||||
|
this.form.fileUrl = [{
|
||||||
|
url: data.fileUrl
|
||||||
|
}]
|
||||||
|
const target = this.treeArray?.find(v=>v.girdCode === data.girdCode)
|
||||||
|
this.currCheckedKeys = [target.id]
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
@@ -247,23 +255,26 @@ 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('请选择网格')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodes.length > 1) {
|
|
||||||
return this.$message.error('不支持多选')
|
|
||||||
}
|
|
||||||
|
|
||||||
this.currCheckedKeys = [nodes[0]?.id]
|
this.currCheckedKeys = [nodes[0]?.id]
|
||||||
this.form.girdCode = nodes[0]?.girdCode
|
this.form.girdCode = nodes[0]?.girdCode
|
||||||
this.form.girdName = nodes[0]?.girdName
|
this.form.girdName = nodes[0]?.girdName
|
||||||
this.dialog = false;
|
this.dialog = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
onCheckChange(e) {
|
handleCheckChange(data, checked){
|
||||||
|
if (checked) {
|
||||||
|
this.$refs.treeRef.setCheckedKeys([data.id])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onCheckChange(e) {
|
||||||
|
if(e.children && e.children.length>0){
|
||||||
|
this.$refs.treeRef.setCheckedKeys([]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
idChange(val) {
|
idChange(val) {
|
||||||
@@ -282,14 +293,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)
|
||||||
|
|||||||
@@ -7,35 +7,35 @@
|
|||||||
<ai-card title="基本信息">
|
<ai-card title="基本信息">
|
||||||
<template #content>
|
<template #content>
|
||||||
<ai-wrapper>
|
<ai-wrapper>
|
||||||
<ai-info-item label="经营者姓名" isLine :value="form.name"></ai-info-item>
|
<ai-info-item label="经营者姓名:" isLine :value="form.name"></ai-info-item>
|
||||||
<ai-info-item label="身份证号" :value="form.idNumber"></ai-info-item>
|
<ai-info-item label="身份证号:" :value="form.idNumber"></ai-info-item>
|
||||||
<ai-info-item label="性别" :value="form.sex"></ai-info-item>
|
<ai-info-item label="性别:" :value="$dict.getLabel('sex', form.sex)"></ai-info-item>
|
||||||
<ai-info-item label="联系电话" :value="form.phone"></ai-info-item>
|
<ai-info-item label="联系电话:" :value="form.phone"></ai-info-item>
|
||||||
<ai-info-item label="出生日期" :value="form.birthday"></ai-info-item>
|
<ai-info-item label="出生日期:" :value="form.birthday"></ai-info-item>
|
||||||
<ai-info-item label="年龄" :value="form.age"></ai-info-item>
|
<ai-info-item label="年龄:" :value="form.age"></ai-info-item>
|
||||||
</ai-wrapper>
|
</ai-wrapper>
|
||||||
</template>
|
</template>
|
||||||
</ai-card>
|
</ai-card>
|
||||||
<ai-card title="门店信息">
|
<ai-card title="门店信息">
|
||||||
<template #content>
|
<template #content>
|
||||||
<ai-wrapper>
|
<ai-wrapper label-width="100px">
|
||||||
<ai-info-item label="门店名称" isLine :value="form.shopName"></ai-info-item>
|
<ai-info-item label="门店名称:" isLine :value="form.shopName"></ai-info-item>
|
||||||
<ai-info-item label="门店照片" isLine>
|
<ai-info-item label="门店照片:" isLine>
|
||||||
<div class="files">
|
<div class="files">
|
||||||
<ai-uploader
|
<ai-uploader
|
||||||
:instance="instance"
|
:instance="instance"
|
||||||
fileType="img"
|
fileType="img"
|
||||||
acceptType=".jpg,.png,.jpeg,.JPG,.PNG,.JPEG"
|
acceptType=".jpg,.png,.jpeg,.JPG,.PNG,.JPEG"
|
||||||
v-model="form.fileUrl"
|
v-model="form.fileUrl"
|
||||||
:limit="9" :disabled="true">
|
:limit="1" :disabled="true">
|
||||||
</ai-uploader>
|
</ai-uploader>
|
||||||
</div>
|
</div>
|
||||||
</ai-info-item>
|
</ai-info-item>
|
||||||
<ai-info-item label="经营类型" isLine :value="form.operatorTypes"></ai-info-item>
|
<ai-info-item label="经营类型:" isLine :value="$dict.getLabel('operatorType',form.operatorType)"></ai-info-item>
|
||||||
<ai-info-item label="所属片区" isLine :value="form.girdName"></ai-info-item>
|
<ai-info-item label="所属片区:" isLine :value="form.girdName"></ai-info-item>
|
||||||
<ai-info-item label="社会信用代码" isLine :value="form.creditCode"></ai-info-item>
|
<ai-info-item label="社会信用代码:" isLine :value="form.creditCode"></ai-info-item>
|
||||||
<ai-info-item label="门店住址" isLine :value="form.address"></ai-info-item>
|
<ai-info-item label="门店住址:" isLine :value="form.address"></ai-info-item>
|
||||||
<ai-info-item label="门店描述" isLine :value="form.description"></ai-info-item>
|
<ai-info-item label="门店描述:" isLine :value="form.description"></ai-info-item>
|
||||||
</ai-wrapper>
|
</ai-wrapper>
|
||||||
</template>
|
</template>
|
||||||
</ai-card>
|
</ai-card>
|
||||||
@@ -68,12 +68,15 @@ export default {
|
|||||||
girdName: '',
|
girdName: '',
|
||||||
address: '',
|
address: '',
|
||||||
description: '',
|
description: '',
|
||||||
|
fileUrl:[]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.getDetail()
|
this.$dict.load('sex','operatorType').then(()=>{
|
||||||
|
this.getDetail()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -81,11 +84,14 @@ export default {
|
|||||||
try {
|
try {
|
||||||
const {code, data} = await this.instance.post('/app/appshoparchives/queryDetailById', null, {
|
const {code, data} = await this.instance.post('/app/appshoparchives/queryDetailById', null, {
|
||||||
params: {
|
params: {
|
||||||
id: this.parmas.id
|
id: this.params.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
this.form = {...data}
|
this.form = {...data}
|
||||||
|
this.form.fileUrl = [{
|
||||||
|
url: data.fileUrl
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
|
|||||||
@@ -2,13 +2,11 @@
|
|||||||
<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">
|
||||||
<template #left>
|
<template #left>
|
||||||
<el-input placeholder="请输入门店名称" v-model="search.shopName" size="small" clearable></el-input>
|
|
||||||
<ai-select
|
<ai-select
|
||||||
v-model="search.isOrNotMan"
|
v-model="search.isOrNotMan"
|
||||||
@change="(search.current = 1), getList()"
|
@change="(search.current = 1), getList()"
|
||||||
@@ -45,16 +43,21 @@
|
|||||||
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
|
||||||
v-model="search.createUserName"
|
v-model="search.shopName"
|
||||||
class="search-input"
|
class="search-input"
|
||||||
size="small"
|
size="small"
|
||||||
v-throttle="() => {search.current = 1, getList()}"
|
v-throttle="() => {search.current = 1, getList()}"
|
||||||
placeholder="请输入身份证、姓名、联系电话"
|
placeholder="请输入门店名称、姓名、联系电话"
|
||||||
clearable
|
clearable
|
||||||
@clear="search.current = 1, search.createUserName = '', getList()"
|
@clear="search.current = 1, search.shopName = '', getList()"
|
||||||
suffix-icon="iconfont iconSearch">
|
suffix-icon="iconfont iconSearch">
|
||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
@@ -65,11 +68,12 @@
|
|||||||
<el-button icon="iconfont iconDelete" :disabled="!ids.length" @click="handleDelBatch">删除</el-button>
|
<el-button icon="iconfont iconDelete" :disabled="!ids.length" @click="handleDelBatch">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<ai-import :instance="instance" :dict="dict" type="appintegraluser" name="门店档案"
|
<ai-import :instance="instance" url=""
|
||||||
|
importUrl="" name="门店档案" title="门店档案"
|
||||||
@success="getList()">
|
@success="getList()">
|
||||||
<el-button icon="iconfont iconImport">导入</el-button>
|
<el-button icon="iconfont iconImport">导入</el-button>
|
||||||
</ai-import>
|
</ai-import>
|
||||||
<ai-download :instance="instance" url="/app/appintegraluser/girdIntegralExport" :params="search"
|
<ai-download :instance="instance" url="" :params="search"
|
||||||
fileName="门店档案"
|
fileName="门店档案"
|
||||||
:disabled="tableData.length == 0">
|
:disabled="tableData.length == 0">
|
||||||
</ai-download>
|
</ai-download>
|
||||||
@@ -89,13 +93,18 @@
|
|||||||
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="operatorType" align="center">
|
||||||
|
<template v-slot="{row}">
|
||||||
|
<span>{{$dict.getLabel('operatorType',row.operatorType)}}</span>
|
||||||
|
</template>
|
||||||
|
</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 +127,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 +165,9 @@ export default {
|
|||||||
girdCode: '',
|
girdCode: '',
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
|
girdCode:'',
|
||||||
|
girdName:'',
|
||||||
|
girdInfoList:[]
|
||||||
},
|
},
|
||||||
ids: [],
|
ids: [],
|
||||||
userList: [],
|
userList: [],
|
||||||
@@ -151,37 +181,83 @@ export default {
|
|||||||
{prop: 'phone', label: '联系电话', align: 'center'},
|
{prop: 'phone', label: '联系电话', align: 'center'},
|
||||||
{prop: 'createTime', label: '录入时间', align: 'center'},
|
{prop: 'createTime', label: '录入时间', align: 'center'},
|
||||||
{prop: 'address', label: '门店地址', align: 'center'},
|
{prop: 'address', label: '门店地址', align: 'center'},
|
||||||
{prop: 'operatorTypes', label: '经营类型', align: 'center'},
|
{slot: 'operatorType'},
|
||||||
{slot: 'mark', align: 'center'}
|
{slot: 'mark', align: 'center'}
|
||||||
],
|
],
|
||||||
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,19 +266,21 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async handleDelBatch() {
|
async handleDelBatch() {
|
||||||
try {
|
this.$confirm('确定删除该数据?').then(async ()=>{
|
||||||
const {code} = await this.instance.post('/app/appshoparchives/delete', null, {
|
try {
|
||||||
params: {
|
const {code} = await this.instance.post('/app/appshoparchives/delete', null, {
|
||||||
ids: this.ids.join(',')
|
params: {
|
||||||
|
ids: this.ids.join(',')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (code === 0) {
|
||||||
|
this.$message.success('删除成功')
|
||||||
|
this.getList()
|
||||||
}
|
}
|
||||||
})
|
} catch (e) {
|
||||||
if (code === 0) {
|
console.error(e)
|
||||||
this.$message.success('删除成功')
|
|
||||||
this.getList()
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
})
|
||||||
console.error(e)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onGridChange(e) {
|
onGridChange(e) {
|
||||||
@@ -257,7 +335,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 +382,11 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.preview-img{
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -9,21 +9,21 @@
|
|||||||
<ai-wrapper>
|
<ai-wrapper>
|
||||||
<ai-info-item label="门店名称" :value="info.shopName"></ai-info-item>
|
<ai-info-item label="门店名称" :value="info.shopName"></ai-info-item>
|
||||||
<ai-info-item label="门店地址" :value="info.address"></ai-info-item>
|
<ai-info-item label="门店地址" :value="info.address"></ai-info-item>
|
||||||
<ai-info-item label="经营者姓名" :value="info.phone"></ai-info-item>
|
<ai-info-item label="经营者姓名" :value="info.shopPerson"></ai-info-item>
|
||||||
<ai-info-item label="联系电话" :value="info.areaName"></ai-info-item>
|
<ai-info-item label="联系电话" :value="info.phone"></ai-info-item>
|
||||||
<ai-info-item label="评价人" :value="info.girdName"></ai-info-item>
|
<ai-info-item label="评价人" :value="info.evaluator"></ai-info-item>
|
||||||
<ai-info-item label="评价人电话" :value="info.auditTime"></ai-info-item>
|
<ai-info-item label="评价人电话" :value="info.evaluatorPhone"></ai-info-item>
|
||||||
<ai-info-item label="评价时间" :value="info.auditTime"></ai-info-item>
|
<ai-info-item label="评价时间" :value="info.evaluationTime"></ai-info-item>
|
||||||
<ai-info-item label="评价人类型" :value="info.auditTime"></ai-info-item>
|
<ai-info-item label="评价人类型" :value="$dict.getLabel('evaluatorType',info.evaluatorType)"></ai-info-item>
|
||||||
<ai-info-item label="评价类型" isLine :value="info.auditTime"></ai-info-item>
|
<ai-info-item label="评价类型" isLine :value="info.assessType"></ai-info-item>
|
||||||
<ai-info-item label="评语" isLine :value="info.auditTime"></ai-info-item>
|
<ai-info-item label="评语" isLine :value="info.remark"></ai-info-item>
|
||||||
<ai-info-item label="现场图片" isLine :value="info.auditTime">
|
<ai-info-item label="现场图片" isLine>
|
||||||
<div class="files">
|
<div class="files">
|
||||||
<ai-uploader
|
<ai-uploader
|
||||||
:instance="instance"
|
:instance="instance"
|
||||||
fileType="img"
|
fileType="img"
|
||||||
|
v-model="info.fileList"
|
||||||
acceptType=".jpg,.png,.jpeg,.JPG,.PNG,.JPEG"
|
acceptType=".jpg,.png,.jpeg,.JPG,.PNG,.JPEG"
|
||||||
v-model="info.images"
|
|
||||||
:limit="9" :disabled="true">
|
:limit="9" :disabled="true">
|
||||||
</ai-uploader>
|
</ai-uploader>
|
||||||
</div>
|
</div>
|
||||||
@@ -61,7 +61,9 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
info: {},
|
info: {
|
||||||
|
fileList:[]
|
||||||
|
},
|
||||||
tableData1:[],
|
tableData1:[],
|
||||||
colConfigs1:[
|
colConfigs1:[
|
||||||
{ prop: 'integralUserName', label: '清单类型', align: 'center' },
|
{ prop: 'integralUserName', label: '清单类型', align: 'center' },
|
||||||
@@ -78,8 +80,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.getDetail()
|
this.$dict.load('evaluatorType').then(()=>{
|
||||||
this.getScoredetail()
|
this.getDetail()
|
||||||
|
this.getScoredetail()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -87,11 +91,11 @@ export default {
|
|||||||
try {
|
try {
|
||||||
const {code,data} = await this.instance.post('/app/appscoredetails/queryDetailById',null,{
|
const {code,data} = await this.instance.post('/app/appscoredetails/queryDetailById',null,{
|
||||||
params:{
|
params:{
|
||||||
id:this.params.id
|
id:this.params.shopId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if(code===0){
|
if(code===0){
|
||||||
console.log('data',data)
|
|
||||||
}
|
}
|
||||||
}catch (e) {
|
}catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
@@ -107,6 +111,11 @@ export default {
|
|||||||
})
|
})
|
||||||
if(code===0){
|
if(code===0){
|
||||||
this.info = data
|
this.info = data
|
||||||
|
this.info.fileList = data.pictureUrl?.split(',')?.map(item=>{
|
||||||
|
return {
|
||||||
|
url:item
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}catch (e) {
|
}catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
|
|||||||
@@ -6,12 +6,11 @@
|
|||||||
<template slot="content">
|
<template slot="content">
|
||||||
<ai-search-bar class="search-bar">
|
<ai-search-bar class="search-bar">
|
||||||
<template #left>
|
<template #left>
|
||||||
<el-input placeholder="请输入门店名称" size="small" clearable></el-input>
|
|
||||||
<ai-select
|
<ai-select
|
||||||
v-model="search.shopName"
|
v-model="search.evaluatorType"
|
||||||
@change="(search.current = 1), getList()"
|
@change="(search.current = 1), getList()"
|
||||||
placeholder="评价人员类型"
|
placeholder="评价人员类型"
|
||||||
:selectList="[]">
|
:selectList="$dict.getDict('evaluatorType')">
|
||||||
</ai-select>
|
</ai-select>
|
||||||
<ai-search label="评价时间">
|
<ai-search label="评价时间">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -46,13 +45,13 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="search.createUserName"
|
v-model="search.shopName"
|
||||||
class="search-input"
|
class="search-input"
|
||||||
size="small"
|
size="small"
|
||||||
v-throttle="() => {search.current = 1, getList()}"
|
v-throttle="() => {search.current = 1, getList()}"
|
||||||
placeholder="请输入身份证、姓名、联系电话"
|
placeholder="请输入门店名称、姓名、联系电话"
|
||||||
clearable
|
clearable
|
||||||
@clear="search.current = 1, search.createUserName = '', getList()"
|
@clear="search.current = 1, search.shopName = '', getList()"
|
||||||
suffix-icon="iconfont iconSearch">
|
suffix-icon="iconfont iconSearch">
|
||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
@@ -114,8 +113,11 @@ export default {
|
|||||||
{ prop: 'shopName', label: '门店名称', align: 'center' },
|
{ prop: 'shopName', label: '门店名称', align: 'center' },
|
||||||
{ prop: 'evaluator', label: '评价人', align: 'center' },
|
{ prop: 'evaluator', label: '评价人', align: 'center' },
|
||||||
{ prop: 'evaluationTime', label: '评价时间', align: 'center' },
|
{ prop: 'evaluationTime', label: '评价时间', align: 'center' },
|
||||||
{ prop: 'evaluatorPhone', label: '联系电话', align: 'center' },
|
{ prop: 'phone', label: '联系电话', align: 'center' },
|
||||||
{ prop: 'evaluatorType', label: '评价人类型', align: 'center'},
|
{ prop: 'evaluatorType', label: '评价人类型', align: 'center',render: (h, {row}) => {
|
||||||
|
return h('span', {
|
||||||
|
}, this.dict.getLabel('evaluatorType', row.evaluatorType))
|
||||||
|
}},
|
||||||
{ prop: 'assessType', label: '评价类型', align: 'center' },
|
{ prop: 'assessType', label: '评价类型', align: 'center' },
|
||||||
{ prop: 'address', label: '门店地址', align: 'center' },
|
{ prop: 'address', label: '门店地址', align: 'center' },
|
||||||
{ prop: 'score', label: '分数', align: 'center' },
|
{ prop: 'score', label: '分数', align: 'center' },
|
||||||
@@ -124,17 +126,9 @@ export default {
|
|||||||
dateList: []
|
dateList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
...mapState(['user']),
|
|
||||||
|
|
||||||
hideLevel () {
|
|
||||||
return this.user.info.areaList?.length || 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
created () {
|
created () {
|
||||||
this.search.areaId = this.user.info.areaId
|
this.$dict.load('evaluatorType').then(() => {
|
||||||
this.$dict.load().then(() => {
|
|
||||||
this.getList()
|
this.getList()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -164,11 +158,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
toDetail ({id}) {
|
toDetail ({id,shopId}) {
|
||||||
this.$emit('change', {
|
this.$emit('change', {
|
||||||
type: 'Detail',
|
type: 'Detail',
|
||||||
params: {
|
params: {
|
||||||
id: id || ''
|
id: id || '',
|
||||||
|
shopId:shopId || ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -209,7 +209,6 @@ export default {
|
|||||||
.app-ark-static {
|
.app-ark-static {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #F3F6F9;
|
background: #F3F6F9;
|
||||||
overflow: auto;
|
|
||||||
|
|
||||||
.card_list {
|
.card_list {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<el-button type="primary" icon="iconfont iconAdd" @click="handleAdd">评选任务</el-button>
|
<el-button type="primary" icon="iconfont iconAdd" @click="handleAdd">评选任务</el-button>
|
||||||
<ai-search label="开始时间">
|
<ai-search label="开始时间">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="search.createTimeStart"
|
v-model="search.startTime"
|
||||||
type="date"
|
type="date"
|
||||||
size="small"
|
size="small"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
</ai-search>
|
</ai-search>
|
||||||
<ai-search label="结束时间">
|
<ai-search label="结束时间">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="search.createTimeStart"
|
v-model="search.endTime"
|
||||||
type="date"
|
type="date"
|
||||||
size="small"
|
size="small"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
@@ -28,13 +28,13 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="search.createUserName"
|
v-model="search.taskName"
|
||||||
class="search-input"
|
class="search-input"
|
||||||
size="small"
|
size="small"
|
||||||
v-throttle="() => {search.current = 1, getList()}"
|
v-throttle="() => {search.current = 1, getList()}"
|
||||||
placeholder="请输入任务名称"
|
placeholder="请输入任务名称"
|
||||||
clearable
|
clearable
|
||||||
@clear="search.current = 1, search.createUserName = '', getList()"
|
@clear="search.current = 1, search.taskName = '', getList()"
|
||||||
suffix-icon="iconfont iconSearch">
|
suffix-icon="iconfont iconSearch">
|
||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
@@ -48,33 +48,25 @@
|
|||||||
:size.sync="search.size"
|
:size.sync="search.size"
|
||||||
@getList="getList">
|
@getList="getList">
|
||||||
|
|
||||||
<el-table-column
|
|
||||||
label="状态"
|
|
||||||
slot="state">
|
|
||||||
<template v-slot="{ row }">
|
|
||||||
<span class="start">启用</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column slot="options" width="180px" fixed="right" label="操作" align="center">
|
<el-table-column slot="options" width="180px" fixed="right" label="操作" align="center">
|
||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
<div class="table-options">
|
<div class="table-options">
|
||||||
<el-button type="text">详情</el-button>
|
<el-button type="text" @click="handleDetail(row)">详情</el-button>
|
||||||
<el-button type="text">删除</el-button>
|
<el-button type="text" @click="handleDelete(row)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ai-table>
|
</ai-table>
|
||||||
</template>
|
</template>
|
||||||
</ai-list>
|
</ai-list>
|
||||||
<ai-dialog title="评分规则" :visible.sync="dialog" width="800px">
|
<ai-dialog title="评分规则" :visible.sync="dialog" width="800px" @closed="onClosed" @confirm="onConfirm">
|
||||||
<el-form ref="formRef" :model="form" label-width="120px">
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="事件类型:">
|
<el-form-item label="任务名称:" prop="taskName">
|
||||||
<el-input v-model="form.type" clearable placeholder="请输入任务名称" size="small"></el-input>
|
<el-input v-model="form.taskName" clearable placeholder="请输入任务名称" size="small"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务开始时间:">
|
<el-form-item label="任务开始时间:" prop="startTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.createTimeStart"
|
v-model="form.startTime"
|
||||||
type="date"
|
type="date"
|
||||||
size="small"
|
size="small"
|
||||||
clearable
|
clearable
|
||||||
@@ -83,9 +75,9 @@
|
|||||||
placeholder="选择开始日期">
|
placeholder="选择开始日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务结束时间:">
|
<el-form-item label="任务结束时间:" prop="endTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.createTimeStart"
|
v-model="form.endTime"
|
||||||
type="date"
|
type="date"
|
||||||
size="small"
|
size="small"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@@ -94,9 +86,9 @@
|
|||||||
placeholder="选择开始日期">
|
placeholder="选择开始日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="发布人:">佩奇</el-form-item>
|
<el-form-item label="发布人:">{{user.info && user.info.name}}</el-form-item>
|
||||||
<el-form-item label="任务描述:">
|
<el-form-item label="任务描述:" prop="taskDescription">
|
||||||
<el-input v-model="form.desc" clearable placeholder="请输入任务描述" type="textarea" :rows="3" show-word-limit :maxlength="200"></el-input>
|
<el-input v-model="form.taskDescription" clearable placeholder="请输入任务描述" type="textarea" :rows="3" show-word-limit :maxlength="200"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</ai-dialog>
|
</ai-dialog>
|
||||||
@@ -104,28 +96,110 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {mapState} from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: "AppraiseTask",
|
name: "AppraiseTask",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
search:{},
|
search:{
|
||||||
|
taskName:'',
|
||||||
|
startTime:'',
|
||||||
|
endTime:'',
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
},
|
||||||
total: 10,
|
total: 10,
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
{type: "selection"},
|
{type: "selection"},
|
||||||
{ prop: 'integralUserName', label: '任务名称', align: 'center' },
|
{ prop: 'taskName', label: '任务名称', align: 'center' },
|
||||||
{ prop: 'areaName', label: '发布人', align: 'center' },
|
{ prop: 'userName', label: '发布人', align: 'center' },
|
||||||
{ prop: 'girdName', label: '发布时间', align: 'center' },
|
{ prop: 'releaswTime', label: '发布时间', align: 'center' },
|
||||||
{ prop: 'createTime', label: '任务发布时间', align: 'center' },
|
{ prop: 'startTime', label: '任务开始时间', align: 'center' },
|
||||||
{ prop: 'createTime', label: '任务结束时间', align: 'center' },
|
{ prop: 'endTime', label: '任务结束时间', align: 'center' },
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
dialog:false,
|
dialog:false,
|
||||||
form:{}
|
form:{},
|
||||||
|
rules:{
|
||||||
|
taskName:[ { required: true, message: '请输入任务名称', trigger: 'blur' }],
|
||||||
|
startTime:[ { required: true, message: '请选择开始时间', trigger: 'change' }],
|
||||||
|
endTime:[ { required: true, message: '请选择结束时间', trigger: 'change' }],
|
||||||
|
taskDescription:[ { required: true, message: '请输入任务描述', trigger: 'blur' }],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
getList(){
|
|
||||||
|
|
||||||
|
computed:{
|
||||||
|
...mapState(['user'])
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
onConfirm(){
|
||||||
|
this.$refs['formRef'].validate(async valid=>{
|
||||||
|
if(valid){
|
||||||
|
try {
|
||||||
|
const {code} = await this.instance.post('/app/apptaskmanage/addOrUpdate',null,{
|
||||||
|
params:{
|
||||||
|
...form
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(code===0){
|
||||||
|
this.$message.success('保存成功')
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
}catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
onClosed(){
|
||||||
|
this.form = {}
|
||||||
|
this.$refs['formRef'].resetFields()
|
||||||
|
},
|
||||||
|
|
||||||
|
handleDetail(row){
|
||||||
|
this.form = {...row}
|
||||||
|
this.dialog = true
|
||||||
|
},
|
||||||
|
|
||||||
|
handleDelete({id}){
|
||||||
|
this.$confirm("是否确定要删除此数据?").then(async ()=>{
|
||||||
|
try {
|
||||||
|
const {code} = await this.instance.post('/app/apptaskmanage/delete',null,{
|
||||||
|
params:{ids:id}
|
||||||
|
})
|
||||||
|
if(code===0){
|
||||||
|
this.$message.success('删除成功')
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
}catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async getList(){
|
||||||
|
try {
|
||||||
|
const {code,data} = await this.instance.post('/app/apptaskmanage/list')
|
||||||
|
if(code===0){
|
||||||
|
this.tableData = data.records
|
||||||
|
this.total = data.total
|
||||||
|
}
|
||||||
|
}catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.dialog = true
|
this.dialog = true
|
||||||
|
|||||||
@@ -13,10 +13,10 @@
|
|||||||
<template #left>
|
<template #left>
|
||||||
<el-button type="primary" icon="iconfont iconAdd" @click="handleAdd">添加</el-button>
|
<el-button type="primary" icon="iconfont iconAdd" @click="handleAdd">添加</el-button>
|
||||||
<ai-select
|
<ai-select
|
||||||
v-model="search.applyItemId"
|
v-model="search.type"
|
||||||
@change="(search.current = 1), getList()"
|
@change="(search.current = 1), getList()"
|
||||||
placeholder="请选择事件类型"
|
placeholder="请选择事件类型"
|
||||||
:selectList="dictList">
|
:selectList="$dict.getDict('shopScoreType')">
|
||||||
</ai-select>
|
</ai-select>
|
||||||
<ai-select
|
<ai-select
|
||||||
v-model="search.applyItemId"
|
v-model="search.applyItemId"
|
||||||
@@ -25,16 +25,10 @@
|
|||||||
:selectList="dictList">
|
:selectList="dictList">
|
||||||
</ai-select>
|
</ai-select>
|
||||||
<ai-select
|
<ai-select
|
||||||
v-model="search.applyItemId"
|
v-model="search.status"
|
||||||
@change="(search.current = 1), getList()"
|
@change="(search.current = 1), getList()"
|
||||||
placeholder="请选择状态"
|
placeholder="请选择状态"
|
||||||
:selectList="dictList">
|
:selectList="$dict.getDict('shopScoreEvent')">
|
||||||
</ai-select>
|
|
||||||
<ai-select
|
|
||||||
v-model="search.applyItemId"
|
|
||||||
@change="(search.current = 1), getList()"
|
|
||||||
placeholder="有效地区"
|
|
||||||
:selectList="dictList">
|
|
||||||
</ai-select>
|
</ai-select>
|
||||||
</template>
|
</template>
|
||||||
</ai-search-bar>
|
</ai-search-bar>
|
||||||
@@ -48,44 +42,52 @@
|
|||||||
@getList="getList">
|
@getList="getList">
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="状态"
|
label="分值"
|
||||||
slot="state">
|
slot="score">
|
||||||
<template v-slot="{ row }">
|
<template v-slot="{ row }">
|
||||||
<span class="start">启用</span>
|
<span>{{row.score === 0 ? 0 : row.score > 0 ? `+${row.score}` : row.score}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="状态"
|
||||||
|
slot="status">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<span class="start" v-if="row.status==='1'">启用</span>
|
||||||
|
<span class="stop" v-else>停用</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column slot="options" width="180px" fixed="right" label="操作" align="center">
|
<el-table-column slot="options" width="180px" fixed="right" label="操作" align="center">
|
||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
<div class="table-options">
|
<div class="table-options">
|
||||||
<el-button type="text">停用</el-button>
|
<el-button type="text" @click="changeState(row)">{{row.status === '1' ? '停用' : '启用'}}</el-button>
|
||||||
<el-button type="text">编辑</el-button>
|
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
|
||||||
<el-button type="text">删除</el-button>
|
<el-button type="text" @click="handleDelete(row)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ai-table>
|
</ai-table>
|
||||||
</template>
|
</template>
|
||||||
</ai-list>
|
</ai-list>
|
||||||
<ai-dialog title="评分规则" :visible.sync="dialog" width="800px">
|
<ai-dialog title="评分规则" :visible.sync="dialog" width="800px" @closed="onClosed" @onConfirm="onConfirm">
|
||||||
<el-form ref="formRef" :model="form" label-width="120px">
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="事件类型:">
|
<el-form-item label="事件类型:" prop="type">
|
||||||
<ai-select
|
<ai-select
|
||||||
v-model="form.applyItemId"
|
v-model="form.type"
|
||||||
placeholder="请选择事件类型"
|
placeholder="请选择事件类型"
|
||||||
:selectList="dictList">
|
:selectList="$dict.getDict('shopScoreType')">
|
||||||
</ai-select>
|
</ai-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="自定义事件:">
|
<el-form-item label="自定义事件:">
|
||||||
<ai-select
|
<ai-select
|
||||||
v-model="form.applyItemId"
|
v-model="form.status"
|
||||||
placeholder="请选择自定义事件"
|
placeholder="请选择自定义事件"
|
||||||
:selectList="dictList">
|
:selectList="$dict.getDict('shopScoreEvent')">
|
||||||
</ai-select>
|
</ai-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="规则:">常规</el-form-item>
|
<el-form-item label="规则:">常规</el-form-item>
|
||||||
<el-form-item label="分值:">
|
<el-form-item label="分值:" prop="score">
|
||||||
<el-input v-model="form.num" size="small" placeholder="请输入分值"></el-input>
|
<el-input-number v-model="form.score" size="small" placeholder="请输入分值"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</ai-dialog>
|
</ai-dialog>
|
||||||
@@ -96,52 +98,163 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "RuleManage",
|
name: "RuleManage",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
search:{},
|
search:{
|
||||||
|
type:'',
|
||||||
|
status:'',
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
},
|
||||||
dictList:[],
|
dictList:[],
|
||||||
cardList: [
|
cardList: [
|
||||||
{
|
{
|
||||||
label: '规则总数量',
|
label: '规则总数量',
|
||||||
value: 122
|
value: 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '正向事件规则项',
|
label: '正向事件规则项',
|
||||||
value: 122
|
value: 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '正向事件总分数',
|
label: '正向事件总分数',
|
||||||
value: 122
|
value: 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '负向事件规则项',
|
label: '负向事件规则项',
|
||||||
value: 122
|
value: 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '负向事件总分数',
|
label: '负向事件总分数',
|
||||||
value: 122
|
value: 0
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
total: 10,
|
total: 10,
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
{type: "selection"},
|
{type: "selection"},
|
||||||
{ prop: 'integralUserName', label: '类型', align: 'center' },
|
{ prop: 'type', label: '类型', align: 'center' },
|
||||||
{ prop: 'areaName', label: '事件', align: 'center' },
|
{ prop: 'areaName', label: '事件', align: 'center' },
|
||||||
{ prop: 'girdName', label: '规则', align: 'center' },
|
{ prop: 'rule', label: '规则', align: 'center' },
|
||||||
{ prop: 'createTime', label: '分值', align: 'center' },
|
{ slot: 'score' },
|
||||||
{ slot: 'state', label: '状态', align: 'center' },
|
{ slot: 'status'},
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
dialog:false,
|
dialog:false,
|
||||||
form:{}
|
form:{
|
||||||
|
id:null,
|
||||||
|
type:'',
|
||||||
|
score:''
|
||||||
|
},
|
||||||
|
rules:{
|
||||||
|
type:[{ required: true, message: '请选择事件类型', trigger: 'change' },],
|
||||||
|
score:[{ required: true, message: '请输入分值', trigger: 'blur' },],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
created(){
|
||||||
|
this.$dict.load('shopScoreType','shopScoreEvent').then(()=>{
|
||||||
|
this.getStatic()
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
onConfirm(){
|
||||||
|
this.$refs['formRef'].validate(async valid=>{
|
||||||
|
if(valid){
|
||||||
|
try {
|
||||||
|
const {code} = await this.instance.post('/app/appscorerules/addOrUpdate')
|
||||||
|
if(code===0){
|
||||||
|
this.$message.success('保存成功')
|
||||||
|
this.getList()
|
||||||
|
this.getStatic()
|
||||||
|
}
|
||||||
|
}catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onClosed(){
|
||||||
|
this.form = {
|
||||||
|
type:'',
|
||||||
|
score:''
|
||||||
|
}
|
||||||
|
this.$refs['formRef'].resetFields()
|
||||||
|
},
|
||||||
|
async changeState({id,status}){
|
||||||
|
try {
|
||||||
|
const {code} = await this.instance.post('/app/appscorerules/isOrNotEnableById',null,{
|
||||||
|
params:{id}
|
||||||
|
})
|
||||||
|
if(code===0){
|
||||||
|
this.$message.success(status === '1' ? '停用成功' :'启用成功')
|
||||||
|
this.getStatic()
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
}catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
handleEdit(row){
|
||||||
|
this.form = {...row}
|
||||||
|
this.dialog = true
|
||||||
|
},
|
||||||
|
|
||||||
|
handleDelete({id}){
|
||||||
|
this.$confirm("是否要删除此数据?").then(
|
||||||
|
async ()=>{
|
||||||
|
try {
|
||||||
|
const {code} = await this.instance.post('/app/appscorerules/delete',null,{
|
||||||
|
params:{ids:id}
|
||||||
|
})
|
||||||
|
if(code===0){
|
||||||
|
this.$message.success('删除成功')
|
||||||
|
this.getStatic()
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
}catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
|
||||||
handleAdd(){
|
handleAdd(){
|
||||||
this.dialog = true
|
this.dialog = true
|
||||||
},
|
},
|
||||||
getList() {
|
|
||||||
|
|
||||||
|
async getStatic() {
|
||||||
|
try {
|
||||||
|
const {code,data} = await this.instance.post('/app/appscorerules/queryAppScoreRulesCount')
|
||||||
|
if(code===0){
|
||||||
|
const array = ['rulesCount','positiveCount','positiveScore','negativeCount','negativeScore']
|
||||||
|
array.forEach((item,index)=>{
|
||||||
|
this.cardList[index].value = data[item]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async getList(){
|
||||||
|
try {
|
||||||
|
const {code,data} = await this.instance.post('/app/appscorerules/list')
|
||||||
|
if(code===0){
|
||||||
|
this.tableData = data.records
|
||||||
|
this.total = data.total
|
||||||
|
}
|
||||||
|
}catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -185,18 +298,18 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.start{
|
|
||||||
font-size: 14px;
|
|
||||||
color: #2EA222;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stop{
|
|
||||||
font-size: 14px;
|
|
||||||
color: #FF4466;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card:last-child {
|
.card:last-child {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.start){
|
||||||
|
font-size: 14px;
|
||||||
|
color: #2EA222;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.stop){
|
||||||
|
font-size: 14px;
|
||||||
|
color: #FF4466;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user