瀏覽代碼

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
       </el-table-column>
56
       </el-table-column>
57
       <el-table-column prop="totalPrice" label="价值(万元)" align="center" width="114">
57
       <el-table-column prop="totalPrice" label="价值(万元)" align="center" width="114">
58
         <template #default="scope">
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
         </template>
65
         </template>
62
       </el-table-column>
66
       </el-table-column>
63
       <el-table-column prop="isAvailable" label="是否可用" align="center" width="120">
67
       <el-table-column prop="isAvailable" label="是否可用" align="center" width="120">
@@ -120,6 +124,8 @@ import { useDict } from '@/hooks/dict';
120
 const { indound_type, is_available, province_ch } = useDict('indound_type', 'is_available', 'province_ch');
124
 const { indound_type, is_available, province_ch } = useDict('indound_type', 'is_available', 'province_ch');
121
 
125
 
122
 const props = defineProps(['id','type'])
126
 const props = defineProps(['id','type'])
127
+// 价值计算带万
128
+const wanJson = ['118', '122', '124', '132', '182', '184']
123
 
129
 
124
 const tableData = ref([{}]);
130
 const tableData = ref([{}]);
125
 const wzOptions = ref([])
131
 const wzOptions = ref([])
@@ -178,14 +184,21 @@ const saveSubmit = (status) => {
178
     isAvailable: tabData0.isAvailable,
184
     isAvailable: tabData0.isAvailable,
179
     inboundMaterialInfos: tableData.value
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
   if(props.id){
202
   if(props.id){
190
     updateInData(postData).then((res: any) => {
203
     updateInData(postData).then((res: any) => {
191
       if (res.code === 0) {
204
       if (res.code === 0) {

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

@@ -71,8 +71,12 @@
71
       </el-table-column>
71
       </el-table-column>
72
       <el-table-column prop="totalPrice" label="价值(万元)" align="center" width="114">
72
       <el-table-column prop="totalPrice" label="价值(万元)" align="center" width="114">
73
         <template #default="scope">
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
         </template>
80
         </template>
77
       </el-table-column>
81
       </el-table-column>
78
       <el-table-column prop="isAvailable" label="是否可用" align="center" width="120">
82
       <el-table-column prop="isAvailable" label="是否可用" align="center" width="120">
@@ -135,6 +139,8 @@ import { useDict } from '@/hooks/dict';
135
 const { outdound_type, is_available, province_ch } = useDict('outdound_type', 'is_available', 'province_ch');
139
 const { outdound_type, is_available, province_ch } = useDict('outdound_type', 'is_available', 'province_ch');
136
 
140
 
137
 const props = defineProps(['id','type'])
141
 const props = defineProps(['id','type'])
142
+// 价值计算带万
143
+const wanJson = ['118', '122', '124', '132', '182', '184']
138
 
144
 
139
 const tableData = ref([{}]);
145
 const tableData = ref([{}]);
140
 const wzOptions = ref([])
146
 const wzOptions = ref([])
@@ -214,14 +220,21 @@ const saveSubmit = (status) => {
214
     deptId: formData.value.deptId,
220
     deptId: formData.value.deptId,
215
     warehouse: showCh(formData.value.deptId, dcckOptions.value)
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
   if(props.id){
238
   if(props.id){
226
     updateOutData(postData).then((res: any) => {
239
     updateOutData(postData).then((res: any) => {
227
       if (res.code === 0) {
240
       if (res.code === 0) {

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

@@ -64,8 +64,12 @@
64
       </el-table-column>
64
       </el-table-column>
65
       <el-table-column prop="totalPrice" label="价值(万元)" align="center" width="114">
65
       <el-table-column prop="totalPrice" label="价值(万元)" align="center" width="114">
66
         <template #default="scope">
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
         </template>
73
         </template>
70
       </el-table-column>
74
       </el-table-column>
71
       <el-table-column prop="isAvailable" label="是否可用" align="center" width="120">
75
       <el-table-column prop="isAvailable" label="是否可用" align="center" width="120">
@@ -129,6 +133,8 @@ import { useDict } from '@/hooks/dict';
129
 const { outdound_type, is_available, province_ch } = useDict('outdound_type', 'is_available', 'province_ch');
133
 const { outdound_type, is_available, province_ch } = useDict('outdound_type', 'is_available', 'province_ch');
130
 
134
 
131
 const props = defineProps(['id','type'])
135
 const props = defineProps(['id','type'])
136
+// 价值计算带万
137
+const wanJson = ['118', '122', '124', '132', '182', '184']
132
 
138
 
133
 const tableData = ref([{}]);
139
 const tableData = ref([{}]);
134
 const wzOptions = ref([])
140
 const wzOptions = ref([])
@@ -191,14 +197,21 @@ const saveSubmit = (status) => {
191
     isAvailable: tabData0.isAvailable,
197
     isAvailable: tabData0.isAvailable,
192
     outboundMaterialInfos: tableData.value
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
   if(props.id){
215
   if(props.id){
203
     updateOutData(postData).then((res: any) => {
216
     updateOutData(postData).then((res: any) => {
204
       if (res.code === 0) {
217
       if (res.code === 0) {