Merge remote-tracking branch 'origin/dev_20230216' into dev_20230216

This commit is contained in:
gaojiabao
2023-04-19 09:35:40 +08:00
6 changed files with 106 additions and 31 deletions
+49 -1
View File
@@ -536,5 +536,53 @@ export default {
}).catch(err => {
exeFun.call(this, err)
})
}
},
_getData (url, params, config = {}) {
return new Promise((resolve,reject)=>{
// 参数包含this
let _this = config._this || false
// 参数包含loading
let loading = config.loading || false
if (_this && loading) {
_this[loading] = true
}
_axios.get(api() + url + '?_t=' + new Date().getTime(), { params }).then(res => {
resolve(res.data)
}).catch(err => {
reject(err)
}).finally(()=>{
if (_this && loading) { _this[loading] = false }
})
})
},
_postData (url, param, config = {}) {
return new Promise((resolve,reject) => {
var _formData = formData(param)
// 参数包含this
let _this = config._this || false
// 参数包含loading
let loading = config.loading || false
// 是否显示操作提示
let showTips = config.showTips === undefined ? true : config.showTips
if (_this && loading) { _this[loading] = true }
_axios.post(api() + url + '?' + new Date().getTime(), _formData).then(res => {
if (res.data.ok !== undefined && showTips) {
let type = res.data.ok ? 'success' : 'warning'
if (_this && res.data.message !== '' && res.data.message !== null) {
Message[type](res.data.message)
}
}
resolve(res.data)
}).catch(err => {
reject(err)
}).finally(()=>{
if (_this && loading) { _this[loading] = false }
})
})
},
}
+10
View File
@@ -32,6 +32,16 @@ export default {
callback()
}
},
validateStandardItem2 (rule, value, callback) {
// return callback()
let testval = /^[A-Za-z0-9/]+$/
let testval1 = /[.-;]+/
if (value && !value.match(testval) && !value.match(testval1)) {
return callback(new Error('只能为(字母、数字、.、-、;、;)'))
} else {
callback()
}
},
/**
* 验证字母、数字、.、-的正则且不能重复
+25 -16
View File
@@ -124,26 +124,35 @@ export default {
},
methods: {
getDate(){
this.loading = true
// this.loading = true
let form = this.form
form.userId = this.$store.getters.userInfo.account
form.pageSize = this.pageSize
form.page = this.currentPage
return new Promise((resolve,reject)=>{
this.$http.get('lawss/AskQuestions/getAskQuestionsPage', form, {_this: this }, res => {
if(res.data){
const data = res.data
this.data = data.records
this.total = data.total
this.currentPage = data.current
this.pageSize = data.size
}
this.loading = false
resolve(res)
}, e => {
this.loading = false
reject(e)
})
// return new Promise((resolve,reject)=>{
// this.$http.get('lawss/AskQuestions/getAskQuestionsPage', form, {_this: this }, res => {
// if(res.data){
// const data = res.data
// this.data = data.records
// this.total = data.total
// this.currentPage = data.current
// this.pageSize = data.size
// }
// this.loading = false
// resolve(res)
// }, e => {
// this.loading = false
// reject(e)
// })
// })
this.$http._getData('lawss/AskQuestions/getAskQuestionsPage', form, {_this: this, loading: 'loading' }).then(res => {
if(res.data){
const data = res.data
this.data = data.records
this.total = data.total
this.currentPage = data.current
this.pageSize = data.size
}
})
},
onSubmit(){
+18 -11
View File
@@ -1984,17 +1984,24 @@ export default {
{
_this: this
}, val => {
this.$http.post('lawss/activiti/completeTask',{
taskIds: val.data,
userId : this.$store.getters.userInfo.userId,
json: JSON.stringify(res.data),
},
{
_this: this
}, res => {
this.submitGetData();
}, e => {
})
// this.$http.post('lawss/activiti/completeTask',{
// taskIds: val.data,
// userId : this.$store.getters.userInfo.userId,
// json: JSON.stringify(res.data),
// },
// {
// _this: this
// }, res => {
// this.submitGetData();
// }, e => {
// })
this.$http._postData('lawss/activiti/completeTask',{
taskIds: val.data,
userId : this.$store.getters.userInfo.userId,
json: JSON.stringify(res.data),
}).then(res => {
this.submitGetData();
})
}, e => {
})
}, e => {
@@ -129,8 +129,9 @@ export default {
},
methods: {
getPrcNameFilter(row){
if(row && row.prcType === 'buss3'){
return row.prcName
if(row && row.prcType === '25' && row.taskInfo === '技术标准起草'){
let _index = row.prcName.lastIndexOf('-')
return row.prcName.slice(0 , _index + 1) + '企标制修订'
}else {
return row.prcName
}
@@ -2844,7 +2844,7 @@ export default {
standNumber: [
{required: true, type: 'string', message: '标准编号不能为空', trigger: 'change'},
{type: 'string', max: 100, message: '标准编号不能超过100个字符', trigger: 'change'},
{type: 'string', validator: this.verify.validateStandardItem, trigger: 'change'}
{type: 'string', validator: this.verify.validateStandardItem2, trigger: 'change'}
],
synopsis: [
{type: 'string', max: 500, message: '文本说明不能超过500个字符', trigger: 'change'}