aaa
nidapeng
2024-03-14 8b46c471e28fbf0b71efbe363facf0bf05d8f6f8
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: ''