|
@@ -10,7 +10,7 @@
|
|
|
<HcCard>
|
|
|
<template #header>
|
|
|
<div class="w-52">
|
|
|
- <el-input v-model="searchForm.queryValue" clearable placeholder="请输入名称进行查询" size="large" />
|
|
|
+ <el-input v-model="searchForm.name" clearable placeholder="请输入名称进行查询" size="large" />
|
|
|
</div>
|
|
|
<div class="ml-4">
|
|
|
<el-button type="primary" size="large" @click="searchClick">
|
|
@@ -38,10 +38,10 @@
|
|
|
<el-button size="small" type="primary" @click="editRowClick(row)">
|
|
|
修改
|
|
|
</el-button>
|
|
|
- <el-button size="small" type="warning">
|
|
|
+ <el-button size="small" type="warning" @click="viewPdf(row)">
|
|
|
查看
|
|
|
</el-button>
|
|
|
- <el-button size="small" type="danger">
|
|
|
+ <el-button size="small" type="danger" @click="delAgree(row)">
|
|
|
删除
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -59,6 +59,7 @@ import { useRouter } from 'vue-router'
|
|
|
import landApi from '~api/agree/land.js'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import { getArrValue } from 'js-fast-way'
|
|
|
+import { delMessageV2 } from '~com/message/index.js'
|
|
|
const useAppState = useAppStore()
|
|
|
const projectId = ref(useAppState.getProjectId)
|
|
|
const router = useRouter()
|
|
@@ -66,11 +67,13 @@ const areaId = ref('')
|
|
|
//树节点被点击
|
|
|
const treeNodeTap = ({ node, data }) => {
|
|
|
areaId.value = data.id
|
|
|
+ searchForm.value.areaId = data.id
|
|
|
+ getTableData()
|
|
|
}
|
|
|
|
|
|
//搜索表单
|
|
|
const searchForm = ref({
|
|
|
- projectType: null, queryValue: null, startTime: null, endTime: null,
|
|
|
+ projectType: null, name: null, startTime: null, endTime: null,
|
|
|
current: 1, size: 20, total: 0,
|
|
|
})
|
|
|
|
|
@@ -90,34 +93,31 @@ const pageChange = ({ current, size }) => {
|
|
|
//获取数据
|
|
|
const tableLoading = ref(false)
|
|
|
const tableColumn = [
|
|
|
- { key: 'key1', name: '协议编号' },
|
|
|
- { key: 'key2', name: '协议书名称' },
|
|
|
- { key: 'key3', name: '地类补偿金额' },
|
|
|
- { key: 'key4', name: '青苗及附着物补偿金额' },
|
|
|
- { key: 'key5', name: '补偿总金额' },
|
|
|
+ { key: 'number', name: '协议编号' },
|
|
|
+ { key: 'name', name: '协议书名称' },
|
|
|
+ { key: 'landMoney', name: '地类补偿金额' },
|
|
|
+ { key: 'cropsMoney', name: '青苗及附着物补偿金额' },
|
|
|
+ { key: 'allMoney', name: '补偿总金额' },
|
|
|
{ key: 'action', name: '操作', width: '190', align: 'center' },
|
|
|
]
|
|
|
const tableData = ref([
|
|
|
- { id: 1, key1: 'xxxx', key2: 'xxxx', key3: '65632' },
|
|
|
- { id: 2, key1: 'xxxx', key2: 'xxxx', key3: '65632' },
|
|
|
- { id: 3, key1: 'xxxx', key2: 'xxxx', key3: '65632' },
|
|
|
- { id: 4, key1: 'xxxx', key2: 'xxxx', key3: '65632' },
|
|
|
+
|
|
|
])
|
|
|
const getTableData = async () => {
|
|
|
- // tableLoading.value = true
|
|
|
- // const { error, code, data } = await landApi.getPage({
|
|
|
- // ...searchForm.value,
|
|
|
- // projectId: projectId.value,
|
|
|
- // type:1,
|
|
|
- // })
|
|
|
- // tableLoading.value = false
|
|
|
- // if (!error && code === 200) {
|
|
|
- // tableData.value = getArrValue(data['records'])
|
|
|
- // searchForm.value.total = data['total'] || 0
|
|
|
- // } else {
|
|
|
- // tableData.value = []
|
|
|
- // searchForm.value.total = 0
|
|
|
- // }
|
|
|
+ tableLoading.value = true
|
|
|
+ const { error, code, data } = await landApi.getPage({
|
|
|
+ ...searchForm.value,
|
|
|
+ projectId: projectId.value,
|
|
|
+ type:1,
|
|
|
+ })
|
|
|
+ tableLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ tableData.value = getArrValue(data['records'])
|
|
|
+ searchForm.value.total = data['total'] || 0
|
|
|
+ } else {
|
|
|
+ tableData.value = []
|
|
|
+ searchForm.value.total = 0
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//多选事件
|
|
@@ -147,6 +147,34 @@ const editRowClick = (row) => {
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
+//查看pdf
|
|
|
+const viewPdf = ({ mergePdfUrl }) => {
|
|
|
+ if (mergePdfUrl) {
|
|
|
+ window.open(mergePdfUrl, '_blank')
|
|
|
+ } else {
|
|
|
+ window.$message.error('暂无文件')
|
|
|
+ }
|
|
|
+}
|
|
|
+const delAgree = (row)=>{
|
|
|
+ delMessageV2(async (action, instance, done) => {
|
|
|
+ if (action === 'confirm') {
|
|
|
+ instance.confirmButtonLoading = true
|
|
|
+ const { error, code, msg } = await landApi.remove({
|
|
|
+ ids: row?.id,
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window?.$message?.success('删除成功')
|
|
|
+ getTableData()
|
|
|
+ } else {
|
|
|
+ window?.$message?.warning(msg)
|
|
|
+ }
|
|
|
+ instance.confirmButtonLoading = false
|
|
|
+ done()
|
|
|
+ } else {
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|