| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?php
- use common\helpers\ComponentHelper;
- ?>
- <div id="app" v-cloak>
- <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1500px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>基础设置</span>
- </div>
- </div>
- <div class="form_box">
- <el-form :model="ruleForm" size="small" ref="ruleForm" label-width="150px">
- <el-card shadow="never">
- <div>
- <el-row>
- <el-col :span="16">
- <el-form-item prop="template_no" label="模板编号">
- <el-col :span="8" style="width: 100%">
- <el-input v-model="ruleForm.template_no" >
- </el-input>
- </el-col>
- <div class="tips-text" style="line-height: 24px;">
- </div>
- </el-form-item>
- <el-form-item prop="template_id" label="模板ID">
- <el-col :span="8" style="width: 100%">
- <el-input v-model="ruleForm.template_id">
- </el-input>
- </el-col>
- <div class="tips-text" style="line-height: 24px;">
- </div>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </el-card>
- </el-form>
- <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;"
- @click="store('ruleForm')" size="small">保存
- </el-button>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- btnLoading: false,
- ruleForm: {
- template_no: '',
- template_id: '',
- },
- }
- },
- mounted: function () {
- this.loadData();
- },
- methods: {
- loadData() {
- this.loading = true;
- request({
- params: {
- r: 'course/course-promoter/setting',
- },
- method: 'get'
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- this.ruleForm = Object.assign(this.ruleForm, e.data.data.list);
- }
- }).catch(e => {
- this.loading = false;
- })
- },
- store(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.btnLoading = true;
- request({
- params: {
- r: 'course/course-promoter/setting',
- },
- method: 'post',
- data: this.ruleForm
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code == 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.$message.error(e);
- this.btnLoading = false;
- })
- } else {
- this.btnLoading = false;
- console.log('error submit!!');
- return false;
- }
- });
- },
- }
- });
- </script>
- <style>
- .form_box {
- background-color: #f3f3f3;
- padding: 0 0 20px;
- }
- .button-item {
- margin-top: 12px;
- padding: 9px 25px;
- }
- .el-input-group__append {
- background-color: #fff;
- color: #353535;
- }
- </style>
|