getList() { | getList() { | ||||
try { | try { | ||||
this.$refs.body.scrollTop = 0; | this.$refs.body.scrollTop = 0; | ||||
} catch (e) { | |||||
console.log(e); | |||||
} | |||||
} catch (e) {} | |||||
this.loading = true; | this.loading = true; | ||||
api | api | ||||
.getList(Object.assign({}, this.searchParams)) | .getList(Object.assign({}, this.searchParams)) | ||||
.then((res) => { | .then((res) => { | ||||
this.dataList = res.data.data; | this.dataList = res.data.data; | ||||
console.log(this.dataList); | |||||
}) | }) | ||||
.catch((e) => { | .catch((e) => { | ||||
this.dataList = []; | this.dataList = []; | ||||
if (valid) { | if (valid) { | ||||
let form = JSON.parse(JSON.stringify(this.form)); | let form = JSON.parse(JSON.stringify(this.form)); | ||||
try { | try { | ||||
console.log(form); | |||||
form.otherDept = form.otherDept.join(","); | form.otherDept = form.otherDept.join(","); | ||||
form.cooperateDept = form.cooperateDept.join(","); | form.cooperateDept = form.cooperateDept.join(","); | ||||
} catch (e) { | } catch (e) { |
methods: { | methods: { | ||||
exportData(data){ | exportData(data){ | ||||
this.loading=true; | this.loading=true; | ||||
api.exportList(Object.assign({sheetName:"链长制配合申请列表"},data)).then(res=>{ | |||||
console.log(res.data.data) | |||||
api.exportList(Object.assign({sheetName:"链长制配合申请列表", isApply: 1},data)).then(res=>{ | |||||
window.open(res.data.data); | window.open(res.data.data); | ||||
this.$message({ | this.$message({ | ||||
type:"success", | type:"success", | ||||
message:"导出成功" | message:"导出成功" | ||||
}) | }) | ||||
}).catch(e=>{ | }).catch(e=>{ | ||||
console.log(e) | |||||
this.$message.error("导出失败") | this.$message.error("导出失败") | ||||
}).finally(()=>{ | }).finally(()=>{ | ||||
this.loading=false; | this.loading=false; | ||||
}); | }); | ||||
}); | }); | ||||
}); | }); | ||||
// console.log(list); | |||||
list = list.filter((item) => { | list = list.filter((item) => { | ||||
return !this.judge(item); | return !this.judge(item); | ||||
}); | }); |
exportData(data){ | exportData(data){ | ||||
this.loading=true; | this.loading=true; | ||||
api.exportList(Object.assign({sheetName:"链长制配合申请审核记录"},data)).then(res=>{ | api.exportList(Object.assign({sheetName:"链长制配合申请审核记录"},data)).then(res=>{ | ||||
console.log(res.data.data) | |||||
window.open(res.data.data); | window.open(res.data.data); | ||||
this.$message({ | this.$message({ | ||||
type:"success", | type:"success", | ||||
message:"导出成功" | message:"导出成功" | ||||
}) | }) | ||||
}).catch(e=>{ | }).catch(e=>{ | ||||
console.log(e) | |||||
this.$message.error("导出失败") | this.$message.error("导出失败") | ||||
}).finally(()=>{ | }).finally(()=>{ | ||||
this.loading=false; | this.loading=false; |
let nameIds = []; | let nameIds = []; | ||||
depts.forEach((dept) => { | depts.forEach((dept) => { | ||||
this.department.forEach((item) => { | this.department.forEach((item) => { | ||||
console.log(item, dept); | |||||
if (item.id == dept) { | if (item.id == dept) { | ||||
nameIds.push(parseInt(item.principal)); | nameIds.push(parseInt(item.principal)); | ||||
} | } | ||||
this.getApi() | this.getApi() | ||||
.addItem(Object.assign({}, form, obj)) | .addItem(Object.assign({}, form, obj)) | ||||
.then((res) => { | .then((res) => { | ||||
console.log(res.data.code); | |||||
if (res.data.code === 0) { | if (res.data.code === 0) { | ||||
this.$message({ | this.$message({ | ||||
type: "success", | type: "success", | ||||
this.getData(); | this.getData(); | ||||
}) | }) | ||||
.catch((e) => { | .catch((e) => { | ||||
console.log(e); | |||||
this.$message.error("删除小项失败"); | this.$message.error("删除小项失败"); | ||||
}) | }) | ||||
.finally(() => { | .finally(() => { |
exportData(data){ | exportData(data){ | ||||
this.loading=true; | this.loading=true; | ||||
api.exportBasicList(Object.assign({sheetName:"基础目标任务细分小条"},data)).then(res=>{ | api.exportBasicList(Object.assign({sheetName:"基础目标任务细分小条"},data)).then(res=>{ | ||||
console.log(res.data.data) | |||||
window.open(res.data.data); | window.open(res.data.data); | ||||
this.$message({ | this.$message({ | ||||
type:"success", | type:"success", | ||||
message:"导出成功" | message:"导出成功" | ||||
}) | }) | ||||
}).catch(e=>{ | }).catch(e=>{ | ||||
console.log(e) | |||||
this.$message.error("导出失败") | this.$message.error("导出失败") | ||||
}).finally(()=>{ | }).finally(()=>{ | ||||
this.loading=false; | this.loading=false; | ||||
}); | }); | ||||
return; | return; | ||||
} | } | ||||
console.log(form[param]); | |||||
if ( | if ( | ||||
form[param] && | form[param] && | ||||
typeof form[param] == "string" && | typeof form[param] == "string" && |
}); | }); | ||||
}) | }) | ||||
.catch((e) => { | .catch((e) => { | ||||
console.log(e); | |||||
this.$message.error("导出失败"); | this.$message.error("导出失败"); | ||||
}) | }) | ||||
.finally(() => { | .finally(() => { | ||||
}); | }); | ||||
return; | return; | ||||
} | } | ||||
console.log(form[param]); | |||||
if ( | if ( | ||||
form[param] && | form[param] && | ||||
typeof form[param] == "string" && | typeof form[param] == "string" && |
}); | }); | ||||
}) | }) | ||||
.catch((e) => { | .catch((e) => { | ||||
console.log(e); | |||||
this.$message.error("导出失败"); | this.$message.error("导出失败"); | ||||
}) | }) | ||||
.finally(() => { | .finally(() => { | ||||
}); | }); | ||||
return; | return; | ||||
} | } | ||||
console.log(form[param]); | |||||
if ( | if ( | ||||
form[param] && | form[param] && | ||||
typeof form[param] == "string" && | typeof form[param] == "string" && |