|
|
@@ -28,16 +28,16 @@
|
|
|
</el-card>
|
|
|
|
|
|
<el-dialog :title="Title" :visible.sync="visible" top="5vh">
|
|
|
- <el-form ref="BusinessForm" :rules="formRules" :model="BusinessForm" label-width="100px">
|
|
|
+ <el-form ref="BusinessForm" :model="BusinessForm" label-width="100px">
|
|
|
<el-row>
|
|
|
- <el-col :span="12" v-if="SupplierTypeCode == '01' && Title == '新增准入范围'">
|
|
|
+ <!-- <el-col :span="12" v-if="SupplierTypeCode == '01' && Title == '新增准入范围'">
|
|
|
<el-form-item label="名称" prop="checkName">
|
|
|
<el-cascader ref="cascader" :options="optionsList" style="width:100%" :props="goodsProps"
|
|
|
:show-all-levels="false" v-model="selectedOptList" @active-item-change="getChildrens"
|
|
|
@change="getGoodsCode" placeholder="请选择分类">
|
|
|
</el-cascader>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
<el-col :span="12" v-if="SupplierTypeCode == '02' && Title == '新增准入范围'">
|
|
|
<el-form-item label="名称" required>
|
|
|
<el-input placeholder="请选择名称" v-model="BusinessForm.Name" style="width:100%">
|
|
|
@@ -46,12 +46,12 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12" v-if="SupplierTypeCode == '03' && Title == '新增准入范围'">
|
|
|
+ <!-- <el-col :span="12" v-if="SupplierTypeCode == '03' && Title == '新增准入范围'">
|
|
|
<el-form-item label="名称" required>
|
|
|
<el-cascader :options="techTreeList" :props="orgtreeprops" change-on-select :show-all-levels="false"
|
|
|
v-model="selectedorg" placeholder="请选择菜单" @change="getCode()" style="width:100%"></el-cascader>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
<el-col :span="12" v-if="Title == '编辑准入范围'">
|
|
|
<el-form-item label="名称">
|
|
|
<el-input v-model="BusinessForm.Name" placeholder="请输入名称" disabled></el-input>
|
|
|
@@ -71,7 +71,7 @@
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer" style="margin-top:-30px;">
|
|
|
<el-button @click="visible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="savedata()">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="addBasicBus()">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
@@ -143,31 +143,31 @@
|
|
|
|
|
|
businessList: [],
|
|
|
techList: [],
|
|
|
- techTreeList: [],
|
|
|
- orgtreeprops: {
|
|
|
- value: 'id',
|
|
|
- label: 'Name',
|
|
|
- children: 'children'
|
|
|
- },
|
|
|
- selectedorg: [],
|
|
|
+ // techTreeList: [],
|
|
|
+ // orgtreeprops: {
|
|
|
+ // value: 'id',
|
|
|
+ // label: 'Name',
|
|
|
+ // children: 'children'
|
|
|
+ // },
|
|
|
+ // selectedorg: [],
|
|
|
ClassId: '',
|
|
|
|
|
|
//物资类懒加载
|
|
|
- optionsList: [], //物资类层级列表
|
|
|
- selectedOptList: [], //已选择的物资类列表
|
|
|
- goodsProps: {
|
|
|
- value: 'id',
|
|
|
- label: 'Name',
|
|
|
- children: 'children'
|
|
|
- },
|
|
|
+ // optionsList: [], //物资类层级列表
|
|
|
+ // selectedOptList: [], //已选择的物资类列表
|
|
|
+ // goodsProps: {
|
|
|
+ // value: 'id',
|
|
|
+ // label: 'Name',
|
|
|
+ // children: 'children'
|
|
|
+ // },
|
|
|
//物资类表单规则
|
|
|
- formRules: {
|
|
|
- checkName: [{
|
|
|
- required: true,
|
|
|
- validator: CheckSelectedOption,
|
|
|
- trigger: 'blur'
|
|
|
- }],
|
|
|
- },
|
|
|
+ // formRules: {
|
|
|
+ // checkName: [{
|
|
|
+ // required: true,
|
|
|
+ // validator: CheckSelectedOption,
|
|
|
+ // trigger: 'blur'
|
|
|
+ // }],
|
|
|
+ // },
|
|
|
|
|
|
Title: '',
|
|
|
BusinessForm: {
|
|
|
@@ -221,56 +221,56 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- savedata() {
|
|
|
- if (this.Title === '新增准入范围') {
|
|
|
- if (this.BusinessForm.SupplierTypeCode == '01') {
|
|
|
- this.addGoodsBus()
|
|
|
- } else if (this.BusinessForm.SupplierTypeCode == '02') {
|
|
|
- this.addBasicBus()
|
|
|
- } else {
|
|
|
- this.addBusiness()
|
|
|
- }
|
|
|
- } else if (this.Title === '编辑准入范围') {
|
|
|
- this.editBusiness()
|
|
|
- }
|
|
|
- },
|
|
|
- addGoodsBus() {
|
|
|
- let _this = this
|
|
|
- let arr = []
|
|
|
- arr = _this.$refs['cascader'].currentLabels
|
|
|
- _this.BusinessForm.Name = arr[arr.length - 1]
|
|
|
- _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
|
|
|
- _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
|
|
|
- _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
|
|
|
- //因为表单验证不能用,所以采用提示验证
|
|
|
- if (_this.selectedOptList.length < 1) {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '名称不能为空,请选择分类!'
|
|
|
- })
|
|
|
- } else {
|
|
|
- _this.$axios.post('/suppliercertsub/addbusiness/', _this.BusinessForm)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- _this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- _this.BusinessForm.Id = res.data.item + ''
|
|
|
- _this.visible = false
|
|
|
- _this.initData()
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
+ // savedata() {
|
|
|
+ // if (this.Title === '新增准入范围') {
|
|
|
+ // if (this.BusinessForm.SupplierTypeCode == '01') {
|
|
|
+ // this.addGoodsBus()
|
|
|
+ // } else if (this.BusinessForm.SupplierTypeCode == '02') {
|
|
|
+ // this.addBasicBus()
|
|
|
+ // } else {
|
|
|
+ // this.addBusiness()
|
|
|
+ // }
|
|
|
+ // } else if (this.Title === '编辑准入范围') {
|
|
|
+ // this.editBusiness()
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // addGoodsBus() {
|
|
|
+ // let _this = this
|
|
|
+ // let arr = []
|
|
|
+ // arr = _this.$refs['cascader'].currentLabels
|
|
|
+ // _this.BusinessForm.Name = arr[arr.length - 1]
|
|
|
+ // _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
|
|
|
+ // _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
|
|
|
+ // _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
|
|
|
+ // //因为表单验证不能用,所以采用提示验证
|
|
|
+ // if (_this.selectedOptList.length < 1) {
|
|
|
+ // _this.$message({
|
|
|
+ // type: 'warning',
|
|
|
+ // message: '名称不能为空,请选择分类!'
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // _this.$axios.post('/suppliercertsub/addbusiness/', _this.BusinessForm)
|
|
|
+ // .then(res => {
|
|
|
+ // if (res.data.code === 0) {
|
|
|
+ // _this.$message({
|
|
|
+ // type: 'success',
|
|
|
+ // message: res.data.message
|
|
|
+ // })
|
|
|
+ // _this.BusinessForm.Id = res.data.item + ''
|
|
|
+ // _this.visible = false
|
|
|
+ // _this.initData()
|
|
|
+ // } else {
|
|
|
+ // _this.$message({
|
|
|
+ // type: 'warning',
|
|
|
+ // message: res.data.message
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(err => {
|
|
|
+ // console.error(err)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // },
|
|
|
addBasicBus() {
|
|
|
let _this = this
|
|
|
_this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
|
|
|
@@ -297,40 +297,40 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- addBusiness() {
|
|
|
- let _this = this
|
|
|
- _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
|
|
|
- _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
|
|
|
- _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
|
|
|
- //因为表单验证不能用,所以采用提示验证
|
|
|
- if (_this.selectedorg.length < 1) {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '名称不能为空,请选择分类!'
|
|
|
- })
|
|
|
- } else {
|
|
|
- _this.$axios.post('/suppliercertsub/addbusiness/', _this.BusinessForm)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- _this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- _this.BusinessForm.Id = res.data.item + ''
|
|
|
- _this.visible = false
|
|
|
- _this.initData()
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
+ // addBusiness() {
|
|
|
+ // let _this = this
|
|
|
+ // _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
|
|
|
+ // _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
|
|
|
+ // _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
|
|
|
+ // //因为表单验证不能用,所以采用提示验证
|
|
|
+ // if (_this.selectedorg.length < 1) {
|
|
|
+ // _this.$message({
|
|
|
+ // type: 'warning',
|
|
|
+ // message: '名称不能为空,请选择分类!'
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // _this.$axios.post('/suppliercertsub/addbusiness/', _this.BusinessForm)
|
|
|
+ // .then(res => {
|
|
|
+ // if (res.data.code === 0) {
|
|
|
+ // _this.$message({
|
|
|
+ // type: 'success',
|
|
|
+ // message: res.data.message
|
|
|
+ // })
|
|
|
+ // _this.BusinessForm.Id = res.data.item + ''
|
|
|
+ // _this.visible = false
|
|
|
+ // _this.initData()
|
|
|
+ // } else {
|
|
|
+ // _this.$message({
|
|
|
+ // type: 'warning',
|
|
|
+ // message: res.data.message
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(err => {
|
|
|
+ // console.error(err)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // },
|
|
|
// editBusiness() {
|
|
|
// let _this = this
|
|
|
// _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
|
|
|
@@ -419,18 +419,18 @@
|
|
|
// },
|
|
|
getbusiness() {
|
|
|
let _this = this
|
|
|
- if (_this.SupplierTypeCode === '01') { // 获取物资类第一级分类
|
|
|
- this.$axios.get('goodsaptitude/goodsparentlist', {})
|
|
|
- .then(res => {
|
|
|
- _this.optionsList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
|
|
|
- _this.optionsList.forEach((item, index) => {
|
|
|
- _this.$set(this.optionsList[index], 'children', [])
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- } else if (_this.SupplierTypeCode === '02') { // 获取基建类业务列表
|
|
|
+ // if (_this.SupplierTypeCode === '01') { // 获取物资类第一级分类
|
|
|
+ // this.$axios.get('goodsaptitude/goodsparentlist', {})
|
|
|
+ // .then(res => {
|
|
|
+ // _this.optionsList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
|
|
|
+ // _this.optionsList.forEach((item, index) => {
|
|
|
+ // _this.$set(this.optionsList[index], 'children', [])
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // .catch(err => {
|
|
|
+ // console.error(err)
|
|
|
+ // })
|
|
|
+ // } else if (_this.SupplierTypeCode === '02') { // 获取基建类业务列表
|
|
|
const params = {
|
|
|
keyword: this.keyword,
|
|
|
_currentPage: this.CurrentPage,
|
|
|
@@ -446,16 +446,16 @@
|
|
|
.catch(err => {
|
|
|
console.error(err)
|
|
|
})
|
|
|
- } else if (_this.SupplierTypeCode === '03') { // 获取技术服务类业务列表
|
|
|
- this.$axios.get('technologyservice/businesslist', {})
|
|
|
- .then(res => {
|
|
|
- _this.techList = res.data.items
|
|
|
- _this.techTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- }
|
|
|
+ // } else if (_this.SupplierTypeCode === '03') { // 获取技术服务类业务列表
|
|
|
+ // this.$axios.get('technologyservice/businesslist', {})
|
|
|
+ // .then(res => {
|
|
|
+ // _this.techList = res.data.items
|
|
|
+ // _this.techTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
|
|
|
+ // })
|
|
|
+ // .catch(err => {
|
|
|
+ // console.error(err)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
},
|
|
|
//获取下一级所有分类
|
|
|
getChildrens(val) {
|
|
|
@@ -509,16 +509,16 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- getCode() {
|
|
|
- this.ClassId = this.selectedorg[this.selectedorg.length - 1]
|
|
|
- for (var i = 0; i < this.techList.length; i++) {
|
|
|
- if (this.selectedorg[this.selectedorg.length - 1] === this.techList[i].Id) {
|
|
|
- this.BusinessForm.SubClassId = this.techList[i].Id
|
|
|
- this.BusinessForm.Name = this.techList[i].Name
|
|
|
- this.BusinessForm.Code = this.techList[i].Code
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
+ // getCode() {
|
|
|
+ // this.ClassId = this.selectedorg[this.selectedorg.length - 1]
|
|
|
+ // for (var i = 0; i < this.techList.length; i++) {
|
|
|
+ // if (this.selectedorg[this.selectedorg.length - 1] === this.techList[i].Id) {
|
|
|
+ // this.BusinessForm.SubClassId = this.techList[i].Id
|
|
|
+ // this.BusinessForm.Name = this.techList[i].Name
|
|
|
+ // this.BusinessForm.Code = this.techList[i].Code
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
getChooseCode(val) {
|
|
|
this.ClassId = val.Id
|
|
|
this.BusinessForm.SubClassId = val.Id
|