|
|
@@ -61,35 +61,40 @@
|
|
|
<!--内框表格剩余栏显示-->
|
|
|
<el-table-column label="操作"
|
|
|
align="center"
|
|
|
- width="150px">
|
|
|
+ width="180px">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary"
|
|
|
plain
|
|
|
title="删除"
|
|
|
size="mini"
|
|
|
@click="deleterow(scope.row.Id)">删除</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ plain
|
|
|
+ title="编辑"
|
|
|
+ size="mini"
|
|
|
+ @click="updateRow(scope.row.Id,scope.row.SupplierName,scope.row.CommercialNo,scope.row.Remark)">编辑</el-button>
|
|
|
+ </template>
|
|
|
+ </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-column label="企业名称"
|
|
|
prop="SupplierName"
|
|
|
align="center"
|
|
|
- width="260px"></el-table-column>
|
|
|
+ min-width="260px"></el-table-column>
|
|
|
<el-table-column label="工商注册号"
|
|
|
prop="CommercialNo"
|
|
|
align="center"
|
|
|
- width="260px"></el-table-column>
|
|
|
+ min-width="260px"></el-table-column>
|
|
|
<el-table-column label="备注"
|
|
|
prop="Remark"
|
|
|
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>
|
|
|
+ min-width="260px"></el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 分页 -->
|
|
|
@@ -102,7 +107,7 @@
|
|
|
:total="currentItemCount"></el-pagination>
|
|
|
</el-card>
|
|
|
|
|
|
- <el-dialog title="黑名单添加" :visible.sync="addShow" width="400px">
|
|
|
+ <el-dialog title="黑名单信息" :visible.sync="addShow" width="400px">
|
|
|
<el-form label-width="100px" ref="EntityForm" :rules="rules" :model="saveForm">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
@@ -161,6 +166,7 @@ export default {
|
|
|
tableLoading: false,
|
|
|
addLoading: false,
|
|
|
addShow: false,
|
|
|
+ status: false,
|
|
|
// 定义列表数据
|
|
|
entityList: [],
|
|
|
// 分页参数
|
|
|
@@ -174,6 +180,7 @@ export default {
|
|
|
CommercialNo: ''
|
|
|
},
|
|
|
saveForm: {
|
|
|
+ Id:0,
|
|
|
SupplierName: '',
|
|
|
CommercialNo: '',
|
|
|
Remark: ''
|
|
|
@@ -192,7 +199,19 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
add () {
|
|
|
+ this.saveForm.SupplierName = ""
|
|
|
+ this.saveForm.CommercialNo = ""
|
|
|
+ this.saveForm.Remark = ""
|
|
|
+ this.saveForm.Id = 0
|
|
|
+ this.addShow = true
|
|
|
+ },
|
|
|
+ updateRow (id, name, no, remark) {
|
|
|
+ this.saveForm.SupplierName = name
|
|
|
+ this.saveForm.CommercialNo = no
|
|
|
+ this.saveForm.Remark = remark
|
|
|
+ this.saveForm.Id = id
|
|
|
this.addShow = true
|
|
|
+ this.status = true
|
|
|
},
|
|
|
deleterow (id) {
|
|
|
this.$confirm('确定删除?', '提示', {
|
|
|
@@ -227,27 +246,51 @@ export default {
|
|
|
this.$refs['EntityForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.addLoading = true
|
|
|
- api.addEntity(this.saveForm, 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)
|
|
|
- })
|
|
|
+ if (this.status) {
|
|
|
+ api.updateEntity(this.saveForm.Id, this.saveForm, 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)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ api.addEntity(this.saveForm, 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)
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
return false
|
|
|
}
|
|
|
@@ -257,7 +300,6 @@ export default {
|
|
|
initCompany () {
|
|
|
api.getSupList(this.$axios)
|
|
|
.then(res => {
|
|
|
- this.dataList = res.data.items
|
|
|
})
|
|
|
.catch(err => {
|
|
|
console.error(err)
|
|
|
@@ -290,6 +332,7 @@ export default {
|
|
|
this.entityList = res.data.items
|
|
|
this.currentItemCount = res.data.currentItemCount
|
|
|
this.tableLoading = false
|
|
|
+ this.dataList = res.data.items
|
|
|
})
|
|
|
.catch(err => {
|
|
|
console.error(err)
|