|
|
@@ -48,8 +48,7 @@
|
|
|
<div slot="header" class="clearfix">
|
|
|
<span>供方基本信息表</span>
|
|
|
<span style="float: right;">
|
|
|
- <el-button type="primary" size="mini" @click="saveinfochange" v-if="Status <= 0">保存
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="saveinfochange" v-if="Status <= 0" :loading="saveLoading">保存</el-button>
|
|
|
</span>
|
|
|
</div>
|
|
|
<!--<goods-info ref="GoodsInfo" :formData.sync="formData" :dictData.sync="dictData" :authUser="authUser"-->
|
|
|
@@ -1325,6 +1324,7 @@
|
|
|
firOptions: [],
|
|
|
newVisible: false,
|
|
|
auditBtn: false,
|
|
|
+ saveLoading: false,
|
|
|
newSubfileForm: {
|
|
|
Id: '',
|
|
|
SupplierId: '',
|
|
|
@@ -2899,47 +2899,78 @@
|
|
|
// },
|
|
|
// 保存信息
|
|
|
saveinfochange (val) {
|
|
|
- let valid1 = false
|
|
|
- let valid2 = false
|
|
|
- this.$refs['EntityForm'].validate((valid) => {
|
|
|
- valid1 = valid
|
|
|
- })
|
|
|
-
|
|
|
- this.$refs['EntityFormCert'].validate((valid) => {
|
|
|
- valid2 = valid
|
|
|
- })
|
|
|
- if (this.formData.Grade == 1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined' || this.formData.PACNumber.trim() == '')) {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '中石油准入证编号不能为空!'
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.saveLoading = true
|
|
|
+ let valid1 = false
|
|
|
+ let valid2 = false
|
|
|
+ this.$refs['EntityForm'].validate((valid) => {
|
|
|
+ valid1 = valid
|
|
|
})
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.formData.InStyle === '3' && this.formData.MgrUnit === '大港油田分公司') {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '二级物资准入不能选择大港油田分公司!'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (valid1 && valid2) {
|
|
|
- api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
|
|
|
- if (res.data.item) {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '该银行账号与其他公司重复'
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.addInfoChangeItemCh(val)
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
+
|
|
|
+ this.$refs['EntityFormCert'].validate((valid) => {
|
|
|
+ valid2 = valid
|
|
|
})
|
|
|
- return true
|
|
|
- } else {
|
|
|
- return false
|
|
|
- }
|
|
|
+ if (this.formData.Grade == 1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined' || this.formData.PACNumber.trim() == '')) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '中石油准入证编号不能为空!'
|
|
|
+ })
|
|
|
+ this.saveLoading = false
|
|
|
+ resolve(false)
|
|
|
+ }
|
|
|
+ if (this.formData.InStyle === '3' && this.formData.MgrUnit === '大港油田分公司') {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '二级物资准入不能选择大港油田分公司!'
|
|
|
+ })
|
|
|
+ this.saveLoading = false
|
|
|
+ resolve(false)
|
|
|
+ }
|
|
|
+ if (valid1 && valid2) {
|
|
|
+ api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
|
|
|
+ if (res.data.item) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '该银行账号与其他公司重复'
|
|
|
+ })
|
|
|
+ this.saveLoading = false
|
|
|
+ resolve(false)
|
|
|
+ } else {
|
|
|
+ // 检查是否缺少资质
|
|
|
+ let fileType = {
|
|
|
+ Type: this.formData.OperType === '制造商' ? 1 : 2,
|
|
|
+ SupplierId: this.formData.Id,
|
|
|
+ CertId: this.certId,
|
|
|
+ Grade: this.formData.Grade,
|
|
|
+ Table: 3
|
|
|
+ }
|
|
|
+ api.checkSupplierFileNew(fileType, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 1) {
|
|
|
+ this.addInfoChangeItemCh(val)
|
|
|
+ this.saveLoading = false
|
|
|
+ resolve(true)
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ this.saveLoading = false
|
|
|
+ resolve(false)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.saveLoading = false
|
|
|
+ resolve(false)
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.saveLoading = false
|
|
|
+ resolve(false)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
+
|
|
|
addInfoChangeItemCh (val) {
|
|
|
let AllInfochangeItemList = {
|
|
|
SupplierId: this.formData.Id + '',
|
|
|
@@ -3037,44 +3068,52 @@
|
|
|
}
|
|
|
return true
|
|
|
}
|
|
|
+ return false
|
|
|
})
|
|
|
},
|
|
|
separateUnitSubmitAuditMakeSure () {
|
|
|
console.log('二级分办单位审核结果 确认提交')
|
|
|
- let checkRes = this.separateUnitSubmitAuditParamsCheck
|
|
|
- if (!checkRes) {
|
|
|
- return false
|
|
|
- }
|
|
|
- let params = {
|
|
|
- firstAudit: this.auditer,
|
|
|
- SecondAudit: this.fushenauditer,
|
|
|
- AuditRemark: this.entityForm.Remark
|
|
|
- }
|
|
|
this.loading = true
|
|
|
- let _this = this
|
|
|
- annualapi.separateUnitAuditEntity(this.annualId, params, this.$axios).then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- // 保存成功后,初始化数据,变成修改
|
|
|
- // this.Status = res.data.item
|
|
|
- // this.entityForm.Status = this.Status
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
+ // let checkRes = this.separateUnitSubmitAuditParamsCheck()
|
|
|
+ // if (!checkRes) {
|
|
|
+ // this.loading = false
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ this.saveinfochange(1).then(res=>{
|
|
|
+ if (res) {
|
|
|
+ let params = {
|
|
|
+ firstAudit: this.auditer,
|
|
|
+ SecondAudit: this.fushenauditer,
|
|
|
+ AuditRemark: this.entityForm.Remark
|
|
|
+ }
|
|
|
+ let _this = this
|
|
|
+ annualapi.separateUnitAuditEntity(this.annualId, params, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ // 保存成功后,初始化数据,变成修改
|
|
|
+ // this.Status = res.data.item
|
|
|
+ // this.entityForm.Status = this.Status
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ _this.initDatas()
|
|
|
+ _this.getstatus(this.annualId)
|
|
|
+ _this.isAccess()
|
|
|
+ _this.dialogSeparateUnitAuditVisible = false
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ }).catch(err => {
|
|
|
+ this.loading = false
|
|
|
+ console.error(err)
|
|
|
})
|
|
|
- _this.initDatas()
|
|
|
- _this.getstatus(this.annualId)
|
|
|
- _this.isAccess()
|
|
|
- _this.dialogSeparateUnitAuditVisible = false
|
|
|
} else {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
- this.loading = false
|
|
|
- }).catch(err => {
|
|
|
- this.loading = false
|
|
|
- console.error(err)
|
|
|
})
|
|
|
},
|
|
|
comSubmitToSeparateUnitClick () {
|
|
|
@@ -3082,56 +3121,55 @@
|
|
|
},
|
|
|
// 企业用户自行提交审批
|
|
|
companySubmitToSecUnitSeparate () {
|
|
|
- this.saveinfochange(1)
|
|
|
- let checkRes = this.companySubmitToSecUnitParamsCheck
|
|
|
+ this.loading = true
|
|
|
+ let checkRes = this.companySubmitToSecUnitParamsCheck()
|
|
|
if (!checkRes) {
|
|
|
+ this.loading = false
|
|
|
return false
|
|
|
}
|
|
|
- this.loading = true
|
|
|
- // this.auditform.FirstAuditName = this.UnitOrg
|
|
|
- // this.auditform.CertId = this.formData.Id
|
|
|
- // this.auditform.TypeCode = '01'
|
|
|
- let params = {
|
|
|
- UnitId: this.UnitOrg,
|
|
|
- AuditRemark: this.entityForm.Remark
|
|
|
- }
|
|
|
- let _this = this
|
|
|
- annualapi.companyAuditEntity(this.annualId, params, this.$axios).then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- // 保存成功后,初始化数据,变成修改
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
+ this.saveinfochange(1).then(res=>{
|
|
|
+ if (res) {
|
|
|
+ // this.auditform.FirstAuditName = this.UnitOrg
|
|
|
+ // this.auditform.CertId = this.formData.Id
|
|
|
+ // this.auditform.TypeCode = '01'
|
|
|
+ let params = {
|
|
|
+ UnitId: this.UnitOrg,
|
|
|
+ AuditRemark: this.entityForm.Remark
|
|
|
+ }
|
|
|
+ let _this = this
|
|
|
+ annualapi.companyAuditEntity(this.annualId, params, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ // 保存成功后,初始化数据,变成修改
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ _this.initDatas()
|
|
|
+ _this.getstatus(this.annualId)
|
|
|
+ _this.isAccess()
|
|
|
+ _this.dialogComSubmitToSeparateUnitVisible = false
|
|
|
+ // _this.getEntityById()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ _this.loading = false
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
})
|
|
|
- _this.initDatas()
|
|
|
- _this.getstatus(this.annualId)
|
|
|
- _this.isAccess()
|
|
|
- _this.dialogComSubmitToSeparateUnitVisible = false
|
|
|
- // _this.getEntityById()
|
|
|
} else {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
- _this.loading = false
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- companySubmitToSecUnitParamsCheck () {
|
|
|
- if (this.myentityList == null || this.myentityList.length <= 0) {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '没有新增准入项,不能提交!'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- for (let idx in this.subfileList1) {
|
|
|
- if (this.subfileList1[idx].OldFileUrl === '' && this.subfileList1[idx].FileUrl === '') {
|
|
|
+ companySubmitToSecUnitParamsCheck () {
|
|
|
+ for (let idx in this.subfileList) {
|
|
|
+ if (this.subfileList[idx].OldFileUrl === '' && this.subfileList[idx].FileUrl === '') {
|
|
|
this.$message({
|
|
|
type: 'warning',
|
|
|
- message: this.subfileList1[idx].NeedFileType + '没有上传,不能提交!'
|
|
|
+ message: this.subfileList[idx].NeedFileType + '没有上传,不能提交!'
|
|
|
})
|
|
|
return
|
|
|
}
|