|
|
@@ -1,23 +1,39 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-card class="box-card">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
+ <div slot="header"
|
|
|
+ class="clearfix">
|
|
|
<span style="font-weight: bold">准入范围</span>
|
|
|
<span style="float: right;">
|
|
|
- <el-button style="float: right; padding: 3px 0px" type="text" @click="deletedata()" v-if="candelete">删除</el-button>
|
|
|
- <el-button style="float: right; padding: 3px 25px" type="text" @click="showDialog" v-if="canadd || newcanadd">添加</el-button>
|
|
|
+ <el-button style="float: right; padding: 3px 0px"
|
|
|
+ type="text"
|
|
|
+ @click="deletedata()"
|
|
|
+ v-if="candelete">删除</el-button>
|
|
|
+ <el-button style="float: right; padding: 3px 25px"
|
|
|
+ type="text"
|
|
|
+ @click="showDialog"
|
|
|
+ v-if="canadd || newcanadd">添加</el-button>
|
|
|
</span>
|
|
|
</div>
|
|
|
- <el-table :data="goodsList" border size="mini" height="calc(100vh - 435px)" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- width="55">
|
|
|
+ <el-table :data="goodsList"
|
|
|
+ border
|
|
|
+ size="mini"
|
|
|
+ height="calc(100vh - 435px)"
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection"
|
|
|
+ width="55">
|
|
|
</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="CertSubStatus" label="状态" show-overflow-tooltip>
|
|
|
- <template slot-scope="scope">
|
|
|
+ <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="CertSubStatus"
|
|
|
+ label="状态"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
<span v-if="scope.row.CertSubStatus=='1'"
|
|
|
style="color:#67C23A">准入</span>
|
|
|
<span v-else-if="scope.row.CertSubStatus>'1'"
|
|
|
@@ -25,42 +41,86 @@
|
|
|
<span v-else>——</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="Remark" label="备注" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="Remark"
|
|
|
+ label="备注"
|
|
|
+ show-overflow-tooltip></el-table-column>
|
|
|
|
|
|
- <el-table-column label="操作" width="90" align="center" fixed >
|
|
|
+ <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="!candelete">删除</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ plain
|
|
|
+ size="mini"
|
|
|
+ title="删除"
|
|
|
+ style="margin-left:3px"
|
|
|
+ @click="deletedata(scope.row)"
|
|
|
+ :disabled="!candelete">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
- :page-sizes="[10, 50, 100, 200, 400]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="currentItemCount">
|
|
|
+ <el-pagination @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-sizes="[10, 50, 100, 200, 400]"
|
|
|
+ :page-size="size"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="currentItemCount">
|
|
|
</el-pagination>
|
|
|
</el-card>
|
|
|
|
|
|
- <el-dialog v-loading="loading" element-loading-text="正在添加请稍后..." title="物资类业务列表" :visible.sync="goodsDialog" top="5vh">
|
|
|
- <el-tabs v-model="tabIdx" style="margin-top: -30px;">
|
|
|
- <el-tab-pane label="2018修正版" name="1">
|
|
|
+ <el-dialog v-loading="loading"
|
|
|
+ element-loading-text="正在添加请稍后..."
|
|
|
+ title="物资类业务列表"
|
|
|
+ :visible.sync="goodsDialog"
|
|
|
+ top="5vh">
|
|
|
+ <el-tabs v-model="tabIdx"
|
|
|
+ style="margin-top: -30px;">
|
|
|
+ <el-tab-pane label="2018修正版"
|
|
|
+ name="1">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-input v-if="!switchstatus" v-model="filterText" placeholder="请输入名称或代码" size="mini" style="width: 250px;"></el-input>
|
|
|
- <el-input v-if="switchstatus" v-model="searchText" placeholder="请输入名称或代码" size="mini" style="width: 250px;"></el-input>
|
|
|
- <el-button style="float: right;" type="primary" size="mini"
|
|
|
- @click="getsectreelist()" :disabled="!switchstatus">查询</el-button>
|
|
|
- <el-switch v-model="switchstatus" size="mini"></el-switch>
|
|
|
+ <el-input v-if="!switchstatus"
|
|
|
+ v-model="filterText"
|
|
|
+ placeholder="请输入名称或代码"
|
|
|
+ size="mini"
|
|
|
+ style="width: 250px;"></el-input>
|
|
|
+ <el-input v-if="switchstatus"
|
|
|
+ v-model="searchText"
|
|
|
+ placeholder="请输入名称或代码"
|
|
|
+ size="mini"
|
|
|
+ style="width: 250px;"></el-input>
|
|
|
+ <el-button style="float: right;"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="getsectreelist()"
|
|
|
+ :disabled="!switchstatus">查询</el-button>
|
|
|
+ <el-switch v-model="switchstatus"
|
|
|
+ size="mini"></el-switch>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row :gutter="20" style="height: calc(100vh - 450px); overflow: auto; margin-top:20px">
|
|
|
+ <el-row :gutter="20"
|
|
|
+ style="height: calc(100vh - 450px); overflow: auto; margin-top:20px">
|
|
|
<el-col :span="20">
|
|
|
- <el-tree v-show="!switchstatus" highlight-current :expand-on-click-node="true" node-key="CodeName"
|
|
|
- :data="orgtreelist" :props="orgtreeprops" ref="orgmanagetree" check-on-click-node
|
|
|
- show-checkbox lazy :load="getChildrens" :filter-node-method="filterNode">
|
|
|
+ <el-tree v-show="!switchstatus"
|
|
|
+ highlight-current
|
|
|
+ :expand-on-click-node="true"
|
|
|
+ node-key="CodeName"
|
|
|
+ :data="orgtreelist"
|
|
|
+ :props="orgtreeprops"
|
|
|
+ ref="orgmanagetree"
|
|
|
+ check-on-click-node
|
|
|
+ show-checkbox
|
|
|
+ lazy
|
|
|
+ :load="getChildrens"
|
|
|
+ :filter-node-method="filterNode">
|
|
|
</el-tree>
|
|
|
- <el-tree v-show="switchstatus" ref="secmanagetree"
|
|
|
+ <el-tree v-show="switchstatus"
|
|
|
+ ref="secmanagetree"
|
|
|
:data="sectreelist"
|
|
|
- show-checkbox check-on-click-node
|
|
|
+ show-checkbox
|
|
|
+ check-on-click-node
|
|
|
node-key="CodeName"
|
|
|
:props="sectreeprops">
|
|
|
</el-tree>
|
|
|
@@ -69,354 +129,477 @@
|
|
|
<el-row style="margin-top: 30px">
|
|
|
备注信息:
|
|
|
<el-col :span="24">
|
|
|
- <el-input v-model="Remark" type="textarea" :rows=3 placeholder="请输入备注信息"></el-input>
|
|
|
+ <el-input v-model="Remark"
|
|
|
+ type="textarea"
|
|
|
+ :rows=3
|
|
|
+ placeholder="请输入备注信息"></el-input>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-tab-pane>
|
|
|
|
|
|
- <el-tab-pane label="2019版" name="2">
|
|
|
- <!--<span style="float: right;" style="margin-top: 5px">
|
|
|
- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="seachdata()">查询
|
|
|
+ <el-tab-pane label="2019版"
|
|
|
+ name="2">
|
|
|
+ <span style="float: right">
|
|
|
+ <el-button type="primary"
|
|
|
+ size="mini"
|
|
|
+ style="margin-left:10px;"
|
|
|
+ @click="initData2019()">查询
|
|
|
</el-button>
|
|
|
- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="basicDialog = false">
|
|
|
+ <el-button type="primary"
|
|
|
+ size="mini"
|
|
|
+ style="margin-left:10px;"
|
|
|
+ @click="goodsDialog = false">
|
|
|
取消</el-button>
|
|
|
</span>
|
|
|
- <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
|
|
|
+ <el-form ref="form"
|
|
|
+ :inline="true"
|
|
|
+ style="float: right;margin-top:-7px">
|
|
|
<el-form-item label="业务名称">
|
|
|
- <el-input size="mini" style="width: 165px;" v-model="keyword" placeholder="请输入业务名称"></el-input>
|
|
|
+ <el-input size="mini"
|
|
|
+ style="width: 165px;"
|
|
|
+ v-model="keyword"
|
|
|
+ placeholder="请输入业务名称"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-table :data="techList" border>
|
|
|
- <el-table-column label="操作" width="70" align="center" fixed>
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" size="small" @click="getChooseCode(scope.row)">选择</el-button>
|
|
|
- </template>
|
|
|
+ <el-table :data="goodsList2019"
|
|
|
+ border
|
|
|
+ size="mini"
|
|
|
+ @selection-change="handleSelectionChangeCert">
|
|
|
+ <el-table-column type="selection"
|
|
|
+ width="55">
|
|
|
</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-column prop="Code"
|
|
|
+ label="编码"
|
|
|
+ show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="Name"
|
|
|
+ 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-pagination @size-change="handleSizeChangeCert"
|
|
|
+ @current-change="handleCurrentChangeCert"
|
|
|
+ :current-page="currentPageCert"
|
|
|
+ :page-sizes="[10, 15, 20, 25]"
|
|
|
+ :page-size="sizeCert"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="currentItemCountCert">
|
|
|
+ </el-pagination>
|
|
|
+ <el-form label-width="80px"
|
|
|
+ label-position="top">
|
|
|
+ <el-form-item label="备注信息">
|
|
|
+ <el-input size="mini"
|
|
|
+ type="textarea"
|
|
|
+ style="width:100%"
|
|
|
+ v-model="Remark1"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
- <div slot="footer" class="dialog-footer" v-if="tabIdx==1">
|
|
|
+ <div slot="footer"
|
|
|
+ class="dialog-footer"
|
|
|
+ v-if="tabIdx==1">
|
|
|
<!--<el-button size="mini" @click="visible = false">取 消</el-button>-->
|
|
|
- <el-button type="primary" size="mini" @click="getChecklist()">确 定</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="getChecklist()">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ <div slot="footer"
|
|
|
+ class="dialog-footer"
|
|
|
+ v-if="tabIdx==2">
|
|
|
+ <el-button type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="addBusiness1()">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {
|
|
|
- mapGetters
|
|
|
- } from 'vuex'
|
|
|
+import {
|
|
|
+ mapGetters
|
|
|
+} from 'vuex'
|
|
|
|
|
|
- export default {
|
|
|
- name: 'GoodsList',
|
|
|
- components: {},
|
|
|
- props: {
|
|
|
- canadd: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
+export default {
|
|
|
+ name: 'GoodsList',
|
|
|
+ components: {},
|
|
|
+ props: {
|
|
|
+ canadd: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ newcanadd: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ candelete: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.initData2019()
|
|
|
+ },
|
|
|
+ /*
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ session: 'session'
|
|
|
+ })
|
|
|
+ }, */
|
|
|
+ watch: {
|
|
|
+ filterText (val) {
|
|
|
+ this.$refs.orgmanagetree.filter(val)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ keyword: '',
|
|
|
+ Ids: [],
|
|
|
+ SupplierId: 0,
|
|
|
+ SupplierTypeCode: '',
|
|
|
+ SupplierCertId: 0,
|
|
|
+ tabIdx: '1',
|
|
|
+ sectionCert: [],
|
|
|
+ goodsList2019: [],
|
|
|
+ goodsList: [],
|
|
|
+ goodsDialog: false,
|
|
|
+ switchstatus: false,
|
|
|
+ orgtreelist: [],
|
|
|
+ sectreelist: [],
|
|
|
+ orgtreeprops: {
|
|
|
+ value: 'Id',
|
|
|
+ label: 'CodeName',
|
|
|
+ children: 'children',
|
|
|
+ isLeaf: 'Leaf',
|
|
|
+ disabled: 'disabled'
|
|
|
},
|
|
|
- newcanadd: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
+ sectreeprops: {
|
|
|
+ children: 'children',
|
|
|
+ label: 'CodeName',
|
|
|
+ disabled: 'disabled'
|
|
|
},
|
|
|
- candelete: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
+ checkList: [],
|
|
|
+ Remark: '',
|
|
|
+ Remark1: '',
|
|
|
+
|
|
|
+ filterText: '',
|
|
|
+ searchText: '',
|
|
|
+ visible: false,
|
|
|
+ selfVisible: this.visible, // 避免vue双向绑定警告
|
|
|
+ currentPage: 1, // 分页
|
|
|
+ size: 10,
|
|
|
+ currentItemCount: 0,
|
|
|
+ currentPageCert: 1, // 分页
|
|
|
+ sizeCert: 10,
|
|
|
+ currentItemCountCert: 0,
|
|
|
+ flagId: 0 // 标记是否第一次点击
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initData2019 () {
|
|
|
+ let params = {
|
|
|
+ _currentPage: this.currentPageCert,
|
|
|
+ _size: this.sizeCert,
|
|
|
+ Name: this.keyword
|
|
|
}
|
|
|
+ this.$axios.get('suppliercertsub/listCert2019', { params })
|
|
|
+ .then(res => {
|
|
|
+ this.goodsList2019 = res.data.items
|
|
|
+ this.currentItemCountCert = res.data.currentItemCount
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
},
|
|
|
- /* created() {
|
|
|
- this.initData()
|
|
|
+ changeCertSubStatus (row, column, cell, event) {
|
|
|
+ if (this.newcanadd && column.property === 'CertSubStatus') {
|
|
|
+ this.$confirm('确定更改此准入范围状态吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then((res) => {
|
|
|
+ this.$axios.get('suppliercertsub/updatestatus/' + row.Id + '/' + row.CertSubStatus + '', {}).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '更改成功'
|
|
|
+ })
|
|
|
+ this.initData()
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ }
|
|
|
},
|
|
|
- computed: {
|
|
|
- ...mapGetters({
|
|
|
- session: 'session'
|
|
|
- })
|
|
|
- }, */
|
|
|
- watch: {
|
|
|
- filterText (val) {
|
|
|
- this.$refs.orgmanagetree.filter(val)
|
|
|
+ handleSelectionChange (val) {
|
|
|
+ this.Ids = []
|
|
|
+ for (var i = 0; i < val.length; i++) {
|
|
|
+ this.Ids.push(val[i].Id)
|
|
|
}
|
|
|
},
|
|
|
- data () {
|
|
|
- return {
|
|
|
- loading: false,
|
|
|
- Ids: [],
|
|
|
- SupplierId: 0,
|
|
|
- SupplierTypeCode: '',
|
|
|
- SupplierCertId: 0,
|
|
|
- tabIdx: '1',
|
|
|
-
|
|
|
- goodsList: [],
|
|
|
- goodsDialog: false,
|
|
|
- switchstatus: false,
|
|
|
- orgtreelist: [],
|
|
|
- sectreelist: [],
|
|
|
- orgtreeprops: {
|
|
|
- value: 'Id',
|
|
|
- label: 'CodeName',
|
|
|
- children: 'children',
|
|
|
- isLeaf: 'Leaf',
|
|
|
- disabled: 'disabled'
|
|
|
- },
|
|
|
- sectreeprops: {
|
|
|
- children: 'children',
|
|
|
- label: 'CodeName',
|
|
|
- disabled: 'disabled'
|
|
|
- },
|
|
|
- checkList: [],
|
|
|
- Remark: '',
|
|
|
-
|
|
|
- filterText: '',
|
|
|
- searchText: '',
|
|
|
- visible: false,
|
|
|
- selfVisible: this.visible, // 避免vue双向绑定警告
|
|
|
- currentPage: 1, // 分页
|
|
|
- size: 10,
|
|
|
- currentItemCount: 0,
|
|
|
- flagId: 0 // 标记是否第一次点击
|
|
|
+ handleSelectionChangeCert (val) {
|
|
|
+ this.sectionCert = val
|
|
|
+ },
|
|
|
+ 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.goodsList = res.data.items
|
|
|
+ _this.currentItemCount = res.data.currentItemCount
|
|
|
+ _this.$emit('close')
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
},
|
|
|
- methods: {
|
|
|
- changeCertSubStatus (row, column, cell, event) {
|
|
|
- if (this.newcanadd && column.property === 'CertSubStatus') {
|
|
|
- this.$confirm('确定更改此准入范围状态吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then((res) => {
|
|
|
- this.$axios.get('suppliercertsub/updatestatus/' + row.Id + '/' + row.CertSubStatus + '', {}).then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '更改成功'
|
|
|
- })
|
|
|
- this.initData()
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- }).catch(() => {
|
|
|
- })
|
|
|
- } else {
|
|
|
+ getChecklist () {
|
|
|
+ let val1 = this.$refs.orgmanagetree.getCheckedNodes()
|
|
|
+ let val2 = this.$refs.secmanagetree.getCheckedNodes()
|
|
|
+ this.checkList = []
|
|
|
+ for (var i = 0; i < val1.length; i++) {
|
|
|
+ if (val1[i].Code.length == 8) {
|
|
|
+ this.checkList.push(val1[i])
|
|
|
}
|
|
|
- },
|
|
|
- handleSelectionChange (val) {
|
|
|
- this.Ids = []
|
|
|
- for (var i = 0; i < val.length; i++) {
|
|
|
- this.Ids.push(val[i].Id)
|
|
|
- }
|
|
|
- },
|
|
|
- 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
|
|
|
+ }
|
|
|
+ for (var i = 0; i < val2.length; i++) {
|
|
|
+ if (val2[i].Code.length == 8) {
|
|
|
+ this.checkList.push(val2[i])
|
|
|
}
|
|
|
- this.$axios.get('suppliercertsub/list', {
|
|
|
- params
|
|
|
+ }
|
|
|
+ this.addBusiness()
|
|
|
+ this.switchstatus = false
|
|
|
+ },
|
|
|
+ addBusiness1 () {
|
|
|
+ if (this.sectionCert.length <= 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择准入类别'
|
|
|
})
|
|
|
- .then(res => {
|
|
|
- _this.goodsList = res.data.items
|
|
|
- _this.currentItemCount = res.data.currentItemCount
|
|
|
- _this.$emit('close')
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- getChecklist () {
|
|
|
- let val1 = this.$refs.orgmanagetree.getCheckedNodes()
|
|
|
- let val2 = this.$refs.secmanagetree.getCheckedNodes()
|
|
|
- this.checkList = []
|
|
|
- for (var i = 0; i < val1.length; i++) {
|
|
|
- if (val1[i].Code.length == 8) {
|
|
|
- this.checkList.push(val1[i])
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ SupplierId: parseInt(this.SupplierId),
|
|
|
+ SupplierCertId: parseInt(this.SupplierCertId),
|
|
|
+ SupplierTypeCode: '01',
|
|
|
+ Type: '1',
|
|
|
+ CertSubStatus: '1',
|
|
|
+ Remark: this.Remark1,
|
|
|
+ CheckList: this.sectionCert
|
|
|
+ }
|
|
|
+ for (var i = 0; i < this.sectionCert.length; i++) {
|
|
|
+ this.sectionCert[i].Id = this.sectionCert[i].Id + ''
|
|
|
+ }
|
|
|
+ this.loading = true
|
|
|
+ this.$axios.post('/suppliercertsub/addgoodsbus', params)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ this.goodsDialog = false
|
|
|
+ this.loading = false
|
|
|
+ this.sectionCert = []
|
|
|
+ this.Remark1 = ''
|
|
|
+ this.initData()
|
|
|
+ this.initData2019()
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '操作失败!'
|
|
|
+ })
|
|
|
}
|
|
|
- }
|
|
|
- for (var i = 0; i < val2.length; i++) {
|
|
|
- if (val2[i].Code.length == 8) {
|
|
|
- this.checkList.push(val2[i])
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addBusiness () {
|
|
|
+ let _this = this
|
|
|
+ let params = {
|
|
|
+ SupplierId: parseInt(_this.SupplierId),
|
|
|
+ SupplierCertId: parseInt(_this.SupplierCertId),
|
|
|
+ SupplierTypeCode: '01',
|
|
|
+ Type: '1',
|
|
|
+ CertSubStatus: '1',
|
|
|
+ Remark: _this.Remark
|
|
|
+ }
|
|
|
+ if (_this.checkList.length > 0) {
|
|
|
+ params = Object.assign(params, {
|
|
|
+ CheckList: _this.checkList
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '名称不能为空,请选择分类!'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ _this.loading = true
|
|
|
+ _this.$axios.post('/suppliercertsub/addgoodsbus', params)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ _this.goodsDialog = false
|
|
|
+ _this.loading = false
|
|
|
+ _this.initData()
|
|
|
+ } else {
|
|
|
+ _this.loading = false
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '操作失败!'
|
|
|
+ })
|
|
|
}
|
|
|
- }
|
|
|
- this.addBusiness()
|
|
|
- this.switchstatus = false
|
|
|
- },
|
|
|
- addBusiness () {
|
|
|
- let _this = this
|
|
|
- let params = {
|
|
|
- SupplierId: parseInt(_this.SupplierId),
|
|
|
- SupplierCertId: parseInt(_this.SupplierCertId),
|
|
|
- SupplierTypeCode: '01',
|
|
|
- Type: '1',
|
|
|
- CertSubStatus: '1',
|
|
|
- Remark: _this.Remark
|
|
|
- }
|
|
|
- if (_this.checkList.length > 0) {
|
|
|
- params = Object.assign(params, {
|
|
|
- CheckList: _this.checkList
|
|
|
- })
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '名称不能为空,请选择分类!'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- _this.loading = true
|
|
|
- _this.$axios.post('/suppliercertsub/addgoodsbus', params)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- _this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- _this.goodsDialog = false
|
|
|
- _this.loading = false
|
|
|
- _this.initData()
|
|
|
- } else {
|
|
|
- _this.loading = false
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '操作失败!'
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- this.$refs.orgmanagetree.setCheckedKeys([])
|
|
|
- this.$refs.secmanagetree.setCheckedKeys([])
|
|
|
- this.filterText = ''
|
|
|
- this.searchText = ''
|
|
|
- },
|
|
|
- deletedata (val) {
|
|
|
- if (val != null && val != '') {
|
|
|
- this.Ids = []
|
|
|
- this.Ids.push(val.Id)
|
|
|
- }
|
|
|
-
|
|
|
- if (this.Ids.length == 0) {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '请先选择删除条目'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ this.$refs.orgmanagetree.setCheckedKeys([])
|
|
|
+ this.$refs.secmanagetree.setCheckedKeys([])
|
|
|
+ this.filterText = ''
|
|
|
+ this.searchText = ''
|
|
|
+ },
|
|
|
+ deletedata (val) {
|
|
|
+ if (val != null && val != '') {
|
|
|
+ this.Ids = []
|
|
|
+ this.Ids.push(val.Id)
|
|
|
+ }
|
|
|
|
|
|
- let _this = this
|
|
|
- _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
+ if (this.Ids.length == 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请先选择删除条目'
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- const delload = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '正在删除请稍后...'
|
|
|
- })
|
|
|
- _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {})
|
|
|
- .then(function (response) {
|
|
|
- if (response.data.code === 0) {
|
|
|
- _this.$message({
|
|
|
- type: 'success',
|
|
|
- message: response.data.message
|
|
|
- })
|
|
|
- delload.close()
|
|
|
- _this.Ids = []
|
|
|
- _this.initData()
|
|
|
- } else {
|
|
|
- delload.close()
|
|
|
- _this.Ids = []
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: response.data.message
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(function (error) {
|
|
|
- console.log(error)
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- _this.Ids = []
|
|
|
- })
|
|
|
- },
|
|
|
- showDialog () {
|
|
|
- // this.getorgtreelist()
|
|
|
- this.goodsDialog = true
|
|
|
- },
|
|
|
- getsectreelist () {
|
|
|
- let _this = this
|
|
|
- let name = _this.searchText
|
|
|
- this.$axios.get('goodsaptitude/goodsparentlist/' + name)
|
|
|
- .then(res => {
|
|
|
- _this.sectreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Code,Name,CodeName')
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ let _this = this
|
|
|
+ _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ const delload = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '正在删除请稍后...'
|
|
|
})
|
|
|
- },
|
|
|
- // 获取下一级所有分类
|
|
|
- getChildrens (val, resolve) {
|
|
|
- let Id = 0
|
|
|
- if (val.level === 0) {
|
|
|
- Id = 0
|
|
|
- } else {
|
|
|
- Id = val.data.Id
|
|
|
- }
|
|
|
- this.$axios.get('goodsaptitude/goodschildlistbypid/' + Id, {})
|
|
|
- .then(res => {
|
|
|
- if (!res.data.items || res.data.items.length <= 0) {
|
|
|
- val.isLeaf = true
|
|
|
- return resolve([])
|
|
|
- }
|
|
|
- for (let idx in res.data.items) {
|
|
|
- if (res.data.items[idx].Code.length <= 4) {
|
|
|
- res.data.items[idx].disabled = true
|
|
|
+ _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {})
|
|
|
+ .then(function (response) {
|
|
|
+ if (response.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: response.data.message
|
|
|
+ })
|
|
|
+ delload.close()
|
|
|
+ _this.Ids = []
|
|
|
+ _this.initData()
|
|
|
+ } else {
|
|
|
+ delload.close()
|
|
|
+ _this.Ids = []
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: response.data.message
|
|
|
+ })
|
|
|
}
|
|
|
- res.data.items[idx].Leaf = res.data.items[idx].Leaf === '1'
|
|
|
+ })
|
|
|
+ .catch(function (error) {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ _this.Ids = []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showDialog () {
|
|
|
+ // this.getorgtreelist()
|
|
|
+ this.goodsDialog = true
|
|
|
+ },
|
|
|
+ getsectreelist () {
|
|
|
+ let _this = this
|
|
|
+ let name = _this.searchText
|
|
|
+ this.$axios.get('goodsaptitude/goodsparentlist/' + name)
|
|
|
+ .then(res => {
|
|
|
+ _this.sectreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Code,Name,CodeName')
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取下一级所有分类
|
|
|
+ getChildrens (val, resolve) {
|
|
|
+ let Id = 0
|
|
|
+ if (val.level === 0) {
|
|
|
+ Id = 0
|
|
|
+ } else {
|
|
|
+ Id = val.data.Id
|
|
|
+ }
|
|
|
+ this.$axios.get('goodsaptitude/goodschildlistbypid/' + Id, {})
|
|
|
+ .then(res => {
|
|
|
+ if (!res.data.items || res.data.items.length <= 0) {
|
|
|
+ val.isLeaf = true
|
|
|
+ return resolve([])
|
|
|
+ }
|
|
|
+ for (let idx in res.data.items) {
|
|
|
+ if (res.data.items[idx].Code.length <= 4) {
|
|
|
+ res.data.items[idx].disabled = true
|
|
|
}
|
|
|
- return resolve(res.data.items)
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- filterNode (value, data) {
|
|
|
- if (!value) return true
|
|
|
- return data.CodeName.indexOf(value) !== -1
|
|
|
- },
|
|
|
+ res.data.items[idx].Leaf = res.data.items[idx].Leaf === '1'
|
|
|
+ }
|
|
|
+ return resolve(res.data.items)
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ filterNode (value, data) {
|
|
|
+ if (!value) return true
|
|
|
+ return data.CodeName.indexOf(value) !== -1
|
|
|
+ },
|
|
|
|
|
|
- handleSizeChange (value) {
|
|
|
- this.size = value
|
|
|
- this.currentPage = 1
|
|
|
- this.initData()
|
|
|
- },
|
|
|
- handleCurrentChange (value) {
|
|
|
- this.currentPage = value
|
|
|
- this.initData()
|
|
|
- }
|
|
|
+ handleSizeChange (value) {
|
|
|
+ this.size = value
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ handleCurrentChange (value) {
|
|
|
+ this.currentPage = value
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ handleSizeChangeCert (value) {
|
|
|
+ this.sizeCert = value
|
|
|
+ this.currentPageCert = 1
|
|
|
+ this.initData2019()
|
|
|
+ },
|
|
|
+ handleCurrentChangeCert (value) {
|
|
|
+ this.currentPageCert = value
|
|
|
+ this.initData2019()
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
-
|
|
|
-
|
|
|
</style>
|