Browse Source

工时修改

seimin 2 years ago
parent
commit
656ebeec9b

+ 183 - 29
src/components/WorkHourManagement/index.vue

@@ -3,30 +3,52 @@
3
     <div class="head">
3
     <div class="head">
4
       <p>
4
       <p>
5
         <span>{{ model.workName }}</span>
5
         <span>{{ model.workName }}</span>
6
-        <span class="textRight"></span>
6
+        <span class="textRight">单价:<strong class="fontBold">{{ model.wage }}元</strong></span>
7
       </p>
7
       </p>
8
     </div>
8
     </div>
9
     <p>
9
     <p>
10
       <span class="fl"></span>
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>&emsp;&emsp;<span class="totalPrice">总价:<strong class="fontBold">{{model.workHourNum2 * model.wage}}元</strong></span></span>
12
     </p>
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
   </div>
26
   </div>
14
 </template>
27
 </template>
15
 
28
 
16
 <script>
29
 <script>
30
+import showModel from "../showModel/showModel.vue";
17
 export default {
31
 export default {
18
   name: "WorkHourManagement",
32
   name: "WorkHourManagement",
19
   data() {
33
   data() {
20
     return {
34
     return {
35
+      gsData: {},
21
       loadShow: true,
36
       loadShow: true,
37
+      // 弹窗model
38
+      models: {
39
+        disjunctor: false
40
+      },
22
     };
41
     };
23
   },
42
   },
24
   props: ["model", "id", "summaryId", "incidentId", "summaryObj"],
43
   props: ["model", "id", "summaryId", "incidentId", "summaryObj"],
44
+  components: {
45
+    showModel,
46
+  },
25
   methods: {
47
   methods: {
26
     // 移除
48
     // 移除
27
     remove(data) {
49
     remove(data) {
28
       console.log(data);
50
       console.log(data);
29
-      console.log(String(this.summaryObj.workHourManagementList.map(v => v.id).filter(v => v != this.id)))
51
+      return;
30
       const toast = this.$createToast({
52
       const toast = this.$createToast({
31
         txt: "Loading...",
53
         txt: "Loading...",
32
         mask: true
54
         mask: true
@@ -34,20 +56,82 @@ export default {
34
       toast.show();
56
       toast.show();
35
       this.$http
57
       this.$http
36
         .post("service/bpm/data/addSummaryDoc", {
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
             "summaryId": this.summaryId,
65
             "summaryId": this.summaryId,
66
+            "remove": 'remove',
39
         })
67
         })
40
         .then(res => {
68
         .then(res => {
41
           toast.hide();
69
           toast.hide();
70
+          this.models.disjunctor = false;
42
           if (res.data.status == 200) {
71
           if (res.data.status == 200) {
43
             this.$createDialog({
72
             this.$createDialog({
44
               type: "alert",
73
               type: "alert",
74
+              title: "操作成功",
45
               icon: "cubeic-right",
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
               title: "操作成功",
129
               title: "操作成功",
130
+              icon: "cubeic-right",
47
               onConfirm: (e, promptValue) => {
131
               onConfirm: (e, promptValue) => {
48
                 this.loadShow = false;
132
                 this.loadShow = false;
49
                 this.$emit("refresh");
133
                 this.$emit("refresh");
50
-              },
134
+              }
51
             }).show();
135
             }).show();
52
           } else {
136
           } else {
53
             this.$createDialog({
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
   created() {
246
   created() {
93
     console.log(this.model);
247
     console.log(this.model);

+ 14 - 1
src/components/showModel/showModel.vue

@@ -67,6 +67,12 @@
67
           <div class="hc_item">单价:{{ data.hc.endPrice }}元</div>
67
           <div class="hc_item">单价:{{ data.hc.endPrice }}元</div>
68
           <div class="hc_item">使用数量:<cube-input type="number" style="flex:1" v-model="consumablesNum"></cube-input></div>
68
           <div class="hc_item">使用数量:<cube-input type="number" style="flex:1" v-model="consumablesNum"></cube-input></div>
69
         </div>
69
         </div>
70
+        <!-- 工时 -->
71
+        <div class="select-wrap hc" v-if="selectName === 'gs_edit'">
72
+          <div class="hc_item">工时名称:{{ data.gs.workName }}<span v-if="data.workUnit">{{ data.gs.workUnit }}</span></div>
73
+          <div class="hc_item">单价:{{ data.gs.wage }}元</div>
74
+          <div class="hc_item">使用数量:<cube-input type="number" style="flex:1" v-model="workHourNum2"></cube-input></div>
75
+        </div>
70
       </div>
76
       </div>
71
       <div class="showModel__footer">
77
       <div class="showModel__footer">
72
         <div v-if="operate.ok" class="showModel__ok" @click="ok">
78
         <div v-if="operate.ok" class="showModel__ok" @click="ok">
@@ -98,6 +104,7 @@ export default {
98
   data() {
104
   data() {
99
     return {
105
     return {
100
       consumablesNum: this.data ? (this.data.consumablesNum ? this.data.consumablesNum : 1) : 1,
106
       consumablesNum: this.data ? (this.data.consumablesNum ? this.data.consumablesNum : 1) : 1,
107
+      workHourNum2: this.data ? (this.data.workHourNum2 ? this.data.workHourNum2 : 1) : 1,
101
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
108
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
102
       logs: [],
109
       logs: [],
103
       time: 5, //5秒后自动关闭
110
       time: 5, //5秒后自动关闭
@@ -329,6 +336,8 @@ export default {
329
         this.$emit("ok", this.selectUserId);
336
         this.$emit("ok", this.selectUserId);
330
       } else if (this.selectName === "hc_add" || this.selectName === "hc_edit") {
337
       } else if (this.selectName === "hc_add" || this.selectName === "hc_edit") {
331
         this.$emit("ok", {hc: this.data.hc, consumablesNum:this.consumablesNum});
338
         this.$emit("ok", {hc: this.data.hc, consumablesNum:this.consumablesNum});
339
+      } else if (this.selectName === "gs_edit") {
340
+        this.$emit("ok", {gs: this.data.gs, workHourNum2:this.workHourNum2});
332
       } else if (this.textName === "textarea") {
341
       } else if (this.textName === "textarea") {
333
         this.$emit("ok", this.textareaData);
342
         this.$emit("ok", this.textareaData);
334
       } else {
343
       } else {
@@ -337,7 +346,11 @@ export default {
337
     },
346
     },
338
     // 移除
347
     // 移除
339
     remove(){
348
     remove(){
340
-      this.$emit("remove", {hc: this.data.hc, consumablesNum:this.consumablesNum});
349
+      if(this.selectName === "hc_edit"){
350
+        this.$emit("remove", {hc: this.data.hc, consumablesNum:this.consumablesNum});
351
+      }else if(this.selectName === "gs_edit"){
352
+        this.$emit("remove", {gs: this.data.gs, workHourNum2:this.workHourNum2});
353
+      }
341
     },
354
     },
342
     // 取消
355
     // 取消
343
     cancel() {
356
     cancel() {

+ 1 - 1
src/router/index.js

@@ -116,7 +116,7 @@ export default new Router({
116
       },
116
       },
117
     },
117
     },
118
     {
118
     {
119
-      path: '/main/workHourManagementTwo/:incidentId/:summaryId/:parentId/:parentName/:processInstanceId',
119
+      path: '/main/workHourManagementTwo/:incidentId/:summaryId/:parentId/:parentName/:parentUnit/:processInstanceId',
120
       name: 'WorkHourManagementTwo',
120
       name: 'WorkHourManagementTwo',
121
       component: WorkHourManagementTwo,
121
       component: WorkHourManagementTwo,
122
       meta: {
122
       meta: {

+ 2 - 2
src/views/WorkHourManagementOne.vue

@@ -16,7 +16,7 @@
16
               >
16
               >
17
                 <div class="head">
17
                 <div class="head">
18
                   <p>
18
                   <p>
19
-                    <span>{{ item.workName }}</span>
19
+                    <span>{{ item.workName }}<span v-if="item.workUnit">({{ item.workUnit }})</span></span>
20
                   </p>
20
                   </p>
21
                 </div>
21
                 </div>
22
               </div>
22
               </div>
@@ -106,7 +106,7 @@ export default {
106
     // 弹窗
106
     // 弹窗
107
     toDetail(item) {
107
     toDetail(item) {
108
       this.$router.push({
108
       this.$router.push({
109
-        path: `/main/WorkHourManagementTwo/${this.$route.params.incidentId}/${this.$route.params.summaryId}/${item.id}/${item.workName}/${this.$route.params.processInstanceId}`
109
+        path: `/main/WorkHourManagementTwo/${this.$route.params.incidentId}/${this.$route.params.summaryId}/${item.id}/${item.workName}/${item.workUnit}/${this.$route.params.processInstanceId}`
110
       });
110
       });
111
     },
111
     },
112
     // 获取列表
112
     // 获取列表

+ 15 - 7
src/views/WorkHourManagementTwo.vue

@@ -2,7 +2,7 @@
2
   <div class="bgColor">
2
   <div class="bgColor">
3
     <div slot="content" class="scroll-wrapper">
3
     <div slot="content" class="scroll-wrapper">
4
       <div class="demo">
4
       <div class="demo">
5
-        <div class="header">一级目录选择的是:{{ $route.params.parentName }}</div>
5
+        <div class="header">一级目录选择的是:{{ $route.params.parentName }}<span v-if="$route.params.parentUnit!=='undefined'">{{ $route.params.parentUnit }}</span></div>
6
         <div class="scroll-list-wrap">
6
         <div class="scroll-list-wrap">
7
           <cube-scroll
7
           <cube-scroll
8
             :data="items"
8
             :data="items"
@@ -47,6 +47,7 @@ import LoadIng from "./loading.vue";
47
 export default {
47
 export default {
48
   data() {
48
   data() {
49
     return {
49
     return {
50
+      workHourManagementList:[],
50
       itemsCopy:[],
51
       itemsCopy:[],
51
       checkList:[],
52
       checkList:[],
52
       hcData: {},
53
       hcData: {},
@@ -80,6 +81,12 @@ export default {
80
     // 确定
81
     // 确定
81
     subVali(){
82
     subVali(){
82
       console.log(this.checkList);
83
       console.log(this.checkList);
84
+      console.log(this.workHourManagementList);
85
+      let workHourManagementMap = {};
86
+      this.workHourManagementList.forEach(v => {
87
+        workHourManagementMap[v.id] = v.workHourNum2;
88
+      })
89
+      console.log(workHourManagementMap);
83
       const toast = this.$createToast({
90
       const toast = this.$createToast({
84
         txt: "Loading...",
91
         txt: "Loading...",
85
         mask: true
92
         mask: true
@@ -87,7 +94,8 @@ export default {
87
       toast.show();
94
       toast.show();
88
       this.$http
95
       this.$http
89
         .post("service/bpm/data/addSummaryDoc", {
96
         .post("service/bpm/data/addSummaryDoc", {
90
-            "workHourIds": String(this.checkList),
97
+            "workHourParent":this.$route.params.parentId,
98
+            "workHourManagementList": this.checkList.map(v => ({workHourId: v, workHourNum: workHourManagementMap[v] || 1, workHourParent: this.$route.params.parentId})),
91
             "summaryId": this.$route.params.summaryId
99
             "summaryId": this.$route.params.summaryId
92
         })
100
         })
93
         .then(res => {
101
         .then(res => {
@@ -130,7 +138,7 @@ export default {
130
     // 弹窗
138
     // 弹窗
131
     toDetail(item) {
139
     toDetail(item) {
132
       this.$router.push({
140
       this.$router.push({
133
-        path: `/main/WorkHourManagementTwo/${this.$route.params.incidentId}/${this.summaryId}/${item.id}/${this.$route.params.processInstanceId}`
141
+        path: `/main/WorkHourManagementTwo/${this.$route.params.incidentId}/${this.summaryId}/${item.id}/${item.workName}/${item.workUnit}/${this.$route.params.processInstanceId}`
134
       });
142
       });
135
     },
143
     },
136
     // 获取列表
144
     // 获取列表
@@ -145,8 +153,8 @@ export default {
145
         )
153
         )
146
         .then((res) => {
154
         .then((res) => {
147
           if(res.data.status == 200){
155
           if(res.data.status == 200){
148
-            let workHourManagementList = res.data.workHourManagementList || [];
149
-            this.checkList = workHourManagementList.map(v => v.id);
156
+            this.workHourManagementList = res.data.workHourManagementList || [];
157
+            this.checkList = this.workHourManagementList.map(v => v.id);
150
             console.log(this.checkList)
158
             console.log(this.checkList)
151
             // ###########################
159
             // ###########################
152
             let postData = {
160
             let postData = {
@@ -167,10 +175,10 @@ export default {
167
                     this.wushuju = false;
175
                     this.wushuju = false;
168
                     if (this.searching) {
176
                     if (this.searching) {
169
                       this.items = res.data.list;
177
                       this.items = res.data.list;
170
-                      this.itemsCopy = res.data.list.map(v => ({label:v.workName, value: v.id}));
178
+                      this.itemsCopy = res.data.list.map(v => ({label:v.workName + (v.workUnit?'('+v.workUnit+')':''), value: v.id}));
171
                     } else {
179
                     } else {
172
                       this.items = this.items.concat(res.data.list);
180
                       this.items = this.items.concat(res.data.list);
173
-                      this.itemsCopy = this.itemsCopy.concat(res.data.list.map(v => ({label:v.workName, value: v.id})));
181
+                      this.itemsCopy = this.itemsCopy.concat(res.data.list.map(v => ({label:v.workName + (v.workUnit?'('+v.workUnit+')':''), value: v.id})));
174
                     }
182
                     }
175
                   } else {
183
                   } else {
176
                     this.wushuju = true;
184
                     this.wushuju = true;

+ 8 - 13
src/views/summaryOrder.vue

@@ -43,7 +43,7 @@
43
             <span class="dash dash-jia"></span>
43
             <span class="dash dash-jia"></span>
44
           </p>
44
           </p>
45
           <p class="textCenter total">
45
           <p class="textCenter total">
46
-            <span>汇总单总价:<strong class="fontBold">{{ totalPriceConsumable + totalPriceWorkHourManagement }}元</strong></span>
46
+            <span>汇总单总价:<strong class="fontBold">{{ totalMaintenancePrice }}元</strong></span>
47
           </p>
47
           </p>
48
         </div>
48
         </div>
49
       </div>
49
       </div>
@@ -71,8 +71,9 @@ export default {
71
   data() {
71
   data() {
72
     return {
72
     return {
73
       // 耗材总价格
73
       // 耗材总价格
74
-      totalPriceConsumable: 0,
75
-      totalPriceWorkHourManagement: 0,
74
+      totalMaintenancePrice: null,
75
+      totalPriceConsumable: null,
76
+      totalPriceWorkHourManagement: null,
76
       summaryObj: {},
77
       summaryObj: {},
77
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
78
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
78
       id: "",
79
       id: "",
@@ -175,16 +176,10 @@ export default {
175
         toast.hide();
176
         toast.hide();
176
         if(res.data.status == 200){
177
         if(res.data.status == 200){
177
           this.summaryObj = res.data;
178
           this.summaryObj = res.data;
178
-          if(this.summaryObj.consumableList){
179
-            this.totalPriceConsumable = this.summaryObj.consumableList.reduce((pre, current) => pre + current.consumableEndPrice * current.consumablesNum, 0)
180
-          }else{
181
-            this.totalPriceConsumable = 0;
182
-          }
183
-          if(this.summaryObj.workHourManagementList){
184
-            this.totalPriceWorkHourManagement = this.summaryObj.workHourManagementList.reduce((pre, current) => pre + current.wage, 0)
185
-          }else{
186
-            this.totalPriceWorkHourManagement = 0;
187
-          }
179
+          this.totalMaintenancePrice = this.summaryObj.totalMaintenancePrice;
180
+          this.totalMaintenancePrice = this.summaryObj.totalMaintenancePrice;
181
+          this.totalPriceConsumable = this.summaryObj.consumablePrice;
182
+          this.totalPriceWorkHourManagement = this.summaryObj.workHourPrice;
188
           this.summaryId = res.data.summaryId;
183
           this.summaryId = res.data.summaryId;
189
         }else if(res.data.status == 201){
184
         }else if(res.data.status == 201){
190
           // 事件第一次绑定汇总单
185
           // 事件第一次绑定汇总单

+ 8 - 13
src/views/summaryOrderDetail.vue

@@ -23,7 +23,7 @@
23
             <span>工时总价:<strong class="fontBold">{{ totalPriceWorkHourManagement }}元</strong></span>
23
             <span>工时总价:<strong class="fontBold">{{ totalPriceWorkHourManagement }}元</strong></span>
24
           </p>
24
           </p>
25
           <p class="textCenter total">
25
           <p class="textCenter total">
26
-            <span>汇总单总价:<strong class="fontBold">{{ totalPriceConsumable + totalPriceWorkHourManagement }}元</strong></span>
26
+            <span>汇总单总价:<strong class="fontBold">{{ totalMaintenancePrice }}元</strong></span>
27
           </p>
27
           </p>
28
         </div>
28
         </div>
29
       </div>
29
       </div>
@@ -50,8 +50,9 @@ export default {
50
   data() {
50
   data() {
51
     return {
51
     return {
52
       // 耗材总价格
52
       // 耗材总价格
53
-      totalPriceConsumable: 0,
54
-      totalPriceWorkHourManagement: 0,
53
+      totalMaintenancePrice: null,
54
+      totalPriceConsumable: null,
55
+      totalPriceWorkHourManagement: null,
55
       summaryObj: {},
56
       summaryObj: {},
56
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
57
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
57
       id: "",
58
       id: "",
@@ -113,16 +114,10 @@ export default {
113
         toast.hide();
114
         toast.hide();
114
         if(res.data.status == 200){
115
         if(res.data.status == 200){
115
           this.summaryObj = res.data;
116
           this.summaryObj = res.data;
116
-          if(this.summaryObj.consumableList){
117
-            this.totalPriceConsumable = this.summaryObj.consumableList.reduce((pre, current) => pre + current.consumableEndPrice * current.consumablesNum, 0)
118
-          }else{
119
-            this.totalPriceConsumable = 0;
120
-          }
121
-          if(this.summaryObj.workHourManagementList){
122
-            this.totalPriceWorkHourManagement = this.summaryObj.workHourManagementList.reduce((pre, current) => pre + current.wage, 0)
123
-          }else{
124
-            this.totalPriceWorkHourManagement = 0;
125
-          }
117
+          this.totalMaintenancePrice = this.summaryObj.totalMaintenancePrice;
118
+          this.totalPriceConsumable = this.summaryObj.consumablePrice;
119
+          this.totalPriceWorkHourManagement = this.summaryObj.workHourPrice;
120
+
126
           this.summaryId = res.data.summaryId;
121
           this.summaryId = res.data.summaryId;
127
         }else if(res.data.status == 201){
122
         }else if(res.data.status == 201){
128
           // 事件第一次绑定汇总单
123
           // 事件第一次绑定汇总单