|
@@ -154,6 +154,14 @@
|
|
<el-button v-if="!formModel.id" :loading="saveLoaing" hc-btn type="primary" @click="modalSaveClose">提交并关闭</el-button>
|
|
<el-button v-if="!formModel.id" :loading="saveLoaing" hc-btn type="primary" @click="modalSaveClose">提交并关闭</el-button>
|
|
</template>
|
|
</template>
|
|
</hc-new-dialog>
|
|
</hc-new-dialog>
|
|
|
|
+ <!-- 同步材料数据 -->
|
|
|
|
+ <hc-new-dialog v-model="asyncModal" title="同步材料数据" :footer="false" widths="70%" @close="asyncClose">
|
|
|
|
+ <hc-table :column="asyncColumn" :datas="asyncData" :index-style="{ width: 60 }" :loading="asyncLoading">
|
|
|
|
+ <template #action="{ row }">
|
|
|
|
+ <el-link type="primary" @click="syncRowData(row)">同步到当前合同段</el-link>
|
|
|
|
+ </template>
|
|
|
|
+ </hc-table>
|
|
|
|
+ </hc-new-dialog>
|
|
</hc-new-card>
|
|
</hc-new-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -213,7 +221,7 @@ const tableColumn = ref([
|
|
{ key: 'quotaRatio', name: '调差限额百分比(%)' },
|
|
{ key: 'quotaRatio', name: '调差限额百分比(%)' },
|
|
{ key: 'ownerRatio', name: '业主收益/承担百分比(%)' },
|
|
{ key: 'ownerRatio', name: '业主收益/承担百分比(%)' },
|
|
{ key: 'deductionRatio', name: '材料综合抵扣率(%)' },
|
|
{ key: 'deductionRatio', name: '材料综合抵扣率(%)' },
|
|
- { key: 'action', name: '操作', width: 100, align: 'center' },
|
|
|
|
|
|
+ { key: 'action', name: '操作', width: 120, align: 'center' },
|
|
])
|
|
])
|
|
|
|
|
|
//获取表格数据
|
|
//获取表格数据
|
|
@@ -448,8 +456,59 @@ const priceCancelClick = () => {
|
|
}
|
|
}
|
|
|
|
|
|
//同步
|
|
//同步
|
|
|
|
+const asyncColumn = ref([
|
|
|
|
+ { key: 'contractName', name: '数据来源' },
|
|
|
|
+ { key: 'materialNumber', name: '材料编号' },
|
|
|
|
+ { key: 'materialName', name: '材料名称' },
|
|
|
|
+ { key: 'specification', name: '规格型号' },
|
|
|
|
+ { key: 'unit', name: '单位' },
|
|
|
|
+ { key: 'price', name: '单价' },
|
|
|
|
+ { key: 'wastageRatio', name: '材料损耗率(%)' },
|
|
|
|
+ { key: 'quotaRatio', name: '调差限额百分比(%)' },
|
|
|
|
+ { key: 'ownerRatio', name: '业主收益/承担百分比(%)' },
|
|
|
|
+ { key: 'deductionRatio', name: '材料综合抵扣率(%)' },
|
|
|
|
+ { key: 'action', name: '操作', width: 140, align: 'center' },
|
|
|
|
+])
|
|
|
|
+const asyncData = ref([])
|
|
|
|
+const asyncLoading = ref(false)
|
|
|
|
+const asyncInfo = ref({})
|
|
|
|
+
|
|
|
|
+//同步
|
|
|
|
+const asyncModal = ref(false)
|
|
const synchronization = async (row) => {
|
|
const synchronization = async (row) => {
|
|
|
|
+ asyncInfo.value = row
|
|
|
|
+ asyncModal.value = true
|
|
|
|
+ asyncLoading.value = true
|
|
|
|
+ const { data } = await mainApi.getSyncData({
|
|
|
|
+ materialNumber: row.materialNumber,
|
|
|
|
+ projectId: projectId.value,
|
|
|
|
+ contractId: contractId.value,
|
|
|
|
+ })
|
|
|
|
+ asyncData.value = getArrValue(data)
|
|
|
|
+ asyncLoading.value = false
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//同步到当前合同段
|
|
|
|
+const syncRowData = async (row) => {
|
|
|
|
+ const { error, code, msg } = await mainApi.syncMaterial({
|
|
|
|
+ id: asyncInfo.value.id,
|
|
|
|
+ selectId: row.id,
|
|
|
|
+ })
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ window.$message.success(msg)
|
|
|
|
+ asyncClose()
|
|
|
|
+ getTableData().then()
|
|
|
|
+ } else {
|
|
|
|
+ window.$message.error(msg ?? '操作失败')
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
+//关闭同步
|
|
|
|
+const asyncClose = () => {
|
|
|
|
+ asyncModal.value = false
|
|
|
|
+ asyncInfo.value = {}
|
|
|
|
+ asyncData.value = []
|
|
|
|
+ asyncLoading.value = false
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|