fix(产品结构化参数):增加删除
This commit is contained in:
parent
ab642017c4
commit
fb06e1a535
@ -64,6 +64,15 @@ export function doSaveParameter(obj) {
|
||||
})
|
||||
}
|
||||
|
||||
// 参数删除
|
||||
export function doDeleteParameter(obj) {
|
||||
return request({
|
||||
url: iep('/z-product-structure-parameter/doDelete'),
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
// 参数明细提交
|
||||
export function doSubmitParameter(obj) {
|
||||
return request({
|
||||
|
||||
@ -23,7 +23,13 @@
|
||||
@inputDialogSelected="itemSelected"
|
||||
></input-select-dialog>
|
||||
|
||||
<basic-container>
|
||||
<basic-container style="margin-top: -20px">
|
||||
<c-top-bar :offset="50">
|
||||
<el-button type="text" icon="el-icon-search" @click="search(true)">检索</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-button type="text" icon="el-icon-circle-close" @click="searchReset">清空</el-button>
|
||||
<el-divider style="margin-top: 0px;"></el-divider>
|
||||
</c-top-bar>
|
||||
<!-- 搜尋框 -->
|
||||
<el-form ref="searchForm" :model="searchForm" label-width="120px" label-suffix=":" :inline="true">
|
||||
<el-row>
|
||||
@ -99,11 +105,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="search(true)">检索</el-button>
|
||||
<el-button type="primary" icon="el-icon-document" size="small" @click="doSave">保存</el-button>
|
||||
<el-button type="primary" icon="el-icon-document-checked" size="small" @click="doSubmit">提交</el-button>
|
||||
<el-button type="primary" icon="el-icon-document" size="small" @click="doExport">导出</el-button>
|
||||
<el-button icon="el-icon-delete" size="small" @click="searchReset">清空</el-button>
|
||||
<el-button type="danger" icon="el-icon-delete" size="small" @click="doDelete">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@ -294,6 +299,7 @@
|
||||
import {mapGetters} from 'vuex';
|
||||
import {getStore} from '@/util/store';
|
||||
import {
|
||||
doDeleteParameter,
|
||||
doSaveParameter,
|
||||
doSubmitParameter,
|
||||
fetchItemPage,
|
||||
@ -481,6 +487,9 @@ export default {
|
||||
this.$message.error(response.data.message);
|
||||
} else {
|
||||
this.$message.success(`保存成功!`);
|
||||
// 清空编码和等级
|
||||
this.searchForm.productFormulaCode = '';
|
||||
this.searchForm.inspectionLevel = '';
|
||||
this.search(true)
|
||||
}
|
||||
}).catch(() => {
|
||||
@ -551,6 +560,37 @@ export default {
|
||||
this.downBlobFile("/iep-app/z-product-structure-parameter/exportProductStructureParameter", me.searchForm, `产品结构化参数.xlsx`);
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
doDelete() {
|
||||
let productFormulaCode = '';
|
||||
if (this.selectedRows.length === 0) {
|
||||
return this.$message.warning("请先勾选需要删除的产品结构化参数数据!");
|
||||
} else {
|
||||
for (let i = 0; i < this.selectedRows.length; i++) {
|
||||
productFormulaCode += this.selectedRows[i].productFormulaCode + ';';
|
||||
}
|
||||
}
|
||||
this.$confirm(`是否确认删除:${productFormulaCode}?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
showLoading();
|
||||
doDeleteParameter(this.selectedRows).then((response) => {
|
||||
hideLoading();
|
||||
if (response.data.code !== 0) {
|
||||
this.$message.error(response.data.message);
|
||||
} else {
|
||||
this.$message.success(`删除成功!`);
|
||||
this.search(true);
|
||||
}
|
||||
}).catch(() => {
|
||||
hideLoading();
|
||||
});
|
||||
}).catch(() => {
|
||||
hideLoading();
|
||||
});
|
||||
},
|
||||
// 清空事件
|
||||
searchReset() {
|
||||
this.searchForm = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user