代码提交
This commit is contained in:
parent
fec6b9896a
commit
d2a5f2d7bf
|
|
@ -8,38 +8,21 @@ 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']
|
|
||||||
ElCol: typeof import('element-plus/es')['ElCol']
|
|
||||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
|
||||||
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']
|
||||||
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
|
||||||
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']
|
||||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
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']
|
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']
|
||||||
|
|
|
||||||
|
|
@ -138,191 +138,6 @@ const equipmentDeployment = () => {
|
||||||
person: '',
|
person: '',
|
||||||
personPhone: '',
|
personPhone: '',
|
||||||
deviceWeight: '',
|
deviceWeight: '',
|
||||||
})
|
|
||||||
//编码类型禁止修改数目
|
|
||||||
const countDisabled = ref(false)
|
|
||||||
//装备类目-change
|
|
||||||
const dialogTypeCascader = ref()
|
|
||||||
//装备类目-change
|
|
||||||
const dialogTypeChange = () => {
|
|
||||||
const deviceTypeList = dialogTypeCascader.value.getCheckedNodes()
|
|
||||||
console.log(deviceTypeList)
|
|
||||||
equipmentDeploymentParams.value.unitName = deviceTypeList[0].data.unitName
|
|
||||||
let manageType = deviceTypeList[0].data.manageType
|
|
||||||
if(manageType=='1'){//数量
|
|
||||||
equipmentDeploymentParams.value.deviceCount=1
|
|
||||||
countDisabled.value=false
|
|
||||||
}else if(manageType=='0'){//编码
|
|
||||||
equipmentDeploymentParams.value.deviceCount=1
|
|
||||||
countDisabled.value=true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//获取所属公司下拉数据
|
|
||||||
const getCompanyList = async () => {
|
|
||||||
const res: any = await getCompanyListApi()
|
|
||||||
console.log(res, '列表数据**--**')
|
|
||||||
companyDataList.value = res.data
|
|
||||||
}
|
|
||||||
// 装备弹框显示隐藏
|
|
||||||
const dialogFormVisibleSettlein: any = ref(false)
|
|
||||||
const ruleFormRef: any = ref(null)
|
|
||||||
//表单校验规则
|
|
||||||
const equipRules = ref({
|
|
||||||
deviceName: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入装备名称',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
deviceTypeList: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请选择装备类目',
|
|
||||||
trigger: 'change'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
deviceCount: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入装备数量',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
brand: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入装备品牌',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
code: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入装备编号',
|
|
||||||
trigger: 'change'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
companyId: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请选择所属公司',
|
|
||||||
trigger: 'change'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
productionDate: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请选择出厂日期',
|
|
||||||
trigger: 'change'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
dayLeasePrice: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入日租金',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
person: [
|
|
||||||
{ required: true, message: "联系人不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
personPhone: [
|
|
||||||
{ required: true, message: "联系电话不能为空", trigger: "blur" },
|
|
||||||
{
|
|
||||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
||||||
message: "请输入正确的手机号码",
|
|
||||||
trigger: "blur"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// deviceWeight: [//
|
|
||||||
// { required: true, message: "整机重量不能为空", trigger: "blur" }
|
|
||||||
// ],
|
|
||||||
})
|
|
||||||
// 弹框保存提交
|
|
||||||
const submitBtn = () => {
|
|
||||||
ruleFormRef.value.validate(async (valid: any) => {
|
|
||||||
if (valid) {
|
|
||||||
if (equipmentDeploymentParams.value.deviceTypeList&&equipmentDeploymentParams.value.deviceTypeList.length > 0) {
|
|
||||||
equipmentDeploymentParams.value.typeId = equipmentDeploymentParams.value.deviceTypeList[3]
|
|
||||||
} else {
|
|
||||||
equipmentDeploymentParams.value.typeId = ""
|
|
||||||
}
|
|
||||||
if(mainFileList.value.length==0||mainFileList.value.length>6){
|
|
||||||
ElMessage({type: 'error',message: '主展示图不得少于1张,不得多于6张'})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if(detailsFileList.value.length==0||detailsFileList.value.length>6){
|
|
||||||
ElMessage({type: 'error',message: '详情展示图不得少于1张,不得多于6张'})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let param = {
|
|
||||||
...equipmentDeploymentParams.value,
|
|
||||||
mainFileList:mainFileList.value,//主展示
|
|
||||||
detailsFileList:detailsFileList.value,//详情展示
|
|
||||||
insurancePdf:insurancePdf.value,//合格证
|
|
||||||
examinationPdf:examinationPdf.value,//检测证明
|
|
||||||
}
|
|
||||||
const res: any = await equipmentAddApi(param)
|
|
||||||
if (res.code === 200) {
|
|
||||||
ElMessage({
|
|
||||||
type: 'success',
|
|
||||||
message: '保存成功'
|
|
||||||
})
|
|
||||||
dialogFormVisibleSettlein.value = false
|
|
||||||
// ruleFormRef.value.resetField()
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//草稿
|
|
||||||
const saveTemp = async() => {
|
|
||||||
if (equipmentDeploymentParams.value.deviceTypeList&&equipmentDeploymentParams.value.deviceTypeList.length > 0) {
|
|
||||||
equipmentDeploymentParams.value.typeId = equipmentDeploymentParams.value.deviceTypeList[3]
|
|
||||||
} else {
|
|
||||||
equipmentDeploymentParams.value.typeId = ""
|
|
||||||
}
|
|
||||||
if(equipmentDeploymentParams.value.deviceName==""||equipmentDeploymentParams.value.companyId==""){
|
|
||||||
ElMessage({type: 'error',message: '保存草稿请至少填写装备名称及所属公司!'})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// if(mainFileList.value.length==0||mainFileList.value.length>6){
|
|
||||||
// ElMessage({type: 'error',message: '主展示图不得少于1张,不得多于6张'})
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// if(detailsFileList.value.length==0||detailsFileList.value.length>6){
|
|
||||||
// ElMessage({type: 'error',message: '详情展示图不得少于1张,不得多于6张'})
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
let param = {
|
|
||||||
...equipmentDeploymentParams.value,
|
|
||||||
mainFileList:mainFileList.value,//主展示
|
|
||||||
detailsFileList:detailsFileList.value,//详情展示
|
|
||||||
insurancePdf:insurancePdf.value,//合格证
|
|
||||||
examinationPdf:examinationPdf.value,//检测证明
|
|
||||||
}
|
|
||||||
const res: any = await insertDraftApi(param)
|
|
||||||
if (res.code === 200) {
|
|
||||||
ElMessage({
|
|
||||||
type: 'success',
|
|
||||||
message: '保存成功'
|
|
||||||
})
|
|
||||||
dialogFormVisibleSettlein.value = false
|
|
||||||
// ruleFormRef.value.resetField()
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* 关闭按钮 */
|
|
||||||
const closeDialogBtn = () => {
|
|
||||||
ruleFormRef.value.resetFields()
|
|
||||||
dialogFormVisibleSettlein.value = false
|
|
||||||
}
|
|
||||||
/* 关闭对话框 */
|
|
||||||
const handleClose = (done: () => void) => {
|
|
||||||
ruleFormRef.value.resetFields()
|
|
||||||
done()
|
|
||||||
dialogFormVisibleSettlein.value = false
|
|
||||||
}
|
}
|
||||||
mainFileList.value = []
|
mainFileList.value = []
|
||||||
detailsFileList.value = []
|
detailsFileList.value = []
|
||||||
|
|
@ -626,10 +441,9 @@ const equipRules = ref({
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
deviceWeight: [
|
// deviceWeight: [//
|
||||||
//
|
// { required: true, message: "整机重量不能为空", trigger: "blur" }
|
||||||
{ required: true, message: '整机重量不能为空', trigger: 'blur' },
|
// ],
|
||||||
],
|
|
||||||
})
|
})
|
||||||
// 弹框保存提交
|
// 弹框保存提交
|
||||||
const submitBtn = () => {
|
const submitBtn = () => {
|
||||||
|
|
@ -876,106 +690,55 @@ const handleRemove = (list: any, index: Number) => {
|
||||||
|
|
||||||
<template>
|
<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="1"></el-option>
|
|
||||||
<el-option label="下架" value="2"></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"
|
|
||||||
:show-all-levels="false"
|
|
||||||
:options="deviceTypeTree"
|
|
||||||
:props="partTypeTreeProps"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
collapse-tags
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请选择装备类目"
|
|
||||||
ref="deviceTypeCascader"
|
|
||||||
@change="deviceTypeChange"
|
|
||||||
></el-cascader>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row>
|
<el-form :model="queryParams" ref="queryFormRef" :inline="true" size="small" label-width="auto">
|
||||||
<el-col :span="6">
|
<el-form-item label="装备名称:" prop="deviceName">
|
||||||
<el-form-item prop="dateRange">
|
<el-input v-model.trim="queryParams.deviceName" style="width: 160px" clearable />
|
||||||
<el-date-picker
|
</el-form-item>
|
||||||
style="width: 100%"
|
<el-form-item label="装备编号:" prop="code">
|
||||||
v-model="dateRange"
|
<el-input v-model.trim="queryParams.code" style="width: 160px" clearable />
|
||||||
type="datetimerange"
|
</el-form-item>
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
<el-form-item label="装备状态:" prop="maStatus">
|
||||||
range-separator="至"
|
<el-select style="width: 160px" v-model="queryParams.maStatus" clearable>
|
||||||
start-placeholder="更新开始日期"
|
<el-option label="草稿状态" value="0"></el-option>
|
||||||
end-placeholder="更新结束日期"
|
<el-option label="上架" value="1"></el-option>
|
||||||
>
|
<el-option label="下架" value="2"></el-option>
|
||||||
</el-date-picker>
|
<el-option label="在租" value="3"></el-option>
|
||||||
</el-form-item>
|
</el-select>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="18">
|
<el-form-item label="装备类目:" prop="deviceTypeList">
|
||||||
<el-form-item>
|
<el-cascader
|
||||||
<el-button class="primary-lease" type="primary" @click="queryTableList"
|
v-model="deviceTypeList"
|
||||||
>查询</el-button
|
:show-all-levels="false"
|
||||||
>
|
:options="deviceTypeTree"
|
||||||
<el-button
|
:props="partTypeTreeProps"
|
||||||
class="primary-lease"
|
filterable
|
||||||
type="primary"
|
clearable
|
||||||
@click="resetTableList(queryFormRef)"
|
collapse-tags
|
||||||
>重置</el-button
|
style="width: 160px"
|
||||||
>
|
placeholder="请选择装备类目"
|
||||||
<el-button class="primary-lease" type="primary" @click="equipmentDeployment"
|
ref="deviceTypeCascader"
|
||||||
>装备新增</el-button
|
@change="deviceTypeChange"
|
||||||
>
|
></el-cascader>
|
||||||
<el-button
|
</el-form-item>
|
||||||
class="primary-lease"
|
<el-form-item label="更新时间:" prop="dateRange">
|
||||||
type="primary"
|
<el-date-picker
|
||||||
@click="handleUpdateUpDown(null, 2)"
|
v-model="dateRange"
|
||||||
>批量上架</el-button
|
type="datetimerange"
|
||||||
>
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
<el-button
|
range-separator="至"
|
||||||
class="primary-lease"
|
start-placeholder="开始日期"
|
||||||
type="primary"
|
end-placeholder="结束日期"
|
||||||
@click="handleUpdateUpDown(null, 1)"
|
>
|
||||||
>批量下架</el-button
|
</el-date-picker>
|
||||||
>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item>
|
||||||
</el-col>
|
<el-button type="primary" @click="queryTableList">查询</el-button>
|
||||||
</el-row>
|
<el-button type="success" @click="resetTableList(queryFormRef)">重置</el-button>
|
||||||
|
<el-button type="primary" @click="equipmentDeployment">装备新增</el-button>
|
||||||
|
<el-button type="warning" @click="handleUpdateUpDown(null, 2)">批量上架</el-button>
|
||||||
|
<el-button type="warning" @click="handleUpdateUpDown(null, 1)">批量下架</el-button>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
|
|
@ -984,7 +747,8 @@ const handleRemove = (list: any, index: Number) => {
|
||||||
style="width: auto"
|
style="width: auto"
|
||||||
row-key="maId"
|
row-key="maId"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:header-cell-style="{ background: '#00a288', color: '#fff' }"
|
max-height="400px"
|
||||||
|
:header-cell-style="{ background: '#3E98FF', color: '#fff' }"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
|
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
|
||||||
|
|
@ -1162,8 +926,7 @@ const handleRemove = (list: any, index: Number) => {
|
||||||
<!-- <el-form-item label="装备编号" prop="code">
|
<!-- <el-form-item label="装备编号" prop="code">
|
||||||
<el-input
|
<el-input
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
style="width: 350px"
|
style="width: 350px" maxlength="40"
|
||||||
maxlength="40"
|
|
||||||
v-model="equipmentDeploymentParams.code"
|
v-model="equipmentDeploymentParams.code"
|
||||||
clearable />
|
clearable />
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
|
|
@ -1625,9 +1388,4 @@ const handleRemove = (list: any, index: Number) => {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep.el-form--inline .el-form-item {
|
|
||||||
margin-right: 6px;
|
|
||||||
width: 95%;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue