|
|
@@ -0,0 +1,335 @@
|
|
|
+<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; margin-top: -5px">
|
|
|
+ <el-form-item label="企业名称">
|
|
|
+ <el-input size="mini" clearable
|
|
|
+ v-model="searchForm.SupplierName"
|
|
|
+ placeholder="请输入内容"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="工商注册号">
|
|
|
+ <el-input size="mini" clearable
|
|
|
+ v-model="searchForm.CommercialNo"
|
|
|
+ placeholder="请输入内容"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <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>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="add">添加</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!--内框表格显示-->
|
|
|
+ <el-table stripe
|
|
|
+ highlight-current-row
|
|
|
+ size="mini"
|
|
|
+ :data="entityList"
|
|
|
+ border
|
|
|
+ height="calc(100vh - 243px)"
|
|
|
+ v-loading="tableLoading"
|
|
|
+ style="width: 100%">
|
|
|
+ <!--内框表格剩余栏显示-->
|
|
|
+ <el-table-column label="操作"
|
|
|
+ align="center"
|
|
|
+ width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="primary"
|
|
|
+ plain
|
|
|
+ title="删除"
|
|
|
+ size="mini"
|
|
|
+ @click="deleterow(scope.row.Id)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="企业名称"
|
|
|
+ prop="SupplierName"
|
|
|
+ align="center"
|
|
|
+ width="260px"></el-table-column>
|
|
|
+ <el-table-column label="工商注册号"
|
|
|
+ prop="CommercialNo"
|
|
|
+ align="center"
|
|
|
+ width="260px"></el-table-column>
|
|
|
+ <el-table-column label="创建时间"
|
|
|
+ prop="CreateOn"
|
|
|
+ align="center"
|
|
|
+ width="100px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ jstimehandle(scope.row.CreateOn+'') }}
|
|
|
+ </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 label-width="90px" ref="EntityFormref">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="企业名称" :rules="{ required: true, message: '企业名称不能为空', trigger: 'change'}">
|
|
|
+ <el-select filterable v-model="SupplierId" placeholder="请选择企业" style="width: 100%">
|
|
|
+ <el-option v-for="item in dataList" :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="备注">-->
|
|
|
+<!-- <el-input v-model="appendformData.Remark" type="textarea" placeholder="请输入备注内容">-->
|
|
|
+<!-- </el-input>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- </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="addSup" :loading="addLoading">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ <br>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import api from '@/api/oilsupplier/blacklist'
|
|
|
+export default {
|
|
|
+ created () {
|
|
|
+ // 执行初始化方法
|
|
|
+ this.initDatas()
|
|
|
+ this.initCompany()
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ tableLoading: false,
|
|
|
+ addLoading: false,
|
|
|
+ addShow: false,
|
|
|
+ // 定义列表数据
|
|
|
+ entityList: [],
|
|
|
+ // 分页参数
|
|
|
+ SupplierId: '',
|
|
|
+ size: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ currentItemCount: 0,
|
|
|
+ dataList: [],
|
|
|
+ searchForm: {
|
|
|
+ SupplierName: '',
|
|
|
+ CommercialNo: ''
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ add () {
|
|
|
+ this.addShow = true
|
|
|
+ },
|
|
|
+ deleterow (id) {
|
|
|
+ this.$confirm('确定删除?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ api.deleteEntity(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(() => { })
|
|
|
+ },
|
|
|
+ addSup () {
|
|
|
+ this.addLoading = true
|
|
|
+ let params = {
|
|
|
+ SupplierId: this.SupplierId
|
|
|
+ }
|
|
|
+ api.addEntity(params, 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
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.addLoading = false
|
|
|
+ this.addShow = false
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ initCompany () {
|
|
|
+ api.getSupList(this.$axios)
|
|
|
+ .then(res => {
|
|
|
+ this.dataList = res.data.items
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 初始化列表方法
|
|
|
+ initDatas (event) {
|
|
|
+ if (event != null) {
|
|
|
+ this.currentPage = 1
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ _size: this.size,
|
|
|
+ _currentPage: this.currentPage
|
|
|
+ }
|
|
|
+ let myCreateOn = []
|
|
|
+ // 解析时间
|
|
|
+ if (this.CreateOn && this.CreateOn.length == 2) {
|
|
|
+ this.CreateOn[1].setHours(23)
|
|
|
+ this.CreateOn[1].setMinutes(59)
|
|
|
+ this.CreateOn[1].setSeconds(59)
|
|
|
+ myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
|
|
|
+ myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
|
|
|
+ }
|
|
|
+ // 查询条件
|
|
|
+ Object.assign(params, this.searchForm)
|
|
|
+ this.tableLoading = true
|
|
|
+ api.getList(myCreateOn.join(','), params, this.$axios)
|
|
|
+ .then(res => {
|
|
|
+ this.entityList = res.data.items
|
|
|
+ this.currentItemCount = res.data.currentItemCount
|
|
|
+ this.tableLoading = false
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ this.tableLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 分页方法
|
|
|
+ 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.SupplierName = ''
|
|
|
+ this.searchForm.CommercialNo = ''
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ jstimehandle (val) {
|
|
|
+ if (val === '') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '0001-01-01T00:00:00Z') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
+ return '永久'
|
|
|
+ } else {
|
|
|
+ val = val.replace('T', ' ')
|
|
|
+ return val.substring(0, 10)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ formatDateTime (date) {
|
|
|
+ var y = date.getFullYear()
|
|
|
+ var m = date.getMonth() + 1
|
|
|
+ m = m < 10 ? ('0' + m) : m
|
|
|
+ var d = date.getDate()
|
|
|
+ d = d < 10 ? ('0' + d) : d
|
|
|
+ // var h = date.getHours()
|
|
|
+ // var minute = date.getMinutes()
|
|
|
+ // minute = minute < 10 ? ('0' + minute) : minute
|
|
|
+ // return y + '-' + m + '-' + d + ' ' + h + ':' + minute
|
|
|
+ return y + '-' + m + '-' + d
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style>
|
|
|
+.box-card1 {
|
|
|
+ margin-top: 5px;
|
|
|
+}
|
|
|
+.box-card1 .el-card__header {
|
|
|
+ padding: 9px 10px;
|
|
|
+}
|
|
|
+.box-card1 .el-card__body {
|
|
|
+ padding: 5px;
|
|
|
+}
|
|
|
+.box-card1 .el-form-item {
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+.certForm .el-form-item .el-form-item__label {
|
|
|
+ padding: 0px;
|
|
|
+}
|
|
|
+</style>
|