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