优化
This commit is contained in:
@ -87,13 +87,14 @@
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['benyi:schoolcalendar:edit']"
|
||||
>修改</el-button>
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['benyi:schoolcalendar:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@ -114,6 +115,7 @@
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
border
|
||||
v-loading="loading"
|
||||
:data="schoolcalendarList"
|
||||
@selection-change="handleSelectionChange"
|
||||
@ -125,7 +127,7 @@
|
||||
:selectable="checkSelectable"
|
||||
/>
|
||||
<!-- <el-table-column label="编号" align="center" prop="id" /> -->
|
||||
<el-table-column label="名称" align="center" prop="name" />
|
||||
<el-table-column fixed label="名称" align="center" prop="name" />
|
||||
<el-table-column
|
||||
label="活动类型"
|
||||
align="center"
|
||||
@ -167,6 +169,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="120"
|
||||
@ -275,7 +278,7 @@ import {
|
||||
delSchoolcalendar,
|
||||
addSchoolcalendar,
|
||||
updateSchoolcalendar,
|
||||
exportSchoolcalendar
|
||||
exportSchoolcalendar,
|
||||
} from "@/api/benyi/schoolcalendar";
|
||||
|
||||
export default {
|
||||
@ -312,7 +315,7 @@ export default {
|
||||
pickerOptions0: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now() - 8.64e7;
|
||||
}
|
||||
},
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
@ -325,7 +328,7 @@ export default {
|
||||
deptid: undefined,
|
||||
activitytime: undefined,
|
||||
createuserid: undefined,
|
||||
createtime: undefined
|
||||
createtime: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@ -333,26 +336,26 @@ export default {
|
||||
rules: {
|
||||
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
||||
type: [
|
||||
{ required: true, message: "活动类型不能为空", trigger: "blur" }
|
||||
{ required: true, message: "活动类型不能为空", trigger: "blur" },
|
||||
],
|
||||
scope: [
|
||||
{ required: true, message: "活动范围不能为空", trigger: "blur" }
|
||||
{ required: true, message: "活动范围不能为空", trigger: "blur" },
|
||||
],
|
||||
activitytime: [
|
||||
{ required: true, message: "活动时间不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
{ required: true, message: "活动时间不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDicts("sys_schoolcalendartype").then(response => {
|
||||
this.getDicts("sys_schoolcalendartype").then((response) => {
|
||||
this.schoolcalendartypeOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_yebjlx").then(response => {
|
||||
this.getDicts("sys_yebjlx").then((response) => {
|
||||
this.scopeOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_xnxq").then(response => {
|
||||
this.getDicts("sys_xnxq").then((response) => {
|
||||
this.xnxqOptions = response.data;
|
||||
});
|
||||
},
|
||||
@ -394,7 +397,7 @@ export default {
|
||||
this.loading = true;
|
||||
listSchoolcalendar(
|
||||
this.addDateRange(this.queryParams, this.dateRange)
|
||||
).then(response => {
|
||||
).then((response) => {
|
||||
this.schoolcalendarList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -412,7 +415,7 @@ export default {
|
||||
name: undefined,
|
||||
type: undefined,
|
||||
scope: undefined,
|
||||
activitytime: undefined
|
||||
activitytime: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -429,7 +432,7 @@ 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;
|
||||
},
|
||||
@ -444,7 +447,7 @@ export default {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
var myArray = new Array(2);
|
||||
getSchoolcalendar(id).then(response => {
|
||||
getSchoolcalendar(id).then((response) => {
|
||||
this.form = response.data;
|
||||
myArray[0] = response.data.activitytime;
|
||||
myArray[1] = response.data.activityendtime;
|
||||
@ -457,8 +460,8 @@ export default {
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
var arrscope = this.form.scope;
|
||||
this.form.scope = arrscope.join(";");
|
||||
@ -469,7 +472,7 @@ export default {
|
||||
this.form.activityendtime = v2;
|
||||
|
||||
if (this.form.id != undefined) {
|
||||
updateSchoolcalendar(this.form).then(response => {
|
||||
updateSchoolcalendar(this.form).then((response) => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
@ -480,7 +483,7 @@ export default {
|
||||
});
|
||||
} else {
|
||||
//console.log(this.form.activitytime[1]);
|
||||
addSchoolcalendar(this.form).then(response => {
|
||||
addSchoolcalendar(this.form).then((response) => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
@ -502,17 +505,17 @@ export default {
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(function() {
|
||||
.then(function () {
|
||||
return delSchoolcalendar(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(function() {});
|
||||
.catch(function () {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@ -520,16 +523,16 @@ export default {
|
||||
this.$confirm("是否确认导出所有园历管理数据项?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
type: "warning",
|
||||
})
|
||||
.then(function() {
|
||||
.then(function () {
|
||||
return exportSchoolcalendar(queryParams);
|
||||
})
|
||||
.then(response => {
|
||||
.then((response) => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
.catch(function() {});
|
||||
}
|
||||
}
|
||||
.catch(function () {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user