serviceSet.vue 3.3 KB
<!-- 店面服务设置 -->
<template>
  <div class="before-sale edit-equity">
    <div class="container edit-container">
      <p class="edit-title">{{ title }}</p>
      <glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
    </div>
    <!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
    <div class="footer" :style="{ width: '100%' }">
      <el-button type="primary" @click="handleConfirm">确定</el-button>
      <!-- <el-button type="default" @click="handleCancel">取消</el-button> -->
    </div>
  </div>
</template>

<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
  name: 'serviceSet',
  data() {
    return {
      size: 'small',
      title: '店面服务设置',
      footerLeft: '0',
      footerWidth: '0',
      editChildRef: 'editChildRef',
      editForm: {
        hotline: ''
      },
      editRule: {
        hotline: [{ required: true, message: '请输入服务热线', trigger: 'change' }]
      },
      editFormData: [
        {
          label: '服务热线',
          name: 'hotline',
          width: '320px',
          type: 'input',
          maxlength: 20
        }
      ]
    }
  },

  components: {
    glsxCombiForm
  },

  mounted() {
    this.getHotline()
  },

  methods: {
    getHotline() {
      this.$apis.beforeSale.getHotlineApi({}).then(res => {
        this.editForm.hotline = res
      })
    },
    handleConfirm() {
      this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
        if (valid) {
          var params = this.$common.utils.deepClone(this.editForm)
          this.$apis.beforeSale.updateHotlineApi(params).then(res => {
            this.$message({
              message: res.code == '0' ? '操作成功' : '操作失败',
              type: res.code == '0' ? 'success' : 'error'
            })
          })
        }
      })
    }
  }
}
</script>
<style scoped>
.before-sale .container {
  padding: 0px 20px 20px 40px;
  background: #ffffff;
  box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
  padding: 20px;
}

.before-sale .edit-container {
  margin-bottom: 84px;
}

.before-sale .edit-form-container {
  margin-top: 20px;
}

.before-sale .txt-center {
  text-align: center;
}

.before-sale .footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 64px;
  /* left: 220px; */
  text-align: center;
  line-height: 64px;
  background: #ffffff;
  z-index: 999;
}

.before-sale .flex {
  display: flex;
  justify-content: space-between;
}

.before-sale .flex-grow {
  flex: 1;
}

.before-sale .edit-title {
  font-size: 16px;
  font-weight: bold;
  height: 48px;
  line-height: 48px;
  border-bottom: 1px solid #E7EAEC;
  margin: 0 0;
}

.before-sale .edit-sub-title {
  position: relative;
  font-size: 13px;
  font-weight: 700;
  height: 32px;
  line-height: 32px;
  color: #333333;
  margin-bottom: 20px;
  padding-left: 8px;
  background-color: rgba(242, 242, 242, 1);
}

.before-sale .message-Z-zinde {
  z-index: 3000 !important;
}

.before-sale .txt-red {
  color: red;
}

.one-line-ellipsis {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
</style>