flat: 修改cityId备份
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<template>
|
||||
<basic-container>
|
||||
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form"
|
||||
:permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose" :page.sync="page"
|
||||
@row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset"
|
||||
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
|
||||
:permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose" :page.sync="page"
|
||||
@row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" @search-change="searchChange"
|
||||
@search-reset="searchReset"
|
||||
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"
|
||||
@on-load="onLoad">
|
||||
<!-- <template slot="menu" slot-scope="{row}">-->
|
||||
<!-- <el-button-->
|
||||
<!-- v-if="vaildData(permission.manage_station_mainList_stop, false) && row.status !== 9"-->
|
||||
@@ -13,37 +15,42 @@
|
||||
<!-- type="text"-->
|
||||
<!-- >终止合作</el-button>-->
|
||||
<!-- </template>-->
|
||||
<template slot="cityIdForm" slot-scope="{disabled}">
|
||||
<jl-city-cascader :disabled="disabled" v-model="form.cityId" filterable clearable></jl-city-cascader>
|
||||
<template slot="authUrlIdImgForm">
|
||||
<el-image style="width: 100px; height: 100px" :src="form.authUrlId"
|
||||
:preview-src-list="[form.authUrlId]"></el-image>
|
||||
</template>
|
||||
<template slot="authUrlIdImgForm">
|
||||
<el-image style="width: 100px; height: 100px" :src="form.authUrlId"
|
||||
:preview-src-list="[form.authUrlId]"></el-image>
|
||||
</template>
|
||||
<template slot="authUrlIdImgForm">
|
||||
<el-image style="width: 100px; height: 100px" :src="form.authUrlId"
|
||||
:preview-src-list="[form.authUrlId]"></el-image>
|
||||
:preview-src-list="[form.authUrlId]"></el-image>
|
||||
</template>
|
||||
<template slot="identityUrl4IdImgForm">
|
||||
<el-image style="width: 100px; height: 100px" :src="form.identityUrl4Id"
|
||||
:preview-src-list="[form.identityUrl4Id]"></el-image>
|
||||
:preview-src-list="[form.identityUrl4Id]"></el-image>
|
||||
</template>
|
||||
<template slot="identityUrl5IdImgForm">
|
||||
<el-image style="width: 100px; height: 100px" :src="form.identityUrl5Id"
|
||||
:preview-src-list="[form.identityUrl5Id]"></el-image>
|
||||
:preview-src-list="[form.identityUrl5Id]"></el-image>
|
||||
</template>
|
||||
</avue-crud>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { companyInfoAdd, companyStationInfo, companyDetail, companyUpdate, stationStop, removeMainList } from "@/api/manage/main";
|
||||
import {
|
||||
companyInfoAdd,
|
||||
companyStationInfo,
|
||||
companyDetail,
|
||||
companyUpdate,
|
||||
stationStop,
|
||||
removeMainList
|
||||
} from "@/api/manage/main";
|
||||
// import { getStationDic } from "@/api/manage/station";
|
||||
import { mapGetters } from "vuex";
|
||||
import { isMobile, check18IdCardNo, validatenull } from "@/util/validate";
|
||||
import { putFile } from "@/api/resource/oss";
|
||||
import {mapGetters} from "vuex";
|
||||
import {isMobile, check18IdCardNo, validatenull} from "@/util/validate";
|
||||
import {putFile} from "@/api/resource/oss";
|
||||
import {getTradeDic} from "@/api/manage/trade";
|
||||
import {companyEnum} from "@/common/dic"
|
||||
import {addressColumn, companyEnum} from "@/common/dic"
|
||||
|
||||
const accept = [
|
||||
"image/png",
|
||||
"image/jpeg",
|
||||
@@ -189,12 +196,12 @@ export default {
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
type: "select",
|
||||
label: "所在地区",
|
||||
prop: "cityId",
|
||||
span: 12,
|
||||
dicData: addressColumn,
|
||||
display: true,
|
||||
formslot: true,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
@@ -279,25 +286,25 @@ export default {
|
||||
value: "id"
|
||||
},
|
||||
dicFormatter(resp) {
|
||||
var result=[];
|
||||
var result = [];
|
||||
resp.data.forEach(ele => {
|
||||
if(ele.name!="1"){
|
||||
if (ele.name != "1") {
|
||||
result.push(ele)
|
||||
}
|
||||
});
|
||||
return result;
|
||||
},
|
||||
rules:[
|
||||
rules: [
|
||||
{
|
||||
required:true,
|
||||
validator: (rule,value,callback) => {
|
||||
if(value=='请选择行业'){
|
||||
required: true,
|
||||
validator: (rule, value, callback) => {
|
||||
if (value == '请选择行业') {
|
||||
callback(new Error('请选择行业'));
|
||||
}else{
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger:'blur'
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -438,8 +445,8 @@ export default {
|
||||
const h = this.$createElement;
|
||||
this.$confirm(
|
||||
h("div", null, [
|
||||
h("p", { style: "font-size: 16px" }, "您确定要删除此消息吗? "),
|
||||
h("p", { style: "color: red" }, "一旦删除则无法找回"),
|
||||
h("p", {style: "font-size: 16px"}, "您确定要删除此消息吗? "),
|
||||
h("p", {style: "color: red"}, "一旦删除则无法找回"),
|
||||
]),
|
||||
{
|
||||
type: "warning",
|
||||
@@ -450,7 +457,7 @@ export default {
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
return removeMainList({ id: row.id, isDeleted: 1});
|
||||
return removeMainList({id: row.id, isDeleted: 1});
|
||||
})
|
||||
.then(() => {
|
||||
this.$message({
|
||||
@@ -459,7 +466,8 @@ export default {
|
||||
});
|
||||
this.refreshChange();
|
||||
})
|
||||
.catch(() => { });
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
rowSave(row, done, loading) {
|
||||
console.log('rowSave')
|
||||
@@ -595,7 +603,7 @@ export default {
|
||||
stop(row) {
|
||||
let h = this.$createElement;
|
||||
this.$confirm(
|
||||
h("p", { style: "color: #F56C6C" }, "一旦终止结算将会终止"),
|
||||
h("p", {style: "color: #F56C6C"}, "一旦终止结算将会终止"),
|
||||
"您确定要终止与此公司的合作吗?",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<select-map
|
||||
ref="selectMap"
|
||||
@addAddress="addAddress"
|
||||
@addressDel = "addressDel"
|
||||
@addressDel="addressDel"
|
||||
@input="inputAddress"
|
||||
:isCanEdit="!disabled"
|
||||
:lng="obj.lon"
|
||||
@@ -53,7 +53,8 @@
|
||||
<template slot-scope="{ row }" slot="wage">
|
||||
<el-input placeholder="请输入工资" type="number" v-model="obj.wage" class="input-with-select" @blur="wageBlur">
|
||||
<el-select v-model="obj.wageUnitCategory" slot="append" placeholder="请选择" @change="getMaxAndMin">
|
||||
<el-option :label="item.label" v-for="item in wageUnitCategory" :key="item.value" :value="item.value"></el-option>
|
||||
<el-option :label="item.label" v-for="item in wageUnitCategory" :key="item.value"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</template>
|
||||
@@ -79,19 +80,19 @@
|
||||
<!-- 工种 -->
|
||||
<template slot="worktypeIds">
|
||||
<div class="tradeId">
|
||||
<el-autocomplete
|
||||
popper-class="my-autocomplete"
|
||||
v-model.trim="workTypeState"
|
||||
:fetch-suggestions="querySearchAsyncWorkType"
|
||||
placeholder="请选择工种"
|
||||
@select="handleSelectWorkType"
|
||||
show-word-limit
|
||||
:disabled = "worktypeDisabled"
|
||||
>
|
||||
<template slot-scope="{ item }">
|
||||
<div class="name">{{item.value}}</div>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
<el-autocomplete
|
||||
popper-class="my-autocomplete"
|
||||
v-model.trim="workTypeState"
|
||||
:fetch-suggestions="querySearchAsyncWorkType"
|
||||
placeholder="请选择工种"
|
||||
@select="handleSelectWorkType"
|
||||
show-word-limit
|
||||
:disabled="worktypeDisabled"
|
||||
>
|
||||
<template slot-scope="{ item }">
|
||||
<div class="name">{{ item.value }}</div>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
</div>
|
||||
</template>
|
||||
<!--/自定义表单-->
|
||||
@@ -100,7 +101,8 @@
|
||||
icon="el-icon-circle-close"
|
||||
@click="drawer = false"
|
||||
:loading="disabled"
|
||||
>取消</el-button
|
||||
>取消
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
</avue-form>
|
||||
@@ -108,12 +110,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { add, detail, update, tradeListAdd, workListAdd,getMounthDays, getDictionary} from "@/api/tenant/mission";
|
||||
import { getTrade, getWork, getWorkTypes} from "@/api/tenant/common";
|
||||
import {add, detail, update, tradeListAdd, workListAdd, getMounthDays, getDictionary} from "@/api/tenant/mission";
|
||||
import {getTrade, getWork, getWorkTypes} from "@/api/tenant/common";
|
||||
import SkillSelect from "../Dialog/Skill";
|
||||
import SelectMap from "@/components/map/selectLocation";
|
||||
import { isvalidatemobile } from "@/util/validate";
|
||||
import { mapGetters } from "vuex";
|
||||
import {isvalidatemobile} from "@/util/validate";
|
||||
import {mapGetters} from "vuex";
|
||||
import {
|
||||
wageUnitCategoryState,
|
||||
wageOptionsWithNoMonth,
|
||||
@@ -135,19 +137,19 @@ export default {
|
||||
id: "",
|
||||
title: "",
|
||||
type: "",
|
||||
tradeBtnState:true,
|
||||
workTypeBtnState:true,
|
||||
worktypeDisabled:true,
|
||||
tradeBtnState: true,
|
||||
workTypeBtnState: true,
|
||||
worktypeDisabled: true,
|
||||
selectedSkillIds: [],
|
||||
selectedName: [],
|
||||
selectedSkills: [],
|
||||
tradeData: [],
|
||||
tradeNameAttr:[],
|
||||
tradeIdAttr:[],
|
||||
tradeNameAttr: [],
|
||||
tradeIdAttr: [],
|
||||
workData: [],
|
||||
workDataNameAttr:[],
|
||||
workDataIdAttr:[],
|
||||
skillIdAttr:[],
|
||||
workDataNameAttr: [],
|
||||
workDataIdAttr: [],
|
||||
skillIdAttr: [],
|
||||
obj: {
|
||||
wage: 0,
|
||||
wageUnitCategory: 3,
|
||||
@@ -155,20 +157,20 @@ export default {
|
||||
ageDesc: "不限年龄",
|
||||
education: 7,
|
||||
experienceDesc: "不限经验",
|
||||
tradeId:null,
|
||||
tradeId: null,
|
||||
tradeNames: null,
|
||||
userNature:"灵活用工",
|
||||
userNature: "灵活用工",
|
||||
},
|
||||
loading: false,
|
||||
drawer: false,
|
||||
wageUnitCategory: wageUnitCategoryState,
|
||||
restaurants: [],
|
||||
tradeState: '',
|
||||
workTypeState:'',
|
||||
timeout: null,
|
||||
days:null,//某个月份的天数
|
||||
endTimeFlag:true,
|
||||
stimeDate:null,
|
||||
workTypeState: '',
|
||||
timeout: null,
|
||||
days: null,//某个月份的天数
|
||||
endTimeFlag: true,
|
||||
stimeDate: null,
|
||||
wallMaxAndMin: []
|
||||
};
|
||||
},
|
||||
@@ -186,12 +188,12 @@ export default {
|
||||
if (val) {
|
||||
getWork(val).then((res) => {
|
||||
this.workData = res;
|
||||
this.workDataNameAttr = res.map((ele)=>{
|
||||
return ele.name
|
||||
})
|
||||
this.workDataIdAttr = res.map((ele)=>{
|
||||
return ele.id
|
||||
})
|
||||
this.workDataNameAttr = res.map((ele) => {
|
||||
return ele.name
|
||||
})
|
||||
this.workDataIdAttr = res.map((ele) => {
|
||||
return ele.id
|
||||
})
|
||||
this.worktypeDisabled = false;
|
||||
if (val !== oldval && oldval) {
|
||||
this.obj.worktypeIds = "";
|
||||
@@ -204,15 +206,17 @@ export default {
|
||||
// "obj.wageUnitCategory": function () {
|
||||
// if (this.$refs.form) this.$refs.form.$refs.form.validateField("wage");
|
||||
// },
|
||||
"stimeDate":function(n){
|
||||
if(n){
|
||||
getMounthDays(n).then(res=>{
|
||||
this.days=res.data.data;
|
||||
})
|
||||
"stimeDate": function (n) {
|
||||
if (n) {
|
||||
getMounthDays(n).then(res => {
|
||||
this.days = res.data.data;
|
||||
})
|
||||
}
|
||||
},
|
||||
wallMaxAndMin(val) {
|
||||
if(!val.length) {return;}
|
||||
if (!val.length) {
|
||||
return;
|
||||
}
|
||||
switch (true) {
|
||||
case this.obj.wage < Math.min(...val):
|
||||
this.obj.wage = Math.min(...val)
|
||||
@@ -278,7 +282,7 @@ export default {
|
||||
},
|
||||
option() {
|
||||
const self = this;
|
||||
const validatePass = (rule, value, callback)=>{
|
||||
const validatePass = (rule, value, callback) => {
|
||||
let specialKey = "[`~#$^&*()=|{}\\[\\]<>/~#¥……&*()——|{}【】《》%@‘”“']‘'";
|
||||
let flagValue = true;
|
||||
for (var i = 0; i < value.length; i++) {
|
||||
@@ -286,14 +290,14 @@ export default {
|
||||
flagValue = false;
|
||||
}
|
||||
}
|
||||
if( flagValue){
|
||||
if (flagValue) {
|
||||
callback();
|
||||
}else{
|
||||
} else {
|
||||
callback(new Error('任务名称不能输入特殊字符'));
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
return {
|
||||
emptyBtn: false,
|
||||
menuPosition: "right",
|
||||
@@ -321,7 +325,7 @@ export default {
|
||||
message: "长度在 3到 30 个字",
|
||||
trigger: "blur",
|
||||
},
|
||||
{ validator: validatePass, trigger: 'blur' }
|
||||
{validator: validatePass, trigger: 'blur'}
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -342,14 +346,13 @@ export default {
|
||||
);
|
||||
},
|
||||
},
|
||||
blur:({value})=>{
|
||||
self.obj.etime='';
|
||||
if(value){
|
||||
self.stimeDate=value.split(' ')[0]
|
||||
self.endTimeFlag=false
|
||||
}
|
||||
else{
|
||||
self.endTimeFlag=true
|
||||
blur: ({value}) => {
|
||||
self.obj.etime = '';
|
||||
if (value) {
|
||||
self.stimeDate = value.split(' ')[0]
|
||||
self.endTimeFlag = false
|
||||
} else {
|
||||
self.endTimeFlag = true
|
||||
}
|
||||
},
|
||||
rules: [
|
||||
@@ -368,15 +371,15 @@ export default {
|
||||
placeholder: "请选择任务结束日期",
|
||||
format: "yyyy-MM-dd",
|
||||
valueFormat: "yyyy-MM-dd 23:59:59",
|
||||
disabled:self.endTimeFlag,
|
||||
disabled: self.endTimeFlag,
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
if(!self.obj.stime){
|
||||
if (!self.obj.stime) {
|
||||
return true
|
||||
}
|
||||
if(self.days){
|
||||
if (self.days) {
|
||||
// let mutiply=1000*60*60*24;
|
||||
return !( time.getTime() > Date.now() && (!self.startTime || (time.getTime() > self.startTime )))
|
||||
return !(time.getTime() > Date.now() && (!self.startTime || (time.getTime() > self.startTime)))
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -612,7 +615,7 @@ export default {
|
||||
dicData: this.tradeData,
|
||||
props: {
|
||||
label: "name",
|
||||
value: "id",
|
||||
value: "name",
|
||||
},
|
||||
span: 12,
|
||||
},
|
||||
@@ -727,7 +730,9 @@ export default {
|
||||
wageBlur(e) {
|
||||
const value = e.target.value
|
||||
const val = this.wallMaxAndMin
|
||||
if(!val.length) {return;}
|
||||
if (!val.length) {
|
||||
return;
|
||||
}
|
||||
switch (true) {
|
||||
case this.obj.wage < Math.min(...val):
|
||||
this.obj.wage = Math.min(...val)
|
||||
@@ -741,9 +746,9 @@ export default {
|
||||
let params = {
|
||||
code: `wages_limit_${this.obj.wageUnitCategory}`
|
||||
}
|
||||
const arr = []
|
||||
const arr = []
|
||||
const resData = await getDictionary(params)
|
||||
if(resData.data.code === 200) {
|
||||
if (resData.data.code === 200) {
|
||||
resData.data.data.map((item) => {
|
||||
arr.push(Number(item.dictKey))
|
||||
})
|
||||
@@ -757,130 +762,130 @@ export default {
|
||||
querySearchAsync(queryString, cb) {
|
||||
let results = [];
|
||||
let tradeNameState = this.tradeNameAttr.indexOf(queryString);
|
||||
if(tradeNameState == -1){
|
||||
if (tradeNameState == -1) {
|
||||
this.tradeBtnState = false;
|
||||
}else{
|
||||
} else {
|
||||
this.tradeBtnState = true;
|
||||
}
|
||||
for(let i of this.tradeData){
|
||||
i.value = i.name;
|
||||
}
|
||||
results = queryString ? this.tradeData.filter(this.createStateFilter(queryString)) : this.tradeData;
|
||||
cb(results);
|
||||
},
|
||||
//工种筛选
|
||||
querySearchAsyncWorkType(queryString, cb){
|
||||
for (let i of this.tradeData) {
|
||||
i.value = i.name;
|
||||
}
|
||||
results = queryString ? this.tradeData.filter(this.createStateFilter(queryString)) : this.tradeData;
|
||||
cb(results);
|
||||
},
|
||||
//工种筛选
|
||||
querySearchAsyncWorkType(queryString, cb) {
|
||||
|
||||
let results = [];
|
||||
let workDataNameState = this.workDataNameAttr.indexOf(queryString);
|
||||
if(workDataNameState == -1){
|
||||
this.workTypeBtnState = false;
|
||||
}else{
|
||||
this.workTypeBtnState = true;
|
||||
}
|
||||
for(let i of this.workData){
|
||||
i.value = i.name;
|
||||
}
|
||||
results = queryString ? this.workData.filter(this.createStateFilter(queryString)) : this.workData;
|
||||
cb(results);
|
||||
},
|
||||
createStateFilter(queryString) {
|
||||
return (state) => {
|
||||
return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
|
||||
};
|
||||
},
|
||||
//行业类型
|
||||
handleSelect(item) {
|
||||
console.log('11111111111')
|
||||
console.log(item)
|
||||
this.tradeBtnState = true;
|
||||
this.obj.tradeId = item.id
|
||||
this.obj.tradeNames = item.name
|
||||
},
|
||||
//工种
|
||||
handleSelectWorkType(item){
|
||||
console.log('222222')
|
||||
let results = [];
|
||||
let workDataNameState = this.workDataNameAttr.indexOf(queryString);
|
||||
if (workDataNameState == -1) {
|
||||
this.workTypeBtnState = false;
|
||||
} else {
|
||||
this.workTypeBtnState = true;
|
||||
this.obj.worktypeIds = item.id;
|
||||
console.log(item)
|
||||
},
|
||||
//点击行业类型添加按钮
|
||||
handleIconClick() {
|
||||
this.$message.closeAll();
|
||||
let nameState = this.tradeNameAttr.indexOf(this.tradeState)
|
||||
if(this.tradeState == ""){
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "请输入要添加的行业类型!",
|
||||
})
|
||||
}else if(nameState != -1){
|
||||
}
|
||||
for (let i of this.workData) {
|
||||
i.value = i.name;
|
||||
}
|
||||
results = queryString ? this.workData.filter(this.createStateFilter(queryString)) : this.workData;
|
||||
cb(results);
|
||||
},
|
||||
createStateFilter(queryString) {
|
||||
return (state) => {
|
||||
return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
|
||||
};
|
||||
},
|
||||
//行业类型
|
||||
handleSelect(item) {
|
||||
console.log('11111111111')
|
||||
console.log(item)
|
||||
this.tradeBtnState = true;
|
||||
this.obj.tradeId = item.id
|
||||
this.obj.tradeNames = item.name
|
||||
},
|
||||
//工种
|
||||
handleSelectWorkType(item) {
|
||||
console.log('222222')
|
||||
this.workTypeBtnState = true;
|
||||
this.obj.worktypeIds = item.id;
|
||||
console.log(item)
|
||||
},
|
||||
//点击行业类型添加按钮
|
||||
handleIconClick() {
|
||||
this.$message.closeAll();
|
||||
let nameState = this.tradeNameAttr.indexOf(this.tradeState)
|
||||
if (this.tradeState == "") {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "请输入要添加的行业类型!",
|
||||
})
|
||||
} else if (nameState != -1) {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "此行业类型已存在,请在列表中选择!",
|
||||
})
|
||||
} else {
|
||||
tradeListAdd(this.tradeState).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.obj.tradeId = res.data.data;
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: res.data.msg,
|
||||
})
|
||||
this.tradeBtnState = true;
|
||||
this.initData();
|
||||
this.clearValidator('tradeId');
|
||||
} else {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "此行业类型已存在,请在列表中选择!",
|
||||
})
|
||||
}else{
|
||||
tradeListAdd(this.tradeState).then((res) =>{
|
||||
if(res.data.code == 200){
|
||||
this.obj.tradeId = res.data.data;
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: res.data.msg,
|
||||
})
|
||||
this.tradeBtnState = true;
|
||||
this.initData();
|
||||
this.clearValidator('tradeId');
|
||||
}else{
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: res.data.msg,
|
||||
})
|
||||
}
|
||||
message: res.data.msg,
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
//点击工种添加按钮
|
||||
handleIconClickWorkType() {
|
||||
this.$message.closeAll();
|
||||
let nameState = this.workDataNameAttr.indexOf(this.workTypeState)
|
||||
if(this.workTypeState == ""){
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "请输入要添加的工种!",
|
||||
})
|
||||
}else if(nameState != -1){
|
||||
},
|
||||
//点击工种添加按钮
|
||||
handleIconClickWorkType() {
|
||||
this.$message.closeAll();
|
||||
let nameState = this.workDataNameAttr.indexOf(this.workTypeState)
|
||||
if (this.workTypeState == "") {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "请输入要添加的工种!",
|
||||
})
|
||||
} else if (nameState != -1) {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "此工种已存在,请在列表中选择!",
|
||||
})
|
||||
} else {
|
||||
workListAdd(this.obj.tradeId, this.workTypeState).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.obj.worktypeIds = res.data.data;
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: res.data.msg,
|
||||
})
|
||||
this.workTypeBtnState = true;
|
||||
this.clearValidator('worktypeIds');
|
||||
getWork(this.obj.tradeId).then((res) => {
|
||||
this.workData = res;
|
||||
this.workDataNameAttr = res.map((ele) => {
|
||||
return ele.name
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "此工种已存在,请在列表中选择!",
|
||||
})
|
||||
}else{
|
||||
workListAdd(this.obj.tradeId,this.workTypeState).then((res) =>{
|
||||
if(res.data.code == 200){
|
||||
this.obj.worktypeIds = res.data.data;
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: res.data.msg,
|
||||
})
|
||||
this.workTypeBtnState = true;
|
||||
this.clearValidator('worktypeIds');
|
||||
getWork(this.obj.tradeId).then((res) => {
|
||||
this.workData = res;
|
||||
this.workDataNameAttr = res.map((ele)=>{
|
||||
return ele.name
|
||||
})
|
||||
})
|
||||
}else{
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: res.data.msg,
|
||||
})
|
||||
}
|
||||
message: res.data.msg,
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
//
|
||||
addressDel(){
|
||||
addressDel() {
|
||||
this.obj.address = "";
|
||||
},
|
||||
initData() {
|
||||
@@ -888,10 +893,10 @@ export default {
|
||||
this.loading = true;
|
||||
getTrade(this.userInfo.company_id).then((res) => {
|
||||
this.tradeData = res;
|
||||
this.tradeNameAttr = res.map((ele)=>{
|
||||
this.tradeNameAttr = res.map((ele) => {
|
||||
return ele.name
|
||||
})
|
||||
this.tradeIdAttr = res.map((ele)=>{
|
||||
this.tradeIdAttr = res.map((ele) => {
|
||||
return ele.id
|
||||
})
|
||||
this.loading = false;
|
||||
@@ -914,7 +919,7 @@ export default {
|
||||
ageDesc: "不限年龄",
|
||||
education: 7,
|
||||
experienceDesc: "不限经验",
|
||||
userNature:"灵活用工",
|
||||
userNature: "灵活用工",
|
||||
|
||||
};
|
||||
},
|
||||
@@ -933,156 +938,156 @@ export default {
|
||||
}
|
||||
},
|
||||
submit(row, done) {
|
||||
if(this.$refs.selectMap.addressLocation == ""){
|
||||
if (this.$refs.selectMap.addressLocation == "") {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "请选择详细地址!",
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
row.address = this.$refs.selectMap.addressLocation;
|
||||
// let ids = [];
|
||||
// let name = [];
|
||||
// this.selectedSkills.forEach((ele) => {
|
||||
// ids.push(ele.id);
|
||||
// name.push(ele.name);
|
||||
// });
|
||||
if(this.skillArr && this.skillArr.length > 0) {
|
||||
this.skillArr.forEach(item => {
|
||||
if(item.id == row.workSkills[0]) {
|
||||
row.worktypeNames = item.name
|
||||
if(item.child && item.child.length > 0) {
|
||||
item.child.forEach(item2 => {
|
||||
if(item2.id == row.workSkills[1]) {
|
||||
row.skillNames = item2.name;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if(this.tradeData && this.tradeData.length > 0) {
|
||||
this.tradeData.forEach(item => {
|
||||
if(row.tradeId == item.id) {
|
||||
row.tradeNames = item.name
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (this.type === "add" || this.type === "copy") {
|
||||
this.$jlEvent("trialCheck")
|
||||
.then(() => {
|
||||
add({
|
||||
|
||||
missionTitle: row.missionTitle,
|
||||
stime: row.stime,
|
||||
etime: row.etime,
|
||||
etimePub: row.etimePub,
|
||||
peopleNum: row.peopleNum,
|
||||
wage: row.wage,
|
||||
wageUnitCategory: row.wageUnitCategory,
|
||||
tradeId: row.tradeId,
|
||||
tradeNames: row.tradeNames,
|
||||
worktypeIds: row.workSkills[0],
|
||||
worktypeNames: row.worktypeNames,
|
||||
skillIds: row.workSkills[1],
|
||||
skillNames: row.skillNames,
|
||||
missionDesc: row.missionDesc,
|
||||
userNature: row.userNature,
|
||||
sex: row.sex,
|
||||
ageDesc: row.ageDesc,
|
||||
education: row.education,
|
||||
experienceDesc: row.experienceDesc,
|
||||
missionCompanyName: row.missionCompanyName,
|
||||
missionCompanyScale: row.missionCompanyScale,
|
||||
missionCompanyIndustry: row.missionCompanyIndustry,
|
||||
missionCompanyNature: row.missionCompanyNature,
|
||||
missionCompanyDescription: row.missionCompanyDescription,
|
||||
callName: row.callName,
|
||||
callTel: row.callTel,
|
||||
callNumber: row.callNumber,
|
||||
cityId: row.cityId,
|
||||
address: row.address,
|
||||
lat: row.lat,
|
||||
lon: row.lon,
|
||||
}).then(
|
||||
() => {
|
||||
this.drawer = false;
|
||||
done();
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!",
|
||||
});
|
||||
this.$emit("back");
|
||||
},
|
||||
(error) => {
|
||||
window.console.log(error);
|
||||
done();
|
||||
// let ids = [];
|
||||
// let name = [];
|
||||
// this.selectedSkills.forEach((ele) => {
|
||||
// ids.push(ele.id);
|
||||
// name.push(ele.name);
|
||||
// });
|
||||
if (this.skillArr && this.skillArr.length > 0) {
|
||||
this.skillArr.forEach(item => {
|
||||
if (item.id == row.workSkills[0]) {
|
||||
row.worktypeNames = item.name
|
||||
if (item.child && item.child.length > 0) {
|
||||
item.child.forEach(item2 => {
|
||||
if (item2.id == row.workSkills[1]) {
|
||||
row.skillNames = item2.name;
|
||||
}
|
||||
})
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
done();
|
||||
});
|
||||
} else if (this.type === "edit") {
|
||||
update({
|
||||
id: this.id,
|
||||
missionTitle: row.missionTitle,
|
||||
stime: row.stime,
|
||||
etime: row.etime,
|
||||
etimePub: row.etimePub,
|
||||
peopleNum: row.peopleNum,
|
||||
wage: row.wage,
|
||||
wageUnitCategory: row.wageUnitCategory,
|
||||
tradeId: row.tradeId,
|
||||
tradeNames: row.tradeNames,
|
||||
worktypeIds: row.workSkills[0],
|
||||
worktypeNames: row.worktypeNames,
|
||||
skillIds: row.workSkills[1],
|
||||
skillNames: row.skillNames,
|
||||
missionDesc: row.missionDesc,
|
||||
userNature: row.userNature,
|
||||
sex: row.sex,
|
||||
ageDesc: row.ageDesc,
|
||||
education: row.education,
|
||||
experienceDesc: row.experienceDesc,
|
||||
missionCompanyIndustry: row.missionCompanyIndustry,
|
||||
missionCompanyDescription: row.missionCompanyDescription,
|
||||
callName: row.callName,
|
||||
callTel: row.callTel,
|
||||
callNumber: row.callNumber,
|
||||
cityId: row.cityId,
|
||||
address: row.address,
|
||||
lat: row.lat,
|
||||
lon: row.lon,
|
||||
}).then(
|
||||
() => {
|
||||
this.drawer = false;
|
||||
done();
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!",
|
||||
}
|
||||
|
||||
if (this.tradeData && this.tradeData.length > 0) {
|
||||
this.tradeData.forEach(item => {
|
||||
if (row.tradeId == item.id) {
|
||||
row.tradeNames = item.name
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (this.type === "add" || this.type === "copy") {
|
||||
this.$jlEvent("trialCheck")
|
||||
.then(() => {
|
||||
add({
|
||||
|
||||
missionTitle: row.missionTitle,
|
||||
stime: row.stime,
|
||||
etime: row.etime,
|
||||
etimePub: row.etimePub,
|
||||
peopleNum: row.peopleNum,
|
||||
wage: row.wage,
|
||||
wageUnitCategory: row.wageUnitCategory,
|
||||
tradeId: row.tradeId,
|
||||
tradeNames: row.tradeNames,
|
||||
worktypeIds: row.workSkills[0],
|
||||
worktypeNames: row.worktypeNames,
|
||||
skillIds: row.workSkills[1],
|
||||
skillNames: row.skillNames,
|
||||
missionDesc: row.missionDesc,
|
||||
userNature: row.userNature,
|
||||
sex: row.sex,
|
||||
ageDesc: row.ageDesc,
|
||||
education: row.education,
|
||||
experienceDesc: row.experienceDesc,
|
||||
missionCompanyName: row.missionCompanyName,
|
||||
missionCompanyScale: row.missionCompanyScale,
|
||||
missionCompanyIndustry: row.missionCompanyIndustry,
|
||||
missionCompanyNature: row.missionCompanyNature,
|
||||
missionCompanyDescription: row.missionCompanyDescription,
|
||||
callName: row.callName,
|
||||
callTel: row.callTel,
|
||||
callNumber: row.callNumber,
|
||||
cityId: row.cityId,
|
||||
address: row.address,
|
||||
lat: row.lat,
|
||||
lon: row.lon,
|
||||
}).then(
|
||||
() => {
|
||||
this.drawer = false;
|
||||
done();
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!",
|
||||
});
|
||||
this.$emit("back");
|
||||
},
|
||||
(error) => {
|
||||
window.console.log(error);
|
||||
done();
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
done();
|
||||
});
|
||||
this.$emit("back");
|
||||
},
|
||||
(error) => {
|
||||
window.console.log(error);
|
||||
done();
|
||||
}
|
||||
);
|
||||
}
|
||||
} else if (this.type === "edit") {
|
||||
update({
|
||||
id: this.id,
|
||||
missionTitle: row.missionTitle,
|
||||
stime: row.stime,
|
||||
etime: row.etime,
|
||||
etimePub: row.etimePub,
|
||||
peopleNum: row.peopleNum,
|
||||
wage: row.wage,
|
||||
wageUnitCategory: row.wageUnitCategory,
|
||||
tradeId: row.tradeId,
|
||||
tradeNames: row.tradeNames,
|
||||
worktypeIds: row.workSkills[0],
|
||||
worktypeNames: row.worktypeNames,
|
||||
skillIds: row.workSkills[1],
|
||||
skillNames: row.skillNames,
|
||||
missionDesc: row.missionDesc,
|
||||
userNature: row.userNature,
|
||||
sex: row.sex,
|
||||
ageDesc: row.ageDesc,
|
||||
education: row.education,
|
||||
experienceDesc: row.experienceDesc,
|
||||
missionCompanyIndustry: row.missionCompanyIndustry,
|
||||
missionCompanyDescription: row.missionCompanyDescription,
|
||||
callName: row.callName,
|
||||
callTel: row.callTel,
|
||||
callNumber: row.callNumber,
|
||||
cityId: row.cityId,
|
||||
address: row.address,
|
||||
lat: row.lat,
|
||||
lon: row.lon,
|
||||
}).then(
|
||||
() => {
|
||||
this.drawer = false;
|
||||
done();
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!",
|
||||
});
|
||||
this.$emit("back");
|
||||
},
|
||||
(error) => {
|
||||
window.console.log(error);
|
||||
done();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
clearValidator(val){
|
||||
clearValidator(val) {
|
||||
this.$refs.form.clearValidate(val);
|
||||
},
|
||||
onLoad(row, type) {
|
||||
this.type = type;
|
||||
this.id = row.id;
|
||||
this.$nextTick(() => {
|
||||
if(type!='edit'){
|
||||
if (type != 'edit') {
|
||||
// getLastTaskInfo().then(res=>{
|
||||
// const data=res.data.data;
|
||||
// this.obj.callName=data.callName;
|
||||
@@ -1110,11 +1115,11 @@ export default {
|
||||
ageDesc: "不限年龄",
|
||||
education: 7,
|
||||
experienceDesc: "不限经验",
|
||||
userNature:"灵活用工"
|
||||
userNature: "灵活用工"
|
||||
};
|
||||
this.selectedSkills = [];
|
||||
this.drawer = true;
|
||||
this.$nextTick(() =>{
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.clearValidate();
|
||||
})
|
||||
if (this.$refs.selectMap) {
|
||||
@@ -1123,7 +1128,7 @@ export default {
|
||||
} else if (type === "edit") {
|
||||
this.title = "编辑任务";
|
||||
detail(row.missionNo).then((res) => {
|
||||
if(res.cityId === -1) {
|
||||
if (res.cityId === -1) {
|
||||
res.cityId = ''
|
||||
}
|
||||
this.obj = res;
|
||||
@@ -1139,7 +1144,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@@ -1152,41 +1157,50 @@ export default {
|
||||
.input-with-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.copy-form .el-input-group__append {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.input-with-select .el-input-group__append .el-input__icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.input-with-select .el-input-group__append input {
|
||||
width: 105px;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.my-autocomplete li{
|
||||
.my-autocomplete li {
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
padding: 7px;
|
||||
}
|
||||
.my-autocomplete li .name{
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
.my-autocomplete li .addr{
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
.my-autocomplete li .highlighted .addr{
|
||||
color: #ddd;
|
||||
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
.tradeId .el-autocomplete{
|
||||
width:100%;
|
||||
|
||||
.tradeId .el-autocomplete {
|
||||
width: 100%;
|
||||
}
|
||||
.tradeId .el-icon-plus:before{
|
||||
content: "\e6d9 添加行业类型";
|
||||
color: #606266;
|
||||
|
||||
.tradeId .el-icon-plus:before {
|
||||
content: "\e6d9 添加行业类型";
|
||||
color: #606266;
|
||||
}
|
||||
.tradeId .el-input--small input{
|
||||
|
||||
.tradeId .el-input--small input {
|
||||
padding-right: 150px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user