This commit is contained in:
weipengfei 2023-08-19 16:12:54 +08:00
commit 76483664e5

View File

@ -15,8 +15,8 @@
<view class="img_box">
<u--image
:showLoading="true"
width="150.28rpx"
height="150.28rpx"
width="131.43rpx"
height="131.43rpx"
:src="myOaInfo.avatar || '../../static/img/public/avatar.png'"
shape="circle"
></u--image>
@ -194,28 +194,20 @@
</template>
<script>
import logistiBriefCard from "@/components/logistiComptent/logistiCard/logistiBriefCard.vue"
import globalPopup from "@/components/GlobalPopup/GlobalPopup.vue"
import {
getList
} from "@/api/logistics.js"
import {
Toast
} from '@/libs/uniApi.js'
import {
oaHomeData
} from '@/static/server/server.js'
import {
noticeList
} from "@/api/notice.js"
import logistiBriefCard from "@/components/logistiComptent/logistiCard/logistiBriefCard.vue";
import globalPopup from "@/components/GlobalPopup/GlobalPopup.vue";
import { getList } from "@/api/logistics.js";
import { Toast } from "@/libs/uniApi.js";
import { oaHomeData } from "@/static/server/server.js";
import { noticeList } from "@/api/notice.js";
// import tabbar from '../components/tabbar'
import {
getIndexListAPI,
getTaskListAPI,
getMyTaskListAPI,
getApproveListAPI,
getUserIndexAPI
} from '@/api/oaApi.js'
getUserIndexAPI,
} from "@/api/oaApi.js";
//#ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
@ -223,84 +215,83 @@ export default {
components: {
// tabbar
logistiBriefCard,
globalPopup
globalPopup,
},
data () {
data() {
return {
notArr: [],
orderList: [],
oaHomeData: [],
src: 'https://cdn.uviewui.com/uview/album/1.jpg',
assessData: [{
num: '0',
name: '任务'
src: "https://cdn.uviewui.com/uview/album/1.jpg",
assessData: [
{
num: "0",
name: "任务",
},
{
num: '0',
name: '已完成'
num: "0",
name: "已完成",
},
{
num: '0',
name: '未完成'
num: "0",
name: "未完成",
},
{
num: '0%',
name: '完成率'
num: "0%",
name: "完成率",
},
],
project: {},
task: {},
page: 1,
myTaskList: [],
flowState: '#47B347', //
priority: '', //
flowState: "#47B347", //
priority: "", //
myOaInfo: {
avatar: '',
nickname: '',
mobile: '',
did_name: '',
label_name: '',
avatar: "",
nickname: "",
mobile: "",
did_name: "",
label_name: "",
},
ApproveList: []
}
ApproveList: [],
};
},
onReady () {
onReady() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#3175f9'
})
frontColor: "#ffffff",
backgroundColor: "#3175f9",
});
},
onLoad () {
onLoad() {
//#ifdef APP-PLUS
const audioContext = uni.createInnerAudioContext()
audioContext.volume = 1
audioContext.src = '../../static/mp3/order.mp3'
let that = this
const audioContext = uni.createInnerAudioContext();
audioContext.volume = 1;
audioContext.src = "../../static/mp3/order.mp3";
let that = this;
jpushModule.addNotificationListener(function (result) {
if (!that.notArr.includes(result.messageID)) {
that.$refs.globalPopup.showPopu();
that.getOrderList()
console.log("idnex的")
audioContext.play()
that.getOrderList();
console.log("idnex的");
audioContext.play();
}
that.notArr.push(result.messageID)
})
that.notArr.push(result.messageID);
});
// #endif
},
onShow () {
onShow() {
// this.getUserIndex()
// this.getIndexList()
this.getApproveList()
this.initUserInfo()
this.showToask()
this.initOaHomeDada()
this.getOrderList()
this.getApproveList();
this.initUserInfo();
this.showToask();
this.initOaHomeDada();
this.getOrderList();
},
computed: {},
methods: {
test () {
test() {
this.$refs.globalPopup.showPopu();
},
// test() {
@ -315,140 +306,141 @@ export default {
// }
// })
// },
async getOrderList () {
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id || ""
async getOrderList() {
let id = JSON.parse(uni.getStorageSync("USER_INFO")).id || "";
let res = await getList({
courier_id: id
courier_id: id,
// courier_id: 167
})
this.orderList = res.data.data
});
this.orderList = res.data.data;
},
goOrderList () {
goOrderList() {
uni.navigateTo({
url: "/pages/logistics/index"
})
url: "/pages/logistics/index",
});
},
initUserInfo () {
this.$store.state.app.userInfo ? this.myOaInfo = this.$store.state.app.userInfo : this.myOaInfo.avatar =
'';
initUserInfo() {
this.$store.state.app.userInfo
? (this.myOaInfo = this.$store.state.app.userInfo)
: (this.myOaInfo.avatar = "");
},
initOaHomeDada () {
if (this.$store.state.app.userInfo.admin_id == 0) { //
let arr = oaHomeData.filter(item => !item.admin); //
initOaHomeDada() {
if (this.$store.state.app.userInfo.admin_id == 0) {
//
let arr = oaHomeData.filter((item) => !item.admin); //
this.oaHomeData = arr;
} else {
// this.oaHomeData = oaHomeData;
let arr = oaHomeData.filter(item => !item.captain); //
let arr = oaHomeData.filter((item) => !item.captain); //
this.oaHomeData = arr;
}
if (this.$store.state.app.userInfo?.company?.company_type_name == '平台公司') {
this.oaHomeData = this.oaHomeData.filter(item => {
return item.text == '人员管理' ? false : true;
})
if (
this.$store.state.app.userInfo?.company?.company_type_name == "平台公司"
) {
this.oaHomeData = this.oaHomeData.filter((item) => {
return item.text == "人员管理" ? false : true;
});
}
//
if (this.oaHomeData >= 8) {
this.oaHomeData[7] = this.oaHomeData[this.oaHomeData.length - 1];
} else {
this.oaHomeData.splice(this.oaHomeData.length - 1, 1)
this.oaHomeData.splice(this.oaHomeData.length - 1, 1);
}
},
async getApproveList () {
async getApproveList() {
const res = await noticeList({
keyword: '',
keyword: "",
page_no: 1,
page_size: 2
})
this.ApproveList = res.data.lists
page_size: 2,
});
this.ApproveList = res.data.lists;
},
async getIndexList () {
const {
project,
task
} = await getIndexListAPI()
console.log(task, '222');
this.assessData[0].num = project.count
this.assessData[1].num = project.count_ok
this.assessData[2].num = project.count_no
this.assessData[3].num = project.count_lv + '%'
this.assessData[4].num = task.count
this.assessData[5].num = task.count_ok
this.assessData[6].num = task.count_no
this.assessData[7].num = task.count_lv + '%'
this.myTaskList = task.list
async getIndexList() {
const { project, task } = await getIndexListAPI();
console.log(task, "222");
this.assessData[0].num = project.count;
this.assessData[1].num = project.count_ok;
this.assessData[2].num = project.count_no;
this.assessData[3].num = project.count_lv + "%";
this.assessData[4].num = task.count;
this.assessData[5].num = task.count_ok;
this.assessData[6].num = task.count_no;
this.assessData[7].num = task.count_lv + "%";
this.myTaskList = task.list;
},
async getMyTask () {
async getMyTask() {
let data = {
page: this.page,
limit: 10
}
const res = getMyTaskListAPI(data)
limit: 10,
};
const res = getMyTaskListAPI(data);
},
naviTaskDetails (id) {
naviTaskDetails(id) {
uni.navigateTo({
url: `/pages/views/task_details?id=${id}`
})
url: `/pages/views/task_details?id=${id}`,
});
},
navTo (url) {
url ?
uni.navigateTo({
navTo(url) {
url
? uni.navigateTo({
url: url,
fail () {
fail() {
uni.switchTab({
url: url
})
}
}) : Toast('暂未开放')
url: url,
});
},
navTwo (url, key) {
})
: Toast("暂未开放");
},
navTwo(url, key) {
let role_id = this.$store.state.app?.userInfo?.admin?.role_id || null;
var arr = [3, 6];
if (role_id && role_id[0] == 9) {
if (arr.indexOf(key) == -1) {
Toast('请先成立公司后开放')
return false
Toast("请先成立公司后开放");
return false;
}
}
this.navTo(url);
},
//
clickNotice (e) {
clickNotice(e) {
uni.navigateTo({
url: `/pages/oaNews/oaNews?id=${e}`
})
url: `/pages/oaNews/oaNews?id=${e}`,
});
},
// ,
showToask () {
showToask() {
if (!this.$store.state.app.token) {
this.assessData = this.assessData.map(item => {
item.num = '*';
this.assessData = this.assessData.map((item) => {
item.num = "*";
return item;
})
});
} else {
//
this.assessData = this.assessData.map(item => {
item.num = '0';
this.assessData = this.assessData.map((item) => {
item.num = "0";
return item;
})
});
}
},
login () {
login() {
uni.navigateTo({
url: '/pages/oaLogin/oaLogin'
})
url: "/pages/oaLogin/oaLogin",
});
},
async getUserIndex () {
const res = await getUserIndexAPI()
this.myOaInfo = res
}
async getUserIndex() {
const res = await getUserIndexAPI();
this.myOaInfo = res;
},
onPullDownRefresh () {
},
onPullDownRefresh() {
// this.getIndexList()
uni.stopPullDownRefresh()
}
}
uni.stopPullDownRefresh();
},
};
</script>
<style lang="scss">
@ -474,21 +466,23 @@ export default {
border-radius: 0 0 30rpx 30rpx;
.head_img {
position: relative;
background-color: #ff7c32;
width: 100%;
border-radius: 70rpx 50rpx 50rpx 70rpx;
height: 130.28rpx;
height: 105.14rpx;
line-height: 105.14rpx;
border-radius: 35.05rpx 35.05rpx 35.05rpx 35.05rpx;
display: flex;
justify-content: space-between;
padding-right: 50rpx;
line-height: 130rpx;
color: white;
font-size: 34rpx;
.img_box {
width: 150.28rpx;
height: 150.28rpx;
translate: -10rpx -10rpx;
width: 131.43rpx;
height: 131.43rpx;
position: absolute;
border: 1px dashed #707070;
}