|
@@ -51,7 +51,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { noticeParkAdd,getUserLocalStorageInfo,noticeParkGetById,noticeParkEdit } from "@/js_sdk/http";
|
|
|
+import { noticeParkAdd,getUserLocalStorageInfo,noticeParkGetById,noticeParkEdit, propertyNoticeAdd,propertyNoticeEdit,getPropertyNoticeById} from "@/js_sdk/http";
|
|
|
import dayjs from "dayjs";
|
|
|
export default {
|
|
|
name: "newRelease",
|
|
@@ -74,10 +74,42 @@ export default {
|
|
|
this.type = type.noticeType
|
|
|
this.addType = type.addType
|
|
|
if (type.id){
|
|
|
- noticeParkGetById({id:type.id}).then(res=>{
|
|
|
- console.log(res)
|
|
|
- this.postData = res.data
|
|
|
- })
|
|
|
+ if (type.noticeType === '1'){
|
|
|
+ noticeParkGetById({id:type.id}).then(res=>{
|
|
|
+ console.log(res)
|
|
|
+ this.postData = res.data
|
|
|
+ this.postData = res.data
|
|
|
+ const picArr = res.data.picture.split(',')
|
|
|
+ picArr.forEach(id=>{
|
|
|
+ this.fileList.push({
|
|
|
+ imgUrl: "/FileController/download/" + id,
|
|
|
+ id: id,
|
|
|
+ url:
|
|
|
+ this.$constant.BASE_URI +
|
|
|
+ "/FileController/download/" +
|
|
|
+ id,
|
|
|
+ isImage: true,
|
|
|
+ });
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ getPropertyNoticeById({id:type.id}).then(res=>{
|
|
|
+ console.log(res)
|
|
|
+ this.postData = res.data
|
|
|
+ const picArr = res.data.picture.split(',')
|
|
|
+ picArr.forEach(id=>{
|
|
|
+ this.fileList.push({
|
|
|
+ imgUrl: "/FileController/download/" + id,
|
|
|
+ id: id,
|
|
|
+ url:
|
|
|
+ this.$constant.BASE_URI +
|
|
|
+ "/FileController/download/" +
|
|
|
+ id,
|
|
|
+ isImage: true,
|
|
|
+ });
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
@@ -92,61 +124,132 @@ export default {
|
|
|
const dayjs = require('dayjs')
|
|
|
this.postData.releaseTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
this.postData.status = 'published'
|
|
|
+ const picArr = []
|
|
|
+ this.fileList.forEach(e=>{
|
|
|
+ picArr.push(e.id)
|
|
|
+ })
|
|
|
+ this.postData.picture = picArr.toString()
|
|
|
if (this.addType === '发布'){
|
|
|
- // console.log(this.postData)
|
|
|
- noticeParkAdd(this.postData).then(res=>{
|
|
|
- if (res.code == '200'){
|
|
|
- uni.reLaunch({
|
|
|
- url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
- })
|
|
|
- uni.showToast({
|
|
|
- title: '操作成功',
|
|
|
- duration: 500
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.type === '1'){
|
|
|
+ //新增园区通知
|
|
|
+ // console.log(this.postData)
|
|
|
+ noticeParkAdd(this.postData).then(res=>{
|
|
|
+ if (res.code == '200'){
|
|
|
+ uni.reLaunch({
|
|
|
+ url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
+ })
|
|
|
+ uni.showToast({
|
|
|
+ title: '操作成功',
|
|
|
+ duration: 500
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ //新增物业通知
|
|
|
+ propertyNoticeAdd(this.postData).then(res=>{
|
|
|
+ if (res.code == '200'){
|
|
|
+ uni.reLaunch({
|
|
|
+ url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
+ })
|
|
|
+ uni.showToast({
|
|
|
+ title: '操作成功',
|
|
|
+ duration: 500
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}else if(this.addType === '编辑'){
|
|
|
- noticeParkEdit(this.postData).then(res=>{
|
|
|
- if (res.code == '200'){
|
|
|
- uni.reLaunch({
|
|
|
- url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
- })
|
|
|
- uni.showToast({
|
|
|
- title: '操作成功',
|
|
|
- duration: 500
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.type === '1'){
|
|
|
+ noticeParkEdit(this.postData).then(res=>{
|
|
|
+ if (res.code == '200'){
|
|
|
+ uni.reLaunch({
|
|
|
+ url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
+ })
|
|
|
+ uni.showToast({
|
|
|
+ title: '操作成功',
|
|
|
+ duration: 500
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ propertyNoticeEdit(this.postData).then(res=>{
|
|
|
+ if (res.code == '200'){
|
|
|
+ uni.reLaunch({
|
|
|
+ url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
+ })
|
|
|
+ uni.showToast({
|
|
|
+ title: '操作成功',
|
|
|
+ duration: 500
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
commitCliack() {
|
|
|
const dayjs = require('dayjs')
|
|
|
+ this.postData.releaseTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ this.postData.status = 'unpublished'
|
|
|
+ const picArr = []
|
|
|
+ this.fileList.forEach(e=>{
|
|
|
+ picArr.push(e.id)
|
|
|
+ })
|
|
|
+ this.postData.picture = picArr.toString()
|
|
|
if (this.addType === '发布'){
|
|
|
- this.postData.releaseTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
- this.postData.status = 'unpublished'
|
|
|
- noticeParkAdd(this.postData).then(res=>{
|
|
|
- if (res.code == '200'){
|
|
|
- uni.reLaunch({
|
|
|
- url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
- })
|
|
|
- uni.showToast({
|
|
|
- title: '操作成功',
|
|
|
- duration: 500
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.type === '1'){
|
|
|
+ //新增园区通知
|
|
|
+ // console.log(this.postData)
|
|
|
+ noticeParkAdd(this.postData).then(res=>{
|
|
|
+ if (res.code == '200'){
|
|
|
+ uni.reLaunch({
|
|
|
+ url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
+ })
|
|
|
+ uni.showToast({
|
|
|
+ title: '操作成功',
|
|
|
+ duration: 500
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ // 新增物业通知
|
|
|
+ propertyNoticeAdd(this.postData).then(res=>{
|
|
|
+ if (res.code == '200'){
|
|
|
+ uni.reLaunch({
|
|
|
+ url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
+ })
|
|
|
+ uni.showToast({
|
|
|
+ title: '操作成功',
|
|
|
+ duration: 500
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}else if(this.addType === '编辑'){
|
|
|
- noticeParkEdit(this.postData).then(res=>{
|
|
|
- if (res.code == '200'){
|
|
|
- uni.reLaunch({
|
|
|
- url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
- })
|
|
|
- uni.showToast({
|
|
|
- title: '操作成功',
|
|
|
- duration: 500
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.type === '1'){
|
|
|
+ noticeParkEdit(this.postData).then(res=>{
|
|
|
+ if (res.code == '200'){
|
|
|
+ uni.reLaunch({
|
|
|
+ url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
+ })
|
|
|
+ uni.showToast({
|
|
|
+ title: '操作成功',
|
|
|
+ duration: 500
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ propertyNoticeEdit(this.postData).then(res=>{
|
|
|
+ if (res.code == '200'){
|
|
|
+ uni.reLaunch({
|
|
|
+ url:'/pages/subPackages/propertyNotice_manage/index?type=' + this.type
|
|
|
+ })
|
|
|
+ uni.showToast({
|
|
|
+ title: '操作成功',
|
|
|
+ duration: 500
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
deleteRYXXZP(event) {
|
|
@@ -165,6 +268,7 @@ export default {
|
|
|
success(res) {
|
|
|
// 上传完成需要更新 fileList
|
|
|
let data = JSON.parse(res.data);
|
|
|
+ console.log('data',data)
|
|
|
that.fileList.push({
|
|
|
imgUrl: "/FileController/download/" + data.data[0],
|
|
|
id: data.data[0],
|