Quellcode durchsuchen

1.新增询价网址链接列
2.新增机器设备作价页面展示评估值合计
3.新增机器设备有筛选条件变色提示
4.新增下载机器设备申报表模板

GouGengquan vor 7 Monaten
Ursprung
Commit
9a8405f13e

+ 4 - 0
src/views/assets/template/createCalculate.vue

@@ -200,6 +200,10 @@ export default {
                 {
                     value: 'NONSTANDARD',
                     label: '机器设备-非标设备-段落模板',
+                },
+                {
+                    value: 'DECLARATION_FORM',
+                    label: '机器设备-基础信息导入模板',
                 }
             ],
             tmplCodes: null,

+ 118 - 33
src/views/assets/workbench/calculate/importInfo.vue

@@ -16,7 +16,7 @@
                 </div>
                 <template #tip>
                     <div class="el-upload__tip">
-                        文件大小限制在100MB及以下
+                        文件大小限制在100MB及以下<el-button type="primary" link @click="downloadDeclarationForm()" style="font-size:12px;margin-bottom: 2px;float:right">下载申报表</el-button>
                     </div>
                 </template>
             </el-upload>
@@ -26,6 +26,12 @@
             <el-button type="primary" @click="addEqptDataDialog = true">
                 单条新增
             </el-button>
+            <el-descriptions title="评估值合计" :column="1" border style="margin-top:20px">
+                <el-descriptions-item width="80" label="账面原值(元)">{{ bookOriginalValueTotal.toFixed(2) }}</el-descriptions-item>
+                <el-descriptions-item width="80" label="账面净值(元)">{{ bookNetValueTotal.toFixed(2) }}</el-descriptions-item>
+                <el-descriptions-item width="80" label="评估原值(元)">{{ evaluateOriginalValueTotal.toFixed(2) }}</el-descriptions-item>
+                <el-descriptions-item width="80" label="评估净值(元)">{{ evaluateNetValueTotal.toFixed(2) }}</el-descriptions-item>
+            </el-descriptions>
         </div>
         <div id="evaluateDiv" class="evaluateDiv">
             <el-button v-if="activeName === 'all'" type="success" style="float:left" @click="saveBatch()"><el-icon>
@@ -91,7 +97,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptNameFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -113,7 +119,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptManufacturerFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -135,7 +141,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptModelFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -157,7 +163,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptPurchaseDateFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -179,7 +185,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptActivationDateFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -246,7 +252,7 @@
                 </vxe-colgroup>
                 <vxe-column field="economicServiceLife" title="经济使用年数" width="160" :edit-render="{}">
                     <template #edit="{ $rowIndex, row }">
-                        <el-input v-model="row.economicServiceLife" @change="countDepreciationRate(row.depreciationRateByAge, $rowIndex)" />
+                        <el-input v-model="row.economicServiceLife" @change="countDepreciationRate(row)" />
                     </template>
                 </vxe-column>
                 <vxe-column field="yearsInUse" title="已使用年数" width="160">
@@ -315,6 +321,7 @@
                         </el-upload> -->
                     </template>
                 </vxe-column>
+                <vxe-column field="inquiryWeb" title="询价网址" width="160" :edit-render="{ name: 'VxeInput' }"></vxe-column>
                 <vxe-column field="inquiryLocation" title="询价地点" width="160" :edit-render="{ name: 'VxeInput' }"></vxe-column>
                 <vxe-column field="price" title="询价单价" width="160" :edit-render="{ name: 'VxeNumberInput' }"></vxe-column>
                 <vxe-column field="quotation" title="报价(含税不含运费不含安装调试费)" width="160">
@@ -389,7 +396,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptNameFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -411,7 +418,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptModelFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -433,7 +440,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptManufacturerFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -456,7 +463,7 @@
                                 <el-button size="small" type="primary" @click="getImpEqptDataPage()">筛选</el-button>
                             </div>
                             <template #reference>
-                                <div style="display: inline-block">
+                                <div style="display: inline-block" :color="eqptPurchaseDateFilterArr.length > 0 ? '#ff6154' : ''">
                                     <el-button link><el-icon>
                                             <ArrowDown />
                                         </el-icon></el-button>
@@ -479,7 +486,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptActivationDateFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -521,7 +528,7 @@
                 <vxe-column field="tariffRate" title="关税税率%" width="160" :edit-render="{ name: 'VxeNumberInput' }"></vxe-column>
                 <vxe-column field="tariffRatePicture" title="关税税率截图" width="160" :edit-render="{}">
                     <template #edit="{ row, $rowIndex }">
-                        <el-input v-model="row.tariffRatePicture" placeholder="粘贴关税税率截图"  @paste.native="(e) => { return imagePaste(e, row, 'tariffRatePicture'); }" />
+                        <el-input v-model="row.tariffRatePicture" placeholder="粘贴关税税率截图" @paste.native="(e) => { return imagePaste(e, row, 'tariffRatePicture'); }" />
                         <!-- <el-upload v-model:file-list="imageList" action="/pp/file/upload/image" accept=".gif,.jpg,.jpeg,.jpg2,.png,.tif,.tiff,.bmp,.svg,.svgz,.webp" :limit="1" :show-file-list="false" :on-success="(response, file, fileList) => {
                             return tariffRatePictureSuccess(response, file, fileList, $rowIndex);
                         }
@@ -591,7 +598,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptNameFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -613,7 +620,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptModelFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -635,7 +642,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptManufacturerFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -660,7 +667,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptPurchaseDateFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -682,7 +689,7 @@
                             </div>
                             <template #reference>
                                 <div style="display: inline-block">
-                                    <el-button link><el-icon>
+                                    <el-button link><el-icon :color="eqptActivationDateFilterArr.length > 0 ? '#ff6154' : ''">
                                             <ArrowDown />
                                         </el-icon></el-button>
                                 </div>
@@ -876,6 +883,7 @@ import { getPPIDownData, getPPIByNameType } from '@/api/eqptPPI';
 import { eqptGnEvpList } from '@/api/eqptGnEvp';
 import { imagePasteHandler } from '@/utils/handlerPaste';
 import { uploadImage } from '@/api/fileUpload';
+import fileUtil from '@/utils/file'
 
 import { VxeUI, VxeTableInstance, VxeTablePropTypes } from 'vxe-table'
 
@@ -960,40 +968,84 @@ export default {
 
         // 机器设备筛选条件
         equipmentNameFilterOptions() {
-            if(this.equipmentName) {
+            if (this.equipmentName) {
                 return this.equipmentNameFilters.filter((option) => option.filter.includes(this.equipmentName));
             } else {
                 return this.equipmentNameFilters;
             }
-		},
+        },
         equipmentModelFilterOptions() {
-            if(this.equipmentModel) {
+            if (this.equipmentModel) {
                 return this.equipmentModelFilters.filter((option) => option.filter.includes(this.equipmentName));
             } else {
                 return this.equipmentModelFilters;
             }
-		},
+        },
         equipmenPurchaseDateFilterOptions() {
-            if(this.equipmentPurchaseDate) {
+            if (this.equipmentPurchaseDate) {
                 return this.equipmenPurchaseDateFilters.filter((option) => option.filter.includes(this.equipmentPurchaseDate));
             } else {
                 return this.equipmenPurchaseDateFilters;
             }
-		},
+        },
         equipmentManufacturerFilterOptions() {
-            if(this.manufacturer) {
+            if (this.manufacturer) {
                 return this.equipmentManufacturerFilters.filter((option) => option.filter.includes(this.manufacturer));
             } else {
                 return this.equipmentManufacturerFilters;
             }
-		},
+        },
         equipmentActivationDateFilterOptions() {
-            if(this.equipmentActivationDate) {
+            if (this.equipmentActivationDate) {
                 return this.equipmentActivationDateFilters.filter((option) => option.filter.includes(this.equipmentActivationDate));
             } else {
                 return this.equipmentActivationDateFilters;
             }
-		}
+        },
+        // 计算账面原值总和
+        bookOriginalValueTotal() {
+            return this.eqptPageData.reduce((sum, item) => {
+                const amount = Number(item.bookOriginalValue);
+                // 只累加有效的数字值
+                if (!isNaN(amount) && amount !== undefined) {
+                    return parseFloat(sum + amount * 1);
+                }
+                return parseFloat(sum);
+            }, 0); // 初始值为 0
+        },
+        // 计算账面净值总和
+        bookNetValueTotal() {
+            return this.eqptPageData.reduce((sum, item) => {
+                const amount = Number(item.bookNetValue);
+                // 只累加有效的数字值
+                if (!isNaN(amount) && amount !== undefined) {
+                    return parseFloat(sum + amount * 1);
+                }
+                return parseFloat(sum);
+            }, 0);
+        },
+        // 计算评估原值总和
+        evaluateOriginalValueTotal() {
+            return this.eqptPageData.reduce((sum, item) => {
+                const amount = Number(item.evaluateOriginalValue);
+                // 只累加有效的数字值
+                if (!isNaN(amount) && amount !== undefined) {
+                    return parseFloat(sum + amount * 1);
+                }
+                return parseFloat(sum);
+            }, 0);
+        },
+        // 计算评估净值总和
+        evaluateNetValueTotal() {
+            return this.eqptPageData.reduce((sum, item) => {
+                const amount = Number(item.evaluateNetValue);
+                // 只累加有效的数字值
+                if (!isNaN(amount) && amount !== undefined) {
+                    return parseFloat(sum + amount * 1);
+                }
+                return parseFloat(sum);
+            }, 0);
+        }
     },
     created() {
         this.getBaseInfo();
@@ -1022,10 +1074,13 @@ export default {
             this.equipmentPurchaseDate = null;
             this.equipmentActivationDateFilters = [];
             this.equipmentActivationDate = null;
+            this.equipmentManufacturerFilters = [];
+            this.equipmentActivationDate = null;
             this.eqptNameFilterArr = [];
             this.eqptModelFilterArr = [];
             this.eqptPurchaseDateFilterArr = [];
             this.eqptActivationDateFilterArr = [];
+            this.eqptManufacturerFilterArr = [];
             if (this.activeName === 'all') {
                 this.getEqptDataPage();
             }
@@ -1220,8 +1275,33 @@ export default {
                 }
             })
         },
-        // 计算直接观察成新率
-        countDepreciationRate(value, index) {
+        // 计算直接观察成新率(操作Table Row数据)
+        countDepreciationRate(row) {
+            /**
+             * 年限成新率个位<=2成新率个位为0不进位
+             * 年限成新率个位>=8个位为0进一位
+             * 8>年限成新率个位>2个位为5不进位
+             */
+            let value = row.depreciationRateByAge;
+            if (value) {
+                // 获取个位
+                let unitsDigit = value % 10;
+                if (unitsDigit < 3) {
+                    value = value - unitsDigit;
+                }
+                if (unitsDigit > 7) {
+                    value = value - unitsDigit + 10;
+                }
+                if (unitsDigit < 8 && unitsDigit > 2 && unitsDigit !== 5) {
+                    value = value - unitsDigit;
+                    unitsDigit = 5
+                    value = value + unitsDigit;
+                }
+                row.directObservationDepreciationRate = value;
+            }
+        },
+        // 计算直接观察成新率(直接操作数组的方式)
+        countDepreciationRateInDataArr(value, index) {
             /**
              * 年限成新率个位<=2成新率个位为0不进位
              * 年限成新率个位>=8个位为0进一位
@@ -1344,9 +1424,10 @@ export default {
                         this.eqptPageData[index].economicServiceLife = item.lifeRecommendedValue;
                         this.eqptPageData[index].installationRate = item.ifrRecommendedValue;
                         // 计算年限成新率
-                        this.eqptPageData[index].depreciationRateByAge = ((this.eqptPageData[index].economicServiceLife - this.eqptPageData[index].yearsInUse) / this.eqptPageData[index].economicServiceLife < 0.15) ? 15 :
-                            ((this.eqptPageData[index].economicServiceLife - this.eqptPageData[index].yearsInUse) / this.eqptPageData[index].economicServiceLife).toFixed(2) * 100
-                        this.countDepreciationRate(this.eqptPageData[index].depreciationRateByAge, index)
+                        this.eqptPageData[index].yearsInUse = (this.getDaysBetween(this.eqptPageData[index].activationDate, this.calculateBaseInfo.valuationBasisDate) / 365).toFixed(2)
+                        this.eqptPageData[index].depreciationRateByAge = ((this.eqptPageData[index].economicServiceLife * 1 - this.eqptPageData[index].yearsInUse * 1) / this.eqptPageData[index].economicServiceLife * 1 < 0.15) ? 15 :
+                            ((this.eqptPageData[index].economicServiceLife * 1 - this.eqptPageData[index].yearsInUse * 1) / this.eqptPageData[index].economicServiceLife * 1).toFixed(2) * 100
+                        this.countDepreciationRateInDataArr(this.eqptPageData[index].depreciationRateByAge, index);
                         break;
                     }
                 }
@@ -1549,6 +1630,10 @@ export default {
                 }
             });
             return Array.from(uniqueMap, ([key, value]) => ({ filter: key, count: value }))
+        },
+        // 下载申报表
+        downloadDeclarationForm() {
+            fileUtil.download("/file/download/assets/declarationForm?tmplCode=DECLARATION_FORM");
         }
     },