发布工作

This commit is contained in:
du 2024-06-06 18:02:51 +08:00
parent ebcc3ff8c7
commit 1d283a01c3
11 changed files with 751 additions and 6 deletions

View File

@ -36,6 +36,7 @@
"pages/statistic/j-b-x-x/personnel/index",
"pages/statistic/j-b-x-x/detail/index",
"pages/work/f-b-g-z/index/index",
"pages/work/f-b-g-z/serve/index",
"pages/risk-pool/index",
"pages/risk-pool/add-pool/index"
],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
images/home/icon_w_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1,18 +1,132 @@
// pages/work/f-b-g-z/index/index.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
curTab: 0,
tabs: [{
lab: '待办事项',
val: 0
}, {
lab: '已办事项',
val: 1
}],
page: 1,
pageSize: 10,
list: []
},
/**
* 输入内容
*/
inputContent: function (e) {
const name = e.currentTarget.dataset.name;
this.data[name] = e.detail.value;
this.refresh();
},
/**
* 切换筛选
*/
tabSelect: function (params) {
const index = params.currentTarget.dataset.index;
this.data.curTab = index;
this.data.freshIng = true;
this.setData(this.data)
},
/**
* 时间筛选
*/
bindDateChange: function (params) {
const name = params.currentTarget.dataset.name;
this.data[name] = params.detail.value;
this.data.freshIng = true;
this.setData(this.data);
},
/**
* 刷新
*/
refresh: function (params) {
this.data.page = 1;
this.getList();
},
/**
* 获取列表
*/
getList: function () {
// console.log(this.data.curTab,parseInt(this.data.curTab) + 1,'=====>');
app.axios("GET", "app", "/work/sendWorkPage", {
page: this.data.page,
limit: this.data.pageSize,
startTime: this.data.startTime || '',
endTime: this.data.endTime || '',
condition: this.data.condition || '',
// state: parseInt(this.data.curTab) + 1,
// userId: app.globalData.userInfo.userId
}, false).then(res => {
console.log(res,'res====>');
this.data.freshIng = false;
if (res.code == 1) {
let page = Number.parseInt(res.data.pageNum);
if (this.data.page == 1) {
this.data.list = res.data.list;
} else {
var list = this.data.list;
if (this.data.page == page) this.data.list = [...list, ...res.data.list]
}
if (res.data.list?.length > 0) this.data.page = page + 1
}
this.setData(this.data)
})
},
/**
* 跳转详情
*/
toDetail: function (params) {
const item = params.currentTarget.dataset.item;
wx.navigateTo({
url: '/pages/g-z-t/d-b-s-x/detail/index',
})
},
/**
* 前往上传
*/
toUp: function (params) {
const item = params.currentTarget.dataset.item;
const detail = params.currentTarget.dataset.detail;
wx.navigateTo({
url: `/pages/work/d-b-s-x/up/index?detail=${detail}`,
success: res => {
res.eventChannel.emit('getItem', item)
}
})
},
/**
* 发布工作
*/
escalationAppeal: function (params) {
wx.navigateTo({
url: `/pages/work/f-b-g-z/serve/index`,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// this.data.curTab = options.id;
this.data.freshIng = true;
this.setData(this.data)
},
/**

View File

@ -1,3 +1,4 @@
{
"usingComponents": {}
"usingComponents": {},
"navigationStyle": "custom"
}

View File

@ -1,2 +1,47 @@
<!--pages/work/f-b-g-z/index/index.wxml-->
<text>pages/work/f-b-g-z/index/index.wxml</text>
<title-bar title="发布任务"></title-bar>
<!-- 搜索 -->
<view class="cu-bar search">
<view class="search-form round">
<text class="cuIcon-search"></text>
<input bindinput="inputContent" data-name="condition" type="text" placeholder="请输入关键字" confirm-type="search"></input>
</view>
</view>
<view style="background-color: #f5f5f5;">
<view class="filter">
<picker mode="date" value="{{dateFilter}}" bindchange="bindDateChange" data-name="startTime">
<view class="picker">
开始时间: {{startTime}}
</view>
</picker>
<view class="line"></view>
<picker mode="date" value="{{dateFilter}}" bindchange="bindDateChange" data-name="endTime">
<view class="picker">
结束时间: {{endTime}}
</view>
</picker>
</view>
</view>
<scroll-view scroll-y style="height: calc(100vh - 280rpx - {{topBarH}}px);" refresher-enabled bindrefresherrefresh="refresh" bindscrolltolower="getList" lower-threshold="300" refresher-triggered="{{freshIng}}">
<!-- 列表 -->
<view class="item-bg" wx:for="{{2}}">
<view class="item">
<view class="head h-div v-center">
<view class="single"></view>
<view class="title ellipsis flex">常规工作</view>
<!-- <view catchtap="toUp" data-item="{{item}}" data-detail="{{0}}" class="done" wx:if="{{item.workState !=3}}">前往完成</view> -->
<view data-item="{{item}}" data-detail="{{1}}" class="done" >查看详情</view>
</view>
<view class="tv"></view>
<view class="time">任务周期2024-05-01 至 2024-06-20</view>
<view class="time">接收时间2024-05-01</view>
<image class="bottom-img" src="/images/task/icon-bottom-line.png" mode="aspectFill" />
</view>
</view>
<empty wx:if="{{list.length==0}}" />
<view class="space"></view>
</scroll-view>
<view class="option">
<view catchtap="escalationAppeal" class="btn">发布任务</view>
</view>

View File

@ -1 +1,143 @@
/* pages/work/f-b-g-z/index/index.wxss */
page {
background-color: #f5f5f5;
}
.filter {
margin: 0 10rpx 10rpx 10rpx;
width: calc(100vw - 20rpx);
height: 80rpx;
display: flex;
flex-direction: row;
background-color: white;
border-radius: 10rpx;
align-items: center;
position: sticky;
top: 0;
border-bottom: 1rpx solid #f5f5f5;
}
.filter picker {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.cu-item {
font-size: 30rpx;
font-weight: bold;
}
.search {
height: 90rpx;
background-color: #f5f5f5;
}
.cu-bar .search-form {
background: #FFFFFF;
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
border-radius: 12rpx;
}
.item-bg {
padding: 0 32rpx 20rpx 32rpx;
background-color: #f5f5f5;
}
.item {
background-color: #ffffff;
padding: 32rpx 20rpx 20rpx 20rpx;
position: relative;
border-radius: 10rpx;
z-index: 2;
}
.item .head {
margin: 0 -20rpx;
margin-top: -32rpx;
background-color: #CDE5FC;
padding: 16rpx;
border-radius: 10rpx 10rpx 0 0;
}
.item .head .single {
width: 8rpx;
height: 36rpx;
background: #4882EE;
border-radius: 4rpx;
}
.item .head .title {
flex: 1;
margin-left: 16rpx;
font-size: 28rpx;
font-weight: bold;
color: #4882EE;
}
.item .head .status {
font-weight: bold;
font-size: 28rpx;
}
.item .tv {
font-size: 32rpx;
color: #222222;
padding-top: 20rpx;
margin-bottom: 10rpx;
}
.item .time {
font-size: 26rpx;
color: #666666;
padding-top: 10rpx;
}
.item .done {
color: rgb(12, 118, 240);
border-radius: 8rpx;
padding: 5rpx 20rpx;
background-color: rgba(0, 0, 0, 0.2);
}
.item .bottom {
font-size: 26rpx;
font-weight: bold;
color: #222222;
}
.item .g-container {
flex: 1;
height: 16rpx;
border-radius: 50rpx;
background: #eee;
margin: 20rpx 0;
}
.item .g-progress {
width: 50%;
height: inherit;
border-radius: 50rpx;
}
.item .val {
font-size: 26rpx;
font-weight: 500;
color: #222222;
margin-left: 20rpx;
}
.item .line {
margin: 20rpx -20rpx;
border-top: 2rpx dashed #f5f5f5;
}
.item .bottom-img {
width: calc(100vw - 65rpx);
max-width: calc(100vw - 65rpx);
height: 40rpx;
margin: 0 -20rpx;
position: absolute;
bottom: 0;
z-index: -1;
}

View File

@ -0,0 +1,239 @@
// 上报动态
import Utils from "../../../../utils/util"
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
baseUrl: app.FILE_SERVER_URL,
dateFilter: Utils.formatTime(new Date(), '-'),
showTaskPop: false,
postData: {}
},
/**
* 时间
*/
bindDateChange: function (params) {
const name = params.currentTarget.dataset.name;
this.data.postData[name] = params.detail.value;
this.setData(this.data)
},
/**
* 显示/关闭任务弹窗
*/
popTaskModal: function (params) {
const type = params.currentTarget.dataset.type;
this.data[type] = !this.data[type];
this.setData(this.data)
},
/**
* 输入内容
*/
inputContent: function (e) {
const name = e.currentTarget.dataset.name;
this.data.postData[name] = e.detail.value;
},
/**
* 选择文件
*/
chooseFile: function () {
wx.chooseImage({
count: 1,
type: 'all',
success: (res) => {
const tempFilePaths = res.tempFiles;
const path = tempFilePaths[0].path;
this.postImg(path)
}
})
},
/**
* 上传图片
*/
postImg(filePath) {
wx.showLoading({
title: '文件上传中...',
})
app.uploadFile(this.data.uuid, app.FileType.resumptionAcs, filePath).then(res => {
wx.hideLoading();
this.getFiles();
})
},
/**
* 获取图片
*/
getFiles: function () {
app.axios("GET", "common", "/upload/getFile", {
otcid: this.data.postData.dynamicsId || this.data.uuid,
otctype: app.FileType.resumptionAcs
}).then(res => {
if (res.code == 1) {
this.data.files = res.data;
this.setData(this.data)
}
})
},
/**
* 删除图片
* @param {*} params
*/
deleteFile: function (e) {
var id = e.currentTarget.dataset.id;
wx.showModal({
title: '删除提示',
content: '是否要删除该附件?',
success: (res) => {
if (res.confirm) {
app.axios("GET", 'common', "/upload/delFile", {
documentId: id,
}).then(res => {
if (res.code == 1) {
this.getFiles();
}
})
}
}
})
},
/**
* 发布
*/
push: function () {
this.data.postData.userId = app.globalData.userInfo.userId;
this.data.postData.emerEventId = this.data.uuid;
if (!this.data.postData.title) {
wx.showToast({
title: '请输入内容',
icon: 'none'
})
return
}
if (!this.data.postData.startTime || !this.data.postData.endTime) {
wx.showToast({
title: '请设置时间',
icon: 'none'
})
return
}
let data = {
...this.data.postData,
}
console.log(data,'data===>');
// app.axios("POST", "app", "/work/workAdd", data).then(res => {
// if (res.code == 1) {
// wx.showToast({
// title: '发布成功',
// icon: 'none'
// })
// setTimeout(() => {
// wx.navigateBack()
// }, 1500);
// } else {
// wx.showToast({
// title: res.message,
// icon: 'none'
// })
// }
// })
},
/**
* 预览文件
*/
filePre: function (params) {
const url = params.currentTarget.dataset.url;
const imgs = [];
this.data.files.forEach(item => {
imgs.push(this.data.baseUrl + item.filepath)
})
wx.previewImage({
urls: imgs,
current: this.data.baseUrl + url
})
},
//查询详情
getDetail: function (id) {
app.axios("GET", "app", `/work/wkDynamicsDetail/${id}`).then(res => {
console.log(res,'res===>');
this.data.postData = res.data
this.setData(this.data);
this.getFiles()
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.data.isUserDetail = options.user;
this.data.uuid = Utils.uuid();
this.setData(this.data);
if (options.dynamicsId) {
this.getDetail(options.dynamicsId);
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,86 @@
<!--pages/msg/push/index.wxml-->
<title-bar title="发布工作"></title-bar>
<scroll-view scroll-y refresher-enabled style="height: calc(100vh - {{topBarH}}px);">
<view class="item">
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">所属组织</text>
</view>
<view class="h-div v-center in-bg" catchtap="popModal" data-type="showTypePop">
<text class="lab"></text>
<text>{{ postData.areaPathName }}请选择所属组织</text>
</view>
<!-- 工作 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">工作类型</text>
</view>
<view class="h-div v-center in-bg" catchtap="popModal" data-type="showTypePop">
<text class="lab"></text>
<text>{{ postData.areaPathName }}请选择工作类型</text>
</view>
<!-- 内容 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">工作内容</text>
</view>
<textarea bindinput="inputContent" data-name="title" value="{{postData.title}}" style="color: #333333;" class="put v-div" placeholder="请输入工作内容"></textarea>
<!-- 时间 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">工作时间</text>
</view>
<view class="filter">
<picker mode="date" value="{{postData.startTime}}" data-name="startTime" bindchange="bindDateChange">
<view class="picker">
开始时间: {{postData.startTime||'-'}}
</view>
</picker>
<picker mode="date" value="{{postData.endTime}}" data-name="endTime" bindchange="bindDateChange">
<view class="picker">
结束时间: {{postData.endTime||'-'}}
</view>
</picker>
</view>
<!-- 附件 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title flex">附件</text>
<text catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加图片</text>
</view>
<view class="grid">
<view class="img" wx:for="{{files}}" style="position: relative;">
<text wx:if="{{!postData.dynamicsId}}" catchtap="deleteFile" data-id="{{item.sysdocumentid}}" class="cuIcon-delete del" style="color:red;"></text>
<image class="img" src="{{baseUrl+item.filepath}}" catchtap="filePre" data-url="{{item.filepath}}" />
</view>
</view>
</view>
<view class="space"></view>
</scroll-view>
<view class="option" wx:if="{{!postData.dynamicsId}}">
<view catchtap="push" class="btn">发布</view>
</view>
<!-- 选择所属社区 -->
<view class="cu-modal {{showTypePop?'show':''}}">
<view class="cu-dialog pop" catchtap>
<view class="cu-bar justify-end pop-header">
<view class="content">选择所属组织</view>
<view class="action" catchtap="popModal" data-type="showTypePop">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<radio-group class="block" style="max-height: 50vh;overflow-y: scroll;">
<!-- <view class="cu-list menu text-left">
<view class="cu-item" wx:for="{{TypeData}}" wx:key>
<label catchtap="typeChange" data-index="{{index}}" class="flex justify-between align-center flex-sub">
<view class="flex-sub">{{item.orgname}}</view>
</label>
</view>
</view> -->
<tree-node id="tree" dataTree="{{unitTreelist}}" pros="{{unitTreepros}}" bindselect="handleselectunit" isOpenAll="true" />
</radio-group>
</view>
</view>

View File

@ -0,0 +1,113 @@
/* pages/msg/push/index.wxss */
scroll-view {
background-color: #f5f5f5;
box-sizing: border-box;
}
.filter {
margin: 0 10rpx;
height: 80rpx;
display: flex;
flex-direction: row;
background-color: white;
border-radius: 10rpx;
}
.filter picker {
flex: 1;
height: 100%;
display: flex;
align-items: center;
}
.item {
background-color: #ffffff;
margin: 32rpx 20rpx 20rpx 20rpx;
padding: 20rpx;
position: relative;
border-radius: 10rpx;
z-index: 2;
}
.item .header {
margin-top: 16rpx;
}
.item .header .single {
width: 8rpx;
height: 36rpx;
background: #4882EE;
border-radius: 4rpx;
margin-right: 10rpx;
}
.item .header .title {
font-size: 30rpx;
font-weight: bold;
color: #222222;
}
.item .put {
width: 100%;
background: #F5F7FC;
border-radius: 12rpx;
min-height: 72rpx;
padding: 15rpx;
margin-top: 16rpx;
color: #333333;
font-size: 28rpx;
}
.grid {
margin-top: 20rpx;
display: grid;
grid-gap: 20rpx 20rpx;
grid-template-columns: calc((100vw - 140rpx)/3) auto auto;
}
.grid .img {
width: calc((100vw - 140rpx)/3);
height: calc((100vw - 140rpx)/3);
background-color: #f5f5f5;
border-radius: 10rpx;
}
.grid .del {
position: absolute;
bottom: 0;
left: 0;
z-index: 1;
font-size: 40rpx;
}
.option {
position: fixed;
bottom: calc(constant(safe-area-inset-bottom) + 30rpx);
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
left: 0;
right: 0;
margin-top: 30rpx;
padding: 16rpx 32rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
z-index: 10;
}
.option .btn {
padding: 14rpx;
display: flex;
align-items: center;
justify-content: center;
background: #409CFF;
color: #FFFFFF;
border-radius: 12rpx;
}
.option .btn:active {
opacity: 0.8;
}
.space {
height: calc(constant(safe-area-inset-bottom) + 150rpx);
height: calc(env(safe-area-inset-bottom) + 150rpx);
}