| @@ -653,6 +653,12 @@ export default { | ||||
|       this.physicalSignsList = response.rows; | ||||
|     }); | ||||
|   }, | ||||
|   activated() { | ||||
|     if (this.$route.query.cusName) { | ||||
|       this.queryParams.name = this.$route.query.cusName; | ||||
|       this.handleQuery(); | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|     isPartner() { | ||||
|       return this.roles && this.roles.includes("partner"); | ||||
|   | ||||
| @@ -32,7 +32,12 @@ | ||||
|         /> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="营养师" prop="nutritionistId"> | ||||
|         <el-select v-model="queryParams.nutritionistId" clearable filterable placeholder="请选择"> | ||||
|         <el-select | ||||
|           v-model="queryParams.nutritionistId" | ||||
|           clearable | ||||
|           filterable | ||||
|           placeholder="请选择" | ||||
|         > | ||||
|           <el-option | ||||
|             v-for="dict in nutritionistIdOptions.slice(1)" | ||||
|             :key="dict.dictValue" | ||||
| @@ -42,7 +47,12 @@ | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="售后" prop="afterNutritionistId"> | ||||
|         <el-select v-model="queryParams.afterNutritionistId" clearable filterable placeholder="请选择"> | ||||
|         <el-select | ||||
|           v-model="queryParams.afterNutritionistId" | ||||
|           clearable | ||||
|           filterable | ||||
|           placeholder="请选择" | ||||
|         > | ||||
|           <el-option | ||||
|             v-for="dict in afterSaleIdOptions.slice(1)" | ||||
|             :key="dict.dictValue" | ||||
| @@ -52,7 +62,11 @@ | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|  | ||||
|       <el-form-item label="打卡日期" prop="logTimeScope" style="margin-left:15px"> | ||||
|       <el-form-item | ||||
|         label="打卡日期" | ||||
|         prop="logTimeScope" | ||||
|         style="margin-left: 15px" | ||||
|       > | ||||
|         <el-date-picker | ||||
|           v-model="logTimeScope" | ||||
|           type="daterange" | ||||
| @@ -153,7 +167,16 @@ | ||||
|           <span>{{ parseTime(scope.row.logTime, "{y}-{m}-{d}") }}</span> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|       <el-table-column label="姓名" align="center" prop="customerName" /> | ||||
|       <el-table-column label="姓名" align="center" prop="customerName"> | ||||
|         <template slot-scope="scope"> | ||||
|           <div | ||||
|             @click="handleOnNameClick(scope.row.customerName)" | ||||
|             class="user_name_style" | ||||
|           > | ||||
|             {{ scope.row.customerName }} | ||||
|           </div> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|       <el-table-column label="当天体重" align="center" prop="weight"> | ||||
|         <template slot-scope="scope"> | ||||
|           <span>{{ `${scope.row.weight} 斤` }}</span> | ||||
| @@ -171,7 +194,6 @@ | ||||
|       <el-table-column label="营养师" align="center" prop="nutritionist" /> | ||||
|       <el-table-column label="售后" align="center" prop="afterNutritionist" /> | ||||
|  | ||||
|        | ||||
|       <el-table-column | ||||
|         label="睡觉时间" | ||||
|         align="center" | ||||
| @@ -192,14 +214,12 @@ | ||||
|         prop="sport" | ||||
|         :formatter="sportFormat" | ||||
|       /> | ||||
|       <el-table-column | ||||
|         label="情绪" | ||||
|         align="center" | ||||
|         prop="emotion" | ||||
|         width="120" | ||||
|       > | ||||
|       <el-table-column label="情绪" align="center" prop="emotion" width="120"> | ||||
|         <template slot-scope="scope"> | ||||
|           <AutoHideMessage :maxLength="4" :data="scope.row.emotion"></AutoHideMessage> | ||||
|           <AutoHideMessage | ||||
|             :maxLength="4" | ||||
|             :data="scope.row.emotion" | ||||
|           ></AutoHideMessage> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|  | ||||
| @@ -216,7 +236,10 @@ | ||||
|         width="120" | ||||
|       > | ||||
|         <template slot-scope="scope"> | ||||
|           <AutoHideMessage :maxLength="4" :data="scope.row.slyEatFood"></AutoHideMessage> | ||||
|           <AutoHideMessage | ||||
|             :maxLength="4" | ||||
|             :data="scope.row.slyEatFood" | ||||
|           ></AutoHideMessage> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|       <el-table-column | ||||
| @@ -315,7 +338,7 @@ import { mapGetters } from "vuex"; | ||||
| import PunchLogDetail from "@/components/PunchLog/PunchLogDetail"; | ||||
| import PunchLogEdit from "@/components/PunchLog/PunchLogEdit"; | ||||
| import AutoHideMessage from "@/components/AutoHideMessage"; | ||||
| import NotPunchCustomer from "@/components/PunchLog/NotPunchCustomer" | ||||
| import NotPunchCustomer from "@/components/PunchLog/NotPunchCustomer"; | ||||
| import dayjs from "dayjs"; | ||||
| export default { | ||||
|   name: "WxUserLog", | ||||
| @@ -356,7 +379,7 @@ export default { | ||||
|         appid: null, | ||||
|         phone: null, | ||||
|         nutritionistId: null, | ||||
|         afterNutritionistId: null | ||||
|         afterNutritionistId: null, | ||||
|       }, | ||||
|       // 表单参数 | ||||
|       form: {}, | ||||
| @@ -364,14 +387,17 @@ export default { | ||||
|       rules: {}, | ||||
|       logTimePickerOptions: { | ||||
|         disabledDate(time) { | ||||
|           return time.getTime() > dayjs() | ||||
|           return time.getTime() > dayjs(); | ||||
|         }, | ||||
|       }, | ||||
|       logTimeScope: null | ||||
|       logTimeScope: null, | ||||
|     }; | ||||
|   }, | ||||
|   components: { | ||||
|     PunchLogDetail,AutoHideMessage,PunchLogEdit,NotPunchCustomer | ||||
|     PunchLogDetail, | ||||
|     AutoHideMessage, | ||||
|     PunchLogEdit, | ||||
|     NotPunchCustomer, | ||||
|   }, | ||||
|   created() { | ||||
|     this.getList(); | ||||
| @@ -396,15 +422,21 @@ export default { | ||||
|       // 售后字典 | ||||
|       "afterSaleIdOptions", | ||||
|       // 主营养师字典 | ||||
|       "nutritionistIdOptions" | ||||
|       "nutritionistIdOptions", | ||||
|     ]), | ||||
|   }, | ||||
|   methods: { | ||||
|     /** 查询微信用户记录列表 */ | ||||
|     getList() { | ||||
|       this.loading = true; | ||||
|       this.queryParams.beginTime = this.logTimeScope && this.logTimeScope.length > 0 ? this.logTimeScope[0] : null; | ||||
|       this.queryParams.endTime = this.logTimeScope && this.logTimeScope.length > 0 ? this.logTimeScope[1] : null; | ||||
|       this.queryParams.beginTime = | ||||
|         this.logTimeScope && this.logTimeScope.length > 0 | ||||
|           ? this.logTimeScope[0] | ||||
|           : null; | ||||
|       this.queryParams.endTime = | ||||
|         this.logTimeScope && this.logTimeScope.length > 0 | ||||
|           ? this.logTimeScope[1] | ||||
|           : null; | ||||
|       listWxUserLog(this.queryParams).then((response) => { | ||||
|         this.wxUserLogList = response.rows; | ||||
|         this.total = response.total; | ||||
| @@ -526,15 +558,11 @@ export default { | ||||
|     /** 删除按钮操作 */ | ||||
|     handleDelete(row) { | ||||
|       const ids = row.id || this.ids; | ||||
|       this.$confirm( | ||||
|         '是否确认删除该用户的打卡记录?', | ||||
|         "警告", | ||||
|         { | ||||
|       this.$confirm("是否确认删除该用户的打卡记录?", "警告", { | ||||
|         confirmButtonText: "确定", | ||||
|         cancelButtonText: "取消", | ||||
|         type: "warning", | ||||
|         } | ||||
|       ) | ||||
|       }) | ||||
|         .then(function () { | ||||
|           return delWxUserLog(ids); | ||||
|         }) | ||||
| @@ -565,10 +593,28 @@ export default { | ||||
|         }) | ||||
|         .catch(function () {}); | ||||
|     }, | ||||
|     handleOnNameClick(name) { | ||||
|       // console.log({ name }); | ||||
|       this.$router.push(`/customer?cusName=${name}`); | ||||
|     }, | ||||
|     showNotLunch() { | ||||
|       this.queryParams.startDate = this.logTimeScope && this.logTimeScope.length > 0 ? this.logTimeScope[0] : null; | ||||
|       this.$refs.notPunchCustomerRef.showDialog(this.queryParams, this.nutritionistIdOptions,this.afterSaleIdOptions); | ||||
|     } | ||||
|       this.queryParams.startDate = | ||||
|         this.logTimeScope && this.logTimeScope.length > 0 | ||||
|           ? this.logTimeScope[0] | ||||
|           : null; | ||||
|       this.$refs.notPunchCustomerRef.showDialog( | ||||
|         this.queryParams, | ||||
|         this.nutritionistIdOptions, | ||||
|         this.afterSaleIdOptions | ||||
|       ); | ||||
|     }, | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
| <style lang="scss" scoped> | ||||
| .app-container { | ||||
|   .user_name_style { | ||||
|     cursor: pointer; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user