jiangping
2024-06-20 09da100729793848bc01b51f7b05ca3f1e7ec64f
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: ''