|
@@ -66,7 +66,7 @@
|
|
|
multiple
|
|
|
collapse-tags
|
|
|
v-model="recordData.type"
|
|
|
- placeholder="请选择教研室"
|
|
|
+ placeholder="请选择维度"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item, index) in weiList"
|
|
@@ -154,11 +154,11 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div
|
|
|
- style="width: 500px;display: flex;justify-content: flex-end;"
|
|
|
- v-if="judgeNum"
|
|
|
- >
|
|
|
- <div class="updateCordSty" @click="open">修改</div>
|
|
|
+ <div style="width: 500px;display: flex;justify-content: flex-end;">
|
|
|
+ <div class="updateCordSty" v-if="judgeNum == 1" @click="open">修改</div>
|
|
|
+ <div class="updateCordSty" v-if="judgeNum == 2" @click="addRecordOpen">
|
|
|
+ 添加
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div v-if="proVisible" class="mask">
|
|
@@ -187,6 +187,9 @@ export default {
|
|
|
type: Number,
|
|
|
default: 0
|
|
|
},
|
|
|
+ sUserId: {
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
recordDataCopy: {
|
|
|
type: Object,
|
|
|
default: () => {
|
|
@@ -229,18 +232,83 @@ export default {
|
|
|
previewImg(url) {
|
|
|
this.$hevueImgPreview(url);
|
|
|
},
|
|
|
+ addRecordOpen() {
|
|
|
+ if (!this.recordData.type.length) {
|
|
|
+ this.$message({
|
|
|
+ message: "请选择纬度",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // console.log(this.recordData.recordDates);
|
|
|
+ if (!this.recordData.recordDate) {
|
|
|
+ this.$message({
|
|
|
+ message: "请选择时间",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // return
|
|
|
+ this.$confirm("是否添加新纪录?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.addRecord();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ // 添加新纪录
|
|
|
+ addRecord() {
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ uid: this.sUserId,
|
|
|
+ tid: this.$route.query.userid,
|
|
|
+ contact: this.recordData.contact.join(","),
|
|
|
+ type: this.recordData.type.join(","),
|
|
|
+ timing: this.recordData.recordDate,
|
|
|
+ place: this.recordData.place,
|
|
|
+ observeCon: this.recordData.recordTit,
|
|
|
+ recordCon: this.recordData.recordContent,
|
|
|
+ imgList: this.recordData.recordImg.join(","),
|
|
|
+ term: this.recordData.term,
|
|
|
+ pid: 1
|
|
|
+ }
|
|
|
+ ];
|
|
|
+
|
|
|
+ console.log("添加新纪录", params);
|
|
|
+
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "insertRecord", params)
|
|
|
+ .then(res => {
|
|
|
+ console.log(res);
|
|
|
+ this.$emit("closePop");
|
|
|
+ this.$emit("getData");
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "添加成功"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
// 确认修改记录提示?
|
|
|
open() {
|
|
|
// console.log(this.recordData);
|
|
|
|
|
|
if (!this.recordData.type.length) {
|
|
|
this.$message({
|
|
|
- type: "success",
|
|
|
message: "请选择纬度",
|
|
|
type: "warning"
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
+ // console.log(this.recordData.recordDates);
|
|
|
+ if (!this.recordData.recordDate) {
|
|
|
+ this.$message({
|
|
|
+ message: "请选择时间",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
// return
|
|
|
this.$confirm("是否修改?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -248,10 +316,7 @@ export default {
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.updateCord();
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "已修改"
|
|
|
- });
|
|
|
+
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
@@ -284,17 +349,39 @@ export default {
|
|
|
.post(this.$store.state.api + "updateRecordData", params)
|
|
|
.then(res => {
|
|
|
console.log(res);
|
|
|
+
|
|
|
this.$emit("closePop");
|
|
|
this.$emit("getData");
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "修改成功"
|
|
|
+ });
|
|
|
});
|
|
|
// updateRecordData
|
|
|
},
|
|
|
|
|
|
// 删除图片
|
|
|
delImg(e) {
|
|
|
- console.log("删除图片", e);
|
|
|
- const iii = this.recordData.recordImg.indexOf(e);
|
|
|
- this.recordData.recordImg.splice(iii, 1);
|
|
|
+ // console.log("删除图片", e);
|
|
|
+ this.$confirm("是否删除?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ const iii = this.recordData.recordImg.indexOf(e);
|
|
|
+ this.recordData.recordImg.splice(iii, 1);
|
|
|
+ // this.$message({
|
|
|
+ // type: "success",
|
|
|
+ // message: "已修改"
|
|
|
+ // });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // this.$message({
|
|
|
+ // type: "info",
|
|
|
+ // message: "已取消修改"
|
|
|
+ // });
|
|
|
+ });
|
|
|
+
|
|
|
// this.recordData.recordImg = this.recordData.recordImg.
|
|
|
},
|
|
|
addImg(e) {
|
|
@@ -487,7 +574,7 @@ export default {
|
|
|
justify-content: flex-end;
|
|
|
/* justify-content: space-between; */
|
|
|
}
|
|
|
-/deep/ .el-input__inner {
|
|
|
+.cellBlock >>> .el-input__inner {
|
|
|
width: 400px;
|
|
|
}
|
|
|
.imgBlock {
|