Merge branch 'ldeyun' into 'master'
1.修改人力资源统计 See merge request cxcxt/cxc-szcx-uniapp!11
This commit is contained in:
commit
0f2283a04a
@ -1,4 +1,4 @@
|
||||
# 开发环境
|
||||
# 请求接口地址
|
||||
VITE_REQUEST_BASE_URL = https://36.112.48.190
|
||||
#VITE_REQUEST_BASE_URL = http://10.75.166.6:8080
|
||||
#VITE_REQUEST_BASE_URL = http://10.75.15.247:8080
|
||||
|
@ -178,6 +178,7 @@
|
||||
const fieldValues = ref([]); //字段值
|
||||
const fieldTexts = ref([]); //字段值
|
||||
const chartOption = ref({});
|
||||
const orgType = ref(''); //记录单位层级 by 闵
|
||||
|
||||
const chartTitle = computed(() => {
|
||||
return selectedOrgCodeLabel.value + '人员(' + selectedFieldLabel.value + ')分组统计';
|
||||
@ -594,6 +595,8 @@
|
||||
|
||||
// 递归计算每个根节点的data
|
||||
rootNodes.forEach((root) => computeData(root));
|
||||
|
||||
console.log(rootNodes)
|
||||
return rootNodes;
|
||||
// console.log('rootNodes', rootNodes);
|
||||
// // 转换为目标格式
|
||||
@ -703,16 +706,24 @@
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
// console.log('全部', result);
|
||||
console.log('全部', result);
|
||||
|
||||
return result;
|
||||
};
|
||||
// 获取统计数据 then filter
|
||||
const fetchStatisticsData = async () => {
|
||||
console.log(selectedOrgCode)
|
||||
if (!selectedOrgCode.value || !selectedField.value) return;
|
||||
let res = [];
|
||||
chartData.value = [];
|
||||
try {
|
||||
//这里添加一个层级字段,并避免 厂机关A01A01A01 orgType by 闵
|
||||
var tempOrgType = '1';
|
||||
if(selectedOrgCode.value.includes('A01A01A01')){
|
||||
tempOrgType = '1';
|
||||
}else{
|
||||
tempOrgType = orgType
|
||||
}
|
||||
if (selectedField.value === 'zjmc') {
|
||||
console.log(dictCode.value);
|
||||
console.log(dictData.value);
|
||||
@ -721,14 +732,16 @@
|
||||
field: selectedField.value,
|
||||
dictCode: dictCode.value,
|
||||
fieldisDict: fieldisDict.value,
|
||||
typeOfWorkList: dictData.value
|
||||
typeOfWorkList: dictData.value,
|
||||
orgType: tempOrgType.value
|
||||
});
|
||||
} else {
|
||||
res = await cxcRyDatAstatistics({
|
||||
orgCode: selectedOrgCode.value,
|
||||
field: selectedField.value,
|
||||
dictCode: dictCode.value,
|
||||
fieldisDict: fieldisDict.value
|
||||
fieldisDict: fieldisDict.value,
|
||||
orgType: tempOrgType.value
|
||||
});
|
||||
}
|
||||
|
||||
@ -743,7 +756,7 @@
|
||||
}
|
||||
//按单位进行分组
|
||||
orgCodeGroupData.value = groupByOrgCode(selectedOrgCode.value, res.result);
|
||||
// console.log(orgCodeGroupData.value);
|
||||
console.log(orgCodeGroupData.value);
|
||||
//将数据转换成echart格式
|
||||
const temp = transformData(selectedOrgCode.value, res.result);
|
||||
|
||||
@ -752,10 +765,13 @@
|
||||
|
||||
chartDataCount.value = chartData.value.length;
|
||||
console.log(chartData.value);
|
||||
updateChart(chartData.value);
|
||||
// updateChart(chartData.value);
|
||||
} else {
|
||||
// chartData.value = temp[0];
|
||||
var tempArr = [];
|
||||
tempArr.push(temp[0])
|
||||
chartData.value =tempArr;
|
||||
}
|
||||
updateChart(chartData.value);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取统计数据失败:', error);
|
||||
@ -782,7 +798,9 @@
|
||||
const onOrgCodeChange = (e, data) => {
|
||||
personnelList.value = [];
|
||||
selectedOrgCode.value = e;
|
||||
// console.log(data.value.title);
|
||||
console.log(e)
|
||||
console.log(data);
|
||||
orgType.value = data.value.orgType; //赋值层级 by 闵
|
||||
selectedOrgCodeLabel.value = data.value.title;
|
||||
fetchStatisticsData();
|
||||
};
|
||||
|
@ -2,13 +2,13 @@
|
||||
<view v-if="returnCodeOrID === 'orgCode'">
|
||||
<uni-data-picker v-model="selectDepartID" ref="depart" :openSearch="true" :ellipsis="true"
|
||||
placeholder="请选择单位code" popup-title="请选择单位" :localdata="departList" @nodeclick="onnodeclick"
|
||||
@popupclosed="onpopupclosed" @change="onchange" :map="{'text':'title','value':'orgCode'}"
|
||||
@popupclosed="onpopupclosed" :map="{'text':'title','value':'orgCode'}"
|
||||
class="no-wrap-picker"></uni-data-picker>
|
||||
</view>
|
||||
<view v-else>
|
||||
<uni-data-picker v-model="selectDepartID" ref="depart" :openSearch="true" :ellipsis="true" placeholder="请选择单位id"
|
||||
popup-title="请选择单位" :localdata="departList" @nodeclick="onnodeclick" @popupclosed="onpopupclosed"
|
||||
@change="onchange" :map="{'text':'title','value':'id'}" class="no-wrap-picker"></uni-data-picker>
|
||||
:map="{'text':'title','value':'id'}" class="no-wrap-picker"></uni-data-picker>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
@ -30,6 +30,7 @@
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
watch,
|
||||
defineEmits,
|
||||
defineProps
|
||||
} from 'vue';
|
||||
@ -46,15 +47,29 @@
|
||||
let selectDepartID = ref("") //当前选中的单位ID
|
||||
let selectDepartIDS = ref([]) //选中的级联单位ID数组
|
||||
let tempSelectDepartID = ref("") //临时选择的单位ID
|
||||
let depart = ref(null);
|
||||
|
||||
let departInfo = ref({}) //"单位的全部信息"
|
||||
|
||||
let $emit = defineEmits(['change']);
|
||||
|
||||
|
||||
watch(
|
||||
tempSelectDepartID,
|
||||
(newVal,oldVal)=>{ //通过监听触发change by 闵
|
||||
console.log(newVal)
|
||||
$emit('change', newVal, departInfo)
|
||||
},{
|
||||
immediate:true,
|
||||
deep:true
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
const getDepartList = () => {
|
||||
queryMyDeptTreeListApi().then((res) => {
|
||||
if (res.success) {
|
||||
// console.log(res)
|
||||
console.log(res)
|
||||
departList.value = res.result
|
||||
}
|
||||
}).catch((err) => {
|
||||
@ -62,22 +77,28 @@
|
||||
})
|
||||
}
|
||||
const onnodeclick = ((e) => {
|
||||
console.log(e)
|
||||
departInfo.value = e;
|
||||
if (props.returnCodeOrID = "orgCode") {
|
||||
if (props.returnCodeOrID == "orgCode") {
|
||||
tempSelectDepartID.value = e.orgCode
|
||||
} else {
|
||||
tempSelectDepartID.value = e.value
|
||||
}
|
||||
|
||||
// if(!depart.value.isOpened){//如果页面已经关闭 就触发change方法 by 闵
|
||||
// $emit('change', selectDepartID.value, departInfo)
|
||||
// }
|
||||
})
|
||||
|
||||
const onchange = ((e) => {
|
||||
$emit('change', e.detail.value[e.detail.value.length - 1].value, {})
|
||||
console.log(e)
|
||||
selectDepartID.value = e.detail.value[e.detail.value.length - 1].value
|
||||
// $emit('change', e.detail.value[e.detail.value.length - 1].value, {})
|
||||
})
|
||||
|
||||
const onpopupclosed = ((e) => {
|
||||
console.log(e)
|
||||
selectDepartID.value = tempSelectDepartID.value
|
||||
$emit('change', selectDepartID.value, departInfo)
|
||||
// $emit('change', selectDepartID.value, departInfo)
|
||||
})
|
||||
onLoad((e) => {
|
||||
getDepartList();
|
||||
|
@ -22,8 +22,8 @@
|
||||
<slot name="picker-loading" :loading="loading"></slot>
|
||||
</view>
|
||||
</view>
|
||||
<view class="uni-data-tree-cover" v-if="isOpened" @click="handleClose"></view>
|
||||
<view class="uni-data-tree-dialog" v-if="isOpened">
|
||||
<view class="uni-data-tree-cover" v-show="isOpened" @click="handleClose"></view>
|
||||
<view class="uni-data-tree-dialog" v-show="isOpened">
|
||||
<view class="uni-popper__arrow"></view>
|
||||
<view class="dialog-caption">
|
||||
<view class="dialog-title-view">
|
||||
|
@ -25,8 +25,8 @@
|
||||
</view>
|
||||
</slot>
|
||||
</view>
|
||||
<view class="uni-data-tree-cover" v-if="isOpened" @click="handleClose"></view>
|
||||
<view class="uni-data-tree-dialog" v-if="isOpened">
|
||||
<view class="uni-data-tree-cover" v-show="isOpened" @click="handleClose"></view>
|
||||
<view class="uni-data-tree-dialog" v-show="isOpened">
|
||||
<view class="uni-popper__arrow"></view>
|
||||
<view class="dialog-caption">
|
||||
<view class="title-area">
|
||||
|
Loading…
Reference in New Issue
Block a user