|
@@ -59,8 +59,10 @@
|
|
|
</el-tabs>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="任务可见性" prop="resource" style="width:700px;" v-if="currType.type ==1">
|
|
|
- <el-tabs :tab-position="tabPosition" v-model="task.resource" style="width: 800px">
|
|
|
+ <el-form-item label="任务可见性" prop="resource" style="width:700px;"
|
|
|
+ v-if="currType.type ==1"
|
|
|
+ required>
|
|
|
+ <el-tabs :tab-position="tabPosition" v-model="task.resource" value='2' style="width: 800px">
|
|
|
<el-tab-pane :label="resourceType[2]" name="2"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-form-item>
|
|
@@ -123,315 +125,316 @@
|
|
|
import {getAllAgencies, getAllServiceTypes, getProvinceNameByProvinceCode, storageGet} from '@/js/index'
|
|
|
|
|
|
export default {
|
|
|
- name: 'Task',
|
|
|
- components: {
|
|
|
- provincecity
|
|
|
- },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- currType:{},
|
|
|
- user: {},
|
|
|
- projectId: 0,
|
|
|
- institutionArray: [],
|
|
|
- tabPosition: 'top',
|
|
|
- resourceType: ResourceType,
|
|
|
- loading: false,
|
|
|
- serviceType: [],
|
|
|
- task: {
|
|
|
- name: '',
|
|
|
- desc: '',
|
|
|
- type: '',
|
|
|
- resource: '0', //如果是广场不用管Location和institution ,定向看institution,区域看location
|
|
|
- // location: {provinceCode: '3200', cityCode: '3201'},
|
|
|
- institution: '',
|
|
|
- datetime: '',
|
|
|
- quotePrice: '',
|
|
|
- fixedPrice: '',
|
|
|
- doc: [],
|
|
|
- requireDocUrl: '',
|
|
|
- participantCount: 1,
|
|
|
- endPoint:{
|
|
|
- serverCode:'',
|
|
|
- }
|
|
|
- },
|
|
|
- pickerOptions: {
|
|
|
- shortcuts: [
|
|
|
- {
|
|
|
- text: '今天',
|
|
|
- onClick (picker) {
|
|
|
- picker.$emit('pick', new Date())
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '昨天',
|
|
|
- onClick (picker) {
|
|
|
- const date = new Date()
|
|
|
- date.setTime(date.getTime() - 3600 * 1000 * 24)
|
|
|
- picker.$emit('pick', date)
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '一周前',
|
|
|
- onClick (picker) {
|
|
|
- const date = new Date()
|
|
|
- date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
|
|
|
- picker.$emit('pick', date)
|
|
|
- }
|
|
|
+ name: 'Task',
|
|
|
+ components: {
|
|
|
+ provincecity
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ currType: {},
|
|
|
+ user: {},
|
|
|
+ projectId: 0,
|
|
|
+ institutionArray: [],
|
|
|
+ tabPosition: 'top',
|
|
|
+ resourceType: ResourceType,
|
|
|
+ loading: false,
|
|
|
+ serviceType: [],
|
|
|
+ task: {
|
|
|
+ name: '',
|
|
|
+ desc: '',
|
|
|
+ type: '',
|
|
|
+ resource: '', //如果是广场不用管Location和institution ,定向看institution,区域看location
|
|
|
+ // location: {provinceCode: '3200', cityCode: '3201'},
|
|
|
+ institution: '',
|
|
|
+ datetime: '',
|
|
|
+ quotePrice: '',
|
|
|
+ fixedPrice: '',
|
|
|
+ doc: [],
|
|
|
+ requireDocUrl: '',
|
|
|
+ participantCount: 1,
|
|
|
+ endPoint: {
|
|
|
+ serverCode: '',
|
|
|
}
|
|
|
- ]
|
|
|
- },
|
|
|
- rules: {
|
|
|
- name: [
|
|
|
- {required: true, message: '请输入任务名称', trigger: 'blur'},
|
|
|
- {min: 5, max: 50, message: '任务名称长度在 5 到 50 个字符', trigger: 'blur'}
|
|
|
- ],
|
|
|
- type: [
|
|
|
- {required: true, message: '测试类型不可为空'},
|
|
|
- ],
|
|
|
- desc: [{required: false, message: '请填写描述', trigger: 'blur'}],
|
|
|
- //price: [{required: true, message: '请填写价格', trigger: 'blur'}],
|
|
|
- quotePrice: [
|
|
|
- {required: true, message: '预算不可为空', trigger: 'blur'},
|
|
|
- {
|
|
|
- validator: (rule, value, callback) => {
|
|
|
- if (parseInt(value) < 0) {
|
|
|
- callback(new Error('请输入不小于0的数'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
+ },
|
|
|
+ pickerOptions: {
|
|
|
+ shortcuts: [
|
|
|
+ {
|
|
|
+ text: '今天',
|
|
|
+ onClick(picker) {
|
|
|
+ picker.$emit('pick', new Date())
|
|
|
}
|
|
|
- }, trigger: 'blur'
|
|
|
- },
|
|
|
- ],
|
|
|
- resource: [
|
|
|
- {required: true},
|
|
|
- {
|
|
|
- validator: (rule, value, callback) => {
|
|
|
- console.log(value)
|
|
|
- if (value == 0 && this.task.institution.id == null) {
|
|
|
- callback(new Error('定向发布至少要选择一个测评机构'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '昨天',
|
|
|
+ onClick(picker) {
|
|
|
+ const date = new Date()
|
|
|
+ date.setTime(date.getTime() - 3600 * 1000 * 24)
|
|
|
+ picker.$emit('pick', date)
|
|
|
}
|
|
|
- }, trigger: 'change'
|
|
|
- },
|
|
|
- ],
|
|
|
- endPoint:[
|
|
|
- {
|
|
|
- validator: (rule, value, callback) => {
|
|
|
- if (this.currType.type=== 1 && this.task.endPoint.serverCode === '') {
|
|
|
- callback(new Error('请填写对应得serverCode'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '一周前',
|
|
|
+ onClick(picker) {
|
|
|
+ const date = new Date()
|
|
|
+ date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
|
|
|
+ picker.$emit('pick', date)
|
|
|
}
|
|
|
- }, trigger: 'change'
|
|
|
- },
|
|
|
- ],
|
|
|
- datetime: [{required: true, message: '截止时间不可为空', trigger: 'blur'}],
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ name: [
|
|
|
+ {required: true, message: '请输入任务名称', trigger: 'blur'},
|
|
|
+ {min: 5, max: 50, message: '任务名称长度在 5 到 50 个字符', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ type: [
|
|
|
+ {required: true, message: '测试类型不可为空'},
|
|
|
+ ],
|
|
|
+ desc: [{required: false, message: '请填写描述', trigger: 'blur'}],
|
|
|
+ //price: [{required: true, message: '请填写价格', trigger: 'blur'}],
|
|
|
+ quotePrice: [
|
|
|
+ {required: true, message: '预算不可为空', trigger: 'blur'},
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (parseInt(value) < 0) {
|
|
|
+ callback(new Error('请输入不小于0的数'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }, trigger: 'blur'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ resource: [
|
|
|
+ {required: true},
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (value == 0 && this.task.institution.id == null) {
|
|
|
+ callback(new Error('定向发布至少要选择一个测评机构'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }, trigger: 'change'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ endPoint: [
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (this.currType.type === 1 && this.task.endPoint.serverCode === '') {
|
|
|
+ callback(new Error('请填写对应得serverCode'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }, trigger: 'change'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ datetime: [{required: true, message: '截止时间不可为空', trigger: 'blur'}],
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- serviceType (val) {
|
|
|
- this.serviceType = val
|
|
|
- },
|
|
|
- institution (val) {
|
|
|
- this.institution = val
|
|
|
},
|
|
|
- // 'task.institution' () {
|
|
|
- // if (this.task.institution) {
|
|
|
- // this.$refs.addFormProvince.resetProviceCity()
|
|
|
- // this.task.location = {provinceCode: '', cityCode: ''}
|
|
|
- // }
|
|
|
- // },
|
|
|
- // 'task.location' () {
|
|
|
- // if (this.task.location.provinceCode || this.task.location.cityCode) {
|
|
|
- // this.task.institution = ''
|
|
|
- // }
|
|
|
- // },
|
|
|
- // 'task.resource' () {
|
|
|
- // if (this.task.resource == '广场') {
|
|
|
- // this.$refs.addFormProvince.resetProviceCity()
|
|
|
- // this.task.institution = ''
|
|
|
- // this.task.location = {provinceCode: '', cityCode: ''}
|
|
|
- // }
|
|
|
- // },
|
|
|
- deep: true
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.init()
|
|
|
- })
|
|
|
- },
|
|
|
- methods: {
|
|
|
- handleTestTypeChange(val){
|
|
|
- let type = this.serviceType.filter((item)=>{
|
|
|
- return item.code === val ;
|
|
|
- });
|
|
|
- this.currType = type[0] ? type[0] : {};
|
|
|
- if(this.currType.type === 0){
|
|
|
- this.task.participantCount = 1
|
|
|
- }
|
|
|
+ watch: {
|
|
|
+ serviceType(val) {
|
|
|
+ this.serviceType = val
|
|
|
+ },
|
|
|
+ institution(val) {
|
|
|
+ this.institution = val
|
|
|
+ },
|
|
|
+ // 'task.institution' () {
|
|
|
+ // if (this.task.institution) {
|
|
|
+ // this.$refs.addFormProvince.resetProviceCity()
|
|
|
+ // this.task.location = {provinceCode: '', cityCode: ''}
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // 'task.location' () {
|
|
|
+ // if (this.task.location.provinceCode || this.task.location.cityCode) {
|
|
|
+ // this.task.institution = ''
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // 'task.resource' () {
|
|
|
+ // if (this.task.resource == '广场') {
|
|
|
+ // this.$refs.addFormProvince.resetProviceCity()
|
|
|
+ // this.task.institution = ''
|
|
|
+ // this.task.location = {provinceCode: '', cityCode: ''}
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ deep: true
|
|
|
},
|
|
|
- init () {
|
|
|
- this.projectId = this.$route.params.projectId
|
|
|
- this.setServiceType()
|
|
|
- this.setInstitutions()
|
|
|
- this.setUserInfo()
|
|
|
+ mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.init()
|
|
|
+ })
|
|
|
},
|
|
|
- updateLocation (location) {
|
|
|
- var provinceName = ''
|
|
|
- var cityName = ''
|
|
|
- for (var item of provinceCityJSON.provinces) {
|
|
|
- if (item.code === location.provinceCode) {
|
|
|
- provinceName = item.name
|
|
|
- for (var city of item.cities) {
|
|
|
- if (city.code === location.cityCode) {
|
|
|
- cityName = city.name
|
|
|
- break
|
|
|
+ methods: {
|
|
|
+ handleTestTypeChange(val) {
|
|
|
+ let type = this.serviceType.filter((item) => {
|
|
|
+ return item.code === val;
|
|
|
+ });
|
|
|
+ this.currType = type[0] ? type[0] : {};
|
|
|
+ if (this.currType.type === 0) {
|
|
|
+ this.task.participantCount = 1
|
|
|
+ }else{
|
|
|
+ this.task.resource = '2'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ init() {
|
|
|
+ this.projectId = this.$route.params.projectId
|
|
|
+ this.setServiceType()
|
|
|
+ this.setInstitutions()
|
|
|
+ this.setUserInfo()
|
|
|
+ },
|
|
|
+ updateLocation(location) {
|
|
|
+ var provinceName = ''
|
|
|
+ var cityName = ''
|
|
|
+ for (var item of provinceCityJSON.provinces) {
|
|
|
+ if (item.code === location.provinceCode) {
|
|
|
+ provinceName = item.name
|
|
|
+ for (var city of item.cities) {
|
|
|
+ if (city.code === location.cityCode) {
|
|
|
+ cityName = city.name
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- return provinceName + ' / ' + cityName
|
|
|
- },
|
|
|
- submitForm (formName) {
|
|
|
- this.$refs['task'].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.showLoading()
|
|
|
- const newTask = {
|
|
|
- name: this.task.name,
|
|
|
- desc: this.task.desc,
|
|
|
- type: this.task.type,
|
|
|
- resource: this.task.resource,
|
|
|
- // location: this.task.resource == '0' ? getProvinceNameByProvinceCode(this.task.location.provinceCode, this.task.location.cityCode):null,
|
|
|
- institution: this.task.resource == '0' ? this.task.institution.id : null,
|
|
|
- datetime: this.task.datetime,
|
|
|
- quotePrice: this.task.quotePrice,
|
|
|
- fixedPrice: this.task.fixedPrice,
|
|
|
- requirementFile: this.task.requireDocUrl,
|
|
|
- participantCount: this.task.participantCount,
|
|
|
- endPoint:this.task.endPoint
|
|
|
+ return provinceName + ' / ' + cityName
|
|
|
+ },
|
|
|
+ submitForm(formName) {
|
|
|
+ this.$refs['task'].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.showLoading()
|
|
|
+ const newTask = {
|
|
|
+ name: this.task.name,
|
|
|
+ desc: this.task.desc,
|
|
|
+ type: this.task.type,
|
|
|
+ resource: this.task.resource,
|
|
|
+ // location: this.task.resource == '0' ? getProvinceNameByProvinceCode(this.task.location.provinceCode, this.task.location.cityCode):null,
|
|
|
+ institution: this.task.resource == '0' ? this.task.institution.id : null,
|
|
|
+ datetime: this.task.datetime,
|
|
|
+ quotePrice: this.task.quotePrice,
|
|
|
+ fixedPrice: this.task.fixedPrice,
|
|
|
+ requirementFile: this.task.requireDocUrl,
|
|
|
+ participantCount: this.task.participantCount,
|
|
|
+ endPoint: this.task.endPoint
|
|
|
+ }
|
|
|
+ Http.post(Apis.TASK.CREATE_TASK.replace('{projectId}', this.projectId), newTask).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ this.hideLoading()
|
|
|
+ this.createTaskSuccess(res.crowdTaskVO.id)
|
|
|
+ }).catch((error) => {
|
|
|
+ console.log(error)
|
|
|
+ this.hideLoading()
|
|
|
+ notify('error', error.data)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ notify('error', '表单填写有误!')
|
|
|
+ return false
|
|
|
}
|
|
|
- Http.post(Apis.TASK.CREATE_TASK.replace('{projectId}', this.projectId), newTask).then((res) => {
|
|
|
- console.log(res)
|
|
|
- this.hideLoading()
|
|
|
- this.createTaskSuccess(res.crowdTaskVO.id)
|
|
|
- }).catch((error) => {
|
|
|
- console.log(error)
|
|
|
- this.hideLoading()
|
|
|
- notify('error', error.data)
|
|
|
- })
|
|
|
- } else {
|
|
|
- notify('error', '表单填写有误!')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ resetForm(formName) {
|
|
|
+ this.$refs.addFormProvince.resetProviceCity()
|
|
|
+ this.$refs[formName].resetFields()
|
|
|
+ this.task.name = ''
|
|
|
+ this.task.desc = ''
|
|
|
+ this.task.type = ''
|
|
|
+ this.task.resource = '广场'; //如果是广场不用管Location和institution ,定向看institution,区域看location
|
|
|
+ (this.task.location = {provinceCode: '', cityCode: ''}),
|
|
|
+ (this.task.institution = '')
|
|
|
+ this.task.datetime = '',
|
|
|
+ this.task.participantCount = 1
|
|
|
+ },
|
|
|
+ locationChange(provinceId, cityId) {
|
|
|
+ if (provinceId || cityId) {
|
|
|
+ this.task.location = {provinceCode: provinceId, cityCode: cityId}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ cancelCreate() {
|
|
|
+ if (window.history.length <= 1) {
|
|
|
+ this.$router.push({path: '/'})
|
|
|
return false
|
|
|
+ } else {
|
|
|
+ this.$router.go(-1)
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- resetForm (formName) {
|
|
|
- this.$refs.addFormProvince.resetProviceCity()
|
|
|
- this.$refs[formName].resetFields()
|
|
|
- this.task.name = ''
|
|
|
- this.task.desc = ''
|
|
|
- this.task.type = ''
|
|
|
- this.task.resource = '广场'; //如果是广场不用管Location和institution ,定向看institution,区域看location
|
|
|
- (this.task.location = {provinceCode: '', cityCode: ''}),
|
|
|
- (this.task.institution = '')
|
|
|
- this.task.datetime = '',
|
|
|
- this.task.participantCount = 1
|
|
|
- },
|
|
|
- locationChange (provinceId, cityId) {
|
|
|
- if (provinceId || cityId) {
|
|
|
- this.task.location = {provinceCode: provinceId, cityCode: cityId}
|
|
|
- }
|
|
|
- },
|
|
|
- cancelCreate () {
|
|
|
- if (window.history.length <= 1) {
|
|
|
- this.$router.push({path: '/'})
|
|
|
- return false
|
|
|
- } else {
|
|
|
- this.$router.go(-1)
|
|
|
- }
|
|
|
- },
|
|
|
- handleRemove (file, fileList) {
|
|
|
- console.log(file, fileList)
|
|
|
- },
|
|
|
- handleExceed (files, fileList) {
|
|
|
- this.$message.warning(
|
|
|
- `当前限制选择 1 个文件,本次选择了 ${
|
|
|
- files.length
|
|
|
- } 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
|
|
- )
|
|
|
- },
|
|
|
- beforeRemove (file, fileList) {
|
|
|
- //return this.$confirm(`确定移除 ${file.name}?`)
|
|
|
- },
|
|
|
- beforeFileUpload (file) {
|
|
|
- console.log(file)
|
|
|
- const isPDF = file.type === 'application/pdf'
|
|
|
- const isDOC = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
|
|
- const isEXCEL = file.type === 'application/vnd.ms-excel'
|
|
|
- const isXLS = file.type === 'application/x-xls'
|
|
|
- const isTXT = file.type === 'text/plain'
|
|
|
- const isXLSX = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
- //console.log(file)
|
|
|
- if (!(isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX)) {
|
|
|
- this.$message.error('上传文件只能是 PDF 、 DOC 、DOCX 、XLS、TXT、XLSX 格式!')
|
|
|
- }
|
|
|
- return isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX
|
|
|
- },
|
|
|
- uploadRequireDoc (param) {
|
|
|
- this.showLoading()
|
|
|
- const formData = new FormData()
|
|
|
- let config = {
|
|
|
- //添加请求头
|
|
|
- headers: {'Content-Type': 'multipart/form-data'},
|
|
|
- }
|
|
|
- formData.append('file', param.file)
|
|
|
- Http.upload(Apis.FILE.REQUIREMENT_FILE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
|
|
|
- this.hideLoading()
|
|
|
- notify('success', '上传成功')
|
|
|
- this.task.requireDocUrl = res.data
|
|
|
- console.log(res.data)
|
|
|
- }).catch((error) => {
|
|
|
- this.hideLoading()
|
|
|
- notify('error', '上传失败:' + error.data)
|
|
|
- })
|
|
|
- },
|
|
|
- setServiceType () {
|
|
|
+ },
|
|
|
+ handleRemove(file, fileList) {
|
|
|
+ console.log(file, fileList)
|
|
|
+ },
|
|
|
+ handleExceed(files, fileList) {
|
|
|
+ this.$message.warning(
|
|
|
+ `当前限制选择 1 个文件,本次选择了 ${
|
|
|
+ files.length
|
|
|
+ } 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
|
|
+ )
|
|
|
+ },
|
|
|
+ beforeRemove(file, fileList) {
|
|
|
+ //return this.$confirm(`确定移除 ${file.name}?`)
|
|
|
+ },
|
|
|
+ beforeFileUpload(file) {
|
|
|
+ console.log(file)
|
|
|
+ const isPDF = file.type === 'application/pdf'
|
|
|
+ const isDOC = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
|
|
+ const isEXCEL = file.type === 'application/vnd.ms-excel'
|
|
|
+ const isXLS = file.type === 'application/x-xls'
|
|
|
+ const isTXT = file.type === 'text/plain'
|
|
|
+ const isXLSX = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
+ //console.log(file)
|
|
|
+ if (!(isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX)) {
|
|
|
+ this.$message.error('上传文件只能是 PDF 、 DOC 、DOCX 、XLS、TXT、XLSX 格式!')
|
|
|
+ }
|
|
|
+ return isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX
|
|
|
+ },
|
|
|
+ uploadRequireDoc(param) {
|
|
|
+ this.showLoading()
|
|
|
+ const formData = new FormData()
|
|
|
+ let config = {
|
|
|
+ //添加请求头
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'},
|
|
|
+ }
|
|
|
+ formData.append('file', param.file)
|
|
|
+ Http.upload(Apis.FILE.REQUIREMENT_FILE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
|
|
|
+ this.hideLoading()
|
|
|
+ notify('success', '上传成功')
|
|
|
+ this.task.requireDocUrl = res.data
|
|
|
+ console.log(res.data)
|
|
|
+ }).catch((error) => {
|
|
|
+ this.hideLoading()
|
|
|
+ notify('error', '上传失败:' + error.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setServiceType() {
|
|
|
getAllServiceTypes().then((res) => {
|
|
|
- this.serviceType = res
|
|
|
+ this.serviceType = res
|
|
|
})
|
|
|
- },
|
|
|
- setInstitutions () {
|
|
|
- getAllAgencies().then((res) => {
|
|
|
- this.institutionArray = res
|
|
|
- console.log(this.institutionArray)
|
|
|
- }).catch((error) => {
|
|
|
- notify('error', '测评机构加载失败')
|
|
|
- })
|
|
|
- },
|
|
|
- setUserInfo () {
|
|
|
- this.user = storageGet('user')
|
|
|
- },
|
|
|
- createTaskSuccess (taskId) {
|
|
|
- this.$alert('任务创建成功', '创建成功', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- callback: action => {
|
|
|
- this.$router.push({
|
|
|
- name: 'Task',
|
|
|
- params: {projectId: this.projectId, taskId: taskId}
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- showLoading () {
|
|
|
- this.loading = true
|
|
|
- },
|
|
|
- hideLoading () {
|
|
|
- this.loading = false
|
|
|
+ },
|
|
|
+ setInstitutions() {
|
|
|
+ getAllAgencies().then((res) => {
|
|
|
+ this.institutionArray = res
|
|
|
+ console.log(this.institutionArray)
|
|
|
+ }).catch((error) => {
|
|
|
+ notify('error', '测评机构加载失败')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setUserInfo() {
|
|
|
+ this.user = storageGet('user')
|
|
|
+ },
|
|
|
+ createTaskSuccess(taskId) {
|
|
|
+ this.$alert('任务创建成功', '创建成功', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ callback: action => {
|
|
|
+ this.$router.push({
|
|
|
+ name: 'Task',
|
|
|
+ params: {projectId: this.projectId, taskId: taskId}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showLoading() {
|
|
|
+ this.loading = true
|
|
|
+ },
|
|
|
+ hideLoading() {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|