LAPTOP-UBJMM5MG\user 9 hónapja%!(EXTRA string=óta)
szülő
commit
f362cd6a99

+ 19 - 0
js_sdk/http.js

@@ -866,6 +866,13 @@ export function peripheryGetById(data) {
     )
 }
 
+export function peripheryAdd(data) {
+    return $http.post(
+        '/wx/periphery/add',
+        data, {}
+    )
+}
+
 // 报事报修提交
 export function repairAdd(data) {
     return $http.post(
@@ -990,3 +997,15 @@ export function parkRoomSlateRemove(e) {
         '/wx/ParkRoomSlateController/remove', e, {}
     )
 }
+// 新增物业通知
+export function propertyNoticeAdd(e) {
+    return $http.post(
+        '/wx/propertyNotice/add', e, {}
+    )
+}
+
+export function propertyNoticeEdit(e) {
+    return $http.post(
+        '/wx/propertyNotice/edit', e, {}
+    )
+}

+ 156 - 52
pages/subPackages/propertyNotice_manage/newRelease.vue

@@ -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],

+ 56 - 2
pages/subPackages/surroundingReleases/components/newRelease_com.vue

@@ -21,7 +21,7 @@
             </span>
         <div class="detailLi2Box">
           <div class="detailLi2BoxTop">
-            <div class="checkItem" :class="checkedName===item.name?'checked':''" v-for="item in checkList" @click="clickCheck(item)">{{item.name}}</div>
+            <div class="checkItem" :class="checkedName===item.label?'checked':''" v-for="item in checkList" :key="item.id" @click="clickCheck(item)">{{item.label}}</div>
           </div>
         </div>
       </li>
@@ -71,8 +71,62 @@
 </template>
 
 <script>
+import { getByCodes, peripheryAdd, getUserLocalStorageInfo} from "@/js_sdk/http";
 export default {
-  name: "newRelease_com"
+  name: "newRelease_com",
+  data(){
+    return{
+      dc_key: ['periphery_type'],
+      fileList:[],
+      checkList:[],
+      postData:{},
+      checkedName:'干洗'
+    }
+  },
+  created(){
+    this.getByCodes()
+  },
+  methods:{
+    async getByCodes() {
+      let data = await getByCodes(JSON.stringify(this.dc_key));
+      this.dic_SelectList = this.$common.handleDicList(data);
+      this.checkList = this.dic_SelectList.periphery_type
+      console.log('checkList',this.checkList)
+    },
+    clickCheck(item){
+      this.checkedName = item.label
+    },
+    deleteRYXXZP(event) {
+      this.fileList.splice(event.detail.index, 1);
+      this.$forceUpdate();
+    },
+    uploadRYXXZP(event) {
+      console.log(event)
+      let that = this;
+      const { file } = event.detail;
+      uni.uploadFile({
+        url: that.$constant.BASE_URI + "/wx/fileController/upload",
+        filePath: file.url,
+        name: "file",
+        formData: { user: "test" },
+        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],
+            url:
+                that.$constant.BASE_URI +
+                "/FileController/download/" +
+                data.data[0],
+            isImage: true,
+          });
+        },
+        fail(res) {},
+      });
+    },
+  }
 }
 </script>
 

+ 59 - 12
pages/subPackages/surroundingReleases/components/releaseRecord_com.vue

@@ -1,17 +1,14 @@
 <template>
   <div class="releaseRecord_com">
-    <van-tabs :active="active" @change="onChange">
-      <van-tab title="全部" :name="0"></van-tab>
-      <van-tab title="精装水" :name="1"></van-tab>
-      <van-tab title="维修" :name="2"></van-tab>
-      <van-tab title="家政服务" :name="3"></van-tab>
-      <van-tab title="其他" :name="4"></van-tab>
+    <van-tabs :active="active" @change="selectChange">
+      <van-tab title="全部" :name="all"></van-tab>
+      <van-tab :title="item.label" :name="item.value" :key="item.id" v-for="item in serviceList"></van-tab>
     </van-tabs>
     <div class="recordBody">
-      <div class="recordItem" v-for="item in 3">
-         <div class="tags">家政服务</div>
-         <div class="recordTitle">福奈特洗衣店(基金PARK店)</div>
-         <div class="recordTime">2024-1-21  13:00</div>
+      <div class="recordItem" v-for="item in peripheralList" :key="item.id">
+         <div class="tags">{{item.type}}</div>
+         <div class="recordTitle">{{item.businessName}}</div>
+         <div class="recordTime">{{item.createdAt}}</div>
          <div class="recordBtnBox">
            <button class="rBtn deleBtn">删除</button>
            <button class="rBtn editBtn">编辑</button>
@@ -22,16 +19,66 @@
 </template>
 
 <script>
+import { getByCodes, peripheryList, getUserLocalStorageInfo} from "@/js_sdk/http";
 export default {
   name: "releaseRecord_com",
   data(){
     return{
+      dc_key: ['periphery_type', 'QUICK_SELECTION'],
       active: 0,
+      all: null,
+      serviceList:[],
+      peripheralList: [],
+      params: {
+        pageNum: 1,
+        pageSize: 10,
+        releaseType: 'periphery',
+        createdBy: getUserLocalStorageInfo().id,
+        status: ''
+      },
     }
   },
+  created(){
+    this.getByCodes()
+  },
   methods:{
-    onChange() {
-
+    async getByCodes() {
+      let data = await getByCodes(JSON.stringify(this.dc_key));
+      this.dic_SelectList = this.$common.handleDicList(data);
+      this.serviceList = this.dic_SelectList.periphery_type
+      this.selectChange({detail:{
+          name:''
+        }})
+    },
+    selectData(type) {
+      const _this = this
+      _this.params.type = type
+      peripheryList(_this.params).then((res) => {
+        if (res.data) {
+          res.data.forEach(function(item) {
+            const jsonMap = _this.getItemJson(item)
+            // console.log('jsonMap',jsonMap)
+            _this.peripheralList.push(jsonMap)
+          })
+        }
+        // console.log(_this.peripheralList)
+      })
+    },
+    selectChange(e) {
+      console.log(e)
+      this.peripheralList = []
+      this.selectData(e.detail.name)
+    },
+    getItemJson: function(item) {
+      item.releaseTime = this.$common.transDate(item.releaseTime)
+      // item.type = this.dic_SelectList.periphery_type[item.type]
+      let transformedObject = this.dic_SelectList.periphery_type.reduce((acc, obj) => {
+        acc[obj.value] = obj.label;
+        return acc;
+      }, {'':'全部'});
+      item.type = transformedObject[item.type]
+      // console.log('this.dic_SelectList.periphery_type',transformedObject)
+      return item
     }
   }
 }