|
@@ -258,6 +258,7 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //初始化
|
|
init () {
|
|
init () {
|
|
this.setServiceTypes()
|
|
this.setServiceTypes()
|
|
this.setResourceTypes()
|
|
this.setResourceTypes()
|
|
@@ -265,9 +266,11 @@ export default {
|
|
//加载数据
|
|
//加载数据
|
|
loadData: function () {
|
|
loadData: function () {
|
|
},
|
|
},
|
|
|
|
+ //表单进入可编辑状态,可修改表单,不再使用
|
|
modifyInfo () {
|
|
modifyInfo () {
|
|
this.isModifyMode = true
|
|
this.isModifyMode = true
|
|
},
|
|
},
|
|
|
|
+ //提交表单
|
|
submitInfo () {
|
|
submitInfo () {
|
|
//this.showDialog()
|
|
//this.showDialog()
|
|
const newAgency = {
|
|
const newAgency = {
|
|
@@ -292,12 +295,15 @@ export default {
|
|
notify('error', error.data.msg)
|
|
notify('error', error.data.msg)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ //取消修改表单,表单进入不可编辑状态,不再使用
|
|
cancelModify () {
|
|
cancelModify () {
|
|
this.isModifyMode = false
|
|
this.isModifyMode = false
|
|
},
|
|
},
|
|
|
|
+ //上传文件时移除文件的响应函数
|
|
handleRemove (file, fileList) {
|
|
handleRemove (file, fileList) {
|
|
console.log(file, fileList)
|
|
console.log(file, fileList)
|
|
},
|
|
},
|
|
|
|
+ //添加文件时的响应函数
|
|
handleExceed (files, fileList) {
|
|
handleExceed (files, fileList) {
|
|
this.$message.warning(
|
|
this.$message.warning(
|
|
`当前限制选择 1 个文件,本次选择了 ${
|
|
`当前限制选择 1 个文件,本次选择了 ${
|
|
@@ -305,11 +311,14 @@ export default {
|
|
} 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
|
} 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
|
)
|
|
)
|
|
},
|
|
},
|
|
|
|
+ //移除文件前的响应函数
|
|
beforeRemove (file, fileList) {
|
|
beforeRemove (file, fileList) {
|
|
return this.$confirm(`确定移除 ${file.name}?`)
|
|
return this.$confirm(`确定移除 ${file.name}?`)
|
|
},
|
|
},
|
|
|
|
+ //文件上传前的响应函数
|
|
beforeFileUpload () {
|
|
beforeFileUpload () {
|
|
},
|
|
},
|
|
|
|
+ //上传文件,此处为上传图片
|
|
uploadFile (param) {
|
|
uploadFile (param) {
|
|
const formData = new FormData()
|
|
const formData = new FormData()
|
|
let config = {
|
|
let config = {
|
|
@@ -327,6 +336,7 @@ export default {
|
|
notify('error', error.data.msg)
|
|
notify('error', error.data.msg)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ //关闭对话框时的响应函数
|
|
handleDialogClose (done) {
|
|
handleDialogClose (done) {
|
|
this.$confirm('确认退出?退出前请记录下登录账号和密码,否则无法找回!!!')
|
|
this.$confirm('确认退出?退出前请记录下登录账号和密码,否则无法找回!!!')
|
|
.then(_ => {
|
|
.then(_ => {
|
|
@@ -336,13 +346,16 @@ export default {
|
|
.catch(_ => {
|
|
.catch(_ => {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ //弹出对话框
|
|
showDialog () {
|
|
showDialog () {
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
},
|
|
},
|
|
|
|
+ //隐藏对话框
|
|
hideDialog () {
|
|
hideDialog () {
|
|
this.dialogVisible = false
|
|
this.dialogVisible = false
|
|
this.resetForm()
|
|
this.resetForm()
|
|
},
|
|
},
|
|
|
|
+ //TODO 跳转到登录页面
|
|
toLogin () {
|
|
toLogin () {
|
|
this.hideDialog()
|
|
this.hideDialog()
|
|
this.$router.push({
|
|
this.$router.push({
|
|
@@ -350,6 +363,7 @@ export default {
|
|
// params: {projectId: projectId, taskId: taskId}
|
|
// params: {projectId: projectId, taskId: taskId}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ //重置表单
|
|
resetForm () {
|
|
resetForm () {
|
|
this.agency = {
|
|
this.agency = {
|
|
mobile: '',
|
|
mobile: '',
|
|
@@ -365,9 +379,11 @@ export default {
|
|
username: '',
|
|
username: '',
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //设置服务类型
|
|
setServiceTypes () {
|
|
setServiceTypes () {
|
|
this.serviceTypes = getAllAbilities()
|
|
this.serviceTypes = getAllAbilities()
|
|
},
|
|
},
|
|
|
|
+ //添加一项测评机构资源
|
|
addAgencyResource () {
|
|
addAgencyResource () {
|
|
const tmpResource = {
|
|
const tmpResource = {
|
|
id: this.agency.resource.length,
|
|
id: this.agency.resource.length,
|
|
@@ -378,15 +394,18 @@ export default {
|
|
}
|
|
}
|
|
this.agency.resource.push(tmpResource)
|
|
this.agency.resource.push(tmpResource)
|
|
},
|
|
},
|
|
|
|
+ //删除一项测评机构资源
|
|
removeAgencyResource (id) {
|
|
removeAgencyResource (id) {
|
|
this.agency.resource.splice(id, 1)
|
|
this.agency.resource.splice(id, 1)
|
|
for (var i = 0; i < this.agency.resource.length; i++) {
|
|
for (var i = 0; i < this.agency.resource.length; i++) {
|
|
this.agency.resource[i].id = i
|
|
this.agency.resource[i].id = i
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //设置测评机构资源类型
|
|
setResourceTypes () {
|
|
setResourceTypes () {
|
|
this.resourceTypes = getAllAgencyResourceTypes()
|
|
this.resourceTypes = getAllAgencyResourceTypes()
|
|
},
|
|
},
|
|
|
|
+ //检测测评机构资源填写是否有效
|
|
checkAgencyResourceVaild () {
|
|
checkAgencyResourceVaild () {
|
|
if (this.agency.resource.length === 0) {
|
|
if (this.agency.resource.length === 0) {
|
|
return true
|
|
return true
|