浏览代码

故障处理

xyg 3 年之前
父节点
当前提交
0adc07c739

+ 2 - 2
light-application-wx/app.json

@@ -3,7 +3,6 @@
         "pages/login/login",
         "pages/index/index",
         "pages/logs/logs",
-        "pages/visit-agenda/visit-agenda",
         "pages/meeting-inspection/meeting-inspection",
         "pages/meeting-list/meeting-list",
         "pages/file-browse/file-browse",
@@ -22,7 +21,8 @@
         "pages/personal/personal",
         "pages/fault-list/fault-list",
         "pages/personal-about/personal-about",
-        "pages/personal-edit/personal-edit"
+        "pages/personal-edit/personal-edit",
+        "pages/fault-detail/fault-detail"
     ],
     "window": {
         "backgroundTextStyle": "light",

+ 0 - 1
light-application-wx/comps/chat/inputbar/inputbar.json

@@ -1,7 +1,6 @@
 {
     "component": true,
     "usingComponents": {
-        "chat-suit-emoji": "suit/emoji/emoji",
         "chat-suit-image": "suit/image/image",
         "chat-suit-main": "suit/main/main"
     }

+ 0 - 63
light-application-wx/comps/chat/inputbar/suit/emoji/emoji.js

@@ -1,63 +0,0 @@
-// comps/chat/inputbar/suit/emoji/emoji.js
-let WebIM = require("../../../../../utils/WebIM")["default"];
-let msgType = require("../../../../../utils/msgtype");
-let EMOJI_STATUS = {
-    OPENED: "showEmoji",
-    CLOSED: "emoji_list",
-};
-
-Component({
-    /**
-     * 组件的属性列表
-     */
-    properties: {
-
-    },
-
-    /**
-     * 组件的初始数据
-     */
-    data: {
-        show: EMOJI_STATUS.CLOSED,
-        emoji: WebIM.Emoji,
-        emojiObj: WebIM.EmojiObj,
-
-        interval: 5000,
-        duration: 1000,
-        autoplay: false,
-        indicatorDots: true,	// 显示面板指示点
-    },
-
-    /**
-     * 组件的方法列表
-     */
-    methods: {
-        openEmoji() {
-            this.setData({
-                show: EMOJI_STATUS.OPENED
-            });
-        },
-
-        cancelEmoji() {
-            this.setData({
-                show: EMOJI_STATUS.CLOSED
-            });
-        },
-
-        // 输出 emoji
-        sendEmoji(event) {
-            var emoji = event.target.dataset.emoji;
-            this.triggerEvent(
-                "newEmojiStr",
-                {
-                    msg: emoji,
-                    type: msgType.EMOJI,
-                },
-                {
-                    bubbles: true,
-                    composed: true
-                }
-            );
-        },
-    }
-})

+ 0 - 4
light-application-wx/comps/chat/inputbar/suit/emoji/emoji.json

@@ -1,4 +0,0 @@
-{
-    "component": true,
-    "usingComponents": {}
-}

+ 0 - 1
light-application-wx/comps/chat/inputbar/suit/emoji/emoji.wxml

@@ -1 +0,0 @@
-<!--comps/chat/inputbar/suit/emoji/emoji.wxml-->

+ 0 - 1
light-application-wx/comps/chat/inputbar/suit/emoji/emoji.wxss

@@ -1 +0,0 @@
-/* comps/chat/inputbar/suit/emoji/emoji.wxss */

+ 78 - 0
light-application-wx/pages/fault-detail/fault-detail.js

@@ -0,0 +1,78 @@
+// pages/fault-detail/fault-detail.js
+const util = require('../../utils/util');
+
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        disabled: false,
+        showSubmit: true,
+        height: '90%'
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+        if (options.item) {
+            let item = JSON.parse(options.item);
+            this.setData({
+                title: item.title,
+                proposePersonnel: item.proposePersonnel,
+                content: item.content,
+                treatmentMethod: item.treatmentMethod,
+                treatmentPersonnel: item.treatmentPersonnel,
+                treatmentTime: item.treatmentTime,
+                disabled: true,
+                showSubmit: false,
+                height: '100%'
+            });
+        }
+    },
+
+    /**
+     * 保存故障处理
+     */
+    formSubmit: function (e) {
+        let values = e.detail.value;
+        if (!values.title) {
+            util.toast('请输入故障标题');
+            return false;
+        }
+        if (!values.content) {
+            util.toast('请输入故障内容');
+            return false;
+        }
+
+        util.post({
+            url: '/api/fault/handling/record/addBean',
+            data: values,
+            success: function (res) {
+                wx.hideLoading();
+                if (res.data.code == 200) {
+                    util.toast(res.data.msg, 'success');
+
+                    //获取页面栈
+                    let pages = getCurrentPages();
+                    if (pages.length > 1) {
+                        //上一个页面实例对象
+                        var prePage = pages[pages.length - 2];
+                        //调用上一个页面的onShow方法
+                        prePage.onLoad();
+                    }
+
+                    setTimeout(() => {
+                        wx.navigateBack({
+                            delta: -1,
+                        });
+                    }, 2000);
+                } else {
+                    util.toast(res.data.msg);
+                }
+            }
+        });
+    }
+
+})

+ 4 - 0
light-application-wx/pages/fault-detail/fault-detail.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "故障处理"
+}

+ 34 - 0
light-application-wx/pages/fault-detail/fault-detail.wxml

@@ -0,0 +1,34 @@
+<!--pages/fault-detail/fault-detail.wxml-->
+<view class="page-body" style="height: {{height}};">
+    <form bindsubmit="formSubmit" bindreset="formReset">
+        <scroll-view class="formbody" scroll-y="true">
+            <view class="page-section page-section-gap">
+                <view class="page-section-title">故障标题:</view>
+                <input type="text" class="weui-input" name="title" value="{{title}}" disabled="{{disabled}}" placeholder="请输入故障标题" maxlength="50" />
+            </view>
+            <view class="page-section page-section-gap">
+                <view class="page-section-title">提出人员:</view>
+                <input type="text" class="weui-input" name="proposePersonnel" value="{{proposePersonnel}}" disabled="{{disabled}}" placeholder="请输入提出人员" maxlength="50" />
+            </view>
+            <view class="page-section page-section-gap">
+                <view class="page-section-title">故障内容:</view>
+                <textarea class="weui-input" name="content" value="{{content}}" disabled="{{disabled}}" placeholder="请输入故障内容" maxlength="500"></textarea>
+            </view>
+            <view class="page-section page-section-gap">
+                <view class="page-section-title">处理方式:</view>
+                <textarea class="weui-input" name="treatmentMethod" value="{{treatmentMethod}}" disabled="{{disabled}}" placeholder="请输入处理方式" maxlength="500"></textarea>
+            </view>
+            <view class="page-section page-section-gap">
+                <view class="page-section-title">处理人员:</view>
+                <input type="text" class="weui-input" name="treatmentPersonnel" value="{{treatmentPersonnel}}" disabled="{{disabled}}" placeholder="请输入处理人员" maxlength="20" />
+            </view>
+            <view class="page-section page-section-gap">
+                <view class="page-section-title">处理时间:</view>
+                <input type="text" class="weui-input" name="treatmentTime" value="{{treatmentTime}}" disabled="{{disabled}}" placeholder="请输入处理时间" maxlength="20" />
+            </view>
+        </scroll-view>
+        <view class="btn-area" wx:if="{{showSubmit}}">
+            <button class="submit-btn" formType="submit">提交</button>
+        </view>
+    </form>
+</view>

+ 54 - 0
light-application-wx/pages/fault-detail/fault-detail.wxss

@@ -0,0 +1,54 @@
+/* pages/fault-detail/fault-detail.wxss */
+page {
+    background-color: #F0F4F7;
+}
+
+/* .page-body {
+    height: 90%;
+} */
+
+.formbody {
+    height: 99%;
+}
+
+.page-section {
+    background-color: #ffffff;
+    margin-bottom: 10rpx;
+    padding: 30rpx;
+    box-sizing: border-box;
+}
+
+.page-section-title {
+    color: #777777;
+}
+
+.weui-input {
+    padding: 10rpx;
+}
+
+textarea {
+    width: 100%;
+    box-sizing: border-box;
+}
+
+.btn-area {
+    box-sizing: border-box;
+    width: 100%;
+    height: 120rpx;
+    padding: 20rpx 30rpx;
+    position: absolute;
+    bottom: 0;
+    background-color: #fff;
+}
+
+.submit-btn {
+    box-sizing: border-box;
+    color: #FFFFFF;
+    background-color: #3D5C92;
+    border-radius: 45rpx;
+    width: 100% !important;
+    text-align: center;
+    letter-spacing: 20rpx;
+    height: 90rpx;
+    line-height: 60rpx;
+}

+ 18 - 28
light-application-wx/pages/fault-list/fault-list.js

@@ -40,34 +40,6 @@ Page({
     },
 
     /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
      * 页面相关事件处理函数--监听用户下拉动作
      */
     onPullDownRefresh() {
@@ -133,4 +105,22 @@ Page({
         });
     },
 
+    /**
+     * 跳转新增故障处理页面
+     */
+    addFault: function () {
+        wx.navigateTo({
+            url: '../fault-detail/fault-detail',
+        });
+    },
+
+    /**
+     * 查看故障处理详情
+     */
+    faultDetail: function (e) {
+        wx.navigateTo({
+            url: '../fault-detail/fault-detail?item=' + JSON.stringify(e.currentTarget.dataset.item),
+        });
+    }
+
 })

+ 4 - 1
light-application-wx/pages/fault-list/fault-list.wxml

@@ -1,6 +1,9 @@
 <!--pages/fault-list/fault-list.wxml-->
+<view class="addBtn">
+    <text bindtap="addFault">新增</text>
+</view>
 <scroll-view class="list" scroll-y="true">
-    <view class="item" wx:for="{{list}}" wx:key="i" data-item="{{item}}">
+    <view class="item" wx:for="{{list}}" wx:key="i" data-item="{{item}}" bindtap="faultDetail">
         <view class="item-title">{{item.title}}</view>
         <view class="item-row">
             <label>内容:</label>

+ 21 - 0
light-application-wx/pages/fault-list/fault-list.wxss

@@ -4,6 +4,27 @@ page {
     background-color: #F0F4F7;
 }
 
+.addBtn {
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    margin-top: 15rpx;
+    margin-right: 30rpx;
+}
+
+.addBtn text {
+    border: solid 1rpx #999999;
+    padding: 15rpx 25rpx;
+    text-align: center;
+    border-radius: 30rpx;
+    font-size: 24rpx;
+    color: #666666;
+}
+
+.list {
+    margin-top: 15rpx;
+}
+
 .item {
     box-sizing: border-box;
     background-color: #FFFFFF;

+ 0 - 1
light-application-wx/pages/meeting-cover/meeting-cover.wxss

@@ -87,7 +87,6 @@
     margin: 0 28rpx;
 }
 
-/* pages/visit-agenda/visit-agenda.wxss */
 .container {
     color: #ffffff;
     padding: 30rpx;

+ 0 - 34
light-application-wx/pages/meeting-list/meeting-list.js

@@ -157,38 +157,4 @@ Page({
         }
     },
 
-    /**
-     * 编辑会议
-     * @param {*} e 
-     */
-    editMeeting: function (e) {
-
-    },
-
-    /**
-     * 删除会议
-     * @param {*} e 
-     */
-    delMeeting: function (e) {
-        console.info(e);
-        let that = this;
-        util.post({
-            url: '/api/meeting/info/deleteById',
-            data: {
-                id: e.target.dataset.id
-            },
-            header: {
-                'Content-Type': 'application/x-www-form-urlencoded'
-            },
-            success: (res) => {
-                console.info(res);
-                if (res.data.code != 200) {
-                    util.toast(res.data.msg);
-                } else {
-                    util.toast(res.data.msg, 'success');
-                    that.onPullDownRefresh();
-                }
-            }
-        });
-    }
 })

+ 0 - 78
light-application-wx/pages/visit-agenda/visit-agenda.js

@@ -1,78 +0,0 @@
-// pages/visit-agenda/visit-agenda.js
-const app = getApp();
-const util = require('../../utils/util.js');
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        imgPath: app.globalData.imgPath,
-        item: {}
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-        let item = JSON.parse(options.item);
-        this.setData({
-            item: item,
-            title: item.title,
-            receptionTime: util.formatDate(item.receptionTime, 'yyyy年MM月dd日 HH:mm'),
-            receptionContent: item.receptionContent
-        });
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-
-    },
-
-    /**
-     * 点击返回
-     */
-    backTap: function () {
-        wx.navigateBack({
-            delta: -1,
-        });
-    }
-
-})

+ 0 - 6
light-application-wx/pages/visit-agenda/visit-agenda.json

@@ -1,6 +0,0 @@
-{
-    "usingComponents": {},
-    "navigationBarTitleText": "",
-    "navigationBarTextStyle": "white",
-    "navigationStyle": "custom"
-}

+ 0 - 12
light-application-wx/pages/visit-agenda/visit-agenda.wxml

@@ -1,12 +0,0 @@
-<!--pages/visit-agenda/visit-agenda.wxml-->
-<view class="container" style="background-image: url({{imgPath}}/meeting-arrangement-bg.png);">
-    <image class="backBtn" src="{{imgPath}}/icon-back-white.png" bindtap="backTap"></image>
-    <view class="agenda-title">{{title}}</view>
-    <view class="english-name">Agenda arrangement</view>
-    <view class="agenda-name">议程安排</view>
-    <view class="now-time">{{receptionTime}}</view>
-
-    <view class="arrangement-list">
-        <textarea name="receptionContent" value="{{receptionContent}}" maxlength="5000"></textarea>
-    </view>
-</view>

+ 0 - 116
light-application-wx/pages/visit-agenda/visit-agenda.wxss

@@ -1,116 +0,0 @@
-/* pages/visit-agenda/visit-agenda.wxss */
-.container {
-    color: #ffffff;
-    padding: 30rpx;
-    display: block;
-    width: 100%;
-    height: 100%;
-    background-size: 100% 100%;
-}
-
-.backBtn {
-    width: 60rpx;
-    height: 60rpx;
-    margin-top: 40rpx;
-}
-
-.agenda-title {
-    font-size: 40rpx;
-    width: 95%;
-    margin-top: 90rpx;
-    margin-left: 10rpx;
-    border-bottom: solid 1rpx #ffffff50;
-    padding-bottom: 10rpx;
-}
-
-.english-name {
-    font-size: 22rpx;
-    color: #ffffff50;
-    text-align: left;
-    margin-top: 10rpx;
-}
-
-.agenda-name {
-    margin-top: 10rpx;
-    line-height: 60rpx;
-    font-size: 50rpx;
-    color: #2BFFE9;
-    border-bottom: solid 1rpx #ffffff50;
-    padding-bottom: 10rpx;
-    display: inline-flex;
-    letter-spacing: 8rpx;
-}
-
-.now-time {
-    margin-top: 30rpx;
-    font-size: 22rpx;
-}
-
-.arrangement-list {
-    /* height: 300rpx; */
-    margin-top: 60rpx;
-}
-
-.arrangement-list textarea {
-    width: 100%;
-    height: 800rpx;
-    word-break: break-all;
-}
-
-.item:nth-child(odd) {
-    background-image: var(--bg--);
-    color: white;
-    height: 120rpx;
-    line-height: 120rpx;
-    font-size: 28rpx;
-    width: 100%;
-    margin-top: 20rpx;
-    display: inline-flex;
-    background-size: 100% 100%;
-}
-
-.item:nth-child(even) {
-    background-color: #07309C;
-    color: white;
-    height: 120rpx;
-    line-height: 120rpx;
-    font-size: 28rpx;
-    width: 100%;
-    margin-top: 20rpx;
-    border-radius: 10rpx;
-    display: inline-flex;
-    background-image: none;
-    background-size: 100% 100%;
-}
-
-.item .time {
-    margin-left: 10rpx;
-    width: 25%;
-}
-
-.item .name {
-    width: 25%;
-}
-
-.item .vertical {
-    border-left: solid 1rpx #ffffff;
-    margin-right: 20rpx;
-    height: 80rpx;
-    margin-top: 20rpx;
-}
-
-.item .desc {
-    width: 40%;
-    line-height: 35rpx;
-    height: 70rpx;
-    font-size: 22rpx;
-    word-wrap: break-all;
-    margin-top: 30rpx;
-    color: #ffffff60;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    align-items: center;
-    display: -webkit-box;
-    -webkit-line-clamp: 2;
-    -webkit-box-orient: vertical;
-}