MrShi
2026-05-22 eb7a808aaf7dd0a6dd2ff70f9ef3f8ce0b1e31d1
admin/src/components/business/OperaShopApprovalWindow.vue
@@ -130,7 +130,7 @@
        </template>
      </div>
      <div class="qualification-section" v-if="storeInfo.companyType === 1">
      <div class="qualification-section">
        <h4 class="section-title">门店照片及其他材料</h4>
        <div class="image-item-row">
          <span class="label">门店门头照:</span>
@@ -182,7 +182,7 @@
    </div>
    <div class="approval-form" v-if="storeInfo && storeInfo.auditStatus === 0">
      <el-form ref="approvalForm" :model="approvalForm" :rules="approvalRules">
      <el-form ref="approvalForm" :model="approvalForm" :rules="approvalForm.auditStatus === 1 ? approvalRules : approvalRules1">
        <el-form-item label="审批结果" prop="auditStatus">
          <el-radio-group v-model="approvalForm.auditStatus" @change="handleAuditStatusChange">
            <el-radio :label="0">通过</el-radio>
@@ -198,6 +198,31 @@
            style="width: 300px"
          ></el-input>
        </el-form-item>
        <div class="profit-section" v-if="approvalForm.auditStatus === 0">
          <h4 class="section-title">就地寄存模式</h4>
          <el-form-item label="在订单中作为寄件点时,分成比例为" prop="localDeposit">
            <div class="profit-input">
              <el-input v-model="approvalForm.localDeposit" placeholder="请输入分成比例" style="width: 150px;"></el-input>
              <span class="unit">%</span>
            </div>
          </el-form-item>
        </div>
        <div class="profit-section" v-if="approvalForm.auditStatus === 0">
          <h4 class="section-title">同城寄送模式</h4>
          <el-form-item label="在订单中作为寄件点时,分成比例为" prop="remoteDeposit">
            <div class="profit-input">
              <el-input v-model="approvalForm.remoteDeposit" placeholder="请输入分成比例" style="width: 150px;"></el-input>
              <span class="unit">%</span>
            </div>
          </el-form-item>
          <el-form-item label="在订单中作为收件点时,分成比例为" prop="remoteTake">
            <div class="profit-input">
              <el-input v-model="approvalForm.remoteTake" placeholder="请输入分成比例" style="width: 150px;"></el-input>
              <span class="unit">%</span>
            </div>
          </el-form-item>
        </div>
        <section class="approval-buttons">
          <el-button type="primary" @click="handleSubmit" :loading="isWorking.submit">提交</el-button>
          <el-button @click="handleCancel">取消</el-button>
@@ -222,11 +247,28 @@
      approvalForm: {
        id: null,
        auditStatus: 0,
        auditRemark: ''
        auditRemark: '',
        localDeposit: '',
        remoteTake: '',
        remoteDeposit: ''
      },
      approvalRules: {
        auditRemark: [
          { required: true, message: '请输入拒绝原因', trigger: 'blur' }
        ]
      },
      approvalRules1: {
        localDeposit: [
          { required: true, message: '请输入分成比例', trigger: 'blur' },
          { validator: this.validateDepositRate, trigger: 'blur' }
        ],
        remoteTake: [
          { required: true, message: '请输入分成比例', trigger: 'blur' },
          { validator: this.validateDepositRate, trigger: 'blur' }
        ],
        remoteDeposit: [
          { required: true, message: '请输入分成比例', trigger: 'blur' },
          { validator: this.validateDepositRate, trigger: 'blur' }
        ]
      },
      isWorking: {
@@ -241,16 +283,49 @@
    })
  },
  methods: {
    validateDepositRate (rule, value, callback) {
      if (value !== null && value !== '' && value !== undefined) {
        const num = Number(value)
        if (isNaN(num)) {
          callback(new Error('请输入有效数字'))
        } else if (num < 1) {
          callback(new Error('必须大于等于1'))
        } else {
          const str = String(num)
          if (str.includes('.')) {
            const decimal = str.split('.')[1]
            if (decimal.length > 1) {
              callback(new Error('最多支持一位小数'))
            } else {
              callback()
            }
          } else {
            callback()
          }
        }
      } else {
        callback()
      }
    },
    changeRadio(){
      this.$refs.approvalForm.clearValidate()
    },
    open (title, row) {
      this.title = title
      this.approvalForm = {
        id: row.id,
        auditStatus: 1,
        auditRemark: ''
        auditRemark: '',
        localDeposit: '',
        remoteTake: '',
        remoteDeposit: ''
      }
      detail(row.id)
        .then(res => {
          this.storeInfo = res
          this.approvalForm.localDeposit = res.localDeposit || ''
          this.approvalForm.remoteTake = res.remoteTake || ''
          this.approvalForm.remoteDeposit = res.remoteDeposit || ''
          this.visible = true
        })
        .catch(e => {
@@ -258,11 +333,9 @@
        })
    },
    handleAuditStatusChange (val) {
      if (val === 1) {
        this.approvalRules.auditRemark = []
      } else {
        this.approvalRules.auditRemark = [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]
      }
      this.$nextTick(() => {
        this.$refs.approvalForm.clearValidate()
      })
    },
    handleSubmit () {
      this.$refs.approvalForm.validate(valid => {
@@ -290,6 +363,30 @@
</script>
<style scoped>
.profit-section {
  margin-bottom: 30px;
  background: #f5f7fa;
  border-radius: 4px;
}
.profit-section .section-title {
  font-size: 16px;
  font-weight: bold;
  color: #303133;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4e7ed;
}
.profit-input {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inline-form /deep/ .el-form-item {
  display: block;
  margin-right: 0;
}
.store-header {
  display: flex;
  background: #f5f7fa;