|
@@ -23,25 +23,25 @@
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
<uni-forms-item name="type" label="主题类型" required label-width="30%">
|
|
<uni-forms-item name="type" label="主题类型" required label-width="30%">
|
|
<uni-data-select
|
|
<uni-data-select
|
|
-
|
|
|
|
|
|
+
|
|
style="width: 30%;margin: auto;"
|
|
style="width: 30%;margin: auto;"
|
|
v-model="formData.type"
|
|
v-model="formData.type"
|
|
placeholder="请选择主题类型"
|
|
placeholder="请选择主题类型"
|
|
- field="deptName as value, deptName as text"
|
|
|
|
|
|
+ field="deptName as value, deptName as text"
|
|
:localdata="topicTypeList"
|
|
:localdata="topicTypeList"
|
|
></uni-data-select>
|
|
></uni-data-select>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
<uni-forms-item name="department" label="所属部门" required label-width="30%">
|
|
<uni-forms-item name="department" label="所属部门" required label-width="30%">
|
|
<uni-data-select
|
|
<uni-data-select
|
|
-
|
|
|
|
|
|
+
|
|
style="width: 30%;margin: auto;"
|
|
style="width: 30%;margin: auto;"
|
|
v-model="formData.department"
|
|
v-model="formData.department"
|
|
placeholder="请选择所属部门"
|
|
placeholder="请选择所属部门"
|
|
- field="name as value, name as text"
|
|
|
|
|
|
+ field="name as value, name as text"
|
|
:localdata="departmentList"
|
|
:localdata="departmentList"
|
|
></uni-data-select>
|
|
></uni-data-select>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
-
|
|
|
|
|
|
+
|
|
<uni-forms-item name="picture" label="图片">
|
|
<uni-forms-item name="picture" label="图片">
|
|
<upload :imgArr="imageList" :fileSize="1" :limit="3" @updateImg="updateImg"></upload>
|
|
<upload :imgArr="imageList" :fileSize="1" :limit="3" @updateImg="updateImg"></upload>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
@@ -57,15 +57,15 @@
|
|
</uni-forms>
|
|
</uni-forms>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
|
|
+
|
|
<script>
|
|
<script>
|
|
- import {
|
|
|
|
|
|
+ import {
|
|
getListTopicType,
|
|
getListTopicType,
|
|
getListDepts ,
|
|
getListDepts ,
|
|
} from '@/api/me/matters/matters.js'
|
|
} from '@/api/me/matters/matters.js'
|
|
import upload from '@/components/upload/index.vue'
|
|
import upload from '@/components/upload/index.vue'
|
|
import {addsc} from '@/api/handleAffairs/matter.js'
|
|
import {addsc} from '@/api/handleAffairs/matter.js'
|
|
-
|
|
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
upload
|
|
upload
|
|
@@ -108,7 +108,7 @@
|
|
imageList:[],
|
|
imageList:[],
|
|
topicTypeList:[],
|
|
topicTypeList:[],
|
|
departmentList:[],
|
|
departmentList:[],
|
|
-
|
|
|
|
|
|
+
|
|
show: false,
|
|
show: false,
|
|
rules: {
|
|
rules: {
|
|
title: {
|
|
title: {
|
|
@@ -166,13 +166,13 @@
|
|
// }
|
|
// }
|
|
// ]
|
|
// ]
|
|
// },
|
|
// },
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
-
|
|
|
|
|
|
+
|
|
submitForm(form) {
|
|
submitForm(form) {
|
|
this.$refs[form]
|
|
this.$refs[form]
|
|
.submit()
|
|
.submit()
|
|
@@ -185,12 +185,12 @@
|
|
console.log("1111111111111", res);
|
|
console.log("1111111111111", res);
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
// 用户点击确定按钮
|
|
// 用户点击确定按钮
|
|
-
|
|
|
|
|
|
+
|
|
addsc(this.formData).then(response => {
|
|
addsc(this.formData).then(response => {
|
|
console.log("7777777", this.formData);
|
|
console.log("7777777", this.formData);
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.$modal.msgSuccess("新增成功");
|
|
uni.navigateBack();
|
|
uni.navigateBack();
|
|
-
|
|
|
|
|
|
+
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
console.error("新增方法出错:", error);
|
|
console.error("新增方法出错:", error);
|
|
});
|
|
});
|
|
@@ -210,7 +210,7 @@
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
// submitForm(form) {
|
|
// submitForm(form) {
|
|
// this.$refs[form]
|
|
// this.$refs[form]
|
|
// .submit()
|
|
// .submit()
|
|
@@ -224,8 +224,8 @@
|
|
// console.error('验证失败:', errors)
|
|
// console.error('验证失败:', errors)
|
|
// })
|
|
// })
|
|
// },
|
|
// },
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
resetForm() {
|
|
resetForm() {
|
|
this.$refs.form.resetFields()
|
|
this.$refs.form.resetFields()
|
|
},
|
|
},
|
|
@@ -247,7 +247,7 @@
|
|
// this.formData.picture =this.imageList
|
|
// this.formData.picture =this.imageList
|
|
// this.formData.picture = JSON.stringify(this.imageList);
|
|
// this.formData.picture = JSON.stringify(this.imageList);
|
|
const pictureString = '"' + this.imageList.join('","') + '"';
|
|
const pictureString = '"' + this.imageList.join('","') + '"';
|
|
-
|
|
|
|
|
|
+
|
|
// 将转换后的字符串赋值给 this.formData.picture
|
|
// 将转换后的字符串赋值给 this.formData.picture
|
|
this.formData.picture = pictureString;
|
|
this.formData.picture = pictureString;
|
|
// console.log("1111111111111",)
|
|
// console.log("1111111111111",)
|
|
@@ -284,4 +284,4 @@
|
|
border-radius: 5px;
|
|
border-radius: 5px;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|