|
@@ -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);
|