diff --git a/src/views/system/hospitalPerson/index.vue b/src/views/system/hospitalPerson/index.vue index ec417e3..566f08e 100644 --- a/src/views/system/hospitalPerson/index.vue +++ b/src/views/system/hospitalPerson/index.vue @@ -8,11 +8,22 @@ v-show="showSearch" label-width="130px" > + + + {{ queryParams.hospitalName }} + + + + + {{ queryParams.departmentName }} + + @@ -182,18 +193,19 @@ {{ form.hospitalName }} - + @@ -277,8 +294,8 @@ @@ -302,11 +319,10 @@ type="textarea" :rows="5" maxlength="30" - style="width: 540px;" + style="width: 540px" placeholder="请输入个人简介" v-model="form.personIntroduce" > -
@@ -539,7 +555,7 @@ @@ -605,7 +621,7 @@ @@ -678,6 +694,7 @@ v-model="form.personAddress" placeholder="请输入科室地址" style="width: 250px" + maxlength="300" /> @@ -707,10 +724,10 @@ @@ -735,10 +752,10 @@ prop="personIntroduce" style="margin-top: 10px; margin-left: 10px" > - @@ -751,8 +768,7 @@ > - + > -->
-
@@ -901,7 +915,7 @@ :show-overflow-tooltip="true" > --> - - + --> - @@ -1020,7 +1034,7 @@ :limit.sync="departmentqueryParams.pageSize" @pagination="departmentList" /> - + --> @@ -1126,6 +1140,7 @@ export default { // 是否显示弹出层 open: false, addopen: false, + homenumber: false, // 查询参数 queryParams: { pageNum: 1, @@ -1134,6 +1149,8 @@ export default { departmentId: null, personCode: null, personName: null, + departmentName: null, + hospitalName: null, personPhone: null, personAddress: null, cardNo: null, @@ -1160,11 +1177,12 @@ export default { departmentqueryParams: { pageNum: 1, pageSize: 10, + hospitalId: "", departmentCode: "", departmentName: "", }, infolist: [], - deletUploadImages:[], + deletUploadImages: [], // 表单校验 rules: { hospitalId: [ @@ -1345,7 +1363,24 @@ export default { this.info(); }, methods: { - + /**只能输入数字且有小数点最多保留两位*/ + checkPrice() { + let checkPlan = "" + this.form.consultingFee; + checkPlan = checkPlan + .replace(/[^\d.]/g, "") // 清除“数字”和“.”以外的字符 + .replace(/\.{2,}/g, ".") // 只保留第一个. 清除多余的 + .replace(/^\./g, "") // 保证第一个为数字而不是. + .replace(".", "$#$") + .replace(/\./g, "") + .replace("$#$", "."); + if (checkPlan.indexOf(".") < 0 && checkPlan !== "") { + // 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额 + checkPlan = parseFloat(checkPlan) + ""; + } else if (checkPlan.indexOf(".") >= 0) { + checkPlan = checkPlan.replace(/^()*(\d+)\.(\d\d).*$/, "$1$2.$3"); // 只能输入两个小数 + } + this.form.consultingFee = checkPlan; + }, //接收图片所属的item imgclassifyItem(item) { let imgUrlData = JSON.parse(item); @@ -1366,52 +1401,69 @@ export default { }, imgUrl(imgUrl) { - console.log(imgUrl,'新上传'); + console.log(imgUrl, "新上传"); this.form.personPictureUrl = imgUrl; - this.deletUploadImages.push(imgUrl) + this.deletUploadImages.push(imgUrl); }, + nurseclick(row) { - console.log(row); - this.form.hospitalName = row.hospitalName; + console.log(this.homenumber); + if (this.homenumber) { + this.queryParams.hospitalName = row.hospitalName; + this.queryParams.hospitalId = row.id; + } else { + this.hospitalId = row.id; + // this.form.hospitalId = row.id; + this.form.hospitalName = row.hospitalName; + } this.form.hospitalId = row.id; this.innerVisible = false; + // this.stationcancel(); }, - nurseclickxg(row) { - console.log(row); - this.form.hospitalName = row.hospitalName; - this.form.hospitalId = row.id; - this.innerVisiblexg = false; - }, + // nurseclickxg(row) { + // console.log(row); + // this.form.hospitalName = row.hospitalName; + // this.hospitalId = row.id; + // this.innerVisiblexg = false; + // }, // 科室 departmentclick(row) { console.log(row); + this.departmentId = row.id; this.form.departmentName = row.departmentName; - this.form.departmentId = row.id; - // } + // this.form.departmentId = row.id; + if (this.homenumber) { + this.queryParams.departmentName = row.departmentName; + this.queryParams.departmentId = row.id; + this.form.departmentId = row.id; + } else { + this.form.departmentId = row.id; + this.form.departmentName = row.departmentName; + } this.innerVisibledepartment = false; }, - departmentclickxg(row) { - console.log(row); - this.form.departmentName = row.departmentName; - this.form.departmentId = row.id; - // } - this.innerVisibledepartmentxg = false; - }, + // departmentclickxg(row) { + // console.log(row); + // this.form.departmentName = row.departmentName; + // this.departmentId = row.id; + // // } + // this.innerVisibledepartmentxg = false; + // }, //医院关闭 innerVisiblecancel() { this.innerVisible = false; }, - innerVisiblecancelxg() { - this.innerVisiblexg = false; - }, + // innerVisiblecancelxg() { + // this.innerVisiblexg = false; + // }, //科室关闭 innerVisiblecanceldepart() { this.innerVisibledepartment = false; }, - innerVisiblecanceldepartxg() { - this.innerVisibledepartmentxg = false; - }, + // innerVisiblecanceldepartxg() { + // this.innerVisibledepartmentxg = false; + // }, //删除deldisease deldisease(index) { this.form.hospitalPersonCertificateList.splice(index, 1); @@ -1419,9 +1471,9 @@ export default { adddisease() { this.idd++; var obj = { - certificateName: "", - certificateSort: "", - certificateUrl: "", + certificateName: null, + certificateSort: null, + certificateUrl: null, idd: this.idd, }; if (this.form.hospitalPersonCertificateList.length == 5) { @@ -1433,6 +1485,7 @@ export default { /** 查询健康咨询-科室人员信息列表 */ getList() { this.loading = true; + // this.queryParams.hospitalId = this.form.hospitalId; listHospitalPerson(this.queryParams).then((response) => { this.hospitalPersonList = response.rows; this.total = response.total; @@ -1440,28 +1493,40 @@ export default { }); }, // 新增医院按钮 - clickinnerVisible() { + clickinnerVisible(item) { + console.log(item); this.info(); this.innerVisible = true; + this.homenumber = item; + if (this.homenumber) { + this.hospitalId = this.queryParams.hospitalId; + } else { + this.hospitalId = this.form.hospitalId; + } }, - // 修改医院按钮 - clickinnerVisiblexg() { - this.addresetQuery(); - this.innerVisiblexg = true; - }, + // // 修改医院按钮 + // clickinnerVisiblexg() { + // this.addresetQuery(); + // this.innerVisiblexg = true; + // }, //新增科室按钮 - clicklist() { - this.departmentList(); - this.innerVisibledepartment = true; - }, - // 修改科室按钮 - clickdepartmentlist() { - this.departmentList(); - // this.form.departmentId = item.departmentId; - this.innerVisibledepartmentxg = true; + clicklist(item) { + this.homenumber = item; + if (this.homenumber) { + // 为查询页面时 + this.hospitalId = this.queryParams.hospitalId; + } else { + this.hospitalId = this.form.hospitalId; + } + if (this.hospitalId) { + this.departmentList(); + this.innerVisibledepartment = true; + } else { + this.$message.error("请先选择所属医院"); + } }, departmentList() { - // this.loading = true; + this.departmentqueryParams.hospitalId = this.hospitalId; listHospitalDepartment(this.departmentqueryParams).then((response) => { this.hospitalDepartmentList = response.rows; this.total3 = response.total; @@ -1504,10 +1569,12 @@ export default { }); } console.log("2222", this.deletNewImgs); - if(this.deletUploadImages.length>0){ - updatePicture({pictureUrlList:this.deletUploadImages}).then((res) => { - this.open = false; - }); + if (this.deletUploadImages.length > 0) { + updatePicture({ pictureUrlList: this.deletUploadImages }).then( + (res) => { + this.open = false; + } + ); } this.imgsurl = { pictureUrlList: [] }; this.addopen = false; @@ -1532,6 +1599,8 @@ export default { personPictureUrl: null, createBy: null, createTime: null, + departmentId: null, + hospitalId: null, updateBy: null, updateTime: null, hospitalName: "请选择所属医院", @@ -1544,7 +1613,7 @@ export default { }, ], }; - this.deletUploadImages=[] + this.deletUploadImages = []; // this.resetForm("form"); }, /** 搜索按钮操作 */ @@ -1554,7 +1623,17 @@ export default { }, /** 重置按钮操作 */ resetQuery() { - this.resetForm("queryForm"); + this.form.departmentId = ""; + this.form.hospitalId = ""; + this.departmentqueryParams = { + pageNum: 1, + pageSize: 10, + }; + this.queryParams = { + pageNum: 1, + pageSize: 10, + }; + // this.resetForm("queryForm"); this.handleQuery(); }, // 多选框选中数据 @@ -1593,6 +1672,10 @@ export default { }, /** 提交按钮 */ submitForm() { + if (this.form.consultingFee) { + this.form.consultingFee = Number(this.form.consultingFee); + } + this.$refs["form"].validate((valid) => { if (valid) { if (this.form.id != null) { @@ -1615,9 +1698,7 @@ export default { handleDelete(row) { const ids = row.id || this.ids; this.$modal - .confirm( - '是否确认删除此人员信息?' - ) + .confirm("是否确认删除此人员信息?") .then(function () { return delHospitalPerson(ids); }) @@ -1640,3 +1721,12 @@ export default { }, }; + \ No newline at end of file