|
@@ -30,7 +30,7 @@
|
|
|
<div class="data-custom-tree-node">
|
|
|
<div class="level">{{ data.formName }}</div>
|
|
|
<div v-if="data.isFormNode" class="submit-input">
|
|
|
- <el-input v-model="data.param" size="small" placeholder="请输入调差参数" />
|
|
|
+ <el-input v-model="data.adjustFactor" size="small" placeholder="请输入调差参数" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -39,15 +39,19 @@
|
|
|
</template>
|
|
|
</hc-body>
|
|
|
<!-- 调差系数编辑 -->
|
|
|
- <hc-new-dialog :show="isFormModal" title="调差系数编辑" :footer="false" is-table widths="50rem" @close="modalClose">
|
|
|
+ <hc-new-dialog :show="isFormModal" title="调差系数编辑" is-footer-center is-table widths="50rem" @close="modalClose">
|
|
|
<hc-table :column="tableColumn1" :datas="tableData2" :is-index="false">
|
|
|
- <template #key4="{ row }">
|
|
|
- <hc-table-input v-model="row.key4" />
|
|
|
+ <template #adjustFactor="{ row }">
|
|
|
+ <hc-table-input v-model="row.adjustFactor" />
|
|
|
</template>
|
|
|
<template #action="{ row }">
|
|
|
<el-link type="danger" @click="dischargeBinding(row)">解除绑定关系</el-link>
|
|
|
</template>
|
|
|
</hc-table>
|
|
|
+ <template #footer>
|
|
|
+ <el-button hc-btn @click="modalClose">取消</el-button>
|
|
|
+ <el-button :loading="saveLoaing" hc-btn type="primary" @click="modalSave">提交</el-button>
|
|
|
+ </template>
|
|
|
</hc-new-dialog>
|
|
|
</hc-card>
|
|
|
</template>
|
|
@@ -133,11 +137,33 @@ const rowBinding = async (row) => {
|
|
|
|
|
|
//确认绑定
|
|
|
const confirmBinding = async (row) => {
|
|
|
- const list = treeNodeCheckList.value
|
|
|
- console.log(list)
|
|
|
-
|
|
|
- //rowBindingShow.value = false
|
|
|
- //row.rowBindingData = false
|
|
|
+ const nodes = treeRef.value?.getCheckedNodes()
|
|
|
+ if (nodes.length <= 0) {
|
|
|
+ window.$message.error('请先勾选要绑定的节点')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ //处理数据
|
|
|
+ let newArr = []
|
|
|
+ for (let i = 0; i < nodes.length; i++) {
|
|
|
+ newArr.push({
|
|
|
+ id: nodes[i].id,
|
|
|
+ adjustFactor: nodes[i].adjustFactor ?? '',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //发起请求
|
|
|
+ const { error, code, msg } = await mainApi.linkFormMaterial({
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ materialId: row.id,
|
|
|
+ forms: newArr,
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success(msg)
|
|
|
+ cancelBinding(row)
|
|
|
+ getTableData().then()
|
|
|
+ } else {
|
|
|
+ window.$message.error(msg ?? '操作失败')
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//取消绑定
|
|
@@ -152,7 +178,7 @@ const tableColumn1 = [
|
|
|
{ key: 'formNumber', name: '清单编号' },
|
|
|
{ key: 'materialName', name: '绑定材料名称' },
|
|
|
{ key: 'adjustFactor', name: '调差系数' },
|
|
|
- { key: 'action', name: '操作', width: 140, align: 'center' },
|
|
|
+ { key: 'action', name: '操作', width: 110, align: 'center' },
|
|
|
]
|
|
|
const tableData2 = ref([])
|
|
|
const getLinkAllForm = async (id) => {
|
|
@@ -188,6 +214,12 @@ const dischargeBinding = (row) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+//保存
|
|
|
+const saveLoaing = ref(false)
|
|
|
+const modalSave = async () => {
|
|
|
+ modalClose()
|
|
|
+}
|
|
|
+
|
|
|
//取消关闭
|
|
|
const modalClose = () => {
|
|
|
isFormModal.value = false
|