Commit fb4b79bb by 李乾广

Merge branch 'mall_master' of http://git.keliuyun.com:55676/luoxinlin/vion-tools into mall_master

# Conflicts:
#	src/views/SnapshotCluster/ClusterResult/ClusterResult.vue
2 parents c5dca8e5 34a0f2c8
......@@ -81,7 +81,7 @@
style="width: 240px">
</a-select>
</a-form-item>
<a-form-item label="年龄类型:" style="padding: 5px 0">
<!--<a-form-item label="年龄类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.childAdult"
mode="multiple"
:maxTagCount="1"
......@@ -90,6 +90,21 @@
<a-select-option :value="0">儿童</a-select-option>
<a-select-option :value="-1">未知</a-select-option>
</a-select>
</a-form-item>-->
<a-form-item label="年龄类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.childAdult"
mode="multiple"
:maxTagCount="1"
style="width: 240px">
<a-select-option
v-for="item in childAdultOptions"
:key="item.value"
:value="item.value"
>{{item.label}}</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="人ID:" style="padding: 5px 0">
<a-input v-model:value="queryForm.personUnid" style="width: 240px"/>
</a-form-item>
<a-form-item label="选择日期:" style="padding: 5px 0">
<a-date-picker v-model:value="queryForm.date" :format="'YYYY-MM-DD'" :allowClear="false" style="width: 240px"/>
......@@ -193,7 +208,7 @@
class="single-image">
</el-image>
<div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ personTypeStr(item.person_type)}}({{ item.childAdult==1?'成人':(item.childAdult==0?'儿童':'未知') }})</div>
<div>人员类型:{{ personTypeStr(item.person_type)}}({{ formatChildAdult(item.childAdult) }})</div>
<div>性别:{{ formatGender(item.gender) }}({{item.age}})</div>
<div class="direction" :class="'direction'+item.direction">事件类型:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
......@@ -513,7 +528,10 @@ export default {
maxPic: rawData.maxPic,
page: pageNum.value - 1,
pageSize: pageSize.value,
childAdult: rawData.childAdult?rawData.childAdult.toString():'',
// childAdult: rawData.childAdult?rawData.childAdult.toString():'',
// 查询条件
age: rawData.childAdult?rawData.childAdult.toString():'',
personUnid: rawData.personUnid,
}
)
const storageData = filterEmptyValueInObject(
......@@ -571,6 +589,20 @@ export default {
const personTypeStr = function(val){
return (personTypeList.value.filter(v => v.value == val)[0] || {label:'--'}).label
}
const childAdultOptions = ref([
{ value: 0, label: '婴儿' },
{ value: 1, label: '儿童' },
{ value: 2, label: '少年' },
{ value: 3, label: '青年' },
{ value: 4, label: '中午' },
{ value: 5, label: '老年' },
{ value: -1, label: '未知' },
])
const formatChildAdult = function(val) {
const targetitem = childAdultOptions.value.find(item => item.value === val)
if (targetitem) return targetitem.label
else return '未知'
}
const formatGender = function(number){
switch (number)
{
......@@ -1109,6 +1141,8 @@ export default {
mutipleOperationText,
deleteRealPersonRecord,
addShopkeeper,
childAdultOptions,
formatChildAdult
}
}
}
......
......@@ -79,7 +79,7 @@
style="width: 240px">
</a-select>
</a-form-item>
<a-form-item label="年龄类型:" style="padding: 5px 0">
<!--<a-form-item label="年龄类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.childAdult"
mode="multiple"
:maxTagCount="1"
......@@ -88,6 +88,18 @@
<a-select-option :value="0">儿童</a-select-option>
<a-select-option :value="-1">未知</a-select-option>
</a-select>
</a-form-item>-->
<a-form-item label="年龄类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.childAdult"
mode="multiple"
:maxTagCount="1"
style="width: 240px">
<a-select-option
v-for="item in childAdultOptions"
:key="item.value"
:value="item.value"
>{{item.label}}</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="选择日期:" style="padding: 5px 0">
<a-date-picker v-model:value="queryForm.date" :format="'YYYY-MM-DD'" :allowClear="false" style="width: 280px"/>
......@@ -144,7 +156,7 @@
>
</el-image>
<div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ personTypeStr(item.person_type)}}({{ item.childAdult==1?'成人':(item.childAdult==0?'儿童':'未知') }})</div>
<div>人员类型:{{ personTypeStr(item.person_type)}}({{ formatChildAdult(item.childAdult) }})</div>
<div>
<span>性别:{{ formatGender(item.gender) }}({{item.age}})</span>
<a-popover v-if="item.personLabel" trigger="click">
......@@ -479,7 +491,8 @@ export default {
endTime: formatDate(rawData.date) + ' ' + rawData.endTime,
page: pageNum.value - 1,
pageSize: pageSize.value,
childAdult: rawData.childAdult?rawData.childAdult.toString():'',
// childAdult: rawData.childAdult?rawData.childAdult.toString():'',
age: rawData.childAdult?rawData.childAdult.toString():'',
}
)
const storageData = filterEmptyValueInObject(
......@@ -528,6 +541,20 @@ export default {
const personTypeStr = function(val){
return (personTypeList.value.filter(v => v.value == val)[0] || {label:'--'}).label
}
const childAdultOptions = ref([
{ value: 0, label: '婴儿' },
{ value: 1, label: '儿童' },
{ value: 2, label: '少年' },
{ value: 3, label: '青年' },
{ value: 4, label: '中午' },
{ value: 5, label: '老年' },
{ value: -1, label: '未知' },
])
const formatChildAdult = function(val) {
const targetitem = childAdultOptions.value.find(item => item.value === val)
if (targetitem) return targetitem.label
else return '未知'
}
const formatGender = function(number){
switch (number)
{
......@@ -1000,7 +1027,10 @@ export default {
suitTypeStr,
rucksackTypeStr,
handbagTypeStr,
shoppingBagTypeStr
shoppingBagTypeStr,
formatChildAdult,
childAdultOptions,
}
}
}
......
......@@ -2,12 +2,23 @@
<div class="containter">
<a-form :model="queryForm" layout="inline" :label-col="{ style: { width: '70px' } }">
<a-form-item label="集团:" style="padding: 5px 0">
<a-select v-model:value="queryForm.account_id" style="width: 240px" mode="multiple" :maxTagCount="1"
<a-select v-model:value="queryForm.account_id" style="width: 240px" :maxTagCount="1"
@change="onAccountChange" :options="accountList" optionFilterProp="label" show-search>
</a-select>
</a-form-item>
<a-form-item label="广场:" style="padding: 5px 0">
<a-select v-model:value="queryForm.plaza_id" style="width: 240px" :maxTagCount="1" :options="plazaList" optionFilterProp="label" show-search>
<a-select v-model:value="queryForm.plaza_id" style="width: 240px" :maxTagCount="1" :options="plazaList" optionFilterProp="label" show-search @change="onPlazaChange">
</a-select>
</a-form-item>
<a-form-item label="店铺:" style="padding: 5px 0">
<a-select v-model:value="queryForm.zone_id"
style="width: 240px"
mode="multiple"
:maxTagCount="1"
:options="zoneList"
optionFilterProp="label"
show-search
>
</a-select>
</a-form-item>
......@@ -92,6 +103,7 @@
getPagedList
} from '@/PublicUtil/PublicUtil'
import {ElMessage,ElMessageBox} from 'element-plus'
import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi';
export default {
components: {
},
......@@ -105,10 +117,11 @@
const dataList = ref([])
const accountList = ref([])
const plazaList = ref([])
const zoneList = ref([])
const currobj = ref({})
const currentItem = ref({})
const queryForm = reactive({
account_id: [],
account_id: '',
plaza_id: '',
date: moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD'),
startTime: '00:00:00',
......@@ -139,11 +152,19 @@
const onAccountChange = function() {
getPlazaList(1)
}
const onPlazaChange = function() {
queryForm.zone_id = []
zoneList.value = []
// 1 表示不从localStorage中读取数据
getZoneList(1)
}
const getPlazaList = function(val) {
queryForm.plaza_id = ''
queryForm.zone_id = []
plazaList.value = []
zoneList.value = []
batchesResultApi.getPlazaList({
account_id: queryForm.account_id.toString()
account_id: Array.isArray(queryForm.account_id) ? queryForm.account_id[0] : queryForm.account_id,
}).then(
(r) => {
if (isArray(r)) {
......@@ -159,7 +180,44 @@
} else {
queryForm.plaza_id = plazaList.value[0].value
}
confirmSearch()
// 1 表示不从localStorage中读取数据,若则读取
getZoneList(val)
}
}
}
)
}
const getZoneList = function(val) {
console.log('getZoneList', val, searchCondition.value)
// queryForm.zone_id = []
zoneList.value = []
snapshotRecordApi.getZoneList(
{
account_id: Array.isArray(queryForm.account_id) ? queryForm.account_id[0] : queryForm.account_id,
plaza_id: queryForm.plaza_id,
}
).then(
(r) => {
if (isArray(r))
{
for (const item of r)
{
zoneList.value.push(
{
value: item.id,
label: item.name,
}
)
}
if(zoneList.value.length){
if(!val&&searchCondition.value.zone_id && searchCondition.value.zone_id.length>0){
queryForm.zone_id = searchCondition.value.zone_id
}else{
queryForm.zone_id = []
}
}else{
queryForm.zone_id = []
}
}
}
......@@ -167,7 +225,7 @@
}
const getAccountList = function() {
queryForm.account_id = []
queryForm.account_id = ''
accountList.value = []
batchesResultApi.getAccountList().then(
(r) => {
......@@ -179,10 +237,10 @@
})
}
if (accountList.value.length) {
if (searchCondition.value.account_id && searchCondition.value.account_id.length > 0) {
if (searchCondition.value.account_id) {
queryForm.account_id = searchCondition.value.account_id
} else {
queryForm.account_id.push(accountList.value[0].value)
queryForm.account_id = accountList.value[0].value
}
getPlazaList()
}
......@@ -199,6 +257,7 @@
const rawData = toRaw(queryForm)
const data = filterEmptyValueInObject({
mallId: rawData.plaza_id,
zoneId: rawData.zone_id.toString(),
countDate: formatDate(rawData.date),
startTime: formatDate(rawData.date) + ' ' + rawData.startTime,
endTime: formatDate(rawData.date) + ' ' + rawData.endTime,
......@@ -210,6 +269,7 @@
const storageData = filterEmptyValueInObject({
account_id: rawData.account_id,
plaza_id: [rawData.plaza_id],
zone_id: rawData.zone_id,
date: rawData.date,
minNum: rawData.minNum,
maxNum: rawData.maxNum,
......@@ -219,7 +279,7 @@
let searchCondition = JSON.parse(window.localStorage.getItem('searchCondition'));
let newSearchCondition = {
...searchCondition,
...storageData
...storageData,
}
window.localStorage.setItem('searchCondition', JSON.stringify(newSearchCondition))
batchesResultApi.getBatchesResultList(data).then(
......@@ -426,6 +486,8 @@
clickSearch,
concatBatches,
deleteBatches,
onPlazaChange,
zoneList,
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!