浏览代码

前端: 增项申请-【增项信息】模块点击提交时自动保存

baichengfei 5 年之前
父节点
当前提交
ba78c359bb

+ 7 - 5
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue

@@ -1865,6 +1865,9 @@
         })
       },
       comSubmitToSeparateUnitClick () {
+        // 企业用户自行提交增项申请
+        // 提交前自动保存【增项信息】模块内容
+        this.saveEntity('auto')
         this.dialogComSubmitToSeparateUnitVisible = true
       },
       // 二级单位代为申请, 提交按钮
@@ -1973,7 +1976,6 @@
         if (!checkRes) {
           return false
         }
-        this.saveEntity('directSubmit')
         this.btnloading = true
         // this.auditform.FirstAuditName = this.UnitOrg
         // this.auditform.CertId = this.formData.Id
@@ -2768,14 +2770,14 @@
         api2.updateEntity(_this.Id, _this.formData, _this.$axios).then(res => {
           if (res.data.code === 0) {
             this.getEntityById()
-            if (val !== 'directSubmit') {
+            if (val !== 'auto') {
               this.$message({
                 type: 'success',
                 message: res.data.message
               })
             }
           } else {
-            if (val !== 'directSubmit') {
+            if (val !== 'auto') {
               this.$message({
                 type: 'warning',
                 message: res.data.message
@@ -2842,14 +2844,14 @@
               this.dialogFormData.SupplierCertAppendId = res.data.info // 接收插入数据后返回的Id
               this.Id = res.data.info
               this.getEntityById()
-              if (val !== 'directSubmit') {
+              if (val !== 'auto') {
                 this.$message({
                   type: 'success',
                   message: res.data.message
                 })
               }
             } else {
-              if (val !== 'directSubmit') {
+              if (val !== 'auto') {
                 this.$message({
                   type: 'warning',
                   message: res.data.message

+ 35 - 25
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -1121,7 +1121,6 @@
   import setapi from '@/api/oilsupplier/oilclassorgset'
   import goodsApi from '@/api/oilsupplier/goodsaptitude'
 
-
   // v-viewer
   import Vue from 'vue'
   import Viewer from 'v-viewer'
@@ -2094,7 +2093,7 @@
           })
         }, 1000)
       },
-      checkExpand (data,node,node2) {
+      checkExpand (data, node, node2) {
         if (data.Code.length === 6) {
           // node.disabled = false
           data.disabled = false
@@ -2212,6 +2211,9 @@
         this.AuditdialogShow = true
       },
       comSubmitToSeparateUnitClick () {
+        // 企业用户自行提交增项申请
+        // 提交前自动保存【增项信息】模块内容
+        this.saveEntity('auto')
         this.dialogComSubmitToSeparateUnitVisible = true
       },
       // 根据分类Id获取Code
@@ -2916,14 +2918,14 @@
       },
 
       // 保存增项信息
-      saveEntity () {
+      saveEntity (val) {
         let _this = this
         this.$refs['EntityForm'].validate((valid) => {
           if (valid) {
             if (_this.editFlag == '1' && _this.Id !== '') {
-              _this.updateData()
+              _this.updateData(val)
             } else {
-              _this.addAppend()
+              _this.addAppend(val)
             }
           } else {
             return false
@@ -2932,21 +2934,25 @@
       },
 
       // 更新增项信息
-      updateData () {
+      updateData (val) {
         this.formData.SupplierName = this.$refs.suppselect.selectedLabel + ''
         let _this = this
         api2.updateEntity(_this.Id, _this.formData, _this.$axios).then(res => {
           if (res.data.code === 0) {
             this.getEntityById()
-            this.$message({
-              type: 'success',
-              message: res.data.message
-            })
+            if (val !== 'auto') { // 直接点击提交按钮时自动保存
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            }
           } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
+            if (val !== 'auto') {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
           }
         }).catch(err => {
           console.error(err)
@@ -2998,7 +3004,7 @@
       },
 
       // 添加增项信息
-      addAppend () {
+      addAppend (val) {
         this.formData.SupplierName = this.$refs.suppselect.selectedLabel + ''
         let _this = this
         _this.formData.AppendType = '01'
@@ -3009,15 +3015,19 @@
               this.dialogFormData.SupplierCertAppendId = res.data.info // 接收插入数据后返回的Id
               this.Id = res.data.info
               this.getEntityById()
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
+              if (val !== 'auto') {
+                _this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              }
             } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
+              if (val !== 'auto') {
+                _this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
             }
           })
           .catch(err => {
@@ -3119,7 +3129,7 @@
         let _this = this
         let name = _this.searchText
         let params = {
-          level : _this.Grade
+          level: _this.Grade
         }
         goodsApi.goodsParentlist(params, name, this.$axios).then(res => {
           _this.sectreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Code,Name,CodeName')
@@ -3473,7 +3483,7 @@
           this.InOptions = res.data.items['InOptions']
           this.UnitRelationOptions = this.dictData['UnitRelation']
           if (this.supplierData.SpecTypeCode == '') {
-            this.supplierData.SpecTypeCode = "1"
+            this.supplierData.SpecTypeCode = '1'
           }
           this.CompanyTypeOptions = this.dictData['CompanyType']
           this.OperTypeOptions = this.dictData['OperType']

+ 5 - 5
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue

@@ -2392,6 +2392,7 @@
           })
       },
       comSubmitToSeparateUnitClick () {
+        this.saveEntity('auto')
         this.dialogComSubmitToSeparateUnitVisible = true
       },
       // 二级单位代为申请, 提交按钮
@@ -2503,7 +2504,6 @@
         if (!checkRes) {
           return false
         }
-        this.saveEntity('directSubmit')
         this.btnloading = true
         // this.auditform.FirstAuditName = this.UnitOrg
         // this.auditform.CertId = this.formData.Id
@@ -2761,14 +2761,14 @@
         api2.updateEntity(_this.Id, _this.formData, _this.$axios).then(res => {
           if (res.data.code === 0) {
             this.getEntityById()
-            if (val !== 'directSubmit') {
+            if (val !== 'auto') {
               this.$message({
                 type: 'success',
                 message: res.data.message
               })
             }
           } else {
-            if (val !== 'directSubmit') {
+            if (val !== 'auto') {
               this.$message({
                 type: 'warning',
                 message: res.data.message
@@ -2837,14 +2837,14 @@
               this.dialogFormData.SupplierCertAppendId = res.data.info // 接收插入数据后返回的Id
               this.Id = res.data.info
               this.getEntityById()
-              if (val !== 'directSubmit') {
+              if (val !== 'auto') {
                 _this.$message({
                   type: 'success',
                   message: res.data.message
                 })
               }
             } else {
-              if (val !== 'directSubmit') {
+              if (val !== 'auto') {
                 _this.$message({
                   type: 'warning',
                   message: res.data.message