吴门医述
This commit is contained in:
@@ -419,10 +419,10 @@
|
|||||||
// 表单提交
|
// 表单提交
|
||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
console.log('11111', this.dataForm.medicaldesBookType)
|
console.log('11111', this.dataForm.medicaldesBookType)
|
||||||
if (this.dataForm.medicaldesBookType.length == 0) {
|
// if (this.dataForm.medicaldesBookType.length == 0) {
|
||||||
this.$message.error("请选择图书类型");
|
// this.$message.error("请选择图书类型");
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$http({
|
this.$http({
|
||||||
|
|||||||
@@ -15,25 +15,17 @@
|
|||||||
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table
|
<el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%;">
|
||||||
:data="dataList"
|
<el-table-column prop="name" header-align="center" align="center" label="姓名">
|
||||||
border
|
|
||||||
v-loading="dataListLoading"
|
|
||||||
style="width: 100%;">
|
|
||||||
<el-table-column
|
|
||||||
prop="name"
|
|
||||||
header-align="center"
|
|
||||||
align="center"
|
|
||||||
label="姓名">
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="url" align="center">
|
<el-table-column label="url" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<a :href ="'http://' + scope.row.url" target="_blank">{{ scope.row.url }}</a>
|
<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">
|
<el-table-column label="图片" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<img :src="scope.row.img" alt="" style="width:70px;height:100px" />
|
<img v-for="item in scope.row.imgList" :src="item.url" alt="" style="width:70px;height:100px;margin: 0 5px;" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="内容" align="center" prop="content">
|
<!-- <el-table-column label="内容" align="center" prop="content">
|
||||||
@@ -49,29 +41,25 @@
|
|||||||
{{ translateaddr(scope.row.cityId) }}
|
{{ translateaddr(scope.row.cityId) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column label="排序" align="center" prop="sort" width="50">
|
||||||
fixed="right"
|
<template slot-scope="scope">
|
||||||
header-align="center"
|
{{ scope.row.sort }}
|
||||||
align="center"
|
</template>
|
||||||
width="150"
|
</el-table-column>
|
||||||
label="操作">
|
<el-table-column fixed="right" header-align="center" align="center" width="100" label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" size="small" @click="editOrUpdateHandle(scope.row)">修改</el-button>
|
<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>
|
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
|
||||||
@size-change="sizeChangeHandle"
|
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
|
||||||
@current-change="currentChangeHandle"
|
|
||||||
:current-page="pageIndex"
|
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
|
||||||
:page-size="pageSize"
|
|
||||||
:total="totalPage"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper">
|
layout="total, sizes, prev, pager, next, jumper">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
<!-- 弹窗, 新增 / 修改 -->
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
<el-dialog :visible.sync="addOrUpdateVisible" :append-to-body="true" :title="titlesub" width="50%" @close="cancleClose">
|
<el-dialog :visible.sync="addOrUpdateVisible" :close-on-click-modal="false" :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-row type="flex" justify="center">
|
||||||
<el-form-item label="姓名" prop="name">
|
<el-form-item label="姓名" prop="name">
|
||||||
@@ -98,31 +86,29 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row type="flex" justify="center">
|
<el-row type="flex" justify="center">
|
||||||
<el-form-item label="地址" prop="cityId" label-width="48px">
|
<el-form-item label="地址" prop="cityId" label-width="48px">
|
||||||
<el-select v-model="addForm.provId" placeholder="请选择省份" style="width:249px"
|
<el-select v-model="addForm.provId" placeholder="请选择省份" style="width:249px" @change="provinceChange">
|
||||||
@change="provinceChange">
|
<el-option v-for="item in provinceEntity" :key="item.provId" :label="item.provName" :value="item.provId">
|
||||||
<el-option v-for="item in provinceEntity" :key="item.provId" :label="item.provName"
|
|
||||||
:value="item.provId">
|
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select v-model="addForm.cityId" placeholder="请选择市" style="width:249px">
|
<el-select v-model="addForm.cityId" placeholder="请选择市" style="width:249px">
|
||||||
<el-option v-for="item in cityEntity" :key="item.cityId" :label="item.cityName"
|
<el-option v-for="item in cityEntity" :key="item.cityId" :label="item.cityName" :value="item.cityId">
|
||||||
: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="图片" prop="img" label-width="48px">
|
<el-form-item label="图片" prop="img" label-width="48px">
|
||||||
<el-upload :limit="1" class="el-uploadfeng "
|
<el-upload class="el-uploadfeng " ref="files"
|
||||||
ref="files"
|
|
||||||
:class="{ uoloadSty: dataForm.showBtnDealImg, disUoloadSty: dataForm.noneBtnImg }"
|
:class="{ uoloadSty: dataForm.showBtnDealImg, disUoloadSty: dataForm.noneBtnImg }"
|
||||||
:action="baseUrl + '/oss/fileoss'" list-type="picture-card" :on-preview="handlePictureCardPreview"
|
:action="baseUrl + '/oss/fileoss'" list-type="picture-card" :file-list="fileList"
|
||||||
:file-list="fileList" :on-success="handlePicSuccess" accept=".jpeg,.jpg,.gif,.png" :on-remove="handleRemove">
|
:on-success="handlePicSuccess" accept=".jpeg,.jpg,.gif,.png" :on-remove="handleRemove">
|
||||||
<i class="el-icon-plus"></i>
|
<i class="el-icon-plus"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
</el-form-item>
|
||||||
<img width="100%" :src="addForm.productImages" alt="">
|
</el-row>
|
||||||
</el-dialog>
|
<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-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -136,9 +122,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import global from '../../common/common.vue' //引入共用组间
|
import global from '../../common/common.vue' //引入共用组间
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
baseUrl: global.baseUrl,
|
baseUrl: global.baseUrl,
|
||||||
cityEntity: [],
|
cityEntity: [],
|
||||||
@@ -146,24 +132,30 @@ export default {
|
|||||||
typeList: [], //类型列表
|
typeList: [], //类型列表
|
||||||
booknameList: [],
|
booknameList: [],
|
||||||
dataForm: {
|
dataForm: {
|
||||||
dictType: '',//分类
|
dictType: '', //分类
|
||||||
bookName: '',//书名
|
bookName: '', //书名
|
||||||
},
|
},
|
||||||
fileList: [],
|
fileList: [],
|
||||||
addForm: {
|
addForm: {
|
||||||
id: '',//新增不传
|
id: '', //新增不传
|
||||||
name: '', //姓名
|
name: '', //姓名
|
||||||
typeId: '',//分类
|
typeId: '', //分类
|
||||||
url: '',
|
url: '',
|
||||||
content: '',
|
content: '',
|
||||||
cityId: '',
|
cityId: '',
|
||||||
provId: '',
|
provId: '',
|
||||||
productImages: ''
|
sort: 0
|
||||||
},
|
},
|
||||||
editId: '',
|
editId: '',
|
||||||
addFormRule: {
|
addFormRule: {
|
||||||
typeId: [{required: true, message: "请选择分类" }],
|
typeId: [{
|
||||||
name: [{required: true, message: "请输入姓名"}]
|
required: true,
|
||||||
|
message: "请选择分类"
|
||||||
|
}],
|
||||||
|
name: [{
|
||||||
|
required: true,
|
||||||
|
message: "请输入姓名"
|
||||||
|
}]
|
||||||
},
|
},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
// publishStatus: false,
|
// publishStatus: false,
|
||||||
@@ -173,7 +165,7 @@ export default {
|
|||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
dataListSelections: [],
|
dataListSelections: [],
|
||||||
addOrUpdateVisible: false,
|
addOrUpdateVisible: false,
|
||||||
bookIds:[],
|
bookIds: [],
|
||||||
titlesub: '新增',
|
titlesub: '新增',
|
||||||
dialogVisible: false
|
dialogVisible: false
|
||||||
}
|
}
|
||||||
@@ -186,17 +178,19 @@ export default {
|
|||||||
this.gettypeList()
|
this.gettypeList()
|
||||||
this.getprovinceEntity()
|
this.getprovinceEntity()
|
||||||
},
|
},
|
||||||
activated () {
|
activated() {
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
this.gettypeList()
|
this.gettypeList()
|
||||||
this.getprovinceEntity()
|
this.getprovinceEntity()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
gettypeList () {
|
gettypeList() {
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/medicaldes/typeList?label=inheritType'),
|
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) {
|
||||||
this.typeList = data.result
|
this.typeList = data.result
|
||||||
|
|
||||||
@@ -206,7 +200,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList () {
|
getDataList() {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/medicaldes/inheritListByPage'),
|
url: this.$http.adornUrl('/book/medicaldes/inheritListByPage'),
|
||||||
@@ -217,9 +211,25 @@ export default {
|
|||||||
"current": this.pageIndex,
|
"current": this.pageIndex,
|
||||||
"limit": this.pageSize
|
"limit": this.pageSize
|
||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.result.records
|
this.dataList = data.result.records
|
||||||
|
for (let i = 0; i < this.dataList.length; i++) {
|
||||||
|
let imgList = []
|
||||||
|
if (this.dataList[i].img != '') {
|
||||||
|
let arr = this.dataList[i].img.split(';');
|
||||||
|
arr.forEach((item, index) => {
|
||||||
|
imgList.push({
|
||||||
|
name: index,
|
||||||
|
url: item
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.dataList[i].imgList = imgList
|
||||||
|
}
|
||||||
|
|
||||||
this.totalPage = data.result.total
|
this.totalPage = data.result.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
@@ -235,52 +245,45 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl(`/api/province/getCityList?provId=${this.addForm.provId}`),
|
url: this.$http.adornUrl(`/api/province/getCityList?provId=${this.addForm.provId}`),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
}).then(({data}) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.cityEntity = data.prov
|
this.cityEntity = data.prov
|
||||||
console.log('data67y8ui9', data);
|
console.log('data67y8ui9', data);
|
||||||
} else {
|
} else {}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
// 每页数
|
// 每页数
|
||||||
sizeChangeHandle (val) {
|
sizeChangeHandle(val) {
|
||||||
this.pageSize = val
|
this.pageSize = val
|
||||||
this.pageIndex = 1
|
this.pageIndex = 1
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
// 当前页
|
// 当前页
|
||||||
currentChangeHandle (val) {
|
currentChangeHandle(val) {
|
||||||
this.pageIndex = val
|
this.pageIndex = val
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
// 多选
|
// 多选
|
||||||
selectionChangeHandle (val) {
|
selectionChangeHandle(val) {
|
||||||
this.dataListSelections = val
|
this.dataListSelections = val
|
||||||
},
|
},
|
||||||
// 新增 / 修改
|
// 新增 / 修改
|
||||||
editOrUpdateHandle (row) {
|
editOrUpdateHandle(row) {
|
||||||
console.log('rowzz', row.img);
|
console.log('rowzz', row.img);
|
||||||
this.titlesub = '修改'
|
this.titlesub = '修改'
|
||||||
this.editId = row.id
|
this.editId = row.id
|
||||||
this.addForm.name = row.name
|
this.addForm.name = row.name
|
||||||
this.addForm.url = row.url
|
this.addForm.url = row.url
|
||||||
this.addForm.productImages = row.img
|
|
||||||
this.addForm.content = row.content
|
this.addForm.content = row.content
|
||||||
this.addForm.typeId = row.type.toString()
|
this.addForm.typeId = row.type.toString()
|
||||||
this.fileList = []
|
this.addForm.sort = row.sort
|
||||||
var img = {
|
this.fileList = row.imgList
|
||||||
name: '',
|
for (var i = 0; i < this.provinceEntity.length; i++) {
|
||||||
url: row.img
|
for (var j = 0; j < this.provinceEntity[i].cityList.length; j++) {
|
||||||
}
|
if (this.provinceEntity[i].cityList[j].cityId == row.cityId) {
|
||||||
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.addForm.provId = this.provinceEntity[i].cityList[j].provId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -300,14 +303,14 @@ export default {
|
|||||||
this.addOrUpdateVisible = false
|
this.addOrUpdateVisible = false
|
||||||
this.$refs["addFormRef"].resetFields();
|
this.$refs["addFormRef"].resetFields();
|
||||||
this.addForm = {
|
this.addForm = {
|
||||||
id: '',//新增不传
|
id: '', //新增不传
|
||||||
name: '', //姓名
|
name: '', //姓名
|
||||||
typeId: '',//分类
|
typeId: '', //分类
|
||||||
url: '',
|
url: '',
|
||||||
content: '',
|
content: '',
|
||||||
cityId: '',
|
cityId: '',
|
||||||
provId: '',
|
provId: '',
|
||||||
productImages: ''
|
sort: 0
|
||||||
}
|
}
|
||||||
this.fileList = []
|
this.fileList = []
|
||||||
},
|
},
|
||||||
@@ -315,7 +318,9 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/api/province/getProvince'),
|
url: this.$http.adornUrl('/api/province/getProvince'),
|
||||||
method: 'get',
|
method: 'get',
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.provinceEntity = data.provinceEntity
|
this.provinceEntity = data.provinceEntity
|
||||||
console.log('this.provinceEntit', this.provinceEntity);
|
console.log('this.provinceEntit', this.provinceEntity);
|
||||||
@@ -326,7 +331,7 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
deleteHandle (id) {
|
deleteHandle(id) {
|
||||||
this.$confirm('请确认是否删除?', '提示', {
|
this.$confirm('请确认是否删除?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@@ -335,7 +340,9 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl(`/book/medicaldes/delInherit?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) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '操作成功',
|
message: '操作成功',
|
||||||
@@ -353,7 +360,17 @@ export default {
|
|||||||
},
|
},
|
||||||
addOreEditCate() {
|
addOreEditCate() {
|
||||||
this.$refs["addFormRef"].validate(valid => {
|
this.$refs["addFormRef"].validate(valid => {
|
||||||
if(valid) {
|
if (valid) {
|
||||||
|
var imageslist = []
|
||||||
|
var arr = []
|
||||||
|
if (this.fileList.length > 0) {
|
||||||
|
arr = this.fileList.map(item => {
|
||||||
|
return item.url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
imageslist = arr.join(";");
|
||||||
|
|
||||||
|
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateInherit'),
|
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateInherit'),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@@ -361,12 +378,15 @@ export default {
|
|||||||
"id": this.editId, //新增不传
|
"id": this.editId, //新增不传
|
||||||
"name": this.addForm.name,
|
"name": this.addForm.name,
|
||||||
"url": this.addForm.url,
|
"url": this.addForm.url,
|
||||||
"img": this.addForm.productImages,
|
"img": imageslist,
|
||||||
"content": this.addForm.content,
|
"content": this.addForm.content,
|
||||||
"type": this.addForm.typeId,
|
"type": this.addForm.typeId,
|
||||||
"cityId": this.addForm.cityId
|
"cityId": this.addForm.cityId,
|
||||||
|
"sort": this.addForm.sort
|
||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
this.addOrUpdateVisible = false
|
this.addOrUpdateVisible = false
|
||||||
@@ -378,43 +398,39 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handlePictureCardPreview(file) {
|
|
||||||
this.addForm.productImages = file.url;
|
|
||||||
this.dialogVisible = true;
|
|
||||||
},
|
|
||||||
handlePicSuccess(res, file) {
|
handlePicSuccess(res, file) {
|
||||||
// console.log(res,'res')
|
// console.log(res,'res')
|
||||||
if (res.msg == "success") {
|
if (res.msg == "success") {
|
||||||
this.addForm.productImages = res.url;
|
|
||||||
this.fileList.push({
|
this.fileList.push({
|
||||||
name: file.name,
|
name: file.name,
|
||||||
url: res.url
|
url: res.url
|
||||||
})
|
})
|
||||||
console.log(this.dataForm.productImages,'productImages')
|
|
||||||
this.$message.success("上传成功");
|
this.$message.success("上传成功");
|
||||||
} else {
|
} else {
|
||||||
this.$message.error("上传失败");
|
this.$message.error("上传失败");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleRemove(file, fileList) {
|
handleRemove(file, fileList) {
|
||||||
this.addForm.productImages = '';
|
|
||||||
this.fileList = fileList
|
this.fileList = fileList
|
||||||
// this.addForm.noneBtnImg = fileList.length >= this.addForm.limitCountImg;
|
// this.addForm.noneBtnImg = fileList.length >= this.addForm.limitCountImg;
|
||||||
},
|
},
|
||||||
filterAA(val){
|
filterAA(val) {
|
||||||
var aa = this.typeList.filter(obj => obj.dictType == val)
|
var aa = this.typeList.filter(obj => obj.dictType == val)
|
||||||
return aa[0].dictValue
|
return aa[0].dictValue
|
||||||
// return aa
|
// return aa
|
||||||
},
|
},
|
||||||
translateaddr(code) {
|
translateaddr(code) {
|
||||||
for(var i = 0; i< this.provinceEntity.length; i++) {
|
for (var i = 0; i < this.provinceEntity.length; i++) {
|
||||||
for(var j = 0; j< this.provinceEntity[i].cityList.length; j++) {
|
for (var j = 0; j < this.provinceEntity[i].cityList.length; j++) {
|
||||||
if(this.provinceEntity[i].cityList[j].cityId == code) {
|
if (this.provinceEntity[i].cityList[j].cityId == code) {
|
||||||
return this.provinceEntity[i].cityList[j].cityName
|
return this.provinceEntity[i].cityList[j].cityName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -15,15 +15,8 @@
|
|||||||
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table
|
<el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%;">
|
||||||
:data="dataList"
|
<el-table-column header-align="center" align="center" label="分类">
|
||||||
border
|
|
||||||
v-loading="dataListLoading"
|
|
||||||
style="width: 100%;">
|
|
||||||
<el-table-column
|
|
||||||
header-align="center"
|
|
||||||
align="center"
|
|
||||||
label="分类">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ filterAA(scope.row.type) }}
|
{{ filterAA(scope.row.type) }}
|
||||||
</template>
|
</template>
|
||||||
@@ -37,33 +30,30 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="资源url" align="center">
|
<el-table-column label="资源url" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<a v-if="scope.row.type == 1 || scope.row.type == 2" :href="scope.row.url" target="_blank">{{ scope.row.url }}</a>
|
<a v-if="scope.row.type == 1 || scope.row.type == 2" :href="scope.row.url"
|
||||||
|
target="_blank">{{ scope.row.url }}</a>
|
||||||
<a v-if="scope.row.type == 3" :href="scope.row.url" target="_blank">{{ scope.row.url }}</a>
|
<a v-if="scope.row.type == 3" :href="scope.row.url" target="_blank">{{ scope.row.url }}</a>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column label="排序" align="center">
|
||||||
fixed="right"
|
<template slot-scope="scope">
|
||||||
header-align="center"
|
{{ scope.row.sort }}
|
||||||
align="center"
|
</template>
|
||||||
width="150"
|
</el-table-column>
|
||||||
label="操作">
|
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" size="small" @click="editOrUpdateHandle(scope.row)">修改</el-button>
|
<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>
|
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
|
||||||
@size-change="sizeChangeHandle"
|
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
|
||||||
@current-change="currentChangeHandle"
|
|
||||||
:current-page="pageIndex"
|
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
|
||||||
:page-size="pageSize"
|
|
||||||
:total="totalPage"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper">
|
layout="total, sizes, prev, pager, next, jumper">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
<!-- 弹窗, 新增 / 修改 -->
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
<el-dialog :visible.sync="addOrUpdateVisible" :append-to-body="true" :title="titlesub" width="50%" @close="cancleClose">
|
<el-dialog :visible.sync="addOrUpdateVisible" :close-on-click-modal="false" :append-to-body="true" :title="titlesub" width="50%"
|
||||||
|
@close="cancleClose">
|
||||||
<el-form :inline="true" :model="addForm" ref="addFormRef" :rules="addFormRule" class="dialog-wmzg">
|
<el-form :inline="true" :model="addForm" ref="addFormRef" :rules="addFormRule" class="dialog-wmzg">
|
||||||
<el-row type="flex" justify="center">
|
<el-row type="flex" justify="center">
|
||||||
<el-form-item label="分类" prop="type" label-width="100px">
|
<el-form-item label="分类" prop="type" label-width="100px">
|
||||||
@@ -85,10 +75,9 @@
|
|||||||
</el-row> -->
|
</el-row> -->
|
||||||
<el-row type="flex" justify="center">
|
<el-row type="flex" justify="center">
|
||||||
<el-form-item label="资源文件" label-width="100px">
|
<el-form-item label="资源文件" label-width="100px">
|
||||||
<el-upload :limit="1" class="el-uploadfeng "
|
<el-upload :limit="1" class="el-uploadfeng " ref="files" :action="baseUrl + '/oss/fileoss'"
|
||||||
ref="files"
|
:on-preview="handlePictureCardPreview" :file-list="fileList" :on-success="handlePicSuccess"
|
||||||
:action="baseUrl + '/oss/fileoss'" :on-preview="handlePictureCardPreview"
|
accept=".mp3,.mp4,.gif,.mpeg,.mpg" :on-remove="handleRemove">
|
||||||
:file-list="fileList" :on-success="handlePicSuccess" accept=".mp3,.mp4,.gif,.mpeg,.mpg" :on-remove="handleRemove">
|
|
||||||
<i class="el-icon-plus"></i>
|
<i class="el-icon-plus"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<!-- <el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
<!-- <el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||||
@@ -99,7 +88,13 @@
|
|||||||
</el-dialog> -->
|
</el-dialog> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</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>
|
</el-form>
|
||||||
|
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="cancleClose">取 消</el-button>
|
<el-button @click="cancleClose">取 消</el-button>
|
||||||
<el-button type="primary" @click="addOreEditCate">确 定</el-button>
|
<el-button type="primary" @click="addOreEditCate">确 定</el-button>
|
||||||
@@ -110,38 +105,43 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import global from '../../common/common.vue' //引入共用组间
|
import global from '../../common/common.vue' //引入共用组间
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
baseUrl: global.baseUrl,
|
baseUrl: global.baseUrl,
|
||||||
typeList: [
|
typeList: [{
|
||||||
{
|
dictValue: '吴门之歌',
|
||||||
dictValue:'吴门之歌',
|
|
||||||
dictType: '1',
|
dictType: '1',
|
||||||
},{
|
}, {
|
||||||
dictValue:'巴山夜雨',
|
dictValue: '巴山夜雨',
|
||||||
dictType: '2',
|
dictType: '2',
|
||||||
},{
|
}, {
|
||||||
dictValue:'吴门之徽',
|
dictValue: '吴门之徽',
|
||||||
dictType: '3',
|
dictType: '3',
|
||||||
}
|
}], //类型列表
|
||||||
], //类型列表
|
|
||||||
booknameList: [],
|
booknameList: [],
|
||||||
dataForm: {
|
dataForm: {
|
||||||
dictType: '',//分类
|
dictType: '', //分类
|
||||||
// ligthname: '',//书名
|
// ligthname: '',//书名
|
||||||
},
|
},
|
||||||
addForm: {
|
addForm: {
|
||||||
"id": '',//新增不传
|
"id": '', //新增不传
|
||||||
"name": '',
|
"name": '',
|
||||||
"type": '',
|
"type": '',
|
||||||
url:''
|
"url": '',
|
||||||
|
"sort": 0
|
||||||
},
|
},
|
||||||
editId: '',
|
editId: '',
|
||||||
addFormRule: {
|
addFormRule: {
|
||||||
typeId: [{required: true, message: "请选择分类" }],
|
typeId: [{
|
||||||
bookId: [{required: true, message: "请选择书名"}]
|
required: true,
|
||||||
|
message: "请选择分类"
|
||||||
|
}],
|
||||||
|
bookId: [{
|
||||||
|
required: true,
|
||||||
|
message: "请选择书名"
|
||||||
|
}]
|
||||||
},
|
},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
// publishStatus: false,
|
// publishStatus: false,
|
||||||
@@ -151,7 +151,7 @@ export default {
|
|||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
dataListSelections: [],
|
dataListSelections: [],
|
||||||
addOrUpdateVisible: false,
|
addOrUpdateVisible: false,
|
||||||
bookIds:[],
|
bookIds: [],
|
||||||
titlesub: '新增',
|
titlesub: '新增',
|
||||||
fileList: [],
|
fileList: [],
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,7 @@ export default {
|
|||||||
// AddOrUpdate,
|
// AddOrUpdate,
|
||||||
// chooseBook
|
// chooseBook
|
||||||
},
|
},
|
||||||
activated () {
|
activated() {
|
||||||
// this.gettypeList()
|
// this.gettypeList()
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
@@ -169,7 +169,7 @@ export default {
|
|||||||
this.dataForm.dictType = '';
|
this.dataForm.dictType = '';
|
||||||
},
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList () {
|
getDataList() {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/medicaldes/lightListByPage'),
|
url: this.$http.adornUrl('/book/medicaldes/lightListByPage'),
|
||||||
@@ -180,7 +180,9 @@ export default {
|
|||||||
"current": this.pageIndex,
|
"current": this.pageIndex,
|
||||||
"limit": this.pageSize
|
"limit": this.pageSize
|
||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.result.records
|
this.dataList = data.result.records
|
||||||
this.totalPage = data.result.total
|
this.totalPage = data.result.total
|
||||||
@@ -200,10 +202,12 @@ export default {
|
|||||||
'page': 1,
|
'page': 1,
|
||||||
'limit': 1000000,
|
'limit': 1000000,
|
||||||
'bookName': '',
|
'bookName': '',
|
||||||
'publisherName' : '',
|
'publisherName': '',
|
||||||
'authorName' : ''
|
'authorName': ''
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.booknameList = data.page.list
|
this.booknameList = data.page.list
|
||||||
} else {
|
} else {
|
||||||
@@ -212,38 +216,39 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
filterAA(val){
|
filterAA(val) {
|
||||||
if(val == 1) {
|
if (val == 1) {
|
||||||
return '吴门之歌'
|
return '吴门之歌'
|
||||||
} else if(val == 2) {
|
} else if (val == 2) {
|
||||||
return '巴山夜雨'
|
return '巴山夜雨'
|
||||||
} else {
|
} else {
|
||||||
return '吴门之徽'
|
return '吴门之徽'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 每页数
|
// 每页数
|
||||||
sizeChangeHandle (val) {
|
sizeChangeHandle(val) {
|
||||||
this.pageSize = val
|
this.pageSize = val
|
||||||
this.pageIndex = 1
|
this.pageIndex = 1
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
// 当前页
|
// 当前页
|
||||||
currentChangeHandle (val) {
|
currentChangeHandle(val) {
|
||||||
this.pageIndex = val
|
this.pageIndex = val
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
// 多选
|
// 多选
|
||||||
selectionChangeHandle (val) {
|
selectionChangeHandle(val) {
|
||||||
this.dataListSelections = val
|
this.dataListSelections = val
|
||||||
},
|
},
|
||||||
// 新增 / 修改
|
// 新增 / 修改
|
||||||
editOrUpdateHandle (row) {
|
editOrUpdateHandle(row) {
|
||||||
this.titlesub = '修改'
|
this.titlesub = '修改'
|
||||||
// this.getbookname()
|
// this.getbookname()
|
||||||
this.editId = row.id
|
this.editId = row.id
|
||||||
this.addForm.name = row.name
|
this.addForm.name = row.name
|
||||||
this.addForm.type = row.type.toString()
|
this.addForm.type = row.type.toString()
|
||||||
this.addForm.url = row.url
|
this.addForm.url = row.url
|
||||||
|
this.addForm.sort = row.sort
|
||||||
this.fileList = []
|
this.fileList = []
|
||||||
var img = {
|
var img = {
|
||||||
name: row.url,
|
name: row.url,
|
||||||
@@ -266,16 +271,17 @@ export default {
|
|||||||
this.addOrUpdateVisible = false
|
this.addOrUpdateVisible = false
|
||||||
this.$refs["addFormRef"].resetFields();
|
this.$refs["addFormRef"].resetFields();
|
||||||
this.addForm = {
|
this.addForm = {
|
||||||
"id": '',//新增不传
|
"id": '', //新增不传
|
||||||
"name": '',
|
"name": '',
|
||||||
"type": '',
|
"type": '',
|
||||||
"url": ''
|
"url": '',
|
||||||
|
"sort": 0
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fileList = []
|
this.fileList = []
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
deleteHandle (id) {
|
deleteHandle(id) {
|
||||||
this.$confirm('请确认是否删除?', '提示', {
|
this.$confirm('请确认是否删除?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@@ -284,7 +290,9 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl(`/book/medicaldes/delLight?id=${id}`),
|
url: this.$http.adornUrl(`/book/medicaldes/delLight?id=${id}`),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
}).then(({data}) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '操作成功',
|
message: '操作成功',
|
||||||
@@ -302,7 +310,7 @@ export default {
|
|||||||
},
|
},
|
||||||
addOreEditCate() {
|
addOreEditCate() {
|
||||||
this.$refs["addFormRef"].validate(valid => {
|
this.$refs["addFormRef"].validate(valid => {
|
||||||
if(valid) {
|
if (valid) {
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateLight'),
|
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateLight'),
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@@ -310,9 +318,12 @@ export default {
|
|||||||
"id": this.editId, //新增不传
|
"id": this.editId, //新增不传
|
||||||
"name": this.addForm.name,
|
"name": this.addForm.name,
|
||||||
"type": this.addForm.type,
|
"type": this.addForm.type,
|
||||||
"url": this.addForm.url
|
"url": this.addForm.url,
|
||||||
|
"sort": this.addForm.sort
|
||||||
})
|
})
|
||||||
}).then(({data}) => {
|
}).then(({
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
this.addOrUpdateVisible = false
|
this.addOrUpdateVisible = false
|
||||||
@@ -336,7 +347,7 @@ export default {
|
|||||||
name: file.name,
|
name: file.name,
|
||||||
url: res.url
|
url: res.url
|
||||||
})
|
})
|
||||||
console.log(this.dataForm.url,'url')
|
console.log(this.dataForm.url, 'url')
|
||||||
this.$message.success("上传成功");
|
this.$message.success("上传成功");
|
||||||
} else {
|
} else {
|
||||||
this.$message.error("上传失败");
|
this.$message.error("上传失败");
|
||||||
@@ -348,14 +359,13 @@ export default {
|
|||||||
// this.addForm.noneBtnImg = fileList.length >= this.addForm.limitCountImg;
|
// this.addForm.noneBtnImg = fileList.length >= this.addForm.limitCountImg;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.dialog-wmzg{
|
.dialog-wmzg {
|
||||||
.el-upload-list__item-name{
|
.el-upload-list__item-name {
|
||||||
max-width: 450px;
|
max-width: 450px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -176,7 +176,7 @@
|
|||||||
data
|
data
|
||||||
}) => {
|
}) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.booknameList = data.page.list
|
this.booknameList = data.page.result
|
||||||
} else {
|
} else {
|
||||||
this.booknameList = []
|
this.booknameList = []
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user