|
|
@@ -557,21 +557,21 @@ export default {
|
|
|
data () {
|
|
|
var checkWorkerTotal = (rule, value, callback) => {
|
|
|
if (value <= 0) {
|
|
|
- return callback(new Error('企业员工总数必须大于0'))
|
|
|
+ callback(new Error('企业员工总数必须大于0'))
|
|
|
} else {
|
|
|
callback()
|
|
|
}
|
|
|
}
|
|
|
var checkTechnicalNum = (rule, value, callback) => {
|
|
|
if (value <= 0) {
|
|
|
- return callback(new Error('技术、管理人员数量必须大于0'))
|
|
|
+ callback(new Error('技术、管理人员数量必须大于0'))
|
|
|
} else {
|
|
|
callback()
|
|
|
}
|
|
|
}
|
|
|
var checkSkillerTotal = (rule, value, callback) => {
|
|
|
if (value <= 0) {
|
|
|
- return callback(new Error('技术工人总数必须大于0'))
|
|
|
+ callback(new Error('技术工人总数必须大于0'))
|
|
|
} else {
|
|
|
callback()
|
|
|
}
|
|
|
@@ -1212,8 +1212,57 @@ export default {
|
|
|
if (this.formDataCert.Status <= 0 && this.activeName === '0') {
|
|
|
valid = this.saveEntity()
|
|
|
} else if (this.formDataCert.Status <= 0 && this.activeName === '1') {
|
|
|
- valid = this.updateNumberEntity()
|
|
|
- valid = true// 没办法中的办法
|
|
|
+ // valid = this.updateNumberEntity()
|
|
|
+ // valid = true// 没办法中的办法
|
|
|
+ if (this.formDataCert.WorkerTotal <= 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '企业员工总数必须大于0'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.formDataCert.TechnicalNum <= 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '技术、管理人员数量必须大于0'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.formDataCert.SkillerTotal <= 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '技术工人总数必须大于0'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.CheckCompanyBase()) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.formDataCert.InStyle = this.formData.InStyle
|
|
|
+ api
|
|
|
+ .updateNumberEntity(
|
|
|
+ this.formData.Id + '_' + this.certId,
|
|
|
+ this.formDataCert,
|
|
|
+ this.$axios
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ // 保存成功后,初始化数据,变成修改
|
|
|
+ this.initDatas()
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
}
|
|
|
if (!valid) {
|
|
|
return false
|