|
@@ -1,114 +1,77 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent v-show="showSearch">
|
|
|
- <el-form-item label="标题" prop="title">
|
|
|
- <el-input v-model="queryParams.title" placeholder="请输入标题" @keyup.enter.native="handleQuery" clearable class="inp"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-button type="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:introduction:add']">新增</el-button>
|
|
|
- <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit',ids)" v-hasPermi="['work:introduction:edit']">修改</el-button>
|
|
|
- <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:introduction:remove']">删除{{ids.length>0?'('+ids.length+')':''}}</el-button>
|
|
|
-
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="标题" align="center" prop="title" />
|
|
|
-<!-- <el-table-column label="介绍" align="center" prop="context" />-->
|
|
|
- <el-table-column label="状态" align="center" prop="status" >
|
|
|
- <template slot-scope="scope">
|
|
|
- <dict-tag :options="dict.type.work_status" :value="scope.row.status"/>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-refresh-left"
|
|
|
- @click="updateStatus(scope.row)"
|
|
|
- v-hasPermi="['work:introduction:updateStatus']"
|
|
|
- >更改状态</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit',scope.row)" v-hasPermi="['work:introduction:edit']">修改</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:introduction:remove']">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <template slot="empty">
|
|
|
- <el-empty></el-empty>
|
|
|
- </template>
|
|
|
- </el-table>
|
|
|
- <pagination v-if="response.total>0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
|
|
+ <div class="app-container" style="overflow-y: auto">
|
|
|
+ <div class="cmain">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="130px">
|
|
|
+ <div class="bos">
|
|
|
+ <div class="lab">
|
|
|
+ <div class="bsg"></div>
|
|
|
+ <div class="tit">医院基本信息</div>
|
|
|
+ </div>
|
|
|
+ <el-form-item label="医院电话" prop="phone">
|
|
|
+ <el-input v-model="form.phone" placeholder="请输入" clearable />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="医院地址" prop="address">
|
|
|
+ <el-input v-model="form.address" placeholder="请输入" clearable />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="医院邮箱" prop="email">
|
|
|
+ <el-input v-model="form.email" placeholder="请输入" clearable />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="医院介绍" prop="brief">
|
|
|
+ <editor v-model="form.brief" placeholder="请输入"></editor>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="bos">
|
|
|
+ <div class="lab">
|
|
|
+ <div class="bsg"></div>
|
|
|
+ <div class="tit">协议(小程序上架需要)</div>
|
|
|
+ </div>
|
|
|
+ <el-form-item label="用户协议" prop="privacy">
|
|
|
+ <editor v-model="form.agreement" placeholder="请输入"></editor>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="隐私政策" prop="privacy">
|
|
|
+ <editor v-model="form.privacy" placeholder="请输入"></editor>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="$layer.close(layerid)">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import edit from './edit'
|
|
|
export default {
|
|
|
- dicts: ['work_status'],
|
|
|
- name: "Introduction",
|
|
|
data() {
|
|
|
return {
|
|
|
- ids: [],
|
|
|
- showSearch:true,
|
|
|
- response: {},
|
|
|
- queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- title: null,
|
|
|
- context: null,
|
|
|
- status: null,
|
|
|
- orderByColumn:'id', //排序字段
|
|
|
- isAsc: 'desc' //排序方式
|
|
|
+ form: {},
|
|
|
+ rules: {
|
|
|
+ address: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
+ phone: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
+ email: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
+ brief: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
+ privacy: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
+ agreement: [{ required: true, message: '不能为空', trigger: 'blur' }]
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- this.getList();
|
|
|
+ mounted() {
|
|
|
+ this.ajax({ url: '/work/introduction/detail' }).then((response) => {
|
|
|
+ this.form = response.data;
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
- updateStatus(row){
|
|
|
- this.ajax({method: 'post',url: '/work/introduction/updateStatus', data: row }).then(response => {
|
|
|
- this.$modal.msgSuccess(response.msg);
|
|
|
- this.getList()
|
|
|
- });
|
|
|
- },
|
|
|
- getList() {
|
|
|
- this.ajax({ url: '/work/introduction/list', data: this.queryParams }).then(response => {
|
|
|
- this.response = response;
|
|
|
- });
|
|
|
- },
|
|
|
- handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- resetQuery() {
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.handleQuery();
|
|
|
- },
|
|
|
- selects(rows) {
|
|
|
- this.ids = rows.map(item => item.id)
|
|
|
- },
|
|
|
- op(tag, row) {
|
|
|
- if (tag == 'add') {
|
|
|
- this.iframe({ obj: edit, param: {}, title:'新增',width: '1000px', height: '700px'});
|
|
|
- }
|
|
|
- if (tag == 'edit') {
|
|
|
- const id = row.id || this.ids[0];
|
|
|
- this.iframe({ obj: edit, param: {id: id}, title:'编辑',width: '1000px', height: '700px'});
|
|
|
- }
|
|
|
- },
|
|
|
- del(row) {
|
|
|
- this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
|
|
|
- this.get({ url: '/work/introduction/remove/' + (row.id || this.ids) }).then(response => {
|
|
|
- this.$modal.msgSuccess('删除成功');
|
|
|
- this.getList();
|
|
|
+ submitForm() {
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id) {
|
|
|
+ this.ajax({ method: 'post', url: '/work/introduction/edit', data: this.form }).then((response) => {
|
|
|
+ this.$modal.msgSuccess('修改成功');
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|