签到完成
This commit is contained in:
		| @@ -3,31 +3,48 @@ | ||||
|     <ai-list> | ||||
|       <ai-title slot="title" title="签到管理" isShowBottomBorder> | ||||
|         <template #rightBtn> | ||||
|           <el-button type="primary">设置</el-button> | ||||
|           <div flex> | ||||
|             <ai-download url="/app/appwechatsigninfo/export" :params="{...search}" :instance="instance" fileName="签到管理导出文件"/> | ||||
|             <ai-dialog-btn dialogTitle="签到提醒设置" width="500px" :submit="submit" @close="form={}" @open="getSetting"> | ||||
|               <el-button slot="btn" type="primary">设置</el-button> | ||||
|               <el-form size="small" label-width="120px" ref="SettingForm" :model="form"> | ||||
|                 <el-form-item label="早提醒时间"> | ||||
|                   <el-time-picker v-model="form.morningTime" placeholder="请选择" value-format="hh:mm:ss"/> | ||||
|                 </el-form-item> | ||||
|                 <el-form-item label="晚提醒时间"> | ||||
|                   <el-time-picker v-model="form.nightTime" placeholder="请选择" value-format="hh:mm:ss"/> | ||||
|                 </el-form-item> | ||||
|               </el-form> | ||||
|             </ai-dialog-btn> | ||||
|           </div> | ||||
|         </template> | ||||
|       </ai-title> | ||||
|       <template #left> | ||||
|         <ai-tree-menu title="组织部门" @search="handleSearchTree"> | ||||
|           <el-tree ref="DeptTree" :data="treeData" :props="{label:'name'}" :filter-node-method="(v,data)=>data.label.indexOf(v)>-1"/> | ||||
|           <el-tree ref="DeptTree" :data="treeData" :props="{label:'name'}" :filter-node-method="(v,data)=>data.name.indexOf(v)>-1" | ||||
|                    @node-click="handleSelectDept"/> | ||||
|         </ai-tree-menu> | ||||
|       </template> | ||||
|       <template #content> | ||||
|         <ai-search-bar> | ||||
|           <template #left> | ||||
|             <ai-download url="/app/appwechatsigninfo/export" :params="{...search,ids}" :instance="instance" fileName="签到管理导出文件"/> | ||||
|           </template> | ||||
|           <template #right> | ||||
|             <el-input size="small" placeholder="搜索" v-model="search.name" clearable @change="page.current=1,getTableData()"/> | ||||
|           </template> | ||||
|         </ai-search-bar> | ||||
|         <ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size" | ||||
|                   @getList="getTableData" :col-configs="colConfigs" :dict="dict"> | ||||
|           <el-table-column slot="options" label="操作" fixed="right" align="center" width="300"> | ||||
|             <template slot-scope="{row}"> | ||||
|  | ||||
|       <template #blank> | ||||
|         <div flex class="gap-16"> | ||||
|           <ai-bar v-for="(v,key) in sta" card class="fill" :title="key"><b class="staNum" v-text="v"/></ai-bar> | ||||
|         </div> | ||||
|         <ai-card panel> | ||||
|           <ai-search-bar> | ||||
|             <template #left> | ||||
|               <ai-search label="签到时间"> | ||||
|                 <el-date-picker v-model="search.createDateStart" size="small" placeholder="开始时间" value-format="yyyy-MM-dd" @change="reloadTable"/> | ||||
|                 <el-date-picker v-model="search.createDateEnd" size="small" placeholder="结束时间" value-format="yyyy-MM-dd" @change="reloadTable"/> | ||||
|               </ai-search> | ||||
|               <ai-select placeholder="签到状态" v-model="search.status" :selectList="dict.getDict('wxSignStatus')" @change="reloadTable"/> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|         </ai-table> | ||||
|             <template #right> | ||||
|               <el-input size="small" placeholder="搜索用户" v-model="search.wxUserName" clearable @change="page.current=1,getTableData()"/> | ||||
|             </template> | ||||
|           </ai-search-bar> | ||||
|           <ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size" | ||||
|                     @getList="getTableData" :col-configs="colConfigs" :dict="dict"/> | ||||
|         </ai-card> | ||||
|       </template> | ||||
|     </ai-list> | ||||
|   </section> | ||||
| @@ -46,16 +63,19 @@ export default { | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       search: {name: ""}, | ||||
|       search: {name: "", createDateStart: "", createDateEnd: ""}, | ||||
|       page: {current: 1, size: 10, total: 0}, | ||||
|       tableData: [], | ||||
|       colConfigs: [ | ||||
|         {prop: "createDate", label: "签到时间"}, | ||||
|         {prop: "wxUserName", label: "用户"}, | ||||
|         {prop: "departmentName", label: "部门"}, | ||||
|         {prop: "status", label: "状态", dict: "wxSignStatus"}, | ||||
|         {prop: "wxUserName", label: "用户"} | ||||
|         {prop: "createDate", label: "签到日期"}, | ||||
|         {prop: "createTime", label: "签到时间"}, | ||||
|         {prop: "status", label: "状态", dict: "wxSignStatus"} | ||||
|       ], | ||||
|       treeData: [] | ||||
|       treeData: [], | ||||
|       form: {}, | ||||
|       sta: {} | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
| @@ -69,9 +89,6 @@ export default { | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     handleAdd(id) { | ||||
|       this.$router.push({hash: "#add", query: {id}}) | ||||
|     }, | ||||
|     getDepartments() { | ||||
|       this.instance.post("/app/wxcp/wxdepartment/listAll").then(res => { | ||||
|         if (res?.data) { | ||||
| @@ -79,13 +96,49 @@ export default { | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     getSetting() { | ||||
|       this.instance.post("/app/appwechatsignconfig/queryDetailById").then(res => { | ||||
|         if (res?.data) { | ||||
|           this.form = res.data | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     getStaData() { | ||||
|       const {departmentId} = this.search | ||||
|       this.instance.post("/app/appwechatsigninfo/querySignStatistic", null, { | ||||
|         params: {departmentId} | ||||
|       }).then(res => { | ||||
|         if (res?.data) { | ||||
|           this.sta = res.data | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     handleSearchTree(name) { | ||||
|       this.$refs.DeptTree.filter(name) | ||||
|     }, | ||||
|     reloadTable() { | ||||
|       this.page.current = 1 | ||||
|       this.getTableData() | ||||
|     }, | ||||
|     handleSelectDept(data) { | ||||
|       this.search.departmentId = data.id | ||||
|       this.reloadTable() | ||||
|       this.getStaData() | ||||
|     }, | ||||
|     submit() { | ||||
|       return this.$refs.SettingForm.validate() | ||||
|       .then(() => this.instance.post("/app/appwechatsignconfig/addOrUpdate", this.form)) | ||||
|       .then(res => { | ||||
|         if (res?.code == 0) { | ||||
|           return this.$message.success("提交成功") | ||||
|         } | ||||
|       }) | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.getTableData() | ||||
|     this.getDepartments() | ||||
|     this.getStaData() | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| @@ -93,5 +146,9 @@ export default { | ||||
| <style lang="scss" scoped> | ||||
| .list { | ||||
|   height: 100%; | ||||
|  | ||||
|   .staNum { | ||||
|     font-size: 20px; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user