方药
This commit is contained in:
@@ -47,7 +47,7 @@ const mainRoutes = {
|
||||
{ path: '/activity-list', component: _import('modules/activity/activityList'), name: 'activity-list', meta: { title: '活动列表', isTab: true } },
|
||||
{ path: '/user-point-memery', component: _import('modules/user/user-point-memery'), name: 'user-point-memery', meta: { title: '充/扣记录', isTab: true } },
|
||||
{ path: '/order-epay', component: _import('modules/order/order-errorpay'), name: 'order-epay', meta: { title: '充值异常列表', isTab: true } },
|
||||
{ path: '/xieyi_list', component: _import('modules/xieyi/xieyi'), name: 'xieyi_list', meta: { title: '协议管理', isTab: true } },
|
||||
{ path: '/xieyi_list', component: _import('modules/xieyi/xieyi'), name: 'xieyi_list', meta: { title: '协议管理', isTab: true } },
|
||||
{ path: '/book-comments', component: _import('modules/book/bookComments'), name: 'book-comments', meta: { title: '书评管理', isTab: true } },
|
||||
{ path: '/clock', component: _import('modules/book/clock'), name: 'clock', meta: { title: '打卡管理', isTab: true } },
|
||||
{ path: '/talkBook', component: _import('modules/book/talkBook'), name: 'talkBook', meta: { title: '讲书管理', isTab: true } },
|
||||
@@ -55,6 +55,8 @@ const mainRoutes = {
|
||||
{ path: '/acupointManagement', component: _import('modules/acupoint/acupointManagement'), name: 'acupointManagement', meta: { title: '经穴分类管理', isTab: true } },
|
||||
{ path: '/acupointList', component: _import('modules/acupoint/acupointList'), name: 'acupointList', meta: { title: '经穴文章列表', isTab: true } },
|
||||
{ path: '/acupointDetail', component: _import('modules/acupoint/acupointDetail'), name: 'acupointDetail', meta: { title: '穴位详细', isTab: true } },
|
||||
{ path: '/medicineList', component: _import('modules/medicine/medicineList'), name: 'medicineList', meta: { title: '方药分类管理', isTab: true } },
|
||||
{ path: '/medicineArt', component: _import('modules/medicine/medicineArt'), name: 'medicineArt', meta: { title: '方药文章管理', isTab: true } },
|
||||
{ path: '/countyManagement', component: _import('modules/county/countyManagement'), name: 'countyManagement', meta: { title: '国家区域管理', isTab: true } },
|
||||
{ path: '/commentsList', component: _import('modules/book/commentsList'), name: 'commentsList', meta: { title: '评论管理', isTab: true } },
|
||||
],
|
||||
|
||||
474
src/views/modules/medicine/medicineArt.vue
Normal file
474
src/views/modules/medicine/medicineArt.vue
Normal file
@@ -0,0 +1,474 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm">
|
||||
<el-cascader v-model="catevalue" :change-on-select="true" placeholder="请选择分类" :options="treeList"
|
||||
:props="cateProps" :emitPath="false" @change="handleChange">
|
||||
</el-cascader>
|
||||
<el-form-item>
|
||||
<!-- <el-button @click="getDataList()">查询</el-button> -->
|
||||
<el-button v-if="isAuth('book:bookchapter:save')" type="primary" @click="addHandle()">添加文章</el-button>
|
||||
<router-link :to="{ path: '/medicineList', query: {} }">
|
||||
<el-button type="success">管理分类</el-button>
|
||||
</router-link>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column prop="title" label="标题"> </el-table-column>
|
||||
<el-table-column prop="categoryString" label="所属方药">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.prescriptCategoryEntity.title}}
|
||||
<span v-if="scope.row.prescriptCategoryEntity.child">
|
||||
<b>></b> {{scope.row.prescriptCategoryEntity.child.title}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="source" label="出处"> </el-table-column>
|
||||
<el-table-column prop="imageList" label="图片">
|
||||
<template slot-scope="scope">
|
||||
<span v-for="(item, index) in scope.row.imageList" :key="index">
|
||||
<img :src="item" width="70" class="tableImg" />
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" width="50px" align="center"> </el-table-column>
|
||||
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="editHandle(scope.row)"><i class="el-icon-edit"></i> 编辑</el-button>
|
||||
<el-button type="text" size="small" @click="deleteContent(scope.row)" style="color: #eb4c0c;;"><i
|
||||
class="el-icon-delete"></i> 删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<el-dialog :title="ctitle" :visible.sync="dialogVisible" width="600px" :close-on-click-modal="false"
|
||||
@close="handleClose">
|
||||
<div style="">
|
||||
<el-form ref="form" :model="form" label-width="80px" :rules="formRule">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="出处">
|
||||
<el-input v-model="form.source" placeholder="请输入出处"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属方药" prop="prescriptCategoryIds">
|
||||
<el-cascader :options="treeListSel" :props="cateProps" :emitPath="false"
|
||||
v-model="form.prescriptCategoryIds">
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片">
|
||||
<el-upload :limit="3" class="el-uploadfeng noneBtnImg" :action="baseUrl + '/oss/fileoss'"
|
||||
list-type="picture-card" multiple :on-exceed="handleExceed" :file-list="fileList"
|
||||
:on-success="handleSuccess" accept=".jpeg,.jpg,.gif,.png" :on-remove="handleRemoveNovel">
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="古代剂量" prop="doseOld">
|
||||
<el-input type="textarea" v-model="form.doseOld" placeholder="请输入古代剂量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="现代剂量" prop="doseNow">
|
||||
<el-input type="textarea" v-model="form.doseNow" placeholder="请输入现代剂量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="煎服法" prop="preUsage">
|
||||
<el-input type="textarea" v-model="form.preUsage" placeholder="请输入煎服法"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="方歌" prop="preSong">
|
||||
<el-input type="textarea" v-model="form.preSong" placeholder="请输入方歌"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="主治" prop="indications">
|
||||
<el-input type="textarea" v-model="form.indications" placeholder="请输入主治"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" type="number"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import global from "../../common/common.vue"; //引入共用组间
|
||||
import {
|
||||
quillEditor
|
||||
} from 'vue-quill-editor'
|
||||
|
||||
import 'quill/dist/quill.core.css'
|
||||
import 'quill/dist/quill.snow.css'
|
||||
import 'quill/dist/quill.bubble.css'
|
||||
const toolbarOptions = [
|
||||
// ['bold', 'italic', 'underline', 'strike'], // 加粗,斜体,下划线,删除线
|
||||
// ['blockquote', 'code-block'], //引用,代码块
|
||||
// [{ 'header': 1 }, { 'header': 2 }], // 几级标题
|
||||
// [{ 'list': 'ordered' }, { 'list': 'bullet' }], // 有序列表,无序列表
|
||||
// [{ 'script': 'sub' }, { 'script': 'super' }], // 下角标,上角标
|
||||
// [{ 'indent': '-1' }, { 'indent': '+1' }], // 缩进
|
||||
// [{ 'direction': 'rtl' }], // 文字输入方向
|
||||
// [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
|
||||
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],// 标题
|
||||
// /[{ 'color': [] }, { 'background': [] }], // 颜色选择
|
||||
// [{ 'font': ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial'] }],// 字体
|
||||
// [{ 'align': [] }], // 居中
|
||||
// ['clean'], // 清除样式,
|
||||
// ['link', 'image'], // 上传图片、上传视频
|
||||
]
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
baseUrl: global.baseUrl,
|
||||
ctitle: "",
|
||||
dataForm: {
|
||||
key: ""
|
||||
},
|
||||
// 富文本编辑器配置
|
||||
editorOption: {
|
||||
modules: {
|
||||
toolbar: false,
|
||||
// history: {
|
||||
// delay: 1000,
|
||||
// maxStack: 50,
|
||||
// userOnly: false
|
||||
// },
|
||||
// toolbar: {
|
||||
// container: toolbarOptions,
|
||||
// handlers: {
|
||||
// image: function (value) {
|
||||
// if (value) {
|
||||
// // 调用element的图片上传组件
|
||||
// document.querySelector('.avatar-uploader input').click()
|
||||
// } else {
|
||||
// this.quill.format('image', false)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
},
|
||||
placeholder: '请输入..',
|
||||
|
||||
},
|
||||
form: {
|
||||
title: "", //必填,标题
|
||||
prescriptCategoryIds: [], //必填,所属方药
|
||||
source: "", //非必填,出处
|
||||
imageList: [], //非必填,图片地址集合
|
||||
doseOld: "", //非必填,古代剂量
|
||||
doseNow: "", //非必填,现代剂量
|
||||
preUsage: "", //非必填,煎服法
|
||||
preSong: "", //非必填,方歌
|
||||
indications: "", //非必填,主治
|
||||
sort: 1
|
||||
},
|
||||
fileList: [],
|
||||
catevalue: [0],
|
||||
cateId: 0,
|
||||
cateIdList: [0],
|
||||
dataList: [],
|
||||
treeList: [],
|
||||
treeListSel: [],
|
||||
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
cateProps: {
|
||||
value: "prescriptCategoryId",
|
||||
label: "title"
|
||||
},
|
||||
|
||||
dialogVisible: false,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
formRule: {
|
||||
title: [{
|
||||
required: true,
|
||||
message: "标题不能为空"
|
||||
}],
|
||||
prescriptCategoryIds: [{
|
||||
required: true,
|
||||
message: "所属方药不能为空"
|
||||
}],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
//this.getCatTreeList();
|
||||
},
|
||||
activated() {
|
||||
this.getDataList();
|
||||
this.getCatTreeList();
|
||||
},
|
||||
components: {
|
||||
quillEditor
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 获取文章数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/prescript/getPrescriptList"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
prescriptCategoryId: this.cateId //此项为非必选
|
||||
})
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
if (data.code == 0) {
|
||||
this.dataListLoading = false;
|
||||
// 查找分类,并将新数据添加上
|
||||
this.dataList = data.page.records;
|
||||
this.totalPage = data.page.total;
|
||||
}
|
||||
})
|
||||
.catch(({
|
||||
e
|
||||
}) => {
|
||||
this.dataListLoading = false;
|
||||
console.log(e, "e");
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数列表数据
|
||||
getCatTreeList() {
|
||||
this.loading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/prescript/getPrescriptCategoryList"),
|
||||
method: "post"
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
this.treeList = [{
|
||||
title: '全部',
|
||||
prescriptCategoryId: 0
|
||||
}];
|
||||
this.treeListSel = []
|
||||
if (data.code == 0) {
|
||||
for (var i = 0; i < data.list.length; i++) {
|
||||
if (data.list[i].children.length == 0) {
|
||||
delete data.list[i].children
|
||||
}
|
||||
this.treeList.push(data.list[i])
|
||||
this.treeListSel.push(data.list[i])
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(({
|
||||
e
|
||||
}) => {
|
||||
console.log(e, "e");
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
// 下拉数据
|
||||
handleChange(e) {
|
||||
this.cateId = e[e.length - 1];
|
||||
this.cateIdList = e
|
||||
this.getDataList();
|
||||
},
|
||||
|
||||
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val;
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val;
|
||||
this.getDataList();
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val;
|
||||
},
|
||||
// 新增
|
||||
addHandle() {
|
||||
this.ctitle = "添加文章";
|
||||
if (this.cateIdList == [0]) {
|
||||
this.form.prescriptCategoryIds = []
|
||||
} else {
|
||||
this.form.prescriptCategoryIds = this.cateIdList
|
||||
}
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
|
||||
// 修改
|
||||
editHandle(row) {
|
||||
this.ctitle = "编辑文章";
|
||||
// this.form = Object.assign({}, row);
|
||||
this.form.title = row.title
|
||||
this.form.prescriptId = row.prescriptId
|
||||
this.form.source = row.source
|
||||
this.form.doseOld = row.doseOld
|
||||
this.form.doseNow = row.doseNow
|
||||
this.form.preUsage = row.preUsage
|
||||
this.form.preSong = row.preSong
|
||||
this.form.indications = row.indications
|
||||
this.form.images = row.images
|
||||
this.form.sort = row.sort
|
||||
this.fileList = []
|
||||
this.form.prescriptCategoryIds = []
|
||||
this.form.prescriptCategoryIds.push(row.prescriptCategoryEntity.prescriptCategoryId)
|
||||
if (row.prescriptCategoryEntity.child) {
|
||||
this.form.prescriptCategoryIds.push(row.prescriptCategoryEntity.child.prescriptCategoryId)
|
||||
}
|
||||
if (row.imageList) {
|
||||
row.imageList.forEach((element, index) => {
|
||||
this.fileList.push({
|
||||
name: index,
|
||||
url: element
|
||||
});
|
||||
this.form.imageList.push(element);
|
||||
});
|
||||
} else {
|
||||
this.form.imageList = []
|
||||
}
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
|
||||
// 提交保存
|
||||
submit() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
let url = "";
|
||||
this.form.prescriptId ?
|
||||
(url = "/book/prescript/editPrescript") :
|
||||
(url = "/book/prescript/addPrescript");
|
||||
|
||||
this.form.prescriptCategoryId = this.form.prescriptCategoryIds[
|
||||
this.form.prescriptCategoryIds.length - 1
|
||||
];
|
||||
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(url),
|
||||
method: "post",
|
||||
data: this.$http.adornData(this.form)
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
if (data.code == 0) {
|
||||
this.$message.success("操作成功");
|
||||
// bc.postMessage("updateList");
|
||||
this.handleClose();
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
.catch(({
|
||||
e
|
||||
}) => {
|
||||
console.log(e, "e");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 删除
|
||||
deleteContent(item) {
|
||||
this.$confirm("确定删除 '" + item.title + "' ?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/prescript/delPrescript"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
prescriptId: item.prescriptId
|
||||
})
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data.code == 0) {
|
||||
this.$message.success("删除成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
|
||||
// 关闭弹窗
|
||||
handleClose() {
|
||||
// console.log("关闭了");
|
||||
this.$nextTick(() => {
|
||||
this.$refs["form"].resetFields();
|
||||
this.form.prescriptId = null
|
||||
this.form.imageList = []
|
||||
this.form.title = ""
|
||||
this.form.prescriptCategoryIds = []
|
||||
this.form.source = ""
|
||||
this.form.doseOld = ""
|
||||
this.form.doseNow = ""
|
||||
this.form.preUsage = ""
|
||||
this.form.preSong = ""
|
||||
this.form.indications = ""
|
||||
this.form.sort = 1
|
||||
this.fileList = []
|
||||
});
|
||||
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
|
||||
|
||||
// 图片
|
||||
handleRemoveNovel(file) {
|
||||
// console.log(file, this.fileList);
|
||||
if (this.form.imageList.length > 0) {
|
||||
this.form.imageList.forEach((element, index) => {
|
||||
{
|
||||
if (element == file.url) {
|
||||
this.form.imageList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log("删除后", this.form.imageList);
|
||||
}
|
||||
// this.dataForm.images = [];
|
||||
},
|
||||
handleSuccess(file, fileList) {
|
||||
// console.log(file, fileList);
|
||||
// this.fileList.push();
|
||||
this.form.imageList.push(file.url);
|
||||
// this.dataForm.novel = file.url
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(`当前限制选择 3 个文件`);
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.el-uploadfeng li,
|
||||
.el-uploadfeng .el-upload {
|
||||
width: 80px !important;
|
||||
height: 80px !important;
|
||||
}
|
||||
|
||||
.el-uploadfeng .el-icon-plus {
|
||||
line-height: 80px;
|
||||
}
|
||||
|
||||
.el-uploadfeng .el-upload--picture-card {
|
||||
line-height: 80px;
|
||||
}
|
||||
</style>
|
||||
277
src/views/modules/medicine/medicineList.vue
Normal file
277
src/views/modules/medicine/medicineList.vue
Normal file
@@ -0,0 +1,277 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tree :data="treeList" :props="defaultProps" @node-click="handleNodeClick" show-checkbox node-key="catId"
|
||||
:default-expanded-keys="expandedkey" :expand-on-click-node="false" default-expand-all>
|
||||
<span class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<span style="padding-right:20px">{{ node.label }}</span>
|
||||
<span>
|
||||
<el-button v-if="node.level < 2&&data.prescriptCategoryId!=3" type="text" size="mini" @click="() => append(data)">
|
||||
<i class="el-icon-plus"></i> 添加
|
||||
</el-button>
|
||||
<el-button v-if="node.level != 1" type="text" size="mini" @click="() => edit(data)" style="color: #1786b3;">
|
||||
<i class="el-icon-edit"></i> 编辑
|
||||
</el-button>
|
||||
<el-button v-if="node.childNodes.length == 0 && node.level != 1" type="text" size="mini"
|
||||
@click="() => deleteCate(data)" style="color: #eb4c0c;">
|
||||
<i class="el-icon-delete"></i> 删除
|
||||
</el-button>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
<!-- 添加/修改分类 -->
|
||||
<el-dialog :title="cateTitle" :visible.sync="addCateVisible" width="30%" center @close="addCateClose"
|
||||
:close-on-click-modal="false">
|
||||
<div style="width:280px">
|
||||
<el-form ref="cateForm" :model="cateForm" label-width="80px" :rules="cateFormRule">
|
||||
<el-form-item label="分类名称" prop="title">
|
||||
<el-input v-model="cateForm.title" placeholder="请输入分类名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
<el-input v-model="cateForm.sort" type="number" placeholder="请输入排序,默认0"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addCateClose">取 消</el-button>
|
||||
<el-button type="primary" @click="addOreEditCate">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
treeList: [],
|
||||
expandedkey: [],
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "title"
|
||||
},
|
||||
cateTitle: '',
|
||||
cateList: [], // 渲染的数据列表
|
||||
loading: false,
|
||||
addCateVisible: false,
|
||||
cateForm: {
|
||||
sort: 0,
|
||||
title: "",
|
||||
pid: null,
|
||||
id: null
|
||||
},
|
||||
contentChange: true,
|
||||
cateProps: {
|
||||
value: "id",
|
||||
label: "title"
|
||||
},
|
||||
cateFormRule: {
|
||||
title: [{
|
||||
required: true,
|
||||
message: "分类名称不能为空"
|
||||
}]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCatTreeList();
|
||||
},
|
||||
activated() {
|
||||
// console.log("激活了");
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
handleNodeClick(data) {
|
||||
// console.log(data);
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
getCatTreeList() {
|
||||
this.loading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/prescript/getPrescriptCategoryList"),
|
||||
method: "post"
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
// console.log(data, "树形结构");
|
||||
if (data.code == 0 && data.list.length > 0) {
|
||||
this.treeList = data.list;
|
||||
this.cateList = data.list;
|
||||
} else {
|
||||
this.treeList = [];
|
||||
this.cateList = [];
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(({
|
||||
e
|
||||
}) => {
|
||||
this.loading = false;
|
||||
console.log(e, "e");
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 添加分类
|
||||
append(data) {
|
||||
this.addCateVisible = true
|
||||
// this.dialogType = 'add'
|
||||
this.cateTitle = `添加分类 - 父级分类:${data.title}`
|
||||
this.cateForm.pid = data.prescriptCategoryId
|
||||
// this.cateForm.showStatus = data.showStatus
|
||||
// this.cateForm.catLevel = data.catLevel*1 + 1
|
||||
// console.log('cateForm', this.cateForm.pid, data)
|
||||
},
|
||||
|
||||
// 修改分类
|
||||
edit(row) {
|
||||
this.cateTitle = '修改分类'
|
||||
// this.cateForm.pid = data.id
|
||||
this.$nextTick(() => {
|
||||
this.cateForm = {
|
||||
title: row.title,
|
||||
prescriptCategoryId: row.prescriptCategoryId,
|
||||
pid: row.pid,
|
||||
sort: row.sort
|
||||
};
|
||||
this.addCateVisible = true
|
||||
});
|
||||
// this.dialogType = 'edit'
|
||||
},
|
||||
|
||||
// 删除分类
|
||||
deleteCate(row) {
|
||||
this.$confirm("确定删除 '"+row.title+"' ?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/prescript/delPrescriptCategory"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
prescriptCategoryId: row.prescriptCategoryId
|
||||
})
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
if (data.code == 0) {
|
||||
this.$message.success("删除成功");
|
||||
this.getCatTreeList();
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
.catch(({
|
||||
e
|
||||
}) => {
|
||||
console.log(e, "e");
|
||||
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 添加或者编辑分类
|
||||
addOreEditCate() {
|
||||
this.$refs["cateForm"].validate(valid => {
|
||||
if (valid) {
|
||||
let url = "";
|
||||
this.cateForm.prescriptCategoryId ?
|
||||
(url = "/book/prescript/editPrescriptCategory") :
|
||||
(url = "/book/prescript/addPrescriptCategory");
|
||||
this.$http({
|
||||
// url: this.$http.adornUrl('/book/sysdictdata/selectByType/express_name'),
|
||||
url: this.$http.adornUrl(url),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
title: this.cateForm.title,
|
||||
pid: this.cateForm.pid,
|
||||
sort: this.cateForm.sort,
|
||||
prescriptCategoryId: this.cateForm.prescriptCategoryId
|
||||
})
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
// console.log(data, "提交");
|
||||
if (data.code == 0) {
|
||||
this.$message.success("操作成功");
|
||||
this.getCatTreeList();
|
||||
this.addCateClose();
|
||||
}
|
||||
})
|
||||
.catch(({
|
||||
e
|
||||
}) => {
|
||||
console.log(e, "e");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 关闭弹窗
|
||||
addCateClose() {
|
||||
// console.log("关闭了");
|
||||
this.addCateVisible = false;
|
||||
this.cateForm = {
|
||||
sort: 0,
|
||||
title: "",
|
||||
pid: null,
|
||||
id: null
|
||||
};
|
||||
this.$refs["cateForm"].resetFields();
|
||||
this.$nextTick(() => {
|
||||
this.$refs["cateForm"].clearValidate();
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/deep/.el-table__row--level-1 {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.contentList {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.contenItem {
|
||||
line-height: 30px;
|
||||
padding: 4px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 10px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
i {
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.el-icon-edit {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.el-icon-delete {
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<el-row :gutter="10" class="flexbox">
|
||||
<div v-if="activities.length == 0" class="noinfo">-暂无物流信息-</div>
|
||||
<el-col v-else :lg="8" :md="12" :xs="24" v-for="(item, index) in activities"
|
||||
<el-col v-else :lg="8" :md="12" :xs="24" v-for="(item, index) in activities" :key="index"
|
||||
:class="item.length == 1 ? 'onlyOne' : 'notOone'" >
|
||||
<div class="scroll">
|
||||
<div style="margin-bottom: 5px;"><icon-svg name="truck"></icon-svg><span
|
||||
|
||||
Reference in New Issue
Block a user