Browse Source

项目商机报价单调整

qymljy 11 months ago
parent
commit
1b924e5c81

+ 39 - 12
src/HDrpManagement/projectChange/modules/modules/quotation/modules/add.vue

@@ -189,6 +189,7 @@
       <div class="fixed__btn__panel">
         <el-button size="small" @click="onClose" class="normal-btn-width" :disabled="loading">{{$t(`取 消`)}}</el-button>
         <el-button  size="small" type="primary" @click="getSubmit" class="normal-btn-width" :loading="loading">{{$t(`确 定`)}}</el-button>
+        <el-button  size="small" @click="getSubmit('提交')"  type="warning" class="normal-btn-width" :loading="loading">{{$t(`保存并提交`)}}</el-button>
       </div>
     </el-drawer>
   </div>
@@ -412,7 +413,7 @@ export default {
       })
     },
     /*提交*/
-    getSubmit(){
+    getSubmit(val){
       if (this.form.date.length === 0){
         this.form.begdate = ''
         this.form.enddate = ''
@@ -434,18 +435,44 @@ export default {
           this.loading = false
           this.tool.showMessage(res,()=>{})
         }
-        this.tool.showMessage(res,() => {
-          this.loading = false
-          /*this.changeData(this.productObj)*/
-          this.$emit('addSuccess')
-          let route = this.$route
-          if (route.path !== '/quotedPriceDetail') {
-            this.oldRoute = {path:route.path,query:route.query}
-            this.$store.dispatch('setHistoryRouter',this.oldRoute)
+        if (val == '提交') {
+          const resSubmit = await this.$api.requested({
+            "id": 20221020165303,
+            "content": {
+              "sa_quotedpriceid":res.data.sa_quotedpriceid
+            }
+          })
+          if (resSubmit.code == 0) {
+            this.loading = false;
+            this.tool.showMessage(res,()=>{})
+          }else {
+            this.tool.showMessage(res,() => {
+              this.loading = false
+              /*this.changeData(this.productObj)*/
+              this.$emit('addSuccess')
+              let route = this.$route
+              if (route.path !== '/quotedPriceDetail') {
+                this.oldRoute = {path:route.path,query:route.query}
+                this.$store.dispatch('setHistoryRouter',this.oldRoute)
+              }
+              this.$store.dispatch('changeDetailDrawer',true)
+              this.$router.push({path:'/quotedPriceDetail',query:{id:res.data.sa_quotedpriceid,rowindex:res.data.rowindex}})
+            })
           }
-          this.$store.dispatch('changeDetailDrawer',true)
-          this.$router.push({path:'/quotedPriceDetail',query:{id:res.data.sa_quotedpriceid,rowindex:res.data.rowindex}})
-        })
+        }else {
+          this.tool.showMessage(res,() => {
+            this.loading = false
+            /*this.changeData(this.productObj)*/
+            this.$emit('addSuccess')
+            let route = this.$route
+            if (route.path !== '/quotedPriceDetail') {
+              this.oldRoute = {path:route.path,query:route.query}
+              this.$store.dispatch('setHistoryRouter',this.oldRoute)
+            }
+            this.$store.dispatch('changeDetailDrawer',true)
+            this.$router.push({path:'/quotedPriceDetail',query:{id:res.data.sa_quotedpriceid,rowindex:res.data.rowindex}})
+          })
+        }
       })
     },
     /*修改后的产品数据*/