Selaa lähdekoodia

任务界面相关修改

xiaohaizhao 2 vuotta sitten
vanhempi
commit
f03aac52f0

+ 4 - 2
packageA/work/add.js

@@ -18,7 +18,7 @@ Page({
             required: true,
             maxlength: '40'
         }, {
-            label: "任务要求",
+            label: "任务内容",
             error: false,
             errMsg: "",
             type: "textarea",
@@ -95,8 +95,10 @@ Page({
     },
     onLoad(options) {
         if (options.data) {
+            wx.setNavigationBarTitle({
+              title: '编辑任务',
+            })
             let data = JSON.parse(options.data);
-            console.log(data)
             if (options.group) {
                 let group = JSON.parse(options.group)
                 let leader = group.findIndex(v => v.userid == data.leader[0].userid);

+ 1 - 1
packageA/work/add.json

@@ -1,4 +1,4 @@
 {
     "usingComponents": {},
-    "navigationBarTitleText": "编辑任务"
+    "navigationBarTitleText": "新建任务"
 }

+ 27 - 8
packageA/work/detail.js

@@ -198,13 +198,13 @@ Page({
                 tabbarList,
                 detail: res.data,
                 briefs: [{
-                        label: "任务要求",
+                        label: "任务内容",
                         value: res.data.remarks
                     }, {
-                        label: "开始时间",
+                        label: "开始日期",
                         value: res.data.starttime
                     }, {
-                        label: "结束时间",
+                        label: "结束日期",
                         value: res.data.endtime
                     },
                     {
@@ -217,14 +217,23 @@ Page({
                     }
                 ],
                 list1: [{
-                    label: "任务要求",
+                    label: "任务标题",
+                    value: res.data.title
+                }, {
+                    label: "任务内容",
                     value: res.data.remarks
                 }, {
-                    label: "开始时间",
+                    label: "开始日期",
                     value: res.data.starttime
                 }, {
-                    label: "结束时间",
+                    label: "结束日期",
                     value: res.data.endtime
+                }, {
+                    label: "执行人",
+                    value: res.data.leader[0].name
+                }, {
+                    label: "协助人",
+                    value: ""
                 }, {
                     label: '关联应用数据',
                     value: res.data.title,
@@ -246,12 +255,17 @@ Page({
                 }, {
                     label: "最近编辑时间",
                     value: res.data.changedate
+                }, {
+                    label: "完成人",
+                    value: res.data.finishby
+                }, {
+                    label: "完成时间",
+                    value: res.data.finishdate
                 }, {
                     label: "转手次数",
                     value: res.data.leader.length ? res.data.leader[0].leadernum : 0
                 }]
             });
-
             /* 更新列表中状态 */
             let page = getCurrentPages().find(v => v.__route__ == 'packageA/saleClue/index');
             if (page) {
@@ -294,7 +308,12 @@ Page({
     },
     //更新团队成员
     getGroup() {
-        this.selectComponent("#Group").getList();
+        this.selectComponent("#Group").getList().then(res => {
+            let i = this.data.list1.findIndex(v => v.label == '协助人')
+            this.setData({
+                [`list1[${i}].value`]: res.filter(v => !v.isleader).map(v => v.name)
+            })
+        });
     },
     onClose() {
         this.setData({

+ 5 - 5
packageA/work/modules/list/index.wxml

@@ -8,19 +8,19 @@
         <van-tag custom-class='tag' wx:for="{{item.tags.systemtag}}" wx:key="index" wx:for-item='tag' color='#FA8C16' text-color='#fff' round>{{tag}}</van-tag>
         <van-tag custom-class='tag' wx:for="{{item.tags.datatag}}" wx:key="index" wx:for-item='tag' color='#FAAB16' text-color='#fff' round>{{tag}}</van-tag>
     </view>
-    <view class="exp line-1">开始时间:<text>{{item.starttime}}</text></view>
-    <view class="exp line-1">结束时间:<text>{{item.endtime||' --'}}</text></view>
+    <view class="exp line-1">开始日期:<text>{{item.starttime}}</text></view>
+    <view class="exp line-1">结束日期:<text>{{item.endtime||' --'}}</text></view>
 </navigator>
 
 <wxs module="backColor">
     module.exports.getColor = function (status) {
         var color = null;
-        if (status == '新建') {
+        if (status == '待执行') {
             color = '#3874F6';
-        } else if (status == '提交') {
+        } else if (status == '进行中') {
             color = '#52C41A';
         } else {
-            color = '#FA8C16';
+            color = '#BBB';
         };
         return color
     }

+ 37 - 24
pages/group/modules/Yl-group/index.js

@@ -1,9 +1,15 @@
 const _Http = getApp().globalData.http;
 Component({
     properties: {
-        add: {type:Boolean}, //是否允许新增
-        ownertable: {type:String},
-        ownerid: {type:String}
+        add: {
+            type: Boolean
+        }, //是否允许新增
+        ownertable: {
+            type: String
+        },
+        ownerid: {
+            type: String
+        }
     },
     data: {
         list: [],
@@ -13,28 +19,35 @@ Component({
     },
     methods: {
         getList() {
-            _Http.basic({
-                "id": 20220930103501,
-                "content": {
-                    ownertable: this.data.ownertable,
-                    ownerid: this.data.ownerid
-                }
-            }).then(res => {
-                console.log("团队列表", res)
-                if (res.msg != '成功') return wx.showToast({
-                    title: res.data,
-                    icon: "none"
+            return new Promise((resolve, reject) => {
+                _Http.basic({
+                    "id": 20220930103501,
+                    "content": {
+                        ownertable: this.data.ownertable,
+                        ownerid: this.data.ownerid
+                    }
+                }).then(res => {
+                    console.log("团队列表", res)
+                    if (res.msg != '成功') {
+                        resolve([])
+                        wx.showToast({
+                            title: res.data,
+                            icon: "none"
+                        });
+                        return
+                    }
+                    if (res.data.length == 0) return resolve([]);
+                    let list = res.data.map(v => v.teamleader.concat(v.team));
+                    const newArr = function (arr) {
+                        return arr.reduce((pre, cur) => pre.concat(Array.isArray(cur) ? newArr(cur) : cur), [])
+                    }
+                    list = newArr(list).slice(0, 5);
+                    resolve(list)
+                    this.setData({
+                        list
+                    })
                 });
-                if (res.data.length == 0) return;
-                let list = res.data.map(v => v.teamleader.concat(v.team));
-                const newArr = function (arr) {
-                    return arr.reduce((pre, cur) => pre.concat(Array.isArray(cur) ? newArr(cur) : cur), [])
-                }
-                list = newArr(list).slice(0, 5);
-                this.setData({
-                    list
-                })
-            });
+            })
         },
         addUser() {
             if (this.data.add) {

+ 14 - 1
project.private.config.json

@@ -3,5 +3,18 @@
     "setting": {
         "urlCheck": false
     },
-    "projectname": "Yos"
+    "projectname": "Yos",
+    "condition": {
+        "miniprogram": {
+            "list": [
+                {
+                    "name": "任务",
+                    "pathName": "packageA/work/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                }
+            ]
+        }
+    }
 }