Commit e1dca37e authored by levante's avatar levante

完成每日流调管理

parent 2a43347e
...@@ -157,7 +157,8 @@ ...@@ -157,7 +157,8 @@
}) })
let data = { let data = {
phone: "18665917172", // phone: "18665917172",
phone: "15385457051",
corpid:corpId, corpid:corpId,
appCode: 'covid-register', appCode: 'covid-register',
type: that.type type: that.type
...@@ -185,6 +186,10 @@ ...@@ -185,6 +186,10 @@
key: 'userId', key: 'userId',
data: res.data.userId data: res.data.userId
}) })
uni.setStorage({
key: 'roleList',
data: res.data.roleList
})
let userType = res.data.userType; //角色权限 0 6 10 15 20 let userType = res.data.userType; //角色权限 0 6 10 15 20
let status = res.data.status; //填报状态 0未填报 1已填报 let status = res.data.status; //填报状态 0未填报 1已填报
let firstReport = res.data.firstReport; //用户是否首次进入此应用 let firstReport = res.data.firstReport; //用户是否首次进入此应用
......
...@@ -9,26 +9,19 @@ ...@@ -9,26 +9,19 @@
<view class="sfzhm"> <view class="sfzhm">
<text>是否填报</text> <text>是否填报</text>
<picker @change="handleIsSubmitChange" :value='index' :range="isSubmitArray"> <picker @change="handleIsSubmitChange" :value='index' :range="isSubmitArray" :disabled='fromStatistics'>
<view class="uni-input">{{isSubmitArray[index]}}</view> <view class="uni-input">{{isSubmitArray[index]}}</view>
</picker> </picker>
</view> </view>
<view class="sfzhm"> <view class="sfzhm" v-if="showMember">
<text>人员类型</text> <text>人员类型</text>
<picker @change="handleMemberTypeChange" :value='memberTypeIndex' :range="memberTypeArray"> <picker @change="handleMemberTypeChange" :value='memberTypeIndex' :range="memberTypeArray" :disabled='fromStatistics'>
<view class="uni-input">{{memberTypeArray[memberTypeIndex]}}</view> <view class="uni-input">{{memberTypeArray[memberTypeIndex]}}</view>
</picker> </picker>
</view> </view>
<view class="sfzhm">
<text>所属部门</text>
<picker @change="handleDepartmentChange" :value='departmentIndex' :range="departmentArray">
<view class="uni-input">{{departmentArray[departmentIndex]}}</view>
</picker>
</view>
<view class="sfzhm"> <view class="sfzhm">
<button type="primary" @click="searchData">查询</button> <button size='mini' type="primary" @click="searchData">查询</button>
</view> </view>
</view> </view>
</view> </view>
...@@ -43,9 +36,10 @@ ...@@ -43,9 +36,10 @@
<uni-tr v-for="(item,index) in userList" :key="index"> <uni-tr v-for="(item,index) in userList" :key="index">
<uni-td align="center">{{item.name}}</uni-td> <uni-td align="center">{{item.name}}</uni-td>
<uni-td align="center">{{item.phone}}</uni-td> <uni-td align="center">{{item.phone}}</uni-td>
<uni-td align="center">{{item.department}}</uni-td> <uni-td align="center">{{item.officeName}}</uni-td>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
<uni-pagination show-icon="true" :total="pagination.total" :current="pagination.current" @change='handleChangePage'></uni-pagination>
<!-- 时间选择器 --> <!-- 时间选择器 -->
<view v-show="picTime" class="picTime"> <view v-show="picTime" class="picTime">
<view class="uni-padding-wrap"> <view class="uni-padding-wrap">
...@@ -118,10 +112,15 @@ ...@@ -118,10 +112,15 @@
}], }],
size: 10 size: 10
}, },
pagination: {
current: 1,
total: 0
},
isnb: 0, isnb: 0,
picTime: false, picTime: false,
time: '', time: '',
name: '', name: '',
showMember: false,
index: 0, index: 0,
isSubmit: '', isSubmit: '',
...@@ -130,9 +129,6 @@ ...@@ -130,9 +129,6 @@
memberTypeIndex: 0, memberTypeIndex: 0,
memberTypeArray: ['院内人员','第三方人员'], memberTypeArray: ['院内人员','第三方人员'],
departmentIndex: 0,
departmentArray: ['中国建设','中国城建'],
years, years,
months, months,
...@@ -141,6 +137,26 @@ ...@@ -141,6 +137,26 @@
value: [9999, month - 1, day - 1], value: [9999, month - 1, day - 1],
visible: true, visible: true,
indicatorStyle: `height: 50px;`, indicatorStyle: `height: 50px;`,
reportNum: '',
fromStatistics: false,
statisticParams: {}
}
},
onLoad(option) {
this.showMember = Boolean(option.showMemberType)
this.reportNum = option.reportNum
if(!!option.officeId) {
console.log('有officeId')
this.fromStatistics = true
this.statisticParams.userType = option.userType
this.statisticParams.type = option.type
this.statisticParams.officeId = option.officeId
this.statisticParams.reportNum = option.reportNum
option.type == '1'? this.index = 0: this.index = 1
console.log(option.userType)
option.userType == 1? this.memberTypeIndex = 0: this.memberTypeIndex = 1
} else {
console.log('无officeId')
} }
}, },
mounted() { mounted() {
...@@ -155,7 +171,7 @@ ...@@ -155,7 +171,7 @@
type: 0, //0:每日流调,1:临时流调,2:在院流调 type: 0, //0:每日流调,1:临时流调,2:在院流调
createDate: this.time createDate: this.time
} }
this.getList(); this.getList()
}, },
methods: { methods: {
searchData() { searchData() {
...@@ -208,16 +224,29 @@ ...@@ -208,16 +224,29 @@
this.picTime = true this.picTime = true
}, },
getList() { getList() {
let data = { let data = {}
createDate: this.time, if(!this.fromStatistics) {
type: '0', console.log(1)
keyWord: this.name data = {
reportNum: this.reportNum,
userType: this.memberTypeArray[this.memberTypeIndex] == '院内人员'?'1':'2',
type: this.isSubmitArray[this.index] == '是'? '1':'0',
}
} else {
console.log(2)
data = this.statisticParams
} }
postRequest('/dailyReportNum/findListByCodeAndType', data).then((res) => {
if (res.code == '200' && res.data.length > 0) { Object.assign(data, {userName: this.name, size: 10, current: this.pagination.current})
postRequest('/statistics/reportedUserList', data).then((res) => {
if (res.code == '200' && res.data.records.length > 0) {
this.loading = false; this.loading = false;
this.userList = res.data; this.userList = res.data.records;
this.pagination.total = res.data.total
this.pagination.current = res.data.current
} else { } else {
this.userList = []
this.loading = false; this.loading = false;
} }
}) })
...@@ -257,9 +286,11 @@ ...@@ -257,9 +286,11 @@
handleMemberTypeChange: function(e) { handleMemberTypeChange: function(e) {
this.memberTypeIndex = e.target.value this.memberTypeIndex = e.target.value
}, },
handleDepartMentChange: function(e) { handleChangePage(e) {
this.departmentIndex = e.target.value console.log(e)
}, this.pagination.current = e.current
this.getList()
}
} }
} }
</script> </script>
......
...@@ -6,13 +6,15 @@ ...@@ -6,13 +6,15 @@
<text>名称</text> <text>名称</text>
<input v-model="name" class="uni-input" focus /> <input v-model="name" class="uni-input" focus />
</view> </view>
<view class="sfzhm" @click="picXs"> <view class="sfzhm">
<text>日期</text> <text>日期</text>
<input type="text" v-model='time' placeholder="请选择日期" /> <view class="example-body">
<image src="../../static/icon/rili.png" mode=""></image> <uni-datetime-picker :clearIcon="false" :border="false" type="date" :disabled="false" v-model="time" start="2021-3-20" end="2024-6-20"
@change="bindChange" />
</view>
</view> </view>
<view class="sfzhm"> <view class="sfzhm">
<button type="primary" @click="searchData">查询</button> <button size='mini' type="primary" @click="searchData">查询</button>
</view> </view>
</view> </view>
</view> </view>
...@@ -190,6 +192,7 @@ ...@@ -190,6 +192,7 @@
this.loading = false; this.loading = false;
this.userList = res.data; this.userList = res.data;
} else { } else {
this.userList = []
this.loading = false; this.loading = false;
} }
}) })
...@@ -219,9 +222,22 @@ ...@@ -219,9 +222,22 @@
}) })
}, },
clickName(item) { clickName(item) {
console.log(item)
const roleList = uni.getStorageSync('roleList')
console.log(roleList.toString().indexOf('superAdmin'))
if(roleList.toString().indexOf('superAdmin') > -1) {
uni.navigateTo({
url: `/pages/mrldgl/statistics?reportNum=${item.num}`
})
} else if(roleList.toString().indexOf('thirdCharge') > -1 && roleList.toString().indexOf('departmentManger') > -1) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/mrldgl/inputMainInfo` url: `/pages/mrldgl/inputMainInfo?reportNum=${item.num}&showMemberType=true`
}) })
} else {
uni.navigateTo({
url: `/pages/mrldgl/inputMainInfo?reportNum=${item.num}&showMemberType=false`
})
}
} }
} }
} }
......
...@@ -16,22 +16,61 @@ ...@@ -16,22 +16,61 @@
<uni-tr v-for="(item,index) in userList" :key="index"> <uni-tr v-for="(item,index) in userList" :key="index">
<uni-td align="center">{{item.officeName}}</uni-td> <uni-td align="center">{{item.officeName}}</uni-td>
<uni-td align="center"> <uni-td align="center">
<button :class="item.noneCount>0?'tabButton':'tab'" @click="item.noneCount>0?clickNum(item.officeId,null,0):''" type="default">{{item.noneCount}}</button> <button @click='tranferData(item.officeId, 1, 1)'>{{item.ynAlreadyCount}}</button>
</uni-td> </uni-td>
<uni-td align="center"> <uni-td align="center">
<button :class="item.alreadyCount>0?'tabButton':'tab'" @click="item.alreadyCount>0?clickNum(item.officeId,null,1):''" type="default">{{item.alreadyCount}}</button> <button @click='tranferData(item.officeId, 1, 0)'>{{item.ynNoneCount}}</button>
</uni-td> </uni-td>
<uni-td align="center"> <uni-td align="center">
<button :class="item.jsAlreadyCount>0?'tabButton':'tab'" @click="item.jsAlreadyCount>0?clickNum(item.officeId,1,1):''" type="default">{{item.jsAlreadyCount}}</button> <button @click='tranferData(item.officeId, 2, 1)'>{{item.dsfAlreadyCount}}</button>
</uni-td> </uni-td>
<uni-td align="center"> <uni-td align="center">
<button :class="item.sqAlreadyCount>0?'tabButton':'tab'" @click="item.sqAlreadyCount>0?clickNum(item.officeId,2,1):''" type="default">{{item.sqAlreadyCount}}</button> <button @click='tranferData(item.officeId, 2, 0)'>{{item.dsfNoneCount}}</button>
</uni-td> </uni-td>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
</template> </template>
<script> <script>
import {
postRequest,
getRequest
} from '@/api/api.js'
export default {
data() {
return {
reportNum: '',
loading: false,
userList: []
}
},
onLoad(option) {
this.reportNum = option.reportNum
},
mounted() {
this.getList()
},
methods: {
getList() {
const data = {
reportNum: this.reportNum
}
postRequest('/statistics/reportedStatistics', data).then((res) => {
if (res.code == '200' && res.data.length > 0) {
this.userList = res.data;
} else {
this.userList = []
this.loading = false;
}
})
},
tranferData(officeId, userType, type) {
uni.navigateTo({
url: `/pages/mrldgl/inputMainInfo?reportNum=${this.reportNum}&showMemberType=true&officeId=${officeId}&userType=${userType}&type=${type}`
})
}
}
}
</script> </script>
<style> <style>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment