响应式优化
This commit is contained in:
@ -60,26 +60,35 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['benyi:mathtermplan:edit']"
|
||||
>审批</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="mb8 btn-list">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['benyi:mathtermplan:edit']"
|
||||
>审批</el-button
|
||||
>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="mathtermplanList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" :selectable="isShow" />
|
||||
<el-table-column label="班级名称" align="center" prop="classid" :formatter="classFormat"/>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"
|
||||
:selectable="isShow"
|
||||
/>
|
||||
<el-table-column
|
||||
label="班级名称"
|
||||
align="center"
|
||||
prop="classid"
|
||||
:formatter="classFormat"
|
||||
/>
|
||||
<el-table-column
|
||||
label="计划名称"
|
||||
align="center"
|
||||
@ -141,14 +150,16 @@
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['benyi:mathtermplan:edit']"
|
||||
v-show="isShow(scope.row)"
|
||||
>审批</el-button>
|
||||
>审批</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['benyi:mathtermplan:query']"
|
||||
>预览</el-button>
|
||||
>预览</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -162,7 +173,7 @@
|
||||
/>
|
||||
|
||||
<!-- 添加或修改游戏数学学期计划对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" class="v-dialog" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="月份" prop="startmonth">
|
||||
<el-date-picker
|
||||
@ -176,7 +187,11 @@
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="学年学期" prop="xnxq">
|
||||
<el-select v-model="form.xnxq" placeholder="请选择学年学期" :disabled="true">
|
||||
<el-select
|
||||
v-model="form.xnxq"
|
||||
placeholder="请选择学年学期"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in xnxqOptions"
|
||||
:key="dict.dictValue"
|
||||
@ -186,7 +201,12 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" :disabled="true" />
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入备注"
|
||||
:disabled="true"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="审批意见" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
@ -195,7 +215,11 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="审批建议" prop="spyj">
|
||||
<el-input v-model="form.spyj" type="textarea" placeholder="请输入审核建议" />
|
||||
<el-input
|
||||
v-model="form.spyj"
|
||||
type="textarea"
|
||||
placeholder="请输入审核建议"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -213,7 +237,7 @@ import {
|
||||
delMathtermplan,
|
||||
addMathtermplan,
|
||||
updateMathtermplan,
|
||||
checkTermplan,
|
||||
checkTermplan
|
||||
} from "@/api/benyi/mathtermplan";
|
||||
|
||||
import { listClass } from "@/api/system/class";
|
||||
@ -257,25 +281,23 @@ export default {
|
||||
status: "1",
|
||||
spr: undefined,
|
||||
sptime: undefined,
|
||||
createuserid: undefined,
|
||||
createuserid: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
status: [{ required: true, message: "状态不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getClassList();
|
||||
this.getList();
|
||||
this.getDicts("sys_xnxq").then((response) => {
|
||||
this.getDicts("sys_xnxq").then(response => {
|
||||
this.xnxqOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_dm_planweekstatus").then((response) => {
|
||||
this.getDicts("sys_dm_planweekstatus").then(response => {
|
||||
this.statusOptions = response.data;
|
||||
});
|
||||
},
|
||||
@ -290,14 +312,14 @@ export default {
|
||||
},
|
||||
// 查询班级列表
|
||||
getClassList() {
|
||||
listClass(null).then((response) => {
|
||||
listClass(null).then(response => {
|
||||
this.classOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询游戏数学学期计划列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMathtermplan(this.queryParams).then((response) => {
|
||||
listMathtermplan(this.queryParams).then(response => {
|
||||
this.mathtermplanList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -307,7 +329,7 @@ export default {
|
||||
classFormat(row, column) {
|
||||
var actions = [];
|
||||
var datas = this.classOptions;
|
||||
Object.keys(datas).map((key) => {
|
||||
Object.keys(datas).map(key => {
|
||||
if (datas[key].bjbh == "" + row.classid) {
|
||||
actions.push(datas[key].bjmc);
|
||||
return false;
|
||||
@ -343,7 +365,7 @@ export default {
|
||||
sptime: undefined,
|
||||
remark: undefined,
|
||||
createuserid: undefined,
|
||||
createTime: undefined,
|
||||
createTime: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -359,16 +381,16 @@ export default {
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.ids = selection.map(item => item.id);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
|
||||
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getMathtermplan(id).then((response) => {
|
||||
getMathtermplan(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改游戏数学学期计划";
|
||||
@ -379,53 +401,48 @@ export default {
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
const time = this.form.startmonth;
|
||||
this.form.startmonth = time[0];
|
||||
this.form.endmonth = time[1];
|
||||
if (this.form.id != undefined) {
|
||||
updateMathtermplan(this.form).then((response) => {
|
||||
updateMathtermplan(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("审批成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 提交按钮操作 */
|
||||
handleCheck(row) {
|
||||
const id = row.id;
|
||||
this.$confirm(
|
||||
"是否确认提交游戏数学学期计划?提交后数据无法维护",
|
||||
"警告",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(function () {
|
||||
this.$confirm("是否确认提交游戏数学学期计划?提交后数据无法维护", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(function() {
|
||||
return checkTermplan(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("提交成功");
|
||||
})
|
||||
.catch(function () {});
|
||||
.catch(function() {});
|
||||
},
|
||||
/** 预览按钮操作 */
|
||||
handleView(row) {
|
||||
const id = row.id;
|
||||
this.$router.push({
|
||||
path: "/benyi_course/mathtermplanprint/table/"+id,
|
||||
path: "/benyi_course/mathtermplanprint/table/" + id
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user