|
@@ -3,30 +3,52 @@
|
3
|
3
|
<div class="head">
|
4
|
4
|
<p>
|
5
|
5
|
<span>{{ model.workName }}</span>
|
6
|
|
- <span class="textRight"></span>
|
|
6
|
+ <span class="textRight">单价:<strong class="fontBold">{{ model.wage }}元</strong></span>
|
7
|
7
|
</p>
|
8
|
8
|
</div>
|
9
|
9
|
<p>
|
10
|
10
|
<span class="fl"></span>
|
11
|
|
- <span class="fr"><span class="totalPrice">单次:<strong class="fontBold">{{model.wage}}元</strong></span></span>
|
|
11
|
+ <span class="fr"><strong class="fontBold">×{{ model.workHourNum2 }}{{ model.workUnit }}</strong>  <span class="totalPrice">总价:<strong class="fontBold">{{model.workHourNum2 * model.wage}}元</strong></span></span>
|
12
|
12
|
</p>
|
|
13
|
+ <!-- 弹窗 -->
|
|
14
|
+ <showModel
|
|
15
|
+ v-if="models.disjunctor"
|
|
16
|
+ :title="models.title"
|
|
17
|
+ :icon="models.icon"
|
|
18
|
+ :disjunctor="models.disjunctor"
|
|
19
|
+ @ok="ok"
|
|
20
|
+ @cancel="cancel"
|
|
21
|
+ @remove="remove"
|
|
22
|
+ :operate="models.operate"
|
|
23
|
+ selectName="gs_edit"
|
|
24
|
+ :data="gsData"
|
|
25
|
+ ></showModel>
|
13
|
26
|
</div>
|
14
|
27
|
</template>
|
15
|
28
|
|
16
|
29
|
<script>
|
|
30
|
+import showModel from "../showModel/showModel.vue";
|
17
|
31
|
export default {
|
18
|
32
|
name: "WorkHourManagement",
|
19
|
33
|
data() {
|
20
|
34
|
return {
|
|
35
|
+ gsData: {},
|
21
|
36
|
loadShow: true,
|
|
37
|
+ // 弹窗model
|
|
38
|
+ models: {
|
|
39
|
+ disjunctor: false
|
|
40
|
+ },
|
22
|
41
|
};
|
23
|
42
|
},
|
24
|
43
|
props: ["model", "id", "summaryId", "incidentId", "summaryObj"],
|
|
44
|
+ components: {
|
|
45
|
+ showModel,
|
|
46
|
+ },
|
25
|
47
|
methods: {
|
26
|
48
|
// 移除
|
27
|
49
|
remove(data) {
|
28
|
50
|
console.log(data);
|
29
|
|
- console.log(String(this.summaryObj.workHourManagementList.map(v => v.id).filter(v => v != this.id)))
|
|
51
|
+ return;
|
30
|
52
|
const toast = this.$createToast({
|
31
|
53
|
txt: "Loading...",
|
32
|
54
|
mask: true
|
|
@@ -34,20 +56,82 @@ export default {
|
34
|
56
|
toast.show();
|
35
|
57
|
this.$http
|
36
|
58
|
.post("service/bpm/data/addSummaryDoc", {
|
37
|
|
- "workHourIds": String(this.summaryObj.workHourManagementList.map(v => v.id).filter(v => v != this.id)),
|
|
59
|
+ "workHourManagementList": [
|
|
60
|
+ {
|
|
61
|
+ "workHourId": data.gs.id,
|
|
62
|
+ "workHourNum": data.workHourNum
|
|
63
|
+ }
|
|
64
|
+ ],
|
38
|
65
|
"summaryId": this.summaryId,
|
|
66
|
+ "remove": 'remove',
|
39
|
67
|
})
|
40
|
68
|
.then(res => {
|
41
|
69
|
toast.hide();
|
|
70
|
+ this.models.disjunctor = false;
|
42
|
71
|
if (res.data.status == 200) {
|
43
|
72
|
this.$createDialog({
|
44
|
73
|
type: "alert",
|
|
74
|
+ title: "操作成功",
|
45
|
75
|
icon: "cubeic-right",
|
|
76
|
+ onConfirm: (e, promptValue) => {
|
|
77
|
+ this.loadShow = false;
|
|
78
|
+ this.$emit("refresh");
|
|
79
|
+ }
|
|
80
|
+ }).show();
|
|
81
|
+ } else {
|
|
82
|
+ this.$createDialog({
|
|
83
|
+ type: "alert",
|
|
84
|
+ title: "系统错误,请稍后再试!",
|
|
85
|
+ icon: "cubeic-wrong",
|
|
86
|
+ onConfirm: (e, promptValue) => {
|
|
87
|
+ this.loadShow = false;
|
|
88
|
+ this.$emit("refresh");
|
|
89
|
+ }
|
|
90
|
+ }).show();
|
|
91
|
+ }
|
|
92
|
+ });
|
|
93
|
+ },
|
|
94
|
+ //确定
|
|
95
|
+ ok(data) {
|
|
96
|
+ console.log(data);
|
|
97
|
+ const reg = /(^[1-9][0-9]*$)/;
|
|
98
|
+ if(!reg.test(data.workHourNum2)){
|
|
99
|
+ this.$createDialog({
|
|
100
|
+ type: "alert",
|
|
101
|
+ title: "请输入大于0的正整数!",
|
|
102
|
+ icon: "cubeic-warn"
|
|
103
|
+ }).show();
|
|
104
|
+ return;
|
|
105
|
+ }
|
|
106
|
+ const toast = this.$createToast({
|
|
107
|
+ txt: "Loading...",
|
|
108
|
+ mask: true
|
|
109
|
+ });
|
|
110
|
+ toast.show();
|
|
111
|
+ this.$http
|
|
112
|
+ .post("service/bpm/data/addSummaryDoc", {
|
|
113
|
+ "workHourManagementList": [
|
|
114
|
+ {
|
|
115
|
+ "workHourId": data.gs.id,
|
|
116
|
+ "workHourNum": data.workHourNum2,
|
|
117
|
+ "workHourParent": data.gs.workHourParent
|
|
118
|
+ }
|
|
119
|
+ ],
|
|
120
|
+ "summaryId": this.summaryId,
|
|
121
|
+ "modifyNum": 'edit',
|
|
122
|
+ })
|
|
123
|
+ .then(res => {
|
|
124
|
+ toast.hide();
|
|
125
|
+ this.models.disjunctor = false;
|
|
126
|
+ if (res.data.status == 200) {
|
|
127
|
+ this.$createDialog({
|
|
128
|
+ type: "alert",
|
46
|
129
|
title: "操作成功",
|
|
130
|
+ icon: "cubeic-right",
|
47
|
131
|
onConfirm: (e, promptValue) => {
|
48
|
132
|
this.loadShow = false;
|
49
|
133
|
this.$emit("refresh");
|
50
|
|
- },
|
|
134
|
+ }
|
51
|
135
|
}).show();
|
52
|
136
|
} else {
|
53
|
137
|
this.$createDialog({
|
|
@@ -62,32 +146,102 @@ export default {
|
62
|
146
|
}
|
63
|
147
|
});
|
64
|
148
|
},
|
|
149
|
+ //取消
|
|
150
|
+ cancel() {
|
|
151
|
+ this.models.disjunctor = false;
|
|
152
|
+ },
|
|
153
|
+ // 移除
|
|
154
|
+ // remove(data) {
|
|
155
|
+ // console.log(data);
|
|
156
|
+ // console.log(String(this.summaryObj.workHourManagementList.map(v => v.id).filter(v => v != this.id)))
|
|
157
|
+ // const toast = this.$createToast({
|
|
158
|
+ // txt: "Loading...",
|
|
159
|
+ // mask: true
|
|
160
|
+ // });
|
|
161
|
+ // toast.show();
|
|
162
|
+ // this.$http
|
|
163
|
+ // .post("service/bpm/data/addSummaryDoc", {
|
|
164
|
+ // "workHourIds": String(this.summaryObj.workHourManagementList.map(v => v.id).filter(v => v != this.id)),
|
|
165
|
+ // "summaryId": this.summaryId,
|
|
166
|
+ // })
|
|
167
|
+ // .then(res => {
|
|
168
|
+ // toast.hide();
|
|
169
|
+ // if (res.data.status == 200) {
|
|
170
|
+ // this.$createDialog({
|
|
171
|
+ // type: "alert",
|
|
172
|
+ // icon: "cubeic-right",
|
|
173
|
+ // title: "操作成功",
|
|
174
|
+ // onConfirm: (e, promptValue) => {
|
|
175
|
+ // this.loadShow = false;
|
|
176
|
+ // this.$emit("refresh");
|
|
177
|
+ // },
|
|
178
|
+ // }).show();
|
|
179
|
+ // } else {
|
|
180
|
+ // this.$createDialog({
|
|
181
|
+ // type: "alert",
|
|
182
|
+ // title: "系统错误,请稍后再试!",
|
|
183
|
+ // icon: "cubeic-wrong",
|
|
184
|
+ // onConfirm: (e, promptValue) => {
|
|
185
|
+ // this.loadShow = false;
|
|
186
|
+ // this.$emit("refresh");
|
|
187
|
+ // }
|
|
188
|
+ // }).show();
|
|
189
|
+ // }
|
|
190
|
+ // });
|
|
191
|
+ // },
|
65
|
192
|
// 弹窗
|
66
|
|
- showModal(item){
|
67
|
|
- this.$createDialog({
|
68
|
|
- type: "confirm",
|
69
|
|
- title: "提示",
|
70
|
|
- content: `您确认要移除工时【${item.workName}】吗`,
|
71
|
|
- icon: "cubeic-right",
|
72
|
|
- confirmBtn: {
|
73
|
|
- text: "确定",
|
74
|
|
- active: true,
|
75
|
|
- disabled: false,
|
76
|
|
- href: "javascript:;"
|
77
|
|
- },
|
78
|
|
- cancelBtn: {
|
79
|
|
- text: "取消",
|
80
|
|
- active: false,
|
81
|
|
- disabled: false,
|
82
|
|
- href: "javascript:;"
|
83
|
|
- },
|
84
|
|
- onConfirm: (e, promptValue) => {
|
85
|
|
- this.loadShow = true;
|
86
|
|
- this.remove(item);
|
|
193
|
+ showModal(item) {
|
|
194
|
+ console.log(item)
|
|
195
|
+ this.modelsData = item;
|
|
196
|
+ this.gsData = {
|
|
197
|
+ gs: {
|
|
198
|
+ wage: item.wage,
|
|
199
|
+ workName: item.workName,
|
|
200
|
+ workUnit: item.workUnit,
|
|
201
|
+ id: item.id,
|
|
202
|
+ workHourParent: item.parent?item.parent.id:undefined
|
87
|
203
|
},
|
88
|
|
- onCancel: () => {}
|
89
|
|
- }).show();
|
90
|
|
- }
|
|
204
|
+ incidentId: this.incidentId,
|
|
205
|
+ summaryId: this.summaryId,
|
|
206
|
+ workHourNum2: item.workHourNum2,
|
|
207
|
+ }
|
|
208
|
+ this.models = {
|
|
209
|
+ disjunctor: true,
|
|
210
|
+ title: "提示",
|
|
211
|
+ icon: "warn",
|
|
212
|
+ operate: {
|
|
213
|
+ ok: "确定",
|
|
214
|
+ cancel: "取消",
|
|
215
|
+ remove: '移除'
|
|
216
|
+ }
|
|
217
|
+ };
|
|
218
|
+ },
|
|
219
|
+ // 弹窗
|
|
220
|
+ // showModal(item){
|
|
221
|
+ // this.$createDialog({
|
|
222
|
+ // type: "confirm",
|
|
223
|
+ // title: "提示",
|
|
224
|
+ // content: `您确认要移除工时【${item.workName}${item.workUnit}】吗`,
|
|
225
|
+ // icon: "cubeic-right",
|
|
226
|
+ // confirmBtn: {
|
|
227
|
+ // text: "确定",
|
|
228
|
+ // active: true,
|
|
229
|
+ // disabled: false,
|
|
230
|
+ // href: "javascript:;"
|
|
231
|
+ // },
|
|
232
|
+ // cancelBtn: {
|
|
233
|
+ // text: "取消",
|
|
234
|
+ // active: false,
|
|
235
|
+ // disabled: false,
|
|
236
|
+ // href: "javascript:;"
|
|
237
|
+ // },
|
|
238
|
+ // onConfirm: (e, promptValue) => {
|
|
239
|
+ // this.loadShow = true;
|
|
240
|
+ // this.remove(item);
|
|
241
|
+ // },
|
|
242
|
+ // onCancel: () => {}
|
|
243
|
+ // }).show();
|
|
244
|
+ // }
|
91
|
245
|
},
|
92
|
246
|
created() {
|
93
|
247
|
console.log(this.model);
|