Commit 3687a857 by 李乾广

修改bug

1 parent 361479b5
<template> <template>
<a-modal <a-modal
title="人员移动" title="添加人员库"
v-if='isVisible' v-if='isVisible'
v-model:visible="isVisible" v-model:visible="isVisible"
width="520px" width="520px"
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
class="detail-modal" class="detail-modal"
> >
<a-form :model="formData"> <a-form :model="formData">
<a-form-item label="分组"> <a-form-item label="人员类型">
<a-select v-model:value="formData.personUnid" showSearch placeholder="请选择分组id"> <a-select v-model:value="formData.personType" showSearch placeholder="请选择">
<a-select-option <a-select-option
v-for="item in showDataList" v-for="(item,index) in showDataList"
:key="item" :key="index"
:value="item" :value="item.id"
>人id:{{item}}</a-select-option> >{{item.name}}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-form> </a-form>
...@@ -30,14 +30,10 @@ ...@@ -30,14 +30,10 @@
import { ref } from "vue"; import { ref } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import clusterResultApi from './ClusterResultApi' import clusterResultApi from './ClusterResultApi'
import moment from 'moment'
export default { export default {
name: 'PersonGroupEditor', name: 'PersonGroupEditor',
props: { props: {
dataList: {
type: Array,
default: () => [],
},
dataParams: { dataParams: {
type: Object, type: Object,
default: null, default: null,
...@@ -48,46 +44,40 @@ export default { ...@@ -48,46 +44,40 @@ export default {
// 表单 // 表单
function getInitialFormData() { function getInitialFormData() {
return { return {
personUnid: '', personType: '',
unidList: [], countdate:'',
countdate: '', unids:[],
} }
} }
const formData = ref(getInitialFormData()) const formData = ref(getInitialFormData())
const initDialog = (selectedList) => { const initDialog = (selectedList) => {
console.log('initDialog', selectedList) // console.log('initDialog', selectedList)
formData.value = getInitialFormData() formData.value = getInitialFormData()
formData.value.unidList = selectedList.map(item => item.unid) formData.value.unids = selectedList.map(item => item.unid)
formData.value.countdate = selectedList.length > 0 ? selectedList[0].counttime : '' formData.value.countdate = selectedList.length > 0 ? moment(selectedList[0].counttime).format('YYYY-MM-DD 00:00:00') : ''
isVisible.value = true; isVisible.value = true;
getDataList() getDataList()
}; };
const showDataList = ref([]) const showDataList = ref([])
const getDataList = () => { const getDataList = () => {
if (props.dataParams) { clusterResultApi.getPersonPoolType(props.dataParams).then(r => {
clusterResultApi.getClusterResultUidList(props.dataParams).then(r => { // console.log('getPersonPoolType', r)
console.log('getClusterResultUidList', r)
showDataList.value = r.data showDataList.value = r.data
}) })
} else {
// 使用props.dataList
showDataList.value = props.dataList.map(item => item.person_unid)
}
} }
const onCancel = () => { const onCancel = () => {
isVisible.value = false; isVisible.value = false;
}; };
const onSave = () => { const onSave = () => {
const params = { const params = {
unid: formData.value.unidList.join(','), unids: formData.value.unids,
personUnid: formData.value.personUnid, personType: formData.value.personType,
countdate: formData.value.countdate, countdate: formData.value.countdate,
mallId: props.dataParams.plaza_id,
} }
clusterResultApi.updateRecognition(params).then( clusterResultApi.addPerson(params).then(
(r) => { (r) => {
if(r.msg_code==200){ if(r.msg_code==200){
ElMessage({ ElMessage({
......
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
> >
<el-button type="text" :disabled="!isMultipleOperation">添加店员库</el-button> <el-button type="text" :disabled="!isMultipleOperation">添加店员库</el-button>
</a-popconfirm> </a-popconfirm>
<!-- <el-button type="text" :disabled="!isMultipleOperation" @click="addPersonnelPool(person)">添加人员库</el-button> --> <el-button type="text" :disabled="!isMultipleOperation" @click="addPersonnelPool(person)">添加人员库</el-button>
<a-popconfirm <a-popconfirm
title="将彻底删除,您确认吗?" title="将彻底删除,您确认吗?"
ok-text="是" ok-text="是"
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
<PersonGroupEditor ref='personGroupEditorRef' @refresh="handleEditorRefresh" /> <PersonGroupEditor ref='personGroupEditorRef' @refresh="handleEditorRefresh" />
<UploadGroupDataEditor ref='uploadGroupDataEditorRef' @refresh="handleEditorRefresh" /> <UploadGroupDataEditor ref='uploadGroupDataEditorRef' @refresh="handleEditorRefresh" />
<PersonGroupMover ref='personGroupMoverRef' :data-params="currentSearchCondition" :data-list="dataList" @refresh="handleRefresh" /> <PersonGroupMover ref='personGroupMoverRef' :data-params="currentSearchCondition" :data-list="dataList" @refresh="handleRefresh" />
<AddPersonnelPool ref='personnelPoolRef' :data-params="currentSearchCondition" :data-list="dataList" @refresh="handleRefresh" /> <AddPersonnelPool ref='personnelPoolRef' :data-params="currentSearchCondition" @refresh="handleRefresh" />
<PersonGroupDialog ref='personGroupDialogRef' :query-form="queryForm" @refresh="handleRefresh" /> <PersonGroupDialog ref='personGroupDialogRef' :query-form="queryForm" @refresh="handleRefresh" />
</template> </template>
...@@ -606,7 +606,7 @@ export default { ...@@ -606,7 +606,7 @@ export default {
{ value: 1, label: '儿童' }, { value: 1, label: '儿童' },
{ value: 2, label: '少年' }, { value: 2, label: '少年' },
{ value: 3, label: '青年' }, { value: 3, label: '青年' },
{ value: 4, label: '中' }, { value: 4, label: '中' },
{ value: 5, label: '老年' }, { value: 5, label: '老年' },
{ value: -1, label: '未知' }, { value: -1, label: '未知' },
]) ])
...@@ -886,7 +886,6 @@ export default { ...@@ -886,7 +886,6 @@ export default {
}) })
return return
} }
personnelPoolRef.value.initDialog(selectedPersonList.value); personnelPoolRef.value.initDialog(selectedPersonList.value);
} }
// 移动人员 // 移动人员
......
...@@ -65,6 +65,20 @@ class ClusterResultApi { ...@@ -65,6 +65,20 @@ class ClusterResultApi {
} }
) )
} }
// 查询集团级人员类型
getPersonPoolType(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/persontype/getPersonPoolType`,
params: filterEmptyValueInObject(
{
plaza_id: data.plaza_id,
},
)
}
)
}
getGateList(data) { getGateList(data) {
return axiosInstance.request( return axiosInstance.request(
...@@ -133,6 +147,16 @@ class ClusterResultApi { ...@@ -133,6 +147,16 @@ class ClusterResultApi {
} }
) )
} }
// 添加人员库
addPerson(data) {
return axiosInstance.request(
{
method: 'POST',
url: `/faceRecognitions/addPerson`,
data: data
}
)
}
// 剔除或移动 // 剔除或移动
updateRecognition(data) { updateRecognition(data) {
return axiosInstance.request( return axiosInstance.request(
......
...@@ -554,7 +554,7 @@ export default { ...@@ -554,7 +554,7 @@ export default {
{ value: 1, label: '儿童' }, { value: 1, label: '儿童' },
{ value: 2, label: '少年' }, { value: 2, label: '少年' },
{ value: 3, label: '青年' }, { value: 3, label: '青年' },
{ value: 4, label: '中' }, { value: 4, label: '中' },
{ value: 5, label: '老年' }, { value: 5, label: '老年' },
{ value: -1, label: '未知' }, { value: -1, label: '未知' },
]) ])
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!