zsk_admin
zsk 10 months ago
parent b689b9c7fb
commit ed747af07e

@ -48,7 +48,7 @@ const router = createRouter({
component: () => import("../views/homePage/examine.vue") component: () => import("../views/homePage/examine.vue")
}, },
{ {
path: "/merchantManagement/fasExamine", path: "/merchantManagement/fastExamine",
name: "fastExamine", name: "fastExamine",
meta: { meta: {
title: '快速入驻', title: '快速入驻',
@ -109,7 +109,9 @@ router.beforeEach(async (to, from, next) => {
isLogin = true; isLogin = true;
} }
console.log(isLogin); console.log(isLogin);
debugger
if (isLogin) { if (isLogin) {
if (to.path == '/login') { if (to.path == '/login') {
next("/merchantManagement/homePage"); next("/merchantManagement/homePage");
} }

@ -5,6 +5,22 @@ import {
} from 'ant-design-vue'; } from 'ant-design-vue';
let data = { let data = {
version: '公共组件', version: '公共组件',
isOpenMock: false,// 是否开放假功能
sha:'2025bckj',
env () {
if (import.meta.env.MODE == 'development') {
return 'dev'
} else {
return 'prod'
}
},
getEnv () {// 不常用。仅服务于某些功能在开发模式下使用或者说是 只有在开发模式下可以看到
if (import.meta.env.MODE == 'development') {
return 'dev'
} else {
return 'prod'
}
},
/** /**
* model自定义确认弹窗 * model自定义确认弹窗
* @params title 标题 * @params title 标题
@ -53,7 +69,28 @@ let data = {
}, },
}) })
} }
},
permissionStr () {
return {
'queryTag': 'queryTag',
'updateTag': 'updateTag',
'addTag': 'addTag',
'deleteTag': 'deleteTag',
'importTag': 'importTag',
'exportTag': 'exportTag',
}
},
gResize (callback = () => { }) {
callback()
let handleResize = () => {
callback()
};
window.addEventListener('resize', handleResize);
},
getDayOfWeek () {
const days = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
const date = new Date();
return days[date.getDay()];
}, },
/** /**
* 时间格式转换 * 时间格式转换
@ -182,6 +219,9 @@ let data = {
case 'default':// 2023-10-31 09:00:00 case 'default':// 2023-10-31 09:00:00
result = year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + second; result = year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + second;
break; break;
case 'version': // 2023-10-31 09:00:00
result = year + month + date;
break;
case 'YY--MM--DD HH:MM':// 2023-10-31 09:00 case 'YY--MM--DD HH:MM':// 2023-10-31 09:00
result = year + '-' + month + '-' + date + ' ' + hours + ':' + minute; result = year + '-' + month + '-' + date + ' ' + hours + ':' + minute;
break; break;
@ -222,7 +262,7 @@ let data = {
* @params $type 1共享 0 普通 * @params $type 1共享 0 普通
*/ */
setReturnFee (returnFee, returnFeeType, $type) { setReturnFee (returnFee, returnFeeType, $type) {
let servetype, $num = 1; let servetype = '', $num = 1;
if ($type == 1) { if ($type == 1) {
$num = 1; $num = 1;
} else { } else {
@ -231,7 +271,7 @@ let data = {
if (returnFeeType === 0) { if (returnFeeType === 0) {
servetype = `${returnFee / $num || "--"}元/小时`; servetype = `${returnFee / $num || "--"}元/小时`;
} else if (returnFeeType === 1) { } else if (returnFeeType === 1) {
servetype = `${returnFee / $num || "--"}元/`; servetype = `${returnFee / $num || "--"}元/`;
} else if (returnFeeType === 2) { } else if (returnFeeType === 2) {
servetype = `${returnFee / $num || "--"}元/月`; servetype = `${returnFee / $num || "--"}元/月`;
} else if (returnFeeType === 3) { } else if (returnFeeType === 3) {
@ -244,6 +284,8 @@ let data = {
servetype = `${returnFee / $num || "--"}`; servetype = `${returnFee / $num || "--"}`;
} else if (returnFeeType === 7) { } else if (returnFeeType === 7) {
servetype = `费用待定`; servetype = `费用待定`;
} else {
servetype = `-`;
} }
return servetype return servetype
}, },
@ -257,7 +299,13 @@ let data = {
.test($str); .test($str);
} }
if ($type == 'tel') { if ($type == 'tel') {
return /^[1][3,4,5,7,8,9][0-9]{9}$/.test($str); return /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test($str);
}
if ($type == 'name') {
return /^[\u4E00-\u9FA5\·A-Za-z]+$/.test($str);
}
if ($type == 'idCard') {
return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test($str);
} }
if ($type == 'grade1') { if ($type == 'grade1') {
return /^[0-9]*$/.test($str); // 纯数字 return /^[0-9]*$/.test($str); // 纯数字
@ -286,10 +334,10 @@ let data = {
{ id: "45", name: "通过未入职", value: "45", text: "通过未入职", num: 0 }, { id: "45", name: "通过未入职", value: "45", text: "通过未入职", num: 0 },
{ id: "50", name: "已离职", value: "50", text: "已离职", num: 0 }, { id: "50", name: "已离职", value: "50", text: "已离职", num: 0 },
{ id: "100", name: "待确认", value: "50", text: "待确认", num: 0 }, // { id: "100", name: "待确认", value: "50", text: "待确认", num: 0 },
{ id: "101", name: "已取消", value: "50", text: "已取消", num: 0 }, // { id: "101", name: "已取消", value: "50", text: "已取消", num: 0 },
{ id: "102", name: "官方审核中", value: "50", text: "官方审核中", num: 0 }, // { id: "102", name: "官方审核中", value: "50", text: "官方审核中", num: 0 },
{ id: "103", name: "审核不通过", value: "50", text: "审核不通过", num: 0 }, // { id: "103", name: "审核不通过", value: "50", text: "审核不通过", num: 0 },
// { id: "60", name: "已完成", value: "60", text: "已完成", num: 0 } // { id: "60", name: "已完成", value: "60", text: "已完成", num: 0 }
]; ];
let data = []; let data = [];
@ -340,6 +388,17 @@ let data = {
} else { } else {
return type + S + '秒' return type + S + '秒'
} }
} else if (type == '后入职') {
// 处理 跟入职 的时间显示
if (D > 0) {
return D + '天' + type
} else if (H > 0) {
return H + '小时' + type
} else if (M > 0) {
return M + '分钟' + type
} else {
return S + '秒' + type
}
} }
} else { } else {
@ -453,6 +512,36 @@ let data = {
return []; return [];
} }
}, },
toGetAddresCopy ($list) {
if ($list && $list.length > 0) {
$list.forEach(item => {
var districtStr = "";
if (item.storeDistrict) {
var districtArr = item.storeDistrict.split(",");
var districtArr1 = [];
// console.log(districtArr);
districtArr.forEach((item1) => {
if (item1.length != 0) {
item1 = item1 + "丨";
districtArr1.push(item1);
}
});
if (districtArr.length < 3) {
districtStr = districtArr1[districtArr1.length - 1];
} else {
districtStr = districtArr1.join("");
}
if (item.storeDistrict.indexOf("undefined") > -1) {
districtStr = "-丨";
}
}
item["district"] = districtStr;
});
return $list;
} else {
return [];
}
},
/* /*
* @params $list 数组 * @params $list 数组
*/ */
@ -514,38 +603,38 @@ let data = {
if ($type == "default") { if ($type == "default") {
if (salaryClassify == 0) { if (salaryClassify == 0) {
return `<div class="g_flex_row_start">` + return `<div class="g_flex_row_start">` +
` <span class="g_fs_22 g_c_f40">${hourlyPay}</span>` + ` <span class="g_fs_22 g_c_f40 g_fw_bold" style="position:relative;top:2px;">${hourlyPay}</span>` +
` <span class="g_fs_14 g_c_f40 g_flex_column_end g_ml_2 g_mb_4">元/小时</span>` + ` <span class="g_fs_14 g_c_f40 g_flex_column_end g_ml_2 g_mb_2">元/小时</span>` +
`</div>`; `</div>`;
} else if (salaryClassify == 1) { } else if (salaryClassify == 1) {
return `<div class="g_flex_row_start">` + return `<div class="g_flex_row_start">` +
` <span class="g_fs_22 g_c_f40">${hourlyPay}</span>` + ` <span class="g_fs_22 g_c_f40 g_fw_bold" style="position:relative;top:2px;">${hourlyPay}</span>` +
` <span class="g_fs_14 g_c_f40 g_flex_column_end g_ml_2 g_mb_4">元/天</span>` + ` <span class="g_fs_14 g_c_f40 g_flex_column_end g_ml_2 g_mb_2">元/天</span>` +
`</div>`; `</div>`;
} else if (salaryClassify == 2) { } else if (salaryClassify == 2) {
return `<div class="g_flex_row_start">` + return `<div class="g_flex_row_start">` +
` <span class="g_fs_14 g_c_f40 g_flex_column_end g_mr_2 g_mb_4">补</span>` + ` <span class="g_fs_14 g_c_f40 g_flex_column_end g_mr_2 g_mb_2">补</span>` +
` <span class="g_fs_22 g_c_f40">${hourlyPay}</span>` + ` <span class="g_fs_22 g_c_f40 g_fw_bold" style="position:relative;top:2px;">${hourlyPay}</span>` +
` <span class="g_fs_14 g_c_f40 g_flex_column_end g_ml_2 g_mb_4">元</span>` + ` <span class="g_fs_14 g_c_f40 g_flex_column_end g_ml_2 g_mb_2">元</span>` +
`</div>`; `</div>`;
} else if (salaryClassify == 3) { } else if (salaryClassify == 3) {
return `<div class="g_flex_row_start">` + return `<div class="g_flex_row_start">` +
` <span class="g_fs_14 g_c_f40 g_flex_column_end g_mr_2 g_mb_4">返</span>` + ` <span class="g_fs_14 g_c_f40 g_flex_column_end g_mr_2 g_mb_2">返</span>` +
` <span class="g_fs_22 g_c_f40">${hourlyPay}</span>` + ` <span class="g_fs_22 g_c_f40 g_fw_bold" style="position:relative;top:2px;">${hourlyPay}</span>` +
` <span class="g_fs_14 g_c_f40 g_flex_column_end g_ml_2 g_mb_4">元</span>` + ` <span class="g_fs_14 g_c_f40 g_flex_column_end g_ml_2 g_mb_2">元</span>` +
`</div>`; `</div>`;
} else if (salaryClassify == 4) { } else if (salaryClassify == 4) {
return `<span class="g_fs_22 g_c_f40">计件</span>`; return `<span class="g_fs_18 g_fw_600 g_c_f40">计件</span>`;
} else if (salaryClassify == 5) { } else if (salaryClassify == 5) {
return `<div class="g_flex_row_start">` + return `<div class="g_flex_row_start">` +
` <span class="g_fs_14 g_c_f40 g_flex_column_end g_mr_2 g_mb_4">保底</span>` + ` <span class="g_fs_14 g_c_f40 g_flex_column_end g_mr_2 g_mb_2">保底</span>` +
` <span class="g_fs_22 g_c_f40">${hourlyPay}</span>` + ` <span class="g_fs_22 g_c_f40 g_fw_bold" style="position:relative;top:2px;">${hourlyPay}</span>` +
` <span class="g_fs_14 g_c_f40 g_flex_column_end g_ml_2 g_mb_4">元</span>` + ` <span class="g_fs_14 g_c_f40 g_flex_column_end g_ml_2 g_mb_2">元</span>` +
`</div>`; `</div>`;
} else if (salaryClassify == 6) { } else if (salaryClassify == 6) {
return `<span class="g_fs_22 g_c_f40">面议</span>`; return `<span class="g_fs_18 g_fw_600 g_c_f40">面议</span>`;
} else if (salaryClassify == 7) { } else if (salaryClassify == 7) {
return `<span class="g_fs_22 g_c_f40">月薪</span>`; return `<span class="g_fs_18 g_fw_600 g_c_f40">月薪</span>`;
} else { } else {
return "-"; return "-";
} }
@ -654,7 +743,7 @@ let data = {
}, },
/* /*
*/ */
disposeJobListData (jobList) { disposeJobListData (jobList, $bili = 1,$count = 2) {
let that = this; let that = this;
if (jobList !== undefined) { if (jobList !== undefined) {
if (Array.isArray(jobList)) { if (Array.isArray(jobList)) {
@ -699,25 +788,26 @@ let data = {
item.diffTime = S + "秒前"; item.diffTime = S + "秒前";
} }
if (item.returnFeeType) { if (item.returnFeeType) {
item.returnFee = Number(item.returnFee);
if (item.returnFeeType === 0) { if (item.returnFeeType === 0) {
item.servetype = `${item.returnFee || "--"}元/小时`; item.servetype = `${item.returnFee / $bili || "--"}元/小时`;
} else if (item.returnFeeType === 1) { } else if (item.returnFeeType === 1) {
item.servetype = `${item.returnFee || "--"}元/日`; item.servetype = `${item.returnFee / $bili || "--"}元/日`;
} else if (item.returnFeeType === 2) { } else if (item.returnFeeType === 2) {
item.servetype = `${item.returnFee || "--"}元/月`; item.servetype = `${item.returnFee / $bili || "--"}元/月`;
} else if (item.returnFeeType === 3) { } else if (item.returnFeeType === 3) {
item.servetype = `${item.returnFee || "--"}元/次`; item.servetype = `${item.returnFee / $bili || "--"}元/次`;
} else if (item.returnFeeType === 4) { } else if (item.returnFeeType === 4) {
item.servetype = `${item.returnFee || "--"}元/件`; item.servetype = `${item.returnFee / $bili || "--"}元/件`;
} else if (item.returnFeeType === 5) { } else if (item.returnFeeType === 5) {
item.servetype = `工人收入${item.returnFee || "--"}%`; item.servetype = `工人收入${item.returnFee / $bili || "--"}%`;
} else if (item.returnFeeType === 6) { } else if (item.returnFeeType === 6) {
item.servetype = `${item.returnFee || "--"}`; item.servetype = `${item.returnFee / $bili || "--"}`;
} else if (item.returnFeeType === 7) { } else if (item.returnFeeType === 7) {
item.servetype = `费用待定`; item.servetype = `费用待定`;
} }
} else { } else {
item.servetype = `${item.returnFee || "--"}元/小时`; item.servetype = `${item.returnFee / $bili || "--"}元/小时`;
} }
//地址深圳丨龙岗区丨 //地址深圳丨龙岗区丨
var districtStr = ""; var districtStr = "";
@ -746,7 +836,7 @@ let data = {
const jobSpecialLabelNames = []; const jobSpecialLabelNames = [];
if (that.isNotEmptyCheck(item.jobSpecialLabelNames) && Array.isArray(item.jobSpecialLabelNames)) { if (that.isNotEmptyCheck(item.jobSpecialLabelNames) && Array.isArray(item.jobSpecialLabelNames)) {
item.jobSpecialLabelNames.forEach((item, index) => { item.jobSpecialLabelNames.forEach((item, index) => {
if (index <= 2) { if (index <= $count) {
jobSpecialLabelNames.push(item); jobSpecialLabelNames.push(item);
} else { } else {
return; return;
@ -783,10 +873,11 @@ let data = {
} }
jobList["age"] = ageStr; jobList["age"] = ageStr;
if (jobList.returnFeeType) { if (jobList.returnFeeType) {
jobList.returnFee = jobList.returnFee / 100
if (jobList.returnFeeType === 0) { if (jobList.returnFeeType === 0) {
jobList.servetype = `${jobList.returnFee || "--"}元/小时`; jobList.servetype = `${jobList.returnFee || "--"}元/小时`;
} else if (jobList.returnFeeType === 1) { } else if (jobList.returnFeeType === 1) {
jobList.servetype = `${jobList.returnFee || "--"}元/`; jobList.servetype = `${jobList.returnFee || "--"}元/`;
} else if (jobList.returnFeeType === 2) { } else if (jobList.returnFeeType === 2) {
jobList.servetype = `${jobList.returnFee || "--"}元/月`; jobList.servetype = `${jobList.returnFee || "--"}元/月`;
} else if (jobList.returnFeeType === 3) { } else if (jobList.returnFeeType === 3) {
@ -801,7 +892,7 @@ let data = {
jobList.servetype = `费用待定`; jobList.servetype = `费用待定`;
} }
} else { } else {
jobList.servetype = `${jobList.returnFee || "--"}元/小时`; jobList.servetype = `${jobList.returnFee / 100 || "--"}元/小时`;
} }
//地址深圳丨龙岗区丨 //地址深圳丨龙岗区丨
var districtStr = ""; var districtStr = "";
@ -848,11 +939,11 @@ let data = {
} }
// 年龄限制 // 年龄限制
if (Boolean(jobList.minAgeWoman) === true && Boolean(jobList.minAgeMan) === false) { if (Boolean(jobList.minAgeWoman) === true && Boolean(jobList.minAgeMan) === false) {
jobList.gender = "女"; jobList.gender = "女";
} else if (Boolean(jobList.minAgeWoman) === false && Boolean(jobList.minAgeMan) === true) { } else if (Boolean(jobList.minAgeWoman) === false && Boolean(jobList.minAgeMan) === true) {
jobList.gender = "男"; jobList.gender = "男";
} else { } else {
jobList.gender = "男女不限"; jobList.gender = "男女不限";
} }
} }
} }
@ -965,63 +1056,51 @@ let data = {
*/ */
goWiondowOpenPage (url, $params = {}) { goWiondowOpenPage (url, $params = {}) {
let that = this; let that = this;
console.log('url', url); console.log('url', url, '$params', $params);
let basePath = null
basePath = 'http://b.ibocai.cn'
if (import.meta.env.MODE == 'webdev') {
basePath = 'http://webdev.ibocai.cn'
}
if (url == "delivery") {// 后台新开页面 if (url == "delivery") {// 后台新开页面
if (that.getDevStr() == "development") { if (that.getDevStr() == "development") {
window.open(window.location.origin + "/#/other/delivery") window.open(window.location.origin + "/other/delivery")
} else { } else {
if (window.location.origin.indexOf('www') > -1) { window.open("http://k.ibocai.cn/login");
window.open('http://www.ibocai.cn/#/other/' + url);
} else {
window.open('http://ibocai.cn/#/other/' + url);
}
}; };
} else if (// 前台特殊处理 } else if (url == "webLogin") {
url == "systemMsg" || if(that.isMobileDevice()){
url == "teamMsg" || if (that.getDevStr() == "development") {
url == "list" window.location.href = "http://localhost:4000/web-mobile";
) {
if (that.getDevStr() == "development") {
window.open("http://localhost:8888/#/" + url)
} else {
if (window.location.origin.indexOf('www') > -1) {
window.open('http://www.ibocai.cn/#/' + url);
} else { } else {
window.open('http://ibocai.cn/#/' + url); window.location.href = window.location.origin + '/web-mobile'
} };
}; }else{
} else if (url == "main" || url == "login") {// 前台特殊处理 if (that.getDevStr() == "development") {
console.log('that.getDevStr()', that.getDevStr()); window.location.href = "http://localhost:4000/" + url;
if (that.getDevStr() == "development") {
window.location.href = "http://localhost:3001/#/" + url;
console.log(window.location.href);
} else {
if (window.location.origin.indexOf('www') > -1) {
window.location.href = 'https://a.matripe.com.cn/stock/index.html#/' + url;
} else { } else {
window.location.href = 'https://a.matripe.com.cn/stock/index.html#/' + url window.location.href = window.location.origin + '/web/home'
} };
}; }
} else if (url == "boundtel") {// 前台特殊处理 } else if(url == 'go-admin'){
let _user = localStorage.getItem('totel'),
_pwd = localStorage.getItem('topwd');
window.open('https://b.ibocai.cn/login?t=a&s=' + localStorage.getItem('DAOTIAN_token') + '&u=' + _user + '&p=' + _pwd,'_blank')
} else if(url == 'go-bcgyl'){
window.open('https://www.ibocai.cn/web/home?t=w&s=' + localStorage.getItem('DAOTIAN_token'),'_blank')
} else if (url == "403") {// 前台特殊处理
if (that.getDevStr() == "development") { if (that.getDevStr() == "development") {
window.open("http://localhost:8888/#/accountsetting/" + url) window.location.href = window.location.origin + '/403';
} else { } else {
if (window.location.origin.indexOf('www') > -1) { window.location.href = basePath + '/403'
window.open('http://www.ibocai.cn/#/accountsetting/' + url);
} else {
window.open('http://ibocai.cn/#/accountsetting/' + url);
}
}; };
} else {// 后台通用 } else {// 后台通用
if (Object.keys($params).length == 0) { if (Object.keys($params).length == 0) {
if (that.getDevStr() == "development") { if (that.getDevStr() == "development") {
window.open(window.location.origin + '/#/merchantManagement/' + url); window.open(window.location.origin + '/merchantManagement/' + url);
} else { } else {
if (window.location.origin.indexOf('www') > -1) { window.open(basePath + '/merchantManagement/' + url);
window.open('http://www.ibocai.cn/#/merchantManagement/' + url);
} else {
window.open('http://ibocai.cn/#/merchantManagement/' + url);
}
}; };
} else { } else {
let _array = []; let _array = [];
@ -1032,13 +1111,9 @@ let data = {
}; };
_str = _array.join('&'); _str = _array.join('&');
if (that.getDevStr() == "development") { if (that.getDevStr() == "development") {
window.open(window.location.origin + '/#/merchantManagement/' + url + '?' + _str); window.open(window.location.origin + '/merchantManagement/' + url + '?' + _str);
} else { } else {
if (window.location.origin.indexOf('www') > -1) { window.open(basePath + '/merchantManagement/' + url + '?' + _str);
window.open('http://www.ibocai.cn/#/merchantManagement/' + url + '?' + _str);
} else {
window.open('http://ibocai.cn/#/merchantManagement/' + url + '?' + _str);
}
}; };
} }
} }
@ -1062,17 +1137,32 @@ let data = {
min: 0, min: 0,
max: 0 max: 0
} }
console.log($str);
if ($str) { if ($str) {
list.forEach((item, index) => { try {
if ($str.indexOf(item) > -1 && $str.split(item)[1]) { list.forEach((item, index) => {
obj = { if ($str.indexOf(item) > -1 && $str.split(item)[1]) {
min: $str.split(item)[0], let newlist = [$str.split(item)[0], $str.split(item)[1]]
max: $str.split(item)[1] newlist.sort(function (a, b) {
return a - b
})
obj = {
min: newlist[0],
max: newlist[1],
}
throw new error
} else {
obj = {
min: $str,
max: $str,
}
} }
} })
}) } catch (error) {
}
return obj;
} }
return obj;
}, },
/* /*
* 示例5000-6000 显示为5000-6,000 * 示例5000-6000 显示为5000-6,000
@ -1107,47 +1197,425 @@ let data = {
return '验证中' return '验证中'
} else if (status == 6) { } else if (status == 6) {
return '已过期' return '已过期'
} else if (status == 0) {
return '邀请中'
}
},
getJobRequestTypeClassifyNameId (id) {
let str = "";
let array = this.jobRequestTypeClassifyArray();
array.forEach((item) => {
if (item.id == id) {
str = item.name;
}
});
return str;
},
jobRequestTypeClassifyArray () {
let jobRequestTypeClassifyArray = [
{ id: "0", name: "学历", subName: "学历", text: "学历", value: "0", checked: false },
{ id: "1", name: "体征", subName: "体征", text: "体征", value: "1", checked: false },
{ id: "2", name: "衣着", subName: "衣着", text: "衣着", value: "2", checked: false },
{ id: "10", name: "其它", subName: "其它", text: "其它", value: "10", checked: false },
];
return jobRequestTypeClassifyArray;
},
getJobRequestSpecClassifyNameId (id) {
let str = "";
let array = this.jobRequestSpecClassifyArray();
array.forEach((item) => {
if (item.id == id) {
str = item.name;
}
});
return str;
},
jobRequestSpecClassifyArray () {
let jobRequestTypeClassifyArray = [
{ id: "0", name: "工作休息", subName: "工作休息", text: "工作休息", value: "0", checked: false },
{ id: "1", name: "薪资待遇", subName: "薪资待遇", text: "薪资待遇", value: "1", checked: false },
{ id: "2", name: "其它特色", subName: "其它特色", text: "其它特色", value: "2", checked: false },
{ id: "3", name: "吃住福利", subName: "吃住福利", text: "吃住福利", value: "3", checked: false },
{ id: "4", name: "面试特色", subName: "面试特色", text: "面试特色", value: "4", checked: false },
];
return jobRequestTypeClassifyArray;
},
downExcel (data, file_name) {
file_name = file_name + '.xlsx';
const blob = new Blob([data], { type: "application/vnd.ms-excel;charset=UTF-8" })
let brower = '';
if (navigator.userAgent.indexOf('Edge') > -1) {
brower = 'Edge'
}
if ('download' in document.createElement('a')) {
if (brower === 'Edge') {
navigator.msSaveBlob(blob, file_name);
return
}
let link = document.createElement('a');
link.style.display = 'none';
link.href = URL.createObjectURL(blob);
link.setAttribute('download', file_name);
document.body.appendChild(link);
link.click();
document.body.removeChild(link)
} else {
navigator.msSaveBlob(blob, file_name)
}
},
fileToBase (file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = function (event) {
if (event.target.readyState === FileReader.DONE) {
resolve(event.target.result);
}
};
reader.onerror = function (error) {
reject(error);
};
reader.readAsDataURL(file);
});
},
policyNumToHanZi (i, type = 'other') {
let pickerStr;
if (i <= 9) {
switch (i) {
case 0:
pickerStr = type == 'add' ? '零条政策' : "政策零";
break;
case 1:
pickerStr = type == 'add' ? '一条政策' : "政策一";
break;
case 2:
pickerStr = type == 'add' ? '二条政策' : "政策二";
break;
case 3:
pickerStr = type == 'add' ? '三条政策' : "政策三";
break;
case 4:
pickerStr = type == 'add' ? '四条政策' : "政策四";
break;
case 5:
pickerStr = type == 'add' ? '五条政策' : "政策五";
break;
case 6:
pickerStr = type == 'add' ? '六条政策' : "政策六";
break;
case 7:
pickerStr = type == 'add' ? '七条政策' : "政策七";
break;
case 8:
pickerStr = type == 'add' ? '八条政策' : "政策八";
break;
case 9:
pickerStr = type == 'add' ? '九条政策' : "政策九";
break;
case 10:
pickerStr = type == 'add' ? '十条政策' : "政策十";
break;
default:
pickerStr = type == 'add' ? i + '条政策' : "政策" + i;
break;
}
}
return pickerStr
},
static: {
reserveaFeeList: [
{
id: 0,
str: "按小时",
placeholder: "如: 20",
pre: "按时",
suffix: "元/小时",
},
{
id: 1,
str: "按天数",
placeholder: "如: 20",
pre: "按天",
suffix: "元/天",
},
{
id: 2,
str: "按月数",
placeholder: "如: 20",
pre: "按月",
suffix: "元/月",
},
{
id: 3,
str: "按次数",
placeholder: "如: 20",
pre: "按次",
suffix: "元/次",
},
{
id: 4,
str: "按件数",
placeholder: "如: 20",
pre: "按件",
suffix: "元/件",
},
{
id: 6,
str: "共计",
placeholder: "如: 20",
pre: "共计",
suffix: "元",
},
{
id: 5,
str: "工人收入",
placeholder: "如: 20",
pre: "工人收入",
suffix: "%",
},
{
id: 7,
str: "待定",
placeholder: "如: 20",
pre: "待定",
suffix: "待定",
},
]
},
setDate ($time) {
let _str = '',
$str = $time;
if ($time) {
_str = $str.$y + '-' + String(($str.$M * 1 + 1)).padStart(2, '0') + '-' + String($str.$D).padStart(2, '0') + ' ' + String($str.$H).padStart(2, '0') + ':' + String($str.$m).padStart(2, '0');
} else {
_str = '';
}
return _str
},
getGenderAndAgeById (idCard) {
if (!idCard) {
return false;
}
if (idCard.length !== 18) {
return false;
}
// 性别判断,奇数为男,偶数为女
let gender = idCard.charAt(16) % 2 === 0 ? 2 : 1;
// 提取出生日期部分格式为YYYYMMDD
const birthDateStr = idCard.substring(6, 14);
// 将字符串格式的出生日期转换为Date对象
const birthDate = new Date(
`${birthDateStr.substring(0, 4)}-${birthDateStr.substring(4, 6)}-${birthDateStr.substring(6, 8)}`
);
// 计算年龄
const today = new Date();
let age = today.getFullYear() - birthDate.getFullYear();
// 如果当前月份小于出生月份,或者当前月份等于出生月份但是当前日小于出生日,则减去一年
if (
today.getMonth() < birthDate.getMonth() ||
(today.getMonth() === birthDate.getMonth() && today.getDate() < birthDate.getDate())
) {
age--;
}
if (isNaN(gender)) gender = ''
if (isNaN(age)) age = ''
return { gender, age };
},
formatPhoneNumber (phone) {
if (phone) {
return phone.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3');
} else {
return ''
}
},
excelToBase64 (file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => {
const base64String = reader.result.split(',')[1];
resolve(base64String);
};
reader.onerror = reject;
reader.readAsDataURL(file);
});
},
isFloatNum (num) {
return typeof num === 'number' && !Number.isInteger(num);
},
/**
* 根据工单状态ID获取名称 我的工单
*/
getUserApplyOrderStatusByIdToBill (id) {
let str = "";
let array = this.userApplyOrderStatusArray();
array.forEach((item) => {
if (item.id == id) {
str = item.name;
}
});
return str;
},
/**
* 处理工单状态
*/
userApplyOrderStatusArray () {
let orderStatus = [
{
id: "10",
name: "已报名,审核中",
value: "10",
text: "报名审核中",
num: 0,
},
{
id: "20",
name: "报名成功,待面试",
value: "20",
text: "审核通过",
num: 0,
},
{
id: "21",
name: "审核未通过,报名失败",
value: "21",
text: "审核未通过",
num: 0,
},
{ id: "25", name: "已接到", value: "25", text: "已接到", num: 0 },
{ id: "26", name: "未接到", value: "26", text: "未接到", num: 0 },
{
id: "30",
name: "面试通过,待入职",
value: "30",
text: "面试通过",
num: 0,
},
{ id: "35", name: "面试未通过", value: "35", text: "面试未通过", num: 0 },
{ id: "40", name: "已入职,在职中", value: "40", text: "已入职", num: 0 },
{
id: "45",
name: "面试通过,未入职",
value: "45",
text: "通过未入职",
num: 0,
},
{ id: "50", name: "已离职", value: "50", text: "已离职", num: 0 },
];
return orderStatus;
},
/*
处理详情地址
*/
setJobInfoPosition (pos) {
let city = [];
let citys = [];
if (this.isNotEmptyCheck(pos)) {
city = pos.split(",");
}
city.forEach((i) => {
if (this.isNotEmptyCheck(i)) {
citys.push(i);
}
});
citys = citys.join(",").replace(/,/g, " | ");
return citys;
},
/*
河北省 显示 河北省
省市河北省石家庄市 显示 省市河北省石家庄市
省市县河北省石家庄市深泽县 显示 省县河北省深泽县
省市区河南省郑州市二七区显示 省市河南省郑州市
省市1市2江苏省苏州市昆山市 显示 省市2 江苏省昆山市
市市区北京市1北京市2东城区显示 市1区北京市东城区
区市区宁夏回族自治区银川市兴庆区显示 区市 宁夏回族自治区银川市
*/
setJobInfoPositionv3 (str) {
str = str.replace(//g, '');
var reg = /.+?(省|市|自治区|自治州|县|区)/g; // 省市区的正则
let matches = str.match(reg);
let result = '';
if (matches && matches.length > 0) {
switch (matches.length) {
case 1:
result = matches[0];
break;
case 2:
if (matches[0].includes('省') || matches[0].includes('自治区') || matches[0].includes('自治州')) {
result = `${matches[0]} | ${matches[1]}`;
} else {
result = `${matches[0]} | ${matches[1]}`;
}
break;
case 3:
if (matches[0].includes('省') || matches[0].includes('自治区') || matches[0].includes('自治州')) {
if(matches[1].includes('市') && matches[2].includes('市')){
result = `${matches[0]} | ${matches[2]}`;
}else{
if (matches[2].includes('县')) {
result = `${matches[0]} | ${matches[2]}`;
} else {
result = `${matches[0]} | ${matches[1]}`;
}
}
} else if (matches[1].includes('市')) {
result = `${matches[0]} | ${matches[2]}`;
} else {
result = `${matches[1]} | ${matches[2]}`;
}
break;
default:
result = str;
break;
}
} else {
result = str;
}
return result;
},
timeShowXXX2 (val) {
const now = Date.now();
const diff = now - val;
const seconds = Math.floor(diff / 1000);
const minutes = Math.floor(seconds / 60);
const hours = Math.floor(minutes / 60);
const days = Math.floor(hours / 24);
if (days < 2) {
if (hours > 0) {
return `${hours}小时前`;
} else if (minutes > 0) {
return `${minutes}分钟前`;
} else {
return `${seconds}秒前`;
}
} else {
return `${days}天前`;
}
},
isMobileDevice() {
if(navigator){
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}else{
return false;
} }
}, },
getJobRequestTypeClassifyNameId (id) { getUrlParams(){
let str = ""; const url = window.location.href;
let array = this.jobRequestTypeClassifyArray(); const params = new URLSearchParams(url.split('?')[1]);
array.forEach((item) => { return Object.fromEntries(params.entries());
if (item.id == id) { }
str = item.name;
}
});
return str;
},
jobRequestTypeClassifyArray () {
let jobRequestTypeClassifyArray = [
{ id: "0", name: "学历", subName: "学历", text: "学历", value: "0", checked: false },
{ id: "1", name: "体征", subName: "体征", text: "体征", value: "1", checked: false },
{ id: "2", name: "衣着", subName: "衣着", text: "衣着", value: "2", checked: false },
{ id: "10", name: "其它", subName: "其它", text: "其它", value: "10", checked: false },
];
return jobRequestTypeClassifyArray;
},
getJobRequestSpecClassifyNameId (id) {
let str = "";
let array = this.jobRequestSpecClassifyArray();
array.forEach((item) => {
if (item.id == id) {
str = item.name;
}
});
return str;
},
jobRequestSpecClassifyArray () {
let jobRequestTypeClassifyArray = [
{ id: "0", name: "工作休息", subName: "工作休息", text: "工作休息", value: "0", checked: false },
{ id: "1", name: "薪资待遇", subName: "薪资待遇", text: "薪资待遇", value: "1", checked: false },
{ id: "2", name: "其它特色", subName: "其它特色", text: "其它特色", value: "2", checked: false },
{ id: "3", name: "吃住福利", subName: "吃住福利", text: "吃住福利", value: "3", checked: false },
{ id: "4", name: "面试特色", subName: "面试特色", text: "面试特色", value: "4", checked: false },
];
return jobRequestTypeClassifyArray;
}
} }
export default data; export default data;

@ -71,6 +71,7 @@ service.interceptors.request.use(
} }
} }
req.headers.token = localStorage.getItem("DAOTIAN_token"); req.headers.token = localStorage.getItem("DAOTIAN_token");
req.headers.Authorization = "Bearer " + localStorage.getItem("DAOTIAN_token");
return req; return req;
}, },
(err) => { (err) => {

@ -141,7 +141,7 @@
<script setup> <script setup>
import { ref, reactive, onMounted, watch } from "vue"; import { ref, reactive, onMounted, watch } from "vue";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { getBusinessCoopList, addAgency, getTemplateList, getChannelUserList } from "@/api/businessCoop"; import { getBusinessCoopList, addAgency, getTemplateList, getChannelUserList } from "@/api/bussinessCoop";
// State // State
const searchKeyword = ref(""); const searchKeyword = ref("");

@ -133,20 +133,36 @@ const submitInfo = (e) => {
.then((res) => { .then((res) => {
console.log(res); console.log(res);
// localStorage.setItem("LOGIN_DATA", JSON.stringify(res.data)); // localStorage.setItem("LOGIN_DATA", JSON.stringify(res.data));
// localStorage.setItem("DAOTIAN_token", res.data.token);
console.log("infoApi", res);
if (res.status == 200 || res.status == 201) {
localStorage.setItem("DAOTIAN_userinfo", JSON.stringify(res.data));
localStorage.setItem("DAOTIAN_userinfo_name", res.data.userName || res.data.name);
localStorage.setItem("DAOTIAN_userinfo_avatar", res.data.userImg);
localStorage.setItem("LOGIN_DATA", JSON.stringify(res.data));
localStorage.setItem("DAOTIAN_token", res.data.token); localStorage.setItem("DAOTIAN_token", res.data.token);
router.push("/merchantManagement/homePage");
message.success("登录成功");
}else{
message.error(res.msg);
}
}) })
.then(() => { // .then(() => {
infoApi({}).then((res) => { // infoApi({}).then((res) => {
console.log("infoApi", res); // console.log("infoApi", res);
// localStorage.setItem("DAOTIAN_userinfo", JSON.stringify(res.data)); // if (res.status == 200 || res.status == 201) {
// localStorage.setItem("DAOTIAN_userinfo_name", res.data.name || res.data.name); // localStorage.setItem("DAOTIAN_userinfo", JSON.stringify(res.data));
// localStorage.setItem("DAOTIAN_userinfo_avatar", res.data.avatar); // localStorage.setItem("DAOTIAN_userinfo_name", res.data.name || res.data.name);
// localStorage.setItem("DAOTIAN_userinfo_roleid", res.data.user.agencyRoleId); // localStorage.setItem("DAOTIAN_userinfo_avatar", res.data.avatar);
// localStorage.setItem("DAOTIAN_userinfo_agencyid", res.data.user.agencyId); // localStorage.setItem("DAOTIAN_userinfo_roleid", res.data.user.agencyRoleId);
router.push("/merchantManagement/home"); // localStorage.setItem("DAOTIAN_userinfo_agencyid", res.data.user.agencyId);
message.success("登录成功"); // router.push("/merchantManagement/home");
}); // message.success("");
}); // }else{
// message.error(res.msg);
// }
// });
// });
}; };
const onFinishFailed = (e) => { const onFinishFailed = (e) => {

Loading…
Cancel
Save