zhangqiOMG il y a 2 ans
Parent
commit
24a5ac79f4

+ 2 - 0
src/Form/projectTask/edit.vue

@@ -181,6 +181,8 @@
             sa_projstagemagid: e.sa_projstagemagid
           })
         })
+        this.act_projtask = this.form.projtaskmag_options[0]
+        this.optionscore = this.form.projtaskmag_options[0].projtaskmag_optionscore
       },
       selectFormObject(val) {
         this.partiesType = val

+ 83 - 3
src/HManagement/task/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="task__pane;">
     <normalLayout>
       <div slot="titleRight">
         <add-task></add-task>
@@ -12,6 +12,30 @@
           <el-tab-pane label="我下属负责的" name="3"></el-tab-pane>
           <el-tab-pane label="我下属参与的" name="4"></el-tab-pane>
         </el-tabs>
+        <div>
+         <el-card v-for="item in list" :key="item.index" class="normal-margin" :body-style="{padding:'10px'}">
+          <div slot="header" class="flex-align-center">
+            <p class="avatar">{{item.createby.substr(0, 1)}}</p>&emsp;
+            <p class="task__label">{{item.createby}}</p>&emsp;
+            <el-tag size="small" type="primary">{{item.status}}</el-tag>&emsp;<span class="task__label">{{item.starttime}}</span>
+          </div>
+          <div>
+            <p><span class="task__label">标题:&emsp;</span>{{item.title}}</p>
+            <p><span class="task__label">描述:&emsp;</span>{{item.remaks}}</p>
+          </div>
+         </el-card>
+        </div>
+        <div class="container normal-panel" style="text-align:right">
+          <el-pagination
+            background
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-sizes="[20, 50, 100, 200]"
+            layout="total,sizes, prev, pager, next, jumper"
+            :total="total">
+          </el-pagination>
+        </div>
       </div>
     </normalLayout>
   </div>
@@ -25,14 +49,70 @@ export default {
   },
   data () {
     return {
-      activeName:'5'
+      activeName:'5',
+      param:{
+        "id":20220901162901,
+          "content": {
+            "pageNumber": 1,
+            "pageSize": 20,
+            "type":this.activeName,
+            "where":{
+              "condition":"",
+              "status":""
+            }
+          }
+      },
+      list:[],
+      total:0,
+      currentPage:0
     }
   },
   methods:{
-    handleClick () {}
+    handleClick (val) {
+      this.param.content.type = this.activeName
+      this.listData()
+    },
+    async listData () {
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+  },
+  mounted () {
+    this.listData()
   }
 }
 
 </script>
 <style>
+</style>
+<style scoped>
+.task__pane{
+  vertical-align:-webkit-baseline-middle;
+}
+.avatar{
+  width: 30px;
+  height: 30px;
+  text-align: center;
+  line-height: 30px;
+  font-size: 1rem;
+  color:#fff;
+  border-radius: 100%;
+  background: #3874F6;
+}
+.task__label{
+  color:rgb(173, 172, 172);
+  font-size: 14px;
+}
 </style>

+ 25 - 8
src/HManagement/task/modules/add.vue

@@ -1,9 +1,15 @@
 <template>
   <div>
-    <el-button size="mini" type="primary" @click="dialogTableVisible = true">
+    <el-button size="small" type="primary" @click="dialogTableVisible = true">
         创建任务
     </el-button>
     <el-dialog title="新增待办" append-to-body :visible.sync="dialogTableVisible" width="700px">
+			<el-alert
+				v-if="errormsg"
+				class="normal-margin"
+				:title="errormsg"
+				type="error">
+			</el-alert>
 			<el-input class="normal-margin" v-model="form.title" placeholder="输入任务标题" type="text" show-word-limit maxlength="40" size="small"></el-input>
 			<el-input  class="normal-margin" v-model="form.remarks" placeholder="输入任务内容" type="textarea" show-word-limit maxlength="100" size="small"></el-input>
 			<div class="flex-align-center flex-between normal-margin">
@@ -35,7 +41,6 @@
 				<upload
 					ref="upload"
 					:folderid="folderid"
-					@onSuccess="onSuccess"
 					:bindData="bindData"
 					type="button">
 				</upload>
@@ -64,7 +69,7 @@
 			</div> -->
 			<div slot="footer" class="dialog-footer">
         <el-button size="small" style="width:120px" @click="dialogTableVisible = false">取 消</el-button>
-        <el-button type="warning" size="small" style="width:120px" @click="submit">创 建</el-button>
+        <el-button type="warning" size="small" style="width:120px" @click="validateInput">创 建</el-button>
       </div>
     </el-dialog>
   </div>
@@ -85,14 +90,27 @@ export default {
         "title":"任务标题",
         "remarks":"任务说明",
         "starttime":"",
-        "remindday":1,
+        "remindday":0,
         "ownertable":"",
         "ownerid":0,
         "endtime":""
-			}
+			},
+			errormsg:'',
+			bindData:{}
 		}
 	},
 	methods:{
+		validateInput () {
+			if (!this.form.title) {
+				this.errormsg = '请输入标题'
+				return false
+			} else if (!this.form.starttime) {
+				this.errormsg = '请选择开始日期'
+				return false
+			} else {
+				this.submit()
+			}
+		},
 		async submit () {
 			const res = await this.$api.requested({
         "id": 20221211112101,
@@ -104,9 +122,8 @@ export default {
           "ownerid": res.data.sys_taskid,
           "usetype": 'default',
         }
-        this.dialogFormVisible = false
-        this.$refs['form'].resetFields();
-          
+				this.errormsg = ''
+        this.dialogTableVisible = false
         this.$refs['upload'].toUpload()
         this.$emit('onSuccess')
       })