吴门医述接口对接
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="书名">
|
<el-form-item label="姓名">
|
||||||
<el-input v-model="dataForm.bookName" placeholder="请输入书名"></el-input>
|
<el-input v-model="dataForm.bookName" placeholder="请输入书名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -21,17 +21,32 @@
|
|||||||
v-loading="dataListLoading"
|
v-loading="dataListLoading"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="productName"
|
prop="name"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
label="分类">
|
label="姓名">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="url" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ filterAA(scope.row.typeId) }}
|
<a :href ="'http://' + scope.row.url" target="_blank">{{ scope.row.url }}</a>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="书名" align="center" prop="name">
|
<el-table-column label="图片" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.book.name }}
|
<img :src="scope.row.img" alt="" style="width:70px;height:100px" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="内容" align="center" prop="content">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="分类" align="center" prop="type">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ filterAA(scope.row.type) }}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="地址" align="center" prop="cityId">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ translateaddr(scope.row.cityId) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -58,6 +73,11 @@
|
|||||||
<!-- 弹窗, 新增 / 修改 -->
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
<el-dialog :visible.sync="addOrUpdateVisible" :append-to-body="true" :title="titlesub" width="50%" @close="cancleClose">
|
<el-dialog :visible.sync="addOrUpdateVisible" :append-to-body="true" :title="titlesub" width="50%" @close="cancleClose">
|
||||||
<el-form :inline="true" :model="addForm" ref="addFormRef" :rules="addFormRule">
|
<el-form :inline="true" :model="addForm" ref="addFormRef" :rules="addFormRule">
|
||||||
|
<el-row type="flex" justify="center">
|
||||||
|
<el-form-item label="姓名" prop="name">
|
||||||
|
<el-input style="width:500px" v-model="addForm.name"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
<el-row type="flex" justify="center">
|
<el-row type="flex" justify="center">
|
||||||
<el-form-item label="分类" prop="typeId">
|
<el-form-item label="分类" prop="typeId">
|
||||||
<el-select v-model="addForm.typeId" placeholder="请选择分类" style="width: 500px;">
|
<el-select v-model="addForm.typeId" placeholder="请选择分类" style="width: 500px;">
|
||||||
@@ -67,16 +87,42 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row type="flex" justify="center">
|
<el-row type="flex" justify="center">
|
||||||
<el-form-item label="书名" prop="bookId">
|
<el-form-item label="url" prop="url" label-width="48px">
|
||||||
<el-select v-model="addForm.bookId" placeholder="请选择书名" style="width: 500px;">
|
<el-input style="width:500px" v-model="addForm.url"></el-input>
|
||||||
<el-option v-for="item in booknameList" :key="item.id" :label="item.name" :value="item.id">
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<el-row type="flex" justify="center">
|
||||||
|
<el-form-item label="内容" prop="content" label-width="48px">
|
||||||
|
<el-input style="width:500px" v-model="addForm.content"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<el-row type="flex" justify="center">
|
||||||
|
<el-form-item label="地址" prop="cityId" label-width="48px">
|
||||||
|
<el-select v-model="addForm.provId" placeholder="请选择省份" style="width:249px"
|
||||||
|
@change="provinceChange">
|
||||||
|
<el-option v-for="item in provinceEntity" :key="item.provId" :label="item.provName"
|
||||||
|
:value="item.provId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-select v-model="addForm.cityId" placeholder="请选择市" style="width:249px">
|
||||||
|
<el-option v-for="item in cityEntity" :key="item.cityId" :label="item.cityName"
|
||||||
|
:value="item.cityId">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row type="flex" justify="center">
|
<el-row type="flex" justify="center">
|
||||||
<el-form-item label="排序" label-width="48px">
|
<el-form-item label="图片" prop="img">
|
||||||
<el-input style="width:500px" v-model="addForm.sort"></el-input>
|
<el-upload :limit="1" class="el-uploadfeng "
|
||||||
|
ref="files"
|
||||||
|
:class="{ uoloadSty: dataForm.showBtnDealImg, disUoloadSty: dataForm.noneBtnImg }"
|
||||||
|
:action="baseUrl + '/oss/fileoss'" list-type="picture-card" :on-preview="handlePictureCardPreview"
|
||||||
|
:file-list="fileList" :on-success="handlePicSuccess" accept=".jpeg,.jpg,.gif,.png" :on-remove="handleRemove">
|
||||||
|
<i class="el-icon-plus"></i>
|
||||||
|
</el-upload>
|
||||||
|
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||||
|
<img width="100%" :src="addForm.productImages" alt="">
|
||||||
|
</el-dialog>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -90,25 +136,34 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import global from '../../common/common.vue' //引入共用组间
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
baseUrl: global.baseUrl,
|
||||||
|
cityEntity: [],
|
||||||
|
provinceEntity: [], //省地址
|
||||||
typeList: [], //类型列表
|
typeList: [], //类型列表
|
||||||
booknameList: [],
|
booknameList: [],
|
||||||
dataForm: {
|
dataForm: {
|
||||||
dictType: '',//分类
|
dictType: '',//分类
|
||||||
bookName: '',//书名
|
bookName: '',//书名
|
||||||
},
|
},
|
||||||
|
fileList: [],
|
||||||
addForm: {
|
addForm: {
|
||||||
"id": '',//新增不传
|
id: '',//新增不传
|
||||||
"bookId": '',
|
name: '', //姓名
|
||||||
"typeId": '',
|
typeId: '',//分类
|
||||||
"sort": ''
|
url: '',
|
||||||
|
content: '',
|
||||||
|
cityId: '',
|
||||||
|
provId: '',
|
||||||
|
productImages: ''
|
||||||
},
|
},
|
||||||
editId: '',
|
editId: '',
|
||||||
addFormRule: {
|
addFormRule: {
|
||||||
typeId: [{required: true, message: "请选择分类" }],
|
typeId: [{required: true, message: "请选择分类" }],
|
||||||
bookId: [{required: true, message: "请选择书名"}]
|
name: [{required: true, message: "请输入姓名"}]
|
||||||
},
|
},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
// publishStatus: false,
|
// publishStatus: false,
|
||||||
@@ -119,21 +174,27 @@ export default {
|
|||||||
dataListSelections: [],
|
dataListSelections: [],
|
||||||
addOrUpdateVisible: false,
|
addOrUpdateVisible: false,
|
||||||
bookIds:[],
|
bookIds:[],
|
||||||
titlesub: '新增'
|
titlesub: '新增',
|
||||||
|
dialogVisible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
// AddOrUpdate,
|
// AddOrUpdate,
|
||||||
// chooseBook
|
// chooseBook
|
||||||
},
|
},
|
||||||
activated () {
|
created() {
|
||||||
this.gettypeList()
|
this.gettypeList()
|
||||||
|
this.getprovinceEntity()
|
||||||
|
},
|
||||||
|
activated () {
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
|
this.gettypeList()
|
||||||
|
this.getprovinceEntity()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
gettypeList () {
|
gettypeList () {
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/medicaldes/typeList?label=medicaldesBookType'),
|
url: this.$http.adornUrl('/book/medicaldes/typeList?label=inheritType'),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
@@ -148,7 +209,7 @@ export default {
|
|||||||
getDataList () {
|
getDataList () {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/medicaldes/bookRelationListByType'),
|
url: this.$http.adornUrl('/book/medicaldes/inheritListByPage'),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: this.$http.adornData({
|
data: this.$http.adornData({
|
||||||
"dictType": this.dataForm.dictType,
|
"dictType": this.dataForm.dictType,
|
||||||
@@ -167,31 +228,22 @@ export default {
|
|||||||
this.dataListLoading = false
|
this.dataListLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getbookname() {
|
provinceChange() {
|
||||||
// 获取数据列表
|
this.addForm.cityId = ''
|
||||||
this.$http({
|
this.cityEntity = []
|
||||||
url: this.$http.adornUrl('/book/book/list'),
|
console.log('addForm.provinceCode', this.addForm.provId);
|
||||||
method: 'get',
|
this.$http({
|
||||||
params: this.$http.adornParams({
|
url: this.$http.adornUrl(`/api/province/getCityList?provId=${this.addForm.provId}`),
|
||||||
'page': 1,
|
method: 'post',
|
||||||
'limit': 1000000,
|
}).then(({data}) => {
|
||||||
'bookName': '',
|
|
||||||
'publisherName' : '',
|
|
||||||
'authorName' : ''
|
|
||||||
})
|
|
||||||
}).then(({ data }) => {
|
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.booknameList = data.page.list
|
this.cityEntity = data.prov
|
||||||
|
console.log('data67y8ui9', data);
|
||||||
} else {
|
} else {
|
||||||
this.booknameList = []
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
filterAA(val){
|
|
||||||
var aa = this.typeList.filter(obj => obj.dictType == val)
|
|
||||||
return aa[0].dictValue
|
|
||||||
},
|
|
||||||
// 每页数
|
// 每页数
|
||||||
sizeChangeHandle (val) {
|
sizeChangeHandle (val) {
|
||||||
this.pageSize = val
|
this.pageSize = val
|
||||||
@@ -209,17 +261,39 @@ export default {
|
|||||||
},
|
},
|
||||||
// 新增 / 修改
|
// 新增 / 修改
|
||||||
editOrUpdateHandle (row) {
|
editOrUpdateHandle (row) {
|
||||||
|
console.log('rowzz', row.img);
|
||||||
this.titlesub = '修改'
|
this.titlesub = '修改'
|
||||||
this.getbookname()
|
|
||||||
this.editId = row.id
|
this.editId = row.id
|
||||||
this.addForm.bookId = row.bookId
|
this.addForm.name = row.name
|
||||||
this.addForm.typeId = row.typeId.toString()
|
this.addForm.url = row.url
|
||||||
this.addForm.sort = row.sort
|
this.addForm.productImages = row.img
|
||||||
this.addOrUpdateVisible = true
|
this.addForm.content = row.content
|
||||||
|
this.addForm.typeId = row.type.toString()
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.fileList = []
|
||||||
|
})
|
||||||
|
var img = {
|
||||||
|
name: '',
|
||||||
|
url: row.img
|
||||||
|
}
|
||||||
|
var attr = []
|
||||||
|
attr.push(img)
|
||||||
|
this.fileList = attr
|
||||||
|
console.log('this.fileList', this.fileList);
|
||||||
|
for(var i = 0; i< this.provinceEntity.length; i++) {
|
||||||
|
for(var j = 0; j< this.provinceEntity[i].cityList.length; j++) {
|
||||||
|
if(this.provinceEntity[i].cityList[j].cityId == row.cityId) {
|
||||||
|
this.addForm.provId = this.provinceEntity[i].cityList[j].provId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.provinceChange()
|
||||||
|
console.log('this.addForm.provId', this.addForm.provId);
|
||||||
|
|
||||||
|
this.addForm.cityId = row.cityId
|
||||||
|
this.addOrUpdateVisible = true
|
||||||
},
|
},
|
||||||
addOrUpdateHandle() {
|
addOrUpdateHandle() {
|
||||||
this.getbookname()
|
|
||||||
this.editId = ''
|
this.editId = ''
|
||||||
this.titlesub = '新增'
|
this.titlesub = '新增'
|
||||||
this.addOrUpdateVisible = true
|
this.addOrUpdateVisible = true
|
||||||
@@ -228,11 +302,30 @@ export default {
|
|||||||
this.addOrUpdateVisible = false
|
this.addOrUpdateVisible = false
|
||||||
this.$refs["addFormRef"].resetFields();
|
this.$refs["addFormRef"].resetFields();
|
||||||
this.addForm = {
|
this.addForm = {
|
||||||
"id": '',//新增不传
|
id: '',//新增不传
|
||||||
"bookId": '',
|
name: '', //姓名
|
||||||
"typeId": '',
|
typeId: '',//分类
|
||||||
"sort": ''
|
url: '',
|
||||||
|
content: '',
|
||||||
|
cityId: '',
|
||||||
|
provId: '',
|
||||||
|
productImages: ''
|
||||||
}
|
}
|
||||||
|
this.fileList = []
|
||||||
|
},
|
||||||
|
getprovinceEntity() {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl('/api/province/getProvince'),
|
||||||
|
method: 'get',
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.provinceEntity = data.provinceEntity
|
||||||
|
console.log('this.provinceEntit', this.provinceEntity);
|
||||||
|
} else {
|
||||||
|
this.provinceEntity = []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
deleteHandle (id) {
|
deleteHandle (id) {
|
||||||
@@ -242,7 +335,7 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl(`/book/medicaldes/delBookRelation?id=${id}`),
|
url: this.$http.adornUrl(`/book/medicaldes/delInherit?id=${id}`),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
@@ -264,13 +357,16 @@ export default {
|
|||||||
this.$refs["addFormRef"].validate(valid => {
|
this.$refs["addFormRef"].validate(valid => {
|
||||||
if(valid) {
|
if(valid) {
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateBookRelation'),
|
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateInherit'),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: this.$http.adornData({
|
data: this.$http.adornData({
|
||||||
"id": this.editId, //新增不传
|
"id": this.editId, //新增不传
|
||||||
"bookId": this.addForm.bookId,
|
"name": this.addForm.name,
|
||||||
"typeId": this.addForm.typeId,
|
"url": this.addForm.url,
|
||||||
"sort": this.addForm.sort
|
"img": this.addForm.productImages,
|
||||||
|
"content": this.addForm.content,
|
||||||
|
"type": this.addForm.typeId,
|
||||||
|
"cityId": this.addForm.cityId
|
||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
@@ -283,6 +379,43 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
handlePictureCardPreview(file) {
|
||||||
|
this.addForm.productImages = file.url;
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
handlePicSuccess(res, file) {
|
||||||
|
// console.log(res,'res')
|
||||||
|
if (res.msg == "success") {
|
||||||
|
this.addForm.productImages = res.url;
|
||||||
|
this.fileList.push({
|
||||||
|
name: file.name,
|
||||||
|
url: res.url
|
||||||
|
})
|
||||||
|
console.log(this.dataForm.productImages,'productImages')
|
||||||
|
this.$message.success("上传成功");
|
||||||
|
} else {
|
||||||
|
this.$message.error("上传失败");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleRemove(file, fileList) {
|
||||||
|
this.addForm.productImages = '';
|
||||||
|
this.fileList = fileList
|
||||||
|
// this.addForm.noneBtnImg = fileList.length >= this.addForm.limitCountImg;
|
||||||
|
},
|
||||||
|
filterAA(val){
|
||||||
|
var aa = this.typeList.filter(obj => obj.dictType == val)
|
||||||
|
return aa[0].dictValue
|
||||||
|
// return aa
|
||||||
|
},
|
||||||
|
translateaddr(code) {
|
||||||
|
for(var i = 0; i< this.provinceEntity.length; i++) {
|
||||||
|
for(var j = 0; j< this.provinceEntity[i].cityList.length; j++) {
|
||||||
|
if(this.provinceEntity[i].cityList[j].cityId == code) {
|
||||||
|
return this.provinceEntity[i].cityList[j].cityName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,290 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mod-config">
|
||||||
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||||
|
<el-form-item label="分类">
|
||||||
|
<el-select v-model="dataForm.dictType" placeholder="请选择分类">
|
||||||
|
<el-option v-for="(item,index) in typeList" :key="index" :label="item.dictValue" :value="item.dictType">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="书名">
|
||||||
|
<el-input v-model="dataForm.ligthname" placeholder="请输入书名"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="pageIndex = 1;getDataList()">查询</el-button>
|
||||||
|
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table
|
||||||
|
:data="dataList"
|
||||||
|
border
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
style="width: 100%;">
|
||||||
|
<el-table-column
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="分类">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ filterAA(scope.row.typeId) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="书名" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.name }}
|
||||||
|
</template>
|
||||||
|
</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="editOrUpdateHandle(scope.row)">修改</el-button>
|
||||||
|
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</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 :visible.sync="addOrUpdateVisible" :append-to-body="true" :title="titlesub" width="50%" @close="cancleClose">
|
||||||
|
<el-form :inline="true" :model="addForm" ref="addFormRef" :rules="addFormRule">
|
||||||
|
<el-row type="flex" justify="center">
|
||||||
|
<el-form-item label="分类" prop="typeId">
|
||||||
|
<el-select v-model="addForm.typeId" placeholder="请选择分类" style="width: 500px;">
|
||||||
|
<el-option v-for="(item,index) in typeList" :key="index" :label="item.dictValue" :value="item.dictType">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<el-row type="flex" justify="center">
|
||||||
|
<el-form-item label="书名" prop="bookId">
|
||||||
|
<el-select v-model="addForm.bookId" placeholder="请选择书名" style="width: 500px;">
|
||||||
|
<el-option v-for="item in booknameList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<el-row type="flex" justify="center">
|
||||||
|
<el-form-item label="排序" label-width="48px">
|
||||||
|
<el-input style="width:500px" v-model="addForm.sort"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cancleClose">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="addOreEditCate">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" @showchooseBookf = "showchooseBookf"></add-or-update>
|
||||||
|
<choose-book v-if="chooseBookVisible" :bookIds = bookIds ref="chooseBook" :chooseBookVisible = chooseBookVisible @closeBookf = "closeBookf"></choose-book> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
typeList: [
|
||||||
|
{
|
||||||
|
dictValue:'吴门之歌',
|
||||||
|
dictType: 1,
|
||||||
|
},{
|
||||||
|
dictValue:'巴山夜雨',
|
||||||
|
dictType: 2,
|
||||||
|
},{
|
||||||
|
dictValue:'吴门之徽',
|
||||||
|
dictType: 3,
|
||||||
|
}
|
||||||
|
], //类型列表
|
||||||
|
booknameList: [],
|
||||||
|
dataForm: {
|
||||||
|
dictType: '',//分类
|
||||||
|
ligthname: '',//书名
|
||||||
|
},
|
||||||
|
addForm: {
|
||||||
|
"id": '',//新增不传
|
||||||
|
"ligthname": '',
|
||||||
|
"typeId": '',
|
||||||
|
},
|
||||||
|
editId: '',
|
||||||
|
addFormRule: {
|
||||||
|
typeId: [{required: true, message: "请选择分类" }],
|
||||||
|
bookId: [{required: true, message: "请选择书名"}]
|
||||||
|
},
|
||||||
|
dataList: [],
|
||||||
|
// publishStatus: false,
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalPage: 0,
|
||||||
|
dataListLoading: false,
|
||||||
|
dataListSelections: [],
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
bookIds:[],
|
||||||
|
titlesub: '新增'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
// AddOrUpdate,
|
||||||
|
// chooseBook
|
||||||
|
},
|
||||||
|
activated () {
|
||||||
|
// this.gettypeList()
|
||||||
|
this.getDataList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList () {
|
||||||
|
this.dataListLoading = true
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl('/book/medicaldes/lightListByPage'),
|
||||||
|
method: 'post',
|
||||||
|
data: this.$http.adornData({
|
||||||
|
"type": this.dataForm.dictType,
|
||||||
|
"name": this.dataForm.ligthname,
|
||||||
|
"current": this.pageIndex,
|
||||||
|
"limit": this.pageSize
|
||||||
|
})
|
||||||
|
}).then(({data}) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.dataList = data.result.records
|
||||||
|
this.totalPage = data.result.total
|
||||||
|
} else {
|
||||||
|
this.dataList = []
|
||||||
|
this.totalPage = 0
|
||||||
|
}
|
||||||
|
this.dataListLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getbookname() {
|
||||||
|
// 获取数据列表
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl('/book/book/list'),
|
||||||
|
method: 'get',
|
||||||
|
params: this.$http.adornParams({
|
||||||
|
'page': 1,
|
||||||
|
'limit': 1000000,
|
||||||
|
'bookName': '',
|
||||||
|
'publisherName' : '',
|
||||||
|
'authorName' : ''
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.booknameList = data.page.list
|
||||||
|
} else {
|
||||||
|
this.booknameList = []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
filterAA(val){
|
||||||
|
if(val == 1) {
|
||||||
|
return '吴门之歌'
|
||||||
|
} else if(val == 2) {
|
||||||
|
return '巴山夜雨'
|
||||||
|
} else {
|
||||||
|
return '吴门之徽'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 每页数
|
||||||
|
sizeChangeHandle (val) {
|
||||||
|
this.pageSize = val
|
||||||
|
this.pageIndex = 1
|
||||||
|
this.getDataList()
|
||||||
|
},
|
||||||
|
// 当前页
|
||||||
|
currentChangeHandle (val) {
|
||||||
|
this.pageIndex = val
|
||||||
|
this.getDataList()
|
||||||
|
},
|
||||||
|
// 多选
|
||||||
|
selectionChangeHandle (val) {
|
||||||
|
this.dataListSelections = val
|
||||||
|
},
|
||||||
|
// 新增 / 修改
|
||||||
|
editOrUpdateHandle (row) {
|
||||||
|
this.titlesub = '修改'
|
||||||
|
this.getbookname()
|
||||||
|
this.editId = row.id
|
||||||
|
this.addForm.bookId = row.bookId
|
||||||
|
this.addForm.typeId = row.typeId.toString()
|
||||||
|
this.addForm.sort = row.sort
|
||||||
|
this.addOrUpdateVisible = true
|
||||||
|
|
||||||
|
},
|
||||||
|
addOrUpdateHandle() {
|
||||||
|
this.getbookname()
|
||||||
|
this.editId = ''
|
||||||
|
this.titlesub = '新增'
|
||||||
|
this.addOrUpdateVisible = true
|
||||||
|
},
|
||||||
|
cancleClose() {
|
||||||
|
this.addOrUpdateVisible = false
|
||||||
|
this.$refs["addFormRef"].resetFields();
|
||||||
|
this.addForm = {
|
||||||
|
"id": '',//新增不传
|
||||||
|
"bookId": '',
|
||||||
|
"typeId": '',
|
||||||
|
"sort": ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
deleteHandle (id) {
|
||||||
|
this.$confirm('请确认是否删除?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl(`/book/medicaldes/delBookRelation?id=${id}`),
|
||||||
|
method: 'post',
|
||||||
|
}).then(({data}) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getDataList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addOreEditCate() {
|
||||||
|
this.$refs["addFormRef"].validate(valid => {
|
||||||
|
if(valid) {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateBookRelation'),
|
||||||
|
method: 'post',
|
||||||
|
data: this.$http.adornData({
|
||||||
|
"id": this.editId, //新增不传
|
||||||
|
"bookId": this.addForm.bookId,
|
||||||
|
"typeId": this.addForm.typeId,
|
||||||
|
"sort": this.addForm.sort
|
||||||
|
})
|
||||||
|
}).then(({data}) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message.success("成功");
|
||||||
|
this.addOrUpdateVisible = false
|
||||||
|
this.getDataList()
|
||||||
|
} else {
|
||||||
|
this.$message.error("失败");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
v-loading="dataListLoading"
|
v-loading="dataListLoading"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="productName"
|
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
label="分类">
|
label="分类">
|
||||||
@@ -29,7 +28,7 @@
|
|||||||
{{ filterAA(scope.row.typeId) }}
|
{{ filterAA(scope.row.typeId) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="书名" align="center" prop="name">
|
<el-table-column label="书名" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.book.name }}
|
{{ scope.row.book.name }}
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user