From 8b46c471e28fbf0b71efbe363facf0bf05d8f6f8 Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期四, 14 三月 2024 18:12:30 +0800
Subject: [PATCH] aaa

---
 company/src/components/business/OperaShopWindow.vue |   50 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/company/src/components/business/OperaShopWindow.vue b/company/src/components/business/OperaShopWindow.vue
index ced1965..e90e15b 100644
--- a/company/src/components/business/OperaShopWindow.vue
+++ b/company/src/components/business/OperaShopWindow.vue
@@ -4,7 +4,7 @@
         width="60%"
         :visible.sync="visible"
         :confirm-working="isWorking"
-        @confirm="confirm"
+        @confirm="confirmShop"
     >
         <el-form :model="form" ref="form" :rules="rules" style="width: 50%;">
             <el-form-item label="鍟嗘埛鍚嶇О" prop="name">
@@ -78,6 +78,7 @@
 import UploadAvatarImage from '@/components/common/UploadAvatarImage'
 import { all } from '@/api/business/solutions'
 import { sendSms } from '@/api/business/smsEmail'
+import {updateById} from "@/api/business/company";
 export default {
   name: 'OperaCompanyWindow',
   extends: BaseOpera,
@@ -85,7 +86,7 @@
   data () {
     return {
       // 琛ㄥ崟鏁版嵁
-      initParam:{
+      initParam: {
         id: null,
         name: '',
         code: '',
@@ -133,7 +134,7 @@
         file3: {
           imgurl: '',
           imgurlfull: ''
-        },
+        }
       },
       form: {},
       timer: null,
@@ -195,9 +196,42 @@
     }
   },
   methods: {
-    changeSolution(row,index){
-     this.form.solutionList[index].solution=row
-   //   console.log(this.form.solutionList)
+    confirmShop () {
+      this.$refs.form.validate((valid) => {
+        // debugger
+        if (!valid) {
+          return
+        }
+        // 璋冪敤鏂板缓鎺ュ彛
+        this.isWorking = true
+        if (this.form.id == null || this.form.id === '') {
+          this.api.createShop(this.form)
+            .then(() => {
+              this.visible = false
+              this.$tip.apiSuccess('鏂板缓鎴愬姛')
+              this.$emit('success')
+            })
+            .catch(e => {
+              this.$tip.apiFailed(e)
+            })
+            .finally(() => {
+              this.isWorking = false
+            })
+        } else {
+          this.api.updateById(this.form)
+            .then(() => {
+              this.visible = false
+              this.$tip.apiSuccess('鏂板缓鎴愬姛')
+              this.$emit('success')
+            })
+            .catch(e => {
+              this.$tip.apiFailed(e)
+            })
+            .finally(() => {
+              this.isWorking = false
+            })
+        }
+      })
     },
     send () {
       if (!this.form.phone) {
@@ -219,7 +253,7 @@
         }
       }, 1000)
     },
-    open (title, target,type) {
+    open (title, target, type) {
       this.title = title
       this.visible = true
       this.form = this.initParam
@@ -255,7 +289,7 @@
     },
     add () {
       this.form.solutionList.push({
-        solutionId:null,
+        solutionId: null,
         solution: {},
         canAdd: '',
         canReduce: ''

--
Gitblit v1.9.3