Merge branch 'bonus-jyy-smart-canteen' of http://192.168.0.75:3000/bonus/bonus-ui into bonus-jyy-smart-canteen
This commit is contained in:
		
						commit
						dba754b1a9
					
				| 
						 | 
				
			
			@ -114,8 +114,40 @@ export function getHealthInfoPageApi(data) {
 | 
			
		|||
    params:data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// 查询 健康档案-详情
 | 
			
		||||
export function getHealthInfoDetailApi(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/smart-canteen/health/info/detail-health-info',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    headers: {
 | 
			
		||||
        "merchant-id":"378915229716713472",
 | 
			
		||||
    },
 | 
			
		||||
    data:data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 健康档案-编辑
 | 
			
		||||
export function editHealthInfoApi(data) {
 | 
			
		||||
    return request({
 | 
			
		||||
         url: '/smart-canteen/health/info/edit-health-info',
 | 
			
		||||
        method: 'post',
 | 
			
		||||
        headers: {
 | 
			
		||||
            "merchant-id":"378915229716713472",
 | 
			
		||||
        },
 | 
			
		||||
        data: data
 | 
			
		||||
    })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 健康档案-删除
 | 
			
		||||
export function delHealthInfoApi(data) {
 | 
			
		||||
    return request({
 | 
			
		||||
         url: '/smart-canteen/health/info/del-health-info',
 | 
			
		||||
        method: 'post',
 | 
			
		||||
        headers: {
 | 
			
		||||
            "merchant-id":"378915229716713472",
 | 
			
		||||
        },
 | 
			
		||||
        data: data
 | 
			
		||||
    })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
    <div class="app-container">
 | 
			
		||||
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
 | 
			
		||||
        <el-form-item label="关 键 字">
 | 
			
		||||
            <el-input v-model="queryParams.articleTitle" placeholder="请输入用户姓名、编号或手机号" maxlength="20" clearable style="width: 220px"/>
 | 
			
		||||
            <el-input v-model="queryParams.articleTitle" placeholder="请输入用户姓名、手机号" maxlength="20" clearable style="width: 220px"/>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="所属组织" prop="deptIdList">
 | 
			
		||||
            <el-cascader v-model="queryParams.deptIdList"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
    <div class="app-container">
 | 
			
		||||
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
 | 
			
		||||
        <el-form-item label="关 键 字">
 | 
			
		||||
            <el-input v-model="queryParams.articleTitle" placeholder="请输入用户姓名、编号或手机号" maxlength="20" clearable style="width: 220px"/>
 | 
			
		||||
            <el-input v-model="queryParams.articleTitle" placeholder="请输入用户姓名、手机号" maxlength="20" clearable style="width: 220px"/>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="所属位置" prop="placeIdList">
 | 
			
		||||
            <el-cascader v-model="queryParams.placeIdList"
 | 
			
		||||
| 
						 | 
				
			
			@ -108,33 +108,33 @@
 | 
			
		|||
        <el-dialog :title="title" :visible.sync="open" width="980px" append-to-body>
 | 
			
		||||
            <el-form ref="form" :model="form" :rules="rules" label-width="90px">
 | 
			
		||||
                <el-row justify="center">
 | 
			
		||||
                  <table  align="center" width="100%" cellspacing="0">
 | 
			
		||||
                  <table  align="center" width="80%" cellspacing="0">
 | 
			
		||||
                    <tr >
 | 
			
		||||
                      <td  colspan="4" class="table-title">个人信息</td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr >
 | 
			
		||||
                      <td  class="table-label"><i  class="text-red">*</i> <span >用户姓名</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >测试操作员</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >{{form.nickName}}</span></td>
 | 
			
		||||
                      <td  class="table-label"><i  class="text-red">*</i> <span >用户编号</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >232072</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >{{form.userId}}</span></td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr >
 | 
			
		||||
                      <td  class="table-label"><i  class="text-red">*</i> <span >所属组织</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >测试有限责任公司(默认)/后场临时部门</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >{{form.orgFullName}}</span></td>
 | 
			
		||||
                      <td  class="table-label"><span >用户类别</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >临时人员</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >{{form.userType}}</span></td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr >
 | 
			
		||||
                      <td  class="table-label"><span >用户手机号</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >136****0965</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >{{form.mobile}}</span></td>
 | 
			
		||||
                      <td  class="table-label"><span >性别</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >男</span></td>
 | 
			
		||||
                      <td  class="table-content"><span >{{form.sex==1?'男':'女'}}</span></td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr >
 | 
			
		||||
                      <td  class="table-label"><span >位置信息</span></td>
 | 
			
		||||
                      <td  class="table-content"><span ></span></td>
 | 
			
		||||
                      <td  class="table-label"><span >出生日期</span></td>
 | 
			
		||||
                      <td  class="table-content"><span ></span></td>
 | 
			
		||||
                      <td  class="table-content"><span >{{form.birthday}}</span></td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr >
 | 
			
		||||
                      <td  colspan="4" class="table-title">健康信息</td>
 | 
			
		||||
| 
						 | 
				
			
			@ -192,12 +192,12 @@
 | 
			
		|||
                      </td>
 | 
			
		||||
                      <td  class="table-label"><span >慢性病</span></td>
 | 
			
		||||
                      <td  class="table-content">
 | 
			
		||||
                        <el-select v-model="form.chronicList" placeholder="请选择慢性病"  multiple style="width: 220px" clearable collapse-tags>
 | 
			
		||||
                            <el-option v-for="item in chronicOptions"
 | 
			
		||||
                                :key="item.chronicId"
 | 
			
		||||
                                :label="item.chronicName"
 | 
			
		||||
                                :value="item.chronicId"
 | 
			
		||||
                            ></el-option>
 | 
			
		||||
                        <el-select v-model="form.chronicList" placeholder="请选择慢性病" style="width: 100%" multiple clearable collapse-tags>
 | 
			
		||||
                          <el-option v-for="item in this.chronicOptions"
 | 
			
		||||
                              :key="item.chronicId"
 | 
			
		||||
                              :label="item.chronicName"
 | 
			
		||||
                              :value="item.chronicId"
 | 
			
		||||
                          ></el-option>
 | 
			
		||||
                        </el-select>
 | 
			
		||||
                      </td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
| 
						 | 
				
			
			@ -213,18 +213,39 @@
 | 
			
		|||
                        </el-select>
 | 
			
		||||
                      </td>
 | 
			
		||||
                      <td  class="table-label"><span >怀孕日期</span></td>
 | 
			
		||||
                      <td  class="table-content"></td>
 | 
			
		||||
                      <td  class="table-content">
 | 
			
		||||
                        <el-date-picker
 | 
			
		||||
                            v-model="form.pregnancyDate"
 | 
			
		||||
                            type="date"
 | 
			
		||||
                            align="right"
 | 
			
		||||
                            unlink-panels
 | 
			
		||||
                            value-format="yyyy-MM-dd" style="width: 100%"
 | 
			
		||||
                             >
 | 
			
		||||
                        </el-date-picker>
 | 
			
		||||
                      </td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr >
 | 
			
		||||
                      <td  class="table-label"><span >是否住院</span></td>
 | 
			
		||||
                      <td  class="table-content">
 | 
			
		||||
                        <el-select v-model="form.ifHospitalized" placeholder="请选择是否住院"  multiple style="width: 220px" clearable collapse-tags>
 | 
			
		||||
                            <el-option id="1">是</el-option>
 | 
			
		||||
                            <el-option id="2">否</el-option>
 | 
			
		||||
                        <el-select v-model="form.ifHospitalized" placeholder="请选择是否住院"  style="width: 100%">
 | 
			
		||||
                            <el-option v-for="item in this.ifHospitalizedOptions"
 | 
			
		||||
                                :key="item.ifHospitalized"
 | 
			
		||||
                                :label="item.ifHospitalizedName"
 | 
			
		||||
                                :value="item.ifHospitalized"
 | 
			
		||||
                            ></el-option>
 | 
			
		||||
                        </el-select>
 | 
			
		||||
                      </td>
 | 
			
		||||
                      <td  class="table-label"><span >住院日期</span></td>
 | 
			
		||||
                      <td  class="table-content"></td>
 | 
			
		||||
                      <td  class="table-content">
 | 
			
		||||
                        <el-date-picker
 | 
			
		||||
                            v-model="form.inpatientDate"
 | 
			
		||||
                            type="date"
 | 
			
		||||
                            align="right"
 | 
			
		||||
                            unlink-panels
 | 
			
		||||
                            value-format="yyyy-MM-dd" style="width: 100%"
 | 
			
		||||
                             >
 | 
			
		||||
                        </el-date-picker>
 | 
			
		||||
                      </td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr >
 | 
			
		||||
                      <td  class="table-label"><span >劳动强度</span></td>
 | 
			
		||||
| 
						 | 
				
			
			@ -250,7 +271,7 @@
 | 
			
		|||
                    <tr >
 | 
			
		||||
                      <td  class="table-label"><span >饮食医嘱</span></td>
 | 
			
		||||
                      <td  class="table-content">
 | 
			
		||||
                        <el-select v-model="form.doctorAdvice" placeholder="请选择饮食医嘱"  multiple style="width: 220px" clearable collapse-tags>
 | 
			
		||||
                        <el-select v-model="form.doctorAdvice" placeholder="请选择饮食医嘱"   style="width: 100%" >
 | 
			
		||||
                            <el-option v-for="item in doctorAdviceOptions"
 | 
			
		||||
                                :key="item.doctorAdvice"
 | 
			
		||||
                                :label="item.doctorAdviceName"
 | 
			
		||||
| 
						 | 
				
			
			@ -260,15 +281,18 @@
 | 
			
		|||
                      </td>
 | 
			
		||||
                      <td  class="table-label"><span >体重控制目标</span></td>
 | 
			
		||||
                      <td  class="table-content">
 | 
			
		||||
                        <el-select v-model="form.weightControl" placeholder="请选择"  multiple style="width: 220px" clearable collapse-tags>
 | 
			
		||||
                            <el-option id="1">减肥</el-option>
 | 
			
		||||
                            <el-option id="2">增重</el-option>
 | 
			
		||||
                        <el-select v-model="form.weightControl" placeholder="请选择"   style="width: 100%" >
 | 
			
		||||
                            <el-option v-for="item in weightControlOptions"
 | 
			
		||||
                                :key="item.weightControl"
 | 
			
		||||
                                :label="item.weightControlName"
 | 
			
		||||
                                :value="item.weightControl"
 | 
			
		||||
                            ></el-option>
 | 
			
		||||
                        </el-select>
 | 
			
		||||
                      </td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr >
 | 
			
		||||
                      <td  class="table-label"><span >BMI(kg/m²)</span></td>
 | 
			
		||||
                      <td  class="table-content"></td>
 | 
			
		||||
                      <td  class="table-content">{{form.bmi}}</td>
 | 
			
		||||
                      <td  colspan="2"></td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                  </table>
 | 
			
		||||
| 
						 | 
				
			
			@ -288,7 +312,7 @@
 | 
			
		|||
 | 
			
		||||
<script>
 | 
			
		||||
  import { deptTreeSelect } from '@/api/system/user'
 | 
			
		||||
  import { dictHealthChronicApi,getHealthSciencePageApi,addHealthScienceApi,editHealthScienceApi,delHealthScienceApi,getHealthInfoPageApi } from "@/api/healthCenter/index";
 | 
			
		||||
  import { dictHealthChronicApi,getHealthSciencePageApi,addHealthScienceApi,editHealthScienceApi,delHealthScienceApi,getHealthInfoPageApi,getHealthInfoDetailApi,editHealthInfoApi,delHealthInfoApi } from "@/api/healthCenter/index";
 | 
			
		||||
  import { imgUpLoadTwo } from '@/api/system/upload'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
| 
						 | 
				
			
			@ -314,33 +338,6 @@ export default {
 | 
			
		|||
            // 是否显示弹出层
 | 
			
		||||
            open: false,
 | 
			
		||||
            dateRange:[new Date(),new Date()],
 | 
			
		||||
            pickerOptions: {
 | 
			
		||||
                shortcuts: [{
 | 
			
		||||
                    text: '最近一周',
 | 
			
		||||
                    onClick(picker) {
 | 
			
		||||
                    const start = new Date();
 | 
			
		||||
                    const end = new Date();
 | 
			
		||||
                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
 | 
			
		||||
                    picker.$emit('pick', [start, end]);
 | 
			
		||||
                    }
 | 
			
		||||
                },{
 | 
			
		||||
                    text: '最近一个月',
 | 
			
		||||
                    onClick(picker) {
 | 
			
		||||
                    const start = new Date();
 | 
			
		||||
                    const end = new Date();
 | 
			
		||||
                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
 | 
			
		||||
                    picker.$emit('pick', [start, end]);
 | 
			
		||||
                    }
 | 
			
		||||
                },{
 | 
			
		||||
                    text: '最近三个月',
 | 
			
		||||
                    onClick(picker) {
 | 
			
		||||
                    const start = new Date();
 | 
			
		||||
                    const end = new Date();
 | 
			
		||||
                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 91);
 | 
			
		||||
                    picker.$emit('pick', [start, end]);
 | 
			
		||||
                    }
 | 
			
		||||
                }]
 | 
			
		||||
            },
 | 
			
		||||
            chronicOptions:[],
 | 
			
		||||
            doctorAdviceOptions:[{"doctorAdvice":1,"doctorAdviceName":"禁食"},
 | 
			
		||||
            {"doctorAdvice":2,"doctorAdviceName":"流食"},
 | 
			
		||||
| 
						 | 
				
			
			@ -355,6 +352,14 @@ export default {
 | 
			
		|||
              {"bloodType":5,"bloodTypeName":"Rh阳型"},
 | 
			
		||||
              {"bloodType":6,"bloodTypeName":"Rh阴型"}
 | 
			
		||||
            ],//血型选项
 | 
			
		||||
            weightControlOptions:[
 | 
			
		||||
              {"weightControl":1,"weightControlName":"减重"},
 | 
			
		||||
              {"weightControl":2,"weightControlName":"增重"}
 | 
			
		||||
            ],//体重控制目标
 | 
			
		||||
            ifHospitalizedOptions:[
 | 
			
		||||
              {"ifHospitalized":1,"ifHospitalizedName":"是"},
 | 
			
		||||
              {"ifHospitalized":2,"ifHospitalizedName":"否"}
 | 
			
		||||
            ],//是否住院
 | 
			
		||||
            pregnantOptions:[
 | 
			
		||||
              {"pregnantStatus":0,"pregnantStatusName":"保密"},
 | 
			
		||||
              {"pregnantStatus":1,"pregnantStatusName":"未怀孕"},
 | 
			
		||||
| 
						 | 
				
			
			@ -379,12 +384,27 @@ export default {
 | 
			
		|||
                articleType:null //类型
 | 
			
		||||
            },
 | 
			
		||||
            form: {
 | 
			
		||||
                articleTitle:null,
 | 
			
		||||
                summary:null,
 | 
			
		||||
                chronicIdList:[],
 | 
			
		||||
                coverPhoto:null,
 | 
			
		||||
                articleType:1,
 | 
			
		||||
                articleContent:null,
 | 
			
		||||
                nickName:null,
 | 
			
		||||
                userId:null,
 | 
			
		||||
                orgFullName:null,
 | 
			
		||||
                userType:null,
 | 
			
		||||
                mobile:null,
 | 
			
		||||
                sex:1,
 | 
			
		||||
                birthday:null,
 | 
			
		||||
                doctorNum:null,
 | 
			
		||||
                hospitalNum:null,
 | 
			
		||||
                height:null,
 | 
			
		||||
                weight:null,
 | 
			
		||||
                bloodType:null,
 | 
			
		||||
                chronicList:[],
 | 
			
		||||
                pregnantStatus:null,
 | 
			
		||||
                pregnancyDate:null,
 | 
			
		||||
                ifHospitalized:null,
 | 
			
		||||
                inpatientDate:null,
 | 
			
		||||
                labourIntensity:null,
 | 
			
		||||
                allergen:null,
 | 
			
		||||
                doctorAdvice:null,
 | 
			
		||||
                weightControl:null,
 | 
			
		||||
            },//详情
 | 
			
		||||
            rules: {
 | 
			
		||||
                articleTitle: [
 | 
			
		||||
| 
						 | 
				
			
			@ -505,46 +525,47 @@ export default {
 | 
			
		|||
        },
 | 
			
		||||
        handleUpdate(row) {
 | 
			
		||||
            this.form = Object.assign({}, row);
 | 
			
		||||
            if(this.form.coverPhoto){
 | 
			
		||||
                this.fileList=[{url:this.form.coverPhoto}]
 | 
			
		||||
                this.checkUrlList=[this.form.coverPhoto]
 | 
			
		||||
            }else{
 | 
			
		||||
                this.fileList=[]
 | 
			
		||||
                this.checkUrlList=[]
 | 
			
		||||
            }
 | 
			
		||||
            this.open = true;
 | 
			
		||||
            this.title = "修改健康档案";
 | 
			
		||||
            getHealthInfoDetailApi(this.form).then(response => {
 | 
			
		||||
              this.form=response.data;
 | 
			
		||||
              console.log("this.form",this.form);
 | 
			
		||||
                this.form.chronicList=this.form.chronicIds!=null?this.form.chronicIds.split(","):[];
 | 
			
		||||
                if(this.form.coverPhoto){
 | 
			
		||||
                    this.fileList=[{url:this.form.coverPhoto}];
 | 
			
		||||
                    this.checkUrlList=[this.form.coverPhoto];
 | 
			
		||||
                }else{
 | 
			
		||||
                    this.fileList=[];
 | 
			
		||||
                    this.checkUrlList=[];
 | 
			
		||||
                }
 | 
			
		||||
                this.open = true;
 | 
			
		||||
                this.title = "修改健康档案";
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
        },
 | 
			
		||||
        /** 提交按钮 */
 | 
			
		||||
        submitForm: function() {
 | 
			
		||||
            this.$refs["form"].validate(valid => {
 | 
			
		||||
                if (valid) {
 | 
			
		||||
                    if(this.form.chronicIdList.length>0){
 | 
			
		||||
                        this.form.chronicIds = this.form.chronicIdList.join(",")
 | 
			
		||||
                    console.log("this.form",this.form)
 | 
			
		||||
                    if(this.form.chronicList.length>0){
 | 
			
		||||
                        this.form.chronicIds = this.form.chronicList.join(",")
 | 
			
		||||
                    }else{
 | 
			
		||||
                        this.form.chronicIds = ""
 | 
			
		||||
                    }
 | 
			
		||||
                    this.form.coverPhoto = this.checkUrlList[0]
 | 
			
		||||
 | 
			
		||||
                    if (this.form.articleId != undefined) {
 | 
			
		||||
                        editHealthScienceApi(this.form).then(response => {
 | 
			
		||||
                    if (this.form.userId != undefined) {
 | 
			
		||||
                       this.$modal.msgSuccess("修改成功");
 | 
			
		||||
                        editHealthInfoApi(this.form).then(response => {
 | 
			
		||||
                            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
                            this.open = false;
 | 
			
		||||
                            this.getList();
 | 
			
		||||
                        });
 | 
			
		||||
                    } else {
 | 
			
		||||
                        addHealthScienceApi(this.form).then(response => {
 | 
			
		||||
                            this.$modal.msgSuccess("新增成功");
 | 
			
		||||
                            this.open = false;
 | 
			
		||||
                            this.getList();
 | 
			
		||||
                        });
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
        },
 | 
			
		||||
        handleDelete(row) {
 | 
			
		||||
            this.$modal.confirm('是否确认删除数据项?').then(function() {
 | 
			
		||||
                return delHealthScienceApi(row.articleId);
 | 
			
		||||
                console.log("row",row)
 | 
			
		||||
                return delHealthInfoApi(row);
 | 
			
		||||
            }).then(() => {
 | 
			
		||||
                this.getList();
 | 
			
		||||
                this.$modal.msgSuccess("删除成功");
 | 
			
		||||
| 
						 | 
				
			
			@ -620,6 +641,7 @@ export default {
 | 
			
		|||
    }
 | 
			
		||||
    table td, table th{
 | 
			
		||||
        border-left: 1px solid #dfe6ec;
 | 
			
		||||
        border-right: 1px solid #dfe6ec;
 | 
			
		||||
        border-top: 1px solid #dfe6ec;
 | 
			
		||||
    }
 | 
			
		||||
    .table-title {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -382,6 +382,7 @@ export default {
 | 
			
		|||
        },
 | 
			
		||||
        handleDelete(row) {
 | 
			
		||||
            this.$modal.confirm('是否确认删除数据项?').then(function() {
 | 
			
		||||
                console.log("row",row)
 | 
			
		||||
                return delHealthScienceApi(row.articleId);
 | 
			
		||||
            }).then(() => {
 | 
			
		||||
                this.getList();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue