Parcourir la source

bug修改

Signed-off-by: lijunqing <lijunqing@dashoo.cn>
lijunqing il y a 6 ans
Parent
commit
09c0b50040

+ 54 - 5
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/basisedit.vue

@@ -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

+ 54 - 5
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -555,21 +555,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()
       }
@@ -1262,8 +1262,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

+ 54 - 5
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/techedit.vue

@@ -550,21 +550,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()
       }
@@ -1262,8 +1262,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