代码提交
This commit is contained in:
parent
fec6b9896a
commit
d2a5f2d7bf
|
|
@ -8,38 +8,21 @@ 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']
|
||||
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']
|
||||
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']
|
||||
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']
|
||||
|
|
|
|||
|
|
@ -138,191 +138,6 @@ const equipmentDeployment = () => {
|
|||
person: '',
|
||||
personPhone: '',
|
||||
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 = []
|
||||
detailsFileList.value = []
|
||||
|
|
@ -626,10 +441,9 @@ const equipRules = ref({
|
|||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
deviceWeight: [
|
||||
//
|
||||
{ required: true, message: '整机重量不能为空', trigger: 'blur' },
|
||||
],
|
||||
// deviceWeight: [//
|
||||
// { required: true, message: "整机重量不能为空", trigger: "blur" }
|
||||
// ],
|
||||
})
|
||||
// 弹框保存提交
|
||||
const submitBtn = () => {
|
||||
|
|
@ -876,106 +690,55 @@ const handleRemove = (list: any, index: Number) => {
|
|||
|
||||
<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-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="equipmentDeployment"
|
||||
>装备新增</el-button
|
||||
>
|
||||
<el-button
|
||||
class="primary-lease"
|
||||
type="primary"
|
||||
@click="handleUpdateUpDown(null, 2)"
|
||||
>批量上架</el-button
|
||||
>
|
||||
<el-button
|
||||
class="primary-lease"
|
||||
type="primary"
|
||||
@click="handleUpdateUpDown(null, 1)"
|
||||
>批量下架</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form :model="queryParams" ref="queryFormRef" :inline="true" size="small" label-width="auto">
|
||||
<el-form-item label="装备名称:" prop="deviceName">
|
||||
<el-input v-model.trim="queryParams.deviceName" style="width: 160px" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="装备编号:" prop="code">
|
||||
<el-input v-model.trim="queryParams.code" style="width: 160px" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="装备状态:" prop="maStatus">
|
||||
<el-select style="width: 160px" v-model="queryParams.maStatus" clearable>
|
||||
<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-form-item label="装备类目:" prop="deviceTypeList">
|
||||
<el-cascader
|
||||
v-model="deviceTypeList"
|
||||
:show-all-levels="false"
|
||||
:options="deviceTypeTree"
|
||||
:props="partTypeTreeProps"
|
||||
filterable
|
||||
clearable
|
||||
collapse-tags
|
||||
style="width: 160px"
|
||||
placeholder="请选择装备类目"
|
||||
ref="deviceTypeCascader"
|
||||
@change="deviceTypeChange"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间:" prop="dateRange">
|
||||
<el-date-picker
|
||||
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-form-item>
|
||||
<el-button type="primary" @click="queryTableList">查询</el-button>
|
||||
<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>
|
||||
|
||||
<!-- 表格 -->
|
||||
|
|
@ -984,7 +747,8 @@ const handleRemove = (list: any, index: Number) => {
|
|||
style="width: auto"
|
||||
row-key="maId"
|
||||
show-overflow-tooltip
|
||||
:header-cell-style="{ background: '#00a288', color: '#fff' }"
|
||||
max-height="400px"
|
||||
:header-cell-style="{ background: '#3E98FF', color: '#fff' }"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<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-input
|
||||
autocomplete="off"
|
||||
style="width: 350px"
|
||||
maxlength="40"
|
||||
style="width: 350px" maxlength="40"
|
||||
v-model="equipmentDeploymentParams.code"
|
||||
clearable />
|
||||
</el-form-item> -->
|
||||
|
|
@ -1625,9 +1388,4 @@ const handleRemove = (list: any, index: Number) => {
|
|||
font-size: 12px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
:deep.el-form--inline .el-form-item {
|
||||
margin-right: 6px;
|
||||
width: 95%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue