This commit is contained in:
parent
d431cd2531
commit
ce807a49e7
Binary file not shown.
|
After Width: | Height: | Size: 394 KiB |
|
|
@ -11,6 +11,7 @@ import userClass from '../../hooks/userClass'
|
||||||
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_1 from '../../assets/img/home/swiper01.png'
|
||||||
import swiper_2 from '../../assets/img/home/swiper02.png'
|
import swiper_2 from '../../assets/img/home/swiper02.png'
|
||||||
|
import swiper_3 from '../../assets/img/home/swiper03.png'
|
||||||
import swiper_4 from '../../assets/img/home/swiper04.png'
|
import swiper_4 from '../../assets/img/home/swiper04.png'
|
||||||
import swiper_5 from '../../assets/img/home/swiper05.png'
|
import swiper_5 from '../../assets/img/home/swiper05.png'
|
||||||
|
|
||||||
|
|
@ -26,14 +27,15 @@ const classList: any = ref([])
|
||||||
const selectOptions = ref<boolean>(false) // 分类
|
const selectOptions = ref<boolean>(false) // 分类
|
||||||
const selectOptionsValue = ref<string>('分类筛选')
|
const selectOptionsValue = ref<string>('分类筛选')
|
||||||
|
|
||||||
const loopList = ref([swiper_2, swiper_4])
|
const loopList = ref([swiper_2, swiper_4, swiper_3])
|
||||||
|
|
||||||
if (userStore.companyList.length === 0) {
|
getCompanyList()
|
||||||
getCompanyList()
|
// if (userStore.companyList.length === 0) {
|
||||||
companyList.value = userStore.companyList
|
// getCompanyList()
|
||||||
} else {
|
// companyList.value = userStore.companyList
|
||||||
companyList.value = userStore.companyList
|
// } else {
|
||||||
}
|
// companyList.value = userStore.companyList
|
||||||
|
// }
|
||||||
if (userStore.goodsClassList.length === 0) {
|
if (userStore.goodsClassList.length === 0) {
|
||||||
getGoodsClassList().then(() => {
|
getGoodsClassList().then(() => {
|
||||||
classList.value = userStore.goodsClassList
|
classList.value = userStore.goodsClassList
|
||||||
|
|
@ -264,6 +266,11 @@ const onSelectItem = (type: number) => {
|
||||||
style="width: 100%; height: 100%"
|
style="width: 100%; height: 100%"
|
||||||
:src="item"
|
:src="item"
|
||||||
fit="cover"
|
fit="cover"
|
||||||
|
@click="
|
||||||
|
() => {
|
||||||
|
router.push({ name: 'equipList' })
|
||||||
|
}
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</el-carousel-item>
|
</el-carousel-item>
|
||||||
</el-carousel>
|
</el-carousel>
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,7 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
<div>
|
<div>
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="rolesType != '2'"
|
||||||
style="
|
style="
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
@ -241,6 +242,7 @@ const store: any = mainStore()
|
||||||
const userId = store.userInfo.userId
|
const userId = store.userInfo.userId
|
||||||
const companyId = store.userInfo.companyId
|
const companyId = store.userInfo.companyId
|
||||||
const leaseList = ref<any>([])
|
const leaseList = ref<any>([])
|
||||||
|
const rolesType = localStorage.getItem('rolesType')
|
||||||
|
|
||||||
//筛选条件列表数据
|
//筛选条件列表数据
|
||||||
const screenChooseList: any = reactive([
|
const screenChooseList: any = reactive([
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ const isViewForm = ref(false)
|
||||||
|
|
||||||
const isDisabled = ref(false)
|
const isDisabled = ref(false)
|
||||||
const isMaStatus = ref(false)
|
const isMaStatus = ref(false)
|
||||||
|
const isAdd = ref(false)
|
||||||
|
|
||||||
const previewDialogVisible = ref(false)
|
const previewDialogVisible = ref(false)
|
||||||
const previewDialogImageUrl = ref('')
|
const previewDialogImageUrl = ref('')
|
||||||
|
|
@ -134,6 +135,7 @@ getList()
|
||||||
//---列表按钮事件---
|
//---列表按钮事件---
|
||||||
// 装备新增按钮
|
// 装备新增按钮
|
||||||
const equipmentDeployment = () => {
|
const equipmentDeployment = () => {
|
||||||
|
isAdd.value = true
|
||||||
settleinTitle.value = '新增装备'
|
settleinTitle.value = '新增装备'
|
||||||
isMaStatus.value = false
|
isMaStatus.value = false
|
||||||
isViewForm.value = false
|
isViewForm.value = false
|
||||||
|
|
@ -182,6 +184,7 @@ const maId: any = ref('')
|
||||||
const warningDays:any = ref(0)
|
const warningDays:any = ref(0)
|
||||||
// 编辑按钮
|
// 编辑按钮
|
||||||
const editRowInfo = (row: any) => {
|
const editRowInfo = (row: any) => {
|
||||||
|
isAdd.value = false
|
||||||
settleinTitle.value = '装备编辑'
|
settleinTitle.value = '装备编辑'
|
||||||
getDetailData(row)
|
getDetailData(row)
|
||||||
isMaStatus.value = true
|
isMaStatus.value = true
|
||||||
|
|
@ -192,6 +195,7 @@ const editRowInfo = (row: any) => {
|
||||||
}
|
}
|
||||||
/* 查看按钮 */
|
/* 查看按钮 */
|
||||||
const previewRowInfo = (row: any) => {
|
const previewRowInfo = (row: any) => {
|
||||||
|
isAdd.value = false
|
||||||
settleinTitle.value = '装备详情'
|
settleinTitle.value = '装备详情'
|
||||||
getDetailData(row)
|
getDetailData(row)
|
||||||
disabledForm.value = true
|
disabledForm.value = true
|
||||||
|
|
@ -302,11 +306,11 @@ const getDetailData = async (row: any) => {
|
||||||
equipTableList.value.push({
|
equipTableList.value.push({
|
||||||
id:item.id,
|
id:item.id,
|
||||||
identifyCode: item.identifyCode,
|
identifyCode: item.identifyCode,
|
||||||
name2: item.insurancePdf[0].fileUrl,
|
name2: item.insurancePdf[0]?.fileUrl,
|
||||||
checkMan: item.checkMan,
|
checkMan: item.checkMan,
|
||||||
checkDate: item.checkDate,
|
checkDate: item.checkDate,
|
||||||
nextCheckDate: item.nextCheckDate,
|
nextCheckDate: item.nextCheckDate,
|
||||||
name6: item.examinationPdf[0].fileUrl,
|
name6: item.examinationPdf[0]?.fileUrl,
|
||||||
insurancePdf: item.insurancePdf,
|
insurancePdf: item.insurancePdf,
|
||||||
examinationPdf: item.examinationPdf,
|
examinationPdf: item.examinationPdf,
|
||||||
})
|
})
|
||||||
|
|
@ -330,11 +334,11 @@ const getDetailData = async (row: any) => {
|
||||||
equipTableList.value.push({
|
equipTableList.value.push({
|
||||||
id:item.id,
|
id:item.id,
|
||||||
identifyCode: item.identifyCode,
|
identifyCode: item.identifyCode,
|
||||||
name2: item.insurancePdf[0].fileUrl,
|
name2: item.insurancePdf[0]?.fileUrl,
|
||||||
checkMan: item.checkMan,
|
checkMan: item.checkMan,
|
||||||
checkDate: item.checkDate,
|
checkDate: item.checkDate,
|
||||||
nextCheckDate: item.nextCheckDate,
|
nextCheckDate: item.nextCheckDate,
|
||||||
name6: item.examinationPdf[0].fileUrl,
|
name6: item.examinationPdf[0]?.fileUrl,
|
||||||
insurancePdf: item.insurancePdf,
|
insurancePdf: item.insurancePdf,
|
||||||
examinationPdf: item.examinationPdf,
|
examinationPdf: item.examinationPdf,
|
||||||
})
|
})
|
||||||
|
|
@ -683,14 +687,24 @@ const submitBtn = async () => {
|
||||||
}
|
}
|
||||||
const submitFun = (type: any) => {
|
const submitFun = (type: any) => {
|
||||||
// type 1 提交(新增时) 2 存草稿(新增时) 3 编辑时的提交 4 编辑时存草稿
|
// type 1 提交(新增时) 2 存草稿(新增时) 3 编辑时的提交 4 编辑时存草稿
|
||||||
addAndEditForm.mainFileList = [
|
// addAndEditForm.mainFileList = [
|
||||||
...addAndEditForm.mainFileList,
|
// ...addAndEditForm.mainFileList,
|
||||||
...addAndEditForm.mainFileTempList,
|
// ...addAndEditForm.mainFileTempList,
|
||||||
]
|
// ]
|
||||||
addAndEditForm.detailsFileList = [
|
// addAndEditForm.detailsFileList = [
|
||||||
...addAndEditForm.detailsFileList,
|
// ...addAndEditForm.detailsFileList,
|
||||||
...addAndEditForm.detailsFileTempList,
|
// ...addAndEditForm.detailsFileTempList,
|
||||||
]
|
// ]
|
||||||
|
if (isAdd.value) {
|
||||||
|
addAndEditForm.mainFileList = Array.from(new Set([
|
||||||
|
...addAndEditForm.mainFileList,
|
||||||
|
...addAndEditForm.mainFileTempList,
|
||||||
|
]))
|
||||||
|
addAndEditForm.detailsFileList = Array.from(new Set([
|
||||||
|
...addAndEditForm.detailsFileList,
|
||||||
|
...addAndEditForm.detailsFileTempList,
|
||||||
|
]))
|
||||||
|
}
|
||||||
|
|
||||||
addAndEditFormRef.value.validate(async (valid: any) => {
|
addAndEditFormRef.value.validate(async (valid: any) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
@ -733,7 +747,7 @@ const submitFun = (type: any) => {
|
||||||
for (let i = 0; i < addAndEditForm.tableList.length; i++) {
|
for (let i = 0; i < addAndEditForm.tableList.length; i++) {
|
||||||
const row = addAndEditForm.tableList[i];
|
const row = addAndEditForm.tableList[i];
|
||||||
for (const key in row) {
|
for (const key in row) {
|
||||||
if (row.hasOwnProperty(key) && (row[key] === null || row[key] === '' || row[key].length ===0) && key !== 'name2' && key !== 'name6'&& key !== 'id') {
|
if (row.hasOwnProperty(key) && (row[key] === null || row[key] === '' || row[key]?.length ===0) && key !== 'name2' && key !== 'name6'&& key !== 'id') {
|
||||||
if(key=='identifyCode'){
|
if(key=='identifyCode'){
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
|
@ -770,6 +784,16 @@ const submitFun = (type: any) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isDescription) return
|
if (isDescription) return
|
||||||
|
addAndEditForm.mainFileList = Array.from(new Set([
|
||||||
|
...addAndEditForm.mainFileList,
|
||||||
|
...addAndEditForm.mainFileTempList,
|
||||||
|
]))
|
||||||
|
console.log('🚀 ~ submitFun ~ addAndEditForm.mainFileList:', addAndEditForm.mainFileList)
|
||||||
|
addAndEditForm.detailsFileList = Array.from(new Set([
|
||||||
|
...addAndEditForm.detailsFileList,
|
||||||
|
...addAndEditForm.detailsFileTempList,
|
||||||
|
]))
|
||||||
|
console.log('🚀 ~ submitFun ~ addAndEditForm.detailsFileList:', addAndEditForm.detailsFileList)
|
||||||
|
|
||||||
addAndEditForm.devInfoProperties = propertyNames.value
|
addAndEditForm.devInfoProperties = propertyNames.value
|
||||||
addAndEditForm.typeId =
|
addAndEditForm.typeId =
|
||||||
|
|
@ -792,16 +816,21 @@ const submitFun = (type: any) => {
|
||||||
SEND_FUN_API = equipmentEditApi
|
SEND_FUN_API = equipmentEditApi
|
||||||
addAndEditForm.maStatus = 0
|
addAndEditForm.maStatus = 0
|
||||||
}
|
}
|
||||||
const res: any = await SEND_FUN_API(addAndEditForm)
|
let res = null
|
||||||
if (res.code === 200) {
|
try {
|
||||||
ElMessage({
|
res = await SEND_FUN_API(addAndEditForm)
|
||||||
type: 'success',
|
if (res.code === 200) {
|
||||||
message: '保存成功',
|
ElMessage({
|
||||||
duration: 1000,
|
type: 'success',
|
||||||
})
|
message: '保存成功',
|
||||||
propertyNames.value = []
|
duration: 1000,
|
||||||
dialogFormVisibleSettlein.value = false
|
})
|
||||||
getList()
|
propertyNames.value = []
|
||||||
|
dialogFormVisibleSettlein.value = false
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log('error', error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组装参数
|
// 组装参数
|
||||||
|
|
@ -1668,7 +1697,7 @@ const changeDate = (row:any,index:number) => {
|
||||||
label="主展示图:"
|
label="主展示图:"
|
||||||
prop="mainFileList"
|
prop="mainFileList"
|
||||||
>
|
>
|
||||||
<div class="img-list" v-if="addAndEditForm.mainFileList.length > 0">
|
<div class="img-list" v-if="addAndEditForm.mainFileList.length > 0 && !isAdd">
|
||||||
<div
|
<div
|
||||||
v-for="(j, i) in addAndEditForm.mainFileList"
|
v-for="(j, i) in addAndEditForm.mainFileList"
|
||||||
:key="j.fileUrl"
|
:key="j.fileUrl"
|
||||||
|
|
@ -1734,7 +1763,7 @@ const changeDate = (row:any,index:number) => {
|
||||||
label="详情页展示图:"
|
label="详情页展示图:"
|
||||||
prop="detailsFileList"
|
prop="detailsFileList"
|
||||||
>
|
>
|
||||||
<div class="img-list" v-if="addAndEditForm.detailsFileList.length > 0">
|
<div class="img-list" v-if="addAndEditForm.detailsFileList.length > 0 && !isAdd">
|
||||||
<div
|
<div
|
||||||
v-for="(j, i) in addAndEditForm.detailsFileList"
|
v-for="(j, i) in addAndEditForm.detailsFileList"
|
||||||
:key="j.fileUrl"
|
:key="j.fileUrl"
|
||||||
|
|
@ -1746,7 +1775,7 @@ const changeDate = (row:any,index:number) => {
|
||||||
<div>
|
<div>
|
||||||
<el-icon
|
<el-icon
|
||||||
class="delete-icon"
|
class="delete-icon"
|
||||||
@click="onDeleteImgInMain(i)"
|
@click="onDeleteImgInDetails(i)"
|
||||||
v-if="!isViewForm"
|
v-if="!isViewForm"
|
||||||
>
|
>
|
||||||
<DeleteFilled />
|
<DeleteFilled />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue