wtt
2026-01-23 920675a9f1ccf311d32e6466ebde737dff765645
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<template>
    <view>
        <view class="tabs" id="tabs">
            <view :class="tabs == 0 ? 'on':''" @tap="switchTab(0)">未读消息</view>
            <view :class="tabs == 1 ? 'on':''" @tap="switchTab(1)">我接收的</view>
            <view :class="tabs == 2 ? 'on':''" @tap="switchTab(2)">我发送的</view>
            <view :class="tabs == 3 ? 'on':''" @tap="switchTab(3)">抄送我的</view>
        </view>
 
        <!-- 工作联系单 列表 -->
        <view class="list" v-for="(item,index) in BillsDisplay" :key="index">
            <uni-card :title="item.制单日期.substr(0,10)" :extra="item.单据号" style="margin: 10px;"
                @tap="showDetail = showDetail==index?-1:index">
                <view class="card-detail">
                    <template v-for="(HBillField, index) in CommonUtils.emptyValueFilter(item,HFieldList).slice(0,10)">
                        <view class="detail" v-if="HBillField.ColmType == 'DateTime'">
                            <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] ? dayjs(item[HBillField.ColmCols]).format("YYYY-MM-DD HH:mm:ss") : "" }}
                        </view>
                        <view class="detail" v-else>
                            <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] }}
                        </view>
                    </template>
                </view>
                <view class="card-detail" v-if="showDetail == index">
                    <view class="card-detail">
                        <template
                            v-for="(HBillField, index) in CommonUtils.emptyValueFilter(item,HFieldList).slice(10,-1)">
                            <view class="detail" v-if="HBillField.ColmType == 'DateTime'">
                                <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] ? dayjs(item[HBillField.ColmCols]).format("YYYY-MM-DD HH:mm:ss") : "" }}
                            </view>
                            <view class="detail" v-else>
                                <text>{{ HBillField.ColmCols }}:</text>{{ item[HBillField.ColmCols] }}
                            </view>
                        </template>
 
                    </view>
                </view>
 
                <view class="more" v-if="showDetail == index && operations != index">
                    <view class="part" style="border-right: 1px solid #eee;">
                        <uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起
                    </view>
                    <view class="part" @tap.stop="operations = operations==index?-1:index">
                        <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>操作
                    </view>
                </view>
                <view class="more" v-if="showDetail != index && operations != index">
                    <view class="part" style="border-right: 1px solid #eee;">
                        <uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>更多信息
                    </view>
                    <view class="part" @tap.stop="operations = operations==index?-1:index">
                        <uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>操作
                    </view>
                </view>
                <view class="op" v-if="operations == index">
                    <!-- <button class="op3" size="mini" plain @tap.stop="edit(item)">编辑</button> -->
                    <!-- <button class="op4" size="mini" plain @tap.stop="del(item)">删除</button> -->
                    <button class="op3" size="mini" plain @tap.stop="displayDetail(item)">查看详情</button>
                    <button class="op1" size="mini" plain @tap.stop="reply(item)">回复</button>
                    <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button>
                </view>
            </uni-card>
        </view>
        <view class="over" v-if="BillsDisplay.length == 0">暂无数据</view>
    </view>
</template>
 
<script>
    import {
        getUserInfo
    } from '../../../utils/auth';
    import {
        CommonUtils
    } from '../../../utils/common';
    import dayjs from 'dayjs';
    export default {
        // 工作联系单查询 模块
        name: 'OA_WorkLinkBillQuery',
        data() {
            return {
                dayjs,
                CommonUtils,
                tabs: 0,
                BillsDisplay: [],
                HFieldList: [], // 字段列表
                sWhere: "",
                showDetail: -1,
                operations: -1,
            };
        },
        methods: {
            switchTab(tabIndex) {
                this.tabs = tabIndex
                switch (tabIndex) {
                    case 0:
                        this.sWhere = ` and 接收人 = '${getUserInfo()['HEmpName']}' and 阅读状态 = '未阅'`
                        break;
                    case 1:
                        this.sWhere = ` and 接收人 = '${getUserInfo()['HEmpName']}'`
                        break;
                    case 2:
                        this.sWhere = ` and 发送人 = '${getUserInfo()['HEmpName']}'`
                        break;
                    case 3:
                        this.sWhere = ` and 抄送接收人 = '${getUserInfo()['HEmpName']}'`
                        break;
                    default:
                        this.sWhere = ` and 接收人 = '${getUserInfo()['HEmpName']}'`
                }
                this.getWorkLinkList()
            },
            async getWorkLinkList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: 'Sc_MESTransFerWorkBill/GetOA_WorkLinkBillList',
                        data: {
                            sWhere: this.sWhere,
                            user: getUserInfo()["Czymc"]
                        }
                    })
 
                    let {
                        count,
                        data,
                        Message,
                        list
                    } = res.data
                    if (count == 1) {
                        console.log('data: ', data);
 
                        this.BillsDisplay = data
 
 
                        let fieldList = CommonUtils.fieldListFilterRole({
                            ExcludeKeys: ['日期', '单据号'],
                            FieldList: list
                        })
 
                        if (fieldList.status == false) {
                            CommonUtils.showTips({
                                title: '温馨提示',
                                message: `获取表单结构失败: ${fieldList.Message}`
                            })
                        }
 
                        this.HFieldList = fieldList.data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `获取维修单异常: ${Message}`
                        })
                    }
 
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: `获取维修单异常: ${err}`
                    })
                }
            },
            displayDetail(item) {
                uni.showModal({
                    title: `${item["主题"]}`,
                    content: `${item["内容"]}`,
                    showCancel: false,
                    success: async (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            // 发送 该单据 已阅请求到后端
                            this.updateWorkLink(item.hmainid, item.HEntryID)
                        }
                    }
                })
            },
            async updateWorkLink(HInterID, HEntryID) {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Sc_MESTransFerWorkBill/UpdateOA_WorkLinkBillFlagMessage",
                        data: {
                            HInterID,
                            HEntryID
                        }
                    })
 
                    let {
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.switchTab(this.tabs)
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `更新工作联系单失败: ${Message}`
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: `更新工作联系单失败: ${err}`
                    })
                }
            },
            reply(item) {
                uni.navigateTo({
                    url: `/pages/ZLGL/OA_WorkLink/OA_WorkLinkBill?HInterID=${item.hmainid}`
                    + `&HEntryID=${item.HEntryID}&operationType=5`
                })
            }
        },
        onShow() {
            this.switchTab(0)
        }
    }
</script>
 
<style lang="scss">
    @import "@/pages/MJGL/style/MJBillStyle.scss";
 
    .more {
        color: #888;
        font-size: 26rpx;
        display: flex;
        border-top: 1px solid #eee;
        padding-top: 20rpx;
 
        .part {
            width: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
    }
 
    .op {
        display: flex;
        justify-content: space-around;
        margin-top: 20rpx;
 
        button {
            padding: 0;
            width: 150rpx;
            font-size: 25rpx;
        }
 
        .op1 {
            border: 1px solid #41a863;
            color: #41a863;
        }
 
        .op2 {
            border: 1px solid #d98d00;
            color: #d98d00;
        }
 
        .op3 {
            border: 1px solid #3a78ff;
            color: #3a78ff;
        }
 
        .op4 {
            border: 1px solid #da0000;
            color: #da0000;
        }
 
        .op5 {
            border: 1px solid #888;
            color: #888;
        }
    }
</style>