Commit 33740995 authored by miaojiale's avatar miaojiale

医联体管理接口

parent 674a77d4
import request from "@/utils/request"
/* 数据库管理 */
export function addMedicalunion(data = {}) {
return request({
url: "/cloud-upms/sys/union/addOrUpdate",
method: "post",
data,
})
}
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<el-dialog :visible.sync="addVisible" width="520px" :show-close="true"> <el-dialog :visible.sync="addVisible" width="520px" :show-close="true">
<div class="title">添加医联体</div> <div class="title">添加医联体</div>
<el-form <el-form
ref="form"
:model="form" :model="form"
:label-position="'right'" :label-position="'right'"
label-width="110px" label-width="110px"
...@@ -30,6 +31,8 @@ ...@@ -30,6 +31,8 @@
v-for="(item, index) in formList" v-for="(item, index) in formList"
:key="index" :key="index"
:label="item.label" :label="item.label"
:rules="[{ required: true, message: item.label + '不能为空' }]"
:prop="item.prop"
> >
<el-input <el-input
v-if="item.type == 'input'" v-if="item.type == 'input'"
...@@ -52,7 +55,7 @@ ...@@ -52,7 +55,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="addVisible = false">保存</el-button> <el-button type="primary" @click="submit()">保存</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -60,6 +63,8 @@ ...@@ -60,6 +63,8 @@
<script> <script>
import CustomsTable from "@/components/CustomsTable" import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin" import paginationMixin from "@/components/TabComponents/mixin"
import { addMedicalunion } from "@/api/medicalunion-management"
export default { export default {
components: { components: {
CustomsTable, CustomsTable,
...@@ -73,23 +78,23 @@ export default { ...@@ -73,23 +78,23 @@ export default {
{ {
label: "医联体名称", label: "医联体名称",
minWidth: 120, minWidth: 120,
value: "groupName", value: "unionName",
}, },
{ {
label: "医联体编号", label: "医联体编号",
minWidth: 120, minWidth: 120,
value: "name", value: "unionNo",
}, },
{ {
label: "", label: "",
minWidth: 120, minWidth: 120,
value: "sex", value: "province",
}, },
{ {
label: "", label: "",
minWidth: 120, minWidth: 120,
value: "idCard", value: "city",
}, },
{ {
label: "操作", label: "操作",
...@@ -123,19 +128,19 @@ export default { ...@@ -123,19 +128,19 @@ export default {
], ],
tableData: [ tableData: [
{ {
groupName: "第一个", unionName: "第一个",
}, },
], ],
formList: [ formList: [
{ {
type: "input", type: "input",
label: "医联体名称", label: "医联体名称",
prop: "medicalName", prop: "unionName",
}, },
{ {
type: "input", type: "input",
label: "医联体编号", label: "医联体编号",
prop: "medicalId", prop: "unionNo",
}, },
{ {
type: "select", type: "select",
...@@ -171,6 +176,20 @@ export default { ...@@ -171,6 +176,20 @@ export default {
} }
this.addVisible = true this.addVisible = true
}, },
submit() {
this.$refs["form"].validate((valid) => {
if (valid) {
addMedicalunion(this.form).then((res) => {
if (res.code == 1) {
this.$message.success("添加成功")
}
})
} else {
console.log("error submit!!")
return false
}
})
},
}, },
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment