Browse Source

小程序代码提交

miaofuhao 3 months ago
parent
commit
48a2b3052b

+ 1 - 1
bigScreen3/.env.production

@@ -1,5 +1,5 @@
1 1
 # 页面标题
2
-VITE_APP_TITLE = 智能客服中心
2
+VITE_APP_TITLE = 河南中林智慧平台
3 3
 
4 4
 # 生产环境配置
5 5
 VITE_APP_ENV = 'production'

+ 1 - 1
bigScreen3/src/views/login.vue

@@ -2,7 +2,7 @@
2 2
   <div class="login" :style="`background-image: url(${backgroundImage});`">
3 3
     <el-form ref="loginFormRef" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
4 4
       <h3 class="title">
5
-        焦作市智慧园林
5
+        河南中林智慧平台
6 6
       </h3>
7 7
       <el-form-item prop="fUsercode">
8 8
         <el-input v-model="loginForm.fUsercode" type="text" auto-complete="off" placeholder="账号">

+ 224 - 167
wxproject/packageA/pages/createReport/createReport.js

@@ -5,15 +5,24 @@ Page({
5 5
    * 页面的初始数据
6 6
    */
7 7
   data: {
8
-    reportType: 'daily', // 填报类型:daily-日报, weekly-周报
9 8
     id: '', // 编辑时的ID
10
-    title: '',
11
-    date: '', // 日报日期
12
-    weekStartDate: '', // 周报开始日期
13
-    weekEndDate: '', // 周报结束日期
14
-    content: '',
9
+    team: '', // 管养班组
10
+    number: '', // 人数
11
+    type: '1', // 类型:1日2周3月
12
+    workStartTime: '', // 工作开始时间
13
+    workEndTime: '', // 工作结束时间
14
+    workContent: [ // 工作内容列表
15
+      {
16
+        content: '', // 工作内容
17
+        location: '', // 工作地点
18
+        completion: '', // 完成情况
19
+        remark: '' // 备注
20
+      }
21
+    ],
22
+    unfinishedWork: '', // 未完成工作
15 23
     submitter: '当前用户', // 实际项目中应从登录信息获取
16
-    isSubmitting: false
24
+    isSubmitting: false,
25
+    pageMode: 'normal' // 页面模式:normal(正常编辑), view(只读查看)
17 26
   },
18 27
 
19 28
   // 标题输入
@@ -23,204 +32,248 @@ Page({
23 32
     });
24 33
   },
25 34
 
26
-  // 选择填报类型
27
-  selectReportType(e) {
28
-    const type = e.currentTarget.dataset.type;
29
-    // 确保值确实发生了变化才执行操作
30
-    if (type !== this.data.reportType) {
31
-      this.setData({
32
-        reportType: type
33
-      });
34
-      
35
-      // 类型切换时可以添加一些重置逻辑(如果需要)
36
-      // 例如:当从日报切换到周报时,可以根据日报日期计算默认的周日期范围
37
-      if (type === 'weekly' && this.data.date) {
38
-        // 这里可以根据日报日期计算周报的开始和结束日期
39
-        // 这里仅作为示例,实际应用中可能需要更复杂的日期计算逻辑
40
-      }
41
-    }
35
+  // 管养班组输入
36
+  onTeamInput(e) {
37
+    this.setData({
38
+      team: e.detail.value
39
+    });
42 40
   },
43 41
 
44
-  // 日报日期选择
45
-  onDateChange(e) {
42
+  // 人数输入
43
+  onNumberInput(e) {
46 44
     this.setData({
47
-      date: e.detail.value
45
+      number: e.detail.value
48 46
     });
49 47
   },
50 48
 
51
-  // 周报开始日期选择
52
-  onWeekStartDateChange(e) {
53
-    const startDate = e.detail.value;
54
-    // 如果结束日期早于开始日期,则清空结束日期
55
-    if (this.data.weekEndDate && this.data.weekEndDate < startDate) {
49
+  // 选择类型
50
+  selectType(e) {
51
+    const type = e.currentTarget.dataset.type;
52
+    this.setData({
53
+      type: type
54
+    });
55
+  },
56
+
57
+  // 工作开始时间选择
58
+  onWorkStartTimeChange(e) {
59
+    const startTime = e.detail.value;
60
+    // 如果结束时间早于开始时间,则清空结束时间
61
+    if (this.data.workEndTime && this.data.workEndTime < startTime) {
56 62
       this.setData({
57
-        weekStartDate: startDate,
58
-        weekEndDate: ''
63
+        workStartTime: startTime,
64
+        workEndTime: ''
59 65
       });
60 66
     } else {
61 67
       this.setData({
62
-        weekStartDate: startDate
68
+        workStartTime: startTime
63 69
       });
64 70
     }
65 71
   },
66 72
 
67
-  // 周报结束日期选择
68
-  onWeekEndDateChange(e) {
73
+  // 工作结束时间选择
74
+  onWorkEndTimeChange(e) {
75
+    this.setData({
76
+      workEndTime: e.detail.value
77
+    });
78
+  },
79
+
80
+  // 工作内容输入
81
+  onWorkContentInput(e) {
82
+    const index = e.currentTarget.dataset.index;
83
+    const field = e.currentTarget.dataset.field;
84
+    const value = e.detail.value;
85
+    
86
+    const workContent = this.data.workContent;
87
+    workContent[index][field] = value;
88
+    
89
+    this.setData({
90
+      workContent: workContent
91
+    });
92
+  },
93
+
94
+  // 添加工作内容
95
+  addWorkContent() {
96
+    const workContent = this.data.workContent;
97
+    workContent.push({
98
+      content: '',
99
+      location: '',
100
+      completion: '',
101
+      remark: ''
102
+    });
103
+    
69 104
     this.setData({
70
-      weekEndDate: e.detail.value
105
+      workContent: workContent
71 106
     });
72 107
   },
73 108
 
74
-  // 内容输入
75
-  onContentInput(e) {
109
+  // 删除工作内容
110
+  deleteWorkContent(e) {
111
+    const index = e.currentTarget.dataset.index;
112
+    const workContent = this.data.workContent;
113
+    
114
+    if (workContent.length > 1) {
115
+      workContent.splice(index, 1);
116
+      this.setData({
117
+        workContent: workContent
118
+      });
119
+    } else {
120
+      wx.showToast({ 
121
+        title: '至少保留一项工作内容', 
122
+        icon: 'none' 
123
+      });
124
+    }
125
+  },
126
+
127
+  // 未完成工作输入
128
+  onUnfinishedWorkInput(e) {
76 129
     this.setData({
77
-      content: e.detail.value
130
+      unfinishedWork: e.detail.value
78 131
     });
79 132
   },
80 133
 
81 134
   // 提交报表
82 135
   async submitReport() {
136
+    // 如果是查看模式,不允许提交
137
+    if (this.data.pageMode === 'view') {
138
+      return;
139
+    }
140
+    
83 141
     // 表单验证
84
-    if (!this.data.title) {
85
-      wx.showToast({ title: '请输入标题', icon: 'none' });
142
+    
143
+    if (!this.data.team) {
144
+      wx.showToast({ title: '请输入管养班组', icon: 'none' });
86 145
       return;
87 146
     }
88 147
     
89
-    // 根据类型进行日期验证
90
-    if (this.data.reportType === 'daily') {
91
-      if (!this.data.date) {
92
-        wx.showToast({ title: '请选择日期', icon: 'none' });
93
-        return;
94
-      }
95
-    } else if (this.data.reportType === 'weekly') {
96
-      if (!this.data.weekStartDate) {
97
-        wx.showToast({ title: '请选择开始日期', icon: 'none' });
98
-        return;
99
-      }
100
-      if (!this.data.weekEndDate) {
101
-        wx.showToast({ title: '请选择结束日期', icon: 'none' });
102
-        return;
103
-      }
148
+    if (!this.data.number || parseInt(this.data.number) <= 0) {
149
+      wx.showToast({ title: '请输入有效的人数', icon: 'none' });
150
+      return;
104 151
     }
105 152
     
106
-    if (!this.data.content) {
107
-      wx.showToast({ title: '请输入内容', icon: 'none' });
153
+    if (!this.data.workStartTime) {
154
+      wx.showToast({ title: '请选择工作开始时间', icon: 'none' });
155
+      return;
156
+    }
157
+    
158
+    if (!this.data.workEndTime) {
159
+      wx.showToast({ title: '请选择工作结束时间', icon: 'none' });
160
+      return;
161
+    }
162
+    
163
+    // 验证工作内容
164
+    const hasValidWorkContent = this.data.workContent.some(item => 
165
+      item.content && item.location && item.completion
166
+    );
167
+    if (!hasValidWorkContent) {
168
+      wx.showToast({ title: '请至少填写一项完整的工作内容', icon: 'none' });
108 169
       return;
109 170
     }
110 171
 
111 172
     this.setData({ isSubmitting: true });
173
+
174
+    
112 175
     try {
113
-      // 根据类型构建不同的数据结构
176
+      // 构建接口所需的数据结构
114 177
       let data = {
115 178
         id: this.data.id,
116
-        title: this.data.title,
117
-        content: this.data.content,
118
-        type: this.data.reportType === 'daily' ? '日报' : '周报',
119
-        rawType: this.data.reportType,
179
+        team: this.data.team,
180
+        number: parseInt(this.data.number),
181
+        type: parseInt(this.data.type),
182
+        workStartTime: this.data.workStartTime + ' 00:00:00',
183
+        workEndTime: this.data.workEndTime + ' 23:59:59',
184
+        workContent: JSON.stringify(this.data.workContent),
185
+        unfinishedWork: this.data.unfinishedWork,
120 186
         submitter: this.data.submitter
121 187
       };
188
+      console.log('提交数据', data);
122 189
       
123
-      // 根据类型设置日期相关字段
124
-      if (this.data.reportType === 'daily') {
125
-        data.date = this.data.date;
126
-        data.displayDate = this.data.date;
127
-      } else if (this.data.reportType === 'weekly') {
128
-        data.date = this.data.weekStartDate + '至' + this.data.weekEndDate;
129
-        data.weekStartDate = this.data.weekStartDate;
130
-        data.weekEndDate = this.data.weekEndDate;
131
-        data.displayDate = this.data.weekStartDate + '至' + this.data.weekEndDate;
190
+      let res;
191
+      // 根据是否有id判断是新增还是编辑
192
+      if (this.data.id) {
193
+        // 编辑模式 - 使用update接口
194
+        res = await app.sendRequest('put', '/t-work-report/updateWorkReportBase', data);
195
+      } else {
196
+        // 新增模式 - 使用save接口
197
+        res = await app.sendRequest('post', '/t-work-report/saveWorkReportBase', data);
132 198
       }
133 199
       
134
-      // 这里模拟请求,实际需要替换为真实接口
135
-      // let url = this.data.id ? '/report/updateReport' : '/report/createReport';
136
-      // let res = await app.sendRequest('post', url, { data });
137
-      // if (res.status == 200) {
138
-      //   wx.showToast({ title: '保存成功' });
139
-      //   setTimeout(() => {
140
-      //     wx.navigateBack();
141
-      //   }, 1500);
142
-      // }
143
-
144
-      // 模拟保存成功
145
-      setTimeout(() => {
146
-        wx.showToast({ title: '保存成功' });
200
+      if (res.status == 200) {
201
+        wx.showToast({ title: this.data.id ? '更新成功' : '保存成功' });
147 202
         setTimeout(() => {
148 203
           wx.navigateBack();
149 204
         }, 1500);
150
-      }, 1000);
205
+      } else {
206
+        wx.showToast({ title: res.message || '操作失败', icon: 'none' });
207
+      }
151 208
     } catch (error) {
152
-      console.log('保存失败', error);
153
-      wx.showToast({ title: '保存失败', icon: 'none' });
209
+      console.log('操作失败', error);
210
+      wx.showToast({ title: '操作失败', icon: 'none' });
154 211
     } finally {
155 212
       this.setData({ isSubmitting: false });
156 213
     }
157 214
   },
215
+  
158 216
 
159
-  // 获取报表详情(编辑时使用)
217
+  // 获取报表详情(编辑或查看时使用)
160 218
   async getReportDetail() {
161 219
     if (!this.data.id) return;
162 220
     
163 221
     try {
164
-      let data = { id: this.data.id };
165
-      // 这里模拟请求,实际需要替换为真实接口
166
-      // let res = await app.sendRequest('post', '/report/selectReportDetail', { data });
167
-      // if (res.status == 200) {
168
-      //   // 根据类型设置不同的日期字段
169
-      //   if (res.data.rawType === 'daily' || res.data.type === '日报') {
170
-      //     this.setData({
171
-      //       title: res.data.title,
172
-      //       date: res.data.date,
173
-      //       content: res.data.content,
174
-      //       submitter: res.data.submitter,
175
-      //       reportType: 'daily'
176
-      //     });
177
-      //   } else if (res.data.rawType === 'weekly' || res.data.type === '周报') {
178
-      //     // 处理周报的日期范围
179
-      //     let weekStartDate = '';
180
-      //     let weekEndDate = '';
181
-      //     if (res.data.weekStartDate && res.data.weekEndDate) {
182
-      //       weekStartDate = res.data.weekStartDate;
183
-      //       weekEndDate = res.data.weekEndDate;
184
-      //     } else if (res.data.date && res.data.date.includes('至')) {
185
-      //       const dateParts = res.data.date.split('至');
186
-      //       weekStartDate = dateParts[0];
187
-      //       weekEndDate = dateParts[1];
188
-      //     }
189
-      //     this.setData({
190
-      //       title: res.data.title,
191
-      //       weekStartDate: weekStartDate,
192
-      //       weekEndDate: weekEndDate,
193
-      //       content: res.data.content,
194
-      //       submitter: res.data.submitter,
195
-      //       reportType: 'weekly'
196
-      //     });
197
-      //   }
198
-      // }
199
-
200
-      // 模拟数据 - 处理类型数据
201
-      setTimeout(() => {
202
-        const isDaily = this.data.type === 0;
203
-        const reportDetail = {
204
-          id: this.data.id,
205
-          title: isDaily ? '编辑日报标题' : '编辑周报标题',
206
-          content: '这是编辑中的内容...',
207
-          date: isDaily ? '2024-01-20' : '2024-01-15至2024-01-21',
208
-          submitter: '张三',
209
-          type: isDaily ? 'daily' : 'weekly', // 原始类型标识
210
-          displayDate: isDaily ? '2024-01-20' : '2024-01-15至2024-01-21'
211
-        };
222
+      // 对接获取详情接口 - GET请求
223
+      let res = await app.sendRequest('get', `/t-work-report/${this.data.id}`, {});
224
+      
225
+      if (res.status == 200) {
226
+        const reportDetail = res.data;
227
+        
228
+        // 处理工作内容(可能是JSON字符串)
229
+        let workContent = reportDetail.workContent;
230
+        try {
231
+          if (typeof workContent === 'string') {
232
+            workContent = JSON.parse(workContent);
233
+          }
234
+          if (!Array.isArray(workContent)) {
235
+            workContent = [{
236
+              content: '',
237
+              location: '',
238
+              completion: '',
239
+              remark: ''
240
+            }];
241
+          }
242
+        } catch (error) {
243
+          console.log('解析工作内容失败', error);
244
+          workContent = [{
245
+            content: '',
246
+            location: '',
247
+            completion: '',
248
+            remark: ''
249
+          }];
250
+        }
251
+        
252
+        // 处理日期格式
253
+        let workStartTime = reportDetail.workStartTime;
254
+        let workEndTime = reportDetail.workEndTime;
255
+        if (workStartTime && workStartTime.includes(' ')) {
256
+          workStartTime = workStartTime.split(' ')[0];
257
+        }
258
+        if (workEndTime && workEndTime.includes(' ')) {
259
+          workEndTime = workEndTime.split(' ')[0];
260
+        }
212 261
         
213 262
         this.setData({
214 263
           title: reportDetail.title,
215
-          content: reportDetail.content,
216
-          date: reportDetail.date,
217
-          submitter: reportDetail.submitter,
218
-          // 添加类型标识
219
-          rawType: reportDetail.type
264
+          team: reportDetail.team || '',
265
+          number: reportDetail.number ? String(reportDetail.number) : '',
266
+          type: reportDetail.type ? String(reportDetail.type) : '1',
267
+          workStartTime: workStartTime || '',
268
+          workEndTime: workEndTime || '',
269
+          workContent: workContent,
270
+          unfinishedWork: reportDetail.unfinishedWork || '',
271
+          submitter: reportDetail.submitter || '当前用户'
220 272
         });
221
-      }, 500);
273
+      }
222 274
     } catch (error) {
223 275
       console.log('获取详情失败', error);
276
+      wx.showToast({ title: '获取详情失败', icon: 'none' });
224 277
     }
225 278
   },
226 279
 
@@ -228,30 +281,41 @@ Page({
228 281
    * 生命周期函数--监听页面加载
229 282
    */
230 283
   onLoad: function(options) {
284
+    // 判断页面模式
285
+    if (options.view === 'true') {
286
+      this.setData({ pageMode: 'view' });
287
+      // 设置导航栏标题为查看模式
288
+      wx.setNavigationBarTitle({
289
+        title: '报表详情'
290
+      });
291
+    }
292
+    
231 293
     // 如果从列表页传入了类型参数,使用传入的类型
232 294
     if (options.type !== undefined) {
233
-      // 设置报表类型(daily或weekly)
234 295
       this.setData({
235
-        reportType: options.type === '1' || options.type === 'weekly' ? 'weekly' : 'daily'
296
+        type: options.type
236 297
       });
237
-      // 设置页面标题
238
-      wx.setNavigationBarTitle({
239
-        title: this.data.reportType === 'daily' ? '新增日报' : '新增周报'
240
-      });
241
-    } else {
242
-      // 默认设置为日报
243
-      this.setData({ reportType: 'daily' });
244 298
     }
245 299
     
246 300
     if (options.id) {
247 301
       this.setData({ 
248 302
         id: options.id
249 303
       });
250
-      wx.setNavigationBarTitle({
251
-        title: '编辑报表'
252
-      });
304
+      
305
+      // 如果不是查看模式,则设置为编辑模式
306
+      if (this.data.pageMode !== 'view') {
307
+        wx.setNavigationBarTitle({
308
+          title: '编辑报表'
309
+        });
310
+      }
311
+      
253 312
       this.getReportDetail();
254 313
     } else {
314
+      // 设置页面标题
315
+      wx.setNavigationBarTitle({
316
+        title: '新增工作报表'
317
+      });
318
+      
255 319
       // 新增时自动设置当前日期
256 320
       const now = new Date();
257 321
       const year = now.getFullYear();
@@ -259,17 +323,10 @@ Page({
259 323
       const day = now.getDate().toString().padStart(2, '0');
260 324
       const today = `${year}-${month}-${day}`;
261 325
       
262
-      // 根据类型设置不同的日期字段
263
-      if (this.data.reportType === 'daily') {
264
-        this.setData({ date: today });
265
-      } else {
266
-        // 计算本周结束日期
267
-        const endDay = Math.min(day + 6, new Date(year, month, 0).getDate());
268
-        this.setData({
269
-          weekStartDate: today,
270
-          weekEndDate: `${year}-${month}-${endDay.toString().padStart(2, '0')}`
271
-        });
272
-      }
326
+      this.setData({
327
+        workStartTime: today,
328
+        workEndTime: today
329
+      });
273 330
     }
274 331
   }
275 332
 });

+ 134 - 39
wxproject/packageA/pages/createReport/createReport.wxml

@@ -1,74 +1,169 @@
1 1
 <view class="createReport">
2 2
   <!-- 表单容器 -->
3 3
   <view class="form-container">
4
-    <!-- 标题输入 -->
4
+    
5
+    <!-- 管养班组 -->
5 6
     <view class="form-item">
6
-      <view class="form-label">标题 *</view>
7
-      <input 
7
+      <view class="form-label">管养班组 *</view>
8
+      <input wx:if="{{pageMode !== 'view'}}"
8 9
         class="form-input" 
9
-        placeholder="请输入标题" 
10
-        value="{{title}}" 
11
-        bindinput="onTitleInput"
10
+        placeholder="请输入管养班组" 
11
+        value="{{team}}" 
12
+        bindinput="onTeamInput"
12 13
       />
14
+      <view wx:else class="readonly-info">
15
+        <text class="readonly-text">{{team || '-'}}</text>
16
+      </view>
13 17
     </view>
14 18
     
15
-    <!-- 填报类型选择 -->
19
+    <!-- 人数 -->
16 20
     <view class="form-item">
17
-      <view class="form-label">填报类型 *</view>
18
-      <view class="radio-group">
21
+      <view class="form-label">人数 *</view>
22
+      <input wx:if="{{pageMode !== 'view'}}"
23
+        class="form-input" 
24
+        type="number" 
25
+        placeholder="请输入人数" 
26
+        value="{{number}}" 
27
+        bindinput="onNumberInput"
28
+      />
29
+      <view wx:else class="readonly-info">
30
+        <text class="readonly-text">{{number || '-'}}</text>
31
+      </view>
32
+    </view>
33
+    
34
+    <!-- 类型选择 -->
35
+    <view class="form-item">
36
+      <view class="form-label">类型 *</view>
37
+      <view wx:if="{{pageMode !== 'view'}}" class="radio-group">
19 38
         <view class="radio-item">
20
-          <radio value="daily" checked="{{reportType === 'daily'}}" bindtap="selectReportType" data-type="daily" />
39
+          <radio value="1" checked="{{type === '1'}}" bindtap="selectType" data-type="1" />
21 40
           <text class="radio-text">日报</text>
22 41
         </view>
23 42
         <view class="radio-item">
24
-          <radio value="weekly" checked="{{reportType === 'weekly'}}" bindtap="selectReportType" data-type="weekly" />
43
+          <radio value="2" checked="{{type === '2'}}" bindtap="selectType" data-type="2" />
25 44
           <text class="radio-text">周报</text>
26 45
         </view>
46
+        <view class="radio-item">
47
+          <radio value="3" checked="{{type === '3'}}" bindtap="selectType" data-type="3" />
48
+          <text class="radio-text">月报</text>
49
+        </view>
50
+      </view>
51
+      <view wx:else class="readonly-info">
52
+        <text class="readonly-text">{{type === '1' ? '日报' : type === '2' ? '周报' : '月报'}}</text>
27 53
       </view>
28 54
     </view>
29 55
     
30
-    <!-- 日期输入 - 日报 -->
31
-    <view class="form-item" wx:if="{{reportType === 'daily'}}">
32
-      <view class="form-label">日期 *</view>
33
-      <picker mode="date" value="{{date}}" start="2020-01-01" end="2100-12-31" bindchange="onDateChange">
34
-        <view class="form-input picker-input">{{date || '请选择日期'}}</view>
56
+    <!-- 工作开始时间 -->
57
+    <view class="form-item">
58
+      <view class="form-label">工作开始时间 *</view>
59
+      <picker wx:if="{{pageMode !== 'view'}}" mode="date" value="{{workStartTime}}" start="2020-01-01" end="2100-12-31" bindchange="onWorkStartTimeChange">
60
+        <view class="form-input picker-input">{{workStartTime || '请选择工作开始时间'}}</view>
35 61
       </picker>
62
+      <view wx:else class="readonly-info">
63
+        <text class="readonly-text">{{workStartTime || '-'}}</text>
64
+      </view>
36 65
     </view>
37 66
     
38
-    <!-- 日期输入 - 周报 -->
39
-    <view class="form-item" wx:if="{{reportType === 'weekly'}}">
40
-      <view class="form-label">开始日期 *</view>
41
-      <picker mode="date" value="{{weekStartDate}}" start="2020-01-01" end="2100-12-31" bindchange="onWeekStartDateChange">
42
-        <view class="form-input picker-input">{{weekStartDate || '请选择开始日期'}}</view>
67
+    <!-- 工作结束时间 -->
68
+    <view class="form-item">
69
+      <view class="form-label">工作结束时间 *</view>
70
+      <picker wx:if="{{pageMode !== 'view'}}" mode="date" value="{{workEndTime}}" start="{{workStartTime || '2020-01-01'}}" end="2100-12-31" bindchange="onWorkEndTimeChange">
71
+        <view class="form-input picker-input">{{workEndTime || '请选择工作结束时间'}}</view>
43 72
       </picker>
73
+      <view wx:else class="readonly-info">
74
+        <text class="readonly-text">{{workEndTime || '-'}}</text>
75
+      </view>
44 76
     </view>
45
-    <view class="form-item" wx:if="{{reportType === 'weekly'}}">
46
-      <view class="form-label">结束日期 *</view>
47
-      <picker mode="date" value="{{weekEndDate}}" start="{{weekStartDate || '2020-01-01'}}" end="2100-12-31" bindchange="onWeekEndDateChange">
48
-        <view class="form-input picker-input">{{weekEndDate || '请选择结束日期'}}</view>
49
-      </picker>
77
+    
78
+    <!-- 工作内容 -->
79
+    <view class="form-item">
80
+      <view class="form-label">工作内容 *</view>
81
+      <view class="work-content-list">
82
+        <view wx:for="{{workContent}}" wx:key="index" class="work-content-item">
83
+          <view class="content-header">
84
+            <text class="content-title">第{{index + 1}}项工作</text>
85
+            <view wx:if="{{pageMode !== 'view' && workContent.length > 1}}" class="delete-btn" bindtap="deleteWorkContent" data-index="{{index}}">删除</view>
86
+          </view>
87
+          <textarea wx:if="{{pageMode !== 'view'}}"
88
+            class="form-textarea" 
89
+            placeholder="请输入工作内容" 
90
+            value="{{item.content}}" 
91
+            bindinput="onWorkContentInput" 
92
+            data-index="{{index}}" 
93
+            data-field="content"
94
+            auto-height
95
+            maxlength="1000"
96
+          />
97
+          <view wx:else class="readonly-info">
98
+            <text class="readonly-text">{{item.content || '-'}}</text>
99
+          </view>
100
+          <input wx:if="{{pageMode !== 'view'}}"
101
+            class="form-input" 
102
+            placeholder="请输入工作地点" 
103
+            value="{{item.location}}" 
104
+            bindinput="onWorkContentInput" 
105
+            data-index="{{index}}" 
106
+            data-field="location"
107
+          />
108
+          <view wx:else class="readonly-info">
109
+            <text class="readonly-text">{{item.location || '-'}}</text>
110
+          </view>
111
+          <input wx:if="{{pageMode !== 'view'}}"
112
+            class="form-input" 
113
+            placeholder="请输入完成情况" 
114
+            value="{{item.completion}}" 
115
+            bindinput="onWorkContentInput" 
116
+            data-index="{{index}}" 
117
+            data-field="completion"
118
+          />
119
+          <view wx:else class="readonly-info">
120
+            <text class="readonly-text">{{item.completion || '-'}}</text>
121
+          </view>
122
+          <textarea wx:if="{{pageMode !== 'view'}}"
123
+            class="form-textarea" 
124
+            placeholder="请输入备注" 
125
+            value="{{item.remark}}" 
126
+            bindinput="onWorkContentInput" 
127
+            data-index="{{index}}" 
128
+            data-field="remark"
129
+            auto-height
130
+          />
131
+          <view wx:else class="readonly-info">
132
+            <text class="readonly-text">{{item.remark || '-'}}</text>
133
+          </view>
134
+        </view>
135
+      </view>
136
+      <view wx:if="{{pageMode !== 'view'}}" class="add-btn" bindtap="addWorkContent">
137
+        <text class="add-icon">+</text>
138
+        <text class="add-text">添加工作内容</text>
139
+      </view>
50 140
     </view>
51 141
     
52
-    <!-- 内容输入 -->
142
+    <!-- 未完成工作 -->
53 143
     <view class="form-item">
54
-      <view class="form-label">内容 *</view>
55
-      <textarea 
144
+      <view class="form-label">未完成工作</view>
145
+      <textarea wx:if="{{pageMode !== 'view'}}"
56 146
         class="form-textarea" 
57
-        placeholder="请输入详细内容" 
58
-        value="{{content}}" 
59
-        bindinput="onContentInput"
147
+        placeholder="请输入未完成工作" 
148
+        value="{{unfinishedWork}}" 
149
+        bindinput="onUnfinishedWorkInput"
60 150
         auto-height
61
-        maxlength="2000"
151
+        maxlength="1000"
62 152
       />
63
-      <view class="word-count">{{content.length}}/2000</view>
153
+      <view wx:else class="readonly-info">
154
+        <text class="readonly-text">{{unfinishedWork || '-'}}</text>
155
+      </view>
156
+      <view class="word-count">{{unfinishedWork.length}}/1000</view>
64 157
     </view>
65 158
     
66 159
     <!-- 提交按钮 -->
67
-    <view class="submit-btn" bindtap="submitReport" wx:if="{{!isSubmitting}}">
68
-      保存
69
-    </view>
70
-    <view class="submit-btn disabled" wx:else>
71
-      保存中...
160
+    <view wx:if="{{pageMode !== 'view'}}">
161
+      <view class="submit-btn" bindtap="submitReport" wx:if="{{!isSubmitting}}">
162
+        {{id ? '更新报表' : '保存'}}
163
+      </view>
164
+      <view class="submit-btn disabled" wx:else>
165
+        {{id ? '更新中...' : '保存中...'}}
166
+      </view>
72 167
     </view>
73 168
   </view>
74 169
 </view>

+ 47 - 9
wxproject/packageA/pages/createReport/createReport.wxss

@@ -36,6 +36,26 @@
36 36
   width: 100%;
37 37
 }
38 38
 
39
+/* 只读信息显示样式 */
40
+.readonly-info {
41
+  flex: 1;
42
+  border: 1px solid #f0f0f0;
43
+  border-radius: 8rpx;
44
+  padding: 20rpx;
45
+  font-size: 28rpx;
46
+  background: #f9f9f9;
47
+  color: #333333;
48
+}
49
+
50
+.readonly-text {
51
+  display: block;
52
+  width: 100%;
53
+  overflow: hidden;
54
+  text-overflow: ellipsis;
55
+  white-space: normal;
56
+  word-break: break-all;
57
+}
58
+
39 59
 /* Radio组样式 */
40 60
 .radio-group {
41 61
   display: flex;
@@ -91,23 +111,41 @@ radio {
91 111
   margin-top: 10rpx;
92 112
 }
93 113
 
114
+/* 文本域 */
115
+.form-textarea {
116
+  font-size: 30rpx;
117
+  color: #666;
118
+  padding: 20rpx 0;
119
+  width: 100%;
120
+  min-height: 150rpx;
121
+  line-height: 1.6;
122
+}
123
+
124
+/* 字数统计 */
125
+.word-count {
126
+  text-align: right;
127
+  font-size: 24rpx;
128
+  color: #999;
129
+  margin-top: 10rpx;
130
+}
131
+
94 132
 /* 提交按钮 */
95 133
 .submit-btn {
96
-  background-color: #1989fa;
134
+  background-color: #07c160;
97 135
   color: #fff;
98
-  font-size: 32rpx;
99 136
   text-align: center;
100
-  padding: 28rpx 0;
101
-  border-radius: 6rpx;
102
-  margin: 40rpx 30rpx;
137
+  padding: 30rpx;
138
+  margin: 0 30rpx 60rpx;
139
+  border-radius: 8rpx;
140
+  font-size: 32rpx;
103 141
 }
104 142
 
105
-.submit-btn:active {
106
-  opacity: 0.8;
143
+.submit-btn.disabled {
144
+  background-color: #d9d9d9;
107 145
 }
108 146
 
109
-.submit-btn.disabled {
110
-  background-color: #c9c9c9;
147
+.submit-btn:active:not(.disabled) {
148
+  background-color: #06ad56;
111 149
 }
112 150
 
113 151
 /* 输入框焦点样式 */

+ 210 - 63
wxproject/packageA/pages/dailyWeeklyReport/dailyWeeklyReport.js

@@ -13,10 +13,16 @@ Page({
13 13
     startTime: '',
14 14
     endTime: '',
15 15
     submitter: '',
16
+    type: '', // 报表类型:''全部, '1'日报, '2'周报, '3'月报
17
+    team: '', // 管养班组
16 18
     // 提交人列表(实际项目中可从接口获取)
17 19
     submitterList: ['张三', '李四', '王五'],
20
+    // 管养班组列表(实际项目中可从接口获取)
21
+    teamList: ['绿化一组', '绿化二组', '绿化三组'],
18 22
     // 筛选模态框显示控制
19
-    scaling: false
23
+    scaling: false,
24
+    // 顶部快速筛选类型
25
+    filterType: ''
20 26
   },
21 27
 
22 28
   // 格式化日报标题
@@ -62,7 +68,35 @@ Page({
62 68
     this.setData({
63 69
       startTime: '',
64 70
       endTime: '',
65
-      submitter: ''
71
+      submitter: '',
72
+      type: '',
73
+      team: ''
74
+    });
75
+  },
76
+  
77
+  // 设置顶部筛选类型
78
+  setFilterType: function(e) {
79
+    const type = e.currentTarget.dataset.type;
80
+    this.setData({
81
+      filterType: type,
82
+      type: type,
83
+      current: 1,
84
+      reportList: []
85
+    });
86
+    this.getReportList();
87
+  },
88
+  
89
+  // 选择报表类型
90
+  bindTypeChange: function(e) {
91
+    this.setData({
92
+      type: e.detail.value
93
+    });
94
+  },
95
+  
96
+  // 选择管养班组
97
+  bindTeamChange: function(e) {
98
+    this.setData({
99
+      team: this.data.teamList[e.detail.value]
66 100
     });
67 101
   },
68 102
 
@@ -85,97 +119,203 @@ Page({
85 119
         size: this.data.size,
86 120
         startTime: this.data.startTime,
87 121
         endTime: this.data.endTime,
88
-        submitter: this.data.submitter
122
+        submitter: this.data.submitter,
123
+        type: this.data.type ? parseInt(this.data.type) : '',
124
+        team: this.data.team
89 125
       };
90
-      // 这里模拟请求,实际需要替换为真实接口
91
-      // let res = await app.sendRequest('post', '/report/selectReportList', { data });
92
-      // if (res.status == 200) {
93
-      //   this.setData({
94
-      //     reportList: this.data.current === 1 ? res.data.data : [...this.data.reportList, ...res.data.data]
95
-      //   });
96
-      // }
97 126
       
98
-      // 模拟数据 - 合并日报和周报数据
99
-      setTimeout(() => {
100
-        // 日报数据
101
-        const dailyData = [
102
-            { id: 1, type: 'daily', date: '2024-01-20', content: '完成园区巡检工作,处理了3处问题', submitter: '张三', displayDate: '2024-01-20' },
103
-            { id: 2, type: 'daily', date: '2024-01-19', content: '完成草坪修剪,施肥工作', submitter: '李四', displayDate: '2024-01-19' },
104
-            { id: 3, type: 'daily', date: '2024-01-18', content: '完成园区垃圾清理和消毒工作', submitter: '王五', displayDate: '2024-01-18' },
105
-            { id: 5, type: 'daily', date: '2024-01-17', content: '完成了前端页面的开发和样式调整', submitter: '张三', displayDate: '2024-01-17' }
106
-          ];
127
+      // 对接获取工作报表列表接口
128
+      let res = await app.sendRequest('get', '/t-work-report/page', data );
129
+      
130
+      if (res.status == 200) {
131
+        // 格式化返回的数据
132
+        const formattedData = res.data.data.map(item => {
133
+          // 构建显示日期
134
+          let displayDate = item.workStartTime;
135
+          if (item.workEndTime && item.workStartTime !== item.workEndTime) {
136
+            displayDate = `${item.workStartTime}至${item.workEndTime}`;
137
+          }
107 138
           
108
-          // 模拟周报数据
109
-          const weeklyData = [
110
-            { id: 4, type: 'weekly', dateRange: '2024-01-15至2024-01-21', content: '本周完成了园区绿化维护工作', submitter: '张三', displayDate: '2024-01-15至2024-01-21' },
111
-            { id: 5, type: 'weekly', dateRange: '2024-01-08至2024-01-14', content: '完成了园区设备检查和维护', submitter: '李四', displayDate: '2024-01-08至2024-01-14' },
112
-            { id: 6, type: 'weekly', dateRange: '2024-01-01至2024-01-07', content: '进行了系统测试和Bug修复,优化了性能', submitter: '赵六', displayDate: '2024-01-01至2024-01-07' }
113
-          ];
114
-        
115
-        // 合并数据
116
-        let mockData = [...dailyData, ...weeklyData];
117
-        
118
-        // 格式化数据
119
-        mockData = mockData.map(item => {
120
-          if (item.type === 'daily') {
121
-            return {
122
-              ...item,
123
-              title: this.formatDailyTitle(item.date),
124
-              displayDate: item.date
125
-            };
126
-          } else {
127
-            const weekInfo = this.formatWeeklyInfo(item.dateRange);
128
-            return {
129
-              ...item,
130
-              title: weekInfo.title,
131
-              displayDate: weekInfo.dateRange
132
-            };
139
+          // 格式化标题(如果没有标题)
140
+          let title = item.title;
141
+          if (!title) {
142
+            const typeText = item.type === 1 ? '日报' : item.type === 2 ? '周报' : '月报';
143
+            title = `${displayDate}${typeText}`;
133 144
           }
145
+          
146
+          return {
147
+            ...item,
148
+            title: title,
149
+            displayDate: displayDate,
150
+            // 构建内容摘要(从工作内容中提取)
151
+            content: this.buildContentSummary(item.workContent)
152
+          };
134 153
         });
135 154
         
136 155
         // 按时间降序排序
137
-        mockData.sort((a, b) => {
138
-          const dateA = new Date(a.date || a.dateRange.split('至')[0]);
139
-          const dateB = new Date(b.date || b.dateRange.split('至')[0]);
140
-          return dateB - dateA;
156
+        formattedData.sort((a, b) => {
157
+          return new Date(b.workStartTime) - new Date(a.workStartTime);
141 158
         });
142 159
         
143
-        // 应用筛选条件
160
+        this.setData({
161
+          reportList: this.data.current === 1 ? formattedData : [...this.data.reportList, ...formattedData]
162
+        });
163
+      }
164
+    } catch (error) {
165
+      console.log('获取报表列表失败', error);
166
+      
167
+      // 错误时使用模拟数据
168
+      setTimeout(() => {
169
+        // 模拟数据 - 包含日报、周报、月报
170
+        const mockData = [
171
+          { id: 1, type: '1', workStartTime: '2024-01-20', workEndTime: '2024-01-20', team: '绿化一组', submitter: '张三', workContent: [{content: '完成园区巡检工作', location: '东区', completion: '已完成'}] },
172
+          { id: 2, type: '2', workStartTime: '2024-01-15', workEndTime: '2024-01-21', team: '绿化二组', submitter: '李四', workContent: [{content: '完成草坪修剪', location: '西区', completion: '已完成'}, {content: '施肥工作', location: '全园区', completion: '已完成'}] },
173
+          { id: 3, type: '3', workStartTime: '2024-01-01', workEndTime: '2024-01-31', team: '绿化三组', submitter: '王五', workContent: [{content: '完成月度养护计划', location: '全园区', completion: '进行中'}] },
174
+          { id: 4, type: '1', workStartTime: '2024-01-19', workEndTime: '2024-01-19', team: '绿化一组', submitter: '张三', workContent: [{content: '园区垃圾清理', location: '全园区', completion: '已完成'}] },
175
+          { id: 5, type: '2', workStartTime: '2024-01-08', workEndTime: '2024-01-14', team: '绿化二组', submitter: '李四', workContent: [{content: '设备检查', location: '全园区', completion: '已完成'}] },
176
+          { id: 6, type: '3', workStartTime: '2023-12-01', workEndTime: '2023-12-31', team: '绿化三组', submitter: '赵六', workContent: [{content: '冬季防寒工作', location: '全园区', completion: '已完成'}] }
177
+        ];
178
+        
179
+        // 根据筛选条件过滤数据
180
+        let filteredData = mockData;
181
+        
182
+        if (this.data.type) {
183
+          filteredData = filteredData.filter(item => item.type === this.data.type);
184
+        }
185
+        
144 186
         if (this.data.startTime) {
145
-          mockData = mockData.filter(item => {
146
-            const itemDate = new Date(item.date || item.dateRange.split('至')[0]);
147
-            return itemDate >= new Date(this.data.startTime);
148
-          });
187
+          filteredData = filteredData.filter(item => new Date(item.workStartTime) >= new Date(this.data.startTime));
149 188
         }
150 189
         
151 190
         if (this.data.endTime) {
152
-          mockData = mockData.filter(item => {
153
-            const itemDate = new Date(item.date || item.dateRange.split('至')[1]);
154
-            return itemDate <= new Date(this.data.endTime);
155
-          });
191
+          filteredData = filteredData.filter(item => new Date(item.workEndTime) <= new Date(this.data.endTime));
156 192
         }
157 193
         
158 194
         if (this.data.submitter) {
159
-          mockData = mockData.filter(item => item.submitter === this.data.submitter);
195
+          filteredData = filteredData.filter(item => item.submitter === this.data.submitter);
160 196
         }
161 197
         
198
+        if (this.data.team) {
199
+          filteredData = filteredData.filter(item => item.team === this.data.team);
200
+        }
201
+        
202
+        // 格式化数据
203
+        const formattedData = filteredData.map(item => {
204
+          let displayDate = item.workStartTime;
205
+          if (item.workEndTime && item.workStartTime !== item.workEndTime) {
206
+            displayDate = `${item.workStartTime}至${item.workEndTime}`;
207
+          }
208
+          
209
+          const typeText = item.type === '1' ? '日报' : item.type === '2' ? '周报' : '月报';
210
+          
211
+          return {
212
+            ...item,
213
+            title: `${displayDate}${typeText}`,
214
+            displayDate: displayDate,
215
+            content: this.buildContentSummary(item.workContent)
216
+          };
217
+        });
218
+        
162 219
         this.setData({
163
-          reportList: mockData,
220
+          reportList: formattedData,
164 221
           isLoading: false
165 222
         });
166 223
       }, 500);
167
-    } catch (error) {
168
-      console.log('获取报表列表失败', error);
224
+    } finally {
169 225
       this.setData({ isLoading: false });
170 226
     }
171 227
   },
228
+  
229
+  // 构建内容摘要
230
+  buildContentSummary(workContent) {
231
+    try {
232
+      // 尝试解析JSON字符串
233
+      let contentArray = typeof workContent === 'string' ? JSON.parse(workContent) : workContent;
234
+      
235
+      if (!Array.isArray(contentArray) || contentArray.length === 0) {
236
+        return '';
237
+      }
238
+      
239
+      // 提取前两个工作内容的摘要
240
+      const summaries = contentArray.slice(0, 2).map(item => item.content || '').filter(Boolean);
241
+      
242
+      if (summaries.length === 0) {
243
+        return '';
244
+      }
245
+      
246
+      let result = summaries.join(';');
247
+      // 如果内容太长,进行截断
248
+      if (result.length > 50) {
249
+        result = result.substring(0, 50) + '...';
250
+      }
251
+      // 如果有更多工作内容,添加提示
252
+      if (contentArray.length > summaries.length) {
253
+        result += ` 等${contentArray.length}项工作`;
254
+      }
255
+      
256
+      return result;
257
+    } catch (error) {
258
+      console.log('解析工作内容失败', error);
259
+      return '';
260
+    }
261
+        
262
+    //     this.setData({
263
+    //       reportList: mockData,
264
+    //       isLoading: false
265
+    //     });
266
+    //   }, 500);
267
+    // } catch (error) {
268
+    //   console.log('获取报表列表失败', error);
269
+    //   this.setData({ isLoading: false });
270
+    // }
271
+  },
172 272
 
173 273
   // 去详情
174 274
   goDetail(e) {
175 275
     let id = e.currentTarget.dataset.id;
176
-    let type = e.currentTarget.dataset.type === 'daily' ? 0 : 1;
276
+    let type = e.currentTarget.dataset.type;
277
+    wx.navigateTo({
278
+      url: `../createReport/createReport?id=${id}&type=${type}&view=true`
279
+    });
280
+  },
281
+  
282
+  // 编辑报表
283
+  editReport(e) {
284
+    let id = e.currentTarget.dataset.id;
177 285
     wx.navigateTo({
178
-      url: `../createReport/createReport?id=${id}&type=${type}`
286
+      url: `../createReport/createReport?id=${id}&edit=true`
287
+    });
288
+  },
289
+  
290
+  // 删除报表
291
+  deleteReport(e) {
292
+    const id = e.currentTarget.dataset.id;
293
+    wx.showModal({
294
+      title: '确认删除',
295
+      content: '确定要删除该工作报表吗?',
296
+      success: async (res) => {
297
+        if (res.confirm) {
298
+          try {
299
+            wx.showLoading({ title: '删除中...' });
300
+            // 调用删除接口
301
+            const deleteRes = await app.sendRequest('delete', `/t-work-report/${id}`, {});
302
+            
303
+            if (deleteRes.status == 200) {
304
+              wx.showToast({ title: '删除成功' });
305
+              // 重新加载列表
306
+              this.setData({ current: 1, reportList: [] });
307
+              this.getReportList();
308
+            } else {
309
+              wx.showToast({ title: '删除失败', icon: 'none' });
310
+            }
311
+          } catch (error) {
312
+            console.log('删除报表失败', error);
313
+            wx.showToast({ title: '删除失败', icon: 'none' });
314
+          } finally {
315
+            wx.hideLoading();
316
+          }
317
+        }
318
+      }
179 319
     });
180 320
   },
181 321
 
@@ -213,6 +353,13 @@ Page({
213 353
    * 生命周期函数--监听页面加载
214 354
    */
215 355
   onLoad: function(options) {
356
+    // 如果从其他页面传入了类型参数,设置筛选条件
357
+    if (options.type) {
358
+      this.setData({
359
+        type: options.type,
360
+        filterType: options.type
361
+      });
362
+    }
216 363
     this.getReportList();
217 364
   },
218 365
 

+ 1 - 1
wxproject/packageA/pages/dailyWeeklyReport/dailyWeeklyReport.json

@@ -1,3 +1,3 @@
1 1
 {
2
-  "navigationBarTitleText": "日周报记录"
2
+  "navigationBarTitleText": "工作报表记录"
3 3
 }

+ 54 - 10
wxproject/packageA/pages/dailyWeeklyReport/dailyWeeklyReport.wxml

@@ -1,18 +1,33 @@
1 1
 <view class="dailyWeeklyReport">
2
+  <!-- 顶部筛选栏 -->
3
+  <view class="filter-buttons">
4
+    <view class="filter-button {{filterType === '' ? 'active' : ''}}" bindtap="setFilterType" data-type="">全部</view>
5
+    <view class="filter-button {{filterType === '1' ? 'active' : ''}}" bindtap="setFilterType" data-type="1">日报</view>
6
+    <view class="filter-button {{filterType === '2' ? 'active' : ''}}" bindtap="setFilterType" data-type="2">周报</view>
7
+    <view class="filter-button {{filterType === '3' ? 'active' : ''}}" bindtap="setFilterType" data-type="3">月报</view>
8
+  </view>
9
+  
2 10
   <!-- 列表容器 -->
3 11
   <view class="list-container">
4
-    <scroll-view scroll-y scroll-top="{{scrollY}}" lower-threshold="50" bindscrolltolower="scrollToLower" style="height: 85vh;">
12
+    <scroll-view scroll-y scroll-top="{{scrollY}}" lower-threshold="50" bindscrolltolower="scrollToLower" style="height: calc(100vh - 120rpx);">
5 13
       <block wx:if="{{reportList.length > 0}}">
6 14
         <block wx:for="{{reportList}}" wx:key="id">
7
-          <view class="list-item" bind:tap="goDetail" data-id="{{item.id}}" data-type="{{item.type}}">
8
-            <view class="item-header">
9
-              <view class="item-title">{{item.title}}</view>
10
-              <view class="report-type {{item.type=='daily'?'daily-type':'weekly-type'}}">{{item.type=='daily'?'日报':'周报'}}</view>
11
-            </view>
12
-            <view class="item-date">{{item.displayDate}}</view>
13
-            <view class="item-submitter">提交人:{{item.submitter}}</view>
14
-            <view class="item-content">{{item.content}}</view>
15
-          </view>
15
+          <view class="list-item">
16
+      <view class="item-main" bind:tap="goDetail" data-id="{{item.id}}" data-type="{{item.type}}">
17
+        <view class="item-header">
18
+          <view class="item-title">{{item.title || '工作报表'}}</view>
19
+          <view class="report-type {{item.type=='1'?'daily-type':item.type=='2'?'weekly-type':'monthly-type'}}">{{item.type=='1'?'日报':item.type=='2'?'周报':'月报'}}</view>
20
+        </view>
21
+        <view class="item-date">{{item.displayDate}}</view>
22
+        <view class="item-submitter">提交人:{{item.submitter}}</view>
23
+        <view class="item-team" wx:if="{{item.team}}">管养班组:{{item.team}}</view>
24
+        <view class="item-content">{{item.content}}</view>
25
+      </view>
26
+      <view class="item-actions">
27
+        <view class="action-btn edit-btn" bindtap="editReport" data-id="{{item.id}}">编辑</view>
28
+        <view class="action-btn delete-btn" bindtap="deleteReport" data-id="{{item.id}}">删除</view>
29
+      </view>
30
+    </view>
16 31
         </block>
17 32
       </block>
18 33
       <view wx:else class="empty-tip">暂无数据</view>
@@ -30,6 +45,27 @@
30 45
         <image src="../../../images/weatherImg/close.png"></image>
31 46
       </view>
32 47
       
48
+      <!-- 报表类型 -->
49
+      <view class="scaling_itme">
50
+        <view class="scaling_itme_left">报表类型:</view>
51
+        <view class="scaling_itme_right type-select">
52
+          <radio-group bindchange="bindTypeChange">
53
+            <label>
54
+              <radio value="" checked="{{type === ''}}" />全部
55
+            </label>
56
+            <label>
57
+              <radio value="1" checked="{{type === '1'}}" />日报
58
+            </label>
59
+            <label>
60
+              <radio value="2" checked="{{type === '2'}}" />周报
61
+            </label>
62
+            <label>
63
+              <radio value="3" checked="{{type === '3'}}" />月报
64
+            </label>
65
+          </radio-group>
66
+        </view>
67
+      </view>
68
+      
33 69
       <!-- 开始时间 -->
34 70
       <view class="scaling_itme">
35 71
         <view class="scaling_itme_left">开始时间:</view>
@@ -54,6 +90,14 @@
54 90
         </picker>
55 91
       </view>
56 92
       
93
+      <!-- 管养班组 -->
94
+      <view class="scaling_itme">
95
+        <view class="scaling_itme_left">管养班组:</view>
96
+        <picker class="scaling_itme_right" bindchange="bindTeamChange" value="{{teamList.indexOf(team)}}" range="{{teamList}}">
97
+          <view>{{team || "请选择管养班组"}}</view>
98
+        </picker>
99
+      </view>
100
+      
57 101
       <view class="scaling_fooder">
58 102
         <view class="scaling_fooder_left" bind:tap="qxScaling">重置</view>
59 103
         <view class="scaling_fooder_right" bind:tap="qdScaling">确定</view>

+ 110 - 0
wxproject/packageA/pages/dailyWeeklyReport/dailyWeeklyReport.wxss

@@ -35,6 +35,37 @@
35 35
 }
36 36
 
37 37
 /* 列表容器 */
38
+/* 按钮形式筛选栏 */
39
+.filter-buttons {
40
+  display: flex;
41
+  padding: 20rpx;
42
+  background: #fff;
43
+  justify-content: flex-start;
44
+  gap: 16rpx;
45
+  border-bottom: 1rpx solid #eee;
46
+  
47
+}
48
+
49
+.filter-button {
50
+  padding: 12rpx 32rpx;
51
+  background: #f7f7f7;
52
+  color: #666;
53
+  font-size: 28rpx;
54
+  border-radius: 20rpx;
55
+  text-align: center;
56
+  transition: all 0.3s;
57
+}
58
+
59
+.filter-button.active {
60
+  background: #1aad19;
61
+  color: #fff;
62
+  font-weight: bold;
63
+}
64
+
65
+.filter-button:active {
66
+  opacity: 0.8;
67
+}
68
+
38 69
 .list-container {
39 70
   background-color: #f5f5f5;
40 71
   padding: 20rpx;
@@ -47,6 +78,39 @@
47 78
   padding: 30rpx;
48 79
   margin-bottom: 20rpx;
49 80
   box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
81
+  position: relative;
82
+}
83
+
84
+.item-main {
85
+  padding-right: 160rpx;
86
+}
87
+
88
+.item-actions {
89
+  position: absolute;
90
+  right: 20rpx;
91
+  top: 50%;
92
+  transform: translateY(-50%);
93
+  display: flex;
94
+  flex-direction: column;
95
+  gap: 16rpx;
96
+}
97
+
98
+.action-btn {
99
+  padding: 12rpx 24rpx;
100
+  font-size: 26rpx;
101
+  border-radius: 16rpx;
102
+  text-align: center;
103
+  min-width: 80rpx;
104
+}
105
+
106
+.edit-btn {
107
+  background: #e6f7ff;
108
+  color: #1890ff;
109
+}
110
+
111
+.delete-btn {
112
+  background: #fff1f0;
113
+  color: #ff4d4f;
50 114
 }
51 115
 
52 116
 .item-header {
@@ -60,6 +124,32 @@
60 124
   font-size: 34rpx;
61 125
   font-weight: bold;
62 126
   color: #333;
127
+  display: flex;
128
+  align-items: center;
129
+  justify-content: space-between;
130
+}
131
+
132
+.item-type {
133
+  font-size: 24rpx;
134
+  padding: 4rpx 16rpx;
135
+  border-radius: 16rpx;
136
+  margin-left: 12rpx;
137
+  display: inline-block;
138
+}
139
+
140
+.type-daily {
141
+  background: #e6f7ff;
142
+  color: #1890ff;
143
+}
144
+
145
+.type-weekly {
146
+  background: #f6ffed;
147
+  color: #52c41a;
148
+}
149
+
150
+.type-monthly {
151
+  background: #fff7e6;
152
+  color: #fa8c16;
63 153
 }
64 154
 
65 155
 .item-date {
@@ -264,6 +354,26 @@
264 354
   align-items: center;
265 355
   padding: 0 20rpx;
266 356
 }
357
+
358
+/* 类型选择样式 */
359
+.radio-group {
360
+  display: flex;
361
+  flex-wrap: wrap;
362
+  margin-top: 10rpx;
363
+}
364
+
365
+.radio-item {
366
+  display: flex;
367
+  align-items: center;
368
+  margin-right: 40rpx;
369
+  margin-bottom: 20rpx;
370
+}
371
+
372
+.radio-item text {
373
+  margin-left: 8rpx;
374
+  font-size: 28rpx;
375
+  color: #333;
376
+}
267 377
 .scaling_itme_left {
268 378
   flex: 2;
269 379
   display: flex;