2
3
Prechádzať zdrojové kódy

准入申请:提交审批前先保存一遍现有信息

baichengfei 5 rokov pred
rodič
commit
fd086d70a4

+ 0 - 1
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist2.vue

@@ -346,7 +346,6 @@
           _currentPage: 1,
           _size: 10000
         }
-        console.log('传入的参数', params)
         _this.$axios.get('supplierfile/filelist', {
           params
         })

+ 171 - 8
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/basisedit.vue

@@ -432,7 +432,7 @@
                    @click="dialogVisible = false">取 消</el-button>
         <el-button size="mini"
                    type="primary"
-                   @click="AuditEntity" :loading="loading">确定</el-button>
+                   @click="secondaryUnitSubmitApply" :loading="loading">确定</el-button>
       </span>
     </el-dialog>
     <el-dialog title="提交"
@@ -474,7 +474,7 @@
                    @click="dialogVisibleCom = false">取 消</el-button>
         <el-button size="mini"
                    type="primary"
-                   @click="SubpEntity" :loading="loading">确定</el-button>
+                   @click="companySubmitToSecUnitSeparateMakeSure" :loading="loading">确定</el-button>
       </span>
     </el-dialog>
 
@@ -590,7 +590,7 @@ export default {
       UnitOrgOptions: [],
       UnitOrg: '',
       allorgunitOptions: [],
-      selectDept: 0,
+      selectDept: 100000151,
       userOptions: [],
       dialogVisible: false,
       dialogVisibleCom: false,
@@ -1403,7 +1403,7 @@ export default {
      }, */
 
     // 保存信息
-    saveEntity () {
+    saveEntity (val) {
       let valid1 = false
       let valid2 = false
       this.$refs['BasisInfo'].$refs['EntityForm'].validate((valid) => {
@@ -1423,9 +1423,17 @@ export default {
         // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
         this.formData.RegCapital = parseFloat(this.formData.RegCapital)
         if (!this.formData.Id || !this.certId) {
-          this.addEntity()
+          if (val === 1) {
+            this.addEntityNoInfo()
+          } else {
+            this.addEntity()
+          }
         } else {
-          this.updateEntity()
+          if (val === 1) {
+            this.updateEntityNoInfo()
+          } else {
+            this.updateEntity()
+          }
         }
         return true
       } else {
@@ -1461,6 +1469,41 @@ export default {
         console.error(err)
       })
     },
+    addEntityNoInfo () {
+      this.formData.SupplierTypeCode = '02'
+      this.formData.SupplierTypeName = '基建类'
+      api.addEntity(this.formData, this.$axios).then(res => {
+        if (res.data.code === 0) {
+          // 保存成功后,初始化数据,变成修改
+          this.formData.Id = res.data.item.split('_')[0]
+          this.certId = res.data.item.split('_')[1]
+          this.initDatas()
+        } else {
+          this.$message({
+            type: 'warning',
+            message: res.data.message
+          })
+        }
+      }).catch(err => {
+        console.error(err)
+      })
+    },
+    updateEntityNoInfo () {
+      api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
+        if (res.data.code === 0) {
+          // 更新子表
+          // this.updateNumberEntity()
+          this.initDatas()
+        } else {
+          this.$message({
+            type: 'warning',
+            message: res.data.message
+          })
+        }
+      }).catch(err => {
+        console.error(err)
+      })
+    },
 
     updateEntity () {
       api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
@@ -1531,6 +1574,32 @@ export default {
         }
       })
     },
+    updateNumberEntityNoInfo () {
+      this.$refs['EntityFormNumber'].validate((valid) => {
+        if (valid) {
+          if (!this.CheckCompanyBase()) {
+            return false
+          }
+          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()
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            }).catch(err => {
+            console.error(err)
+          })
+        } else {
+          return false
+        }
+      })
+    },
     getFirAuditerByDept () {
       let deptId = this.authUser.Profile.DepartmentId
       this.userOptions = []
@@ -1557,8 +1626,9 @@ export default {
       this.chooseAuditorVisible = true
     },
     commitAudit () {
-      console.log(this.formData)
-      apiCert.checkSupplierCertCanSubmit(this.formData.Id, this.$axios)
+      this.saveEntity(1)
+      this.updateNumberEntityNoInfo()
+      apiCert.checkSupplierCertCanSubmit(this.certId, this.$axios)
         .then(res => {
           if (res.data.code === 0) {
             this.selectAuditOrg()
@@ -1647,6 +1717,99 @@ export default {
         console.error(err)
       })
     },
+    secondaryUnitSubmitApply (val) {
+      if (!this.auditer) {
+        this.$message({
+          type: 'warning',
+          message: '请选择审批人!'
+        })
+        return false
+      }
+      if (!this.fushenauditer) {
+        this.$message({
+          type: 'warning',
+          message: '请选择复审人!'
+        })
+        return false
+      }
+      if (!this.selectDept) {
+        this.$message({
+          type: 'warning',
+          message: '请选择专业处室!'
+        })
+        return false
+      }
+      if (!this.userOptions || this.userOptions.length === 0) {
+        this.$message({
+          type: 'warning',
+          message: '该专业科室未配置接收人!'
+        })
+        return false
+      }
+      this.loading = true
+      this.applyLoading = true
+      let params = {
+        'FirstAudit': this.auditer,
+        'SecondAudit': this.fushenauditer,
+        'ThirdAudit': this.selectDept, // this.majorDept[this.majorDept.length - 1] 专业处室部门id
+        'AuditRemark': this.auditform.AuditRemark
+      }
+      apiCert.unitAuditEntity(this.certId, params, this.$axios).then(res => {
+        if (res.data.code === 0) {
+          // 保存成功后,初始化数据,变成修改
+          this.initDatas()
+          this.dialogVisible = false
+          this.$message({
+            type: 'success',
+            message: res.data.message
+          })
+        } else {
+          this.$message({
+            type: 'warning',
+            message: res.data.message
+          })
+        }
+        this.applyLoading = false
+        this.loading = false
+      }).catch(err => {
+        console.error(err)
+      })
+    },
+    companySubmitToSecUnitSeparateMakeSure () {
+      if (this.orgauditOptions == null || this.orgauditOptions.length === 0) {
+        this.$message({
+          type: 'warning',
+          message: '该单位没有分办人员!'
+        })
+        return
+      }
+      this.applyLoading = true
+      this.auditform.UnitId = this.UnitOrg
+      this.auditform.CertId = this.certId
+      this.loading = true
+      console.log('企业用户提交参数', this.auditform)
+      apiCert.companyAuditEntity(this.certId, this.auditform, this.$axios)
+        .then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.initDatas()
+            this.dialogVisibleCom = false
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          this.loading = false
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
     SubpEntity () {
       if (this.orgauditOptions == null || this.orgauditOptions.length === 0) {
         this.$message({

+ 89 - 6
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -1537,7 +1537,7 @@ export default {
        }, */
 
     // 保存信息
-    saveEntity () {
+    saveEntity (val) {
       let valid1 = false
       let valid2 = false
       this.$refs['GoodsInfo'].$refs['EntityForm'].validate((valid) => {
@@ -1601,9 +1601,17 @@ export default {
         // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
         this.formData.RegCapital = parseFloat(this.formData.RegCapital)
         if (!this.formData.Id || !this.certId) {
-          this.addEntity()
+          if (val === 1) {
+            this.addEntityNoInfo()
+          } else {
+            this.addEntity()
+          }
         } else {
-          this.updateEntity()
+          if (val === 1) {
+            this.updateEntityNoInfo()
+          } else {
+            this.updateEntity()
+          }
         }
         return true
       }
@@ -1614,6 +1622,52 @@ export default {
       this.$refs['SupplierCertEditCompoment'].saveEntity()
     },
 
+    addEntityNoInfo () {
+      this.formData.SupplierTypeCode = '01'
+      this.formData.SupplierTypeName = '物资类'
+      api
+        .addEntity(this.formData, this.$axios)
+        .then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.formData.Id = res.data.item.split('_')[0]
+            this.certId = res.data.item.split('_')[1]
+            this.initDatas()
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    updateEntityNoInfo () {
+      let _this = this
+      this.goodsloading = true
+      api
+        .updateEntity(this.formData.Id, this.formData, this.$axios)
+        .then(res => {
+          if (res.data.code === 0) {
+            // 更新子表
+            // this.updateNumberEntity()
+            _this.initDatas()
+            _this.goodsloading = false
+          } else {
+            _this.goodsloading = false
+            _this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        })
+        .catch(err => {
+          this.goodsloading = false
+          console.error(err)
+        })
+    },
     addEntity () {
       this.formData.SupplierTypeCode = '01'
       this.formData.SupplierTypeName = '物资类'
@@ -1722,6 +1776,36 @@ export default {
         }
       })
     },
+    updateNumberEntityNoInfo () {
+      this.$refs['EntityFormNumber'].validate((valid) => {
+        // TODO 检查各部门人员数,不能大于总人员数
+        if (valid) {
+          if (!this.CheckCompanyBase()) {
+            return false
+          }
+          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()
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+          })
+        } else {
+          return false
+        }
+      })
+    },
     getFirAuditerByDept () {
       let deptid = this.authUser.Profile.DepartmentId
       this.userOptions = []
@@ -1747,8 +1831,8 @@ export default {
       }
     },
     commitAudit () {
-      console.log('提交审批')
-      console.log(this.formData)
+      this.saveEntity(1)
+      this.updateNumberEntityNoInfo()
       apiCert.checkSupplierCertCanSubmit(this.formData.CertId, this.$axios)
         .then(res => {
           if (res.data.code === 0) {
@@ -1870,7 +1954,6 @@ export default {
         'ThirdAudit': this.selectDept, // this.majorDept[this.majorDept.length - 1] 专业处室部门id
         'AuditRemark': this.auditform.AuditRemark
       }
-      console.log(params)
       apiCert.unitAuditEntity(this.certId, params, this.$axios).then(res => {
         if (res.data.code === 0) {
           // 保存成功后,初始化数据,变成修改

+ 74 - 3
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/techedit.vue

@@ -1395,7 +1395,7 @@ export default {
     }, */
 
     // 保存信息
-    saveEntity () {
+    saveEntity (val) {
       let valid1 = false
       let valid2 = false
 
@@ -1416,9 +1416,17 @@ export default {
         // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
         this.formData.RegCapital = parseFloat(this.formData.RegCapital)
         if (!this.formData.Id || !this.certId) {
-          this.addEntity()
+          if (val === 1) {
+            this.addEntityNoInfo()
+          } else {
+            this.addEntity()
+          }
         } else {
-          this.updateEntity()
+          if (val === 1) {
+            this.updateEntityNoInfo()
+          } else {
+            this.updateEntity()
+          }
         }
         return true
       } else {
@@ -1431,6 +1439,41 @@ export default {
       this.$refs['SupplierCertEditCompoment'].saveEntity()
     },
 
+    addEntityNoInfo () {
+      this.formData.SupplierTypeCode = '03'
+      this.formData.SupplierTypeName = '服务类'
+      api.addEntity(this.formData, this.$axios).then(res => {
+        if (res.data.code === 0) {
+          // 保存成功后,初始化数据,变成修改
+          this.formData.Id = res.data.item.split('_')[0]
+          this.certId = res.data.item.split('_')[1]
+          this.initDatas()
+        } else {
+          this.$message({
+            type: 'warning',
+            message: res.data.message
+          })
+        }
+      }).catch(err => {
+        console.error(err)
+      })
+    },
+    updateEntityNoInfo () {
+      api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
+        if (res.data.code === 0) {
+          // 更新子表
+          // this.updateNumberEntity()
+          this.initDatas()
+        } else {
+          this.$message({
+            type: 'warning',
+            message: res.data.message
+          })
+        }
+      }).catch(err => {
+        console.error(err)
+      })
+    },
     addEntity () {
       this.formData.SupplierTypeCode = '03'
       this.formData.SupplierTypeName = '服务类'
@@ -1524,6 +1567,32 @@ export default {
         }
       })
     },
+    updateNumberEntityNoInfo () {
+      this.$refs['EntityFormNumber'].validate((valid) => {
+        if (valid) {
+          if (!this.CheckCompanyBase()) {
+            return false
+          }
+          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()
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            }).catch(err => {
+            console.error(err)
+          })
+        } else {
+          return false
+        }
+      })
+    },
     getFirAuditerByDept () {
       let deptid = this.authUser.Profile.DepartmentId
       this.userOptions = []
@@ -1550,6 +1619,8 @@ export default {
       this.chooseAuditorVisible = true
     },
     commitAudit () {
+      this.saveEntity(1)
+      this.updateNumberEntityNoInfo()
       apiCert.checkSupplierCertCanSubmit(this.formData.Id, this.$axios)
         .then(res => {
           if (res.data.code === 0) {