This commit is contained in:
parent
a55ac003b8
commit
693d512131
|
|
@ -127,7 +127,13 @@
|
|||
新增装备
|
||||
</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-col>
|
||||
|
|
@ -370,13 +376,23 @@
|
|||
>
|
||||
<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; 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>
|
||||
</el-table-column>
|
||||
<el-table-column prop="certificates" label="合格证" show-overflow-tooltip align="center" min-width="200px">
|
||||
<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; 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>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
|
@ -388,7 +404,12 @@
|
|||
>
|
||||
<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; 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>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
|
@ -400,7 +421,12 @@
|
|||
>
|
||||
<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; 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>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
|
@ -459,6 +485,16 @@
|
|||
/>
|
||||
</el-select>
|
||||
</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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -787,16 +823,19 @@ export default {
|
|||
'导入结果',
|
||||
{ dangerouslyUseHTMLString: true },
|
||||
)
|
||||
this.$router.replace({
|
||||
query: {
|
||||
orderId: response.data,
|
||||
isAddVisible: this.isAddVisible,
|
||||
isApprovalVisible: this.isApprovalVisible,
|
||||
},
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.getList()
|
||||
}, 200)
|
||||
this.orderId = response.data
|
||||
this.$router
|
||||
.replace({
|
||||
query: {
|
||||
orderId: response.data,
|
||||
isAddVisible: this.isAddVisible,
|
||||
isApprovalVisible: this.isApprovalVisible,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
console.log('🚀 ~ 导入成功跳转完成')
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
handleFileSuccess2(response, file, fileList) {
|
||||
this.upload.open2 = false
|
||||
|
|
@ -927,8 +966,41 @@ export default {
|
|||
* 处理表单提交
|
||||
*/
|
||||
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
|
||||
if (this.isSubmit) return
|
||||
const loading = this.$loading()
|
||||
equipmentSubmitApiNew({ id: this.orderId, status: 0 })
|
||||
.then((res) => {
|
||||
|
|
@ -1130,7 +1202,7 @@ export default {
|
|||
this.download(
|
||||
`/material-mall/order/zip?orderId=${this.orderId}`,
|
||||
{},
|
||||
`装备信息图片导入模板_${new Date().getTime()}.zip`,
|
||||
`批量导入图片模板_${new Date().getTime()}.zip`,
|
||||
)
|
||||
},
|
||||
async addList() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue