This commit is contained in:
bb_pan 2025-12-10 19:40:29 +08:00
parent a55ac003b8
commit 693d512131
1 changed files with 89 additions and 17 deletions

View File

@ -127,7 +127,13 @@
新增装备 新增装备
</el-button> </el-button>
<el-button type="primary" size="mini" @click="handleImport" v-show="!isAddVisible"> 批量导入 </el-button> <el-button type="primary" size="mini" @click="handleImport" v-show="!isAddVisible"> 批量导入 </el-button>
<el-button type="primary" size="mini" @click="handleImportImg" v-show="!isAddVisible && tableData.length > 0"> <el-button
type="primary"
size="mini"
@click="handleImportImg"
v-show="!isAddVisible"
:disabled="tableData.length == 0"
>
批量导入图片 批量导入图片
</el-button> </el-button>
</el-col> </el-col>
@ -370,13 +376,23 @@
> >
<template v-slot="{ row }"> <template v-slot="{ row }">
<span style="color: #00a288; cursor: pointer" v-if="row.isNew" @click="handleFileUpload(row, 1)">上传</span> <span style="color: #00a288; cursor: pointer" v-if="row.isNew" @click="handleFileUpload(row, 1)">上传</span>
<span style="color: #00a288; cursor: pointer; margin-left: 10px" @click="handleView(row, 1)">查看</span> <span
v-if="row.appearanceImages && row.appearanceImages.length > 0"
style="color: #00a288; cursor: pointer; margin-left: 10px"
@click="handleView(row, 1)"
>查看</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="certificates" label="合格证" show-overflow-tooltip align="center" min-width="200px"> <el-table-column prop="certificates" label="合格证" show-overflow-tooltip align="center" min-width="200px">
<template v-slot="{ row }"> <template v-slot="{ row }">
<span style="color: #00a288; cursor: pointer" v-if="row.isNew" @click="handleFileUpload(row, 2)">上传</span> <span style="color: #00a288; cursor: pointer" v-if="row.isNew" @click="handleFileUpload(row, 2)">上传</span>
<span style="color: #00a288; cursor: pointer; margin-left: 10px" @click="handleView(row, 2)">查看</span> <span
v-if="row.certificates && row.certificates.length > 0"
style="color: #00a288; cursor: pointer; margin-left: 10px"
@click="handleView(row, 2)"
>查看</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -388,7 +404,12 @@
> >
<template v-slot="{ row }"> <template v-slot="{ row }">
<span style="color: #00a288; cursor: pointer" v-if="row.isNew" @click="handleFileUpload(row, 3)">上传</span> <span style="color: #00a288; cursor: pointer" v-if="row.isNew" @click="handleFileUpload(row, 3)">上传</span>
<span style="color: #00a288; cursor: pointer; margin-left: 10px" @click="handleView(row, 3)">查看</span> <span
v-if="row.inspectionReports && row.inspectionReports.length > 0"
style="color: #00a288; cursor: pointer; margin-left: 10px"
@click="handleView(row, 3)"
>查看</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -400,7 +421,12 @@
> >
<template v-slot="{ row }"> <template v-slot="{ row }">
<span style="color: #00a288; cursor: pointer" v-if="row.isNew" @click="handleFileUpload(row, 4)">上传</span> <span style="color: #00a288; cursor: pointer" v-if="row.isNew" @click="handleFileUpload(row, 4)">上传</span>
<span style="color: #00a288; cursor: pointer; margin-left: 10px" @click="handleView(row, 4)">查看</span> <span
v-if="row.purchaseInvoices && row.purchaseInvoices.length > 0"
style="color: #00a288; cursor: pointer; margin-left: 10px"
@click="handleView(row, 4)"
>查看</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -459,6 +485,16 @@
/> />
</el-select> </el-select>
</div> </div>
<span
v-else-if="
row.isNew &&
row.propertyVoList.length > 0 &&
row.propertyVoList[Math.ceil(index / 2)] &&
row.propertyVoList[Math.ceil(index / 2)].mustHave != 0
"
style="color: red"
>{{ getFeatureValue(row, item.prop) }}</span
>
<span v-else>{{ getFeatureValue(row, item.prop) }}</span> <span v-else>{{ getFeatureValue(row, item.prop) }}</span>
</template> </template>
</el-table-column> </el-table-column>
@ -787,16 +823,19 @@ export default {
'导入结果', '导入结果',
{ dangerouslyUseHTMLString: true }, { dangerouslyUseHTMLString: true },
) )
this.$router.replace({ this.orderId = response.data
this.$router
.replace({
query: { query: {
orderId: response.data, orderId: response.data,
isAddVisible: this.isAddVisible, isAddVisible: this.isAddVisible,
isApprovalVisible: this.isApprovalVisible, isApprovalVisible: this.isApprovalVisible,
}, },
}) })
setTimeout(() => { .then(() => {
console.log('🚀 ~ 导入成功跳转完成')
this.getList() this.getList()
}, 200) })
}, },
handleFileSuccess2(response, file, fileList) { handleFileSuccess2(response, file, fileList) {
this.upload.open2 = false this.upload.open2 = false
@ -927,8 +966,41 @@ export default {
* 处理表单提交 * 处理表单提交
*/ */
handleSubmit() { handleSubmit() {
if (this.isSubmit) return console.log('提交表单')
//
let hasMissing = false
for (const item of this.tableData) {
if (!item.appearanceImages?.length) {
this.$message({
type: 'warning',
message: '请上传装备外观附件',
})
hasMissing = true
break
}
if (!item.certificates?.length) {
this.$message({
type: 'warning',
message: '请上传装备合格证附件',
})
hasMissing = true
break
}
if (!item.inspectionReports?.length) {
this.$message({
type: 'warning',
message: '请上传装备检验报告附件',
})
hasMissing = true
break
}
}
if (hasMissing) return
this.isSubmit = true this.isSubmit = true
if (this.isSubmit) return
const loading = this.$loading() const loading = this.$loading()
equipmentSubmitApiNew({ id: this.orderId, status: 0 }) equipmentSubmitApiNew({ id: this.orderId, status: 0 })
.then((res) => { .then((res) => {
@ -1130,7 +1202,7 @@ export default {
this.download( this.download(
`/material-mall/order/zip?orderId=${this.orderId}`, `/material-mall/order/zip?orderId=${this.orderId}`,
{}, {},
`装备信息图片导入模板_${new Date().getTime()}.zip`, `批量导入图片模板_${new Date().getTime()}.zip`,
) )
}, },
async addList() { async addList() {