diff --git a/src/components/BatchProject.vue b/src/components/BatchProject.vue index d0414f4..6482203 100644 --- a/src/components/BatchProject.vue +++ b/src/components/BatchProject.vue @@ -4,19 +4,19 @@ 录入格式:1.请按照 “项目名称 空格 单次价格” 格式输入。2.每行一条数据, 回车 确认

- - -
-
+ +
+
{{ item.name }}
- - + + - @@ -41,38 +41,39 @@ export default { data() { return { formRules: { - name: [ + classify_name: [ { required: true, message: '请输入', trigger: 'blur' } ], - }, form:{ - name:'', + classify_name:'', + groupType: '1', + project_contents:'', + classify_id:'' }, - groupType: '1', - notice:'', - projectSearchId:'', groupOptions: [ { label: '归入已有分组', value: '1' }, { label: '新增分组', value: '2' }, // 禁用选项 - { label: '不分组', value: '3' }, + // { label: '不分组', value: '3' }, ], } }, methods: { getNotice(e){ // \n 换行符 - let flag = e.includes('\n') - console.log(JSON.stringify(e),flag,'===---'); - }, - changeName(e){ - console.log(e,'===---'); - }, - radioChange(data) { - console.log(data, 'radio--data'); + let str = e.replace('\n','') + this.form.project_contents = str; }, selectTag(item){ - this.projectSearchId = item.id + this.form.classify_id = item.id + }, + formReset(){ + this.form = { + classify_name:'', + groupType: '1', + project_contents:'', + classify_id:'' + } } }, } @@ -128,6 +129,9 @@ export default { background: #F2F3F5; } } + .tabProject1{ + width: 100%; + } .form-special{ align-items: flex-start; } diff --git a/src/components/GuipTable.vue b/src/components/GuipTable.vue index df58773..4dbb20b 100644 --- a/src/components/GuipTable.vue +++ b/src/components/GuipTable.vue @@ -78,7 +78,6 @@ export default { methods: { handleSelectionChange(row) { // 获取的当前行信息 - console.log(row, '======'); this.$emit('selectChange', row) }, // 点击确定按钮 diff --git a/src/views/HosInformation.vue b/src/views/HosInformation.vue index 3b369c5..3abfaf0 100644 --- a/src/views/HosInformation.vue +++ b/src/views/HosInformation.vue @@ -270,7 +270,7 @@ - + { - this.projectTagData = response.data - - }).catch(error => { - console.error(error, 'error') - }) - }, // 修改项目价格 changePrice(row) { if (row.sort) { @@ -664,14 +654,14 @@ export default { }).then(response => { if (response.code == 0) { this.$Message.success('修改成功') - this.getInitData() + this.fetchProjectData() } }).catch(error => { console.error(error, 'error') }) }, addNewSetMenu() { - this.$router.push(`/addNewTreatment?doctor_id=${this.doctor_id}&depart_id${this.depart_id}`) + this.$router.push(`/addNewTreatment?doctor_id=${this.doctor_id}&depart_id=${this.depart_id}`) }, addNewGroup(){ this.dialogVisible1 = true @@ -697,22 +687,50 @@ export default { if (this.dialogVisible1) { this.$refs['projectNameForm'].validate((valid) => { if (valid) { - alert('submit!'); - this.dialogVisible1 = false; - + this.$http('POST', '/api/admin/add_project_group', { + name:this.form1.projectName.trim(), + depart_id: this.depart_id, + doctor_id: this.doctor_id, + }).then(response => { + if (response.code == 0) { + this.$Message.success('修改成功') + this.dialogVisible1 = false; + this.form1.projectName = '' + this.fetchProjectData() + } + }).catch(error => { + this.$Message.error(error || '错误!') + }) } else { - console.log('error submit!!'); + this.$Message.info('项目分组名称不可为空') return false; } }); } else if (this.dialogVisible) { - this.$Message.success('点击了确认按钮'); - this.dialogVisible = false; + let data = this.$refs.channelProject.form; + if(!data.project_contents || (data.groupType == '1' && !data.classify_id) || (data.groupType == '2' && !data.classify_name)){ + this.$Message.info('请填写完整信息!') + }else{ + this.$http('POST', '/api/admin/mitil_add_project', { + depart_id: this.depart_id, + doctor_id: this.doctor_id, + ...data + }).then(response => { + if (response.code == 0) { + this.$Message.success('新增项目成功') + this.$refs.channelProject.formReset() + this.dialogVisible = false; + this.fetchProjectData(); + } + }).catch(error => { + this.$Message.error(error || '错误!') + }) + } } }, // 取消按钮事件 handleCancel() { - this.$Message.warning('点击了取消按钮'); + if(this.dialogVisible)this.$refs.channelProject.formReset() this.dialogVisible = false; this.dialogVisible1 = false; },