feat:工作动态上报+待办事项

已完成数据接入
This commit is contained in:
lijianzhong 2024-02-05 15:53:23 +08:00
parent 87c47b7246
commit 0c6a42aa64
31 changed files with 581 additions and 412 deletions

4
app.js
View File

@ -50,7 +50,8 @@ App({
globalData: { globalData: {
versionCode: 'V1', versionCode: 'V1',
userInfo: {}, userInfo: {},
headerUrl: "http://42.193.40.239:8017/" // headerUrl: "http://42.193.40.239:8017/"
headerUrl: "http://192.168.110.186:8017/"
}, },
// 文件服务器地址 // 文件服务器地址
@ -61,7 +62,6 @@ App({
FileType: { FileType: {
avatar: "SysPhoto", // 用户头像 avatar: "SysPhoto", // 用户头像
resumptionAcs: "WorkFile", // 履职附件 resumptionAcs: "WorkFile", // 履职附件
taskAcs: "TaskAttachment", // 任务附件
msgAcs: "MsgAcs", // 消息附件 msgAcs: "MsgAcs", // 消息附件
eventAcs: "eventAcs", //突发事件上报 eventAcs: "eventAcs", //突发事件上报

View File

@ -10,20 +10,17 @@
"pages/msg/push-index/index", "pages/msg/push-index/index",
"pages/msg/push/index", "pages/msg/push/index",
"pages/web/index", "pages/web/index",
"pages/statistic/y-j/index/index", "pages/statistic/y-j/index/index",
"pages/statistic/j-b-x-x/index/index", "pages/statistic/j-b-x-x/index/index",
"pages/statistic/g-z-t-j/index/index", "pages/statistic/g-z-t-j/index/index",
"pages/statistic/g-z-r-z/index/index", "pages/statistic/g-z-r-z/index/index",
"pages/statistic/g-z-r-z/detail/index", "pages/statistic/g-z-r-z/detail/index",
"pages/work/s-b/index/index", "pages/work/s-b/index/index",
"pages/work/d-b-s-x/index/index", "pages/work/d-b-s-x/index/index",
"pages/work/d-b-s-x/detail/index",
"pages/emergency/y-a/index/index", "pages/emergency/y-a/index/index",
"pages/emergency/s-b/index/index", "pages/emergency/s-b/index/index",
"pages/emergency/t-x/index/index" "pages/emergency/t-x/index/index",
"pages/work/d-b-s-x/up/index"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

BIN
images/home/icon_w_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
images/home/icon_w_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
images/home/icon_w_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
images/home/icon_yj_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/home/icon_yj_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
images/home/icon_yj_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -183,48 +183,48 @@ Page({
name: "工作日志", name: "工作日志",
href: "/pages/statistic/g-z-r-z/index/index" href: "/pages/statistic/g-z-r-z/index/index"
}, { }, {
icon: "icon_tab1", icon: "icon_tab2",
name: "工作统计", name: "工作统计",
href: "/pages/statistic/g-z-t-j/index/index" href: "/pages/statistic/g-z-t-j/index/index"
}, { }, {
icon: "icon_tab1", icon: "icon_tab3",
name: "应急统计", name: "应急统计",
href: "/pages/statistic/y-j/index/index" href: "/pages/statistic/y-j/index/index"
}, { }, {
icon: "icon_tab1", icon: "icon_tab4",
name: "基本信息", name: "基本信息",
href: "/pages/statistic/j-b-x-x/index/index" href: "/pages/statistic/j-b-x-x/index/index"
}], }],
// 工作台 // 工作台
tab2: [{ tab2: [{
icon: "icon_tab6", icon: "icon_w_1",
name: "上报动态", name: "上报动态",
href: "/pages/work/s-b/index/index", href: "/pages/work/s-b/index/index",
}, },
{ {
icon: "icon_tab2", icon: "icon_w_2",
name: "待办事项", name: "待办事项",
href: "/pages/work/d-b-s-x/index/index?id=0" href: "/pages/work/d-b-s-x/index/index?id=0"
}, },
{ {
icon: "icon_tab4", icon: "icon_w_3",
name: "已办事项", name: "已办事项",
href: "/pages/work/d-b-s-x/index/index?id=1" href: "/pages/work/d-b-s-x/index/index?id=1"
}, },
], ],
// 应急指挥 // 应急指挥
tab3: [{ tab3: [{
icon: "icon_tab5", icon: "icon_yj_1",
name: "应急预案", name: "应急预案",
href: "/pages/emergency/y-a/index/index", href: "/pages/emergency/y-a/index/index",
}, },
{ {
icon: "icon_tab5", icon: "icon_yj_2",
name: "事件上报", name: "事件上报",
href: "/pages/emergency/s-b/index/index" href: "/pages/emergency/s-b/index/index"
}, },
{ {
icon: "icon_tab5", icon: "icon_yj_3",
name: "应急通讯录", name: "应急通讯录",
href: "/pages/emergency/t-x/index/index" href: "/pages/emergency/t-x/index/index"
}, },

View File

@ -6,13 +6,6 @@ Page({
logs: [] logs: []
}, },
onLoad() { onLoad() {
this.setData({
logs: (wx.getStorageSync('logs') || []).map(log => { },
return {
date: util.formatTime(new Date(log)),
timeStamp: log
}
})
})
}
}) })

View File

@ -1,6 +1,4 @@
<!--logs.wxml--> <!--logs.wxml-->
<view class="container log-list"> <view class="container log-list">
<block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log"> <text class="log-item">{{s}}</text>
<text class="log-item">{{index + 1}}. {{log.date}}</text>
</block>
</view> </view>

View File

@ -56,7 +56,7 @@ Page({
*/ */
getList: function () { getList: function () {
const time = this.data.currentIndex == 0 ? formatTime(new Date(), '-') : this.data.dateFilter const time = this.data.currentIndex == 0 ? formatTime(new Date(), '-') : this.data.dateFilter
app.axios("GET", "app", "/work/sendWorkPage", { app.axios("GET", "app", "/work/wkDynamicsPage", {
page: this.data.page, page: this.data.page,
limit: this.data.pageSize, limit: this.data.pageSize,
startTime: time, startTime: time,
@ -109,6 +109,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.data.page = 1;
this.getList(); this.getList();
}, },

View File

@ -1,207 +0,0 @@
// pages/task/check/index/index.js
import * as echarts from '../../../../ec-canvas/echarts';
let chart = null;
const app = getApp()
/**
* 获取像素比
*/
const getPixelRatio = () => {
let pixelRatio = 0
wx.getSystemInfo({
success: function (res) {
pixelRatio = res.pixelRatio
},
fail: function () {
pixelRatio = 0
}
})
return pixelRatio
}
/**
* 设置echarts
*/
function initChart(data) {
if (chart == null) return
chart.init((canvas, width, height) => {
var dpr = getPixelRatio();
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr
});
canvas.setChart(chart);
const option = {
angleAxis: {
show: false,
max: (100 * 360) / 180, //-45度到225度二者偏移值是270度除360度
type: "value",
startAngle: 180, //极坐标初始角度
splitLine: {
show: false,
},
},
barMaxWidth: 10, //圆环宽度
radiusAxis: {
show: false,
type: "category",
},
//圆环位置和大小
polar: {
center: ["50%", "80%"],
radius: "250%",
},
series: [{
type: "bar",
data: [{
//上层圆环,显示数据
value: 50,
itemStyle: {
color: "#0062FF",
},
}, ],
barGap: "-100%", //柱间距离,上下两层圆环重合
coordinateSystem: "polar",
roundCap: true, //顶端圆角
z: 3, //圆环层级同zindex
},
{
//下层圆环,显示最大值
type: "bar",
data: [{
value: 100,
itemStyle: {
color: "#EBEDF0",
borderWidth: 0,
},
}, ],
barGap: "-100%",
coordinateSystem: "polar",
roundCap: true,
z: 1,
},
//仪表盘
{
type: "gauge",
axisLine: {
show: false,
},
splitLine: {
show: false,
},
axisTick: {
show: false,
},
axisLabel: {
show: false,
},
splitLabel: {
show: false,
},
pointer: false,
detail: {
formatter: function () {
return `{number|${50 + "%\n"}}{wcl|完成进度}`;
},
rich: {
number: {
fontSize: 18,
textAlign: "center",
color: "#202229",
fontWeight: "bolder",
},
wcl: {
fontSize: 12,
textAlign: "center",
color: "#606977",
},
},
color: "#fff",
offsetCenter: ["0", "20"],
},
title: {
show: false,
},
data: [{
value: 50,
}, ],
},
],
};
chart.clear();
chart.setOption(option);
return chart;
})
}
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
chart = this.selectComponent('#d-chart')
initChart({})
this.setData(this.data)
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

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

View File

@ -1,42 +0,0 @@
<!--pages/task/check/index/index.wxml-->
<title-bar title="专项任务"></title-bar>
<scroll-view scroll-y style="height: calc(100vh - {{topBarH}}px);">
<!-- 基本信息 -->
<view class="item-bg">
<view class="item">
<view class="h-div v-center content">
<text class="single"></text>
<text class="lab">基本信息</text>
</view>
<view class="h-div content">
<text class="lab">任务周期:</text>
<text class="val">2022-09-15至2022-09-20</text>
</view>
<view class="h-div content">
<text class="lab">发布时间:</text>
<text class="val">2022-09-15</text>
</view>
<view class="h-div content">
<text class="lab">发布人:</text>
<text class="val">某某人</text>
</view>
<view class="h-div" style="margin-top: 15rpx;">
<text class="lab">事项内容:</text>
<text class="val flex">关于某某某某某某某某某某某项工作的任务要求,关于某某某某某某某某工作的任务要求。</text>
</view>
</view>
</view>
<!-- 统计 -->
<view class="item-bg">
<view class="item v-div">
<view class="h-div v-center">
<text class="single"></text>
<text class="lab">完成进度</text>
</view>
<view class="h-div h-center">
<ec-canvas id="d-chart" canvas-id="d-chart" ec="{{ ec }}" class="charts flex"></ec-canvas>
</view>
</view>
</view>
<view class="space"></view>
</scroll-view>

View File

@ -1,77 +0,0 @@
/* pages/task/check/index/index.wxss */
.item-bg {
padding: 20rpx 20rpx 0rpx 20rpx;
background-color: #f5f5f5;
}
.item {
background: #FFFFFF;
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
border-radius: 12rpx;
padding: 16rpx;
}
.item .content {
padding: 15rpx 0;
border-bottom: 1rpx dashed #f5f5f5;
}
.item .file::before {
display: block;
content: ' ';
width: 20rpx;
height: 20rpx;
margin-right: 20rpx;
border-radius: 50%;
background-color: var(--blue);
}
.item .lab {
font-size: 28rpx;
font-weight: bold;
color: #222222;
}
.item .val {
font-size: 28rpx;
color: #222222;
}
.item .cloud {
width: 40rpx;
height: 40rpx;
margin-left: 20rpx;
}
.item .people {
width: calc((100vw - 120rpx) / 4);
margin-top: 20rpx;
}
.item .people .avatar {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
background-color: #f5f5f5;
}
.item .people .name {
font-size: 28rpx;
font-weight: bold;
color: #222222;
}
.item .single {
width: 8rpx;
height: 34rpx;
background: #4882EE;
border-radius: 4rpx;
margin-right: 10rpx;
}
.item-bg .charts {
width: 280rpx;
height: 200rpx;
margin-right: 30rpx;
margin-top: 30rpx;
}

View File

@ -16,11 +16,19 @@ Page({
lab: '已办事项', lab: '已办事项',
val: 1 val: 1
}], }],
list: [{
type: 0 page: 1,
}, { pageSize: 10,
type: 1 list: []
}] },
/**
* 输入内容
*/
inputContent: function (e) {
const name = e.currentTarget.dataset.name;
this.data[name] = e.detail.value;
this.refresh();
}, },
/** /**
@ -29,9 +37,56 @@ Page({
tabSelect: function (params) { tabSelect: function (params) {
const index = params.currentTarget.dataset.index; const index = params.currentTarget.dataset.index;
this.data.curTab = index; this.data.curTab = index;
this.data.freshIng = true;
this.setData(this.data) 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 () {
app.axios("GET", "app", "/work/receiveWork", {
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 => {
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)
})
},
/** /**
* 跳转详情 * 跳转详情
*/ */
@ -42,11 +97,26 @@ Page({
}) })
}, },
/**
* 前往上传
*/
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)
}
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.data.curTab = options.id; this.data.curTab = options.id;
this.data.freshIng = true;
this.setData(this.data) this.setData(this.data)
}, },

View File

@ -12,35 +12,38 @@
<view class="cu-bar search"> <view class="cu-bar search">
<view class="search-form round"> <view class="search-form round">
<text class="cuIcon-search"></text> <text class="cuIcon-search"></text>
<input type="text" placeholder="请输入关键字" confirm-type="search"></input> <input bindinput="inputContent" data-name="condition" type="text" placeholder="请输入关键字" confirm-type="search"></input>
</view> </view>
</view> </view>
<view class="filter"> <view class="filter">
<picker mode="date" value="{{dateFilter}}" bindchange="bindDateChange"> <picker mode="date" value="{{dateFilter}}" bindchange="bindDateChange" data-name="startTime">
<view class="picker"> <view class="picker">
开始时间: {{dateFilter}} 开始时间: {{startTime}}
</view> </view>
</picker> </picker>
<view class="line"></view> <view class="line"></view>
<picker mode="date" value="{{dateFilter}}" bindchange="bindDateChange"> <picker mode="date" value="{{dateFilter}}" bindchange="bindDateChange" data-name="endTime">
<view class="picker"> <view class="picker">
结束时间: {{dateFilter}} 结束时间: {{endTime}}
</view> </view>
</picker> </picker>
</view> </view>
<scroll-view refresher-enabled scroll-y style="height: calc(100vh - 280rpx - {{topBarH}}px);"> <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="{{list}}"> <view class="item-bg" wx:for="{{list}}">
<view catchtap="toDetail" data-item="{{item}}" class="item"> <view class="item">
<view class="head h-div v-center"> <view class="head h-div v-center">
<view class="single"></view> <view class="single"></view>
<view wx:if="{{item.type == 0}}" class="title ellipsis">常规工作</view> <view class="title ellipsis flex">{{item.typeName}}</view>
<view wx:if="{{item.type == 1}}" class="title ellipsis">督办工作</view> <view catchtap="toUp" data-item="{{item}}" data-detail="{{0}}" class="done" wx:if="{{item.workState !=3}}">前往完成</view>
</view> <view catchtap="toUp" data-item="{{item}}" data-detail="{{1}}" class="done" wx:else>查看详情</view>
<view class="tv">关于某某某某某某某某某某某项工作的任务要求,关于某某某某某某某某工作的任务要求。
</view> </view>
<view class="tv">{{item.title}}</view>
<view class="time">任务周期:{{item.startTime}} 至 {{item.endTime}}</view>
<view class="time">接收时间:{{item.createTime}}</view>
<image class="bottom-img" src="/images/task/icon-bottom-line.png" mode="aspectFill" /> <image class="bottom-img" src="/images/task/icon-bottom-line.png" mode="aspectFill" />
</view> </view>
</view> </view>
<empty wx:if="{{list.length==0}}" />
<view class="space"></view> <view class="space"></view>
</scroll-view> </scroll-view>

View File

@ -82,10 +82,23 @@ page {
} }
.item .tv { .item .tv {
font-size: 28rpx; font-size: 32rpx;
font-weight: 500;
color: #222222; color: #222222;
padding-top: 20rpx; 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 { .item .bottom {

View File

@ -0,0 +1,262 @@
// 上报动态
import Utils from "../../../../utils/util"
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
baseUrl: app.FILE_SERVER_URL,
dateFilter: Utils.formatTime(new Date(), '-'),
showTypePop: false,
showTaskPop: false,
TypeData: [],
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)
},
/**
* 显示/关闭弹窗
*/
popModal: function (params) {
const type = params.currentTarget.dataset.type;
this.data[type] = !this.data[type];
this.setData(this.data)
},
/**
* 通知类型
*/
typeChange: function (params) {
const index = params.currentTarget.dataset.index;
this.data.postData.type = index + 1;
this.data.postData.typeId = this.data.TypeData[index].typeId;
this.data.showTypePop = false;
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)
}
})
},
/**
* 获取工作类型
*/
getType: function () {
app.axios("GET", "app", "/work/wkTypes", {
classify: 2
}).then(res => {
if (res.code == 1) {
this.data.TypeData = res.data;
this.setData(this.data)
}
})
},
/**
* 上传图片
*/
postImg(filePath) {
wx.showLoading({
title: '文件上传中...',
})
app.uploadFile(this.data.detail.wkUserId, app.FileType.resumptionAcs, filePath).then(res => {
wx.hideLoading();
this.getFiles();
})
},
/**
* 获取图片
*/
getFiles: function () {
app.axios("GET", "common", "/upload/getFile", {
otcid: this.data.detail.wkUserId,
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.wkUserId = this.data.detail.wkUserId;
if (!this.data.postData.workContent) {
wx.showToast({
title: '请输入内容',
icon: 'none'
})
return
}
if (!this.data.postData.completionTime) {
wx.showToast({
title: '请设置时间',
icon: 'none'
})
return
}
app.axios("POST", "app", "/work/receiveWorkComplete", this.data.postData).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
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.data.readonly = options.detail == 1;
const eventChannel = this.getOpenerEventChannel()
eventChannel.on('getItem', (item) => {
this.data.detail = item;
if (this.data.readonly) this.data.postData = item;
this.setData(this.data)
this.getFiles();
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,6 @@
{
"usingComponents": {
"tree": "/components/tree/index"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,71 @@
<!--pages/msg/push/index.wxml-->
<title-bar title="任务内容{{readonly?'详情':'上报'}}"></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>
<input disabled value="{{detail.title}}" class="put v-div h-center" placeholder="-"></input>
<!-- 类型 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">任务类型</text>
</view>
<input disabled class="put v-div h-center" placeholder="-" value="{{detail.typeName}}"></input>
<!-- 任务周期 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">任务周期</text>
</view>
<view class="filter">
<picker mode="date" disabled>
<view class="picker">
开始时间: {{detail.startTime||'-'}}
</view>
</picker>
<picker mode="date" disabled>
<view class="picker">
结束时间: {{detail.endTime||'-'}}
</view>
</picker>
</view>
</view>
<view class="item">
<!-- 内容 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">完成情况</text>
</view>
<textarea disabled="{{readonly}}" bindinput="inputContent" data-name="workContent" value="{{postData.workContent}}" 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 disabled="{{readonly}}" mode="date" value="{{postData.completionTime}}" data-name="completionTime" bindchange="bindDateChange">
<view class="picker" style="width: 90vw;">
选择时间: {{postData.completionTime||'-'}}
</view>
</picker>
</view>
<!-- 附件 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title flex">附件</text>
<text wx:if="{{!readonly}}" 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="{{!readonly}}" 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="{{!readonly}}">
<view catchtap="push" class="btn">上报</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);
}

View File

@ -25,7 +25,6 @@ Page({
const name = params.currentTarget.dataset.name; const name = params.currentTarget.dataset.name;
this.data.postData[name] = params.detail.value; this.data.postData[name] = params.detail.value;
this.setData(this.data) this.setData(this.data)
console.info(this.data.postData)
}, },
/** /**
@ -85,7 +84,7 @@ Page({
*/ */
getType: function () { getType: function () {
app.axios("GET", "app", "/work/wkTypes", { app.axios("GET", "app", "/work/wkTypes", {
classify: 1 classify: 2
}).then(res => { }).then(res => {
if (res.code == 1) { if (res.code == 1) {
this.data.TypeData = res.data; this.data.TypeData = res.data;
@ -150,8 +149,7 @@ Page({
*/ */
push: function () { push: function () {
this.data.postData.userId = app.globalData.userInfo.userId; this.data.postData.userId = app.globalData.userInfo.userId;
this.data.postData.workId = this.data.uuid; this.data.postData.dynamicsId = this.data.uuid;
this.data.postData.listperformid = '';
if (!this.data.postData.title) { if (!this.data.postData.title) {
wx.showToast({ wx.showToast({
title: '请输入工作标题', title: '请输入工作标题',
@ -180,7 +178,7 @@ Page({
}) })
return return
} }
app.axios("POST", "app", "/work/workAdd", this.data.postData).then(res => { app.axios("POST", "app", "/work/wkDynamicsAdd", this.data.postData).then(res => {
if (res.code == 1) { if (res.code == 1) {
wx.showToast({ wx.showToast({
title: '发布成功', title: '发布成功',

View File

@ -19,7 +19,7 @@
<text class="single"></text> <text class="single"></text>
<text class="title">工作内容</text> <text class="title">工作内容</text>
</view> </view>
<textarea bindinput="inputContent" data-name="content" value="{{postData.content}}" style="color: #333333;" class="put v-div" placeholder="请输入工作内容"></textarea> <textarea bindinput="inputContent" data-name="detail" value="{{postData.detail}}" style="color: #333333;" class="put v-div" placeholder="请输入工作内容"></textarea>
<!-- 时间 --> <!-- 时间 -->
<view class="h-div v-center header"> <view class="h-div v-center header">
<text class="single"></text> <text class="single"></text>
@ -37,12 +37,6 @@
</view> </view>
</picker> </picker>
</view> </view>
<!-- 关闭任务 -->
<view class="h-div v-center header">
<text class="single"></text>
<text class="title">关闭任务</text>
</view>
<input catchtap="popTaskModal" data-type="showTaskPop" disabled class="put v-div h-center" placeholder="请选择"></input>
<!-- 附件 --> <!-- 附件 -->
<view class="h-div v-center header"> <view class="h-div v-center header">
<text class="single"></text> <text class="single"></text>
@ -62,7 +56,7 @@
<view catchtap="push" class="btn">上报</view> <view catchtap="push" class="btn">上报</view>
</view> </view>
<!-- 选择通知类型 --> <!-- 选择工作类型 -->
<view class="cu-modal {{showTypePop?'show':''}}"> <view class="cu-modal {{showTypePop?'show':''}}">
<view class="cu-dialog pop" catchtap> <view class="cu-dialog pop" catchtap>
<view class="cu-bar justify-end pop-header"> <view class="cu-bar justify-end pop-header">
@ -82,23 +76,3 @@
</radio-group> </radio-group>
</view> </view>
</view> </view>
<!-- 选择任务 -->
<view class="cu-modal {{showTaskPop?'show':''}}">
<view class="cu-dialog pop" catchtap>
<view class="cu-bar justify-end pop-header">
<view class="content">选择需要完成的任务</view>
<view class="action" catchtap="popTaskModal" data-type="showTaskPop">
<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.typeName}}</view>
</label>
</view>
</view>
</radio-group>
</view>
</view>