代码完善

This commit is contained in:
BianLzhaoMin 2024-12-05 11:51:00 +08:00
parent 547b648140
commit 2f82fffe13
9 changed files with 237 additions and 138 deletions

14
components.d.ts vendored
View File

@ -8,14 +8,23 @@ export {}
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default'] Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader'] ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol'] ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElCountdown: typeof import('element-plus/es')['ElCountdown']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog'] ElDialog: typeof import('element-plus/es')['ElDialog']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm'] ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon'] ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage'] ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
@ -23,11 +32,16 @@ declare module 'vue' {
ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption'] ElOption: typeof import('element-plus/es')['ElOption']
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElPagination: typeof import('element-plus/es')['ElPagination'] ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm'] ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElProgress: typeof import('element-plus/es')['ElProgress'] ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow'] ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect'] ElSelect: typeof import('element-plus/es')['ElSelect']
ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps']
ElTable: typeof import('element-plus/es')['ElTable'] ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTag: typeof import('element-plus/es')['ElTag'] ElTag: typeof import('element-plus/es')['ElTag']

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

@ -23,4 +23,8 @@ export const deleteLeaseInfoApi = (data: any) => {
// 接单列表查询 // 接单列表查询
export const getAcceptOrdersListApi = (data: any) => { export const getAcceptOrdersListApi = (data: any) => {
return get('/material-mall/ma-lease/rentList', data) return get('/material-mall/ma-lease/rentList', data)
}
// 接单审核
export const maLeaseAuditApi = (data: any) => {
return post('/material-mall/ma-lease/audit', data)
} }

View File

@ -35,7 +35,7 @@
</el-row> </el-row>
<el-row class="item"> <el-row class="item">
<el-col :span="5"> <el-col :span="5">
<div class="label">参考图片/样式</div> <div class="label">需求清单</div>
</el-col> </el-col>
<el-col :span="18"> <el-col :span="18">
<div class="img-list"> <div class="img-list">
@ -46,6 +46,35 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<el-row style="padding: 8px 0; font-size: 16px"> 装备需求信息 </el-row>
<div
class="demand-info-list"
v-for="item in leaseDetails.detailsList"
:key="item.id"
>
<el-row style="padding: 10px 0">
<el-col :span="4">
<span class="label">装备类目</span>
</el-col>
<el-col :span="10">
<span>{{ item.groupName }}</span>
</el-col>
<el-col :span="4">
<span class="label">预估数量</span>
</el-col>
<el-col :span="6">
<span>{{ item.leaseNum }}</span>
</el-col>
</el-row>
<div class="label" style="padding: 10px 0">参考图片/样式</div>
<el-row>
<el-col :span="12" v-for="img in item.fileInfoList" :key="img.id">
<img :src="img.fileUrl" alt="" style="width: 98%; height: 120px" />
</el-col>
</el-row>
</div>
</div> </div>
<div class="right"> <div class="right">
<div class="count-down"> <div class="count-down">
@ -82,13 +111,13 @@
</div> </div>
<div style="text-align: right"> <div style="text-align: right">
<el-button <el-button
class="item_btn applyFor" class="item_btn primary-lease"
style="background-color: #1abc9c" type="primary"
:style="
userId == leaseDetails.publishUser ? 'opacity:0.5;color:#fff' : ''
"
@click="onAcceptOrders" @click="onAcceptOrders"
:disabled="userId == leaseDetails.publishUser" :disabled="
userId == leaseDetails.publishUser ||
companyId == leaseDetails.publishCompany
"
v-if="leaseDetails.leaseStatus !== 1" v-if="leaseDetails.leaseStatus !== 1"
> >
立即接单 立即接单
@ -117,6 +146,7 @@ const route = useRoute()
const router = useRouter() const router = useRouter()
const store: any = mainStore() const store: any = mainStore()
const userId = store.userInfo.userId const userId = store.userInfo.userId
const companyId = store.userInfo.companyId
// //
const equipBaseInfoList = reactive([ const equipBaseInfoList = reactive([
@ -124,10 +154,10 @@ const equipBaseInfoList = reactive([
label: '需求编号', label: '需求编号',
key: 'leaseCode', key: 'leaseCode',
}, },
{ // {
label: '装备类目', // label: '',
key: 'groupName', // key: 'groupName',
}, // },
{ {
label: '联系人', label: '联系人',
key: 'person', key: 'person',
@ -140,10 +170,10 @@ const equipBaseInfoList = reactive([
label: '所属地市', label: '所属地市',
key: 'areaName', key: 'areaName',
}, },
{ // {
label: '预估数量', // label: '',
key: 'leaseNum', // key: 'leaseNum',
}, // },
{ {
label: '预估租赁天数', label: '预估租赁天数',
key: 'leaseDay', key: 'leaseDay',
@ -536,6 +566,7 @@ onMounted(() => {
.item_btn { .item_btn {
width: 110px; width: 110px;
height: 36px; height: 36px;
margin-top: 80px;
line-height: 36px; line-height: 36px;
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
@ -578,4 +609,17 @@ onMounted(() => {
} }
} }
} }
.demand-info-list {
padding: 6px 0;
box-sizing: content-box;
.label {
font-size: 14px;
font-family: PingFangSC, PingFang SC;
// font-weight: 600;
color: #8e8e8e;
// margin-right: 15px;
}
}
</style> </style>

View File

@ -9,6 +9,8 @@ import { reactive, ref } from 'vue'
import baseData from '@/assets/baseInformation.json' import baseData from '@/assets/baseInformation.json'
import imgSrc from '../../assets/img/home/nw.png' import imgSrc from '../../assets/img/home/nw.png'
import swiper_1 from '../../assets/img/home/swiper01.png'
import swiper_2 from '../../assets/img/home/swiper02.png'
const router: any = useRouter() const router: any = useRouter()
@ -23,6 +25,8 @@ const loopList = ref([
'https://zlpt-1259760603.cos.ap-nanjing.myqcloud.com/488bab245180ebf9f1f3d7db5301be4.png', 'https://zlpt-1259760603.cos.ap-nanjing.myqcloud.com/488bab245180ebf9f1f3d7db5301be4.png',
// 'https://jmy-pic.baidu.com/0/pic/-1857035387_-1067811148_-1621691324.png', // 'https://jmy-pic.baidu.com/0/pic/-1857035387_-1067811148_-1621691324.png',
imgSrc, imgSrc,
swiper_1,
swiper_2,
]) ])
// //
const getGoodsClassList = async () => { const getGoodsClassList = async () => {

View File

@ -126,7 +126,7 @@
<div>预估数量</div> <div>预估数量</div>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<div>{{ item.leaseNum }}</div> <div>{{ item.leaseTotalNum }}</div>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div>预估租期()</div> <div>预估租期()</div>
@ -185,7 +185,9 @@
border: none; border: none;
border-radius: 0; border-radius: 0;
" "
:disabled="userId == item.publishUser" :disabled="
userId == item.publishUser || companyId == item.publishCompany
"
:style="userId == item.publishUser ? 'opacity:0.5;color:#fff' : ''" :style="userId == item.publishUser ? 'opacity:0.5;color:#fff' : ''"
@click="onAcceptOrders(item.id)" @click="onAcceptOrders(item.id)"
> >
@ -227,6 +229,7 @@ const router = useRouter()
const route: any = useRoute() const route: any = useRoute()
const store: any = mainStore() const store: any = mainStore()
const userId = store.userInfo.userId const userId = store.userInfo.userId
const companyId = store.userInfo.companyId
const leaseList = ref<any>([]) const leaseList = ref<any>([])
// //
@ -334,9 +337,9 @@ getTypeListData()
// //
const getCompanyAddressListData = async () => { const getCompanyAddressListData = async () => {
const res: any = await getCompanyListApi() const res: any = await getCompanyListApi()
const result: any = await getAreaApi() const result: any = await getAreaApi(34)
const addressList = result.data.map((e: any) => { const addressList = result.data.map((e: any) => {
return { ...e, name: e.areaName, value: e.areaId, isChecked: false, index: 1 } return { ...e, name: e.areaName, value: e.areaCode, isChecked: false, index: 1 }
}) })
const companyList = res.data.map((e: any) => { const companyList = res.data.map((e: any) => {
return { ...e, name: e.companyName, value: e.companyId, isChecked: false, index: 2 } return { ...e, name: e.companyName, value: e.companyId, isChecked: false, index: 2 }
@ -353,7 +356,7 @@ const getLeaseListData = async (keyWord: any = '') => {
companyId: '', companyId: '',
typeId: '', typeId: '',
level: '', level: '',
areaId: '', cityCode: '',
startTime: optionActive.value == 0 ? screenOptionList[optionActive.value].sort : '', startTime: optionActive.value == 0 ? screenOptionList[optionActive.value].sort : '',
rentDay: optionActive.value == 1 ? screenOptionList[optionActive.value].sort : '', rentDay: optionActive.value == 1 ? screenOptionList[optionActive.value].sort : '',
endTime: optionActive.value == 2 ? screenOptionList[optionActive.value].sort : '', endTime: optionActive.value == 2 ? screenOptionList[optionActive.value].sort : '',
@ -368,7 +371,7 @@ const getLeaseListData = async (keyWord: any = '') => {
} }
if (index == 1 && j.isChecked) { if (index == 1 && j.isChecked) {
searchParams.areaId = j.value searchParams.cityCode = j.value
} }
if (index == 2 && j.isChecked) { if (index == 2 && j.isChecked) {
searchParams.companyId = j.value searchParams.companyId = j.value

View File

@ -116,6 +116,7 @@
<el-table-column align="center" prop="orderUser" label="操作人" /> <el-table-column align="center" prop="orderUser" label="操作人" />
<el-table-column align="center" prop="endTime" label="需求截止日期" /> <el-table-column align="center" prop="endTime" label="需求截止日期" />
<el-table-column align="center" prop="orderTime" label="接单时间" /> <el-table-column align="center" prop="orderTime" label="接单时间" />
<el-table-column align="center" prop="leaseStatusName" label="状态" />
<!-- <el-table-column align="center" prop="leaseStatusName" label="需求状态" /> <!-- <el-table-column align="center" prop="leaseStatusName" label="需求状态" />
<el-table-column align="center" label="操作" :width="220"> <el-table-column align="center" label="操作" :width="220">
<template #default="{ row }"> <template #default="{ row }">

View File

@ -111,7 +111,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="leaseName" label="需求名称" /> <el-table-column align="center" prop="leaseName" label="需求名称" />
<el-table-column align="center" prop="operateAddress" label="需求所在地" /> <el-table-column align="center" prop="cityName" label="需求所在地" />
<el-table-column align="center" prop="publishUser" label="发布人" /> <el-table-column align="center" prop="publishUser" label="发布人" />
<el-table-column align="center" prop="endTime" label="需求截止日期" width="120" /> <el-table-column align="center" prop="endTime" label="需求截止日期" width="120" />
<el-table-column align="center" prop="startTime" label="发布时间" /> <el-table-column align="center" prop="startTime" label="发布时间" />
@ -124,7 +124,7 @@
size="small" size="small"
type="primary" type="primary"
class="primary-lease" class="primary-lease"
v-if="row.leaseStatus === 2" v-if="row.leaseStatus === 2 || row.leaseStatus === 4"
@click="onRepublish(row.id, false)" @click="onRepublish(row.id, false)"
> >
重新发布 重新发布
@ -133,18 +133,36 @@
size="small" size="small"
type="primary" type="primary"
class="primary-lease" class="primary-lease"
v-if="row.leaseStatus === 2 || row.leaseStatus === 0" v-if="row.leaseStatus === 2 || row.leaseStatus === 0 || row.leaseStatus === 4"
@click="onRepublish(row.id, true, row.leaseStatus)" @click="onRepublish(row.id, true, row.leaseStatus)"
> >
编辑 编辑
</el-button> </el-button>
<el-button
size="small"
type="primary"
class="primary-lease"
v-if="row.leaseStatus === 3"
@click="onAuditing(row.id, 1)"
>
通过
</el-button>
<el-button
size="small"
type="primary"
class="primary-lease"
v-if="row.leaseStatus === 3"
@click="onAuditing(row.id, 4)"
>
驳回
</el-button>
<el-popconfirm <el-popconfirm
width="220" width="220"
:icon="InfoFilled" :icon="InfoFilled"
icon-color="#626AEF" icon-color="#626AEF"
title="确定删除该项需求吗?" title="确定删除该项需求吗?"
@confirm="onDelete(row.id)" @confirm="onDelete(row.id)"
v-if="row.leaseStatus != 1" v-if="row.leaseStatus === 2 || row.leaseStatus === 0"
> >
<template #reference> <template #reference>
<el-button size="small" type="primary" class="primary-lease"> <el-button size="small" type="primary" class="primary-lease">
@ -201,59 +219,22 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="装备类目" prop="typeIds">
<el-cascader
clearable
style="width: 100%"
:options="classOptions"
:show-all-levels="false"
placeholder="请选择装备类目"
v-model="addOrEditForm.typeIds"
:props="{
value: 'id',
label: 'name',
checkStrictly: true,
}"
@change="onChangeClass"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="租赁公司" prop="companyId">
<el-select
clearable
style="width: 100%"
placeholder="请选择租赁公司"
v-model="addOrEditForm.companyId"
>
<el-option
:key="item.companyId"
:value="item.companyId"
:label="item.companyName"
v-for="item in companyOptions"
/>
</el-select>
</el-form-item>
</el-col>
</el-row> -->
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="项目所在地" style="width: 100%" prop="areaId"> <el-form-item label="项目所在地" style="width: 100%" prop="provinceCode">
<el-row :span="24"> <el-row :span="24">
<el-col :span="6"> <el-col :span="6">
<el-form-item prop="areaId"> <el-form-item>
<el-select <el-select
clearable clearable
style="width: 95%" style="width: 95%"
placeholder="请选择项目所在省" placeholder="请选择项目所在省"
v-model="addOrEditForm.areaId" v-model="addOrEditForm.provinceCode"
@change="onProvinceChange($event)" @change="onProvinceChange($event)"
> >
<el-option <el-option
:key="item.areaId" :key="item.areaId"
:value="item.areaCode" :value="item.areaCode * 1"
:label="item.areaName" :label="item.areaName"
v-for="item in areaList" v-for="item in areaList"
/> />
@ -261,17 +242,17 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item prop="areaId"> <el-form-item prop="cityCode">
<el-select <el-select
clearable clearable
style="width: 95%" style="width: 95%"
placeholder="请选择项目所在市" placeholder="请选择项目所在市"
v-model="addOrEditForm.areaId2" v-model="addOrEditForm.cityCode"
@change="onCityChange($event)" @change="onCityChange($event)"
> >
<el-option <el-option
:key="item.areaId" :key="item.areaId"
:value="item.areaCode" :value="item.areaCode * 1"
:label="item.areaName" :label="item.areaName"
v-for="item in areaCityList" v-for="item in areaCityList"
/> />
@ -279,17 +260,17 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item prop="areaId"> <el-form-item prop="areaCode">
<el-select <el-select
clearable clearable
style="width: 95%" style="width: 95%"
placeholder="请选择项所在县" placeholder="请选择项所在区/县"
v-model="addOrEditForm.areaId1" v-model="addOrEditForm.areaCode"
@change="onCountyChange($event)" @change="onCountyChange($event)"
> >
<el-option <el-option
:key="item.areaId" :key="item.areaId"
:value="item.areaCode" :value="item.areaCode * 1"
:label="item.areaName" :label="item.areaName"
v-for="item in areaCountyList" v-for="item in areaCountyList"
/> />
@ -297,12 +278,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item prop="areaId"> <el-form-item prop="address">
<el-input <el-input
style="width: 100%" style="width: 100%"
clearable clearable
placeholder="请输入详细地址" placeholder="请输入详细地址"
v-model="addOrEditForm.areaId3" v-model="addOrEditForm.address"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -356,19 +337,6 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12">
<el-form-item label="预估数量" prop="leaseNum">
<el-input-number
clearable
:min="1"
:max="9999"
style="width: 100%"
placeholder="请输入预估数量"
v-model="addOrEditForm.leaseNum"
/>
</el-form-item>
</el-col> -->
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
@ -403,12 +371,11 @@
height="100px" height="100px"
:multiple="true" :multiple="true"
:autoUpload="true" :autoUpload="true"
:minLimit="minLimit" :minLimit="addOrEditForm.fileInfoList.length"
:actionUrl="uploadUrl" :actionUrl="uploadUrl"
listType="picture-card" listType="picture-card"
@onFileChange="onFileChange" @onFileChange="onFileChange"
:acceptTypeList="['.jpg', '.png']" :acceptTypeList="['.jpg', '.png']"
:fileListN="addOrEditForm.fileInfoList"
> >
<template v-slot:default> <template v-slot:default>
<el-icon size="48" color="#aaa"><Plus /></el-icon> <el-icon size="48" color="#aaa"><Plus /></el-icon>
@ -433,7 +400,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="装备需求信息" style="font-weight: bold"> <el-form-item label="装备需求信息" style="font-weight: bold" prop="detailsList">
<el-button class="primary-lease" type="primary" @click="onAddDemandInfo"> <el-button class="primary-lease" type="primary" @click="onAddDemandInfo">
添加装备描述 添加装备描述
</el-button> </el-button>
@ -445,7 +412,7 @@
<el-form <el-form
label-width="auto" label-width="auto"
label-position="right" label-position="right"
v-for="(item, index) in addOrEditDemandFormList" v-for="(item, index) in addOrEditForm.detailsList"
:key="item.newId" :key="item.newId"
:model="item" :model="item"
:rules="addOrEditDemandFormRules" :rules="addOrEditDemandFormRules"
@ -514,16 +481,18 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="20"> <el-col :span="20">
<el-form-item label="参考图片/样式"> <el-form-item label="参考图片/样式">
<div class="img-list" v-if="addOrEditForm.fileInfoList.length > 0"> <div class="img-list" v-if="item.fileInfoList.length > 0">
<div <div
v-for="(item, index) in addOrEditForm.fileInfoList" v-for="(j, i) in item.fileInfoList"
:key="item.id" :key="j.fileUrl"
class="img-items" class="img-items"
> >
<img :src="item.fileUrl" alt="" /> <img :src="j.fileUrl" alt="" />
<div class="mask-img"> <div class="mask-img">
<el-icon class="delete-icon" @click="onDeleteImg(index)" <el-icon
class="delete-icon"
@click="onDeleteImgInDetails(index, i)"
><DeleteFilled ><DeleteFilled
/></el-icon> /></el-icon>
</div> </div>
@ -534,14 +503,14 @@
:max-limit="4" :max-limit="4"
width="100px" width="100px"
height="100px" height="100px"
:currentIndex="index"
:multiple="true" :multiple="true"
:autoUpload="true" :autoUpload="true"
:minLimit="minLimit" :minLimit="item.fileInfoList.length"
:actionUrl="uploadUrl" :actionUrl="uploadUrl"
listType="picture-card" listType="picture-card"
@onFileChange="onFileChange" @onFileChange="onFileChangeInDetails"
:acceptTypeList="['.jpg', '.png']" :acceptTypeList="['.jpg', '.png']"
:fileListN="addOrEditForm.fileInfoList"
> >
<template v-slot:default> <template v-slot:default>
<el-icon size="48" color="#aaa"><Plus /></el-icon> <el-icon size="48" color="#aaa"><Plus /></el-icon>
@ -549,7 +518,7 @@
</UploadComponentNew> </UploadComponentNew>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4" v-if="index !== 0">
<el-button <el-button
size="small" size="small"
type="danger" type="danger"
@ -587,12 +556,13 @@ import { getCompanyListApi, getGoodsClassListApi, getAreaApi } from 'http/api/ho
import { import {
addLeaseInfoApi, addLeaseInfoApi,
getLeaseListApi, getLeaseListApi,
maLeaseAuditApi,
editLeaseInfoApi, editLeaseInfoApi,
deleteLeaseInfoApi, deleteLeaseInfoApi,
getLeaseDetailsByIdApi, getLeaseDetailsByIdApi,
} from 'http/api/sourcing/index' } from 'http/api/sourcing/index'
import { InfoFilled } from '@element-plus/icons-vue' import { InfoFilled } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
const total = ref(0) const total = ref(0)
const endTime = ref([]) const endTime = ref([])
@ -629,44 +599,51 @@ const searchParams = reactive({
}) })
const addOrEditForm = ref<any>({ const addOrEditForm = ref<any>({
leaseName: '', leaseName: '',
typeId: '',
typeIds: [],
companyId: '', companyId: '',
person: '', person: '',
personPhone: '', personPhone: '',
leaseDay: 1, leaseDay: 1,
leaseNum: 1,
endTime: '', endTime: '',
description: '', description: '',
isSubmit: '', isSubmit: '',
fileInfoList: [], fileInfoList: [],
areaId: '', fileInfoTempList: [],
areaCode: '',
cityCode: '',
provinceCode: '',
address: '',
detailsList: [],
}) })
const addOrEditFormTemp = ref<any>({ const addOrEditFormTemp = ref<any>({
leaseName: '', leaseName: '',
typeId: '',
typeIds: [],
companyId: '', companyId: '',
person: '', person: '',
personPhone: '', personPhone: '',
leaseDay: 1, leaseDay: 1,
leaseNum: 1,
endTime: '', endTime: '',
description: '', description: '',
isSubmit: '', isSubmit: '',
fileInfoList: fileListTemp ? fileListTemp : [], fileInfoList: [],
areaId: '', fileInfoTempList: [],
areaCode: '',
cityCode: '',
provinceCode: '',
address: '',
detailsList: [],
}) })
const addOrEditFormRules = reactive({ const addOrEditFormRules = reactive({
person: [{ required: true, message: '请输入联系人', trigger: 'blur' }], person: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
leaseDay: [{ required: true, message: '请输入预估租期', trigger: 'blur' }], leaseDay: [{ required: true, message: '请输入预估租期', trigger: 'blur' }],
leaseName: [{ required: true, message: '请输入需求名称', trigger: 'blur' }], leaseName: [{ required: true, message: '请输入需求名称', trigger: 'blur' }],
areaId: [{ required: true, message: '请选择项目所在地', trigger: 'change' }], areaCode: [{ required: true, message: '请选择项目所在区/县', trigger: 'change' }],
cityCode: [{ required: true, message: '请选择项目所在市', trigger: 'change' }],
provinceCode: [{ required: true, message: '请选择项目所在省', trigger: 'change' }],
address: [{ required: true, message: '请输入项目详细地址', trigger: 'blur' }],
companyId: [{ required: true, message: '请选择租赁公司', trigger: 'change' }], companyId: [{ required: true, message: '请选择租赁公司', trigger: 'change' }],
fileInfoList: [{ required: true, message: '请上传参考图片', trigger: 'blur' }], fileInfoList: [{ required: true, message: '请上传参考图片', trigger: 'blur' }],
endTime: [{ required: true, message: '请选择需求截止日期', trigger: 'change' }], endTime: [{ required: true, message: '请选择需求截止日期', trigger: 'change' }],
detailsList: [{ required: true, message: '请添加需求装备信息', trigger: 'change' }],
personPhone: [ personPhone: [
{ required: true, message: '请输入联系电话', trigger: 'blur' }, { required: true, message: '请输入联系电话', trigger: 'blur' },
{ {
@ -748,40 +725,46 @@ const onRepublish = async (id: any, type: any, leaseStatus: any) => {
const res: any = await getLeaseDetailsByIdApi({ id }) const res: any = await getLeaseDetailsByIdApi({ id })
const { const {
leaseName, leaseName,
typeId,
companyId, companyId,
person, person,
personPhone, personPhone,
leaseDay, leaseDay,
leaseNum,
endTime, endTime,
description, description,
typeIds,
fileInfoList, fileInfoList,
areaId, areaCode,
address,
cityCode,
provinceCode,
detailsList,
} = res.data } = res.data
Object.assign(addOrEditForm.value, { Object.assign(addOrEditForm.value, {
leaseName, leaseName,
typeId,
companyId, companyId,
person, person,
personPhone, personPhone,
leaseDay, leaseDay,
leaseNum,
endTime, endTime,
description, description,
typeIds,
id, id,
fileInfoList: fileInfoList ? fileInfoList : [], fileInfoList: fileInfoList ? fileInfoList : [],
areaId, areaCode,
address,
cityCode,
provinceCode,
detailsList,
}) })
addOrEditForm.value.typeIds = addOrEditForm.value.typeIds.map((e: any) => { detailsList.forEach((e: any) => {
return (e *= 1) e.fileInfoTempList = []
e.typeIds = e.typeIds.map((j: any) => {
return (j *= 1)
})
})
Promise.all([onProvinceChange(provinceCode), onCityChange(cityCode)]).then(() => {
addOrEditDialogVisible.value = true
}) })
addOrEditDialogVisible.value = true
} }
// //
@ -789,15 +772,12 @@ const onSubmit = (type: boolean) => {
addOrEditFormRef.value.validate(async (valid: any) => { addOrEditFormRef.value.validate(async (valid: any) => {
if (valid) { if (valid) {
addOrEditForm.value.isSubmit = type addOrEditForm.value.isSubmit = type
addOrEditForm.value.typeId = // addOrEditForm.value.typeId =
addOrEditForm.value.typeIds[addOrEditForm.value.typeIds.length - 1] // addOrEditForm.value.typeIds[addOrEditForm.value.typeIds.length - 1]
addOrEditForm.value.fileInfoList.push(...fileListTemp.value) addOrEditForm.value.fileInfoList.push(...fileListTemp.value)
addOrEditForm.value.maStatus == 0
? (addOrEditForm.value.maStatus = 1)
: addOrEditForm.value.maStatus
let isDemand = false let isDemand = false
for (let index = 0; index < addOrEditDemandFormList.value.length; index++) { for (let index = 0; index < addOrEditForm.value.detailsList.length; index++) {
try { try {
const valid = await new Promise((resolve) => { const valid = await new Promise((resolve) => {
addOrEditDemandFormRefList.value[index].validate((valid: any) => { addOrEditDemandFormRefList.value[index].validate((valid: any) => {
@ -813,6 +793,16 @@ const onSubmit = (type: boolean) => {
} }
if (isDemand) return if (isDemand) return
addOrEditForm.value.fileInfoList = [
...addOrEditForm.value.fileInfoList,
...addOrEditForm.value.fileInfoTempList,
]
addOrEditForm.value.detailsList.forEach((e: any) => {
e.fileInfoList = [...e.fileInfoList, ...e.fileInfoTempList]
e.typeId = e.typeIds[e.typeIds.length - 1]
})
// addOrEditForm.value.detailsList = addOrEditDemandFormList.value
const SUBMIT_API = isRepublish.value ? addLeaseInfoApi : editLeaseInfoApi const SUBMIT_API = isRepublish.value ? addLeaseInfoApi : editLeaseInfoApi
const res: any = await SUBMIT_API(addOrEditForm.value) const res: any = await SUBMIT_API(addOrEditForm.value)
if (res.code === 200) { if (res.code === 200) {
@ -830,15 +820,26 @@ const onSubmit = (type: boolean) => {
// //
const onFileChange = (fileList: any) => { const onFileChange = (fileList: any) => {
fileListTemp.value = [] addOrEditForm.value.fileInfoTempList = []
fileListTemp.value = fileList.map((e: any) => { const fileListTemp = fileList.map((e: any) => {
return { return {
fileName: e.name, fileName: e.name,
fileUrl: e.url, fileUrl: e.url,
} }
}) })
// addOrEditForm.value.fileInfoList.push(...fileListTemp.value) addOrEditForm.value.fileInfoTempList.push(...fileListTemp)
}
const onFileChangeInDetails = (fileList: any, index: number) => {
addOrEditForm.value.detailsList[index].fileInfoTempList = []
const fileListTemp = fileList.map((e: any) => {
return {
fileName: e.name,
fileUrl: e.url,
}
})
addOrEditForm.value.detailsList[index].fileInfoTempList.push(...fileListTemp)
} }
// //
@ -854,6 +855,9 @@ const onClose = () => {
const onDeleteImg = (index: any) => { const onDeleteImg = (index: any) => {
addOrEditForm.value.fileInfoList.splice(index, 1) addOrEditForm.value.fileInfoList.splice(index, 1)
} }
const onDeleteImgInDetails = (index: any, j: any) => {
addOrEditForm.value.detailsList[index].fileInfoList.splice(j, 1)
}
const minLimit = computed(() => { const minLimit = computed(() => {
return addOrEditForm.value.fileInfoList.length return addOrEditForm.value.fileInfoList.length
@ -864,16 +868,18 @@ const onChangeClass = (val: any) => {
} }
const onAddDemandInfo = () => { const onAddDemandInfo = () => {
const newId = Date.now() const newId = Date.now()
addOrEditDemandFormList.value.push({ addOrEditForm.value.detailsList.push({
newId, newId,
typeIds: [], typeIds: [],
typeId: '',
leaseNum: 1, leaseNum: 1,
fileInfoList: [], fileInfoList: [],
fileInfoTempList: [],
}) })
} }
const onDeleteDemand = (index: any) => { const onDeleteDemand = (index: any) => {
addOrEditDemandFormList.value.splice(index, 1) addOrEditForm.value.detailsList.splice(index, 1)
addOrEditDemandFormRefList.value.splice(index, 1) addOrEditDemandFormRefList.value.splice(index, 1)
addOrEditDemandFormRefList.value.forEach((e: any) => { addOrEditDemandFormRefList.value.forEach((e: any) => {
if (e) e.clearValidate() if (e) e.clearValidate()
@ -890,6 +896,29 @@ const onCityChange = async (id: any) => {
} }
const onCountyChange = async (id: any) => {} const onCountyChange = async (id: any) => {}
const onAuditing = (id: any, leaseStatus: number) => {
ElMessageBox.confirm(`是否${leaseStatus === 1 ? '通过' : '驳回'}此次接单申请?`, '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success',
})
.then(async () => {
const res: any = await maLeaseAuditApi({
id,
leaseStatus,
})
if (res.code == 200) {
ElMessage({
type: 'success',
message: '提交成功',
})
//
getLeaseListData()
}
})
.catch(async () => {})
}
onMounted(() => { onMounted(() => {
getClassAndCompanyData() getClassAndCompanyData()
getLeaseListData() getLeaseListData()
@ -918,8 +947,8 @@ onMounted(() => {
align-items: center; align-items: center;
.img-items { .img-items {
width: 120px; width: 100px;
height: 120px; height: 100px;
margin-right: 8px; margin-right: 8px;
position: relative; position: relative;