瀏覽代碼

时间选项

Hwt 2 年之前
父節點
當前提交
7c107475f7
共有 1 個文件被更改,包括 282 次插入236 次删除
  1. 282 236
      operationSupport/src/views/propertyManagement/inform.vue

+ 282 - 236
operationSupport/src/views/propertyManagement/inform.vue

@@ -1,54 +1,97 @@
 <template>
-    <div class="inform">
-        <div class="search">
-            <el-input placeholder="请输入标题" class="search-input" clearable v-model.trim="mixins_query.title"></el-input>
-            <el-select placeholder="请选择所属社区" v-model="mixins_query.communityId" clearable>
-                <el-option v-for="(item, index) in communityList" :key="index" :label="item.label" :value="item.id"></el-option>
-            </el-select>
-            <el-date-picker
-                v-model="searchTime"
-                value-format="yyyy-MM-dd"
-                type="daterange"
-                range-separator="至"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期"
-                :picker-options="pickerOptions"
-                :editable="false"
-            ></el-date-picker>
-            <el-button type="primary" placeholder="状态" class="search-btn" @click="searchInfo" icon="el-icon-search">查询 </el-button>
-            <div class="search-icon">
-                <el-tooltip class="item" effect="light" placement="bottom" content="物业通知发布">
-                    <i class="zoniot_font zoniot-icon-tianjia2" @click="add"></i>
-                </el-tooltip>
+  <div class="inform">
+    <div class="search">
+      <el-input
+        placeholder="请输入标题"
+        class="search-input"
+        clearable
+        v-model.trim="mixins_query.title"
+      ></el-input>
+      <el-select
+        placeholder="请选择所属社区"
+        v-model="mixins_query.communityId"
+        clearable
+      >
+        <el-option
+          v-for="(item, index) in communityList"
+          :key="index"
+          :label="item.label"
+          :value="item.id"
+        ></el-option>
+      </el-select>
+      <el-date-picker
+        v-model="searchTime"
+        value-format="yyyy-MM-dd"
+        type="daterange"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"
+        :picker-options="pickerOptions"
+        :editable="false"
+      ></el-date-picker>
+      <el-button
+        type="primary"
+        placeholder="状态"
+        class="search-btn"
+        @click="searchInfo"
+        icon="el-icon-search"
+      >查询 </el-button>
+      <div class="search-icon">
+        <el-tooltip
+          class="item"
+          effect="light"
+          placement="bottom"
+          content="物业通知发布"
+        >
+          <i
+            class="zoniot_font zoniot-icon-tianjia2"
+            @click="add"
+          ></i>
+        </el-tooltip>
+      </div>
+    </div>
+    <div class="content">
+      <div class="roles-wrap">
+        <zz-table
+          :cols="cols"
+          :settings="{ showNumber: true, stripe: true, showNumberWidth: '100' }"
+          :data="mixins_list"
+          :pageset="mixins_pageset"
+          @page-change="pageChange"
+          :loading="mixins_onQuery"
+        >
+          <template
+            slot="pubPeople"
+            slot-scope="scope"
+          >
+            {{ scope.row.pubPeople }}
+          </template>
+          <template
+            slot-scope="scope"
+            slot="releaseTime"
+          >
+            <div>
+              {{ scope.row.pubDate }}
             </div>
-        </div>
-        <div class="content">
-            <div class="roles-wrap">
-                <zz-table
-                    :cols="cols"
-                    :settings="{ showNumber: true, stripe: true, showNumberWidth: '100' }"
-                    :data="mixins_list"
-                    :pageset="mixins_pageset"
-                    @page-change="pageChange"
-                    :loading="mixins_onQuery"
-                >
-                    <template slot="pubPeople" slot-scope="scope">
-                        {{ scope.row.pubPeople }}
-                    </template>
-                    <template slot-scope="scope" slot="releaseTime">
-                        <div>
-                            {{ scope.row.pubDate }}
-                        </div>
-                    </template>
-                    <template slot-scope="scope" slot="opt">
-                        <div class="opt" @click="clickDatail(scope.row)">
-                            <img src="../../assets/img/icon_biaodan@2x.png" alt="" />
-                        </div>
-                    </template>
-                </zz-table>
+          </template>
+          <template
+            slot-scope="scope"
+            slot="opt"
+          >
+            <div
+              class="opt"
+              @click="clickDatail(scope.row)"
+            >
+              <img
+                src="../../assets/img/icon_biaodan@2x.png"
+                alt=""
+              />
             </div>
-        </div>
+          </template>
+        </zz-table>
+      </div>
     </div>
+  </div>
 </template>
 
 <script>
@@ -56,206 +99,209 @@ import list from '@utils/list.js';
 import previeInform from './common/previeInform';
 const content = '';
 export default {
-    mixins: [list],
-    components: { previeInform },
-    data() {
-        let _this = this;
-        return {
-            // 显示详情
-            showDetail: true,
-            rowDetail: '',
-            contentHtml: '',
-            // 查询的时间
-            searchTime: [],
-            // 输入地址
-            location: '',
-            // 通知类型
-            informTypes: [
-                {
-                    status: 0,
-                    label: '物业通知'
-                },
-                {
-                    status: 1,
-                    label: '社区活动'
-                }
-            ],
-            cols: [
-                {
-                    label: '标题',
-                    prop: 'title',
-                    width: 300
-                },
-                {
-                    label: '所属社区',
-                    prop: 'communityName'
-                },
-                {
-                    label: '通知类型',
-                    prop: 'type',
-                    format(val) {
-                        if (val == 0) {
-                            return '物业通知';
-                        } else if (val == 1) {
-                            return '社区活动';
-                        } else {
-                            return '其他';
-                        }
-                    }
-                },
-                {
-                    label: '是否紧急',
-                    prop: 'urgentFlag',
-                    format(val) {
-                        if (val == 0) {
-                            return '不紧急';
-                        } else if (val == 1) {
-                            return '紧急';
-                        } else {
-                            return '---';
-                        }
-                    }
-                },
-                {
-                    label: '发布时间',
-                    prop: 'pubDate',
-                    slot: 'releaseTime'
-                },
-                {
-                    label: '状态',
-                    prop: 'status',
-                    format(val) {
-                        return val ? val : '已发布';
-                    }
-                },
-                {
-                    label: '发布人',
-                    prop: 'pubPeople',
-                    slot: 'pubPeople'
-                },
-                {
-                    label: '操作',
-                    prop: 'id',
-                    slot: 'opt'
-                }
-            ],
-            mixins_post: 'post'
-        };
-    },
-    created() {
-        this.getCommunityList();
-        this.mixins_dataUrl = '/sc-community/notice/page';
-        this.mixins_query = {};
-        this.mixins_search();
-        this.getOrgTreeList();
-        this.getPeopleList();
-    },
-    mounted() {},
-    methods: {
-        /**添加按钮 */
-        add() {
-            new Promise((resolve) => {
-                this.$store.dispatch('addPopup', {
-                    url: '/propertyManagement/stepPage/informAdd.vue',
-                    width: '1100px',
-                    height: '600px',
-                    props: {
-                        callback: resolve,
-                        house: this.selectRow
-                    },
-                    title: '物业通知发布'
-                });
-            }).then(() => {
-                this.mixins_search();
-            });
+  mixins: [list],
+  components: { previeInform },
+  data () {
+    let _this = this;
+    return {
+      // 显示详情
+      showDetail: true,
+      rowDetail: '',
+      contentHtml: '',
+      // 查询的时间
+      searchTime: [],
+      // 输入地址
+      location: '',
+      // 通知类型
+      informTypes: [
+        {
+          status: 0,
+          label: '物业通知'
+        },
+        {
+          status: 1,
+          label: '社区活动'
+        }
+      ],
+      cols: [
+        {
+          label: '标题',
+          prop: 'title',
+          width: 300
         },
-        /**查询按钮*/
-        searchInfo() {
-            let d = '00:00:00';
-            let dEnd = '23:59:59';
-            if (this.searchTime && this.searchTime.length) {
-                this.mixins_query.startTime = `${this.searchTime[0]}T${d}`;
-                this.mixins_query.endTime = `${this.searchTime[1]}T${dEnd}`;
+        {
+          label: '所属社区',
+          prop: 'communityName'
+        },
+        {
+          label: '通知类型',
+          prop: 'type',
+          format (val) {
+            if (val == 0) {
+              return '物业通知';
+            } else if (val == 1) {
+              return '社区活动';
             } else {
-                this.mixins_query.startTime = this.$moment(new Date()).subtract(1, 'months').format('YYYY-MM-DDTHH:mm:ss');
-                this.mixins_query.endTime = this.$moment(new Date()).format('YYYY-MM-DDTHH:mm:ss');
+              return '其他';
             }
-            this.mixins_search();
+          }
         },
-        /** 获取社区列表*/
-        getCommunityList() {
-            this.communityList = [];
-            var onOption = '';
-            this.$http.get('/sc-community/assets/community/list', {}).then((res) => {
-                res.data.map((res) => {
-                    onOption = {
-                        label: res.communityName,
-                        id: res.id
-                    };
-                    this.communityList.push(onOption);
-                });
-            });
+        {
+          label: '是否紧急',
+          prop: 'urgentFlag',
+          format (val) {
+            if (val == 0) {
+              return '不紧急';
+            } else if (val == 1) {
+              return '紧急';
+            } else {
+              return '---';
+            }
+          }
         },
-
-        getOrgTreeList() {
-            this.$http.get('/sc-community/assets/tree/community/find').then(({ status, data, msg }) => {
-                if (status === 0 && data) {
-                    this.houseData = data;
-                }
-            });
+        {
+          label: '发布时间',
+          prop: 'pubDate',
+          slot: 'releaseTime'
         },
-        // 获取人员
-        getPeopleList() {
-            this.$http.get('/sc-user-center/user/findUserList').then(({ status, data, msg }) => {
-                if (status == 0 && data) {
-                    this.peopleData = data;
-                }
-            });
+        {
+          label: '状态',
+          prop: 'status',
+          format (val) {
+            return val ? val : '已发布';
+          }
+        },
+        {
+          label: '发布人',
+          prop: 'pubPeople',
+          slot: 'pubPeople'
         },
+        {
+          label: '操作',
+          prop: 'id',
+          slot: 'opt'
+        }
+      ],
+      mixins_post: 'post'
+    };
+  },
+  created () {
+    this.getCommunityList();
+    this.mixins_dataUrl = '/sc-community/notice/page';
+    this.mixins_query = {};
+    this.mixins_search();
+    this.getOrgTreeList();
+    this.getPeopleList();
+  },
+  mounted () { },
+  methods: {
+    /**添加按钮 */
+    add () {
+      new Promise((resolve) => {
+        this.$store.dispatch('addPopup', {
+          url: '/propertyManagement/stepPage/informAdd.vue',
+          width: '1100px',
+          height: '600px',
+          props: {
+            callback: resolve,
+            house: this.selectRow
+          },
+          title: '物业通知发布'
+        });
+      }).then(() => {
+        this.mixins_search();
+      });
+    },
+    /**查询按钮*/
+    searchInfo () {
+      let d = '00:00:00';
+      let dEnd = '23:59:59';
+      if (this.searchTime && this.searchTime.length) {
+        this.mixins_query.startTime = `${this.searchTime[0]}T${d}`;
+        this.mixins_query.endTime = `${this.searchTime[1]}T${dEnd}`;
+      } else {
+        // this.mixins_query.startTime = this.$moment(new Date()).subtract(1, 'months').format('YYYY-MM-DDTHH:mm:ss');
+        // this.mixins_query.endTime = this.$moment(new Date()).format('YYYY-MM-DDTHH:mm:ss');
+        this.mixins_query.startTime = null;
+        this.mixins_query.endTime = null;
+
+      }
+      this.mixins_search();
+    },
+    /** 获取社区列表*/
+    getCommunityList () {
+      this.communityList = [];
+      var onOption = '';
+      this.$http.get('/sc-community/assets/community/list', {}).then((res) => {
+        res.data.map((res) => {
+          onOption = {
+            label: res.communityName,
+            id: res.id
+          };
+          this.communityList.push(onOption);
+        });
+      });
+    },
+
+    getOrgTreeList () {
+      this.$http.get('/sc-community/assets/tree/community/find').then(({ status, data, msg }) => {
+        if (status === 0 && data) {
+          this.houseData = data;
+        }
+      });
+    },
+    // 获取人员
+    getPeopleList () {
+      this.$http.get('/sc-user-center/user/findUserList').then(({ status, data, msg }) => {
+        if (status == 0 && data) {
+          this.peopleData = data;
+        }
+      });
+    },
 
-        /** 查看详情*/
-        clickDatail(row) {
-            this.$http.get('/sc-community/notice/find/' + row.id).then(({ data, status, msg }) => {
-                if (status == 0) {
-                    let treeData = JSON.parse(data.treeData);
-                    let treeDataHome = JSON.parse(treeData[0]);
-                    let treeDataPeople = JSON.parse(treeData[1]);
-                    let userType = '';
-                    if (treeDataHome.length > 0 && treeDataPeople.length > 0) {
-                        userType = 2;
-                    } else if (treeDataHome.length > 0) {
-                        userType = 0;
-                    } else {
-                        userType = 1;
-                    }
-                    new Promise((resolve) => {
-                        this.$store.dispatch('addPopup', {
-                            url: '/propertyManagement/common/detailView.vue',
-                            width: '1080px',
-                            height: '750px',
-                            props: {
-                                dataDetail: data,
-                                successImageLists: JSON.parse(data.themePictrue),
-                                filePath: JSON.parse(data.filePath),
-                                houseData: this.houseData,
-                                peopleData: this.peopleData,
-                                houseDataIds: treeDataHome,
-                                houseDataPeopleIds: treeDataPeople,
-                                userType: userType,
-                                showrightPhone: true,
-                                callback: resolve
-                            },
-                            title: data.type == 0 ? '物业通知详情' : '社区活动详情',
-                            showCancelButton: true,
-                            showConfirmButton: true
-                        });
-                    }).then(() => {});
-                } else {
-                    return this.$message.error('获取详情失败!请稍后重试');
-                }
+    /** 查看详情*/
+    clickDatail (row) {
+      this.$http.get('/sc-community/notice/find/' + row.id).then(({ data, status, msg }) => {
+        if (status == 0) {
+          let treeData = JSON.parse(data.treeData);
+          let treeDataHome = JSON.parse(treeData[0]);
+          let treeDataPeople = JSON.parse(treeData[1]);
+          let userType = '';
+          if (treeDataHome.length > 0 && treeDataPeople.length > 0) {
+            userType = 2;
+          } else if (treeDataHome.length > 0) {
+            userType = 0;
+          } else {
+            userType = 1;
+          }
+          new Promise((resolve) => {
+            this.$store.dispatch('addPopup', {
+              url: '/propertyManagement/common/detailView.vue',
+              width: '1080px',
+              height: '750px',
+              props: {
+                dataDetail: data,
+                successImageLists: JSON.parse(data.themePictrue),
+                filePath: JSON.parse(data.filePath),
+                houseData: this.houseData,
+                peopleData: this.peopleData,
+                houseDataIds: treeDataHome,
+                houseDataPeopleIds: treeDataPeople,
+                userType: userType,
+                showrightPhone: true,
+                callback: resolve
+              },
+              title: data.type == 0 ? '物业通知详情' : '社区活动详情',
+              showCancelButton: true,
+              showConfirmButton: true
             });
+          }).then(() => { });
+        } else {
+          return this.$message.error('获取详情失败!请稍后重试');
         }
+      });
     }
+  }
 };
 </script>
 <style lang="scss" scoped>