From c01dff9a24f98f10f247d2f2e449383f567ec338 Mon Sep 17 00:00:00 2001
From: 唐耀东 <18861537@qq.com>
Date: 星期三, 18 五月 2022 14:55:48 +0800
Subject: [PATCH] 提交代码
---
src/views/construction/constructionBatch/index.vue | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/views/construction/constructionBatch/index.vue b/src/views/construction/constructionBatch/index.vue
index 946b5c3..52da7f9 100644
--- a/src/views/construction/constructionBatch/index.vue
+++ b/src/views/construction/constructionBatch/index.vue
@@ -106,6 +106,7 @@
<el-date-picker
v-model="form.date"
type="daterange"
+ value-format="yyyy-MM-dd"
range-separator="鑷�"
start-placeholder="寮�濮嬫棩鏈�"
end-placeholder="鎴嚦鏃ユ湡">
@@ -142,6 +143,12 @@
export default {
name: "ConstructionBatch",
+ props: {
+ schoolId: {
+ type: Number,
+ default: undefined
+ }
+ },
data() {
return {
// 鎸夐挳loading
@@ -193,6 +200,11 @@
userList: []
};
},
+ watch: {
+ 'schoolId': function () {
+ this.getList()
+ }
+ },
created() {
this.getList();
},
@@ -200,7 +212,7 @@
/** 鏌ヨ鏂藉伐鎵规鍒楄〃 */
getList() {
this.loading = true;
- listConstructionBatch(this.queryParams).then(response => {
+ listConstructionBatch(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
this.constructionBatchList = response.rows;
this.total = response.total;
this.loading = false;
@@ -264,8 +276,9 @@
const id = row.id || this.ids
getConstructionBatch(id).then(response => {
this.loading = false;
- this.form = response.data;
- this.form.date = [this.form.startDate, this.form.endDate]
+ // this.form = response.data;
+ const localDate = [response.data.startDate, response.data.endDate];
+ this.form = Object.assign({}, response.data, {date: localDate})
this.open = true;
this.title = "淇敼鏂藉伐鎵规";
});
@@ -273,11 +286,11 @@
/** 鎻愪氦鎸夐挳 */
submitForm() {
this.$refs["form"].validate(valid => {
- console.log(this.form.date)
this.form.startDate = this.form.date[0];
this.form.endDate = this.form.date[1];
if (valid) {
this.buttonLoading = true;
+ this.form.schoolId = this.schoolId;
if (this.form.id != null) {
updateConstructionBatch(this.form).then(response => {
this.$modal.msgSuccess("淇敼鎴愬姛");
--
Gitblit v1.9.1