|
@@ -2,7 +2,10 @@
|
|
<hc-new-card>
|
|
<hc-new-card>
|
|
<template #header>
|
|
<template #header>
|
|
<div class="w-40">
|
|
<div class="w-40">
|
|
- <el-select v-model="searchForm.meterPeriodId" placeholder="选择计量期" filterable clearable block @change="searchKey1Click">
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="searchForm.meterPeriodId" placeholder="选择计量期" filterable clearable block
|
|
|
|
+ @change="searchKey1Click"
|
|
|
|
+ >
|
|
<el-option v-for="item in key1Data" :key="item.id" :label="item.periodName" :value="item.id" />
|
|
<el-option v-for="item in key1Data" :key="item.id" :label="item.periodName" :value="item.id" />
|
|
</el-select>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
@@ -26,8 +29,12 @@
|
|
is-current-row @selection-change="tableCheckChange" @row-click="hanleRow"
|
|
is-current-row @selection-change="tableCheckChange" @row-click="hanleRow"
|
|
>
|
|
>
|
|
<template #action="{ row }">
|
|
<template #action="{ row }">
|
|
- <el-link type="success" :disabled="approveStatus !== 0" @click="rowEditClick(row)">修改</el-link>
|
|
|
|
- <el-link type="danger" :disabled="approveStatus !== 0" @click="delRowClick(row)">删除</el-link>
|
|
|
|
|
|
+ <el-link type="success" :disabled="approveStatus !== 0" @click="rowEditClick(row)">
|
|
|
|
+ 修改
|
|
|
|
+ </el-link>
|
|
|
|
+ <el-link type="danger" :disabled="approveStatus !== 0" @click="delRowClick(row)">
|
|
|
|
+ 删除
|
|
|
|
+ </el-link>
|
|
</template>
|
|
</template>
|
|
</hc-table>
|
|
</hc-table>
|
|
<template #action>
|
|
<template #action>
|
|
@@ -64,7 +71,12 @@
|
|
<div class="mt-5">附件列表</div>
|
|
<div class="mt-5">附件列表</div>
|
|
<div class="mt-3">
|
|
<div class="mt-3">
|
|
<template v-if="infoData?.fileList?.length > 0">
|
|
<template v-if="infoData?.fileList?.length > 0">
|
|
- <el-check-tag v-for="item in infoData?.fileList" :key="item.id" checked class="mr-2" @click="viewFile(item)">{{ item.fileName }}</el-check-tag>
|
|
|
|
|
|
+ <el-check-tag
|
|
|
|
+ v-for="item in infoData?.fileList" :key="item.id" checked class="mr-2"
|
|
|
|
+ @click="viewFile(item)"
|
|
|
|
+ >
|
|
|
|
+ {{ item.fileName }}
|
|
|
|
+ </el-check-tag>
|
|
</template>
|
|
</template>
|
|
<hc-empty v-else />
|
|
<hc-empty v-else />
|
|
</div>
|
|
</div>
|
|
@@ -72,7 +84,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 新增/修改 -->
|
|
<!-- 新增/修改 -->
|
|
- <HcDataModal v-model="isDataModal" :info-data="infoData" :ids="editId" @close="finishData" />
|
|
|
|
|
|
+ <HcDataModal v-model="isDataModal" :info-data="newInfoData" :ids="editId" @close="finishData" />
|
|
|
|
|
|
<!-- 上报弹窗 -->
|
|
<!-- 上报弹窗 -->
|
|
<hc-report-dialog v-model="isReport" :info="reportInfo" @finish="reportFinish" />
|
|
<hc-report-dialog v-model="isReport" :info="reportInfo" @finish="reportFinish" />
|
|
@@ -83,7 +95,7 @@
|
|
import { nextTick, onActivated, ref } from 'vue'
|
|
import { nextTick, onActivated, ref } from 'vue'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
import HcDataModal from './components/order/dataModal.vue'
|
|
import HcDataModal from './components/order/dataModal.vue'
|
|
-import { getArrValue, getObjValue } from 'js-fast-way'
|
|
|
|
|
|
+import { deepClone, getArrValue, getObjValue } from 'js-fast-way'
|
|
import mainApi from '~api/debit-pay/start-work/order.js'
|
|
import mainApi from '~api/debit-pay/start-work/order.js'
|
|
import periodApi from '~api/debit-pay/material/periods.js'
|
|
import periodApi from '~api/debit-pay/material/periods.js'
|
|
import { HcDelMsg } from 'hc-vue3-ui'
|
|
import { HcDelMsg } from 'hc-vue3-ui'
|
|
@@ -109,10 +121,10 @@ onActivated(() => {
|
|
//计量期
|
|
//计量期
|
|
const key1Data = ref([])
|
|
const key1Data = ref([])
|
|
const approveStatus = ref(0)
|
|
const approveStatus = ref(0)
|
|
-const getKey1Data = async ()=>{
|
|
|
|
|
|
+const getKey1Data = async () => {
|
|
const { error, code, data } = await periodApi.allPeriod({
|
|
const { error, code, data } = await periodApi.allPeriod({
|
|
- contractId:contractId.value,
|
|
|
|
- type:2,
|
|
|
|
|
|
+ contractId: contractId.value,
|
|
|
|
+ type: 2,
|
|
})
|
|
})
|
|
tableLoading.value = false
|
|
tableLoading.value = false
|
|
if (!error && code === 200) {
|
|
if (!error && code === 200) {
|
|
@@ -153,14 +165,12 @@ const tableColumn = ref([
|
|
{ key: 'approveStatusName', name: '审批状态' },
|
|
{ key: 'approveStatusName', name: '审批状态' },
|
|
{ key: 'action', name: '操作', width: 94 },
|
|
{ key: 'action', name: '操作', width: 94 },
|
|
])
|
|
])
|
|
-const tableData = ref([
|
|
|
|
-])
|
|
|
|
|
|
+const tableData = ref([])
|
|
const getTableData = async () => {
|
|
const getTableData = async () => {
|
|
tableLoading.value = true
|
|
tableLoading.value = true
|
|
- console.log(searchForm.value, 'searchForm.value')
|
|
|
|
const { error, code, data } = await mainApi.getPage({
|
|
const { error, code, data } = await mainApi.getPage({
|
|
- ...searchForm.value,
|
|
|
|
- contractId:contractId.value,
|
|
|
|
|
|
+ ...searchForm.value,
|
|
|
|
+ contractId: contractId.value,
|
|
})
|
|
})
|
|
tableLoading.value = false
|
|
tableLoading.value = false
|
|
if (!error && code === 200) {
|
|
if (!error && code === 200) {
|
|
@@ -174,31 +184,27 @@ const getTableData = async () => {
|
|
} else {
|
|
} else {
|
|
tableData.value = []
|
|
tableData.value = []
|
|
searchForm.value.total = 0
|
|
searchForm.value.total = 0
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//获取详情
|
|
//获取详情
|
|
const infoData = ref({})
|
|
const infoData = ref({})
|
|
-const getDetail = async (id)=>{
|
|
|
|
- const { error, code, data } = await mainApi.detail({
|
|
|
|
- id,
|
|
|
|
- })
|
|
|
|
|
|
+const getDetail = async (id) => {
|
|
|
|
+ const { error, code, data } = await mainApi.detail({ id })
|
|
if (!error && code === 200) {
|
|
if (!error && code === 200) {
|
|
infoData.value = getObjValue(data)
|
|
infoData.value = getObjValue(data)
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
infoData.value = {}
|
|
infoData.value = {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//查看附件
|
|
//查看附件
|
|
-const viewFile = (item)=>{
|
|
|
|
|
|
+const viewFile = (item) => {
|
|
toPdfPage(item.filePdfUrl)
|
|
toPdfPage(item.filePdfUrl)
|
|
}
|
|
}
|
|
//表格选择
|
|
//表格选择
|
|
const tableCheckChange = () => {
|
|
const tableCheckChange = () => {
|
|
|
|
|
|
}
|
|
}
|
|
-const hanleRow = ({ row })=>{
|
|
|
|
|
|
+const hanleRow = ({ row }) => {
|
|
getDetail(row.id)
|
|
getDetail(row.id)
|
|
}
|
|
}
|
|
//新增
|
|
//新增
|
|
@@ -208,17 +214,18 @@ const addModalClick = () => {
|
|
editId.value = ''
|
|
editId.value = ''
|
|
}
|
|
}
|
|
const editId = ref('')
|
|
const editId = ref('')
|
|
|
|
+const newInfoData = ref({})
|
|
//修改
|
|
//修改
|
|
const rowEditClick = (row) => {
|
|
const rowEditClick = (row) => {
|
|
isDataModal.value = true
|
|
isDataModal.value = true
|
|
editId.value = row.id
|
|
editId.value = row.id
|
|
|
|
+ newInfoData.value = deepClone(infoData.value)
|
|
}
|
|
}
|
|
-const delRowClick = (row)=>{
|
|
|
|
- HcDelMsg( async ( resolve) => {
|
|
|
|
- await removeProPay(row.id)
|
|
|
|
- resolve() //关闭弹窗的回调
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
|
|
+const delRowClick = (row) => {
|
|
|
|
+ HcDelMsg(async (resolve) => {
|
|
|
|
+ await removeProPay(row.id)
|
|
|
|
+ resolve() //关闭弹窗的回调
|
|
|
|
+ })
|
|
}
|
|
}
|
|
const removeProPay = async (id) => {
|
|
const removeProPay = async (id) => {
|
|
const { error, code, msg } = await mainApi.remove({
|
|
const { error, code, msg } = await mainApi.remove({
|
|
@@ -226,12 +233,12 @@ const removeProPay = async (id) => {
|
|
})
|
|
})
|
|
if (!error && code === 200) {
|
|
if (!error && code === 200) {
|
|
window?.$message?.success('删除成功')
|
|
window?.$message?.success('删除成功')
|
|
- getTableData()
|
|
|
|
|
|
+ getTableData().then()
|
|
} else {
|
|
} else {
|
|
window.$message.error(msg ?? '操作失败')
|
|
window.$message.error(msg ?? '操作失败')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-const finishData = ()=>{
|
|
|
|
|
|
+const finishData = () => {
|
|
isDataModal.value = false
|
|
isDataModal.value = false
|
|
getTableData()
|
|
getTableData()
|
|
}
|
|
}
|