123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406 |
- <template>
- <div class="m-container">
- <div class="m-core">
- <!-- <el-button size="mini" type="primary">添加规则</el-button> -->
- <el-form :inline="true" :model="form" ref="form">
- <el-alert
- style="margin: 20px 0"
- title="财务规则"
- :closable="false"
- type="info"
- >
- </el-alert>
- <el-row>
- <el-form-item
- prop="91"
- :rules="[
- {
- required: false,
- pattern:
- /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
- message: '请输入正确的人数',
- },
- ]"
- >
- 基本课酬
- <el-input v-model="form['91']" size="mini" placeholder="请输入金额">
- <template slot="append">元</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- prop="73"
- :rules="[
- {
- required: false,
- pattern:
- /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
- message: '请输入正确的人数',
- },
- ]"
- >
- 全职资源公摊金额
- <el-input v-model="form['73']" size="mini" placeholder="请输入金额">
- <template slot="append">元</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-alert
- style="margin: 20px 0"
- title="学员练习参数"
- :closable="false"
- type="info"
- >
- </el-alert>
- <el-row>
- <el-form-item
- prop="106"
- :rules="[
- {
- required: false,
- pattern: /^[1-9][0-9]*$/,
- message: '请输入正确的分钟数',
- },
- ]"
- >
- 学员每周使用团练宝时长小于
- <el-input
- v-model="form['106']"
- size="mini"
- placeholder="请输入分钟数"
- >
- <template slot="append">分钟</template> </el-input
- >时需要回访
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- prop="107"
- :rules="[
- {
- required: false,
- pattern: /^[1-9][0-9]*$/,
- message: '请输入正确的次数',
- },
- ]"
- >
- 学员每周使用团练宝练习次数小于
- <el-input
- v-model="form['107']"
- size="mini"
- placeholder="请输入次数"
- >
- <template slot="append">次</template> </el-input
- >时需要回访
- </el-form-item>
- </el-row>
- <el-alert
- style="margin: 20px 0"
- title="特殊参数"
- :closable="false"
- type="info"
- >
- </el-alert>
- <el-row>
- <el-form-item prop="108">
- 团练宝活动分部目标
- <el-input
- class="marginLR5"
- style="width: 180px"
- v-model="form['108']"
- size="mini"
- placeholder="请输入分部目标"
- >
- </el-input>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item prop="109">
- 团练宝活动预约开始时间
- <el-date-picker
- class="marginLR5"
- v-model="form['109']"
- type="datetime"
- format="yyyy-MM-dd HH:mm:ss"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="选择开始日期"
- size="mini"
- >
- </el-date-picker>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item prop="110">
- 团练宝活动预约结束时间
- <el-date-picker
- class="marginLR5"
- v-model="form['110']"
- type="datetime"
- format="yyyy-MM-dd HH:mm:ss"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="选择开始日期"
- size="mini"
- >
- </el-date-picker>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item prop="111">
- 团练宝活动开屏广告编号
- <el-input
- class="marginLR5"
- v-model="form['111']"
- size="mini"
- placeholder="请输入编号"
- style="width: 180px"
- />
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item prop="111">
- 支持考级活动报名的分部编号
- <el-input
- class="marginLR5"
- v-model="form['111']"
- size="mini"
- placeholder="请输入编号"
- style="width: 180px"
- />
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item prop="199">
- 考级活动开始时间
- <el-date-picker
- class="marginLR5"
- v-model="form['199']"
- type="datetime"
- format="yyyy-MM-dd HH:mm:ss"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="选择开始日期"
- size="mini"
- >
- </el-date-picker>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item prop="200">
- 考级活动结束时间
- <el-date-picker
- class="marginLR5"
- v-model="form['200']"
- type="datetime"
- format="yyyy-MM-dd HH:mm:ss"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="选择开始日期"
- size="mini"
- >
- </el-date-picker>
- </el-form-item>
- </el-row>
- <!-- <el-row>
- <el-form-item
- prop="203"
- :rules="[
- {
- required: false,
- pattern: /^[1-9][0-9]*$/,
- message: '请输入正确的分钟数',
- },
- ]"
- >
- 云教室可提前
- <el-input
- v-model="form['203']"
- placeholder="请输入分钟数"
- size="mini"
- >
- <template slot="append">分钟</template> </el-input
- >进入教室
- </el-form-item>
- </el-row> -->
- <el-row>
- <el-form-item
- prop="61"
- :rules="[
- {
- required: false,
- pattern: /^[1-9][0-9]*$/,
- message: '请输入正确的分钟数',
- },
- ]"
- >
- 云教室可提前:
- <el-input
- v-model="form['61']"
- placeholder="请输入分钟数"
- size="mini"
- >
- <template slot="append">分钟</template>
- </el-input>
- 进入教室
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- prop="60"
- :rules="[
- {
- required: false,
- pattern: /^[1-9][0-9]*$/,
- message: '请输入正确的分钟数',
- },
- ]"
- >
- 课程结束后:
- <el-input
- v-model="form['60']"
- placeholder="请输入分钟数"
- size="mini"
- >
- <template slot="append">分钟</template>
- </el-input>
- 网络教室自动关闭
- </el-form-item>
- </el-row>
- </el-form>
- <el-button
- size="mini"
- type="primary"
- @click="save"
- class="saveBtn"
- v-if="!isPlatform"
- v-permission="'sysTenantConfig/batchUpSet_otherRules'"
- >保存</el-button
- >
- <el-button
- size="mini"
- type="primary"
- @click="save"
- class="saveBtn"
- v-else
- v-permission="'sysConfig/batchUpdate_otherRules'"
- >保存</el-button
- >
- </div>
- </div>
- </template>
- <script>
- import {
- getSysTenantConfig,
- questionnaireTopicQueryPage,
- setSysTenantConfig,
- } from "@/views/courseRulersManager/api";
- import { sysConfigList, sysConfigUpdate } from "@/api/generalSettings"; // 平台的修改和查
- export default {
- props: ["isPlatform"],
- data() {
- return {
- form: {},
- questionList: [],
- rulesVisiable: false,
- };
- },
- async mounted() {
- this.getRules();
- try {
- const res = await questionnaireTopicQueryPage({ page: 1, rows: 999 });
- this.questionList = res.data.rows.map((item) => {
- return {
- label: item.title,
- value: String(item.id),
- };
- });
- } catch (e) {
- console.log(e);
- }
- },
- methods: {
- getRules() {
- if (this.isPlatform) {
- this.getPlatformRules();
- } else {
- this.getInstitutionRules();
- }
- },
- async getPlatformRules() {
- try {
- const res = await sysConfigList({ group: "DAYA_BASIC" });
- res.data.forEach((item) => {
- // this.form[item.paramName] = item.paranValue
- this.$set(this.form, item.id, item.paranValue);
- });
- // this.$forceUpdate()
- console.log(this.form);
- } catch (e) {
- console.log(e);
- }
- },
- async getInstitutionRules() {
- try {
- const res = await getSysTenantConfig({ group: "DAYA_BASIC" });
- res.data.forEach((item) => {
- // this.form[item.paramName] = item.paranValue
- this.$set(this.form, item.id, item.paranValue);
- });
- // this.$forceUpdate()
- console.log(this.form);
- } catch (e) {
- console.log(e);
- }
- },
- savePlatform() {
- this.$refs.form.validate(async (valid) => {
- if (valid) {
- let param = [];
- for (let i in this.form) {
- param.push({
- id: i,
- paranValue: this.form[i],
- });
- }
- try {
- const res = await sysConfigUpdate(param);
- this.$message.success("保存成功");
- this.getRules();
- } catch (e) {
- console.log(e);
- }
- }
- });
- },
- saveInstitution() {
- this.$refs.form.validate(async (valid) => {
- if (valid) {
- let param = [];
- for (let i in this.form) {
- param.push({
- id: i,
- paranValue: this.form[i],
- });
- }
- try {
- const res = await setSysTenantConfig(param);
- this.$message.success("保存成功");
- this.getRules();
- } catch (e) {
- console.log(e);
- }
- }
- });
- },
- save() {
- if (this.isPlatform) {
- this.savePlatform();
- } else {
- this.saveInstitution();
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- @import "~@scss/views/courseRulersManager/index.scss";
- </style>
|