Ver Fonte

材料调差计算

ZaiZai há 1 ano atrás
pai
commit
9e0d716dfc

+ 8 - 0
src/api/modules/debit-pay/material/material.js

@@ -88,4 +88,12 @@ export default {
             params: { id },
         }, false)
     },
+    //材料明细-计算调差数量与金额
+    async calculate(form) {
+        return HcApi({
+            url: '/api/blade-meter/contractMaterialAdjust/material-adjust-calculate',
+            method: 'post',
+            data: form,
+        }, false)
+    },
 }

+ 1 - 1
src/config/index.json

@@ -1,6 +1,6 @@
 {
     "version": "20230607160059",
-    "target": "http://192.168.0.109:8090",
+    "target": "http://39.108.216.210:8090",
     "target1": "http://192.168.0.125:8090",
     "smsPhone": "",
     "vite": {

+ 40 - 2
src/views/debit-pay/material/components/material/dataModal.vue

@@ -87,12 +87,12 @@
                     </tr>
                     <tr>
                         <hc-info-table-td is-title width="10%">
-                            <span>材料数量:</span>
+                            <span>调差数量:</span>
                             <i class="i-iconoir-asterisk asterisk-icon" />
                         </hc-info-table-td>
                         <hc-info-table-td>
                             <el-form-item prop="materialTotal">
-                                <el-input v-model="formModel.materialTotal" />
+                                <el-input v-model="formModel.adjustTotal" />
                             </el-form-item>
                         </hc-info-table-td>
                         <hc-info-table-td is-title width="10%">价差幅度:</hc-info-table-td>
@@ -130,6 +130,9 @@
             <div v-if="tab_key === '材料明细'" class="loop-refresh-icon" @click="getMaterialDetail">
                 <hc-icon name="loop-left" />
             </div>
+            <div v-if="tab_key === '材料明细'" class="computation-btn">
+                <el-button size="small" color="#008200" @click="computationClick">计算</el-button>
+            </div>
             <div v-if="tab_key === '材料明细'" class="table-body">
                 <hc-table :column="tableColumn1" :datas="tableData1" :index-style="{ width: 60 }" :loading="tableLoading1">
                     <template #changeTotal="{ row }">
@@ -539,6 +542,30 @@ const changeTotalBlur = (row) => {
     row.adjustTotal = new BigNumber(changeTotal).multipliedBy(adjustFactor).toString()
 }
 
+//计算
+const computationClick = async () => {
+    const isForm = await formValidate(formRef.value)
+    if (!isForm) return
+    if (tableData1.value.length <= 0) {
+        window.$message.warning('请先获取材料明细')
+        return
+    }
+    //处理表单
+    const form = formModel.value
+    form.details = tableData1.value
+    form.files = tableData2.value
+    form.projectId = projectId.value
+    form.contractId = contractId.value
+    const { code, msg, data } = await mainApi.calculate(form)
+    if (code === 200) {
+        formModel.value.adjustMoney = data.adjustMoney
+        formModel.value.adjustTotal = data.adjustTotal
+        formModel.value.adjustCalculation = data.adjustCalculation
+    } else {
+        window.$message.error(msg ?? '计算失败')
+    }
+}
+
 //上传附件
 const tableColumn2 = [
     { key: 'fileName', name: '文件名称' },
@@ -713,6 +740,17 @@ const modalClose = () => {
             color: #035903;
         }
     }
+    .computation-btn {
+        position: absolute;
+        font-size: 26px;
+        height: 32px;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        background: white;
+        right: 10px;
+        top: -14px;
+    }
     .table-body {
         position: relative;
         height: calc(100% - 25px);

+ 3 - 3
src/views/debit-pay/material/contract.vue

@@ -50,7 +50,7 @@
                         <el-form-item label="单位:">
                             <el-input v-model="infoData.unit" />
                         </el-form-item>
-                        <el-form-item label="单价:">
+                        <el-form-item label="(基期)单价:">
                             <el-input v-model="infoData.price" />
                         </el-form-item>
                         <el-form-item label="材料损耗:">
@@ -122,7 +122,7 @@
                         </el-form-item>
                     </el-col>
                     <el-col :span="12">
-                        <el-form-item label="单价:">
+                        <el-form-item label="(基期)单价:">
                             <el-input-number v-model="formModel.price" :controls="false" :min="0" class="w-100" />
                         </el-form-item>
                     </el-col>
@@ -216,7 +216,7 @@ const tableColumn = ref([
     { key: 'materialName', name: '材料名称' },
     { key: 'specification', name: '规格型号' },
     { key: 'unit', name: '单位' },
-    { key: 'price', name: '单价' },
+    { key: 'price', name: '(基期)单价' },
     { key: 'wastageRatio', name: '材料损耗率(%)' },
     { key: 'quotaRatio', name: '调差限额百分比(%)' },
     { key: 'ownerRatio', name: '业主收益/承担百分比(%)' },