|
@@ -16,12 +16,12 @@
|
|
|
:column="tableColumn" :datas="tableData" :loading="tableLoading" is-new
|
|
|
:check-style="{ width: 29 }" :index-style="{ width: 60 }"
|
|
|
>
|
|
|
- <template #key3="{ row }">
|
|
|
- <el-tag v-if="row.key3" type="success">是</el-tag>
|
|
|
+ <template #isLinkData="{ row }">
|
|
|
+ <el-tag v-if="row.isLinkData === 1" type="success">是</el-tag>
|
|
|
<el-tag v-else type="danger">否</el-tag>
|
|
|
</template>
|
|
|
<template #action="{ row }">
|
|
|
- <el-button type="primary" @click="relateData(row)">关联质保资料</el-button>
|
|
|
+ <el-button type="primary" :disabled="row.isLinkData === 1" @click="relateData(row)">关联质检资料</el-button>
|
|
|
</template>
|
|
|
</hc-table>
|
|
|
<template #action>
|
|
@@ -29,17 +29,18 @@
|
|
|
</template>
|
|
|
</hc-new-card>
|
|
|
</div>
|
|
|
+ <!-- 关联质检资料 -->
|
|
|
+ <qualityRleation :quality-moadal="qualityMoadal" :cid="contractId" :period-id="searchForm.contractPeriodId" :is-remian-old-check="false" :save-modal-loading="saveModalLoading" @finish="finishModal" />
|
|
|
</div>
|
|
|
- <!-- 关联质检资料 -->
|
|
|
- <qualityRleation :quality-moadal="qualityMoadal" :cid="contractId" :period-id="searchForm.contractPeriodId" />
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import { nextTick, onActivated, onMounted, ref } from 'vue'
|
|
|
import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
|
-import { getArrValue, getObjValue, getRandom } from 'js-fast-way'
|
|
|
+import { arrToKey, getArrValue, getObjValue, getRandom } from 'js-fast-way'
|
|
|
import unitApi from '~api/project/debit/contract/unit'
|
|
|
import mainApi from '~api/debit-pay/admin/middlepay'
|
|
|
+import dataLinkApi from '~api/debit-pay/ledger/datarelate'
|
|
|
import qualityRleation from '~src/views/debit-pay/admin/components/middlepay/qualityRleation.vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
const useAppState = useAppStore()
|
|
@@ -139,18 +140,18 @@ const tableLoading = ref(false)
|
|
|
const tableColumn = ref([
|
|
|
{ key: 'meterNumber', name: '计量单编号' },
|
|
|
{ key: 'engineerDivide', name: '工程划分部位' },
|
|
|
- { key: 'key3', name: '资料是否齐全' },
|
|
|
+ { key: 'isLinkData', name: '资料是否齐全' },
|
|
|
{ key: 'meterMoney', name: '计量金额' },
|
|
|
- { key: 'key5', name: '应扣回金额' },
|
|
|
+ { key: 'meterMoney', name: '应扣回金额' },
|
|
|
{ key: 'businessDate', name: '业务日期' },
|
|
|
- { key: 'key7', name: '距离扣回金额日期' },
|
|
|
+ { key: 'deductDate', name: '距离扣回金额日期' },
|
|
|
{ key: 'action', name: '操作', width: 120, align: 'center' },
|
|
|
])
|
|
|
const tableData = ref([])
|
|
|
const getTableData = async () => {
|
|
|
tableData.value = []
|
|
|
tableLoading.value = true
|
|
|
- const { data } = await mainApi.getPage({
|
|
|
+ const { data } = await dataLinkApi.dataLinkPage({
|
|
|
...searchForm.value,
|
|
|
contractId: contractId.value,
|
|
|
})
|
|
@@ -161,8 +162,34 @@ const getTableData = async () => {
|
|
|
|
|
|
//关联质检资料
|
|
|
const qualityMoadal = ref(false)
|
|
|
-const relateData = ()=>{
|
|
|
+const meterId = ref('')
|
|
|
+const relateData = (row)=>{
|
|
|
qualityMoadal.value = true
|
|
|
+ meterId.value = row.id
|
|
|
+}
|
|
|
+const saveModalLoading = ref(false)
|
|
|
+const finishModal = async (rows, cancelcheck)=>{
|
|
|
+ console.log(rows, 'rows')
|
|
|
+ console.log(cancelcheck, 'cancelcheck')
|
|
|
+ const fileIds = arrToKey(rows, 'selectId', ',')
|
|
|
+ if (rows.length > 0) {
|
|
|
+ saveModalLoading.value = true
|
|
|
+ const { data, code, msg, error } = await dataLinkApi.dataLinkFile({
|
|
|
+ fileIds,
|
|
|
+ id:meterId.value,
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success(msg)
|
|
|
+ getTableData()
|
|
|
+ qualityMoadal.value = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ window.$message.warning('请选择对应的资料')
|
|
|
+ }
|
|
|
+
|
|
|
+// qualityMoadal.value = false
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
</script>
|
|
|
|