标签更改

yfy
严飞永 1 month ago
parent 2302cedee6
commit ee7cca5324

@ -71,12 +71,7 @@
</el-row> </el-row>
</div> </div>
<div class="table-wrapper"> <div class="table-wrapper">
<el-table <el-table v-loading="loading" :data="postList" stripe height="100%">
v-loading="loading"
:data="postList"
stripe
height="100%"
>
<el-table-column label="序号" align="center"> <el-table-column label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
@ -91,7 +86,7 @@
width="200" width="200"
/> />
<el-table-column <el-table-column
label="统一信用代码" label="统一社会信用代码"
align="center" align="center"
prop="uscc" prop="uscc"
width="200" width="200"
@ -123,9 +118,15 @@
fixed="right" fixed="right"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="getAdd(scope.row, 'detail')" <el-button type="text" @click="getinfo(scope.row, 'detail')"
>详情</el-button >详情</el-button
> >
<el-button
type="text"
@click="getedit(scope.row, 'detail')"
style="color: #67c23a"
>编辑</el-button
>
<el-button <el-button
type="text" type="text"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
@ -151,12 +152,18 @@
:title="dialogTitle" :title="dialogTitle"
:visible.sync="dialogFormVisible" :visible.sync="dialogFormVisible"
width="50%" width="50%"
@close="handleDialogClose"
> >
<!-- 在新增/编辑弹窗的el-form中 -->
<el-form ref="form" :model="form" label-width="200px"> <el-form ref="form" :model="form" label-width="200px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="企业名称"> <el-form-item label="企业名称">
<el-input v-model="form.epname" placeholder="请输入企业名称" /> <el-input
v-model="form.epname"
placeholder="请输入企业名称"
:disabled="isDetail"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -164,17 +171,18 @@
<el-input <el-input
v-model="form.uscc" v-model="form.uscc"
placeholder="请输入统一社会信用代码" placeholder="请输入统一社会信用代码"
:disabled="isDetail"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="标签代码"> <el-form-item label="标签代码">
<el-input <el-input
v-model="form.catalogueid" v-model="form.catalogueid"
placeholder="请输入标签代码" placeholder="请输入标签代码"
:disabled="isDetail"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -183,6 +191,7 @@
<el-input <el-input
v-model="form.lablenotes" v-model="form.lablenotes"
placeholder="请输入标签注释" placeholder="请输入标签注释"
:disabled="isDetail"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -191,31 +200,43 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="标签状态"> <el-form-item label="标签状态">
<el-input v-model="form.status" placeholder="请输入标签状态" /> <el-input
v-model="form.status"
placeholder="请输入标签状态"
:disabled="isDetail"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button @click="dialogFormVisible = false">取消</el-button> <el-button @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="submitForm"></el-button> <el-button type="primary" @click="submitForm">
{{ isDetail ? "确定" : "保存" }}
</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getCybqInformationPage, getSpanById, addCybq, updateSpan,deleteSpan} from "@/api/ManageApi/index"; import {
getCybqInformationPage,
getSpanById,
addCybq,
updateSpan,
deleteSpan,
} from "@/api/ManageApi/index";
import { checkPermi, checkRole } from "@/utils/permission"; import { checkPermi, checkRole } from "@/utils/permission";
export default { export default {
dicts: ["xzfl"], dicts: ["xzfl"],
data() { data() {
return { return {
isDetail: false,
// //
dialogFormVisible: false, dialogFormVisible: false,
dialogTitle: '', dialogTitle: "",
form: { form: {
id: null, id: null,
epname: "", epname: "",
@ -229,7 +250,7 @@ export default {
codekey: "", codekey: "",
sceneid: "", sceneid: "",
status: "", status: "",
bqbjdw: "" bqbjdw: "",
}, },
// //
@ -291,63 +312,100 @@ export default {
codekey: "", codekey: "",
sceneid: "", sceneid: "",
status: "", status: "",
bqbjdw: "" bqbjdw: "",
}; };
this.dialogFormVisible = true; this.dialogFormVisible = true;
}, },
/** 获取详情 */
/** 编辑按钮点击(即“详情”) */ getinfo(row) {
getAdd(row) { this.dialogTitle = "产业标签详情";
getSpanById(row.id)
.then((response) => {
const data = response.data;
this.form = {
id: data.id,
epname: data.epname,
uscc: data.uscc,
catalogueid: data.catalogueid,
state: data.state,
yhlx: data.yhlx,
lablenotes: data.lablenotes,
status: data.status,
dw_timestamp: data.dw_timestamp,
codekey: data.codekey,
sceneid: data.sceneid,
status: data.status,
bqbjdw: data.bqbjdw,
};
//
this.isDetail = true;
this.dialogFormVisible = true;
})
.catch(() => {
this.$message.error("获取数据失败");
});
},
getedit(row) {
this.dialogTitle = "编辑产业标签"; this.dialogTitle = "编辑产业标签";
getSpanById(row.id).then(response => { getSpanById(row.id)
const data = response.data; .then((response) => {
this.form = { const data = response.data;
id: data.id, this.form = {
epname: data.epname, id: data.id,
uscc: data.uscc, epname: data.epname,
catalogueid: data.catalogueid, uscc: data.uscc,
state: data.state, catalogueid: data.catalogueid,
yhlx: data.yhlx, state: data.state,
lablenotes: data.lablenotes, yhlx: data.yhlx,
status: data.status, lablenotes: data.lablenotes,
dw_timestamp: data.dw_timestamp, status: data.status,
codekey: data.codekey, dw_timestamp: data.dw_timestamp,
sceneid: data.sceneid, codekey: data.codekey,
status: data.status, sceneid: data.sceneid,
bqbjdw: data.bqbjdw status: data.status,
}; bqbjdw: data.bqbjdw,
this.dialogFormVisible = true; };
}).catch(() => { this.dialogFormVisible = true;
this.$message.error("获取数据失败"); })
}); .catch(() => {
});
}, },
/** 提交表单(新增或修改) */ /** 提交表单(新增或修改) */
submitForm() { submitForm() {
if (this.isDetail) {
this.dialogFormVisible = false;
return;
}
const apiRequest = this.form.id ? updateSpan : addCybq; const apiRequest = this.form.id ? updateSpan : addCybq;
apiRequest(this.form) apiRequest(this.form)
.then(() => { .then(() => {
this.$message.success(this.form.id ? '更新成功' : '新增成功'); this.$message.success(this.form.id ? "更新成功" : "新增成功");
this.getList(); // this.getList(); //
this.dialogFormVisible = false; this.dialogFormVisible = false;
}) })
.catch(() => { .catch(() => {
this.$message.error(this.form.id ? '更新失败' : '新增失败'); this.$message.error(this.form.id ? "更新失败" : "新增失败");
}); });
}, },
handleDialogClose() {
this.isDetail = false;
},
/** 删除按钮点击 */ /** 删除按钮点击 */
handleDelete(row) { handleDelete(row) {
this.$confirm("是否确认删除所选数据?", "提示", { this.$confirm("是否确认删除所选数据?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning",
}).then(() => { })
deleteSpan([row.id]).then(() => { .then(() => {
this.$message.success("删除成功"); deleteSpan([row.id]).then(() => {
this.getList(); this.$message.success("删除成功");
}); this.getList();
}).catch(() => {}); });
})
.catch(() => {});
}, },
/** 搜索与重置 */ /** 搜索与重置 */
@ -368,8 +426,8 @@ export default {
status: undefined, status: undefined,
}; };
this.getList(); this.getList();
} },
} },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

Loading…
Cancel
Save