|
|
@@ -11,7 +11,9 @@
|
|
|
<i class="icon icon-table2"></i> 年审申请表
|
|
|
</span>
|
|
|
<span style="float: right;">
|
|
|
- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="addaudit">添加
|
|
|
+ <el-button v-if="IsCompanyUser == 0" type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="addaudit">添加
|
|
|
+ </el-button>
|
|
|
+ <el-button v-if="IsCompanyUser == 1" type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="addauditcom">添加
|
|
|
</el-button>
|
|
|
</span>
|
|
|
<el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
|
|
|
@@ -330,6 +332,7 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
|
|
|
//查询条件初始值备份
|
|
|
Object.assign(this.searchFormReset, this.searchForm)
|
|
|
//查询列表
|
|
|
@@ -376,7 +379,9 @@
|
|
|
if (_this.supplierList) {
|
|
|
_this.suplen = _this.supplierList.length
|
|
|
}
|
|
|
- console.log("this.suplen", this.suplen)
|
|
|
+ if (_this.IsCompanyUser == 1 && _this.supplierList) {
|
|
|
+ _this.entityForm.SupplierId = _this.supplierList[0].Id
|
|
|
+ }
|
|
|
})
|
|
|
.catch(err => {
|
|
|
console.error(err)
|
|
|
@@ -404,13 +409,11 @@
|
|
|
})
|
|
|
},
|
|
|
setAuditer(val, name) {
|
|
|
- console.log("------", val, name)
|
|
|
this.auditer = val
|
|
|
this.auditerName = name
|
|
|
this.chooseAuditorVisible = false
|
|
|
},
|
|
|
chooseAuditorShow() {
|
|
|
- console.log("---this.entityForm---", this.entityForm)
|
|
|
this.$refs['chooseAuditor'].getorgtreelist(this.entityForm.SupplierTypeName)
|
|
|
this.chooseAuditorVisible = true
|
|
|
},
|
|
|
@@ -425,10 +428,8 @@
|
|
|
this.$refs['EntityFormref'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.entityForm.auditer = this.auditer
|
|
|
- console.log("----this.entityForm.auditer--", this.entityForm.auditer)
|
|
|
api.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
|
|
|
if (res.data.code === 0) {
|
|
|
- console.log("--------res.data----", res.data)
|
|
|
//保存成功后,初始化数据,变成修改
|
|
|
this.entityForm.Id = res.data.item;
|
|
|
this.initDatas();
|
|
|
@@ -453,6 +454,28 @@
|
|
|
addaudit() {
|
|
|
this.addshow = true
|
|
|
},
|
|
|
+ addauditcom() {
|
|
|
+ api.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ //保存成功后,初始化数据,变成修改
|
|
|
+ this.entityForm.Id = res.data.item;
|
|
|
+ this.initDatas();
|
|
|
+ this.addshow = false
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
getselectsupplier() {
|
|
|
api.getSupList(this.$axios).then(res => {
|