邵佳豪 2 years ago
parent
commit
ab8c49d794
  1. 203
      pages/rescue/index.vue
  2. 24
      pages/rescue/task_implement/details.vue
  3. 78
      pages/rescue/taskapply.vue
  4. 76
      pages/rescue/taskreceive.vue
  5. 15
      pages/tabbar/three.vue

203
pages/rescue/index.vue

@ -37,7 +37,8 @@
<view class="left"> <view class="left">
<img src="@/static/4412.png" alt=""> <img src="@/static/4412.png" alt="">
<view class="" style="display: flex; font-weight: 600;"> <view class="" style="display: flex; font-weight: 600;">
<view class="top_name">{{item.name}}</view><view style="flex: 1;">任务总数: {{nub}}/{{week}}</view> <view class="top_name">{{item.name}}</view>
<view style="flex: 1;">任务总数: {{nub}}/{{week}}</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
@ -51,7 +52,7 @@
</view> </view>
<view class="charts-box" style="display: flex;"> <view class="charts-box" style="display: flex;">
<img src="@/static/dadui/10.png" alt=""> <img src="@/static/dadui/10.png" alt="">
<view style="width: 40%;"> <view style="width: 40%;">
<qiun-data-charts type="ring" :opts="opts" :chartData="chartData" v-if="index2" /> <qiun-data-charts type="ring" :opts="opts" :chartData="chartData" v-if="index2" />
</view> </view>
<view <view
@ -113,16 +114,14 @@
{{item.approvalStatus}} {{item.approvalStatus}}
</view> </view>
</view> </view>
<view style="display: flex;"> <view style="display: flex;">
<view style="flex:1"> <view style="width: 60%;">
<view class="staffbox"> <view class="staffbox">
<view class="staff"> <view class="staff2">
<view>协助人员:</view> <view>协助人员:</view>
<view v-for="(i,k) in item.supervisors" :key="k" <view class="staff_namebox">
style="display: flex;justify-content: center;align-items: center;"> <text v-for="(i,k) in item.supervisors" :key="k">{{i.name}}</text>
<img v-if="i.posts && i.posts[0] == '主查人员'" src="../../static/447.png" alt="">
<img v-if="i.posts && i.posts[0] == '协查人员'" src="../../static/446.png" alt="">
{{i.name}}
</view> </view>
</view> </view>
@ -134,14 +133,15 @@
<view v-if="item.checkTime" class="staff"> <view v-if="item.checkTime" class="staff">
<view>检查时间:</view> <view>检查时间:</view>
<picker :value="tasktiem" mode="date" @change="scheduledTime($event,item)"> <picker :value="tasktiem" mode="date" @change="scheduledTime($event,item)">
<text style="margin-right: 12rpx;">{{item.checkTime}}</text> <text style="margin-right: 12rpx;">{{item.checkTime}}</text>
</picker> </picker>
</view> </view>
<view v-else class="staff"> <view v-else class="staff">
<view>预定时间:</view> <view>预定时间:</view>
<picker :value="tasktiem" mode="date" @change="scheduledTime($event,item)"> <picker :value="tasktiem" mode="date" @change="scheduledTime($event,item)">
<text :class="tasktiem=='检查时间'?'tiem':''" style="margin-right: 12rpx;">{{tasktiem}}</text> <text :class="tasktiem=='检查时间'?'tiem':''"
style="margin-right: 12rpx;">{{tasktiem}}</text>
</picker> </picker>
<image v-if="tasktiem=='检查时间'" src="../../static/down.png" mode=""></image> <image v-if="tasktiem=='检查时间'" src="../../static/down.png" mode=""></image>
</view> </view>
@ -244,7 +244,7 @@
fontSize: 25, fontSize: 25,
color: "#fff" color: "#fff"
}, },
extra: { extra: {
ring: { ring: {
width: 50, width: 50,
@ -270,8 +270,8 @@
list: [], list: [],
month: 0, month: 0,
nub: 0, nub: 0,
index2:false, index2: false,
tasktiem:"检查时间", tasktiem: "检查时间",
index: false, index: false,
months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
} }
@ -284,81 +284,19 @@
this.month = date.getMonth() + 1 this.month = date.getMonth() + 1
this.dates.year = date.getFullYear() this.dates.year = date.getFullYear()
this.today.year = date.getFullYear() this.today.year = date.getFullYear()
this.dates.day = date.getDate()
let a = this.month % 2
let b = 0
if (this.dates.year % 4 == 0 && year % 100 != 0 || this.dates.year % 400 == 0) {
b = 1
}
if (this.month < 8 && this.month != 2 && a == 0) {
for (let i = 0; i < 30; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month < 8 && this.month != 2 && a != 0) {
for (let i = 0; i < 31; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month >= 8 && a == 0) {
for (let i = 0; i < 31; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month >= 8 && a != 0) {
for (let i = 0; i < 30; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month == 2 && !b) {
for (let i = 0; i < 28; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else {
for (let i = 0; i < 29; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
}
this.getOrganizations()
},
onReady() {
this.dates.day = date.getDate()
this.getTargetCount()
this.getOrganizations() this.getOrganizations()
}, },
methods: { methods: {
getTargetCount(){
let selectedTime = this.dates.year + '-' + this.dates.month + '-' + '01'
this.$request.get('/api/TaskTargets/GetTargetCount/'+selectedTime,null,(data,res)=>{
console.log(res);
this.week=res
})
},
getOrganizations() { getOrganizations() {
const that = this const that = this
let selectedTime = this.dates.year + '-' + this.dates.month + '-' + '01' let selectedTime = this.dates.year + '-' + this.dates.month + '-' + '01'
@ -397,7 +335,7 @@
if (res[i].name = userName) { if (res[i].name = userName) {
this.user = [res[i]] this.user = [res[i]]
for (let i = 0; i < this.user.length; i++) { for (let i = 0; i < this.user.length; i++) {
this.user[i]["tasknub"] = 0 this.user[i]["tasknub"] = 0
this.user[i]["rate"] = 0 this.user[i]["rate"] = 0
@ -491,18 +429,18 @@
this.index = false this.index = false
this.getOrganizations() this.getOrganizations()
}, },
scheduledTime(e,item){ scheduledTime(e, item) {
console.log(e); console.log(e);
this.tasktiem=e.detail.value this.tasktiem = e.detail.value
let body = { let body = {
checkTime: this.tasktiem checkTime: this.tasktiem
} }
this.$request.patch('/api/PlanTasks/'+item.id,body, (data, res) => { this.$request.patch('/api/PlanTasks/' + item.id, body, (data, res) => {
this.$alert.showError("检查时间修改成功") this.$alert.showError("检查时间修改成功")
console.log(res); console.log(res);
this.getOrganizations() this.getOrganizations()
}) })
}, },
bohui(item) { bohui(item) {
this.$request.post('/api/PlanTasks/Approval/' + item.id + '?approvalStatus=' + '驳回', null, (data, res) => { this.$request.post('/api/PlanTasks/Approval/' + item.id + '?approvalStatus=' + '驳回', null, (data, res) => {
@ -511,13 +449,13 @@
}) })
}, },
start(item) { start(item) {
if(!item.checkTime){ if (!item.checkTime) {
return 请选择检查时间 return this.$alert.showError("请填写检查时间")
} }
console.log(item); console.log(item);
// return // return
uni.navigateTo({ uni.navigateTo({
url: '/pages/rescue/task_implement/details?id=' + item.company.id + '&uid=' + item.id, url: '/pages/rescue/task_implement/details?id=' + item.company.id + '&user=' + item.id,
}) })
} }
} }
@ -561,7 +499,7 @@
border-radius: 40rpx 40rpx 0 0; border-radius: 40rpx 40rpx 0 0;
padding: 10rpx 40rpx 0 40rpx; padding: 10rpx 40rpx 0 40rpx;
display: flex; display: flex;
view:nth-child(1) { view:nth-child(1) {
flex: 1; flex: 1;
} }
@ -729,17 +667,19 @@
margin-top: 20rpx; margin-top: 20rpx;
height: 60rpx; height: 60rpx;
display: flex; display: flex;
.top_name{
.top_name {
width: 180rpx; width: 180rpx;
white-space: nowrap; white-space: nowrap;
/*内容超宽后禁止换行显示*/ /*内容超宽后禁止换行显示*/
overflow: hidden; overflow: hidden;
/*超出部分隐藏*/ /*超出部分隐藏*/
text-overflow: ellipsis; text-overflow: ellipsis;
/*文字超出部分以省略号显示*/ /*文字超出部分以省略号显示*/
} }
.left { .left {
display: flex; display: flex;
flex: 1; flex: 1;
@ -944,26 +884,66 @@
} }
.staffbox { .staffbox {
display: flex; display: flex;
margin: 6rpx 0; margin: 6rpx 0;
font-size: 30rpx; font-size: 30rpx;
white-space: nowrap;
/*内容超宽后禁止换行显示*/
overflow: hidden;
/*超出部分隐藏*/
text-overflow: ellipsis;
.staff { .staff {
display: flex; display: flex;
color: rgba(16, 15, 25, 0.48); color: rgba(16, 15, 25, 0.48);
image {
margin-top: 8rpx; .zhu {
width: 26rpx;
height: 26rpx; color: #100F19;
} }
.tiem {
color: #317AFF; view {
margin-right: 20rpx;
} }
img {
width: 40rpx;
height: 40rpx;
min-width: 40rpx;
min-height: 40rpx;
}
}
.staff2 {
display: flex;
color: rgba(16, 15, 25, 0.48);
// width: 70%;
white-space: nowrap;
/*内容超宽后禁止换行显示*/
overflow: hidden;
/*超出部分隐藏*/
text-overflow: ellipsis;
.staff_namebox {
white-space: nowrap;
/*内容超宽后禁止换行显示*/
overflow: hidden;
/*超出部分隐藏*/
text-overflow: ellipsis;
}
.zhu { .zhu {
color: #100109; color: #100F19;
} }
view { view {
margin-right: 20rpx; margin-right: 20rpx;
} }
@ -985,17 +965,18 @@
} }
.implement { .implement {
text-align: right;
margin-bottom: 10rpx; margin-bottom: 10rpx;
width: 100%;
.buttons { .buttons {
margin-top: 20rpx; margin-top: 10rpx;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding-top: 20rpx; padding-top: 20rpx;
} }
img { img {
// float: right;
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
} }

24
pages/rescue/task_implement/details.vue

@ -192,7 +192,8 @@
onLoad(e) { onLoad(e) {
console.log(e); console.log(e);
this.id=e.id this.id=e.id
this.uid=e.uid this.uid=e.user
this.getCompanies() this.getCompanies()
}, },
onReady() { onReady() {
@ -212,14 +213,18 @@
} }
}) })
}, },
bbb(){ bbb(){
let params={ // let params={
approvalStatus:'已检查', // approvalStatus:'',
inspectionResult:'未发现违法违规情况' // inspectionResult:''
} // }
this.$request.patch('/api/PlanTasks/' + this.uid, params, (data, res) => { // this.$request.patch('/api/PlanTasks/' + this.uid, params, (data, res) => {
console.log(res); // console.log(res);
}) // })
// uni.redirectTo({
// url:"/pages/rescue/task_implement/implement?id="+
// })
}, },
danweif(e){ danweif(e){
console.log(e); console.log(e);
@ -233,7 +238,10 @@
<style lang="scss"> <style lang="scss">
.button{ .button{
margin: 0 auto;
margin-top: 40rpx; margin-top: 40rpx;
width: 100%;
button { button {
width: 200rpx; width: 200rpx;
// height: 140rpx; // height: 140rpx;

78
pages/rescue/taskapply.vue

@ -280,7 +280,7 @@
months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
} }
}, },
mounted() { created() {
let date = new Date() let date = new Date()
this.dates.month = date.getMonth() + 1 this.dates.month = date.getMonth() + 1
@ -289,80 +289,22 @@
this.dates.year = date.getFullYear() this.dates.year = date.getFullYear()
this.today.year = date.getFullYear() this.today.year = date.getFullYear()
this.dates.day = date.getDate() this.dates.day = date.getDate()
let a = this.month % 2 this.getTargetCount()
let b = 0
if (this.dates.year % 4 == 0 && year % 100 != 0 || this.dates.year % 400 == 0) {
b = 1
}
if (this.month < 8 && this.month != 2 && a == 0) {
for (let i = 0; i < 30; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month < 8 && this.month != 2 && a != 0) {
for (let i = 0; i < 31; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month >= 8 && a == 0) {
for (let i = 0; i < 31; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month >= 8 && a != 0) {
for (let i = 0; i < 30; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month == 2 && !b) {
for (let i = 0; i < 28; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else {
for (let i = 0; i < 29; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
}
this.getOrganizations() this.getOrganizations()
}, },
onReady() { onReady() {
this.getOrganizations()
}, },
methods: { methods: {
getTargetCount(){
let selectedTime = this.dates.year + '-' + this.dates.month + '-' + '01'
this.$request.get('/api/TaskTargets/GetTargetCount/'+selectedTime,null,(data,res)=>{
console.log(res);
this.week=res
})
},
getOrganizations() { getOrganizations() {
const that = this const that = this
let selectedTime = this.dates.year + '-' + this.dates.month + '-' + '01' let selectedTime = this.dates.year + '-' + this.dates.month + '-' + '01'

76
pages/rescue/taskreceive.vue

@ -282,7 +282,7 @@
months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
} }
}, },
mounted() { created() {
let date = new Date() let date = new Date()
this.dates.month = date.getMonth() + 1 this.dates.month = date.getMonth() + 1
this.today.month = date.getMonth() + 1 this.today.month = date.getMonth() + 1
@ -290,72 +290,7 @@
this.dates.year = date.getFullYear() this.dates.year = date.getFullYear()
this.today.year = date.getFullYear() this.today.year = date.getFullYear()
this.dates.day = date.getDate() this.dates.day = date.getDate()
let a = this.month % 2 this.getTargetCount()
let b = 0
if (this.dates.year % 4 == 0 && year % 100 != 0 || this.dates.year % 400 == 0) {
b = 1
}
if (this.month < 8 && this.month != 2 && a == 0) {
for (let i = 0; i < 30; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month < 8 && this.month != 2 && a != 0) {
for (let i = 0; i < 31; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month >= 8 && a == 0) {
for (let i = 0; i < 31; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month >= 8 && a != 0) {
for (let i = 0; i < 30; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else if (this.month == 2 && !b) {
for (let i = 0; i < 28; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
} else {
for (let i = 0; i < 29; i++) {
var dt2 = new Date(Date.parse(JSON.stringify(this.dates.month) + " " + "1 " + JSON.stringify(this.dates
.year)) + i * 24 * 3600 * 1000);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var week = weekDay[dt2.getDay()]
if (week == "周二" || week == "周四") {
this.week++
}
}
}
this.getOrganizations() this.getOrganizations()
this.OrganizationId = uni.getStorageSync("user").organizationId this.OrganizationId = uni.getStorageSync("user").organizationId
this.userId = uni.getStorageSync("user").id this.userId = uni.getStorageSync("user").id
@ -366,6 +301,13 @@
}, },
methods: { methods: {
getTargetCount(){
let selectedTime = this.dates.year + '-' + this.dates.month + '-' + '01'
this.$request.get('/api/TaskTargets/GetTargetCount/'+selectedTime,null,(data,res)=>{
console.log(res);
this.week=res
})
},
getOrganizations() { getOrganizations() {
const that = this const that = this
let selectedTime = this.dates.year + '-' + this.dates.month + '-' + '01' let selectedTime = this.dates.year + '-' + this.dates.month + '-' + '01'

15
pages/tabbar/three.vue

@ -1,7 +1,16 @@
<template> <template>
<Dtask v-if="shenfen=='battalion'&&!isSupervisor"></Dtask> <view class="">
<Ztask v-else-if="shenfen=='brigade'"></Ztask> <view class="">
<Jtask v-else></Jtask> <Dtask v-if="shenfen=='battalion'&&!isSupervisor"></Dtask>
</view>
<view class="">
<Ztask v-if="shenfen=='brigade'"></Ztask>
</view>
<view class="">
<Jtask v-if="shenfen=='squadron'||isSupervisor"></Jtask>
</view>
</view>
</template> </template>

Loading…
Cancel
Save