完成任务导入功能联调
This commit is contained in:
@@ -344,3 +344,8 @@ export const getMounthDays = (date) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*导入任务*/
|
||||||
|
export const upload = () => {
|
||||||
|
return `/api/jobslink-api/missions/mission/importMission?isCovered=1`
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,32 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<avue-crud
|
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="obj" @row-del="rowDel"
|
||||||
:option="option"
|
@row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen" :page.sync="page"
|
||||||
:table-loading="loading"
|
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
|
||||||
:data="data"
|
|
||||||
ref="crud"
|
|
||||||
v-model="obj"
|
|
||||||
@row-del="rowDel"
|
|
||||||
@row-update="rowUpdate"
|
|
||||||
@row-save="rowSave"
|
|
||||||
:before-open="beforeOpen"
|
|
||||||
:page.sync="page"
|
|
||||||
@current-change="currentChange"
|
|
||||||
@size-change="sizeChange"
|
|
||||||
@refresh-change="refreshChange"
|
|
||||||
@on-load="onLoad"
|
|
||||||
>
|
|
||||||
<!--自定义按钮-->
|
<!--自定义按钮-->
|
||||||
<template slot="menuLeft">
|
<template slot="menuLeft">
|
||||||
<save-button
|
<save-button type="warning" plain icon="el-icon-plus" size="small" @click="rowCopy('', 'add')"
|
||||||
type="warning"
|
v-show="vaildData(permission.tenant_mission_add, false)">发布任务</save-button>
|
||||||
plain
|
<el-button type="success" size="small" plain icon="el-icon-plus" @click="handleImport"
|
||||||
icon="el-icon-plus"
|
v-show="vaildData(permission.tenant_talents_groupadd, false)">导入</el-button>
|
||||||
size="small"
|
|
||||||
@click="rowCopy('', 'add')"
|
|
||||||
v-show="vaildData(permission.tenant_mission_add, false)"
|
|
||||||
>发布任务</save-button
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
<!--/自定义按钮-->
|
<!--/自定义按钮-->
|
||||||
<!--自定义列-->
|
<!--自定义列-->
|
||||||
@@ -44,15 +26,15 @@
|
|||||||
</template>
|
</template>
|
||||||
<!-- 报名截止日期 -->
|
<!-- 报名截止日期 -->
|
||||||
<template slot="etimePub" slot-scope="{row}">
|
<template slot="etimePub" slot-scope="{row}">
|
||||||
<span>{{format(row.etimePub)}}</span>
|
<span>{{ format(row.etimePub) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- 开始日期 -->
|
<!-- 开始日期 -->
|
||||||
<template slot="stime" slot-scope="{row}">
|
<template slot="stime" slot-scope="{row}">
|
||||||
<span>{{format(row.stime)}}</span>
|
<span>{{ format(row.stime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- 完成日期 -->
|
<!-- 完成日期 -->
|
||||||
<template slot="etime" slot-scope="{row}">
|
<template slot="etime" slot-scope="{row}">
|
||||||
<span>{{format(row.etime)}}</span>
|
<span>{{ format(row.etime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template slot="takeOnCount" slot-scope="{ row }">
|
<template slot="takeOnCount" slot-scope="{ row }">
|
||||||
<div style="color: #409eff;cursor: pointer;" @click="employmentNum(row)">
|
<div style="color: #409eff;cursor: pointer;" @click="employmentNum(row)">
|
||||||
@@ -70,45 +52,15 @@
|
|||||||
<!--/自定义列-->
|
<!--/自定义列-->
|
||||||
<!--自定义操作栏-->
|
<!--自定义操作栏-->
|
||||||
<div slot="menu" slot-scope="{ size, type, row }">
|
<div slot="menu" slot-scope="{ size, type, row }">
|
||||||
<el-button type="text" size="mini" @click="recommend(row)"
|
<el-button type="text" size="mini" @click="recommend(row)">人才推荐</el-button>
|
||||||
>人才推荐</el-button
|
<el-button type="text" size="mini" @click="employ(row, 1)">录用人员</el-button>
|
||||||
>
|
<el-button icon="el-icon-view" :size="size" :type="type" @click.stop="rowView(row)"
|
||||||
<el-button type="text" size="mini" @click="employ(row, 1)"
|
v-show="vaildData(permission.tenant_mission_view, false)">查看</el-button>
|
||||||
>录用人员</el-button
|
<save-button icon="el-icon-check" :size="size" :type="type" @click="rowCopy(row, 'copy')">复制</save-button>
|
||||||
>
|
<el-button icon="el-icon-edit" :size="size" :type="type" @click="rowCopy(row, 'edit')"
|
||||||
<el-button
|
:disabled="row.signUpCount !== 0" v-show="vaildData(permission.tenant_mission_edit, false)">编辑</el-button>
|
||||||
icon="el-icon-view"
|
<el-button icon="el-icon-delete" :size="size" :type="type" @click="$refs.crud.rowDel(row)"
|
||||||
:size="size"
|
:disabled="row.signUpCount !== 0" v-show="vaildData(permission.tenant_mission_cancel, false)">取消</el-button>
|
||||||
:type="type"
|
|
||||||
@click.stop="rowView(row)"
|
|
||||||
v-show="vaildData(permission.tenant_mission_view, false)"
|
|
||||||
>查看</el-button
|
|
||||||
>
|
|
||||||
<save-button
|
|
||||||
icon="el-icon-check"
|
|
||||||
:size="size"
|
|
||||||
:type="type"
|
|
||||||
@click="rowCopy(row, 'copy')"
|
|
||||||
>复制</save-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
icon="el-icon-edit"
|
|
||||||
:size="size"
|
|
||||||
:type="type"
|
|
||||||
@click="rowCopy(row, 'edit')"
|
|
||||||
:disabled="row.signUpCount !== 0"
|
|
||||||
v-show="vaildData(permission.tenant_mission_edit, false)"
|
|
||||||
>编辑</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
icon="el-icon-delete"
|
|
||||||
:size="size"
|
|
||||||
:type="type"
|
|
||||||
@click="$refs.crud.rowDel(row)"
|
|
||||||
:disabled="row.signUpCount !== 0"
|
|
||||||
v-show="vaildData(permission.tenant_mission_cancel, false)"
|
|
||||||
>取消</el-button
|
|
||||||
>
|
|
||||||
<!-- <el-button type="text" size="mini" @click="contrast(row)"
|
<!-- <el-button type="text" size="mini" @click="contrast(row)"
|
||||||
>比对人才库</el-button> -->
|
>比对人才库</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
@@ -117,31 +69,36 @@
|
|||||||
<copy-mission ref="copy" @back="backIndex" v-show="false"></copy-mission>
|
<copy-mission ref="copy" @back="backIndex" v-show="false"></copy-mission>
|
||||||
<!--/发布 复制 编辑dialog-->
|
<!--/发布 复制 编辑dialog-->
|
||||||
<!--录用人员dialog-->
|
<!--录用人员dialog-->
|
||||||
<Employ
|
<Employ ref="employ" @refresh="refreshChange" :status="status" v-show="false"></Employ>
|
||||||
ref="employ"
|
<employment-num ref="employmentNum" :status="1" v-show="false"></employment-num>
|
||||||
@refresh="refreshChange"
|
|
||||||
:status="status"
|
|
||||||
v-show="false"
|
|
||||||
></Employ>
|
|
||||||
<employment-num
|
|
||||||
ref="employmentNum"
|
|
||||||
:status="1"
|
|
||||||
v-show="false"
|
|
||||||
></employment-num>
|
|
||||||
<!--/录用人员dialog-->
|
<!--/录用人员dialog-->
|
||||||
<!--人才推荐dialog-->
|
<!--人才推荐dialog-->
|
||||||
<Recommend ref="recommend" v-show="false"></Recommend>
|
<Recommend ref="recommend" v-show="false"></Recommend>
|
||||||
<!--/人才推荐dialog-->
|
<!--/人才推荐dialog-->
|
||||||
<!--对比人才库dialog-->
|
<!--对比人才库dialog-->
|
||||||
<Contrast ref="contrast" v-show="false"></Contrast>
|
<Contrast ref="contrast" v-show="false"></Contrast>
|
||||||
<!--对比人才库dialog-->
|
<!--对比人才库dialog-->
|
||||||
<!--查看dialog-->
|
<!--查看dialog-->
|
||||||
<mission-view :visible.sync="viewDrawer" :model="view"></mission-view>
|
<mission-view :visible.sync="viewDrawer" :model="view"></mission-view>
|
||||||
<!--/查看dialog-->
|
<!--/查看dialog-->
|
||||||
|
<!--批量导入-->
|
||||||
|
<el-dialog title="导入" append-to-body :visible.sync="excelBox" :close-on-click-modal="false" width="555px">
|
||||||
|
<avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter" :upload-before="beforeAvatarUpload"
|
||||||
|
:upload-error="uploadError">
|
||||||
|
<template slot="excelTemplate">
|
||||||
|
<el-button type="primary" @click="handleTemplate()" :loading="templateLoading">
|
||||||
|
点击下载
|
||||||
|
<i class="el-icon-download el-icon--right"></i>
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</avue-form>
|
||||||
|
</el-dialog>
|
||||||
|
<!--/批量导入-->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { upload } from "@/api/tenant/mission";
|
||||||
import { getList, cancel, detail } from "@/api/tenant/mission";
|
import { getList, cancel, detail } from "@/api/tenant/mission";
|
||||||
import CopyMission from "../Dialog/CopyMission";
|
import CopyMission from "../Dialog/CopyMission";
|
||||||
import Employ from "../Dialog/Employ";
|
import Employ from "../Dialog/Employ";
|
||||||
@@ -151,8 +108,11 @@ import Contrast from "../Dialog/Contrast"
|
|||||||
import SkillSelect from "../Dialog/Skill";
|
import SkillSelect from "../Dialog/Skill";
|
||||||
import missionView from "./missionView.vue";
|
import missionView from "./missionView.vue";
|
||||||
import SelectMap from "@/components/map/selectLocation";
|
import SelectMap from "@/components/map/selectLocation";
|
||||||
|
import { isExcel } from "@/util/validate";
|
||||||
|
import { excelAccept } from "@/common/accept";
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
import { dateFormat } from "@/util/date";
|
import { dateFormat } from "@/util/date";
|
||||||
|
import { getTemplate } from "@/api/resource/template";
|
||||||
import saveButton from "./saveButton";
|
import saveButton from "./saveButton";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -165,7 +125,8 @@ export default {
|
|||||||
missionView,
|
missionView,
|
||||||
saveButton,
|
saveButton,
|
||||||
Contrast,
|
Contrast,
|
||||||
employmentNum
|
employmentNum,
|
||||||
|
excelAccept
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
ellipsis(value) {
|
ellipsis(value) {
|
||||||
@@ -178,6 +139,35 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
excelBox: false,
|
||||||
|
excelForm: { isCovered: 1 },
|
||||||
|
excelOption: {
|
||||||
|
submitBtn: false,
|
||||||
|
emptyBtn: false,
|
||||||
|
column: [
|
||||||
|
{
|
||||||
|
label: "文件上传",
|
||||||
|
prop: "excelFile",
|
||||||
|
type: "upload",
|
||||||
|
drag: true,
|
||||||
|
loadText: "文件上传中,请稍等",
|
||||||
|
span: 24,
|
||||||
|
propsHttp: {
|
||||||
|
res: "data",
|
||||||
|
},
|
||||||
|
tip: "请上传 .xls,.xlsx 标准格式文件",
|
||||||
|
accept: excelAccept,
|
||||||
|
showFileList: false,
|
||||||
|
action: upload(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "模板下载",
|
||||||
|
prop: "excelTemplate",
|
||||||
|
formslot: true,
|
||||||
|
span: 24,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
status: 1,
|
status: 1,
|
||||||
viewDrawer: false,
|
viewDrawer: false,
|
||||||
view: {},
|
view: {},
|
||||||
@@ -194,10 +184,10 @@ export default {
|
|||||||
},
|
},
|
||||||
data: [],
|
data: [],
|
||||||
obj: {},
|
obj: {},
|
||||||
missionNo:'',
|
missionNo: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {},
|
created() { },
|
||||||
watch: {},
|
watch: {},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(["permission"]),
|
...mapGetters(["permission"]),
|
||||||
@@ -218,6 +208,7 @@ export default {
|
|||||||
columnBtn: false,
|
columnBtn: false,
|
||||||
searchBtn: false,
|
searchBtn: false,
|
||||||
searchShow: false,
|
searchShow: false,
|
||||||
|
templateLoading: false,
|
||||||
border: true,
|
border: true,
|
||||||
index: false,
|
index: false,
|
||||||
selection: false,
|
selection: false,
|
||||||
@@ -273,7 +264,7 @@ export default {
|
|||||||
display: false,
|
display: false,
|
||||||
width: 110,
|
width: 110,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
label: "提示",
|
label: "提示",
|
||||||
prop: "toStart",
|
prop: "toStart",
|
||||||
@@ -292,7 +283,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 录用人数
|
// 录用人数
|
||||||
employmentNum(row){
|
employmentNum(row) {
|
||||||
this.$refs.employmentNum.openDialog(row, 2);//查看已录用人员
|
this.$refs.employmentNum.openDialog(row, 2);//查看已录用人员
|
||||||
},
|
},
|
||||||
/*打开新增 复制 编辑*/
|
/*打开新增 复制 编辑*/
|
||||||
@@ -315,7 +306,7 @@ export default {
|
|||||||
this.$refs.recommend.openDialog(row);
|
this.$refs.recommend.openDialog(row);
|
||||||
},
|
},
|
||||||
/*打开对比人才库*/
|
/*打开对比人才库*/
|
||||||
contrast(row){
|
contrast(row) {
|
||||||
this.$refs.contrast.openDialog(row);
|
this.$refs.contrast.openDialog(row);
|
||||||
},
|
},
|
||||||
/*取消任务*/
|
/*取消任务*/
|
||||||
@@ -400,6 +391,55 @@ export default {
|
|||||||
backIndex() {
|
backIndex() {
|
||||||
this.$emit("refresh");
|
this.$emit("refresh");
|
||||||
},
|
},
|
||||||
|
/*导入任务*/
|
||||||
|
beforeAvatarUpload(file, done, loading) {
|
||||||
|
if (!isExcel(file)) {
|
||||||
|
loading();
|
||||||
|
this.$message.error("上传任务信息只能是 .xls,.xlsx 标准格式文件!");
|
||||||
|
} else {
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
uploadAfter(res, done) {
|
||||||
|
if (!(res instanceof Error) && !res.data) {
|
||||||
|
this.excelBox = false;
|
||||||
|
} else if (res.data && res.data.code === 900) {
|
||||||
|
const arr = [];
|
||||||
|
const data = res.data.data;
|
||||||
|
data.error &&
|
||||||
|
data.error.errorList.forEach((item) => {
|
||||||
|
arr.push(`${item.name} ${item.remarks}`);
|
||||||
|
});
|
||||||
|
data.auth &&
|
||||||
|
data.auth.authList.forEach((item) => {
|
||||||
|
arr.push(`${item.name} ${item.remarks}`);
|
||||||
|
});
|
||||||
|
this.$refs.ied.show(arr);
|
||||||
|
}
|
||||||
|
this.refreshChange();
|
||||||
|
// this.initDept(this.tenantId);
|
||||||
|
done();
|
||||||
|
},
|
||||||
|
uploadError(error) {
|
||||||
|
if (error) {
|
||||||
|
this.$message.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleImport() {
|
||||||
|
this.excelBox = true;
|
||||||
|
},
|
||||||
|
/*下载任务模板 */
|
||||||
|
handleTemplate() {
|
||||||
|
this.templateLoading = true;
|
||||||
|
getTemplate("trc")
|
||||||
|
.then((rep) => {
|
||||||
|
this.templateLoading = false;
|
||||||
|
window.open(rep.data.data);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.templateLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -408,6 +448,7 @@ export default {
|
|||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.map {
|
.map {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 300px;
|
height: 300px;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ module.exports = {
|
|||||||
proxy: {
|
proxy: {
|
||||||
"/api": {
|
"/api": {
|
||||||
//本地服务接口地址
|
//本地服务接口地址
|
||||||
target: "http://39.98.184.58:8000",
|
target: "http://192.168.31.246:8000",
|
||||||
ws: true,
|
ws: true,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
|
|||||||
Reference in New Issue
Block a user