合同管理状态改变

This commit is contained in:
jjLv 2024-12-13 18:14:22 +08:00
parent 228eebbb75
commit 1baeed8e2e
4 changed files with 47 additions and 19 deletions

View File

@ -16,3 +16,8 @@ export const editContractApi = (data: any = {}) => {
export const delContractApi = (data: any = {}) => {
return post('/material-mall/contract/del', data)
}
// 修改状态
export const updateStatus = (data: any = {}) => {
return post('/material-mall/contract/updateStatus', data)
}

View File

@ -26,4 +26,7 @@ export const confirmPriceApi = (data: any) => {
return post('/material-mall/lease-repair/confirmPrice', data)
}
//获取租赁协议详情
export const getContractDetailApi = (data: any) => {
return get('/material-mall/order/leaseAgreement', data)
}

View File

@ -90,8 +90,8 @@
<template #default="{ row }">
<el-switch
v-model="row.status"
active-value="0"
inactive-value="1"
:active-value="1"
:inactive-value="0"
@change="handleStatusChange(row)"
></el-switch>
</template>
@ -99,7 +99,7 @@
<el-table-column align="center" prop="qcTime" label="合同附件">
<template #default="{ row }">
<a
:href="row.bmFileInfoList[0].fileUrl"
:href="row.bmFileInfoList.length>0 ? row.bmFileInfoList[0].fileUrl:null"
target="_blank"
style="color: #00a288; text-decoration: underline"
>查看</a
@ -111,18 +111,15 @@
<el-table-column align="center" label="操作" :width="220">
<template #default="{ row }">
<el-button
text
size="small"
type="primary"
@click="onContract(row, false)"
>
编辑
</el-button>
<el-button
text
size="small"
type="primary"
type="danger"
@click="onDelete(row.id, true)"
>
删除
@ -131,12 +128,12 @@
</el-table-column>
</el-table>
<!-- <PagingComponent
@getList="getLeaseListData"
:pageSize="searchParams.pageSize"
:pageNumber="searchParams.pageNum"
<PagingComponent
@getList="getContractListData"
:pageSize="queryParams.pageSize"
:pageNumber="queryParams.pageNum"
:total="total"
/> -->
/>
<!-- 新增和修改弹框 -->
<el-dialog
@ -250,6 +247,7 @@ import {
addContractApi, //
editContractApi, //
delContractApi, //
updateStatus, //
} from 'http/api/contract-manage'
import { InfoFilled, UploadFilled } from '@element-plus/icons-vue'
const total = ref(0)
@ -280,7 +278,7 @@ const getContractListData = async () => {
queryParams.endTime = createTime.value[1]
}
const { data: res }: any = await getContractListApi(queryParams)
qualityLis.value = res
qualityLis.value = res.rows
total.value = res.total
}
@ -295,9 +293,27 @@ const onReset = () => {
getContractListData()
}
//
const handleStatusChange = (row:any)=>{
//
const handleStatusChange = async(row:any)=>{
console.log('111111',row)
const id = row.id
// if (row.status === 0) {
// // If the current row's status is turned on, disable switches for other rows
// qualityLis.value.forEach((item:any) => {
// if (item !== row) {
// item.status = 1; // Set the status of other rows to "off"
// }
// });
// }
const res: any = await updateStatus({id,status:row.status})
if(res.code === 200){
ElMessage({
type:'success',
message: '状态修改成功',
})
await getContractListData()
}
}
const addAndEditFormRef = ref()

View File

@ -5,7 +5,7 @@ import RentTerminationModel from './rent-termination-model.vue'
import CostSettlementModel from './cost-settlement-model.vue'
import Empty from 'components/Empty/index.vue'
import { useRouter } from 'vue-router'
import { getOrderListApi, passApi, failApi } from 'http/api/usercenter/seekorder'
import { getOrderListApi, passApi, failApi,getContractDetailApi } from 'http/api/usercenter/seekorder'
import uploadComponent from 'components/uploadComponent/index.vue'
import previewImg from './previewImg/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
@ -609,7 +609,7 @@ const handleViewRepair = (item: any) => {
const settleWordTitle = ref('')
const dialogFormVisibleSettleWord: any = ref(false)
//
const handleViewWord = () => {
const handleViewWord = async(index: Number, row: any) => {
settleWordTitle.value = '租赁协议'
moneyParams1.value = {
/* 设备状态 */
@ -618,6 +618,10 @@ const handleViewWord = () => {
insureList: [],
picList: [],
}
const orderId = row.orderId
const res: any = await getContractDetailApi({ orderId })
cardList.value = res.rows
total.value = res.total
wordUrl.value = "http://127.0.0.1:29300/statics/2024/12/13/合同模板2_20241213133604A002.doc"
//
dialogFormVisibleSettleWord.value = true
@ -961,7 +965,7 @@ const wordUrl = ref('')
>
订单详情
</el-button>
<el-button @click="handleViewWord(j)" type="primary" size="small">
<el-button @click="handleViewWord(j,item)" type="primary" size="small">
租赁协议
</el-button>
<el-button