|
@@ -92,15 +92,14 @@ export default {
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
- const initTableColumns = () => TableColumns;
|
|
|
- const initSearchColumns = () => SearchColumns;
|
|
|
+
|
|
|
return {
|
|
|
loading: false,
|
|
|
- searchColumns: initSearchColumns(),
|
|
|
+ searchColumns: SearchColumns,
|
|
|
searchParams: {
|
|
|
- ...initParams(initSearchColumns()),
|
|
|
+ ...initParams(SearchColumns),
|
|
|
},
|
|
|
- tableColumns: initTableColumns(),
|
|
|
+ tableColumns: TableColumns,
|
|
|
tableData: [],
|
|
|
checkedList: [],
|
|
|
page: {
|
|
@@ -145,10 +144,8 @@ export default {
|
|
|
handelResetSearch() {
|
|
|
|
|
|
console.log('重置');
|
|
|
-
|
|
|
- for (const key in this.searchParams) {
|
|
|
-
|
|
|
- this.searchParams[key] = '';
|
|
|
+ this.searchParams = {
|
|
|
+ ...initParams(SearchColumns),
|
|
|
}
|
|
|
},
|
|
|
// 判断状态
|
|
@@ -194,7 +191,6 @@ export default {
|
|
|
},
|
|
|
// 新增、编辑授权信息
|
|
|
handleOpenAddDialog(rows) {
|
|
|
- console.log(rows, '授权信息');
|
|
|
const { setVisible, setFormData } = this.$refs.addDialogRef;
|
|
|
setFormData(rows);
|
|
|
setVisible(true);
|
|
@@ -202,26 +198,37 @@ export default {
|
|
|
},
|
|
|
// 查看
|
|
|
handleOpenSeeDialog(rows) {
|
|
|
- console.log(rows, '编辑、查看');
|
|
|
const { setVisible, setFormData } = this.$refs.seeDialogRef;
|
|
|
setFormData(rows);
|
|
|
setVisible(true);
|
|
|
},
|
|
|
// 删除
|
|
|
- async handleDelDialog(rows) {
|
|
|
- console.log(rows, '删除');
|
|
|
+ handleDelDialog(rows) {
|
|
|
let { id } = rows;
|
|
|
- try {
|
|
|
- this.loading = true;
|
|
|
- let { code, msg } = await dealerApi.remove({ id });
|
|
|
- if (code == 200) {
|
|
|
- this.handleRefresh();
|
|
|
+
|
|
|
+ this.$confirm('此操作将删除该条数据, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ let { code, msg } = await dealerApi.remove({ id });
|
|
|
+ if (code == 200) {
|
|
|
+ this.handleRefresh();
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ } finally {
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- console.log(error);
|
|
|
- } finally {
|
|
|
- this.loading = false;
|
|
|
- }
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
},
|
|
|
// 提交
|
|
|
handleSubmit(row) {
|