flat: 暂存

This commit is contained in:
Apcallover
2024-03-24 23:37:45 +08:00
parent 427a9a75d6
commit 08e87225d6
3 changed files with 38 additions and 16 deletions

View File

@@ -114,7 +114,7 @@ export default {
column: [
{
label: "公司名称",
prop: "companyName",
prop: "comname",
search: true,
display: false,
},
@@ -166,7 +166,7 @@ export default {
span: 12,
display: true,
size: "small",
prop: "companyName",
prop: "comname",
rules: [
{
required: true,

View File

@@ -201,6 +201,7 @@ export default {
days:null,//某个月份的天数
endTimeFlag:true,
stimeDate:null,
workTypesNameList: [],
};
},
components: {
@@ -544,9 +545,7 @@ export default {
search: true,
display: true,
dicUrl: `/api/jobslink-api/tenant/worktypes/base/list?type=2`,
dicFormatter: (res) => {
return res.data; //返回字典的层级结构
},
dicFormatter: this.workSkillList,
props: {
label: "name",
value: "id",
@@ -843,6 +842,20 @@ export default {
},
},
methods: {
workSkillList(res) {
this.workTypesNameList = res.data
const Deliver = (children, obj = {}) => {
children.forEach((item) => {
obj[item.id] = item.name
if (item.child) {
return Deliver(item.child, obj)
}
})
return obj
}
this.workTypesNameObj = Deliver(res.data)
return res.data
},
//过滤行业类型
querySearchAsync(queryString, cb) {
let results = [];
@@ -1021,12 +1034,12 @@ export default {
},
submit(row, done) {
if(this.$refs.selectMap.addressLocation == ""){
this.$message({
return this.$message({
type: "error",
message: "请选择详细地址!",
});
}else{
row.address = this.$refs.selectMap.addressLocation;
}
row.address = this.$refs.selectMap.addressLocation;
// let ids = [];
// let name = [];
// this.selectedSkills.forEach((ele) => {
@@ -1057,7 +1070,11 @@ export default {
}
})
}
const copy = JSON.parse(JSON.stringify(row))
row.worktypeIds = copy.workSkills.join(',')
row.worktypeNames = copy.workSkills.map((id) => this.workTypesNameObj[id]).join(',')
console.log(row)
// 修改原数据workSkills
if (this.type === "add" || this.type === "copy") {
this.$jlEvent("trialCheck")
.then(() => {
@@ -1072,7 +1089,7 @@ export default {
wageUnitCategory: row.wageUnitCategory,
tradeId: row.tradeId,
tradeNames: row.tradeNames,
worktypeIds: row.workSkills[0],
worktypeIds: row.workSkills,
worktypeNames: row.worktypeNames,
skillIds: row.workSkills[1],
skillNames: row.skillNames,
@@ -1125,7 +1142,7 @@ export default {
wageUnitCategory: row.wageUnitCategory,
tradeId: row.tradeId,
tradeNames: row.tradeNames,
worktypeIds: row.workSkills[0],
worktypeIds: row.worktypeIds,
worktypeNames: row.worktypeNames,
skillIds: row.workSkills[1],
skillNames: row.skillNames,
@@ -1158,7 +1175,6 @@ export default {
}
);
}
}
},
clearValidator(val){
@@ -1266,9 +1282,12 @@ export default {
this.title = "编辑岗位";
detail(row.id).then((res) => {
this.obj = res;
this.obj.workSkills = []
this.obj.workSkills.push(res.worktypeIds)
this.obj.workSkills.push(res.skillIds)
// this.obj.workSkills = []
// console.log(res.worktypeIds)
this.obj.workSkills = res.worktypeIds.split(',')
console.log(res, this.obj)
// this.obj.workSkills.push(res.worktypeIds)
// this.obj.workSkills.push(res.skillIds)
this.drawer = true;
// let tradeIdState = this.tradeIdAttr.indexOf(this.obj.tradeId);
//判断有无此行业