Commit a4ffb7e6 authored by miaojiale's avatar miaojiale

联调部分接口增加功能

parent 6c1b6427
...@@ -16,3 +16,9 @@ export function medicalunionList(params = {}) { ...@@ -16,3 +16,9 @@ export function medicalunionList(params = {}) {
params, params,
}) })
} }
export function deleteUnion(id) {
return request({
url: `/cloud-upms/sys/union/${id}`,
method: "delete",
})
}
import request from "@/utils/request"
/* 数据库管理 */
export function addArticle(data = {}) {
return request({
url: "/cloud-upms/sys/article/addOrUpdate",
method: "post",
data,
})
}
// 获取列表
export function articleList(params = {}) {
return request({
url: "/cloud-upms/sys/article/list",
method: "get",
params,
})
}
// 启用禁用状态
export function articleEnable(params = {}) {
return request({
url: "/cloud-upms/sys/article/enable",
method: "get",
params,
})
}
// 删除文章
export function deleteArticle(id) {
return request({
url: `/cloud-upms/sys/article/${id}`,
method: "delete",
})
}
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
:header-row-class-name="headerClass" :header-row-class-name="headerClass"
style="width: 100%" style="width: 100%"
> >
<el-table-column v-if="showIndex" type="index" width="120" label="序号">
</el-table-column>
<template v-for="(column, index) in columns"> <template v-for="(column, index) in columns">
<template v-if="!column.type && !column.operType"> <template v-if="!column.type && !column.operType">
<el-table-column <el-table-column
...@@ -98,6 +100,7 @@ ...@@ -98,6 +100,7 @@
<template v-if="column.type === 'switch'"> <template v-if="column.type === 'switch'">
<el-switch <el-switch
v-model="scope.row[column.value]" v-model="scope.row[column.value]"
:active-value="1"
@change="column.func(scope.row, scope.$index)" @change="column.func(scope.row, scope.$index)"
> >
</el-switch> </el-switch>
...@@ -140,6 +143,7 @@ export default { ...@@ -140,6 +143,7 @@ export default {
headerClass: { type: String, default: "default" }, // 头部背景色Class名称,默认default headerClass: { type: String, default: "default" }, // 头部背景色Class名称,默认default
columns: Array, // 表格列配置数据,{vlaue:对应数据对象中的属性,label:对应的是标题文字,fixed:列是否固定,width:列宽, sortable:是否可排序,formatter:列格式化, className:对应的是列的样式类名} columns: Array, // 表格列配置数据,{vlaue:对应数据对象中的属性,label:对应的是标题文字,fixed:列是否固定,width:列宽, sortable:是否可排序,formatter:列格式化, className:对应的是列的样式类名}
tableData: Array, // 表格数据 tableData: Array, // 表格数据
showIndex: { default: false }, // 是否展示索引
}, },
mixins: [resize], mixins: [resize],
data() { data() {
......
<template> <template>
<el-row class="el-upload-self"> <el-row class="el-upload-self">
<el-upload <el-upload
:multiple="multiple"
class="avatar-uploader"
ref="upload" ref="upload"
:multiple="multiple"
:class="[
'avatar-uploader',
value.length > 0 ? 'textUpload' : '',
accept == 'application/pdf' ? 'pdfUpload' : '',
]"
:action="action" :action="action"
:headers="headers" :headers="headers"
:list-type="listType" :list-type="listType"
...@@ -11,6 +15,7 @@ ...@@ -11,6 +15,7 @@
:on-remove="handleRemove" :on-remove="handleRemove"
:on-success="handleSuccess" :on-success="handleSuccess"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:on-change="handleSelectFile"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:before-remove="beforeRemove" :before-remove="beforeRemove"
:file-list="fileList" :file-list="fileList"
...@@ -24,23 +29,27 @@ ...@@ -24,23 +29,27 @@
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</template> </template>
<template v-else-if="listType === 'picture-card'"> <template v-else-if="value.length">
<i class="el-icon-plus"></i> <el-button size="middle" type="text">点击更换</el-button>
</template>
<template v-else-if="listType === 'picture-card' && !value.length">
<el-button size="middle" type="text">点击上传</el-button>
</template> </template>
<template v-else> <template v-else>
<!-- <el-button size="middle" :type="btnType">点击上传</el-button> --> <!-- <el-button size="middle" :type="btnType">点击上传</el-button> -->
<!-- <img v-if="imageUrl" :src="imageUrl" class="avatar" /> --> <!-- <img v-if="imageUrl" :src="imageUrl" class="avatar" /> -->
<i class="el-icon-plus avatar-uploader-icon"></i> <el-button size="middle" type="text">点击上传</el-button>
</template> </template>
<div slot="tip" class="el-upload__tip">{{ tip }}</div> <!-- <div slot="tip" class="el-upload__tip">{{ tip }}</div> -->
</el-upload> </el-upload>
<el-image <el-image
ref="image"
style="display: none" style="display: none"
:src="imgUrl" :src="imgUrl"
:preview-src-list="previewList" :preview-src-list="previewList"
ref="image"
> >
</el-image> </el-image>
</el-row> </el-row>
...@@ -50,7 +59,7 @@ ...@@ -50,7 +59,7 @@
import { getAccessToken } from "@/utils/accessToken" import { getAccessToken } from "@/utils/accessToken"
import { delFile } from "@/api/file" import { delFile } from "@/api/file"
export default { export default {
name: "el-upload-self", name: "ElUploadSelf",
props: { props: {
accept: { type: String, default: "image/*" }, accept: { type: String, default: "image/*" },
disabled: { disabled: {
...@@ -84,7 +93,10 @@ export default { ...@@ -84,7 +93,10 @@ export default {
type: String, type: String,
default: "primary", default: "primary",
}, },
value: Array, //上传文件数组 绑定数组 value: {
type: Array,
default: () => [],
}, //上传文件数组 绑定数组
}, },
data() { data() {
return { return {
...@@ -97,20 +109,6 @@ export default { ...@@ -97,20 +109,6 @@ export default {
fileList: [], fileList: [],
} }
}, },
watch: {
value: {
handler(newValue, oldValue) {
if (newValue === oldValue) return
this.fileList = newValue.map((_) => {
return {
name: _.file_name,
url: `${this.httpPrefix}/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`,
}
})
},
immediate: true,
},
},
computed: { computed: {
headers() { headers() {
return { return {
...@@ -118,23 +116,41 @@ export default { ...@@ -118,23 +116,41 @@ export default {
} }
}, },
action() { action() {
return ( return this.httpPrefix + `/cloud-upms/file/upload`
this.httpPrefix +
`/disease-data/file/upload?formId=${this.uploadQuery.formId}&patientId=${this.uploadQuery.patientId}&prefix=${this.uploadQuery.prefix}`
)
}, },
// 预览list // 预览list
previewList() { previewList() {
if (!this.value) return [] console.log(this.value)
if (!this.value.length || this.accept != "image/*") return []
return this.value.map((_) => { return this.value.map((_) => {
return ( return (
_.url || _.url ||
`${this.httpPrefix}/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}` `${this.httpPrefix}/cloud-upms/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`
) )
}) })
}, },
}, },
watch: {
value: {
handler(newValue, oldValue) {
if (newValue === oldValue) return
this.fileList = newValue.map((_) => {
return {
name: _.file_name,
url: `${this.httpPrefix}/cloud-upms/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`,
}
})
},
immediate: true,
},
},
methods: { methods: {
handleSelectFile(file, fileList) {
if (fileList.length > 1) {
this.value.shift()
fileList.shift()
}
},
// 上传前回调 // 上传前回调
beforeUpload(file) { beforeUpload(file) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -146,17 +162,18 @@ export default { ...@@ -146,17 +162,18 @@ export default {
resolve() resolve()
}) })
}, },
// 超出限制 // 超出限制
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.$message.error(`最多可上传${this.limit}个文件!`) this.$message.error(`最多可上传${this.limit}个文件!`)
}, },
// 上传成功 // 上传成功
handleSuccess(res, file, fileList) { handleSuccess(res, file, fileList) {
const { data } = res const { data } = res
if (data) { if (data) {
this.value.push({ ...data, url: file.url }) this.value.push({ ...data, url: file.url })
// 上传成功
this.$emit("input", this.value)
this.$emit("fileSuccess")
} else { } else {
this.$message.warning(res.msg) this.$message.warning(res.msg)
this.$refs.upload.clearFiles() this.$refs.upload.clearFiles()
...@@ -170,8 +187,13 @@ export default { ...@@ -170,8 +187,13 @@ export default {
// 移除 // 移除
handleRemove({ url }, fileList) { handleRemove({ url }, fileList) {
const i = this.value.findIndex((_) => url.endsWith(_.uuid_name)) if (fileList.length > 1) {
if (i > -1) this.value.splice(i, 1) // 静态移除 fileList.shift()
}
this.value = []
this.$emit("input", this.value)
// const i = this.value.findIndex((_) => url.endsWith(_.uuid_name))
// if (i > -1) this.value.splice(i, 1) // 静态移除
}, },
// 查看 // 查看
...@@ -181,7 +203,7 @@ export default { ...@@ -181,7 +203,7 @@ export default {
let responseUrl let responseUrl
if (file.response) { if (file.response) {
const _ = file.response.data const _ = file.response.data
responseUrl = `${this.httpPrefix}/disease-data/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}` responseUrl = `${this.httpPrefix}/cloud-upms/file/info/${_.bucket_name}/${_.prefix}-${_.uuid_name}`
} }
try { try {
if (name.match(/\.(png|jpg|jpeg)/)) { if (name.match(/\.(png|jpg|jpeg)/)) {
...@@ -227,16 +249,38 @@ export default { ...@@ -227,16 +249,38 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.pdfUpload {
display: flex;
flex-direction: row-reverse;
justify-content: flex-end;
::v-deep .el-upload-list__item {
transform: translateY(-6px);
width: 158px;
height: 40px;
}
}
::v-deep .avatar-uploader .el-upload { ::v-deep .avatar-uploader .el-upload {
border: 1px solid #d9d9d9; border: none;
border-radius: 6px; width: 80px;
cursor: pointer; height: 30px;
position: relative; line-height: 0px;
overflow: hidden; }
::v-deep .textUpload {
align-items: flex-start;
.el-upload {
border: none;
width: 80px;
height: 30px;
line-height: 0px;
}
} }
::v-deep .avatar-uploader .el-upload:hover { ::v-deep .avatar-uploader .el-upload:hover {
border-color: #409eff; border-color: #409eff;
} }
::v-deep .el-upload-list__item {
width: 88px;
height: 88px;
}
.avatar-uploader-icon { .avatar-uploader-icon {
font-size: 28px; font-size: 28px;
color: #8c939d; color: #8c939d;
...@@ -250,4 +294,10 @@ export default { ...@@ -250,4 +294,10 @@ export default {
height: 88px; height: 88px;
display: block; display: block;
} }
// ::v-deep .el-upload--picture-card {
// width: none;
// height: none;
// line-height: 0px;
// border: none;
// }
</style> </style>
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
ref="table" ref="table"
:table-data="tableData" :table-data="tableData"
:columns="columns" :columns="columns"
:show-index="true"
:header-class="'newHeader'" :header-class="'newHeader'"
:list-loading="listLoading" :list-loading="listLoading"
:current-page="pageIndex" :current-page="pageIndex"
...@@ -18,12 +19,7 @@ ...@@ -18,12 +19,7 @@
@currentPageChange="handleCurrentChange" @currentPageChange="handleCurrentChange"
/> />
</div> </div>
<el-dialog <el-dialog :visible.sync="addVisible" width="520px" :show-close="true">
:visible.sync="addVisible"
width="520px"
:show-close="true"
@closed="clearForm"
>
<div class="title">添加医联体</div> <div class="title">添加医联体</div>
<el-form <el-form
ref="form" ref="form"
...@@ -49,18 +45,29 @@ ...@@ -49,18 +45,29 @@
v-if="item.type == 'select'" v-if="item.type == 'select'"
v-model="form[item.prop]" v-model="form[item.prop]"
:placeholder="'请选择' + item.label" :placeholder="'请选择' + item.label"
@change="changeCity(item.prop)"
> >
<el-option <el-option
v-for="e in item.selectGroup" v-for="e in item.selectGroup"
:key="e.value" :key="e.value"
:label="e.label" :label="e.label"
:value="e.value" :value="e.label"
></el-option> ></el-option>
</el-select> </el-select>
</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="submit()">保存</el-button> <el-button class="f-btn" type="primary" @click="submit()"
>保存</el-button
>
</span>
</el-dialog>
<!-- 删除提示框 -->
<el-dialog title="提示" :visible.sync="deleteVisible" width="30%">
<span>确定删除吗?</span>
<span slot="footer" class="dialog-footers">
<el-button @click="deleteVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmDelete">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -71,7 +78,9 @@ import paginationMixin from "@/components/TabComponents/mixin" ...@@ -71,7 +78,9 @@ import paginationMixin from "@/components/TabComponents/mixin"
import { import {
addMedicalunion, addMedicalunion,
medicalunionList, medicalunionList,
deleteUnion,
} from "@/api/medicalunion-management" } from "@/api/medicalunion-management"
import cityList from "@/data/city"
export default { export default {
components: { components: {
...@@ -80,6 +89,7 @@ export default { ...@@ -80,6 +89,7 @@ export default {
mixins: [paginationMixin], mixins: [paginationMixin],
data() { data() {
return { return {
deleteVisible: false,
addVisible: false, addVisible: false,
listLoading: false, listLoading: false,
columns: [ columns: [
...@@ -120,7 +130,7 @@ export default { ...@@ -120,7 +130,7 @@ export default {
}, },
}, },
{ {
func: this.rowOpration, func: this.deleteFunc,
style: { style: {
color: "#FA6400", color: "#FA6400",
}, },
...@@ -134,12 +144,7 @@ export default { ...@@ -134,12 +144,7 @@ export default {
], ],
}, },
], ],
tableData: [ tableData: [],
{
unionName: "第一个",
id: 123,
},
],
formList: [ formList: [
{ {
type: "input", type: "input",
...@@ -155,21 +160,23 @@ export default { ...@@ -155,21 +160,23 @@ export default {
type: "select", type: "select",
label: "", label: "",
prop: "province", prop: "province",
selectGroup: [{ label: "北京市", value: "001" }], selectGroup: cityList,
}, },
{ {
type: "select", type: "select",
label: "", label: "",
prop: "city", prop: "city",
selectGroup: [{ label: "北京市", value: "001" }], selectGroup: [],
}, },
], ],
form: {}, form: {},
deleteId: "",
} }
}, },
watch: {}, watch: {},
mounted() { mounted() {
this.getMedicalunionList() this.getMedicalunionList()
console.log(cityList)
}, },
methods: { methods: {
// 获取list // 获取list
...@@ -177,17 +184,35 @@ export default { ...@@ -177,17 +184,35 @@ export default {
medicalunionList({ medicalunionList({
size: this.pageSize, size: this.pageSize,
current: this.pageIndex, current: this.pageIndex,
}).then((res) => {}) }).then((res) => {
if (res.code == 1) {
this.total = res.data.total
this.tableData = res.data.records
}
})
}, },
// 添加医联体 // 添加医联体
addMedical() { addMedical() {
if (this.$refs["form"]) {
this.clearForm()
}
this.addVisible = true this.addVisible = true
}, },
// 编辑医联体 // 编辑医联体
editMedical(data) { editMedical(data) {
console.log(data) console.log(data)
this.form = data this.form = { ...data }
this.addVisible = true this.addVisible = true
let value = this.form["province"]
cityList.forEach((e) => {
if (e.label == value) {
this.formList[3].selectGroup = e.children
if (e.children[0].label == "市辖区") {
this.formList[3].selectGroup[0].label = e.label
}
}
})
}, },
submit() { submit() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
...@@ -196,18 +221,54 @@ export default { ...@@ -196,18 +221,54 @@ export default {
if (res.code == 1) { if (res.code == 1) {
this.$message.success("添加成功") this.$message.success("添加成功")
this.addVisible = false this.addVisible = false
this.page = 1
this.getMedicalunionList()
} }
}) })
} else { } else {
console.log("error submit!!") // console.log("error submit!!")
return false return false
} }
}) })
}, },
// 删除
deleteFunc(data) {
console.log(data)
this.deleteVisible = true
this.deleteId = data.id
},
clearForm() { clearForm() {
this.form = {} this.form = {}
this.$refs["form"].resetFields() this.$refs["form"].resetFields()
}, },
confirmDelete() {
this.deleteVisible = false
deleteUnion(this.deleteId)
.then((res) => {
if (res.code == 1) {
this.$message.success("删除成功")
this.getMedicalunionList()
}
})
.catch(() => {})
},
// 省份变化改变城市
changeCity(val) {
console.log(val)
if (val == "province") {
delete this.form["city"]
// console.log(this.form["province"])
let value = this.form["province"]
cityList.forEach((e) => {
if (e.label == value) {
this.formList[3].selectGroup = e.children
if (e.children[0].label == "市辖区") {
this.formList[3].selectGroup[0].label = e.label
}
}
})
}
},
}, },
} }
</script> </script>
...@@ -242,7 +303,7 @@ export default { ...@@ -242,7 +303,7 @@ export default {
::v-deep .el-dialog__footer { ::v-deep .el-dialog__footer {
border-top: none; border-top: none;
text-align: center; text-align: center;
.el-button { .f-btn {
width: 100px; width: 100px;
height: 32px; height: 32px;
background: #4e68ff; background: #4e68ff;
......
<template> <template>
<div id="medicalunion-management"> <div id="medicalunion-management">
<div class="top-btn"> <div class="top-btn">
<el-select v-model="selectType"> <el-select v-model="selectType" @change="getArticleList">
<el-option <el-option
v-for="item in selectList" v-for="item in selectList"
:key="item.value" :key="item.value"
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
:key="index" :key="index"
:label="item.label" :label="item.label"
:prop="item.prop" :prop="item.prop"
:rules="[{ required: true, message: item.label + '不能为空' }]"
> >
<template v-if="!readOnly"> <template v-if="!readOnly">
<!-- 输入框 --> <!-- 输入框 -->
...@@ -61,6 +62,7 @@ ...@@ -61,6 +62,7 @@
v-else-if="item.type == 'select'" v-else-if="item.type == 'select'"
v-model="form[item.prop]" v-model="form[item.prop]"
:placeholder="'请选择' + item.label" :placeholder="'请选择' + item.label"
style="width: 100%"
> >
<el-option <el-option
v-for="e in item.selectGroup" v-for="e in item.selectGroup"
...@@ -75,12 +77,18 @@ ...@@ -75,12 +77,18 @@
v-model="form[item.prop]" v-model="form[item.prop]"
:btn-type="'text'" :btn-type="'text'"
v-bind="item" v-bind="item"
:list-type="item.listType"
:accept="item.accept"
:limit="item.limit"
@fileSuccess="fileSuccess"
></el-upload-self> ></el-upload-self>
<!-- switch --> <!-- switch -->
<!-- switch切换 启用 --> <!-- switch切换 启用 -->
<el-switch <el-switch
v-else-if="item.type === 'switch'" v-else-if="item.type === 'switch'"
v-model="form[item.prop]" v-model="form[item.prop]"
:active-value="1"
:inactive-value="0"
> >
</el-switch> </el-switch>
</template> </template>
...@@ -99,7 +107,12 @@ ...@@ -99,7 +107,12 @@
import CustomsTable from "@/components/CustomsTable" import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin" import paginationMixin from "@/components/TabComponents/mixin"
import ElUploadSelf from "@/components/Upload" import ElUploadSelf from "@/components/Upload"
import {
articleList,
articleEnable,
deleteArticle,
addArticle,
} from "@/api/operation-management"
export default { export default {
components: { components: {
CustomsTable, CustomsTable,
...@@ -134,7 +147,7 @@ export default { ...@@ -134,7 +147,7 @@ export default {
{ {
label: "标题", label: "标题",
minWidth: 120, minWidth: 120,
value: "title", value: "articleTitle",
}, },
{ {
label: "图片", label: "图片",
...@@ -218,58 +231,89 @@ export default { ...@@ -218,58 +231,89 @@ export default {
{ {
type: "select", type: "select",
label: "类型", label: "类型",
prop: "type", prop: "articleType",
selectGroup: [ selectGroup: [
{ {
label: "筛查", label: "筛查",
value: 0, value: 1,
}, },
{ {
label: "生活", label: "生活",
value: 1, value: 2,
}, },
{ {
label: "医学知识", label: "医学知识",
value: 2, value: 3,
}, },
{ {
label: "其他", label: "其他",
value: 3, value: 4,
}, },
], ],
}, },
{ {
type: "input", type: "input",
label: "标题", label: "标题",
prop: "title", prop: "articleTitle",
}, },
{ {
type: "upload", type: "upload",
label: "图片", label: "图片",
prop: "img", prop: "imgPath",
listType: "picture-card",
}, },
{ {
type: "upload", type: "upload",
label: "PDF", label: "PDF",
prop: "aaa", prop: "filePath",
accept: "application/pdf",
}, },
{ {
type: "switch", type: "switch",
label: "启用状态", label: "启用状态",
prop: "ssd", prop: "status",
}, },
], ],
rules: { rules: {
title: [{ required: true, message: "请输入标题", trigger: "blur" }], title: [{ required: true, message: "请输入标题", trigger: "blur" }],
}, },
form: {}, form: {
status: 1,
},
} }
}, },
watch: {}, watch: {},
mounted() {}, mounted() {
this.getArticleList()
},
methods: { methods: {
// 添加医联体 fileSuccess(val) {
console.log(this.form)
},
// 获取健康科普
getArticleList() {
this.listLoading = true
let params = {
size: this.pageSize,
current: this.pageIndex,
moduleType: "4",
articleType: this.selectType + 1,
}
articleList(params)
.then((res) => {
if (res.code == 1) {
this.tableData = [...res.data.records]
this.total = res.data.total
this.listLoading = false
}
})
.catch((e) => {
this.listLoading = false
})
},
// 添加文章
addMedical() { addMedical() {
this.readOnly = false
this.addVisible = true this.addVisible = true
}, },
// 查看 // 查看
...@@ -295,15 +339,38 @@ export default { ...@@ -295,15 +339,38 @@ export default {
// 启用状态 // 启用状态
openChage(data, index) { openChage(data, index) {
console.log(data, index) console.log(data, index)
let params = {
id: data.id,
status: data.status ? 1 : 0,
}
articleEnable(params).then((res) => {
if (res.code == 1) {
// this.$message.success("保存成功")
this.getArticleList()
}
})
}, },
resetForm() { resetForm() {
this.$refs["form"].resetFields() this.$refs["form"].resetFields()
this.form = {
status: 1,
}
}, },
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
alert("submit!") addArticle({
...this.form,
moduleType: "4",
}).then((res) => {
if (res.code == 1) {
this.addVisible = false this.addVisible = false
this.$refs["form"].resetFields()
this.form = {
status: 1,
}
}
})
} else { } else {
console.log("error submit!!") console.log("error submit!!")
return false return false
......
...@@ -18,7 +18,15 @@ ...@@ -18,7 +18,15 @@
@currentPageChange="handleCurrentChange" @currentPageChange="handleCurrentChange"
/> />
</div> </div>
<el-dialog :visible.sync="addVisible" width="520px" :show-close="true"> <!-- 删除提示框 -->
<el-dialog title="提示" :visible.sync="deleteVisible" width="30%">
<span>确定删除吗?</span>
<span slot="footer" class="dialog-footers">
<el-button @click="deleteVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmDelete">确 定</el-button>
</span>
</el-dialog>
<!-- <el-dialog :visible.sync="addVisible" width="520px" :show-close="true">
<div class="title">添加医联体</div> <div class="title">添加医联体</div>
<el-form <el-form
:model="form" :model="form"
...@@ -54,12 +62,17 @@ ...@@ -54,12 +62,17 @@
<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="addVisible = false">保存</el-button>
</span> </span>
</el-dialog> </el-dialog> -->
</div> </div>
</template> </template>
<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 {
articleList,
articleEnable,
deleteArticle,
} from "@/api/operation-management"
export default { export default {
components: { components: {
CustomsTable, CustomsTable,
...@@ -69,16 +82,17 @@ export default { ...@@ -69,16 +82,17 @@ export default {
return { return {
addVisible: false, addVisible: false,
listLoading: false, listLoading: false,
deleteVisible: false,
columns: [ columns: [
{ {
label: "标题", label: "标题",
minWidth: 120, minWidth: 120,
value: "title", value: "articleTitle",
}, },
{ {
label: "文件", label: "文件",
minWidth: 120, minWidth: 120,
value: "file", value: "fileCode",
}, },
{ {
label: "上传时间", label: "上传时间",
...@@ -88,18 +102,18 @@ export default { ...@@ -88,18 +102,18 @@ export default {
{ {
label: "最新修改时间", label: "最新修改时间",
minWidth: 120, minWidth: 120,
value: "editTime", value: "updateTime",
}, },
{ {
label: "上传人姓名", label: "上传人姓名",
minWidth: 120, minWidth: 120,
value: "uploadPerson", value: "uploadUserName",
}, },
{ {
label: "启用状态", label: "启用状态",
minWidth: 120, minWidth: 120,
type: "switch", type: "switch",
value: "isOpen", value: "status",
func: this.openChage, func: this.openChage,
}, },
{ {
...@@ -127,7 +141,7 @@ export default { ...@@ -127,7 +141,7 @@ export default {
}, },
}, },
{ {
func: this.rowOpration, func: this.deleteFunc,
style: { style: {
color: "#FA6400", color: "#FA6400",
}, },
...@@ -142,10 +156,10 @@ export default { ...@@ -142,10 +156,10 @@ export default {
}, },
], ],
tableData: [ tableData: [
{ // {
title: "第一个", // title: "第一个",
isOpen: true, // isOpen: true,
}, // },
], ],
formList: [ formList: [
{ {
...@@ -172,11 +186,52 @@ export default { ...@@ -172,11 +186,52 @@ export default {
}, },
], ],
form: {}, form: {},
deleteId: "",
} }
}, },
watch: {}, watch: {},
mounted() {}, mounted() {
this.getArticleList()
},
methods: { methods: {
// 删除
deleteFunc(data) {
console.log(data)
this.deleteVisible = true
this.deleteId = data.id
},
// 确认删除
confirmDelete() {
this.deleteVisible = false
deleteArticle(this.deleteId)
.then((res) => {
if (res.code == 1) {
this.$message.success("删除成功")
this.getArticleList()
}
})
.catch(() => {})
},
// 获取新闻会议
getArticleList() {
this.listLoading = true
let params = {
size: this.pageSize,
current: this.pageIndex,
moduleType: "1",
}
articleList(params)
.then((res) => {
if (res.code == 1) {
this.tableData = [...res.data.records]
this.total = res.data.total
this.listLoading = false
}
})
.catch((e) => {
this.listLoading = false
})
},
// 添加医联体 // 添加医联体
addMedical() { addMedical() {
this.addVisible = true this.addVisible = true
...@@ -195,6 +250,16 @@ export default { ...@@ -195,6 +250,16 @@ export default {
// 启用状态 // 启用状态
openChage(data, index) { openChage(data, index) {
console.log(data, index) console.log(data, index)
let params = {
id: data.id,
status: data.status ? 1 : 0,
}
articleEnable(params).then((res) => {
if (res.code == 1) {
// this.$message.success("保存成功")
this.getArticleList()
}
})
}, },
}, },
} }
...@@ -231,7 +296,7 @@ export default { ...@@ -231,7 +296,7 @@ export default {
::v-deep .el-dialog__footer { ::v-deep .el-dialog__footer {
border-top: none; border-top: none;
text-align: center; text-align: center;
.el-button { .f-btn {
width: 100px; width: 100px;
height: 32px; height: 32px;
background: #4e68ff; background: #4e68ff;
......
...@@ -60,6 +60,11 @@ ...@@ -60,6 +60,11 @@
<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 {
articleList,
articleEnable,
deleteArticle,
} from "@/api/operation-management"
export default { export default {
components: { components: {
CustomsTable, CustomsTable,
...@@ -99,7 +104,7 @@ export default { ...@@ -99,7 +104,7 @@ export default {
label: "启用状态", label: "启用状态",
minWidth: 120, minWidth: 120,
type: "switch", type: "switch",
value: "isOpen", value: "status",
func: this.openChage, func: this.openChage,
}, },
{ {
...@@ -141,12 +146,7 @@ export default { ...@@ -141,12 +146,7 @@ export default {
], ],
}, },
], ],
tableData: [ tableData: [],
{
title: "第一个",
isOpen: true,
},
],
formList: [ formList: [
{ {
type: "input", type: "input",
...@@ -175,8 +175,30 @@ export default { ...@@ -175,8 +175,30 @@ export default {
} }
}, },
watch: {}, watch: {},
mounted() {}, mounted() {
this.getArticleList()
},
methods: { methods: {
// 获取通知公告
getArticleList() {
this.listLoading = true
let params = {
size: this.pageSize,
current: this.pageIndex,
moduleType: "2",
}
articleList(params)
.then((res) => {
if (res.code == 1) {
this.tableData = [...res.data.records]
this.total = res.data.total
this.listLoading = false
}
})
.catch((e) => {
this.listLoading = false
})
},
// 添加医联体 // 添加医联体
addMedical() { addMedical() {
this.addVisible = true this.addVisible = true
......
...@@ -94,7 +94,11 @@ ...@@ -94,7 +94,11 @@
import CustomsTable from "@/components/CustomsTable" import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin" import paginationMixin from "@/components/TabComponents/mixin"
import ElUploadSelf from "@/components/Upload" import ElUploadSelf from "@/components/Upload"
import {
articleList,
articleEnable,
deleteArticle,
} from "@/api/operation-management"
export default { export default {
components: { components: {
CustomsTable, CustomsTable,
...@@ -255,8 +259,30 @@ export default { ...@@ -255,8 +259,30 @@ export default {
} }
}, },
watch: {}, watch: {},
mounted() {}, mounted() {
this.getArticleList()
},
methods: { methods: {
// 获取健康科普
getArticleList() {
this.listLoading = true
let params = {
size: this.pageSize,
current: this.pageIndex,
moduleType: "5",
}
articleList(params)
.then((res) => {
if (res.code == 1) {
this.tableData = [...res.data.records]
this.total = res.data.total
this.listLoading = false
}
})
.catch((e) => {
this.listLoading = false
})
},
// 添加医联体 // 添加医联体
addMedical() { addMedical() {
this.addVisible = true this.addVisible = true
......
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