Commit 7b864f34 by 李乾广

增加商品类型,修改列表排序

1 parent 3115559d
......@@ -224,7 +224,7 @@
<div>性别:{{ formatGender(item.gender) }}({{item.age}})</div>
<div class="direction" :class="'direction'+item.direction">方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
<div>商品类型:{{ formatProduct(item.productId)}}</div>
<div style="width:100%;overflow:hidden;text-overflow:ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;">商品类型:{{ formatProduct(item.productId)}}</div>
</div>
</el-col>
......@@ -695,12 +695,21 @@ export default {
return (productList.value.filter(v => v.value == val)[0] || {label:'--'}).label
}
const sortDataList = function(list) {
if(queryForm.sortType==1) {
list.sort(
(a, b) => {
return (a.perrsonList[0].counttime - b.perrsonList[0].counttime)
}
)
} else {
list.sort(
(a, b) => {
return (b.perrsonList.length - a.perrsonList.length)
}
)
}
}
const reqPersonType = (val) => {
personTypeList.value = []
clusterResultApi.getPersonType({plaza_id:queryForm.plaza_id}).then(
......@@ -875,7 +884,7 @@ export default {
const rawData = toRaw(queryForm)
const params = {
unids: strIdList,
mallId:currobj.value.mall_id,
mallId:selectedPersonList.value[0].mall_id,
countdate:formatDate(rawData.date) + ' 00:00:00',
}
clusterResultApi.addDataToShopkeeper(params).then(
......
......@@ -71,6 +71,15 @@
<a-select-option :value="2">全身照</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="商品类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.productId"
mode="multiple"
:options="productList"
optionFilterProp="label"
:maxTagCount="1"
style="width: 240px">
</a-select>
</a-form-item>
<a-form-item label="人员类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.personType"
mode="multiple"
......@@ -183,6 +192,7 @@
</div>
<div class="direction" :class="'direction'+item.direction">方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
<div style="width:100%;overflow:hidden;text-overflow:ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;">商品类型:{{ formatProduct(item.productId)}}</div>
</div>
</el-col>
</el-row>
......@@ -233,6 +243,7 @@ export default {
// sequence
const dataList = ref([])
const accountList = ref([])
const productList = ref([])
const plazaList = ref([])
const personTypeList = ref([])
const zoneList = ref([])
......@@ -253,6 +264,7 @@ export default {
{
account_id: '',
plaza_id: '',
productId:[],
zone_id: [],
gate_id: [],
type: 0,
......@@ -272,6 +284,7 @@ export default {
queryForm.type = searchCondition.value.type;
queryForm.zone_id = searchCondition.value.zone_id;
queryForm.gate_id = searchCondition.value.gate_id;
queryForm.productId = searchCondition.value.productId;
queryForm.direction = searchCondition.value.direction;
queryForm.childAdult = searchCondition.value.childAdult;
queryForm.picType = searchCondition.value.picType;
......@@ -293,6 +306,7 @@ export default {
const onAccountChange = function() {
getPlazaList(1)
getProductList(1)
// getZoneList()
// getGateList()
}
......@@ -458,11 +472,35 @@ export default {
queryForm.account_id = accountList.value[0].value
}
getPlazaList()
getProductList()
}
}
}
)
}
// 查询商品
const getProductList = function(val) {
queryForm.productId = []
productList.value = []
snapshotRecordApi.getProductList({account_id: queryForm.account_id}).then((r) => {
if(r.msg_code==200){
let list = r.data?r.data:[];
for (const item of list){
productList.value.push({
value: item.id,
label: item.name,
})
}
if(productList.value.length>0){
if(!val&&searchCondition.value.productId && searchCondition.value.productId.length>0){
queryForm.productId = searchCondition.value.productId
}else{
queryForm.productId = []
}
}
}
})
}
const confirmSearch = function() {
isLoading.value = true
......@@ -472,6 +510,7 @@ export default {
account_id: rawData.account_id,
type: rawData.type,
plaza_id: rawData.plaza_id,
productId: rawData.productId?rawData.productId.toString():'',
zone_id: rawData.zone_id?rawData.zone_id.toString():'',
gate_id: rawData.gate_id?rawData.gate_id.toString():'',
direction: rawData.direction?rawData.direction.toString():'',
......@@ -489,6 +528,7 @@ export default {
account_id: [rawData.account_id],
type: rawData.type,
plaza_id: [rawData.plaza_id],
productId: rawData.productId,
zone_id: rawData.zone_id,
gate_id: rawData.gate_id,
direction: rawData.direction,
......@@ -534,6 +574,9 @@ export default {
const personUnidClick = function(val){
// return (personTypeList.value.filter(v => v.value == val)[0] || {label:'--'}).label
}
const formatProduct = function(val) {
return (productList.value.filter(v => v.value == val)[0] || {label:'--'}).label
}
const formatGender = function(number){
switch (number)
{
......@@ -1323,6 +1366,7 @@ export default {
// sequence
accountList,
plazaList,
productList,
personTypeList,
zoneList,
gateList,
......@@ -1356,6 +1400,7 @@ export default {
imgModelRef,
singleComparativeFun,
singleImgComparisonRef,
formatProduct,
personUnidClick,
hairStyleStr,
hatStr,
......
......@@ -22,6 +22,19 @@ class SnapshotRecordApi {
}
)
}
getProductList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/product/list`,
params: filterEmptyValueInObject(
{
accountId: data.account_id
},
)
}
)
}
// 查询系统级人员类型
getPersonType(data) {
return axiosInstance.request(
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!