新框架PDA前端(祈禧6月初版本)
南骏 池
3 天以前 3ff569f00d22919e47cab8fb6d7d9867fd115d97
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
var vm = new Vue({
    el: '#app',
    data: function () {
        return {
            isLoading: false,
            userInfo: {
                "loginGuid": '',
                "loginAccount": '',
            },
            formData: {},
            isNumber: false,
            checkItem: "",
            id: 0,
            gid: 0,
            itemInId: 0,
            billNo: "",
            showPopup: false,
            editData: {},
            tableData: [],
            isShowImg: false,
            base64Image: "",
            remarks: "",
            remarksPopup: false,
            fcheckResu: null,
            fsubmit:1
        }
    },
    mounted() {
        var that = this;
        this.userInfo = {
            loginGuid: this.GetLoginInfor().loginGuid,
            loginAccount: this.GetLoginInfor().loginAccount,
        };
        this.id = this.Request("id");
        this.gid = this.Request("gid");
        this.fsubmit = this.Request("fsubmit");
 
        this.refreshResult();
    },
    methods: {
        refreshResult() {
 
            var that = this;
            that.AxiosHttp("post", 'LLJ/getXjDetail02ById', {
                id: this.id
            }, false)
                .then(function (res) {
                    that.formData = res.data.tbBillList.itemXj01;
 
                    that.tableData = res.data.tbBillList.itemXj02s;
 
                    //if (this.formData.imageData) {
                    //    this.isShowImg = true;
                    //    this.base64Image = 'data:image/jpeg;base64,' + this.formData.imageData;
                    //}
 
                    //fupAllow  fdownAllow  standardValue
                    if (that.formData.fupAllow && that.formData.fdownAllow && that.formData.fstand) {
                        that.isNumber = true;
                    }
                })
                .catch(function (error) {
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                });
        },
        submit() {
            let count = this.formData.checkQyt;
            let fstand = "√";
 
            //有最大值和最小值就根据是否符合标准值更新判定结果,没有最大值和最小值就根据是否通过检验判定结果
            if (this.formData.fupAllow && this.formData.fdownAllow) {
 
                if (!this.formData.fcheckResu) {
                    this.$toast.fail("请输入检验值");
                    return;
                }
 
                let max = Number(this.formData.fupAllow); 
                let min = Number(this.formData.fdownAllow); 
 
                if (this.formData.fcheckResu >= min && this.formData.fcheckResu <= max) {
                    fstand = "√"
                } else {
                    fstand = "×";
                }
                count = 1;
            } else {
 
                if (!this.formData.fcheckResu) {
                    this.formData.fcheckResu = 1
                }
 
                if (this.formData.fcheckResu == 0 || this.formData.fcheckResu == 1) {
                    this.formData.isPass = this.formData.fcheckResu
                } else {
                    this.$toast.fail("无标准值时,检验结果只能为0或1!");
                    return;
                }
                count = count - this.tableData.length;
            }
 
            this.formData.updater = this.userInfo.loginAccount;
 
            var that = this;
            that.AxiosHttp("post", 'LLJ/SetQSItemDetail', {
                parentGuid: that.id,
                grandpaGuid: that.gid,
                fstand: fstand,
                fcheckItem: that.formData.fcheckItem,
                fcheckResu: that.formData.fcheckResu,
                lastupdateBy: that.formData.updater,
                count: count
            }, false)
                .then(function (res) {
                    that.formData.fcheckResu = null;
                    that.$notify({ type: 'success', message: '保存成功' });
                    that.refreshResult();
                })
                .catch(function (error) {
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                });
        },
        toDetail(item) {
            this.showPopup = !this.showPopup;
            this.editData = item;
        },
        editResult(fcheckResu) {
            if (fcheckResu == 'OK') {
                return "改为不合格";
            } else {
                return "改为合格";
            }
        },
        numberEdit(item) {
 
            let fstand = "√";
            let fcheckResu = "OK";
 
            if (item.fcheckResu == 'OK') {
                fstand = "×";
                fcheckResu = "NG";
            }
 
            var that = this;
            that.AxiosHttp("post", 'LLJ/UpdateQSItemDetail', {
                guid: item.guid,
                parentGuid: item.parentGuid,
                grandpaGuid: item.grandpaGuid,
                fstand: fstand,
                fcheckResu: fcheckResu,
                lastupdateBy: that.userInfo.loginAccount,
            }, false)
                .then(function (res) {
                    that.$notify({ type: 'success', message: '修改成功' });
                    that.refreshResult();
                })
                .catch(function (error) {
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                });
        },
        eidt() {
 
            if (!this.editData.fcheckResu) {
                this.$toast.fail("请输入检验结果");
            }
 
            if (this.formData.fcheckResu == this.editData.fcheckResu) {
                this.$notify({ type: 'success', message: '修改成功' });
                return;
            }
 
            let fstand = "√";
 
            if (this.formData.fupAllow && this.formData.fdownAllow) {
 
                if (!this.editData.fcheckResu) {
                    this.$toast.fail("请输入检验值");
                    return;
                }
 
                let max = Number(this.formData.fupAllow);
                let min = Number(this.formData.fdownAllow);
 
                if (this.editData.fcheckResu >= min && this.editData.fcheckResu <= max) {
                    this.editData.isPass = 1
                } else {
                    this.editData.isPass = 0
                    fstand = "×";
                }
 
            } else {
 
                if (!this.editData.fcheckResu) {
                    this.editData.fcheckResu = 1
                }
 
                if (this.editData.fcheckResu == 0 || this.editData.fcheckResu == 1) {
                    if (this.editData.fcheckResu == 0) {
                        fstand = "×";
                    }
                } else {
                    this.$toast.fail("无标准值时,检验结果只能为0或1!");
                    return;
                }
            }
 
            this.editData.updater = this.userInfo.loginAccount;
 
            var that = this;
 
            that.AxiosHttp("post", 'LLJ/UpdateQSItemDetail', {
                guid: that.editData.guid,
                parentGuid: that.editData.parentGuid,
                grandpaGuid: that.editData.grandpaGuid,
                fstand: fstand,
                fcheckResu: that.editData.fcheckResu,
                lastupdateBy: that.userInfo.loginAccount,
            }, false)
                .then(function (res) {
                   
                    if (res.status == 0) {
                        that.$notify({ type: 'success', message: '修改成功' });
                        that.showPopup = false;
                        that.refreshResult();
                    } else {
                        that.$toast.fail(res.message);
                        that.editData.fcheckResu = that.fcheckResu;
                    }
                })
                .catch(function (error) {
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                });
        },
        GoBack1() {
            window.history.back();
        }
    }
})