|
|
@@ -25,13 +25,22 @@
|
|
|
<span v-if="scope.row.GoodsLevel=='2'">二级</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="是否为制造商" width="120px" v-if="SupplierTypeCode == '01'" sortable>
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag type="info" v-if="scope.row.IsManufacturer == 2">非制造商</el-tag>
|
|
|
- <el-tag type="success" v-else-if="scope.row.IsManufacturer == 1">制造商</el-tag>
|
|
|
- <span v-else>——</span>
|
|
|
- </template>
|
|
|
+ <el-table-column width="220px" align="center" v-if="SupplierTypeCode == '01'" sortable prop="IsManufacturer">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
+ <el-button-group >
|
|
|
+ <el-button type="plain" :disabled="isDisabledBtn(1)" size="mini" @click="setManufacturer(1)">制造商</el-button>
|
|
|
+ <el-button type="plain" :disabled="isDisabledBtn(2)" size="mini" @click="setManufacturer(2)">非制造商</el-button>
|
|
|
+ </el-button-group>
|
|
|
+ </template>
|
|
|
+<!-- <template slot-scope="scope">-->
|
|
|
+<!-- <el-tag type="info" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope.row)" :disabled="isDisabledBtn(1)">非制造商</el-tag>-->
|
|
|
+<!-- <el-tag type="success" v-else-if="scope.row.IsManufacturer == 1" @click="type_change(scope.row)" :disabled="isDisabledBtn(2)">制造商</el-tag>-->
|
|
|
+<!-- <span v-else>——</span>-->
|
|
|
+<!-- </template>-->
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope.row)" :disabled="isDisabledBtn(1)">非制造商</el-button>
|
|
|
+ <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope.row)" :disabled="isDisabledBtn(2)">制造商</el-button>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="CertSubStatus" label="状态" show-overflow-tooltip sortable>
|
|
|
<template slot-scope="scope">
|
|
|
@@ -135,6 +144,10 @@
|
|
|
name: 'EquipmentList',
|
|
|
components: {},
|
|
|
props: {
|
|
|
+ operType: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
canadd: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
@@ -179,6 +192,7 @@
|
|
|
loading: false,
|
|
|
Ids: [],
|
|
|
SupplierId: 0,
|
|
|
+ Status: 0,
|
|
|
SupplierTypeCode: '',
|
|
|
SupplierCertId: 0,
|
|
|
// 列表排序
|
|
|
@@ -248,6 +262,99 @@
|
|
|
this.currentPage = 1
|
|
|
this.initData()
|
|
|
},
|
|
|
+ isDisabledBtn (val) {
|
|
|
+ if (this.operType !== '制造商') {
|
|
|
+ if ((this.Status <= 0) && val === 2) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ if (this.Status <= 0) {
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setManufacturer (operTag) {
|
|
|
+ let _this = this
|
|
|
+ let message = '是否将全部准入范围改为'
|
|
|
+ if (operTag === 1) {
|
|
|
+ message += '制造商?'
|
|
|
+ } else {
|
|
|
+ message += '非制造商?'
|
|
|
+ }
|
|
|
+ _this.$confirm(message, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ const delload = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '正在设置请稍后...'
|
|
|
+ })
|
|
|
+ let postData = {
|
|
|
+ CertSubIdList: [],
|
|
|
+ SupplierId: parseInt(this.SupplierId),
|
|
|
+ SupplierCertId: parseInt(this.SupplierCertId),
|
|
|
+ IsManufacturer: operTag
|
|
|
+ }
|
|
|
+ _this.$axios.post('suppliercertsub/modify-manufacturers/' + this.SupplierCertId, postData)
|
|
|
+ .then(function (response) {
|
|
|
+ if (response.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ duration: 10000,
|
|
|
+ type: 'success',
|
|
|
+ message: response.data.message
|
|
|
+ })
|
|
|
+ delload.close()
|
|
|
+ _this.initData()
|
|
|
+ } else {
|
|
|
+ delload.close()
|
|
|
+ _this.$message({
|
|
|
+ duration: 10000,
|
|
|
+ type: 'warning',
|
|
|
+ message: response.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(function (error) {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch((ex) => {
|
|
|
+ console.error(ex)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ type_change (val) {
|
|
|
+ if (this.Status <= 0) {
|
|
|
+ let postData = {
|
|
|
+ CertSubIdList: [],
|
|
|
+ SupplierId: parseInt(this.SupplierId),
|
|
|
+ SupplierCertId: parseInt(this.SupplierCertId),
|
|
|
+ IsManufacturer: val.IsManufacturer === 1 ? 2 : 1
|
|
|
+ }
|
|
|
+ this.$axios.post('suppliercertsub/modify-manufacturer/' + val.Id, postData).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.$message({
|
|
|
+ duration: 10000,
|
|
|
+ type: 'success',
|
|
|
+ message: '更改成功'
|
|
|
+ })
|
|
|
+ this.initData()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ duration: 10000,
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
changeCertSubStatus (row, column, cell, event) {
|
|
|
if (this.newcanadd && column.property === 'CertSubStatus') {
|
|
|
this.$confirm('确定更改此准入范围状态吗?', '提示', {
|
|
|
@@ -278,12 +385,16 @@
|
|
|
this.Ids.push(val[i].Id)
|
|
|
}
|
|
|
},
|
|
|
- getvalue (SupplierId, SupplierTypeCode, certId) {
|
|
|
+ getvalue (SupplierId, SupplierTypeCode, certId, Status) {
|
|
|
this.SupplierId = SupplierId
|
|
|
this.SupplierTypeCode = SupplierTypeCode
|
|
|
this.SupplierCertId = certId
|
|
|
+ this.Status = Status
|
|
|
this.initData()
|
|
|
},
|
|
|
+ getvalue1 (Status) {
|
|
|
+ this.Status = Status
|
|
|
+ },
|
|
|
// 列表排序功能
|
|
|
orderby (column) {
|
|
|
if (column.order == 'ascending') {
|