工器具修改
This commit is contained in:
parent
314e59a34f
commit
1229708294
|
|
@ -39,7 +39,7 @@ export function delDataAPI(data) {
|
||||||
/* 工器具库->查询详情 */
|
/* 工器具库->查询详情 */
|
||||||
export function getDetailDataAPI(params) {
|
export function getDetailDataAPI(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/smartBid/mainDatabase/tool/getDetailData',
|
url: '/smartBid/mainDatabase/tool/detailData',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -42,27 +42,6 @@ export default {
|
||||||
handleCategoryChange(categoryId) {
|
handleCategoryChange(categoryId) {
|
||||||
this.activeCategory = categoryId
|
this.activeCategory = categoryId
|
||||||
},
|
},
|
||||||
handleAddCategory() {
|
|
||||||
},
|
|
||||||
handleCategoryCommand(command) {
|
|
||||||
if (command.type === 'edit') {
|
|
||||||
console.log('编辑分类:', command.id)
|
|
||||||
} else if (command.type === 'delete') {
|
|
||||||
console.log('删除分类:', command.id)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleAddScheme() {
|
|
||||||
console.log('新增方案')
|
|
||||||
},
|
|
||||||
handleView(row) {
|
|
||||||
console.log('查看:', row)
|
|
||||||
},
|
|
||||||
handleEdit(row) {
|
|
||||||
console.log('编辑:', row)
|
|
||||||
},
|
|
||||||
handleDelete(row) {
|
|
||||||
console.log('删除:', row)
|
|
||||||
},
|
|
||||||
// 返回上一页
|
// 返回上一页
|
||||||
handleBack() {
|
handleBack() {
|
||||||
const obj = {
|
const obj = {
|
||||||
|
|
|
||||||
|
|
@ -5,16 +5,16 @@
|
||||||
<div>
|
<div>
|
||||||
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="110px">
|
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="110px">
|
||||||
<el-form-item label="工器具名称" prop="toolName">
|
<el-form-item label="工器具名称" prop="toolName">
|
||||||
<el-input class="form-item" v-model="form.toolName" clearable show-word-limit
|
<el-input class="form-item" v-model="form.toolName" clearable show-word-limit placeholder="请输入工器具名称"
|
||||||
placeholder="请输入工器具名称" maxlength="32"></el-input>
|
maxlength="32"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="规格型号" prop="model">
|
<el-form-item label="规格型号" prop="model">
|
||||||
<el-input class="form-item" v-model="form.model" clearable show-word-limit
|
<el-input class="form-item" v-model="form.model" clearable show-word-limit placeholder="请输入规格型号"
|
||||||
placeholder="请输入规格型号" maxlength="32"></el-input>
|
maxlength="32"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="单位" prop="unit">
|
<el-form-item label="单位" prop="unit">
|
||||||
<el-input class="form-item" v-model="form.unit" clearable show-word-limit
|
<el-input class="form-item" v-model="form.unit" clearable show-word-limit placeholder="请输入单位"
|
||||||
placeholder="请输入单位" maxlength="32"></el-input>
|
maxlength="32"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="技术参数" prop="technicalParameters">
|
<el-form-item label="技术参数" prop="technicalParameters">
|
||||||
<el-input class="form-item" v-model="form.technicalParameters" clearable show-word-limit
|
<el-input class="form-item" v-model="form.technicalParameters" clearable show-word-limit
|
||||||
|
|
@ -29,6 +29,11 @@
|
||||||
v-model.trim="form.remark" clearable show-word-limit placeholder="请输入备注"
|
v-model.trim="form.remark" clearable show-word-limit placeholder="请输入备注"
|
||||||
maxlength="300"></el-input>
|
maxlength="300"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- 工器具图片 -->
|
||||||
|
<el-form-item label="工器具图片" prop="fileList">
|
||||||
|
<UploadFile :fileList="form.fileList" :fileUploadRule="defaultParams.fileUploadRule"
|
||||||
|
@file-change="handleFileChange" @del-file="handleDelFile" type="tool" />
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
|
|
@ -40,23 +45,39 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import UploadFile from '@/views/common/UploadFile.vue'
|
||||||
|
import { addDataAPI, editDataAPI, getDetailDataAPI } from '@/api/enterpriseLibrary/tool/tool'
|
||||||
|
// 默认参数
|
||||||
|
const defaultParams = {
|
||||||
|
fileUploadRule: {
|
||||||
|
fileUploadType: 'tools',
|
||||||
|
fields_json: '',
|
||||||
|
suffix: 'tools_database'
|
||||||
|
},
|
||||||
|
};
|
||||||
export default {
|
export default {
|
||||||
name: "TypeForm",
|
name: "ToolForm",
|
||||||
|
components: {
|
||||||
|
UploadFile
|
||||||
|
},
|
||||||
props: ["width", "rowData", "title", "disabled", "isAdd"],
|
props: ["width", "rowData", "title", "disabled", "isAdd"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lDialog: this.width > 500 ? "w700" : "w500",
|
lDialog: this.width > 500 ? "w700" : "w500",
|
||||||
dialogVisible: true,
|
dialogVisible: true,
|
||||||
isDisabled: true,
|
isDisabled: true,
|
||||||
|
defaultParams,
|
||||||
form: {
|
form: {
|
||||||
id: null,
|
id: null,
|
||||||
|
enterpriseId: this.rowData.enterpriseId,
|
||||||
technicalSolutionName: '',
|
technicalSolutionName: '',
|
||||||
model: '',
|
model: '',
|
||||||
unit: '',
|
unit: '',
|
||||||
technicalParameters: '',
|
technicalParameters: '',
|
||||||
mainFunction: '',
|
mainFunction: '',
|
||||||
remark: '',
|
remark: '',
|
||||||
|
fileList: [],
|
||||||
|
delFileList: []
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
toolName: [
|
toolName: [
|
||||||
|
|
@ -68,6 +89,9 @@ export default {
|
||||||
unit: [
|
unit: [
|
||||||
{ required: true, message: '单位不能为空', trigger: 'blur' }
|
{ required: true, message: '单位不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
|
fileList: [
|
||||||
|
{ required: true, message: '工器具图片不能为空', trigger: ['blur', 'change'] }
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -83,8 +107,9 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 初始化表单数据 */
|
/** 初始化表单数据 */
|
||||||
initFormData() {
|
async initFormData() {
|
||||||
if (this.isAdd === 'edit' && this.rowData) {
|
if (!this.rowData) return;
|
||||||
|
const files = await this.getDetail();
|
||||||
// 编辑模式:填充表单数据
|
// 编辑模式:填充表单数据
|
||||||
this.form = {
|
this.form = {
|
||||||
id: this.rowData.id,
|
id: this.rowData.id,
|
||||||
|
|
@ -94,7 +119,47 @@ export default {
|
||||||
technicalParameters: this.rowData.technicalParameters || '',
|
technicalParameters: this.rowData.technicalParameters || '',
|
||||||
mainFunction: this.rowData.mainFunction || '',
|
mainFunction: this.rowData.mainFunction || '',
|
||||||
remark: this.rowData.remark || '',
|
remark: this.rowData.remark || '',
|
||||||
|
fileList: Array.isArray(files) ? files : [],
|
||||||
|
delFileList: [],
|
||||||
|
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
async getDetail() {
|
||||||
|
try {
|
||||||
|
const res = await getDetailDataAPI({ toolId: this.rowData.toolId, enterpriseId: this.rowData.enterpriseId });
|
||||||
|
if (res && res.code === 200) {
|
||||||
|
return this.getFileList(res.data);
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getFileList(detailData){
|
||||||
|
const list = detailData && Array.isArray(detailData.resourceFileVoList)
|
||||||
|
? detailData.resourceFileVoList
|
||||||
|
: [];
|
||||||
|
return list.map(item => {
|
||||||
|
return {
|
||||||
|
name: item.fileName,
|
||||||
|
filePath: item.filePath,
|
||||||
|
lsFilePath: item.lsFilePath,
|
||||||
|
fileType: item.fileType
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 文件变化
|
||||||
|
handleFileChange(file) {
|
||||||
|
console.log(file);
|
||||||
|
this.form.fileList = file;
|
||||||
|
},
|
||||||
|
// 文件删除时触发
|
||||||
|
handleDelFile(file) {
|
||||||
|
console.log(file);
|
||||||
|
const delPath = file?.response?.fileRes?.filePath || file?.filePath || null;
|
||||||
|
if (delPath) {
|
||||||
|
this.form.delFileList.push(delPath);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/*关闭弹窗 */
|
/*关闭弹窗 */
|
||||||
|
|
@ -123,10 +188,41 @@ export default {
|
||||||
this.$emit('handleQuery');
|
this.$emit('handleQuery');
|
||||||
this.handleClose();
|
this.handleClose();
|
||||||
},
|
},
|
||||||
/**验证 */
|
validate(formName) {
|
||||||
submitForm(formName) {
|
return new Promise((resolve, reject) => {
|
||||||
this.$refs[formName].validate(valid => {
|
this.$refs[formName].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
resolve(this.form) // 校验成功返回表单数据
|
||||||
|
} else {
|
||||||
|
reject(new Error('数据未填写完整'))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**验证 */
|
||||||
|
async submitForm(formName) {
|
||||||
|
try {
|
||||||
|
const data = await this.validate(formName);
|
||||||
|
// 所有校验通过,组装完整数据
|
||||||
|
let formData = {
|
||||||
|
...data,
|
||||||
|
allFiles: [
|
||||||
|
...data.fileList.map(file => JSON.parse(JSON.stringify(file))),
|
||||||
|
],
|
||||||
|
delFiles: [
|
||||||
|
...data.delFileList
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
let allFiles = formData.allFiles.map(file => {
|
||||||
|
return file?.response?.fileRes ? {
|
||||||
|
...file.response.fileRes,
|
||||||
|
} : null;
|
||||||
|
}).filter(item => item !== null);
|
||||||
|
formData.files = allFiles;
|
||||||
|
delete formData.fileList;
|
||||||
|
delete formData.delFileList;
|
||||||
|
delete formData.allFiles;
|
||||||
// 显示遮罩层
|
// 显示遮罩层
|
||||||
this.loading = this.$loading({
|
this.loading = this.$loading({
|
||||||
lock: true,
|
lock: true,
|
||||||
|
|
@ -134,35 +230,38 @@ export default {
|
||||||
background: 'rgba(0,0,0,0.5)',
|
background: 'rgba(0,0,0,0.5)',
|
||||||
target: this.$el.querySelector('.el-dialog') || document.body
|
target: this.$el.querySelector('.el-dialog') || document.body
|
||||||
})
|
})
|
||||||
let params = _.cloneDeep(this.form);
|
console.log('所有表单校验通过,完整数据:', formData)
|
||||||
if (this.isAdd === 'add') {
|
const res = await this.saveData(formData)
|
||||||
addDataClassAPI(params).then(res => {
|
|
||||||
this.loading.close();
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.handleReuslt(res);
|
this.handleReuslt(res);
|
||||||
} else {
|
} else {
|
||||||
this.$modal.msgError(res.msg);
|
this.$modal.msgError(res.msg);
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
} catch (error) {
|
||||||
this.loading.close();
|
|
||||||
this.$modal.msgError(this.errorMsg(error));
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
|
|
||||||
updateDataClassAPI(params).then(res => {
|
} finally {
|
||||||
this.loading.close();
|
this.loading.close();
|
||||||
if (res.code === 200) {
|
|
||||||
this.handleReuslt(res);
|
|
||||||
} else {
|
|
||||||
this.$modal.msgError(res.msg);
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 保存接口
|
||||||
|
async saveData(formData) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (this.isAdd === 'add') { // 新增
|
||||||
|
addDataAPI(formData).then(res => {
|
||||||
|
resolve(res)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.loading.close();
|
reject(error)
|
||||||
this.$modal.msgError(this.errorMsg(error));
|
})
|
||||||
});
|
} else { // 修改
|
||||||
|
editDataAPI(formData).then(res => {
|
||||||
|
resolve(res)
|
||||||
|
}).catch(error => {
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,16 @@ export const formLabel = [
|
||||||
isShow: false, // 是否展示label
|
isShow: false, // 是否展示label
|
||||||
f_type: 'ipt',
|
f_type: 'ipt',
|
||||||
f_label: '工器具名称',
|
f_label: '工器具名称',
|
||||||
f_model: 'userName',
|
f_model: 'toolName',
|
||||||
f_max: 32,
|
f_max: 32,
|
||||||
f_width: '250px',
|
f_width: '250px',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export const columnsList = [
|
export const columnsList = [
|
||||||
{ t_props: 'userName', t_label: '名称' },
|
{ t_props: 'toolName', t_label: '工器具名称' },
|
||||||
{ t_props: 'nickName', t_label: '规格型号' },
|
{ t_props: 'model', t_label: '规格型号' },
|
||||||
{ t_props: 'phonenumberDes', t_label: '单位' },
|
{ t_props: 'unit', t_label: '单位' },
|
||||||
{ t_props: 'phonenumberDes', t_label: '技术参数' },
|
{ t_props: 'technicalParameters', t_label: '技术参数' },
|
||||||
{ t_props: 'phonenumberDes', t_label: '主要作用' },
|
{ t_props: 'mainFunction', t_label: '主要作用' },
|
||||||
]
|
]
|
||||||
|
|
@ -8,32 +8,32 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-container">
|
<div class="table-container">
|
||||||
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="false" ref="userTableRef"
|
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="false" ref="toolTableRef"
|
||||||
:columnsList="columnsList" :request-api="listUser">
|
:columnsList="columnsList" :request-api="listAPI" :sendParams= "sendParams">
|
||||||
<template slot="tableTitle">
|
<template slot="tableTitle">
|
||||||
<h3>数据列表</h3>
|
<h3>数据列表</h3>
|
||||||
</template>
|
</template>
|
||||||
<template slot="tableActions">
|
<template slot="tableActions">
|
||||||
<el-button @click="handleAdd" v-hasPermi="['enterpriseLibrary:technical:add']"
|
<el-button @click="handleModelExport" v-hasPermi="['enterpriseLibrary:tool:add']"
|
||||||
class="add-btn">导入模板下载</el-button>
|
class="add-btn">导入模板下载</el-button>
|
||||||
<el-button @click="handleAdd" v-hasPermi="['enterpriseLibrary:technical:add']"
|
<el-button @click="handleBathchImport" v-hasPermi="['enterpriseLibrary:tool:add']"
|
||||||
class="add-btn">导入模板下载</el-button>
|
class="add-btn">批量导入</el-button>
|
||||||
<el-button @click="handleAdd" v-hasPermi="['enterpriseLibrary:technical:add']" class="add-btn"><i
|
<el-button @click="handleAdd" v-hasPermi="['enterpriseLibrary:tool:add']" class="add-btn"><i
|
||||||
class="el-icon-plus"></i> 新增工器具</el-button>
|
class="el-icon-plus"></i> 新增工器具</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template slot="deptName" slot-scope="{ data }">
|
<template slot="deptName" slot-scope="{ data }">
|
||||||
<span>{{ data.dept.deptName || '--' }}</span>
|
<span>{{ data.dept.deptName || '--' }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template slot="handle" slot-scope="{ data }">
|
<template slot="handle" slot-scope="{ data }">
|
||||||
<el-button type="text" v-hasPermi="['enterpriseLibrary:technical:detail']" class="action-btn"
|
<el-button type="text" v-hasPermi="['enterpriseLibrary:tool:detail']" class="action-btn"
|
||||||
@click="handleUpdate(data)">
|
@click="handleUpdate(data)">
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" v-hasPermi="['enterpriseLibrary:technical:edit']" class="action-btn"
|
<el-button type="text" v-hasPermi="['enterpriseLibrary:tool:edit']" class="action-btn"
|
||||||
style="color: #EAA819;" @click="handleUpdate(data)">
|
style="color: #EAA819;" @click="handleUpdate(data)">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" v-hasPermi="['enterpriseLibrary:technical:del']" class="action-btn"
|
<el-button type="text" v-hasPermi="['enterpriseLibrary:tool:del']" class="action-btn"
|
||||||
style="color: #DB3E29;" @click="handleDelete(data)">
|
style="color: #DB3E29;" @click="handleDelete(data)">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -51,10 +51,7 @@
|
||||||
import TableModel from '@/components/TableModel2'
|
import TableModel from '@/components/TableModel2'
|
||||||
import { columnsList, formLabel } from './config'
|
import { columnsList, formLabel } from './config'
|
||||||
import ToolForm from './components/ToolForm.vue'
|
import ToolForm from './components/ToolForm.vue'
|
||||||
import {
|
import { listAPI, delDataAPI } from '@/api/enterpriseLibrary/tool/tool'
|
||||||
listUser,
|
|
||||||
delUser,
|
|
||||||
} from '@/api/system/user'
|
|
||||||
import { encryptWithSM4, decryptWithSM4 } from '@/utils/sm'
|
import { encryptWithSM4, decryptWithSM4 } from '@/utils/sm'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -63,12 +60,11 @@ export default {
|
||||||
TableModel,
|
TableModel,
|
||||||
ToolForm
|
ToolForm
|
||||||
},
|
},
|
||||||
dicts: ['construction_nature', 'structural_form', 'basic_form'],
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formLabel,
|
formLabel,
|
||||||
columnsList,
|
columnsList,
|
||||||
listUser,
|
listAPI,
|
||||||
enterpriseId: decryptWithSM4(this.$route.query.enterpriseId) || '0',
|
enterpriseId: decryptWithSM4(this.$route.query.enterpriseId) || '0',
|
||||||
title: "",
|
title: "",
|
||||||
isflag: false,
|
isflag: false,
|
||||||
|
|
@ -78,16 +74,14 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
// 将字典数据填充到表单配置的下拉选项中
|
},
|
||||||
if (Array.isArray(this.formLabel)) {
|
computed:{
|
||||||
this.formLabel.forEach((item) => {
|
sendParams(){
|
||||||
if (item.f_dict && this.dict && this.dict.type && this.dict.type[item.f_dict]) {
|
return {
|
||||||
this.$set(item, 'f_selList', this.dict.type[item.f_dict])
|
enterpriseId : this.enterpriseId
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// 返回上一页
|
// 返回上一页
|
||||||
handleBack() {
|
handleBack() {
|
||||||
|
|
@ -103,7 +97,7 @@ export default {
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.title = "新增工器具";
|
this.title = "新增工器具";
|
||||||
this.isAdd = 'add';
|
this.isAdd = 'add';
|
||||||
this.row = {};
|
this.row = {enterpriseId:this.enterpriseId};
|
||||||
this.isflag = true;
|
this.isflag = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -113,34 +107,48 @@ export default {
|
||||||
this.isAdd = 'edit';
|
this.isAdd = 'edit';
|
||||||
this.row = row;
|
this.row = row;
|
||||||
this.isflag = true;
|
this.isflag = true;
|
||||||
|
},
|
||||||
|
// 批量导入
|
||||||
|
handleBathchImport(){
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
// 模板下载
|
||||||
|
handleModelExport(){
|
||||||
|
|
||||||
},
|
},
|
||||||
closeDialog() {
|
closeDialog() {
|
||||||
this.isflag = false;
|
this.isflag = false;
|
||||||
},
|
},
|
||||||
/* 搜索操作 */
|
/* 搜索操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.$refs.userTableRef.getTableList()
|
this.$refs.toolTableRef.getTableList()
|
||||||
},
|
},
|
||||||
/** 删除操作 */
|
/** 删除操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal.confirm(`是否确认删除此数据项?`).then(() => {
|
this.$confirm(`确定要删除"${raw.technicalSolutionName}"吗?删除后将无法恢复!`, '操作提示', {
|
||||||
// 显示加载遮罩
|
confirmButtonText: '确定',
|
||||||
this.$modal.loading("正在删除,请稍候...");
|
cancelButtonText: '取消',
|
||||||
delUser({ userId: row.userId }).then(res => {
|
type: 'warning',
|
||||||
this.$modal.closeLoading();
|
dangerouslyUseHTMLString: true,
|
||||||
|
customClass: 'delete-confirm-dialog'
|
||||||
|
}).then(() => {
|
||||||
|
delDataAPI(
|
||||||
|
{
|
||||||
|
toolId: raw.toolId,
|
||||||
|
enterpriseId: this.enterpriseId
|
||||||
|
}
|
||||||
|
).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$message.success('删除成功');
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
} else {
|
} else {
|
||||||
this.$modal.msgError(res.msg);
|
this.$message.error(res.msg || '删除失败');
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$modal.closeLoading();
|
console.error('删除失败:', error);
|
||||||
this.$modal.msgError(error);
|
|
||||||
});
|
|
||||||
}).catch(() => {
|
|
||||||
// 用户取消删除,不需要处理
|
|
||||||
});
|
});
|
||||||
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -203,5 +211,4 @@ export default {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue