From 3a45da15c947c2d478a44a51bd0f926647b1b841 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 11 四月 2025 16:33:17 +0800
Subject: [PATCH] 提交

---
 company/src/components/business/OperaShopWindow.vue |  114 ++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 101 insertions(+), 13 deletions(-)

diff --git a/company/src/components/business/OperaShopWindow.vue b/company/src/components/business/OperaShopWindow.vue
index ced1965..a87c7d5 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">
@@ -32,7 +32,7 @@
             <el-form-item label="璁よ瘉閭" prop="email" >
                 <el-input v-model="form.email" placeholder="璇疯緭鍏�" v-trim/>
             </el-form-item>
-            <el-form-item label="绾崇◣浜鸿瘑鍒彿" prop="taxCode">
+<!--            <el-form-item label="绾崇◣浜鸿瘑鍒彿" prop="taxCode">
                 <el-input v-model="form.taxCode" placeholder="璇疯緭鍏�" v-trim/>
             </el-form-item>
             <el-form-item label="閾惰璐﹀彿" prop="taxAccount">
@@ -49,7 +49,7 @@
             </el-form-item>
             <el-form-item label="绾歌川鍙戠エ鎺ユ敹鍦板潃" prop="invoiceAddr">
                 <el-input v-model="form.invoiceAddr" placeholder="璇疯緭鍏�" v-trim/>
-            </el-form-item>
+            </el-form-item>-->
             <el-form-item label="钀ヤ笟鎵х収" prop="businessImg">
                 <div style="width: 100%; height: 100px; display: flex; align-items: center;">
                     <UploadAvatarImage :uploadData="{ folder: 'company' }" :file="form.file" @uploadSuccess="result" />
@@ -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: '',
@@ -106,7 +107,7 @@
           fileurl: '',
           name: ''
         },
-        idcardImgList: [],
+        idcardImgList: [{},{}],
         signImg: {
           fileurl: '',
           name: ''
@@ -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,15 +253,17 @@
         }
       }, 1000)
     },
-    open (title, target,type) {
+    open (title, target, type) {
       this.title = title
       this.visible = true
-      this.form = this.initParam
+      this.clearFrom()
+      console.log(this.form)
+
       this.getAll()
       // 鏂板缓
       if (target == null) {
         this.$nextTick(() => {
-          this.$refs.form.resetFields()
+          // this.$refs.form.resetFields()
           this.form[this.configData['field.id']] = null
         })
         return
@@ -238,6 +274,58 @@
           this.form[key] = target[key]
         }
       })
+    },
+    clearFrom(){
+      this.form ={
+        id: null,
+        name: '',
+        code: '',
+        legalName: '',
+        taxCode: '',
+        taxAccount: '',
+        username: '',
+        taxBank: '',
+        taxAddr: '',
+        invoiceEmail: '',
+        invoiceAddr: '',
+        phone: '',
+        email: '',
+        type: 1,
+        actionType: 0,
+        captche: '',
+        businessImg: {
+          fileurl: '',
+          name: ''
+        },
+        idcardImgList: [{},{}],
+        signImg: {
+          fileurl: '',
+          name: ''
+        },
+        solutionList: [
+          {
+            solution: null,
+            canAdd: 0,
+            canReduce: 0
+          }
+        ],
+        file: {
+          imgurl: '',
+          imgurlfull: ''
+        },
+        file1: {
+          imgurl: '',
+          imgurlfull: ''
+        },
+        file2: {
+          imgurl: '',
+          imgurlfull: ''
+        },
+        file3: {
+          imgurl: '',
+          imgurlfull: ''
+        }
+      }
     },
     // 鑾峰彇鍏ㄩ儴鏂规
     getAll () {
@@ -255,7 +343,7 @@
     },
     add () {
       this.form.solutionList.push({
-        solutionId:null,
+        solutionId: null,
         solution: {},
         canAdd: '',
         canReduce: ''

--
Gitblit v1.9.3