Преглед на файлове

Merge branch 'sxw-skeleton' of http://101.36.160.140:21044/emergency-report/report-vue into sxw-skeleton

sunxuewei преди 2 години
родител
ревизия
b9bad05715

+ 23 - 10
src/views/InformationFilling/enterWarehouseInfo/detail.vue

@@ -56,8 +56,12 @@
56 56
       </el-table-column>
57 57
       <el-table-column prop="totalPrice" label="价值(万元)" align="center" width="114">
58 58
         <template #default="scope">
59
-          {{ (scope.row.quantity)*(scope.row.unitPrice)/10000 ? (scope.row.quantity)*(scope.row.unitPrice)/10000 : 0 }}
60
-          <!-- <el-input v-model="scope.row.totalPrice" size="small"></el-input> -->
59
+          <span v-if="scope.row.materialTree && wanJson.indexOf(scope.row.materialTree[3]) == -1">
60
+            {{ (scope.row.quantity)*(scope.row.unitPrice)/10000 ? (scope.row.quantity)*(scope.row.unitPrice)/10000 : 0 }}
61
+          </span>
62
+          <span v-else>
63
+            {{ (scope.row.quantity)*(scope.row.unitPrice) ? (scope.row.quantity)*(scope.row.unitPrice) : 0 }}
64
+          </span>
61 65
         </template>
62 66
       </el-table-column>
63 67
       <el-table-column prop="isAvailable" label="是否可用" align="center" width="120">
@@ -120,6 +124,8 @@ import { useDict } from '@/hooks/dict';
120 124
 const { indound_type, is_available, province_ch } = useDict('indound_type', 'is_available', 'province_ch');
121 125
 
122 126
 const props = defineProps(['id','type'])
127
+// 价值计算带万
128
+const wanJson = ['118', '122', '124', '132', '182', '184']
123 129
 
124 130
 const tableData = ref([{}]);
125 131
 const wzOptions = ref([])
@@ -178,14 +184,21 @@ const saveSubmit = (status) => {
178 184
     isAvailable: tabData0.isAvailable,
179 185
     inboundMaterialInfos: tableData.value
180 186
   }
181
-  postData.inboundMaterialInfos = tableData.value.map(({filePartList, ...item}) => ({
182
-    ...item,
183
-    materialGroup: item.materialTree[0],
184
-    materialType: item.materialTree[1],
185
-    materialName: item.materialTree[2],
186
-    unit: item.materialTree[3],
187
-    totalPrice: (item.quantity)*(item.unitPrice)/10000 ? (item.quantity)*(item.unitPrice)/10000 : 0
188
-  }));
187
+  postData.inboundMaterialInfos = tableData.value.map(function({filePartList, ...item}){
188
+    let totalPrice = (item.quantity)*(item.unitPrice) ? (item.quantity)*(item.unitPrice) : 0
189
+    if(wanJson.indexOf(item.materialTree[3]) == -1){
190
+      totalPrice = (item.quantity)*(item.unitPrice)/10000 ? (item.quantity)*(item.unitPrice)/10000 : 0
191
+    }
192
+    let returnData = {
193
+      ...item,
194
+      materialGroup: item.materialTree[0],
195
+      materialType: item.materialTree[1],
196
+      materialName: item.materialTree[2],
197
+      unit: item.materialTree[3],
198
+      totalPrice: totalPrice
199
+    }
200
+    return returnData;
201
+  });
189 202
   if(props.id){
190 203
     updateInData(postData).then((res: any) => {
191 204
       if (res.code === 0) {

+ 23 - 10
src/views/InformationFilling/outIssue/detail.vue

@@ -71,8 +71,12 @@
71 71
       </el-table-column>
72 72
       <el-table-column prop="totalPrice" label="价值(万元)" align="center" width="114">
73 73
         <template #default="scope">
74
-          {{ (scope.row.quantity)*(scope.row.unitPrice)/10000 ? (scope.row.quantity)*(scope.row.unitPrice)/10000 : 0 }}
75
-          <!-- <el-input v-model="scope.row.totalPrice" size="small"></el-input> -->
74
+          <span v-if="scope.row.materialTree && wanJson.indexOf(scope.row.materialTree[3]) == -1">
75
+            {{ (scope.row.quantity)*(scope.row.unitPrice)/10000 ? (scope.row.quantity)*(scope.row.unitPrice)/10000 : 0 }}
76
+          </span>
77
+          <span v-else>
78
+            {{ (scope.row.quantity)*(scope.row.unitPrice) ? (scope.row.quantity)*(scope.row.unitPrice) : 0 }}
79
+          </span>
76 80
         </template>
77 81
       </el-table-column>
78 82
       <el-table-column prop="isAvailable" label="是否可用" align="center" width="120">
@@ -135,6 +139,8 @@ import { useDict } from '@/hooks/dict';
135 139
 const { outdound_type, is_available, province_ch } = useDict('outdound_type', 'is_available', 'province_ch');
136 140
 
137 141
 const props = defineProps(['id','type'])
142
+// 价值计算带万
143
+const wanJson = ['118', '122', '124', '132', '182', '184']
138 144
 
139 145
 const tableData = ref([{}]);
140 146
 const wzOptions = ref([])
@@ -214,14 +220,21 @@ const saveSubmit = (status) => {
214 220
     deptId: formData.value.deptId,
215 221
     warehouse: showCh(formData.value.deptId, dcckOptions.value)
216 222
   }
217
-  postData.outboundMaterialInfos = tableData.value.map(({filePartList, ...item}) => ({
218
-    ...item,
219
-    materialGroup: item.materialTree[0],
220
-    materialType: item.materialTree[1],
221
-    materialName: item.materialTree[2],
222
-    unit: item.materialTree[3],
223
-    totalPrice: (item.quantity)*(item.unitPrice)/10000 ? (item.quantity)*(item.unitPrice)/10000 : 0
224
-  }));
223
+  postData.outboundMaterialInfos = tableData.value.map(function({filePartList, ...item}){
224
+    let totalPrice = (item.quantity)*(item.unitPrice) ? (item.quantity)*(item.unitPrice) : 0
225
+    if(wanJson.indexOf(item.materialTree[3]) == -1){
226
+      totalPrice = (item.quantity)*(item.unitPrice)/10000 ? (item.quantity)*(item.unitPrice)/10000 : 0
227
+    }
228
+    let returnData = {
229
+      ...item,
230
+      materialGroup: item.materialTree[0],
231
+      materialType: item.materialTree[1],
232
+      materialName: item.materialTree[2],
233
+      unit: item.materialTree[3],
234
+      totalPrice: totalPrice
235
+    }
236
+    return returnData;
237
+  });
225 238
   if(props.id){
226 239
     updateOutData(postData).then((res: any) => {
227 240
       if (res.code === 0) {

+ 23 - 10
src/views/InformationFilling/outWarehouseInfo/detail.vue

@@ -64,8 +64,12 @@
64 64
       </el-table-column>
65 65
       <el-table-column prop="totalPrice" label="价值(万元)" align="center" width="114">
66 66
         <template #default="scope">
67
-          {{ (scope.row.quantity)*(scope.row.unitPrice)/10000 ? (scope.row.quantity)*(scope.row.unitPrice)/10000 : 0 }}
68
-          <!-- <el-input v-model="scope.row.totalPrice" size="small"></el-input> -->
67
+          <span v-if="scope.row.materialTree && wanJson.indexOf(scope.row.materialTree[3]) == -1">
68
+            {{ (scope.row.quantity)*(scope.row.unitPrice)/10000 ? (scope.row.quantity)*(scope.row.unitPrice)/10000 : 0 }}
69
+          </span>
70
+          <span v-else>
71
+            {{ (scope.row.quantity)*(scope.row.unitPrice) ? (scope.row.quantity)*(scope.row.unitPrice) : 0 }}
72
+          </span>
69 73
         </template>
70 74
       </el-table-column>
71 75
       <el-table-column prop="isAvailable" label="是否可用" align="center" width="120">
@@ -129,6 +133,8 @@ import { useDict } from '@/hooks/dict';
129 133
 const { outdound_type, is_available, province_ch } = useDict('outdound_type', 'is_available', 'province_ch');
130 134
 
131 135
 const props = defineProps(['id','type'])
136
+// 价值计算带万
137
+const wanJson = ['118', '122', '124', '132', '182', '184']
132 138
 
133 139
 const tableData = ref([{}]);
134 140
 const wzOptions = ref([])
@@ -191,14 +197,21 @@ const saveSubmit = (status) => {
191 197
     isAvailable: tabData0.isAvailable,
192 198
     outboundMaterialInfos: tableData.value
193 199
   }
194
-  postData.outboundMaterialInfos = tableData.value.map(({filePartList, ...item}) => ({
195
-    ...item,
196
-    materialGroup: item.materialTree[0],
197
-    materialType: item.materialTree[1],
198
-    materialName: item.materialTree[2],
199
-    unit: item.materialTree[3],
200
-    totalPrice: (item.quantity)*(item.unitPrice)/10000 ? (item.quantity)*(item.unitPrice)/10000 : 0
201
-  }));
200
+  postData.outboundMaterialInfos = tableData.value.map(function({filePartList, ...item}){
201
+    let totalPrice = (item.quantity)*(item.unitPrice) ? (item.quantity)*(item.unitPrice) : 0
202
+    if(wanJson.indexOf(item.materialTree[3]) == -1){
203
+      totalPrice = (item.quantity)*(item.unitPrice)/10000 ? (item.quantity)*(item.unitPrice)/10000 : 0
204
+    }
205
+    let returnData = {
206
+      ...item,
207
+      materialGroup: item.materialTree[0],
208
+      materialType: item.materialTree[1],
209
+      materialName: item.materialTree[2],
210
+      unit: item.materialTree[3],
211
+      totalPrice: totalPrice
212
+    }
213
+    return returnData;
214
+  });
202 215
   if(props.id){
203 216
     updateOutData(postData).then((res: any) => {
204 217
       if (res.code === 0) {