Răsfoiți Sursa

企业用户年审添加修改

huahaiyan 6 ani în urmă
părinte
comite
1785a6aecb

+ 29 - 6
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/basicindex.vue

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

+ 31 - 5
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/goodsindex.vue

@@ -11,7 +11,11 @@
             <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 +334,7 @@
       }
     },
     created() {
+      this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
       //查询条件初始值备份
       Object.assign(this.searchFormReset, this.searchForm)
       //查询列表
@@ -376,6 +381,9 @@
             if (_this.supplierList) {
               _this.suplen = _this.supplierList.length
             }
+            if (_this.IsCompanyUser == 1 && _this.supplierList) {
+              _this.entityForm.SupplierId = _this.supplierList[0].Id
+            }
           })
           .catch(err => {
             console.error(err)
@@ -403,13 +411,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
       },
@@ -424,10 +430,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();
@@ -452,6 +456,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 => {

+ 0 - 5
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/index.vue

@@ -364,7 +364,6 @@
         //访问接口
         api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
-          console.log("---this.entityList ----", this.entityList)
           this.currentItemCount = res.data.currentItemCount
         }).catch(err => {
           console.error(err)
@@ -406,13 +405,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
       },
@@ -427,10 +424,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();

+ 29 - 5
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/techindex.vue

@@ -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,6 +379,9 @@
             if (_this.supplierList) {
               _this.suplen = _this.supplierList.length
             }
+            if (_this.IsCompanyUser == 1 && _this.supplierList) {
+              _this.entityForm.SupplierId = _this.supplierList[0].Id
+            }
           })
           .catch(err => {
             console.error(err)
@@ -403,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
       },
@@ -424,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();
@@ -452,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 => {