diff --git a/src/views/modules/shop/commonMedicineTags/shopproduct.vue b/src/views/modules/shop/commonMedicineTags/shopproduct.vue index 8dfa470..e705e03 100644 --- a/src/views/modules/shop/commonMedicineTags/shopproduct.vue +++ b/src/views/modules/shop/commonMedicineTags/shopproduct.vue @@ -321,7 +321,7 @@ this.$emit('delete',[row]) row.isEdit = false var url = "" if(this.oprateType == "yingxiao"){ - url = "/master/medicineLabelAndMarket/editMarketSort" + url = "/master/psycheLabelAndMarket/editMarketSort" }else{ return } diff --git a/src/views/modules/talents/talents-list.vue b/src/views/modules/talents/talents-list.vue index 170d5f4..4dcf503 100644 --- a/src/views/modules/talents/talents-list.vue +++ b/src/views/modules/talents/talents-list.vue @@ -59,15 +59,18 @@ + + + + + + - - - @@ -141,17 +144,83 @@ - + + 主任 + 副主任 + 主任医师 + + + + + + + + +
+ +
+ 修改 +
+ + + + + + + + + + + + + + + - - - + @@ -200,6 +269,7 @@ export default { userId: "", id: "", //新增不传 name: "", + department: '', title: "", specialty: "", region: "", @@ -208,6 +278,32 @@ export default { clinic: "", icon: "" }, + departmentList: [ + { + value: '1', + label: '消化专科' + }, + { + value: '2', + label: '呼吸专科' + }, + { + value: '3', + label: '风湿免疫专科' + }, + { + value: '4', + label: '肿瘤专科' + }, + { + value: '5', + label: '妇科专科' + }, + { + value: '6', + label: '全科医生' + } + ], editId: "", addFormRule: { tel: [ @@ -221,18 +317,6 @@ export default { required: true, message: "请输入姓名", }, - ], - title: [ - { - required: true, - message: "请输入职称", - }, - ], - region: [ - { - required: true, - message: "请输入所属地域", - }, ] }, dataList: [], @@ -247,11 +331,31 @@ export default { titlesub: '', current: 1, - limit: 10 + limit: 10, + + // 选择的值 + selectedCountry: '', + selectedProvince: '', + selectedCity: '', + + // 加载状态 + countryLoading: false, + provinceLoading: false, + cityLoading: false, + + // 数据存储 + countries: [], + provinces: [], + cities: [], + chinaStatus: false, + selectCode: null, + selectedProvId: null, + changeStatus: false }; }, activated(){ this.getDataList(); + this.loadCountries(); }, methods: { // 获取数据列表 @@ -305,10 +409,23 @@ export default { this.addOrUpdateVisible = true; this.titlesub = '新增'; this.statusType = 0; //新增 - this.$refs["addFormRef"].resetFields(); + + this.changeStatus = true; + this.chinaStatus = false; + this.selectCode = null; + this.selectedProvId = null; + this.selectedCity = ''; + + this.selectCode = null; + this.selectedProvId = null; + this.selectedCity = ''; + this.fileList = []; + this.stopLoad = false; this.addForm = { + tel: '', name: "", title: "", + department: '', specialty: "", region: "", reservation: "", @@ -316,11 +433,23 @@ export default { clinic: "", icon: "" } - this.fileList = []; - this.stopLoad = false; + this.$nextTick(() => { + this.$refs.addFormRef.clearValidate(); + }); }, //点击确定 addOrEditCate(){ + //如果是中国 城市必选 + if(this.chinaStatus){ + if(!this.selectedCity){ + this.$message({ + message: "请选择城市", + type: "warning" + }); + + return + } + } if(this.statusType==0){ //如果是新增 this.addCate(); }else if(this.statusType==1){ //如果是修改 @@ -331,9 +460,17 @@ export default { this.$refs["addFormRef"].validate(valid => { if (valid) { var icon = ''; + var region = ''; if(this.fileList&&this.fileList.length>0){ icon = this.fileList[0].url } + if(this.selectedCountry){ + if(!this.selectedProvince){ + region = this.selectedCountry + }else{ + region = this.selectedProvince + this.selectedCity; + } + } this.$http({ url: this.$http.adornUrl("/master/taihuTalent/addTaihuTalent"), method: "post", @@ -341,8 +478,9 @@ export default { userId: this.addForm.userId, name: this.addForm.name, title: this.addForm.title, + department: this.addForm.department, specialty: this.addForm.specialty, - region: this.addForm.region, + region: region, reservation: this.addForm.reservation, introduce: this.addForm.introduce, clinic: this.addForm.clinic, @@ -355,7 +493,7 @@ export default { type: "success" }); this.addOrUpdateVisible = false; - + this.dataList = []; this.getDataList(); } }); @@ -366,9 +504,17 @@ export default { this.$refs["addFormRef"].validate(valid => { if (valid) { var icon = ''; + var region = ''; if(this.fileList&&this.fileList.length>0){ icon = this.fileList[0].url } + if(this.selectedCountry){ + if(!this.selectedProvince){ + region = this.selectedCountry + }else{ + region = this.selectedProvince + this.selectedCity; + } + } this.$http({ url: this.$http.adornUrl("/master/taihuTalent/updateTaihuTalent"), method: "post", @@ -376,8 +522,9 @@ export default { id: data.id, name: data.name, title: data.title, + department: data.department, specialty: data.specialty, - region: data.region, + region: region, reservation: data.reservation, introduce: data.introduce, clinic: data.clinic, @@ -390,13 +537,20 @@ export default { type: "success" }); this.addOrUpdateVisible = false; - + this.dataList = []; this.getDataList(); } }); } }) }, + //修改地域 + changeCountry(){ + this.changeStatus = true; + this.chinaStatus = false; + this.selectCode = null; + this.selectedProvId = null; + }, //取消 cancleClose(){ this.addOrUpdateVisible = false; @@ -420,10 +574,12 @@ export default { this.addOrUpdateVisible = true; this.titlesub = '修改'; this.statusType = 1; //修改 + this.changeStatus = false; this.addForm.id = data.id; this.addForm.name = data.name; this.addForm.title = data.title; + this.addForm.department = data.department; this.addForm.specialty = data.specialty; this.addForm.region = data.region; this.addForm.reservation = data.reservation; @@ -436,6 +592,9 @@ export default { url: data.icon }); } + this.$nextTick(() => { + this.$refs.addFormRef.clearValidate(); + }); }, //点击删除 deleteHandle(data){ @@ -489,6 +648,85 @@ export default { handleRemove(file, fileList) { this.fileList = []; }, + + //获取国家数据 + loadCountries() { + this.countryLoading = true; + this.$http({ + url: this.$http.adornUrl("/common/baseArea/getAllBaseArea"), + method: "post", + data: this.$http.adornData({}), + }).then(({ data }) => { + if (data && data.code === 0) { + if (data.baseAreas&&data.baseAreas.length>0) { + this.countryLoading = false; + this.countries = data.baseAreas; + } + } + }); + }, + + //获取中国省份 + loadProvinces() { + this.provinceLoading = true; + this.$http({ + url: this.$http.adornUrl("/common/province/getProvinceList"), + method: "post", + data: this.$http.adornData({}), + }).then(({ data }) => { + if (data && data.code === 0) { + if (data.provinceList&&data.provinceList.length>0) { + this.provinceLoading = false; + this.provinces = data.provinceList; + } + } + }); + }, + + //选择国家 + handleCountryChange(code){ + if(code=='86'){ + this.chinaStatus = true; + }else{ + this.chinaStatus = false; + } + const data = this.countries.find(country => country.code === code); + this.selectedCountry = data.title; + this.selectedProvince = ''; + this.selectedCity = ''; + this.selectedProvId = null; + this.provinces = []; + this.cities = []; + + console.log('所选国家-', this.selectedCountry) + }, + //选择省份 + handleProvinceChange(provId){ + this.cityLoading = true; + const data = this.provinces.find(prov => prov.provId === provId); + this.selectedProvince = data.provName; + this.selectedCity = ''; + this.$http({ + url: this.$http.adornUrl("/common/province/getCityList?provId="+ provId), + method: "post", + data: this.$http.adornData({}), + }).then(({ data }) => { + if (data && data.code === 0) { + if (data.prov&&data.prov.length>0) { + this.cities = data.prov; + this.cityLoading = false; + } + } + }); + + console.log('所选省份-', this.selectedProvince) + }, + //选择城市 + handleCityChange(val){ + this.selectedCity = val; + + console.log('所选城市-', this.selectedCity) + }, }, }; @@ -560,4 +798,10 @@ export default { ::v-deep.el-form-item__label{ width: 110px; } +.editBtn{ + margin-left: 10px; + width: 70px; + border-color: #17B3A3; + color: #17B3A3; +} diff --git a/src/views/modules/trainingCourse/training-course-list.vue b/src/views/modules/trainingCourse/training-course-list.vue index 540d8eb..6455ad0 100644 --- a/src/views/modules/trainingCourse/training-course-list.vue +++ b/src/views/modules/trainingCourse/training-course-list.vue @@ -116,6 +116,20 @@ + + + @@ -132,7 +146,7 @@ @click="editHandle(scope.row)" >修改 - + + + + + { if (data && data.code === 0) { @@ -409,7 +438,11 @@ export default { }, //设置开关 修改数据 changeSingupFlag(data){ - this.editCate(data); + this.editCate(data, '1'); + }, + //上下架开关 + changeDisplayFlag(data){ + this.editCate(data, '1'); }, //新增 @@ -417,7 +450,6 @@ export default { this.addOrUpdateVisible = true; this.statusType = 0; //新增 this.titlesub = '新增'; - this.$refs["addFormRef"].resetFields(); this.addForm = { title: "", //标题 type: 1, //1线上 2线下 @@ -433,18 +465,22 @@ export default { threeHuFee: '', fiveHuFee: '', singupFlag: 1, //1可报名 0不可报名 + displayFlag: 0, sort: '' } this.fileList = []; this.vipType = []; this.svipType = []; + this.$nextTick(() => { + this.$refs.addFormRef.clearValidate(); + }); }, //点击确定 addOrEditCate(){ if(this.statusType==0){ //如果是新增 this.addCate(); }else if(this.statusType==1){ //如果是修改 - this.editCate(this.addForm); + this.editCate(this.addForm, '0'); } }, //取消 @@ -452,47 +488,56 @@ export default { this.addOrUpdateVisible = false; }, //修改 - editCate(data){ - this.$refs["addFormRef"].validate(valid => { - if (valid) { - var icon = ''; - if(this.fileList&&this.fileList.length>0){ - icon = this.fileList[0].url + editCate(data, type){ + if(type=='0'){ + this.$refs["addFormRef"].validate(valid => { + if (valid) { + this.submitData(data); } - this.$http({ - url: this.$http.adornUrl("/master/trainingClass/editTrainingClass"), - method: "post", - data: this.$http.adornData({ - id: data.id, - title: data.title, - type: data.type, - year: data.year, - trainingDate: data.trainingDate, - endDate: data.endDate, - singupFlag: data.singupFlag, - icon: icon, - fee: data.fee, - vipType: String(this.vipType), - vipFee: data.vipFee, - svipType: String(this.svipType), - svipFee: data.svipFee, - threeHuFee: data.threeHuFee, - fiveHuFee: data.fiveHuFee, - sort: data.sort - }), - }).then(({ data }) => { - if (data && data.code === 0) { - this.$message({ - message: "操作成功", - type: "success" - }); - this.addOrUpdateVisible = false; - - this.getDataList(); - } + }) + }else{ + this.submitData(data); + } + }, + //修改 + submitData(data){ + var icon = ''; + if(this.fileList&&this.fileList.length>0){ + icon = this.fileList[0].url + } + this.$http({ + url: this.$http.adornUrl("/master/trainingClass/editTrainingClass"), + method: "post", + data: this.$http.adornData({ + id: data.id, + title: data.title, + type: data.type, + year: data.year, + trainingDate: data.trainingDate, + endDate: data.endDate, + singupFlag: data.singupFlag, + displayFlag: data.displayFlag, + icon: icon, + fee: data.fee, + vipType: String(this.vipType), + vipFee: data.vipFee, + svipType: String(this.svipType), + svipFee: data.svipFee, + threeHuFee: data.threeHuFee, + fiveHuFee: data.fiveHuFee, + sort: data.sort + }), + }).then(({ data }) => { + if (data && data.code === 0) { + this.$message({ + message: "操作成功", + type: "success" }); + this.addOrUpdateVisible = false; + + this.getDataList(); } - }) + }); }, // 每页数 sizeChangeHandle(val) { @@ -523,6 +568,7 @@ export default { trainingDate: this.addForm.trainingDate, endDate: this.addForm.endDate, singupFlag: String(this.addForm.singupFlag), + displayFlag: String(this.addForm.displayFlag), icon: icon, fee: this.addForm.fee, vipType: String(this.vipType), @@ -563,6 +609,7 @@ export default { this.addForm.trainingDate = data.trainingDate; this.addForm.endDate = data.endDate; this.addForm.singupFlag = Number(data.singupFlag); + this.addForm.displayFlag = Number(data.displayFlag); this.addForm.icon = data.icon; //图片赋值 if(data.icon){ @@ -578,6 +625,9 @@ export default { this.addForm.threeHuFee = data.threeHuFee; this.addForm.fiveHuFee = data.fiveHuFee; this.addForm.sort = data.sort; + this.$nextTick(() => { + this.$refs.addFormRef.clearValidate(); + }); }, //上传图片 handlePreview(file) { diff --git a/src/views/modules/trainingCourse/training-course-user.vue b/src/views/modules/trainingCourse/training-course-user.vue index a2a02f4..2a90a76 100644 --- a/src/views/modules/trainingCourse/training-course-user.vue +++ b/src/views/modules/trainingCourse/training-course-user.vue @@ -4,6 +4,7 @@ :inline="true" :model="dataForm" @keyup.enter.native="getDataList()" + style="position: relative;" > 报名 + + + 导出 + - + {}); }, + //导出 + handleExport() { + try { + this.$http({ + url: this.$http.adornUrl("/master/trainingClass/exportTrainingClassUser"), + method: "post", + data: this.$http.adornData({ + current: this.pageIndex, + limit: this.pageSize, + trainingId: this.trainingId, + tel: this.dataForm.tel, + createTimeSort: this.sortParams.date + }), + responseType: "blob" + }).then(res => { + const blob = new Blob([res.data], { + type: + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + }); + + const link = document.createElement("a"); + link.href = window.URL.createObjectURL(blob); + link.download = '['+ this.trainingTitle +']-用户数据文件'; + link.click(); + + window.URL.revokeObjectURL(link.href); // 释放内存 + this.$message({ + message: "培训班用户数据文件下载完成,请注意查看!", + type: "success", + duration: 3000, + showClose: true + }); + + }); + } catch (err) { + this.$message.error("文件下载失败!"); + } + }, }, };