|
|
@@ -57,7 +57,7 @@
|
|
|
提交
|
|
|
</el-button>
|
|
|
<el-button v-if="parseInt(IsCompanyUser) !== 1 && parseInt(totalTab) >= 3 && formData.Status <= 0" type="primary" size="mini" style="float: right;margin-left: 25px" @click="commitAudit()">
|
|
|
- 提交审批
|
|
|
+ 提交
|
|
|
</el-button>
|
|
|
<el-button v-if="parseInt(totalTab) >= 3 && formData.Status == 6" type="primary" size="mini" style="float: right;margin-left: 25px" @click="recallApplyClick()" :loading="recallApplyBtn">
|
|
|
撤回
|
|
|
@@ -1642,107 +1642,107 @@ export default {
|
|
|
|
|
|
// 保存信息
|
|
|
saveEntity (val) {
|
|
|
- // console.log('2221111')
|
|
|
- let valid1 = false
|
|
|
- let valid2 = false
|
|
|
- this.$refs['GoodsInfo'].$refs['EntityForm'].validate((valid) => {
|
|
|
- valid1 = valid
|
|
|
- })
|
|
|
-
|
|
|
- this.$refs['GoodsInfo'].$refs['EntityFormCert'].validate((valid) => {
|
|
|
- valid2 = valid
|
|
|
- })
|
|
|
-
|
|
|
- if (this.formData.Grade == 1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined')) {
|
|
|
- this.$message({
|
|
|
- duration: 10000,
|
|
|
- type: 'warning',
|
|
|
- message: '中石油准入证编号不能为空!'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.formData.InStyle === '3' && this.formData.MgrUnit.indexOf('大庆油田') != -1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined')) {
|
|
|
- this.$message({
|
|
|
- duration: 10000,
|
|
|
- type: 'warning',
|
|
|
- message: '中石油准入证编号不能为空!'
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ let valid1 = false
|
|
|
+ let valid2 = false
|
|
|
+ this.$refs['GoodsInfo'].$refs['EntityForm'].validate((valid) => {
|
|
|
+ valid1 = valid
|
|
|
})
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.formData.InStyle === '3' && this.formData.MgrUnit === '大港油田分公司') {
|
|
|
- this.$message({
|
|
|
- duration: 10000,
|
|
|
- type: 'warning',
|
|
|
- message: '二级物资准入不能选择大港油田分公司!'
|
|
|
+
|
|
|
+ this.$refs['GoodsInfo'].$refs['EntityFormCert'].validate((valid) => {
|
|
|
+ valid2 = valid
|
|
|
})
|
|
|
- return
|
|
|
- }
|
|
|
|
|
|
- /** 2019.05.16 - 16 准入申请中,若选择了“管理单位”,“中石油准入证编号”应自动改为必填项 */
|
|
|
- // if (this.formData.MgrUnit != null) {
|
|
|
- // if (this.formData.MgrUnit.length > 0 && !this.formData.PACNumber) {
|
|
|
- // valid1 = false
|
|
|
- // this.$message({
|
|
|
- // type: 'warning',
|
|
|
- // message: '【中石油准入证编号】不能为空'
|
|
|
- // })
|
|
|
- // return
|
|
|
- // }
|
|
|
- // }
|
|
|
- if (valid1 && valid2) {
|
|
|
- if (!this.formData.SetupTime) {
|
|
|
- this.formData.SetupTime = null
|
|
|
- } else {
|
|
|
- this.formData.SetupTime = new Date(this.formData.SetupTime)
|
|
|
+ if (this.formData.Grade == 1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined')) {
|
|
|
+ this.$message({
|
|
|
+ duration: 10000,
|
|
|
+ type: 'warning',
|
|
|
+ message: '中石油准入证编号不能为空!'
|
|
|
+ })
|
|
|
+ return resolve(false)
|
|
|
+ }
|
|
|
+ if (this.formData.InStyle === '3' && this.formData.MgrUnit.indexOf('大庆油田') != -1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined')) {
|
|
|
+ this.$message({
|
|
|
+ duration: 10000,
|
|
|
+ type: 'warning',
|
|
|
+ message: '中石油准入证编号不能为空!'
|
|
|
+ })
|
|
|
+ return resolve(false)
|
|
|
}
|
|
|
- // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
|
|
|
- this.formData.RegCapital = parseFloat(this.formData.RegCapital)
|
|
|
- let isCompanyUser = ''
|
|
|
- if (this.authUser.Profile.IsCompanyUser === 1) {
|
|
|
- isCompanyUser = '1'
|
|
|
+ if (this.formData.InStyle === '3' && this.formData.MgrUnit === '大港油田分公司') {
|
|
|
+ this.$message({
|
|
|
+ duration: 10000,
|
|
|
+ type: 'warning',
|
|
|
+ message: '二级物资准入不能选择大港油田分公司!'
|
|
|
+ })
|
|
|
+ return resolve(false)
|
|
|
}
|
|
|
- // console.log(isCompanyUser, 'isCompanyUser')
|
|
|
- api.signupCommercialNo(this.formData.CommercialNo, this.formData.Id, isCompanyUser, this.$axios).then(res => {
|
|
|
- // console.log(res, 'Item')
|
|
|
- if (res.data.item) {
|
|
|
- this.$message({
|
|
|
- duration: 10000,
|
|
|
- type: 'warning',
|
|
|
- message: '该统一社会信用代码与其他公司重复'
|
|
|
- })
|
|
|
+
|
|
|
+ if (valid1 && valid2) {
|
|
|
+ if (!this.formData.SetupTime) {
|
|
|
+ this.formData.SetupTime = null
|
|
|
} else {
|
|
|
- api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
|
|
|
- // console.log(res, 'checkBack')
|
|
|
- if (res.data.item) {
|
|
|
- this.$message({
|
|
|
+ this.formData.SetupTime = new Date(this.formData.SetupTime)
|
|
|
+ }
|
|
|
+ // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
|
|
|
+ this.formData.RegCapital = parseFloat(this.formData.RegCapital)
|
|
|
+ let isCompanyUser = ''
|
|
|
+ if (this.authUser.Profile.IsCompanyUser === 1) {
|
|
|
+ isCompanyUser = '1'
|
|
|
+ }
|
|
|
+ api.signupCommercialNo(this.formData.CommercialNo, this.formData.Id, isCompanyUser, this.$axios).then(res => {
|
|
|
+ if (res.data.item) {
|
|
|
+ this.$message({
|
|
|
+ duration: 10000,
|
|
|
+ type: 'warning',
|
|
|
+ message: '该统一社会信用代码与其他公司重复'
|
|
|
+ })
|
|
|
+ return resolve(false)
|
|
|
+ } else {
|
|
|
+ api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
|
|
|
+ // console.log(res, 'checkBack')
|
|
|
+ if (res.data.item) {
|
|
|
+ this.$message({
|
|
|
duration: 10000,
|
|
|
type: 'warning',
|
|
|
- message: '该银行账号与其他公司重复'
|
|
|
- })
|
|
|
- } else {
|
|
|
- if (!this.formData.Id || !this.certId) {
|
|
|
- if (val === 1) {
|
|
|
- this.addEntityNoInfo()
|
|
|
- } else {
|
|
|
- this.addEntity()
|
|
|
- }
|
|
|
+ message: '该银行账号与其他公司重复'
|
|
|
+ })
|
|
|
+ return resolve(false)
|
|
|
} else {
|
|
|
- if (val === 1) {
|
|
|
- this.updateEntityNoInfo()
|
|
|
+ if (!this.formData.Id || !this.certId) {
|
|
|
+ if (val === 1) {
|
|
|
+ this.addEntityNoInfo()
|
|
|
+ } else {
|
|
|
+ this.addEntity()
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.updateEntity()
|
|
|
+ if (val === 1) {
|
|
|
+ this.updateEntityNoInfo()
|
|
|
+ } else {
|
|
|
+ this.updateEntity()
|
|
|
+ }
|
|
|
}
|
|
|
+ return resolve(true)
|
|
|
}
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- return true
|
|
|
- }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ return resolve(false)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ return resolve(false)
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ duration: 10000,
|
|
|
+ type: 'warning',
|
|
|
+ message: '请完善企业基本信息!'
|
|
|
+ })
|
|
|
+ return resolve(false)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 保存信息
|
|
|
@@ -1997,23 +1997,7 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
- this.saveEntity(1)
|
|
|
- this.updateNumberEntityNoInfo()
|
|
|
- apiCert.checkSupplierCertCanSubmit(this.formData.CertId, this.$axios)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- this.selectAuditOrg()
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- duration: 10000,
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
+ this.selectAuditOrg()
|
|
|
},
|
|
|
checkSubFile () {
|
|
|
let _this = this
|
|
|
@@ -2198,110 +2182,132 @@ export default {
|
|
|
secondaryUnitSubmitApply (val) {
|
|
|
if (!this.auditer) {
|
|
|
this.$message({
|
|
|
- duration: 10000,
|
|
|
- type: 'warning',
|
|
|
+ duration: 10000,
|
|
|
+ type: 'warning',
|
|
|
message: '请选择审批人!'
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
if (!this.fushenauditer) {
|
|
|
this.$message({
|
|
|
- duration: 10000,
|
|
|
- type: 'warning',
|
|
|
+ duration: 10000,
|
|
|
+ type: 'warning',
|
|
|
message: '请选择复审人!'
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
if (!this.selectDept) {
|
|
|
this.$message({
|
|
|
- duration: 10000,
|
|
|
- type: 'warning',
|
|
|
+ duration: 10000,
|
|
|
+ type: 'warning',
|
|
|
message: '请选择专业处室!'
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
if (!this.userOptions || this.userOptions.length === 0) {
|
|
|
this.$message({
|
|
|
- duration: 10000,
|
|
|
- type: 'warning',
|
|
|
+ duration: 10000,
|
|
|
+ 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()
|
|
|
- if (this.$refs['WfHistory']) {
|
|
|
- this.$refs['WfHistory'].getHistoryTask()
|
|
|
+ this.saveEntity(1).then(res => {
|
|
|
+ if (res) {
|
|
|
+ let params = {
|
|
|
+ 'FirstAudit': this.auditer,
|
|
|
+ 'SecondAudit': this.fushenauditer,
|
|
|
+ 'ThirdAudit': this.selectDept, // this.majorDept[this.majorDept.length - 1] 专业处室部门id
|
|
|
+ 'AuditRemark': this.auditform.AuditRemark
|
|
|
}
|
|
|
- this.dialogVisible = false
|
|
|
- this.$message({
|
|
|
+ apiCert.unitAuditEntity(this.certId, params, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ // 保存成功后,初始化数据,变成修改
|
|
|
+ this.initDatas()
|
|
|
+ if (this.$refs['WfHistory']) {
|
|
|
+ this.$refs['WfHistory'].getHistoryTask()
|
|
|
+ }
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.$message({
|
|
|
duration: 10000,
|
|
|
type: 'success',
|
|
|
message: res.data.message
|
|
|
})
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
duration: 10000,
|
|
|
type: 'warning',
|
|
|
message: res.data.message
|
|
|
})
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
- this.applyLoading = false
|
|
|
- this.loading = false
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
})
|
|
|
},
|
|
|
companySubmitToSecUnitSeparateMakeSure () {
|
|
|
if (this.orgauditOptions == null || this.orgauditOptions.length === 0) {
|
|
|
this.$message({
|
|
|
- duration: 10000,
|
|
|
- type: 'warning',
|
|
|
+ duration: 10000,
|
|
|
+ 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.dialogVisibleCom = false
|
|
|
- this.$message({
|
|
|
- duration: 10000,
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
+ this.saveEntity(1).then(res => {
|
|
|
+ if (res) {
|
|
|
+ this.updateNumberEntityNoInfo()
|
|
|
+ apiCert.checkSupplierCertCanSubmit(this.formData.CertId, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.auditform.UnitId = this.UnitOrg
|
|
|
+ this.auditform.CertId = this.certId
|
|
|
+ apiCert.companyAuditEntity(this.certId, this.auditform, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ // 保存成功后,初始化数据,变成修改
|
|
|
+ this.dialogVisibleCom = false
|
|
|
+ this.$message({
|
|
|
+ duration: 10000,
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ this.initDatas()
|
|
|
+ if (this.$refs['WfHistory']) {
|
|
|
+ this.$refs['WfHistory'].getHistoryTask()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ duration: 10000,
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ }).catch(err => {
|
|
|
+ this.loading = false
|
|
|
+ console.error(err)
|
|
|
})
|
|
|
- this.initDatas()
|
|
|
- if (this.$refs['WfHistory']) {
|
|
|
- this.$refs['WfHistory'].getHistoryTask()
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
duration: 10000,
|
|
|
type: 'warning',
|
|
|
message: res.data.message
|
|
|
})
|
|
|
- }
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.loading = false
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
this.loading = false
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
SubpEntity () {
|
|
|
if (this.orgauditOptions == null || this.orgauditOptions.length === 0) {
|