Commit ed66af1f authored by jiaorz's avatar jiaorz

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform-ui into base-modify

parents c3392610 37817dfe
module.exports = { module.exports = {
NODE_ENV: '"development"', NODE_ENV: '"development"',
BASE_API:'"https://xxtest.upyuns.com"',//'"https://dev.dfangche.com"',//'"https://xxfcmgmt.upyuns.com"(正)',//http://10.1.37.192:9527(何), //https://xxtest.upyuns.com(测),10.1.37.246:9527(韩), 10.1.37.244(李斌)10.1.37.248:8765(小威) BASE_API:'"https://xxtest.upyuns.com"',//'"https://xxtest.upyuns.com"',//'"https://dev.dfangche.com"',//'"https://xxfcmgmt.upyuns.com"(正)',//http://10.1.37.192:9527(何), //https://xxtest.upyuns.com(测),10.1.37.246:9527(韩), 10.1.37.244(李斌)10.1.37.248:8765(小威)
APP_ORIGIN: '"https://wallstreetcn.com"' APP_ORIGIN: '"https://wallstreetcn.com"'
} }
...@@ -99,15 +99,32 @@ export function postions(obj) { ...@@ -99,15 +99,32 @@ export function postions(obj) {
}); });
} }
// 身份列表
export function jobs(obj) {
return fetch({
url: '/api/admin/postion/admin/jobs',
method: 'get',
data: obj
});
}
// 添加员工 // 添加员工
export function addEditor(obj) { export function addEditor(obj) {
return fetch({ return fetch({
url: '/api/admin/postion/admin/add', url: '/api/admin/postion/admin/addUserPostion',
method: 'post', method: 'post',
data: obj data: obj
}); });
} }
// 编辑员工
export function editorUpd(obj) {
return fetch({
url: '/api/admin/postion/admin/updUserPostion',
method: 'post',
data: obj
});
}
//删除员工 //删除员工
export function deleteStaffs(id) { export function deleteStaffs(id) {
return fetch({ return fetch({
......
...@@ -39,3 +39,10 @@ export function activityIds() { ...@@ -39,3 +39,10 @@ export function activityIds() {
method: 'get' method: 'get'
}) })
} }
export function remove(id) {
return fetch({
url: '/api/summit/activity/remove/' + id,
method: 'delete'
})
}
\ No newline at end of file
...@@ -398,8 +398,9 @@ ...@@ -398,8 +398,9 @@
<span class="label-text">拍照取证*:</span> <span class="label-text">拍照取证*:</span>
<br /> <br />
<img <img
v-for="item in otherImg" v-for="(item,index) in otherImg"
:src="item" :src="item"
:key="index"
style="width: 100px; height: 100px;margin-left:110px;" style="width: 100px; height: 100px;margin-left:110px;"
/> />
<!-- <img src="../../../../dist/static/img/success.8304acb.png" style="width: 100px; height: 100px;margin-left:110px;"/> <!-- <img src="../../../../dist/static/img/success.8304acb.png" style="width: 100px; height: 100px;margin-left:110px;"/>
......
...@@ -17,12 +17,7 @@ ...@@ -17,12 +17,7 @@
</el-form-item> </el-form-item>
<el-form-item label="峰会状态"> <el-form-item label="峰会状态">
<el-select class="filter-item" v-model="query.status" placeholder="状态"> <el-select class="filter-item" v-model="query.status" placeholder="状态">
<el-option <el-option v-for="(val,index) in status" :key="index" :label="val.name" :value="val.id"></el-option>
v-for="(val,index) in status"
:key="index"
:label="val.name"
:value="val.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-row> </el-row>
...@@ -84,7 +79,7 @@ ...@@ -84,7 +79,7 @@
size="small" size="small"
class="el-button el-button--text el-button--small" class="el-button el-button--text el-button--small"
@click="applyPage(scope.row)" @click="applyPage(scope.row)"
>报名页面</el-button> --> >报名页面</el-button>-->
<el-button <el-button
class="el-button el-button--text el-button--small" class="el-button el-button--text el-button--small"
size="small" size="small"
...@@ -128,44 +123,40 @@ ...@@ -128,44 +123,40 @@
:enrollRow="enrollRow" :enrollRow="enrollRow"
v-on:enrollDialogEvent="enrollDialogEvent" v-on:enrollDialogEvent="enrollDialogEvent"
/> />
<reviewPopup <reviewPopup v-if="reviewShow" :reviewRow="reviewRow" v-on:reviewDialogEvent="reviewDialogEvent" />
v-if="reviewShow"
:reviewRow="reviewRow"
v-on:reviewDialogEvent="reviewDialogEvent"
/>
<!-- <applyPage :applyInfo='applyInfo'></applyPage> --> <!-- <applyPage :applyInfo='applyInfo'></applyPage> -->
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from "vuex"; import { mapGetters } from 'vuex'
import { timestamp2Date } from "src/utils/dateUtils"; import { timestamp2Date } from 'src/utils/dateUtils'
import { page, update } from "src/api/summit/activity"; import { page, update, remove } from 'src/api/summit/activity'
import summitPopup from "src/views/summit/model/summitPopup"; import summitPopup from 'src/views/summit/model/summitPopup'
import enrollDataPopup from "src/views/summit/model/enrollDataPopup"; import enrollDataPopup from 'src/views/summit/model/enrollDataPopup'
import reviewPopup from "src/views/summit/model/reviewPopup"; import reviewPopup from 'src/views/summit/model/reviewPopup'
// import applyPage from "src/views/summit/model/applyPage"; // import applyPage from "src/views/summit/model/applyPage";
import { getToken } from "src/utils/auth"; import { getToken } from 'src/utils/auth'
export default { export default {
name: "summitList", name: 'summitList',
components: { components: {
summitPopup, summitPopup,
enrollDataPopup, enrollDataPopup,
reviewPopup, reviewPopup
// applyPage // applyPage
}, },
data() { data() {
return { return {
applyInfo:{ applyInfo: {
dialogVisible:false, dialogVisible: false
}, },
query: { query: {
page: 1, page: 1,
limit: 10, limit: 10,
title: "", title: '',
startTime: "", startTime: '',
status: undefined, status: undefined,
type: 1 type: 1
}, },
...@@ -173,15 +164,15 @@ export default { ...@@ -173,15 +164,15 @@ export default {
list: [], list: [],
listLoading: true, listLoading: true,
status: [ status: [
{ id: 0, name: "全部" }, { id: 0, name: '全部' },
{ id: 1, name: "报名中" }, { id: 1, name: '报名中' },
{ id: 2, name: "进行中" }, { id: 2, name: '进行中' },
{ id: 3, name: "已结束" } { id: 3, name: '已结束' }
], ],
total: 0, total: 0,
inline: true, inline: true,
popupShow: false, popupShow: false,
titleNme: "创建峰会", titleNme: '创建峰会',
popupRow: undefined, popupRow: undefined,
enrollRow: undefined, enrollRow: undefined,
enrollShow: false, enrollShow: false,
...@@ -189,21 +180,21 @@ export default { ...@@ -189,21 +180,21 @@ export default {
reviewShow: false, reviewShow: false,
statusNameList: { statusNameList: {
1: "默认", 1: '默认',
2: "报名中", 2: '报名中',
3: "进行中", 3: '进行中',
4: "已结束" 4: '已结束'
}
} }
};
}, },
created() { created() {
this.getList(); this.getList()
}, },
computed: { computed: {
...mapGetters(["elements"]), ...mapGetters(['elements']),
getHeaderWithToken() { getHeaderWithToken() {
return { Authorization: getToken() }; return { Authorization: getToken() }
} }
}, },
methods: { methods: {
...@@ -212,86 +203,106 @@ export default { ...@@ -212,86 +203,106 @@ export default {
// this.applyInfo.dialogVisible = true; // this.applyInfo.dialogVisible = true;
// }, // },
getList() { getList() {
this.listLoading = true; this.listLoading = true
page(this.query).then(res => { page(this.query).then(res => {
this.list = res.data.list; this.list = res.data.list
this.total = res.data.total; this.total = res.data.total
}); })
setTimeout(() => { setTimeout(() => {
this.listLoading = false; this.listLoading = false
}, 500); }, 500)
}, },
changeTime(val) { changeTime(val) {
!!val !!val
? (this.query.startTime = Date.now(val)) ? (this.query.startTime = Date.now(val))
: this.query.startTime == ""; : this.query.startTime == ''
}, },
handleFilter() { handleFilter() {
this.getList(); this.getList()
}, },
viewDetails(row) { viewDetails(row) {
update(row).then(res => { update(row).then(res => {
if (res.rel) { if (res.rel) {
this.$notify.success({ this.$notify.success({
title: "编辑成功", title: '编辑成功',
message: `success` message: `success`
}); })
this.getList(); this.getList()
} else { } else {
this.$notify.warning({ this.$notify.warning({
title: "编辑失败", title: '编辑失败',
message: `failed` message: `failed`
}); })
} }
}); })
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.query.limit = val; this.query.limit = val
this.getList(); this.getList()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.query.page = val; this.query.page = val
this.getList(); this.getList()
}, },
timestamp2Date(timeStamp) { timestamp2Date(timeStamp) {
return timestamp2Date(timeStamp); return timestamp2Date(timeStamp)
}, },
enrollData(row) { enrollData(row) {
this.enrollRow = row; this.enrollRow = row
this.enrollShow = true; this.enrollShow = true
}, },
edit(row) { edit(row) {
// debugger; // debugger;
this.popupRow = row; this.popupRow = row
this.titleNme = "编辑峰会"; this.titleNme = '编辑峰会'
this.popupShow = true; this.popupShow = true
}, },
createSummit() { createSummit() {
this.popupRow = {}; this.popupRow = {}
this.titleNme = "创建峰会"; this.titleNme = '创建峰会'
this.popupShow = true; this.popupShow = true
}, },
review(row) { review(row) {
this.reviewRow = row; this.reviewRow = row
this.reviewShow = true; this.reviewShow = true
console.log(this.reviewRow); },
deleteSummit(row) {
this.$confirm('此操作将删除该峰会, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
remove(row.id).then(data => {
if (data.status == 200) {
this.getList()
this.$message({
type: 'success',
message: '删除成功!'
})
} else {
this.$message({
type: 'error',
message: data.message
})
}
})
})
}, },
deleteSummit() {},
getStatusName(status) { getStatusName(status) {
return status + 1 ? this.statusNameList[status + 1] : ""; return status + 1 ? this.statusNameList[status + 1] : ''
}, },
summitDialogEvent(e) { summitDialogEvent(e) {
this.popupShow = false; this.popupShow = false
if (e) { if (e) {
this.getList(); this.getList()
} }
}, },
enrollDialogEvent(e) { enrollDialogEvent(e) {
this.enrollShow = false; this.enrollShow = false
}, },
reviewDialogEvent(e) { reviewDialogEvent(e) {
this.reviewShow = false; this.reviewShow = false
} }
} }
}; }
</script> </script>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
list-type="picture-card" list-type="picture-card"
:file-list="list" :file-list="list"
:on-success="handlePictureCardPreview" :on-success="handlePictureCardPreview"
:on-remove="handleRemove" :on-remove="handleRemoveZip"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
> >
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
...@@ -64,11 +64,11 @@ ...@@ -64,11 +64,11 @@
> >
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
</el-upload> </el-upload>
<video <!-- <video
v-if="$utils.isString(form.videoPath) && !$utils.isEmpty(form.videoPath) && !imgFlag" v-if="$utils.isString(form.videoPath) && !$utils.isEmpty(form.videoPath) && !imgFlag"
:src="form.videoPath" :src="form.videoPath"
style="width:300px;max-height:300px;" style="width:300px;max-height:300px;"
/> />-->
<!-- <i <!-- <i
v-else-if="!imgFlag" v-else-if="!imgFlag"
class="el-icon-plus avatar-uploader-icon" class="el-icon-plus avatar-uploader-icon"
...@@ -78,8 +78,8 @@ ...@@ -78,8 +78,8 @@
</el-col> </el-col>
<el-col> <el-col>
<el-form-item> <el-form-item>
<el-button class="button" type="primary" @click="cre">确 定</el-button>
<el-button class="button" @click="cancelHandel">取 消</el-button> <el-button class="button" @click="cancelHandel">取 消</el-button>
<!-- <el-button class="button" type="primary" @click="cre">确 定</el-button> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -117,12 +117,14 @@ export default { ...@@ -117,12 +117,14 @@ export default {
imgFlag: false, imgFlag: false,
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
percent: 0, //上传进度 percent: 0, //上传进度
list: [], list: [], //压缩包
oldList: '',
oldVadio: '',
vadio: [], //视频
activeId: '', //峰会id
form: { form: {
id: undefined, id: undefined,
banner: undefined, banner: undefined,
activityId: undefined,
banner: undefined,
videoPath: undefined, videoPath: undefined,
picturePath: undefined picturePath: undefined
} }
...@@ -151,44 +153,74 @@ export default { ...@@ -151,44 +153,74 @@ export default {
// }, // },
mounted() { mounted() {
this.getOrderInfo() this.getOrderInfo()
console.log(this.reviewRow)
}, },
methods: { methods: {
vidioSuccess(res) { vidioSuccess(res, file, fileList) {
if (res.status == 200) {
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: res.message, message: res.message,
type: 'success', type: 'success',
duration: 2000 duration: 2000
}) })
this.vadio = fileList
}
}, },
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
// const zip = file.type === 'application/zip' var index = file.name.lastIndexOf('.')
// if (!zip) { var ext = file.name.substr(index + 1)
// this.$message.error('上传头像图片只能是 zip 格式!') if (ext != 'zip') {
// } this.$message.error('上传压缩包只能是 zip 格式!')
// return zip return false
}
return true
}, },
videoUpload(file) { videoUpload(file) {
console.log(file.type)
const isJPG = file.type === 'video/mp4' const isJPG = file.type === 'video/mp4'
if (!isJPG) { if (!isJPG) {
this.$message.error('上传头像图片只能是 mp4 格式!') this.$message.error('上传压缩包只能是 mp4 格式!')
} }
return isJPG return isJPG
}, },
getOrderInfo() { getOrderInfo() {
console.log(this.reviewRow.id)
one(this.reviewRow.id).then(res => { one(this.reviewRow.id).then(res => {
this.form = res.data this.form = res.data
this.activeId = res.data.id //峰会id
this.oldList = res.data.picturePath || '' //压缩包
this.oldVadio = res.data.videoPath || '' //视频
this.dialogVisible = true this.dialogVisible = true
this.imgDialogVisible = true this.imgDialogVisible = true
}) })
}, },
cre() { cre() {
console.log(this.form.picturePath) let zipPic = []
save(this.form).then(res => { this.list.forEach(element => {
zipPic.push(element.response.data)
})
let mp4Vadio = []
this.vadio.forEach(element => {
mp4Vadio.push(element.response.data)
})
let params = {
id: this.activeId, //回顾id
banner: this.form.banner,
activityId: this.reviewRow.id, //峰会id
videoPath: this.oldVadio
? mp4Vadio == ''
? this.oldVadio
: mp4Vadio.join(',') + ',' + this.oldVadio
: mp4Vadio.join(','),
picturePath: this.oldList
? zipPic == ''
? this.oldList
: zipPic.join(',') + ',' + this.oldList
: zipPic.join(',')
}
// console.log(params);
save(params).then(res => {
this.responseResult(res) this.responseResult(res)
}) })
}, },
...@@ -241,20 +273,22 @@ export default { ...@@ -241,20 +273,22 @@ export default {
this.form.videoPath = file.data this.form.videoPath = file.data
this.imgDialogVisible = true this.imgDialogVisible = true
}, },
handleRemoveZip(file, fileList) {
this.list = fileList
},
handleRemove(file, fileList) { handleRemove(file, fileList) {
// console.log(file) this.vadio = fileList
console.log(file, fileList)
}, },
handlePictureCardPreview(res, file) { handlePictureCardPreview(res, file, fileList) {
if (res.status == 200) {
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: res.message, message: '上传成功',
type: 'success', type: 'success'
duration: 2000
}) })
this.list.push({ url: res.data }) this.list = fileList
// this.imgDialogVisible = true; }
}, },
cleanForm() { cleanForm() {
this.form = { this.form = {
......
...@@ -105,12 +105,7 @@ ...@@ -105,12 +105,7 @@
<el-form-item label="活动id:"> <el-form-item label="活动id:">
<!-- <el-input v-model="form.rid" placeholder="请输入签到/抽奖活动的id"></el-input> --> <!-- <el-input v-model="form.rid" placeholder="请输入签到/抽奖活动的id"></el-input> -->
<el-select v-model="form.rid" placeholder="请选择签到/抽奖活动id"> <el-select v-model="form.rid" placeholder="请选择签到/抽奖活动id">
<el-option <el-option v-for="(item,index) in optionsId" :key="index" :label="item" :value="item"></el-option>
v-for="(item,index) in optionsId"
:key="index"
:label="item"
:value="item"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -151,20 +146,16 @@ ...@@ -151,20 +146,16 @@
<div> <div>
<el-row> <el-row>
<el-col> <el-col>
<el-form-item label="房车介绍:"> <el-form-item label="房车介绍:" style="margin-top:20px">
<el-upload <el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'" :action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleRemove" list-type="picture-card"
:file-list="fileList2" :file-list="fileList2"
:on-success="handleBannerSuccess" :on-success="handleBannerSuccess"
list-type="picture" :on-remove="handleRemove"
:headers="getHeaderWithToken"
> >
<div slot="tip" class="el-upload__tip"> <i class="el-icon-plus"></i>
<span style="color: red;">建议尺寸:1080*644px</span>
</div>
<el-button size="small" type="primary">点击上传</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="峰会流程:"> <el-form-item label="峰会流程:">
...@@ -205,8 +196,8 @@ ...@@ -205,8 +196,8 @@
<el-row> <el-row>
<el-col> <el-col>
<el-button class="button" @click="cancelHandel">取 消</el-button> <el-button class="button" @click="cancelHandel">取 消</el-button>
<el-button class="button" type="primary" v-if="titleNme=='创建峰会'" @click="create('form')"> </el-button> <el-button class="button" type="primary" v-if="titleNme=='创建峰会'" @click="create('form')">确定</el-button>
<el-button class="button" type="primary" v-if="titleNme=='编辑峰会'" @click="update1()"> </el-button> <el-button class="button" type="primary" v-if="titleNme=='编辑峰会'" @click="update1()">确定</el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
...@@ -287,7 +278,7 @@ export default { ...@@ -287,7 +278,7 @@ export default {
created() { created() {
activityIds().then(data => { activityIds().then(data => {
if (data.status == 200) { if (data.status == 200) {
this.optionsId = data.data; this.optionsId = data.data
} }
}) })
}, },
...@@ -306,11 +297,14 @@ export default { ...@@ -306,11 +297,14 @@ export default {
} }
}, },
methods: { methods: {
handleBannerSuccess(res, file) { handleBannerSuccess(res, file, fileList) {
this.fileList2.push({ url: res.data }) console.log(fileList);
this.form.vehicleImgs = this.fileList2 this.fileList2 = fileList
// this.form.vehicleImgs = this.fileList2
},
handleRemove(res, file, fileList) {
this.fileList2 = file
}, },
handleRemove() {},
getOrderInfo() { getOrderInfo() {
this.title = this.titleNme this.title = this.titleNme
if (this.title === '编辑峰会') { if (this.title === '编辑峰会') {
...@@ -384,7 +378,7 @@ export default { ...@@ -384,7 +378,7 @@ export default {
}, },
getState(status) { getState(status) {
if (this.$utils.isInteger(status)) { if (this.$utils.isInteger(status)) {
console.log(status); console.log(status)
if (status == 0) { if (status == 0) {
return '默认' return '默认'
} else { } else {
...@@ -450,10 +444,17 @@ export default { ...@@ -450,10 +444,17 @@ export default {
? (this.form.bmCloseTime = this.form.bmCloseTime) ? (this.form.bmCloseTime = this.form.bmCloseTime)
: (this.form.bmCloseTime = this.form.bmCloseTime.getTime()) : (this.form.bmCloseTime = this.form.bmCloseTime.getTime())
let pic = [] let pic = []
if (!!this.form.vehicleImgs) { if (this.fileList2 != '') {
this.form.vehicleImgs.forEach(element => { console.log(this.fileList2);
pic.push(element.url) this.fileList2.forEach(element => {
}) if (!!element.response) {
pic.push(element.response.data)
}else{
pic.push(element.url);
}
});
console.log(pic);
this.form.vehicleImgs = pic.join(',') this.form.vehicleImgs = pic.join(',')
} }
...@@ -501,12 +502,18 @@ export default { ...@@ -501,12 +502,18 @@ export default {
this.form.startTime = this.form.startTime.getTime() this.form.startTime = this.form.startTime.getTime()
this.form.bmCloseTime = this.form.bmCloseTime.getTime() this.form.bmCloseTime = this.form.bmCloseTime.getTime()
let pic = [] let pic = []
if (!!this.form.vehicleImgs) { if (this.fileList2 != '') {
this.form.vehicleImgs.forEach(element => { this.fileList2.forEach(element => {
pic.push(element.url) pic.push(element.response.data);
}) });
this.form.vehicleImgs = pic.join(',') this.form.vehicleImgs = pic.join(',')
} }
// if (!!this.form.vehicleImgs) {
// this.form.vehicleImgs.forEach(element => {
// pic.push(element.url)
// })
// this.form.vehicleImgs = pic.join(',')
// }
this.dataProcessing() this.dataProcessing()
add(this.form).then(res => { add(this.form).then(res => {
this.responseResult(res) this.responseResult(res)
...@@ -516,7 +523,7 @@ export default { ...@@ -516,7 +523,7 @@ export default {
dataProcessing() { dataProcessing() {
if (this.form.state === '默认') { if (this.form.state === '默认') {
this.form.status = '0' this.form.status = '0'
}else{ } else {
this.form.status = this.statusRadio this.form.status = this.statusRadio
} }
this.form.processJson = JSON.stringify(this.processJson) this.form.processJson = JSON.stringify(this.processJson)
......
...@@ -28,16 +28,32 @@ ...@@ -28,16 +28,32 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4">
<el-form-item label="分公司">
<el-autocomplete
class="inline-input"
v-model="listQuery.companyName"
:fetch-suggestions="querySearch"
placeholder="请选择分公司"
@select="handleSelectPark"
clearable
></el-autocomplete>
<!-- <el-select class="filter-item" v-model="listQuery.status" placeholder="请选分公司">
<el-option :key="undefined" label="全部" :value="undefined"></el-option>
<el-option
v-for="(item,index) in companyList "
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>-->
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button> <el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button <el-button class="filter-item" type="primary" v-waves icon="delete" @click="cleaningQuery">清除搜索条件</el-button>
class="filter-item"
type="primary"
v-waves
icon="delete"
@click="cleaningQuery"
>清除搜索条件</el-button>
<el-button class="filter-item" type="primary" v-waves @click="addStaff">新增员工</el-button> <el-button class="filter-item" type="primary" v-waves @click="addStaff">新增员工</el-button>
<el-button class="filter-item" type="primary" v-waves @click="toLoad">批量导入员工</el-button> <el-button class="filter-item" type="primary" v-waves @click="toLoad">批量导入员工</el-button>
...@@ -53,6 +69,8 @@ ...@@ -53,6 +69,8 @@
> >
<el-table-column prop="name" label="姓名" width="180" align="center"></el-table-column> <el-table-column prop="name" label="姓名" width="180" align="center"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center"></el-table-column> <el-table-column prop="phone" label="手机号" align="center"></el-table-column>
<el-table-column prop="jobName" label="职位" align="center"></el-table-column>
<el-table-column prop="companyName" label="所属公司" align="center"></el-table-column>
<el-table-column prop="positionName" label="身份" align="center"></el-table-column> <el-table-column prop="positionName" label="身份" align="center"></el-table-column>
<el-table-column label="状态" align="center"> <el-table-column label="状态" align="center">
<template scope="scope"> <template scope="scope">
...@@ -90,12 +108,7 @@ ...@@ -90,12 +108,7 @@
></el-pagination> ></el-pagination>
<!-- 新增编辑员工 --> <!-- 新增编辑员工 -->
<el-dialog <el-dialog :title="staffTitle" :visible.sync="bulkUploadMember" class="member" @close="closeAdd">
:title="staffTitle"
:visible.sync="bulkUploadMember"
class="member"
@close="closeAdd"
>
<el-form :model="staffTitleFrom" ref="userMembership" :rules="rules" label-width="100px"> <el-form :model="staffTitleFrom" ref="userMembership" :rules="rules" label-width="100px">
<el-form-item label="员工姓名"> <el-form-item label="员工姓名">
<el-input v-model.number="staffTitleFrom.name" placeholder="请输入姓名"></el-input> <el-input v-model.number="staffTitleFrom.name" placeholder="请输入姓名"></el-input>
...@@ -119,6 +132,34 @@ ...@@ -119,6 +132,34 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="员工职位">
<el-select
class="filter-item"
v-model="staffTitleFrom.jobId"
placeholder="请选择员工身份"
style="width:100%"
>
<el-option :key="undefined" label="全部" :value="undefined"></el-option>
<el-option
v-for="(item,index) in jobsList "
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="分公司">
<el-autocomplete
class="inline-input"
v-model="staffTitleFrom.companyName"
:fetch-suggestions="querySearch"
placeholder="请选择分公司"
style="width:100%"
@select="handleSelectParks"
></el-autocomplete>
</el-form-item>
<div style="text-align:center"> <div style="text-align:center">
<el-button type="primary" @click="confirm">确 定</el-button> <el-button type="primary" @click="confirm">确 定</el-button>
<el-button type="primary" @click="bulkUploadMember = false">取消</el-button> <el-button type="primary" @click="bulkUploadMember = false">取消</el-button>
...@@ -131,10 +172,7 @@ ...@@ -131,10 +172,7 @@
<el-form :model="fileForm"> <el-form :model="fileForm">
<el-form-item label="上传文件" label-width="80px"> <el-form-item label="上传文件" label-width="80px">
<el-button type="primary" icon="el-icon-download"> <el-button type="primary" icon="el-icon-download">
<a <a class="el-icon-download" href="https://mgmt.dfangche.com/axshare/userposition.xlsx">下载模板</a>
class="el-icon-download"
href="https://mgmt.dfangche.com/axshare/userposition.xlsx"
>下载模板</a>
</el-button> </el-button>
<el-upload <el-upload
...@@ -157,12 +195,7 @@ ...@@ -157,12 +195,7 @@
</el-button> </el-button>
<div slot="tip" class="el-upload__tip">只能上传xlsx(Excel2007以上版本)文件,且不超过10M</div> <div slot="tip" class="el-upload__tip">只能上传xlsx(Excel2007以上版本)文件,且不超过10M</div>
</el-upload> </el-upload>
<el-button <el-button size="small" class="filter-item" type="primary" @click="cancelNotDeleteForm">取消</el-button>
size="small"
class="filter-item"
type="primary"
@click="cancelNotDeleteForm"
>取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-dialog> </el-dialog>
...@@ -193,48 +226,56 @@ import { ...@@ -193,48 +226,56 @@ import {
staffList, staffList,
postions, postions,
addEditor, addEditor,
deleteStaffs deleteStaffs,
} from "src/api/admin/userManagement/index"; jobs,editorUpd
import { getToken } from "src/utils/auth"; } from 'src/api/admin/userManagement/index'
import { mapGetters } from "vuex"; import { getToken } from 'src/utils/auth'
import { staffImport } from "src/api/admin/UserMember/index"; import { mapGetters } from 'vuex'
import { staffImport } from 'src/api/admin/UserMember/index'
import { getAll } from 'api/base_info/branch_company'
export default { export default {
created() { created() {
this.getList(); this.getList()
this.postionsFn(); this.postionsFn()
this.getAllFn()
this.jobsFn()
}, },
computed: { computed: {
...mapGetters(["elements"]), ...mapGetters(['elements']),
/** /**
* 获取token * 获取token
*/ */
getHeaderWithToken() { getHeaderWithToken() {
return { Authorization: getToken() }; return { Authorization: getToken() }
} }
}, },
data() { data() {
return { return {
activeId: "", jobsList: [],
activeId: '',
uploadListHiut: { uploadListHiut: {
uploadList: [], uploadList: [],
success: "", success: '',
error: "" error: ''
}, },
companyList: [],
uploadHiut: false, uploadHiut: false,
fileList: [], fileList: [],
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
limitNum: 1, limitNum: 1,
fileForm: { fileForm: {
file: "" file: ''
}, },
tolead: false, tolead: false,
listQuery: { listQuery: {
name: "", name: '',
phone: "", phone: '',
status: null, status: null,
page: 1, page: 1,
limit: 10 limit: 10,
companyId: '',
companyName: ''
}, },
total: null, total: null,
tableKey: 0, tableKey: 0,
...@@ -242,48 +283,90 @@ export default { ...@@ -242,48 +283,90 @@ export default {
listLoading: true, listLoading: true,
statusList: [ statusList: [
{ {
label: "未核销", label: '未核销',
value: "0" value: '0'
}, },
{ {
label: "已核销", label: '已核销',
value: "1" value: '1'
} }
], ],
postionsList: [], postionsList: [],
staffTitle: "新增员工", staffTitle: '新增员工',
bulkUploadMember: false, bulkUploadMember: false,
staffTitleFrom: { staffTitleFrom: {
phone: "", phone: '',
name: "", name: '',
positionId: "" positionId: '',
jobId: '',
companyId: '',
companyName: ''
}, },
rules: {} rules: {}
}; }
}, },
methods: { methods: {
handleSelectPark(item) {
this.listQuery.companyId = item.id
},
handleSelectParks(item) {
this.staffTitleFrom.companyId = item.id
this.staffTitleFrom.companyName = item.name
},
createFilter(queryString) {
return restaurant => {
return restaurant.name.indexOf(queryString.toLowerCase()) != -1
}
},
querySearch(queryString, cb) {
let selectArry = []
this.companyList.map(function(item) {
item.value = item.name
selectArry.push(item)
})
this.selectArry = selectArry
var results = queryString
? selectArry.filter(this.createFilter(queryString))
: selectArry
// 调用 callback 返回建议列表的数据
cb(results)
},
//分公司
getAllFn() {
getAll().then(data => {
if (data.status == 200) {
this.companyList = data.data;
this.companyList.unshift({name:'全部',id:''})
console.log(this.companyList);
}
})
},
//新增,编辑员工弹窗关闭 //新增,编辑员工弹窗关闭
closeAdd() { closeAdd() {
this.staffTitleFrom = { this.staffTitleFrom = {
phone: "", phone: '',
name: "", name: '',
positionId: "" positionId: '',
}; jobId: '',
companyId: '',
companyName: ''
}
}, },
upLoad(file) { upLoad(file) {
var form = new FormData(); var form = new FormData()
// 文件对象 // 文件对象
form.append("file", file.file); form.append('file', file.file)
staffImport(form).then(res => { staffImport(form).then(res => {
console.log(res); console.log(res)
this.uploadHiut = true; this.uploadHiut = true
(this.uploadListHiut = { ;(this.uploadListHiut = {
uploadList: res.data.data, uploadList: res.data.data,
success: res.data.success, success: res.data.success,
error: res.data.error error: res.data.error
}), }),
this.getList(); this.getList()
}); })
}, },
//excel上传 //excel上传
handleRemove(file, fileList) { handleRemove(file, fileList) {
...@@ -293,22 +376,22 @@ export default { ...@@ -293,22 +376,22 @@ export default {
//console.log(file); //console.log(file);
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`); return this.$confirm(`确定移除 ${file.name}?`)
}, },
// 文件超出个数限制时的钩子 // 文件超出个数限制时的钩子
exceedFile(files, fileList) { exceedFile(files, fileList) {
this.$notify.warning({ this.$notify.warning({
title: "警告", title: '警告',
message: `只能选择 ${ message: `只能选择 ${
this.limitNum this.limitNum
} 个文件,当前共选择了 ${files.length + fileList.length} 个` } 个文件,当前共选择了 ${files.length + fileList.length} 个`
}); })
}, },
// 文件状态改变时的钩子 // 文件状态改变时的钩子
fileChange(file, fileList) { fileChange(file, fileList) {
//console.log("change"); //console.log("change");
//console.log(file); //console.log(file);
this.fileForm.file = file.raw; this.fileForm.file = file.raw
//console.log(this.fileForm.file); //console.log(this.fileForm.file);
// console.log(fileList); // console.log(fileList);
}, },
...@@ -316,134 +399,152 @@ export default { ...@@ -316,134 +399,152 @@ export default {
beforeUploadFile(file) { beforeUploadFile(file) {
//console.log("before upload"); //console.log("before upload");
//console.log(file); //console.log(file);
let extension = file.name.substring(file.name.lastIndexOf(".") + 1); let extension = file.name.substring(file.name.lastIndexOf('.') + 1)
let size = file.size / 1024 / 1024; let size = file.size / 1024 / 1024
if (extension !== "xlsx") { if (extension !== 'xlsx') {
this.$notify.warning({ this.$notify.warning({
title: "警告", title: '警告',
message: `只能上传Excel 2007以上版本(即后缀是.xlsx)的文件` message: `只能上传Excel 2007以上版本(即后缀是.xlsx)的文件`
}); })
} }
if (size > 10) { if (size > 10) {
this.$notify.warning({ this.$notify.warning({
title: "警告", title: '警告',
message: `文件大小不得超过10M` message: `文件大小不得超过10M`
}); })
} }
}, },
cancelNotDeleteForm() { cancelNotDeleteForm() {
this.tolead = false; this.tolead = false
this.$refs.uploadExcel.clearFiles(); this.$refs.uploadExcel.clearFiles()
}, },
//员工列表 //员工列表
getList() { getList() {
staffList(this.listQuery).then(data => { staffList(this.listQuery).then(data => {
this.listLoading = true; this.listLoading = true
if (data.status == 200) { if (data.status == 200) {
console.log(data); console.log(data)
this.list = data.data.data; this.list = data.data.data
this.total = data.data.totalCount; this.total = data.data.totalCount
this.listLoading = false; this.listLoading = false
} }
}); })
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.listQuery.limit = val; this.listQuery.limit = val
this.getList(); this.getList()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.listQuery.page = val; this.listQuery.page = val
this.getList(); this.getList()
}, },
//搜索 //搜索
handleFilter() { handleFilter() {
this.getList(); this.getList()
}, },
//清空搜索条件 //清空搜索条件
cleaningQuery() { cleaningQuery() {
this.listQuery.page = 1; this.listQuery.page = 1
this.listQuery.limit = 10; this.listQuery.limit = 10
this.listQuery.name = ""; this.listQuery.name = ''
this.listQuery.phone = ""; this.listQuery.phone = ''
this.listQuery.status = ""; this.listQuery.status = ''
this.getList(); this.listQuery.companyId = ''
this.listQuery.companyName = ''
this.getList()
}, },
//新增员工 //新增员工
addStaff() { addStaff() {
this.staffTitle == "新增员工" this.staffTitle = '新增员工'
this.bulkUploadMember = true; this.bulkUploadMember = true
}, },
//批量导入员工 //批量导入员工
toLoad() { toLoad() {
this.tolead = true; this.tolead = true
}, },
//编辑员工 //编辑员工
editorStaff(row) { editorStaff(row) {
this.activeId = row.id; this.activeId = row.id
this.staffTitle = "编辑员工"; this.staffTitle = '编辑员工'
this.bulkUploadMember = true; this.bulkUploadMember = true
this.staffTitleFrom = { this.staffTitleFrom = {
phone: row.phone, phone: row.phone,
name: row.name, name: row.name,
positionId: row.positionId positionId: row.positionId,
}; companyId:row.companyId,
companyName:row.companyName,
}
}, },
//删除员工 //删除员工
deleteStaff(row) { deleteStaff(row) {
this.$confirm("确定删除吗?", "提示", { this.$confirm('确定删除吗?', '提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(() => { }).then(() => {
deleteStaffs(row.id).then(data => { deleteStaffs(row.id).then(data => {
if (data.status == 200) { if (data.status == 200) {
this.$notify({ this.$notify({
title: "成功", title: '成功',
message: "删除成功", message: '删除成功',
type: "success", type: 'success',
duration: 2000 duration: 2000
}); })
this.getList(); this.getList()
} else { } else {
this.$notify({ this.$notify({
title: "失败", title: '失败',
message: "删除失败", message: '删除失败',
type: "failed", type: 'failed',
duration: 2000 duration: 2000
}); })
} }
}); })
}); })
}, },
//确定 //确定
confirm(formName) { confirm(formName) {
if (this.staffTitle == "新增员工") { if (this.staffTitle == '新增员工') {
addEditor(this.staffTitleFrom).then(data => { addEditor(this.staffTitleFrom).then(data => {
if (data.status == 200) { if (data.status == 200) {
this.$notify({ this.$notify({
title: "成功", title: '成功',
message: "新增成功", message: '新增成功',
type: "success", type: 'success',
duration: 2000 duration: 2000
}); })
this.bulkUploadMember = false; this.bulkUploadMember = false
this.getList(); this.getList()
}else {
this.$notify({
title: '失败',
message: data.message,
type: 'failed',
duration: 2000
})
} }
}); })
} else { } else {
this.staffTitleFrom.id = this.activeId; this.staffTitleFrom.id = this.activeId
addEditor(this.staffTitleFrom).then(data => { editorUpd(this.staffTitleFrom).then(data => {
if (data.status == 200) { if (data.status == 200) {
this.$notify({ this.$notify({
title: "成功", title: '成功',
message: "编辑成功", message: '编辑成功',
type: "success", type: 'success',
duration: 2000 duration: 2000
}); })
this.bulkUploadMember = false; this.bulkUploadMember = false
this.getList(); this.getList()
}else {
this.$notify({
title: '失败',
message: data.message,
type: 'failed',
duration: 2000
})
} }
}); })
} }
}, },
//身份列表 //身份列表
...@@ -451,15 +552,23 @@ export default { ...@@ -451,15 +552,23 @@ export default {
postions().then(data => { postions().then(data => {
//console.log(data); //console.log(data);
if (data.status == 200) { if (data.status == 200) {
this.postionsList = data.data; this.postionsList = data.data
}
})
},
jobsFn() {
jobs().then(data => {
//console.log(data);
if (data.status == 200) {
this.jobsList = data.data
} }
}); })
}, },
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields()
} }
} }
}; }
</script> </script>
<style> <style>
.member .el-dialog--small { .member .el-dialog--small {
......
...@@ -1541,11 +1541,11 @@ ...@@ -1541,11 +1541,11 @@
}, },
queryVehicleModelSearch(queryString, cb) { queryVehicleModelSearch(queryString, cb) {
let selectArry = []; let selectArry = [];
let iitem = { // let iitem = {
value: "全部", // value: "全部",
name: "全部" // name: "全部"
}; // };
selectArry.push(iitem); // selectArry.push(iitem);
this.allVehicleList.map(function (item) { this.allVehicleList.map(function (item) {
item.value = item.name; item.value = item.name;
selectArry.push(item); selectArry.push(item);
......
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