This commit is contained in:
parent
8e7570af80
commit
d39426a7dc
|
|
@ -60,7 +60,7 @@
|
|||
>
|
||||
<el-option label="已超期" value="已超期"/>
|
||||
<el-option label="一月内到期" value="一月内到期"/>
|
||||
<el-option label="正常" value="一月内到期"/>
|
||||
<el-option label="正常" value="正常"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
<el-table-column prop="itemTypeModel" label="装备型号" align="center"/>
|
||||
<el-table-column prop="deviceCode" label="装备编码" align="center"/>
|
||||
<el-table-column prop="qcUser" label="维保人" align="center" width="120"/>
|
||||
<el-table-column prop="upCheckTime" label="上次维保日期" align="center"/>
|
||||
<el-table-column prop="qcTime" label="上次维保日期" align="center"/>
|
||||
<el-table-column prop="nextCheckTime" label="下次维保日期" align="center"/>
|
||||
<el-table-column prop="phonenumber" label="维保人联系方式" align="center"/>
|
||||
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@
|
|||
</el-row>
|
||||
<el-row style="border-bottom: 1px solid #ccc; margin-bottom: 10px" class="order-title-info">
|
||||
<el-col :span="8">
|
||||
<span> 出租方姓名: </span>
|
||||
<span> 出租单位: </span>
|
||||
<span> {{ item.sellerName }} </span>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@
|
|||
|
||||
<el-row class="order-title-info" style="border-bottom: 1px solid #ccc; margin-bottom: 10px">
|
||||
<el-col :span="8">
|
||||
<span> 出租方姓名: </span>
|
||||
<span> 出租单位: </span>
|
||||
<span>{{ item.sellerName }}</span>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
|
|
|||
|
|
@ -283,7 +283,9 @@
|
|||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm"
|
||||
:loading="isSubmitting"
|
||||
:disabled="isSubmitting" >确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -313,6 +315,8 @@
|
|||
|
||||
loadingTwo: false,
|
||||
|
||||
isSubmitting: false, // 新增:标记是否正在提交
|
||||
submitDebounce: null, // 防抖计时器
|
||||
|
||||
// 是否显示项目部Id
|
||||
showName: false,
|
||||
|
|
@ -637,36 +641,64 @@
|
|||
this.handleQuery();
|
||||
},
|
||||
|
||||
//** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(async valid => {
|
||||
if (valid) {
|
||||
//** 提交按钮 */
|
||||
submitForm() {
|
||||
// 1. 第一层拦截:正在提交中,直接返回
|
||||
if (this.isSubmitting) return;
|
||||
|
||||
// 2. 第二层拦截:防抖,500ms内只允许触发一次
|
||||
if (this.submitDebounce) {
|
||||
clearTimeout(this.submitDebounce);
|
||||
}
|
||||
this.submitDebounce = setTimeout(async () => {
|
||||
try {
|
||||
// 3. 提前锁定提交状态(关键:移到validate之前)
|
||||
this.isSubmitting = true;
|
||||
|
||||
// 执行表单验证
|
||||
const valid = await new Promise((resolve) => {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
resolve(valid);
|
||||
});
|
||||
});
|
||||
|
||||
if (valid) {
|
||||
// 核心业务逻辑
|
||||
if (this.form.supplierId != undefined) {
|
||||
const reqData = new FormData();
|
||||
if(this.businessLicenseListTemp.length!=0){
|
||||
await this.getImaUploadEdit(),
|
||||
const reqData = new FormData();
|
||||
if (this.businessLicenseListTemp.length != 0) {
|
||||
await this.getImaUploadEdit();
|
||||
await this.editFacturerTemp(this.form);
|
||||
await this.deleteFile();
|
||||
} else {
|
||||
await this.editFacturerTemp(this.form);
|
||||
await this.deleteFile();
|
||||
}else{
|
||||
await this.editFacturerTemp(this.form);
|
||||
await this.deleteFile();
|
||||
}
|
||||
|
||||
} else {
|
||||
if(this.businessLicenseListTemp.length!=0){
|
||||
await this.getImaUpload(),
|
||||
if (this.businessLicenseListTemp.length != 0) {
|
||||
await this.getImaUpload();
|
||||
await this.addFacturerTemp(this.form);
|
||||
} else {
|
||||
await this.addFacturerTemp(this.form);
|
||||
}else{
|
||||
await this.addFacturerTemp(this.form);
|
||||
}
|
||||
}
|
||||
|
||||
this.uploadKey = Date.now();
|
||||
this.$message.success('提交成功!');
|
||||
}
|
||||
}
|
||||
});
|
||||
this.uploadKey = Date.now();
|
||||
},
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
this.$message.error('提交失败,请重试!');
|
||||
} finally {
|
||||
// 4. 最终解锁,恢复可点击状态
|
||||
this.isSubmitting = false;
|
||||
this.submitDebounce = null; // 清空防抖计时器
|
||||
}
|
||||
}, 500); // 防抖间隔:500ms,可根据需求调整
|
||||
},
|
||||
|
||||
async getImaUpload(){
|
||||
|
||||
async getImaUpload(){
|
||||
this.businessLicenseFileList = []
|
||||
const reqData = new FormData()
|
||||
const {fileTwo} = await this.getFileData()
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@
|
|||
</el-row>
|
||||
<el-row style="border-bottom: 1px solid #ccc; margin-bottom: 10px" class="order-title-info">
|
||||
<el-col :span="8">
|
||||
<span> 出租方姓名: </span>
|
||||
<span> 出租单位: </span>
|
||||
<span> {{ item.sellerName }} </span>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
|
|
|||
|
|
@ -45,24 +45,25 @@
|
|||
stripe
|
||||
height="546"
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="60" />
|
||||
<el-table-column prop="processCode" label="流程编码" width="220" />
|
||||
<el-table-column prop="processName" label="流程名称" min-width="100" />
|
||||
<el-table-column prop="businessType" label="业务类型" width="150">
|
||||
<el-table-column align="center" label="序号" type="index" width="60"/>
|
||||
<!-- <el-table-column prop="id" label="ID" width="60" />-->
|
||||
<el-table-column prop="processCode" align="center" label="流程编码" width="220" />
|
||||
<el-table-column prop="processName" align="center" label="流程名称" min-width="100" />
|
||||
<el-table-column prop="businessType" align="center" label="业务类型" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ getBusinessTypeLabel(scope.row.businessType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="description" label="流程描述" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="状态" width="80">
|
||||
<el-table-column prop="description" align="center" label="流程描述" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="status" align="center" label="状态" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status === '1' ? 'success' : 'danger'">
|
||||
{{ scope.row.status === '1' ? '启用' : '停用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" width="180" />
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
<el-table-column prop="createTime" align="center" label="创建时间" width="180" />
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button type="info" size="mini" @click="handleView(scope.row)">查看</el-button>
|
||||
|
|
|
|||
|
|
@ -687,7 +687,7 @@ export default {
|
|||
Message.error(res.message || '获取项目列表失败')
|
||||
}
|
||||
} catch (error) {
|
||||
Message.error('网络错误,获取项目列表失败')
|
||||
Message.error('获取项目列表失败')
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -776,7 +776,7 @@ export default {
|
|||
Message.error(res.message || '获取项目详情失败')
|
||||
}
|
||||
} catch (error) {
|
||||
Message.error('网络错误,获取项目详情失败')
|
||||
Message.error('获取项目详情失败')
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -839,7 +839,7 @@ export default {
|
|||
this.$nextTick(() => this.$refs.addOrEditFormRef?.clearValidate());
|
||||
} catch (error) {
|
||||
console.error('编辑失败:', error);
|
||||
Message.error('网络错误,编辑失败');
|
||||
Message.error('编辑失败');
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -867,7 +867,7 @@ export default {
|
|||
Message.error(res.message || (this.isAdd ? '新增项目失败' : '编辑项目失败'))
|
||||
}
|
||||
} catch (error) {
|
||||
Message.error('网络错误,操作失败')
|
||||
//Message.error('网络错误,操作失败')
|
||||
} finally {
|
||||
this.submitLoading = false
|
||||
}
|
||||
|
|
@ -884,7 +884,7 @@ export default {
|
|||
Message.error(res.message || '删除项目失败')
|
||||
}
|
||||
} catch (error) {
|
||||
Message.error('网络错误,删除项目失败')
|
||||
Message.error('删除项目失败')
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -918,7 +918,7 @@ export default {
|
|||
}
|
||||
} catch (error) {
|
||||
if (error !== 'cancel') {
|
||||
Message.error('网络错误,批量删除失败')
|
||||
Message.error('批量删除失败')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue