新增属性

This commit is contained in:
jjLv 2024-12-10 17:01:47 +08:00
parent 68e431eb43
commit 21ea680a38
7 changed files with 516 additions and 25 deletions

2
auto-imports.d.ts vendored
View File

@ -82,6 +82,6 @@ declare global {
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}

18
components.d.ts vendored
View File

@ -8,41 +8,23 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
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']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
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']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElImg: typeof import('element-plus/es')['ElImg']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
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']
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']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTag: typeof import('element-plus/es')['ElTag']

View File

@ -235,6 +235,17 @@ const routes: Array<RouteRecordRaw> = [
isLogin: true
},
},
{
path: '/contract-manage',
name: 'contract-manage',
component: () => import('views/user/contract-manage/index.vue'),
meta: {
title: '合同管理',
keepAlive: true,
AuthFlag: false,
isLogin: true
},
},
{
path: '/rent-termination',
name: 'rent-termination',
@ -246,6 +257,7 @@ const routes: Array<RouteRecordRaw> = [
isLogin: true
},
},
{
path: '/settlement-manage',
name: 'settlement-manage',

View File

@ -0,0 +1,362 @@
<template>
<!-- 寻源需求 -->
<el-form
:model="queryParams"
ref="queryFormRef"
:inline="true"
size="default"
label-width="0"
>
<!-- 表单搜索 -->
<el-row>
<el-col :span="6">
<el-form-item prop="deviceName">
<el-input
v-model.trim="queryParams.deviceName"
style="width: 100%"
clearable
placeholder="请输入装备名称"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="code">
<el-input
v-model.trim="queryParams.code"
style="width: 100%"
clearable
placeholder="请输入装备编号"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="maStatus">
<el-select
style="width: 100%"
v-model="queryParams.maStatus"
clearable
placeholder="请选择装备状态"
>
<el-option label="草稿状态" value="0"></el-option>
<el-option label="上架" value="2"></el-option>
<el-option label="下架" value="1"></el-option>
<el-option label="在租" value="3"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="deviceTypeList">
<el-cascader
v-model="deviceTypeList"
:options="deviceTypeTree"
:props="partTypeTreeProps"
filterable
clearable
style="width: 100%"
placeholder="请选择装备类目"
ref="deviceTypeCascader"
@change="deviceTypeChange"
></el-cascader>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item prop="dateRange">
<el-date-picker
style="width: 100%"
v-model="dateRange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="更新开始日期"
end-placeholder="更新结束日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item>
<el-button class="primary-lease" type="primary" @click="queryTableList"
>查询</el-button
>
<el-button
class="primary-lease"
type="primary"
@click="resetTableList(queryFormRef)"
>重置</el-button
>
<el-button class="primary-lease" type="primary" @click="addContract"
>合同新增</el-button
>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 表格 -->
<el-table
:data="leaseList"
show-overflow-tooltip
:header-cell-style="{
background: '#00a288',
color: '#fff',
}"
>
<el-table-column align="center" label="合同编码">
<template #default="{ row }">
<a
style="#00a288; text-decoration: underline"
>
{{ row.leaseCode }}
</a>
</template>
</el-table-column>
<el-table-column align="center" prop="leaseName" label="合同名称" />
<el-table-column align="center" prop="leaseName" label="状态" >
<template #default="{ row }">
<el-switch
v-model="row.status"
active-value="0"
inactive-value="1"
@change="handleStatusChange(row)"
></el-switch>
</template>
</el-table-column>
<el-table-column align="center" prop="publishUser" label="创建时间" />
<el-table-column align="center" prop="orderUser" label="更新时间" />
<el-table-column align="center" label="操作" :width="220">
<template #default="{ row }">
<el-button
text
size="small"
type="primary"
@click="onRepublish(row.id, false)"
>
编辑
</el-button>
<el-button
text
size="small"
type="primary"
v-if="row.leaseStatus === 2"
@click="onRepublish(row.id, true)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- <PagingComponent
@getList="getLeaseListData"
:pageSize="searchParams.pageSize"
:pageNumber="searchParams.pageNum"
:total="total"
/> -->
<!-- 装备弹框 -->
<el-dialog
v-model="dialogVisibleSettlein"
:title="settleinTitle"
width="40%"
destroy-on-close
class="centered-dialog"
:close-on-click-modal="false"
@close="onDialogClose"
>
<el-form
label-width="140px"
ref="addAndEditFormRef"
label-position="right"
:model="addAndEditForm"
:rules="htRules"
>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="合同模板名称:" prop="htName">
<el-input
autocomplete="off"
style="width: 850px"
maxlength="30"
v-model="addAndEditForm.htName"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" >
<el-col :span="24">
<el-form-item label="1" style="margin-bottom: 0" class="upload-tip">
<el-button size="small" type="primary">点击上传</el-button>
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
multiple
:limit="1"
:on-exceed="handleExceed"
:file-list="fileList">
<div class="upload-tip" >支持格式.word.单个文件大小不能超过2M</div>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script setup lang="ts">
import TableComponent from 'components/TableComponent/index.vue'
import FormComponent from 'components/FormComponent/index.vue'
import PagingComponent from 'components/PagingComponent/index.vue'
import UploadComponentNew from 'components/uploadComponentNew/index.vue'
import TitleTip from 'components/TitleTip/index.vue'
import uploadComponent from 'components/uploadComponent/index.vue'
import previewImg from './previewImg/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance } from 'element-plus'
import { ref } from 'vue'
import { useStore } from 'store/user'
const store = useStore()
import { mainStore } from 'store/main'
const store2 = mainStore()
const isViewForm = ref(false)
const isDisabled = ref(false)
import {
getEquipmentTypeApi, //
getCompanyListApi, //
getEquipmentListApi, //
} from 'http/api/usercenter/goodsmang'
/* 查询参数 */
const queryParams: any = ref({
deviceName: '',
code: '',
maStatus: '',
typeId: '',
pageSize: 10,
pageNum: 1,
})
const addAndEditForm = reactive<any>({
htName: '',
mainFileList: [],
})
//
const deviceTypeTree: any = ref([])
const partTypeTreeProps: any = ref({
children: 'children',
label: 'name',
multiple: false,
value: 'id',
})
//
const companyDataList: any = ref([])
//
const getTypeTreeData = async () => {
const res: any = await getEquipmentTypeApi()
console.log('treeData==========', res)
deviceTypeTree.value = res.data
}
//
const getCompanyList = async () => {
const res: any = await getCompanyListApi()
console.log(res, '列表数据**--**-----------')
companyDataList.value = res.data
}
//
const handleStatusChange = (row:any)=>{
}
const addAndEditFormRef = ref()
const settleinTitle = ref('')
//
const dialogVisibleSettlein: any = ref(false)
//
const addContract = () => {
settleinTitle.value = '合同新建'
dialogVisibleSettlein.value = true;
}
const onDialogClose = () => {
// addAndEditFormRef.value.resetFields()
}
onMounted(() => {
//
getTypeTreeData()
//
getCompanyList()
})
</script>
<style lang="scss" scoped>
:deep.upload-tip .el-form-item__label {
color: transparent;
}
.el-pagination {
justify-content: flex-end;
padding: 5px 0;
}
:deep.el-pagination.is-background .el-pager li.is-active {
background-color: #3cb4a6;
}
:deep.el-form--inline .el-form-item {
margin-right: 6px;
width: 95%;
}
.img-list {
display: flex;
align-items: center;
.img-items {
width: 120px;
height: 120px;
margin-right: 8px;
position: relative;
img {
width: 100%;
height: 100%;
}
.mask-img {
visibility: hidden;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #000;
opacity: 0.5;
display: flex;
align-items: center;
justify-content: center;
.delete-icon {
font-size: 20px;
cursor: pointer;
z-index: 9;
color: #fff;
}
}
}
.img-items:hover .mask-img {
visibility: visible;
}
}
</style>

View File

@ -401,6 +401,20 @@ const dialogTypeChange = () => {
// equipmentDeploymentParams.value.deviceCount = 1
// countDisabled.value = true
// }
console.log('deviceTypeList',deviceTypeList[0].data.propertyNames)
if(deviceTypeList[0].data.propertyNames==null){
propertyNames.value=[]
}else{
propertyNames.value=[]
deviceTypeList[0].data.propertyNames.forEach((item:any) =>{
propertyNames.value.push({'maType':item,'value':null})
options.value.push({'label':item,'value':item})
})
console.log(propertyNames.value)
// propertyNames.value = deviceTypeList[0].data.propertyNames
// console.log(propertyNames.value)
}
// propertyNames.value = deviceTypeList[0].data.propertyNames
isDisabled.value = true
addAndEditForm.unitName = deviceTypeList[0].data.unitName
addAndEditForm.dayLeasePrice = deviceTypeList[0].data.leasePrice
@ -960,6 +974,45 @@ const onDeleteImgExaminationPdf = (j: any, index: any) => {
const onDialogClose = () => {
addAndEditFormRef.value.resetFields()
}
const propertyNames = ref<any>([
// {
// maType: 1,
// value: 2,
// },
// {
// maType: 2,
// value: 3,
// },
// {
// maType: 3,
// value: 4,
// },
])
const options = ref<any>([
// {
// label:'',
// value:1
// },
// {
// label:'',
// value:2
// },
// {
// label:'',
// value:3
// }
])
//
const addPartItem = () => {
propertyNames.value.push({'maType':null,'value':null});
}
const removePartItem = (index:any)=> {
if (propertyNames.value.length > 1) {
propertyNames.value.splice(index, 1);
}
}
</script>
<template>
@ -1358,7 +1411,7 @@ const onDialogClose = () => {
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<!-- <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="整机重量(KG)">
<el-input
@ -1373,7 +1426,56 @@ const onDialogClose = () => {
/>
</el-form-item>
</el-col>
</el-row>
</el-row> -->
<div
v-for="(item, index) in propertyNames"
:key="index"
class="dynamic-item"
>
<el-row :gutter="20" style="display: flex;margin-top:10px;justify-content: left;">
<el-col :span="14" >
<el-form-item >
<el-col :span="7" style="justify-content: left;">
<el-select v-model="item.maType" placeholder="请选择" style="width: 100%">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
<el-col :span="7" >
<el-input
v-model="item.value"
placeholder="请输入"
maxlength="20"
style="width: 350px;"
>
</el-input>
</el-col>
</el-form-item>
</el-col>
<el-col
:span="6"
style="
display: flex;
justify-content: left;
align-items: left;
"
>
<div style="">
<el-button @click="addPartItem" type="success"> 新增属性</el-button>
<el-button @click="removePartItem(index)" v-if="index != 0" type="danger">
删除属性</el-button
>
</div>
</el-col>
</el-row>
</div>
<TitleTip :titleText="`装备图片`" />
<el-row :gutter="20" v-if="!isViewForm">

View File

@ -70,6 +70,7 @@ const allList = [
{ title: '结算管理', name: 'settlement-manage', permission: ['1'] },
{ title: '需求管理', name: 'sourcingNeed', permission: ['2'] },
{ title: '订单管理', name: 'orderManagement', permission: ['2'] },
{ title: '合同管理', name: 'contract-manage', permission: ['1'] },
]
const menuList: any = computed(() => {
return allList.filter((e) => e.permission.includes(isType.value))

View File

@ -568,7 +568,6 @@ const dialogFormVisibleSettleWord: any = ref(false)
//
const handleViewWord = () => {
settleWordTitle.value = '租赁协议'
console.log(12313131)
moneyParams1.value = {
/* 设备状态 */
maStatus: 15,
@ -579,6 +578,18 @@ const handleViewWord = () => {
//
dialogFormVisibleSettleWord.value = true
}
const contract = ref({
lessor: '公司一',
tenant: '公司二',
rentTime: '2024-01-01'
});
// Word
const downloadContract = () => {
}
</script>
<template>
@ -1792,17 +1803,38 @@ const handleViewWord = () => {
destroy-on-close
:close-on-click-modal="false"
>
<div style="display: flex; justify-content: center">
<!-- <div style="display: flex; justify-content: center">
<img src="@/assets/img/zuLin.png" style="width: 100%; height: 600px" />
</div> -->
<div class="modal-content">
<h2>租赁合同</h2>
<form @submit.prevent="saveContract">
<div class="form-group">
<label>出租方</label>
<span>{{ contract.lessor }}</span>
</div>
<div class="form-group">
<label>租赁方</label>
<span>{{ contract.tenant }}</span>
</div>
<div class="form-group">
<label>租赁时间</label>
<span>{{ contract.rentTime }}</span>
</div>
<div class="form-group">
<button type="button" @click="downloadContract">下载</button>
<button type="button" @click="dialogFormVisibleSettleWord = false">关闭</button>
</div>
</form>
</div>
<template #footer>
<!-- <template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="dialogFormVisibleSettleWord = false"
> </el-button
>
<el-button @click="submitBtn" type="success"> 下载 </el-button>
</span>
</template>
</template> -->
</el-dialog>
</template>