From 6378fa4ea01c8c6a92bd3bf710686f5deedf99dd Mon Sep 17 00:00:00 2001
From: yz3456 <2753272399@qq.com>
Date: 星期六, 06 四月 2024 17:45:29 +0800
Subject: [PATCH] 完善家庭会议模块
---
ruoyi-ui/src/views/selfeconomy/memo.vue | 141 +++++++++++++++++++++++++++++++++-------------
1 files changed, 101 insertions(+), 40 deletions(-)
diff --git a/ruoyi-ui/src/views/selfeconomy/memo.vue b/ruoyi-ui/src/views/selfeconomy/memo.vue
index 4ea5afd..ce16402 100644
--- a/ruoyi-ui/src/views/selfeconomy/memo.vue
+++ b/ruoyi-ui/src/views/selfeconomy/memo.vue
@@ -18,7 +18,7 @@
size="mini"
type="text"
icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
+ @click="editAutobiography(scope.row)"
v-hasPermi="['familymodel:economy:info']"
>淇敼</el-button>
<el-button
@@ -43,29 +43,32 @@
<!-- 娣诲姞鎴栦慨鏀硅祫浜т俊鎭厤缃璇濇 -->
- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
- <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px">
+ <el-dialog :title="isEdit1 ? '缂栬緫' : '鏂板'" :visible.sync="open" width="900px" append-to-body>
+ <el-col >
+ <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px">
- <el-form-item label="鏃堕棿" prop="happenTime">
- <el-date-picker
- v-model='formDat.happenTime'
- type='date'
- placeholder='閫夋嫨鏃ユ湡'
- ></el-date-picker>
- </el-form-item>
+ <el-form-item label="鏃堕棿" prop="happenTime">
+ <el-date-picker
+ v-model='formDat.happenTime'
+ type='date'
+ placeholder='閫夋嫨鏃ユ湡'
+ value-format="yyyy-MM-dd"
+ ></el-date-picker>
+ </el-form-item>
- <el-form-item label="鍐呭" prop="content">
- <el-input v-model="formDat.content" placeholder="璇疯緭鍏ュ唴瀹�" clearable :style="{width: '100%'}" >
- </el-input>
- </el-form-item>
+ <el-form-item label="鍐呭" prop="content">
+ <el-input v-model="formDat.content" placeholder="璇疯緭鍏ュ唴瀹�" clearable :style="{width: '100%'}" >
+ </el-input>
+ </el-form-item>
- </el-form>
+ </el-form>
+ </el-col>
<h4 class="form-header"> </h4>
<div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitDataScope">纭� 瀹�</el-button>
+ <el-button type="primary" @click="submitDataScope6">淇� 瀛�</el-button>
<el-button @click="cancelData">鍙� 娑�</el-button>
</div>
</el-dialog>
@@ -85,7 +88,7 @@
//鍦╯ystem/note/index.js涓鍏ユ帴鍙e嚱鏁� --鎺ュソ浜�
-import {addNote,listNote,enload,delNote, uploadPic} from "@/api/allmemo/index";
+import {addNote, listNote, enload, delNote, uploadPic, updateNote} from "@/api/allmemo/index";
import { TimeSelect } from "element-ui";
export default {
@@ -93,6 +96,7 @@
dicts: ['sys_normal_disable'],
data() {
return {
+ isEdit1:false,
// 閬僵灞�
disabled: false,
loading: true,
@@ -195,9 +199,23 @@
// 鍙栨秷鎸夐挳
cancelData() {
this.open = false;
+ Object.keys(this.formDat).forEach(key => {
+ this.formDat[key] = '';
+ });
this.reset();
},
-
+ editAutobiography(row) {
+ const id = row.id;
+ console.log(id)
+ console.log(row.content)
+ this.isEdit1 = true;
+ this.formDat.cid = row.cid;
+ this.formDat.id = row.id;
+ this.formDat.happenTime = row.happenTime;
+ this.formDat.content = row.content;
+ this.open = true;
+ console.log(this.formDat)
+ },
//闅旇鍙樿壊
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 0) {
@@ -220,8 +238,9 @@
listNote(cid, 2026).then(response => {
this.memoList = response.data;
console.log(this.memoList)
- this.total = response.data.total;
+ // this.total = response.data.total;
this.loading = false;
+
}
);
},
@@ -232,7 +251,55 @@
this.$delete(this.fileListOther,i);
}
},
+ //涓汉鑷紶鐨勪繚瀛�
+ submitDataScope6: function() {
+ const cid = this.$route.params && this.$route.params.id;
+ const fid =2026;
+ this.formDat.fid = 2026;
+ this.formDat.cid = cid ;
+ console.log(this.formDat)
+ console.log(this.isEdit1)
+ this.$refs["elForm"].validate(valid => {
+ if (valid) {
+ if (this.isEdit1) {
+ // 鎵ц淇敼鎿嶄綔
+ updateNote(this.formDat).then(response => {
+ console.log("1")
+ this.$modal.msgSuccess("淇敼鎴愬姛");
+ this.open = false;
+ //娓呯┖formDat瀵硅薄鐨勬暟鎹�
+ Object.keys(this.formDat).forEach(key => {
+ this.formDat[key] = '';
+ });
+ this.isEdit1 = false;
+ this.getList(2026,cid);
+ }).catch(error => {
+ console.log(error);
+ this.isEdit1 = false;
+ this.open = false;
+ });
+ } else {
+ // 鎵ц鏂板鎿嶄綔
+ addNote(this.formDat).then(response => {
+ // this.formDat.term = selectedOption.label;
+ this.$modal.msgSuccess("鏂板鎴愬姛");
+ this.open = false;
+ //娓呯┖formDat瀵硅薄鐨勬暟鎹�
+ Object.keys(this.formDat).forEach(key => {
+ this.formDat[key] = '';
+ });
+ this.getList(2026,cid);
+ }).catch(error => {
+ console.log(error);
+ this.open = false;
+ });
+ }
+ }
+ });
+ // 閲嶇疆isEdit涓篺alse锛屼互渚夸笅娆$偣鍑绘柊澧炴椂涓烘柊澧炴搷浣�
+ this.isEdit1 = false;
+ },
// 鍙栨秷鎸夐挳
cancel() {
this.open = false;
@@ -299,18 +366,12 @@
this.title = "鏂板澶囧繕鏈�";
},
- /** 淇敼鎸夐挳鎿嶄綔 */
- handleUpdate(row) {
- const id = row.id;
- let jd = true
-
- this.$router.push({
- path:"/self/travel/travelInfo/" + id,
- query:{
- detail:jd
- }
- });
- },
+ // /** 淇敼鎸夐挳鎿嶄綔 */
+ // handleUpdate(row) {
+ // const id = row.id;
+ //
+ //
+ // },
handlePictureCardPreview(file) {
@@ -329,24 +390,24 @@
this.formDat.fid = 2026;
this.formDat.cid = cid ;
this.formDat.url = ul+","+uls
-
+ console.log(this.formDat)
+ // debugger
this.$refs["elForm"].validate(valid => {
if (valid) {
addNote(this.formDat).then(response => {
this.$modal.msgSuccess("鏂板鎴愬姛");
this.open = false;
- // this.queryParams.cid = cid
- // this.queryParams.fid = fid
- this.getList(this.formDat.fid,this.formDat.cid);
- resetQuery();
+ //娓呯┖formDat瀵硅薄鐨勬暟鎹�
+ Object.keys(this.formDat).forEach(key => {
+ this.formDat[key] = '';
+ });
+ this.getList(2026,cid);
+
});
}
});
- //娓呯┖formDat瀵硅薄鐨勬暟鎹�
- Object.keys(this.formDat).forEach(key => {
- this.formDat[key] = '';
- });
+
},
requestUpload(params)
{
--
Gitblit v1.9.1