|
|
@@ -0,0 +1,235 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span style="font-weight: bold">准入范围</span>
|
|
|
+ <span style="float: right;">
|
|
|
+ <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" v-if="canadd">添加
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <el-table :data="techList" border style="height: calc(100vh - 435px);">
|
|
|
+ <el-table-column label="操作" width="90" align="center" fixed>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="primary" plain size="mini" title="删除" style="margin-left:3px"
|
|
|
+ @click="deletedata(scope.row)" :disabled="!canadd">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="Code" label="分类编码" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="Name" label="分类名称" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="Remark" label="备注" show-overflow-tooltip></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="techDialog" top="5vh">
|
|
|
+ <el-row :gutter="20" style="height: calc(100vh - 450px); overflow: auto;">
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-tree highlight-current :expand-on-click-node="true" node-key="CodeName" :data="orgtreelist"
|
|
|
+ :props="orgtreeprops" ref="orgmanagetree" show-checkbox>
|
|
|
+ </el-tree>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="margin-top: 30px">
|
|
|
+ 备注信息:
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-input v-model="Remark" type="textarea" :rows=3 placeholder="请输入备注信息"></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="mini" @click="visible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="getChecklist()">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from 'vuex'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'GoodsList',
|
|
|
+ components: {},
|
|
|
+ props: {
|
|
|
+ canadd: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ session: 'session'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ SupplierId: 0,
|
|
|
+ SupplierTypeCode: '',
|
|
|
+ SupplierCertId: 0,
|
|
|
+
|
|
|
+ techList: [],
|
|
|
+ techDialog: false,
|
|
|
+ orgtreelist: [],
|
|
|
+ orgtreeprops: {
|
|
|
+ value: 'Id',
|
|
|
+ label: 'CodeName',
|
|
|
+ children: 'children'
|
|
|
+ },
|
|
|
+ checkList: [],
|
|
|
+ Remark: '',
|
|
|
+
|
|
|
+ visible: false,
|
|
|
+ selfVisible: this.visible, // 避免vue双向绑定警告
|
|
|
+ currentPage: 1, // 分页
|
|
|
+ size: 10,
|
|
|
+ currentItemCount: 0,
|
|
|
+ flagId: 0 //标记是否第一次点击
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getvalue(SupplierId, SupplierTypeCode, certId) {
|
|
|
+ this.SupplierId = SupplierId
|
|
|
+ this.SupplierTypeCode = SupplierTypeCode
|
|
|
+ this.SupplierCertId = certId
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ initData() {
|
|
|
+ let _this = this
|
|
|
+ const params = {
|
|
|
+ SupplierCertId: this.SupplierCertId,
|
|
|
+ SupplierTypeCode: this.SupplierTypeCode,
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size
|
|
|
+ }
|
|
|
+ this.$axios.get('suppliercertsub/list', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ _this.techList = res.data.items
|
|
|
+ _this.currentItemCount = res.data.currentItemCount
|
|
|
+ _this.$emit('close')
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getChecklist() {
|
|
|
+ let val = this.$refs.orgmanagetree.getCheckedNodes()
|
|
|
+ this.checkList = []
|
|
|
+ for (var i = 0; i < val.length; i++) {
|
|
|
+ if (val[i].Code.length == 8) {
|
|
|
+ this.checkList.push(val[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.addBusiness()
|
|
|
+ },
|
|
|
+ addBusiness() {
|
|
|
+ let _this = this
|
|
|
+ let params = {
|
|
|
+ SupplierId: parseInt(_this.SupplierId),
|
|
|
+ SupplierCertId: parseInt(_this.SupplierCertId),
|
|
|
+ SupplierTypeCode: '03',
|
|
|
+ Remark: _this.Remark
|
|
|
+ }
|
|
|
+ if (_this.checkList.length > 0) {
|
|
|
+ params = Object.assign(params, {
|
|
|
+ CheckList: _this.checkList
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '名称不能为空,请选择分类!'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log("021r--================",params)
|
|
|
+ _this.$axios.post('/suppliercertsub/addtechbus', params)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ _this.techDialog = false
|
|
|
+ _this.initData()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '操作失败!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deletedata(val) {
|
|
|
+ let _this = this
|
|
|
+ _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ _this.$axios.delete('suppliercertsub/businessdelete/' + val.Id, {})
|
|
|
+ .then(function (response) {
|
|
|
+ if (response.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: response.data.message
|
|
|
+ })
|
|
|
+ _this.initData()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: response.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(function (error) {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ },
|
|
|
+ showDialog() {
|
|
|
+ this.getorgtreelist()
|
|
|
+ this.techDialog = true
|
|
|
+ },
|
|
|
+ getorgtreelist() {
|
|
|
+ let _this = this
|
|
|
+ this.$axios.get('technologyservice/techbuslist', {})
|
|
|
+ .then(res => {
|
|
|
+ _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Code,Name,CodeName')
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSizeChange(value) {
|
|
|
+ this.size = value
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ handleCurrentChange(value) {
|
|
|
+ this.currentPage = value
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+
|
|
|
+
|
|
|
+</style>
|