|
|
@@ -12,24 +12,17 @@
|
|
|
<span>
|
|
|
<i class="icon icon-table2"></i> 不良行为记录
|
|
|
</span>
|
|
|
+ <span style="float: right;margin-left:8px;">
|
|
|
+ <el-button type="primary" size="mini" @click="addaudit" style="float: right; margin-left:10px;">添加</el-button>
|
|
|
+ </span>
|
|
|
|
|
|
- <el-form
|
|
|
- :model="searchForm"
|
|
|
- ref="searchformRef"
|
|
|
- :inline="true"
|
|
|
- style="float: right;position:absolute;right:75px;top:10.5px"
|
|
|
- >
|
|
|
+ <el-form :model="searchForm" ref="searchformRef" :inline="true" style="float: right; margin-top: -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-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>
|
|
|
@@ -38,13 +31,8 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
- <el-dropdown
|
|
|
- split-button
|
|
|
- type="primary"
|
|
|
- size="mini"
|
|
|
- @click="initDatas($event)"
|
|
|
- @command="searchCommand"
|
|
|
- >
|
|
|
+ <el-dropdown split-button type="primary" style="margin-left:8px;" size="mini" @click="initDatas($event)"
|
|
|
+ @command="searchCommand">
|
|
|
查询
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
<el-dropdown-item command="clear">查询重置</el-dropdown-item>
|
|
|
@@ -52,14 +40,7 @@
|
|
|
</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>
|
|
|
|
|
|
<!--内框表格显示-->
|
|
|
@@ -79,15 +60,9 @@
|
|
|
</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-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>
|
|
|
|
|
|
<!-- 添加框(默认隐藏) -->
|
|
|
@@ -97,18 +72,9 @@
|
|
|
<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 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>
|
|
|
@@ -117,12 +83,7 @@
|
|
|
<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-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>
|
|
|
@@ -190,223 +151,217 @@
|
|
|
|
|
|
|
|
|
<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: [
|
|
|
- {
|
|
|
+ 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: [
|
|
|
- {
|
|
|
+ }],
|
|
|
+ Categorycode: [{
|
|
|
required: true,
|
|
|
message: "请选择准入类别",
|
|
|
trigger: "change"
|
|
|
- }
|
|
|
- ],
|
|
|
- Record: [
|
|
|
- {
|
|
|
+ }],
|
|
|
+ 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);
|
|
|
+ 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);
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
- },
|
|
|
- //初始化列表方法
|
|
|
- initDatas(event) {
|
|
|
- console.log(event);
|
|
|
- if (event != null) {
|
|
|
- this.currentPage = 1;
|
|
|
- }
|
|
|
- let params = {
|
|
|
- _size: this.size,
|
|
|
- _currentPage: this.currentPage
|
|
|
- };
|
|
|
+ },
|
|
|
+ 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();
|
|
|
|
|
|
- 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);
|
|
|
+ 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);
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
- },
|
|
|
- addaudit() {
|
|
|
- this.addshow = true;
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
- //分页方法
|
|
|
- handleCurrentChange(value) {
|
|
|
- this.currentPage = value;
|
|
|
- this.initDatas();
|
|
|
- },
|
|
|
- handleSizeChange(value) {
|
|
|
- this.size = value;
|
|
|
- this.currentPage = 1;
|
|
|
- this.initDatas();
|
|
|
- },
|
|
|
+ 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
|
|
|
+ };
|
|
|
|
|
|
- searchCommand(command) {
|
|
|
- if (command == "clear") {
|
|
|
- this.clearSearch();
|
|
|
+ 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();
|
|
|
}
|
|
|
- },
|
|
|
- clearSearch() {
|
|
|
- this.searchForm.Companyname = "";
|
|
|
- this.searchForm.Categorycode = "";
|
|
|
- this.initDatas();
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
-</script>
|
|
|
+ };
|
|
|
|
|
|
+</script>
|