Commit b939976b by Lyan

培训计划

parent 55ff7b66
<template>
<el-dialog
title="修改年度培训计划"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px" >
<el-form-item label="分支机构名称:" prop="name">
<el-input v-model="dataForm.name" placeholder="请输入显示标题" disabled></el-input>
</el-form-item>
<el-form-item label="上传附件:" prop="file" class="pic">
<el-upload
class="avatar-uploaderFile"
action=""
:show-file-list="false"
:http-request="UploadFile"
:before-upload="beforeUploadFile">
<el-button size="small" type="primary">点击上传</el-button>
<span style="float:right;color:red;margin-left:100px;font-size:10px">*注意:上传附件为.xsl或.xlsx</span>
</el-upload>
<a :href="dataForm.docfile" target="_blank">{{dataForm.docfile}}</a>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" >
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import Ueditor from '../temps/ueditor'
export default {
components: {
Ueditor
},
data () {
return {
loading: false,
visible: false,
dataForm: {
id: 0,
name: '',
docfile: ''
},
fileUrl: new FormData(),
fileUrlStr: ''
}
},
created () {
},
mounted () {
},
methods: {
init (id, name) {
this.dataForm.id = id || 0
this.visible = true
this.dataForm.name = name
this.dataForm.docfile = ''
},
// 表单提交
dataFormSubmit () {
if (this.dataForm.docfile === '') {
this.$message.error('请上传附件!')
return false
}
this.loading = true
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/office/planbranch/batchUpdateStatus`),
method: 'post',
data: this.$http.adornData({
'ids': [this.dataForm.id],
'ppath': this.dataForm.docfile
})
}).then(({data}) => {
this.loading = false
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
},
clearInp () {
this.dataForm.docfile = ''
this.dialogVisible = false
},
beforeUploadFile (file) {
const isLt100M = file.size / 1024 / 1024 < 10
var index = file.name.lastIndexOf('.')
// 获取后缀
var ext = file.name.substr(index + 1).toLowerCase()
// 输出结果
var extarr = ['xlsx', 'xls']
if (extarr.indexOf(ext) === -1) {
this.$message.error('上传文件只能是xlsx/xls格式!')
return false
}
if (!isLt100M) {
this.$message.error('上传文件大小不能超过100MB哦!')
return false
}
if (file) {
var windowURL = window.URL || window.webkitURL
this.fileUrlStr = windowURL.createObjectURL(file)
this.dialogVisible = true
this.fileUrl.append('file', file)
}
},
UploadFile () {
this.$http({
url: this.$http.adornUrl('/office/file/uploadFile'),
method: 'post',
data: this.fileUrl,
headers: {
'Content-Type': 'multipart/form-data'
}
})
.then(res => {
console.log(res)
if (res.data.code === 500) {
this.$message.error(res.data.message)
} else {
this.dataForm.docfile = res.data.data
}
}).catch(err => {
console.log(err)
this.$message.error('上传失败')
})
}
}
}
</script>
<template>
<div class="mod-config mod-list-form">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()" label-width="120px">
<el-form-item label='分支机构名称' prop='name'>
<el-input v-model='dataForm.name' placeholder='请输入分支机构名称' clearable></el-input>
</el-form-item>
<el-form-item label='状态' prop='state'>
<el-select v-model="dataForm.state" placeholder="请选择状态" clearable>
<el-option
v-for="item in stateList"
:key="item.state"
:label="item.stateName"
:value="item.state">
</el-option>
</el-select>
</el-form-item>
<el-button class="seach-btn" @click="getDataList2()" type="primary">搜索</el-button>
</el-form>
<div class="add-btn">
<el-button type="primary" @click="allUpload('',-1)">批量上报</el-button>
<el-button type="primary" @click="allUpload('',0)">批量上传</el-button>
</div>
<div class="table-list">
<el-table
:data="dataList"
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
border
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
type="index"
header-align="center"
align="center"
width="50px"
label="序号">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="分支机构名称">
</el-table-column>
<el-table-column
prop="updatetime"
header-align="center"
align="center"
label="修改时间">
</el-table-column>
<el-table-column
prop="lasteditor"
header-align="center"
align="center"
label="最后编辑">
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name)">修改</el-button><br />
<el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button>
<el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button>
</template>
</el-table-column>
<el-table-column
prop="checkflag"
header-align="center"
align="center"
label="状态">
<!-- -1为“未上报”,0为“未上传”1为“已上传” -->
<template slot-scope="scope">
<p v-if="scope.row.checkflag===-1" type="text" size="small">未上报</p>
<p v-if="scope.row.checkflag===0" type="text" size="small">未上传</p>
<p v-if="scope.row.checkflag===1" type="text" size="small">已上传</p>
</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>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</div>
</template>
<script>
import AddOrUpdate from './annual-add-or-update'
export default {
components: {
AddOrUpdate
},
data () {
return {
addOrUpdateVisible: false,
dataForm: {
name: '',
state: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
stateList: [
{
state: -1,
stateName: '未上报'
},
{
state: 0,
stateName: '未上传'
},
{
state: 1,
stateName: '已上传'
}
]
}
},
activated () {
this.getDataList()
},
methods: {
getDataList2 () {
this.pageIndex = 1
this.getDataList()
},
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/office/planbranch/list'),
method: 'post',
data: this.$http.adornData({
'page': this.pageIndex + '',
'limit': this.pageSize + '',
'classnum': 0, // 0 年度 1 第一季度 2第二季度 3第三季度 4第四季度
'checkflag': this.dataForm.state == null ? '' : this.dataForm.state + '', // -1为“未上报”。 0为“未上传” 1为“已上传”
'name': this.dataForm.name
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.$message.error(data.msg)
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id, name) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, name)
})
},
checkHandle (data) {
},
// 修改状态
allUpload (id, checkflag) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
if (ids.length === 0) {
this.$message.error('请选择需要更改的分支机构')
return false
}
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? checkflag === -1 ? '未上报' : '未上传' : '批量' + checkflag === -1 ? '未上报' : '未上传'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/office/planbranch/batchUpdateStatus'),
method: 'post',
data: this.$http.adornData({
'ids': ids,
'checkflag': checkflag + ''
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>
<template>
<div class="mod-config mod-list-form">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()" label-width="120px">
<el-form-item label='分支机构名称' prop='name'>
<el-input v-model='dataForm.name' placeholder='请输入分支机构名称' clearable></el-input>
</el-form-item>
<el-form-item label='状态' prop='state'>
<el-select v-model="dataForm.state" placeholder="请选择状态" clearable>
<el-option
v-for="item in stateList"
:key="item.state"
:label="item.stateName"
:value="item.state">
</el-option>
</el-select>
</el-form-item>
<el-button class="seach-btn" @click="getDataList2()" type="primary">搜索</el-button>
</el-form>
<div class="add-btn">
<el-button type="primary" @click="allUpload('',-1)">批量上报</el-button>
<el-button type="primary" @click="allUpload('',0)">批量上传</el-button>
</div>
<div class="table-list">
<el-table
:data="dataList"
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
border
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
type="index"
header-align="center"
align="center"
width="50px"
label="序号">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="分支机构名称">
</el-table-column>
<el-table-column
prop="updatetime"
header-align="center"
align="center"
label="修改时间">
</el-table-column>
<el-table-column
prop="lasteditor"
header-align="center"
align="center"
label="最后编辑">
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name)">修改</el-button><br />
<el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button>
<el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button>
</template>
</el-table-column>
<el-table-column
prop="checkflag"
header-align="center"
align="center"
label="状态">
<!-- -1为“未上报”,0为“未上传”1为“已上传” -->
<template slot-scope="scope">
<p v-if="scope.row.checkflag===-1" type="text" size="small">未上报</p>
<p v-if="scope.row.checkflag===0" type="text" size="small">未上传</p>
<p v-if="scope.row.checkflag===1" type="text" size="small">已上传</p>
</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>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</div>
</template>
<script>
import AddOrUpdate from './annual-add-or-update'
export default {
components: {
AddOrUpdate
},
data () {
return {
addOrUpdateVisible: false,
dataForm: {
name: '',
state: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
stateList: [
{
state: -1,
stateName: '未上报'
},
{
state: 0,
stateName: '未上传'
},
{
state: 1,
stateName: '已上传'
}
]
}
},
activated () {
this.getDataList()
},
methods: {
getDataList2 () {
this.pageIndex = 1
this.getDataList()
},
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/office/planbranch/list'),
method: 'post',
data: this.$http.adornData({
'page': this.pageIndex + '',
'limit': this.pageSize + '',
'classnum': 1, // 0 年度 1 第一季度 2第二季度 3第三季度 4第四季度
'checkflag': this.dataForm.state == null ? '' : this.dataForm.state + '', // -1为“未上报”。 0为“未上传” 1为“已上传”
'name': this.dataForm.name
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.$message.error(data.msg)
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id, name) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, name)
})
},
checkHandle (data) {
},
// 修改状态
allUpload (id, checkflag) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
if (ids.length === 0) {
this.$message.error('请选择需要更改的分支机构')
return false
}
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? checkflag === -1 ? '未上报' : '未上传' : '批量' + checkflag === -1 ? '未上报' : '未上传'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/office/planbranch/batchUpdateStatus'),
method: 'post',
data: this.$http.adornData({
'ids': ids,
'checkflag': checkflag + ''
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>
<template>
<div class="mod-config mod-list-form">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()" label-width="120px">
<el-form-item label='分支机构名称' prop='name'>
<el-input v-model='dataForm.name' placeholder='请输入分支机构名称' clearable></el-input>
</el-form-item>
<el-form-item label='状态' prop='state'>
<el-select v-model="dataForm.state" placeholder="请选择状态" clearable>
<el-option
v-for="item in stateList"
:key="item.state"
:label="item.stateName"
:value="item.state">
</el-option>
</el-select>
</el-form-item>
<el-button class="seach-btn" @click="getDataList2()" type="primary">搜索</el-button>
</el-form>
<div class="add-btn">
<el-button type="primary" @click="allUpload('',-1)">批量上报</el-button>
<el-button type="primary" @click="allUpload('',0)">批量上传</el-button>
</div>
<div class="table-list">
<el-table
:data="dataList"
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
border
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
type="index"
header-align="center"
align="center"
width="50px"
label="序号">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="分支机构名称">
</el-table-column>
<el-table-column
prop="updatetime"
header-align="center"
align="center"
label="修改时间">
</el-table-column>
<el-table-column
prop="lasteditor"
header-align="center"
align="center"
label="最后编辑">
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name)">修改</el-button><br />
<el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button>
<el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button>
</template>
</el-table-column>
<el-table-column
prop="checkflag"
header-align="center"
align="center"
label="状态">
<!-- -1为“未上报”,0为“未上传”1为“已上传” -->
<template slot-scope="scope">
<p v-if="scope.row.checkflag===-1" type="text" size="small">未上报</p>
<p v-if="scope.row.checkflag===0" type="text" size="small">未上传</p>
<p v-if="scope.row.checkflag===1" type="text" size="small">已上传</p>
</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>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</div>
</template>
<script>
import AddOrUpdate from './annual-add-or-update'
export default {
components: {
AddOrUpdate
},
data () {
return {
addOrUpdateVisible: false,
dataForm: {
name: '',
state: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
stateList: [
{
state: -1,
stateName: '未上报'
},
{
state: 0,
stateName: '未上传'
},
{
state: 1,
stateName: '已上传'
}
]
}
},
activated () {
this.getDataList()
},
methods: {
getDataList2 () {
this.pageIndex = 1
this.getDataList()
},
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/office/planbranch/list'),
method: 'post',
data: this.$http.adornData({
'page': this.pageIndex + '',
'limit': this.pageSize + '',
'classnum': 4, // 0 年度 1 第一季度 2第二季度 3第三季度 4第四季度
'checkflag': this.dataForm.state == null ? '' : this.dataForm.state + '', // -1为“未上报”。 0为“未上传” 1为“已上传”
'name': this.dataForm.name
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.$message.error(data.msg)
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id, name) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, name)
})
},
checkHandle (data) {
},
// 修改状态
allUpload (id, checkflag) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
if (ids.length === 0) {
this.$message.error('请选择需要更改的分支机构')
return false
}
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? checkflag === -1 ? '未上报' : '未上传' : '批量' + checkflag === -1 ? '未上报' : '未上传'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/office/planbranch/batchUpdateStatus'),
method: 'post',
data: this.$http.adornData({
'ids': ids,
'checkflag': checkflag + ''
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>
<template>
<div class="mod-config mod-list-form">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()" label-width="120px">
<el-form-item label='分支机构名称' prop='name'>
<el-input v-model='dataForm.name' placeholder='请输入分支机构名称' clearable></el-input>
</el-form-item>
<el-form-item label='状态' prop='state'>
<el-select v-model="dataForm.state" placeholder="请选择状态" clearable>
<el-option
v-for="item in stateList"
:key="item.state"
:label="item.stateName"
:value="item.state">
</el-option>
</el-select>
</el-form-item>
<el-button class="seach-btn" @click="getDataList2()" type="primary">搜索</el-button>
</el-form>
<div class="add-btn">
<el-button type="primary" @click="allUpload('',-1)">批量上报</el-button>
<el-button type="primary" @click="allUpload('',0)">批量上传</el-button>
</div>
<div class="table-list">
<el-table
:data="dataList"
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
border
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
type="index"
header-align="center"
align="center"
width="50px"
label="序号">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="分支机构名称">
</el-table-column>
<el-table-column
prop="updatetime"
header-align="center"
align="center"
label="修改时间">
</el-table-column>
<el-table-column
prop="lasteditor"
header-align="center"
align="center"
label="最后编辑">
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name)">修改</el-button><br />
<el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button>
<el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button>
</template>
</el-table-column>
<el-table-column
prop="checkflag"
header-align="center"
align="center"
label="状态">
<!-- -1为“未上报”,0为“未上传”1为“已上传” -->
<template slot-scope="scope">
<p v-if="scope.row.checkflag===-1" type="text" size="small">未上报</p>
<p v-if="scope.row.checkflag===0" type="text" size="small">未上传</p>
<p v-if="scope.row.checkflag===1" type="text" size="small">已上传</p>
</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>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</div>
</template>
<script>
import AddOrUpdate from './annual-add-or-update'
export default {
components: {
AddOrUpdate
},
data () {
return {
addOrUpdateVisible: false,
dataForm: {
name: '',
state: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
stateList: [
{
state: -1,
stateName: '未上报'
},
{
state: 0,
stateName: '未上传'
},
{
state: 1,
stateName: '已上传'
}
]
}
},
activated () {
this.getDataList()
},
methods: {
getDataList2 () {
this.pageIndex = 1
this.getDataList()
},
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/office/planbranch/list'),
method: 'post',
data: this.$http.adornData({
'page': this.pageIndex + '',
'limit': this.pageSize + '',
'classnum': 2, // 0 年度 1 第一季度 2第二季度 3第三季度 4第四季度
'checkflag': this.dataForm.state == null ? '' : this.dataForm.state + '', // -1为“未上报”。 0为“未上传” 1为“已上传”
'name': this.dataForm.name
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.$message.error(data.msg)
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id, name) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, name)
})
},
checkHandle (data) {
},
// 修改状态
allUpload (id, checkflag) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
if (ids.length === 0) {
this.$message.error('请选择需要更改的分支机构')
return false
}
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? checkflag === -1 ? '未上报' : '未上传' : '批量' + checkflag === -1 ? '未上报' : '未上传'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/office/planbranch/batchUpdateStatus'),
method: 'post',
data: this.$http.adornData({
'ids': ids,
'checkflag': checkflag + ''
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>
<template>
<div class="mod-config mod-list-form">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()" label-width="120px">
<el-form-item label='分支机构名称' prop='name'>
<el-input v-model='dataForm.name' placeholder='请输入分支机构名称' clearable></el-input>
</el-form-item>
<el-form-item label='状态' prop='state'>
<el-select v-model="dataForm.state" placeholder="请选择状态" clearable>
<el-option
v-for="item in stateList"
:key="item.state"
:label="item.stateName"
:value="item.state">
</el-option>
</el-select>
</el-form-item>
<el-button class="seach-btn" @click="getDataList2()" type="primary">搜索</el-button>
</el-form>
<div class="add-btn">
<el-button type="primary" @click="allUpload('',-1)">批量上报</el-button>
<el-button type="primary" @click="allUpload('',0)">批量上传</el-button>
</div>
<div class="table-list">
<el-table
:data="dataList"
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
border
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
type="index"
header-align="center"
align="center"
width="50px"
label="序号">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="分支机构名称">
</el-table-column>
<el-table-column
prop="updatetime"
header-align="center"
align="center"
label="修改时间">
</el-table-column>
<el-table-column
prop="lasteditor"
header-align="center"
align="center"
label="最后编辑">
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,scope.row.name)">修改</el-button><br />
<el-button type="text" size="small" @click="allUpload(scope.row.id,-1)">[未上报]</el-button>
<el-button type="text" size="small" @click="allUpload(scope.row.id,0)">[未上传]</el-button>
</template>
</el-table-column>
<el-table-column
prop="checkflag"
header-align="center"
align="center"
label="状态">
<!-- -1为“未上报”,0为“未上传”1为“已上传” -->
<template slot-scope="scope">
<p v-if="scope.row.checkflag===-1" type="text" size="small">未上报</p>
<p v-if="scope.row.checkflag===0" type="text" size="small">未上传</p>
<p v-if="scope.row.checkflag===1" type="text" size="small">已上传</p>
</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>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</div>
</template>
<script>
import AddOrUpdate from './annual-add-or-update'
export default {
components: {
AddOrUpdate
},
data () {
return {
addOrUpdateVisible: false,
dataForm: {
name: '',
state: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
stateList: [
{
state: -1,
stateName: '未上报'
},
{
state: 0,
stateName: '未上传'
},
{
state: 1,
stateName: '已上传'
}
]
}
},
activated () {
this.getDataList()
},
methods: {
getDataList2 () {
this.pageIndex = 1
this.getDataList()
},
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/office/planbranch/list'),
method: 'post',
data: this.$http.adornData({
'page': this.pageIndex + '',
'limit': this.pageSize + '',
'classnum': 3, // 0 年度 1 第一季度 2第二季度 3第三季度 4第四季度
'checkflag': this.dataForm.state == null ? '' : this.dataForm.state + '', // -1为“未上报”。 0为“未上传” 1为“已上传”
'name': this.dataForm.name
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.$message.error(data.msg)
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id, name) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, name)
})
},
checkHandle (data) {
},
// 修改状态
allUpload (id, checkflag) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
if (ids.length === 0) {
this.$message.error('请选择需要更改的分支机构')
return false
}
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? checkflag === -1 ? '未上报' : '未上传' : '批量' + checkflag === -1 ? '未上报' : '未上传'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/office/planbranch/batchUpdateStatus'),
method: 'post',
data: this.$http.adornData({
'ids': ids,
'checkflag': checkflag + ''
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>
...@@ -132,12 +132,12 @@ ...@@ -132,12 +132,12 @@
</template> </template>
<script> <script>
import AddOrUpdate from "./glossary-add-or-update"; import AddOrUpdate from './glossary-add-or-update'
export default { export default {
data() { data () {
return { return {
dataForm: { dataForm: {
key: "", key: '',
titleCn: '中文标题' titleCn: '中文标题'
}, },
titleList: [ titleList: [
...@@ -156,97 +156,97 @@ export default { ...@@ -156,97 +156,97 @@ export default {
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false, addOrUpdateVisible: false
}; }
}, },
components: { components: {
AddOrUpdate, AddOrUpdate
}, },
activated() { activated () {
this.getDataList(); this.getDataList()
}, },
methods: { methods: {
// 获取数据列表 // 获取数据列表
getDataList() { getDataList () {
this.dataListLoading = true; this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl("/office/glossary/list"), url: this.$http.adornUrl('/office/glossary/list'),
method: "get", method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
page: this.pageIndex, page: this.pageIndex,
limit: this.pageSize, limit: this.pageSize,
titleCn: this.dataForm.titleCn, titleCn: this.dataForm.titleCn,
keyword: this.dataForm.key, keyword: this.dataForm.key
}), })
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.records; this.dataList = data.page.records
this.totalPage = data.page.total; this.totalPage = data.page.total
} else { } else {
this.dataList = []; this.dataList = []
this.totalPage = 0; this.totalPage = 0
} }
this.dataListLoading = false; this.dataListLoading = false
}); })
}, },
// 每页数 // 每页数
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
}, },
// 新增 / 修改 // 新增 / 修改
addOrUpdateHandle(id) { addOrUpdateHandle (id) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id); this.$refs.addOrUpdate.init(id)
}); })
}, },
// 删除 // 删除
deleteHandle(id) { deleteHandle (id) {
var ids = id var ids = id
? [id] ? [id]
: this.dataListSelections.map((item) => { : this.dataListSelections.map((item) => {
return item.id; return item.id
}); })
this.$confirm( this.$confirm(
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`, `确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`,
"提示", '提示',
{ {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning'
} }
).then(() => { ).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl("/office/glossary/delete"), url: this.$http.adornUrl('/office/glossary/delete'),
method: "post", method: 'post',
data: this.$http.adornData(ids, false), data: this.$http.adornData(ids, false)
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: "操作成功", message: '操作成功',
type: "success", type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList(); this.getDataList()
}, }
}); })
} else { } else {
this.$message.error(data.msg); this.$message.error(data.msg)
} }
}); })
}); })
}, }
}, }
}; }
</script> </script>
...@@ -76,12 +76,12 @@ ...@@ -76,12 +76,12 @@
</template> </template>
<script> <script>
import AddOrUpdate from "./pcategory-add-or-update"; import AddOrUpdate from './pcategory-add-or-update'
export default { export default {
data() { data () {
return { return {
dataForm: { dataForm: {
key: "", key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
...@@ -89,96 +89,96 @@ export default { ...@@ -89,96 +89,96 @@ export default {
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false, addOrUpdateVisible: false
}; }
}, },
components: { components: {
AddOrUpdate, AddOrUpdate
}, },
activated() { activated () {
this.getDataList(); this.getDataList()
}, },
methods: { methods: {
// 获取数据列表 // 获取数据列表
getDataList() { getDataList () {
this.dataListLoading = true; this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl("/office/pcategory/list"), url: this.$http.adornUrl('/office/pcategory/list'),
method: "get", method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
page: this.pageIndex, page: this.pageIndex,
limit: this.pageSize, limit: this.pageSize,
key: this.dataForm.key, key: this.dataForm.key
}), })
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list; this.dataList = data.page.list
this.totalPage = data.page.totalCount; this.totalPage = data.page.totalCount
} else { } else {
this.dataList = []; this.dataList = []
this.totalPage = 0; this.totalPage = 0
} }
this.dataListLoading = false; this.dataListLoading = false
}); })
}, },
// 每页数 // 每页数
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
}, },
// 新增 / 修改 // 新增 / 修改
addOrUpdateHandle(id) { addOrUpdateHandle (id) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id); this.$refs.addOrUpdate.init(id)
}); })
}, },
// 删除 // 删除
deleteHandle(id) { deleteHandle (id) {
var ids = id var ids = id
? [id] ? [id]
: this.dataListSelections.map((item) => { : this.dataListSelections.map((item) => {
return item.categoryid; return item.categoryid
}); })
this.$confirm( this.$confirm(
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`, `确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`,
"提示", '提示',
{ {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning'
} }
).then(() => { ).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl("/office/pcategory/delete"), url: this.$http.adornUrl('/office/pcategory/delete'),
method: "post", method: 'post',
data: this.$http.adornData(ids, false), data: this.$http.adornData(ids, false)
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: "操作成功", message: '操作成功',
type: "success", type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList(); this.getDataList()
}, }
}); })
} else { } else {
this.$message.error(data.msg); this.$message.error(data.msg)
} }
}); })
}); })
}, }
}, }
}; }
</script> </script>
...@@ -157,13 +157,13 @@ ...@@ -157,13 +157,13 @@
</template> </template>
<script> <script>
import AddOrUpdate from "./product-add-or-update"; import AddOrUpdate from './product-add-or-update'
export default { export default {
data() { data () {
return { return {
dataForm: { dataForm: {
key: "", key: '',
categoryid: "", categoryid: ''
}, },
categoryIdList: [], categoryIdList: [],
dataList: [], dataList: [],
...@@ -172,165 +172,165 @@ export default { ...@@ -172,165 +172,165 @@ export default {
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false, addOrUpdateVisible: false
}; }
}, },
components: { components: {
AddOrUpdate, AddOrUpdate
}, },
filters: { filters: {
statusFilter(val) { statusFilter (val) {
let newVal; // let newVal
switch (val) { switch (val) {
case 0: case 0:
return "等待"; return '等待'
break; break
case 1: case 1:
return "成功"; return '成功'
break; break
default: default:
return "失败"; return '失败'
break; break
} }
}, }
}, },
activated() { activated () {
this.getCategoryList(); this.getCategoryList()
this.getDataList(); this.getDataList()
}, },
methods: { methods: {
// 获取商品分类列表 // 获取商品分类列表
getCategoryList() { getCategoryList () {
this.$http({ this.$http({
url: this.$http.adornUrl("/office/pcategory/getCategoryList"), url: this.$http.adornUrl('/office/pcategory/getCategoryList'),
method: "get", method: 'get'
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.categoryIdList = data.list; this.categoryIdList = data.list
} else { } else {
this.categoryIdList = []; this.categoryIdList = []
} }
}); })
}, },
// 获取数据列表 // 获取数据列表
getDataList() { getDataList () {
this.dataListLoading = true; this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl("/office/product/list"), url: this.$http.adornUrl('/office/product/list'),
method: "get", method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
page: this.pageIndex, page: this.pageIndex,
limit: this.pageSize, limit: this.pageSize,
keyword: this.dataForm.key, keyword: this.dataForm.key,
categoryid: this.dataForm.categoryid, categoryid: this.dataForm.categoryid
}), })
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list; this.dataList = data.page.list
this.totalPage = data.page.totalCount; this.totalPage = data.page.totalCount
} else { } else {
this.dataList = []; this.dataList = []
this.totalPage = 0; this.totalPage = 0
} }
this.dataListLoading = false; this.dataListLoading = false
}); })
}, },
// 每页数 // 每页数
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
}, },
// 新增 / 修改 // 新增 / 修改
addOrUpdateHandle(id) { addOrUpdateHandle (id) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id); this.$refs.addOrUpdate.init(id)
}); })
}, },
// 删除 // 删除
deleteHandle(id) { deleteHandle (id) {
var ids = id var ids = id
? [id] ? [id]
: this.dataListSelections.map((item) => { : this.dataListSelections.map((item) => {
return item.id; return item.id
}); })
this.$confirm( this.$confirm(
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`, `确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`,
"提示", '提示',
{ {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning'
} }
).then(() => { ).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl("/office/product/delete"), url: this.$http.adornUrl('/office/product/delete'),
method: "post", method: 'post',
data: this.$http.adornData(ids, false), data: this.$http.adornData(ids, false)
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: "操作成功", message: '操作成功',
type: "success", type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList(); this.getDataList()
}, }
}); })
} else { } else {
this.$message.error(data.msg); this.$message.error(data.msg)
} }
}); })
}); })
}, },
// 审核 // 审核
checkHandle(id, status) { checkHandle (id, status) {
let str = ""; let str = ''
if (status === 1) { if (status === 1) {
str = "成功"; str = '成功'
} else { } else {
str = "失败"; str = '失败'
} }
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, "提示", { this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning'
}) })
.then(() => { .then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl("/office/product/verifyProduct"), url: this.$http.adornUrl('/office/product/verifyProduct'),
method: "post", method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
id: id, id: id,
status: status, status: status
}), })
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: "操作成功", message: '操作成功',
type: "success", type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList(); this.getDataList()
}, }
}); })
} else { } else {
this.$message.error(data.msg); this.$message.error(data.msg)
} }
}); })
}) })
.catch(() => {}); .catch(() => {})
}, }
}, }
}; }
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment