|
@@ -0,0 +1,412 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <!--顶部显示-->
|
|
|
|
|
+ <el-breadcrumb class="heading">
|
|
|
|
|
+ <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
|
|
|
|
|
+ <el-breadcrumb-item>不良行为记录</el-breadcrumb-item>
|
|
|
|
|
+ </el-breadcrumb>
|
|
|
|
|
+
|
|
|
|
|
+ <!--内框顶部显示-->
|
|
|
|
|
+ <el-card class="box-card" style="height: calc(100vh - 115px);position:relative">
|
|
|
|
|
+ <div slot="header">
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <i class="icon icon-table2"></i> 不良行为记录
|
|
|
|
|
+ </span>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ :model="searchForm"
|
|
|
|
|
+ ref="searchformRef"
|
|
|
|
|
+ :inline="true"
|
|
|
|
|
+ style="float: right;position:absolute;right:75px;top:10.5px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form-item label="企业名称">
|
|
|
|
|
+ <el-input size="mini" v-model="searchForm.Companyname" placeholder="请输入内容"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="准入类别">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ style="width:150px"
|
|
|
|
|
+ v-model="searchForm.Categorycode"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option label="全部" value></el-option>
|
|
|
|
|
+ <el-option label="物资类" value="01"></el-option>
|
|
|
|
|
+ <el-option label="基建类" value="02"></el-option>
|
|
|
|
|
+ <el-option label="技术服务类" value="03"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-dropdown
|
|
|
|
|
+ split-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="initDatas($event)"
|
|
|
|
|
+ @command="searchCommand"
|
|
|
|
|
+ >
|
|
|
|
|
+ 查询
|
|
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
|
|
+ <el-dropdown-item command="clear">查询重置</el-dropdown-item>
|
|
|
|
|
+ </el-dropdown-menu>
|
|
|
|
|
+ </el-dropdown>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <span style="float: right;position:relative">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="addaudit"
|
|
|
|
|
+ style="float: right;position:absolute;right:0px"
|
|
|
|
|
+ >添加</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!--内框表格显示-->
|
|
|
|
|
+ <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%">
|
|
|
|
|
+ <!--内框表格剩余栏显示-->
|
|
|
|
|
+ <el-table-column label="企业名称" prop="Companyname"></el-table-column>
|
|
|
|
|
+ <el-table-column label="类别名称" prop="Categoryname"></el-table-column>
|
|
|
|
|
+ <el-table-column label="不良行为" prop="Record"></el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <!--内框表格操作栏显示-->
|
|
|
|
|
+ <el-table-column label="操作" min-width="35" align="center" fixed="right">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button type="primary" plain title="编辑" size="mini" @click="edit(scope.row)">编辑</el-button>
|
|
|
|
|
+ <el-button type="primary" plain title="删除" size="mini" @click="deleterow(scope.row)">删除</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 分页 -->
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
|
+ :page-sizes="[10, 15, 20, 25]"
|
|
|
|
|
+ :page-size="size"
|
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
+ :total="currentItemCount"
|
|
|
|
|
+ ></el-pagination>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 添加框(默认隐藏) -->
|
|
|
|
|
+ <el-dialog title="企业不良行为添加" :visible.sync="addshow" width="360px">
|
|
|
|
|
+ <el-form :model="entityForm" :rules="rules" ref="EntityFormref">
|
|
|
|
|
+ <!-- 第一行 -->
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="企业名称" required prop="CompanyCode">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ v-model="entityForm.CompanyCode"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in companys"
|
|
|
|
|
+ :key="item.Id"
|
|
|
|
|
+ :label="item.SupplierName"
|
|
|
|
|
+ :value="item.Id"
|
|
|
|
|
+ ></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <!-- 第二行 -->
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="准入类别" required prop="Categorycode">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ default-first-option
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ v-model="entityForm.Categorycode"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option label="物资类" value="01"></el-option>
|
|
|
|
|
+ <el-option label="基建类" value="02"></el-option>
|
|
|
|
|
+ <el-option label="技术服务类" value="03"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <!-- 第叁行 -->
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-form-item label="不良行为" required prop="Record">
|
|
|
|
|
+ <el-input type="textarea" v-model="entityForm.Record"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <span style="float: right;margin-top:-10px;">
|
|
|
|
|
+ <el-button size="small" @click="addshow = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" size="small" @click="addAnnualAudit()">确 定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 编辑框(默认隐藏) -->
|
|
|
|
|
+ <el-dialog title="企业不良行为编辑" :visible.sync="editshow" width="360px">
|
|
|
|
|
+ <el-form :model="editForm" :rules="rules" ref="EditFormref">
|
|
|
|
|
+ <!-- 第一行 -->
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="企业名称" required prop="Companyname">
|
|
|
|
|
+ <el-input v-model="editForm.Companyname" disabled></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 第二行 -->
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="准入类别" required prop="Categorycode">
|
|
|
|
|
+ <el-select style="width: 100%" v-model="editForm.Categorycode" disabled>
|
|
|
|
|
+ <el-option label="物资类" value="01"></el-option>
|
|
|
|
|
+ <el-option label="基建类" value="02"></el-option>
|
|
|
|
|
+ <el-option label="技术服务类" value="03"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 第三行 -->
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="不良记录" required prop="Record">
|
|
|
|
|
+ <el-input style="width: 100%" v-model="editForm.Record"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <span style="float: right;margin-top:-10px;">
|
|
|
|
|
+ <el-button size="small" @click="editshow = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" size="small" @click="EditSubmit()">编 辑</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import setapi from "@/api/oilsupplier/oilclassorgset";
|
|
|
|
|
+export default {
|
|
|
|
|
+ created() {
|
|
|
|
|
+ // 执行初始化方法
|
|
|
|
|
+ this.initDatas();
|
|
|
|
|
+ this.initCompany();
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ addshow: false,
|
|
|
|
|
+ editshow: false,
|
|
|
|
|
+ editId: "",
|
|
|
|
|
+ // 定义列表数据
|
|
|
|
|
+ entityList: [],
|
|
|
|
|
+ companys: [],
|
|
|
|
|
+ // 分页参数
|
|
|
|
|
+ size: 10,
|
|
|
|
|
+ currentPage: 1,
|
|
|
|
|
+ currentItemCount: 0,
|
|
|
|
|
+ entityForm: {
|
|
|
|
|
+ CompanyCode: "",
|
|
|
|
|
+ Categorycode: "",
|
|
|
|
|
+ Record: ""
|
|
|
|
|
+ },
|
|
|
|
|
+ editForm: {
|
|
|
|
|
+ Companyname: "",
|
|
|
|
|
+ Categorycode: "",
|
|
|
|
|
+ Record: ""
|
|
|
|
|
+ },
|
|
|
|
|
+ searchForm: {
|
|
|
|
|
+ Companyname: "",
|
|
|
|
|
+ Categorycode: ""
|
|
|
|
|
+ },
|
|
|
|
|
+ rules: {
|
|
|
|
|
+ CompanyCode: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: "请输入企业名称",
|
|
|
|
|
+ trigger: "change"
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ Categorycode: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: "请选择准入类别",
|
|
|
|
|
+ trigger: "change"
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ Record: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: "请填写不良记录",
|
|
|
|
|
+ trigger: "change"
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ EditSubmit() {
|
|
|
|
|
+ this.$refs["EditFormref"].validate(valid => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ setapi
|
|
|
|
|
+ .updatebadrecordbyid(this.editId, this.editForm, this.$axios)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.data.code === 0) {
|
|
|
|
|
+ this.initDatas();
|
|
|
|
|
+ this.editshow = false;
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$refs["EditFormref"].resetFields();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ console.error(err);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ edit(row) {
|
|
|
|
|
+ console.log(row);
|
|
|
|
|
+ this.editId = row.Id; //记录将更新的id
|
|
|
|
|
+ this.editshow = true; //显示界面
|
|
|
|
|
+ this.editForm.Companyname = row.Companyname; //反显名称
|
|
|
|
|
+ this.editForm.Categorycode = row.Categorycode; //返现类别名称根据value值
|
|
|
|
|
+ this.editForm.Record = row.Record; //返现类别名称根据value值
|
|
|
|
|
+ },
|
|
|
|
|
+ deleterow(row) {
|
|
|
|
|
+ console.log(row);
|
|
|
|
|
+ var id = row.Id;
|
|
|
|
|
+ this.$confirm("确定删除?", "提示", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ setapi
|
|
|
|
|
+ .deletebadrecordbyid(id, this.$axios)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.data.code === 0) {
|
|
|
|
|
+ //刷新列表
|
|
|
|
|
+ this.initDatas();
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ console.error(err);
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
|
|
+ },
|
|
|
|
|
+ //增加方法
|
|
|
|
|
+ addAnnualAudit() {
|
|
|
|
|
+ this.$refs["EntityFormref"].validate(valid => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ setapi
|
|
|
|
|
+ .addBadRecord(this.entityForm, this.$axios)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.data.code === 0) {
|
|
|
|
|
+ //刷新列表
|
|
|
|
|
+ this.initDatas();
|
|
|
|
|
+
|
|
|
|
|
+ this.addshow = false;
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$refs["EntityFormref"].resetFields();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ message: res.data.message
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ console.error(err);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ initCompany() {
|
|
|
|
|
+ setapi
|
|
|
|
|
+ .getCompany(this.$axios)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ console.log(res.data.items);
|
|
|
|
|
+ this.companys = res.data.items;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ console.error(err);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ //初始化列表方法
|
|
|
|
|
+ initDatas(event) {
|
|
|
|
|
+ console.log(event);
|
|
|
|
|
+ if (event != null) {
|
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ _size: this.size,
|
|
|
|
|
+ _currentPage: this.currentPage
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ setapi
|
|
|
|
|
+ .getBadRecordBySearch(params, this.searchForm, this.$axios)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ console.log(res.data.items);
|
|
|
|
|
+ this.entityList = res.data.items;
|
|
|
|
|
+ this.currentItemCount = res.data.currentItemCount;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ console.error(err);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ addaudit() {
|
|
|
|
|
+ this.addshow = true;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ //分页方法
|
|
|
|
|
+ handleCurrentChange(value) {
|
|
|
|
|
+ this.currentPage = value;
|
|
|
|
|
+ this.initDatas();
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSizeChange(value) {
|
|
|
|
|
+ this.size = value;
|
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
|
+ this.initDatas();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ searchCommand(command) {
|
|
|
|
|
+ if (command == "clear") {
|
|
|
|
|
+ this.clearSearch();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ clearSearch() {
|
|
|
|
|
+ this.searchForm.Companyname = "";
|
|
|
|
|
+ this.searchForm.Categorycode = "";
|
|
|
|
|
+ this.initDatas();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|
|
|
|
|
+
|