|
@@ -3,26 +3,26 @@
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
<!-- 左侧字典列表 -->
|
|
<!-- 左侧字典列表 -->
|
|
<a-col :span="6">
|
|
<a-col :span="6">
|
|
- <a-row :gutter="24">
|
|
|
|
- <!-- <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addCode">添加字典</a-button> -->
|
|
|
|
- <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="editCode">编辑字典</a-button>
|
|
|
|
- <!-- <a-select style="width: 110px" placeholder="更多操作" allowClear >
|
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
+ <!-- <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addCode">添加字典</a-button> -->
|
|
|
|
+ <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="editCode">编辑字典</a-button>
|
|
|
|
+ <!-- <a-select style="width: 110px" placeholder="更多操作" allowClear >
|
|
<a-select-option @click="editCode" value="编辑字典">编辑字典</a-select-option>
|
|
<a-select-option @click="editCode" value="编辑字典">编辑字典</a-select-option>
|
|
<a-select-option @click="delectCode" value="删除字典">删除字典</a-select-option>
|
|
<a-select-option @click="delectCode" value="删除字典">删除字典</a-select-option>
|
|
- </a-select> -->
|
|
|
|
|
|
+ </a-select> -->
|
|
</a-row>
|
|
</a-row>
|
|
- <a-row :gutter="24" class="textCount">
|
|
|
|
|
|
+ <a-row :gutter="24" class="textCount">
|
|
<a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
|
|
<a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
|
|
- <span>当前选择:<span style="color: #40a9ff;font-weight: 600;">{{selectedMenu}}</span><span v-if="selectedKey.length" class="imgSize" @click="cancelSel">取消选择</span></span>
|
|
|
|
|
|
+ <span>当前选择:<span style="color: #40a9ff;font-weight: 600;">{{ selectedMenu }}</span><span v-if="selectedKey.length" class="imgSize" @click="cancelSel">取消选择</span></span>
|
|
</a-row>
|
|
</a-row>
|
|
<a-row :gutter="24" >
|
|
<a-row :gutter="24" >
|
|
<a-input-search v-model="code" placeholder="输入编码类别/名称 搜索字典" style="width: 100%" @search="getCodeList" />
|
|
<a-input-search v-model="code" placeholder="输入编码类别/名称 搜索字典" style="width: 100%" @search="getCodeList" />
|
|
</a-row>
|
|
</a-row>
|
|
<a-row :gutter="24" >
|
|
<a-row :gutter="24" >
|
|
- <a-menu class="menu-box" style="border-right: 0;max-height: 650px;overflow: auto;" v-model="selectedKey" >
|
|
|
|
- <a-menu-item style="margin-bottom: 0px;height: 30px; line-height: 30px;" v-for="(item,index) in codeList" :key="index" :value="item">{{item.name}}</a-menu-item>
|
|
|
|
- </a-menu>
|
|
|
|
- <span v-if="noData" style="line-height: 50px; font-weight: 600;">暂无数据</span>
|
|
|
|
|
|
+ <a-menu class="menu-box" style="border-right: 0;max-height: 650px;overflow: auto;" v-model="selectedKey" >
|
|
|
|
+ <a-menu-item style="margin-bottom: 0px;height: 30px; line-height: 30px;" v-for="(item,index) in codeList" :key="index" :value="item">{{ item.name }}</a-menu-item>
|
|
|
|
+ </a-menu>
|
|
|
|
+ <span v-if="noData" style="line-height: 50px; font-weight: 600;">暂无数据</span>
|
|
</a-row>
|
|
</a-row>
|
|
</a-col>
|
|
</a-col>
|
|
<!-- 右侧数据列表 -->
|
|
<!-- 右侧数据列表 -->
|
|
@@ -36,16 +36,18 @@
|
|
<a-input allowClear v-model="queryParam.dispName" placeholder="请输入数据名称"/>
|
|
<a-input allowClear v-model="queryParam.dispName" placeholder="请输入数据名称"/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
-
|
|
|
|
|
|
+
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="状态">
|
|
<a-form-item label="状态">
|
|
- <a-select allowClear v-model="queryParam.isEnable"
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
|
+ <a-select
|
|
|
|
+ allowClear
|
|
|
|
+ v-model="queryParam.isEnable"
|
|
|
|
+ placeholder="请选择"
|
|
>
|
|
>
|
|
- <a-select-option :value = '1'>
|
|
|
|
|
|
+ <a-select-option :value="1">
|
|
是
|
|
是
|
|
</a-select-option>
|
|
</a-select-option>
|
|
- <a-select-option :value = '0'>
|
|
|
|
|
|
+ <a-select-option :value="0">
|
|
否
|
|
否
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
@@ -67,7 +69,7 @@
|
|
<!-- <a-button type="" icon="delete" @click="delectAll">批量删除</a-button> -->
|
|
<!-- <a-button type="" icon="delete" @click="delectAll">批量删除</a-button> -->
|
|
<a-button type="" icon="reload" @click="$refs.table.refresh(true)">刷新数据</a-button>
|
|
<a-button type="" icon="reload" @click="$refs.table.refresh(true)">刷新数据</a-button>
|
|
</div>
|
|
</div>
|
|
- <!-- <div class="textCount">
|
|
|
|
|
|
+ <!-- <div class="textCount">
|
|
<a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
|
|
<a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
|
|
<span>已选择<span style="color: #40a9ff;font-weight: 600;margin-left: 10px;">{{selectedNum}}项</span><span class="imgSize">清空</span></span>
|
|
<span>已选择<span style="color: #40a9ff;font-weight: 600;margin-left: 10px;">{{selectedNum}}项</span><span class="imgSize">清空</span></span>
|
|
</div> -->
|
|
</div> -->
|
|
@@ -78,7 +80,7 @@
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
bordered
|
|
bordered
|
|
- >
|
|
|
|
|
|
+ >
|
|
<span slot="action" slot-scope="text, record">
|
|
<span slot="action" slot-scope="text, record">
|
|
<template>
|
|
<template>
|
|
<a class="action-button" @click="handleEdit(record)">修改</a>
|
|
<a class="action-button" @click="handleEdit(record)">修改</a>
|
|
@@ -87,7 +89,7 @@
|
|
</span>
|
|
</span>
|
|
</s-table>
|
|
</s-table>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
|
|
+
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
<codeModal :visible="showCodeModal" :data="codeData" @refresh="getCodeList" @close="showCodeModal = false"></codeModal>
|
|
<codeModal :visible="showCodeModal" :data="codeData" @refresh="getCodeList" @close="showCodeModal = false"></codeModal>
|
|
@@ -96,272 +98,262 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- import { STable, VSelect } from '@/components'
|
|
|
|
- import codeModal from './codeModal.vue'
|
|
|
|
- import codeItemModal from './codeItemModal.vue'
|
|
|
|
- import { listLookUp, delLookUp, getLookUpItem, delLookUpItem } from '@/api/lookup.js'
|
|
|
|
- export default {
|
|
|
|
- name: 'dataDictionary',
|
|
|
|
- components: {
|
|
|
|
- STable, VSelect, codeModal, codeItemModal
|
|
|
|
- },
|
|
|
|
- props: {},
|
|
|
|
- data () {
|
|
|
|
- // const rowSelection = {
|
|
|
|
- // onChange: (selectedRowKeys, selectedRows) => {
|
|
|
|
- // console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
|
|
|
|
- // },
|
|
|
|
- // onSelect: (record, selected, selectedRows) => {
|
|
|
|
- // this.selectedNum = selectedRows.length
|
|
|
|
- // console.log(record,'record')
|
|
|
|
- // console.log(selectedRows,'selectedRows')
|
|
|
|
- // },
|
|
|
|
- // onSelectAll: (selected, selectedRows, changeRows) => {
|
|
|
|
- // this.selectedNum = selectedRows.length
|
|
|
|
- // console.log(selected, selectedRows, changeRows)
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- return {
|
|
|
|
- // 查询参数
|
|
|
|
- queryParam: {
|
|
|
|
- dispName: '',
|
|
|
|
- isEnable: undefined,
|
|
|
|
- lookupCode: ''
|
|
|
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
|
+import codeModal from './codeModal.vue'
|
|
|
|
+import codeItemModal from './codeItemModal.vue'
|
|
|
|
+import { listLookUp, delLookUp, getLookUpItem, delLookUpItem } from '@/api/lookup.js'
|
|
|
|
+export default {
|
|
|
|
+ name: 'DataDictionary',
|
|
|
|
+ components: {
|
|
|
|
+ STable, VSelect, codeModal, codeItemModal
|
|
|
|
+ },
|
|
|
|
+ props: {},
|
|
|
|
+ data () {
|
|
|
|
+ // const rowSelection = {
|
|
|
|
+ // onChange: (selectedRowKeys, selectedRows) => {
|
|
|
|
+ // console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
|
|
|
|
+ // },
|
|
|
|
+ // onSelect: (record, selected, selectedRows) => {
|
|
|
|
+ // this.selectedNum = selectedRows.length
|
|
|
|
+ // console.log(record,'record')
|
|
|
|
+ // console.log(selectedRows,'selectedRows')
|
|
|
|
+ // },
|
|
|
|
+ // onSelectAll: (selected, selectedRows, changeRows) => {
|
|
|
|
+ // this.selectedNum = selectedRows.length
|
|
|
|
+ // console.log(selected, selectedRows, changeRows)
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ return {
|
|
|
|
+ // 查询参数
|
|
|
|
+ queryParam: {
|
|
|
|
+ dispName: '',
|
|
|
|
+ isEnable: undefined,
|
|
|
|
+ lookupCode: ''
|
|
|
|
+ },
|
|
|
|
+ noData: false,
|
|
|
|
+ code: '', // 根据输入编码类别/名称搜索字典
|
|
|
|
+ selectedNum: '',
|
|
|
|
+ selectedKey: [], // 选中的字典编码项
|
|
|
|
+ selectedMenu: '',
|
|
|
|
+ formLayout: 'horizontal',
|
|
|
|
+ form: this.$form.createForm(this, { name: 'miniForm' }),
|
|
|
|
+ codeList: [],
|
|
|
|
+ showCodeModal: false,
|
|
|
|
+ showItemCodeModal: false,
|
|
|
|
+ codeData: {}, // 编辑字典行数据
|
|
|
|
+ itemCodeData: {},
|
|
|
|
+ // 表头
|
|
|
|
+ columns: [
|
|
|
|
+ {
|
|
|
|
+ title: '序号',
|
|
|
|
+ dataIndex: 'no',
|
|
|
|
+ width: '40',
|
|
|
|
+ align: 'center'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '名称',
|
|
|
|
+ dataIndex: 'dispName',
|
|
|
|
+ width: '100',
|
|
|
|
+ align: 'center'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '项编码',
|
|
|
|
+ dataIndex: 'code',
|
|
|
|
+ width: '100',
|
|
|
|
+ align: 'center'
|
|
},
|
|
},
|
|
- noData: false,
|
|
|
|
- code: '', // 根据输入编码类别/名称搜索字典
|
|
|
|
- selectedNum: '',
|
|
|
|
- selectedKey: [], // 选中的字典编码项
|
|
|
|
- selectedMenu: '',
|
|
|
|
- formLayout: 'horizontal',
|
|
|
|
- form: this.$form.createForm(this, { name: 'miniForm' }),
|
|
|
|
- codeList: [],
|
|
|
|
- showCodeModal: false,
|
|
|
|
- showItemCodeModal: false,
|
|
|
|
- codeData: {}, // 编辑字典行数据
|
|
|
|
- itemCodeData: {},
|
|
|
|
- // 表头
|
|
|
|
- columns: [
|
|
|
|
- {
|
|
|
|
- title: '序号',
|
|
|
|
- dataIndex: 'no',
|
|
|
|
- width: '40',
|
|
|
|
- align: 'center'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '名称',
|
|
|
|
- dataIndex: 'dispName',
|
|
|
|
- width: '100',
|
|
|
|
- align: 'center'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '项编码',
|
|
|
|
- dataIndex: 'code',
|
|
|
|
- width: '100',
|
|
|
|
- align: 'center'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '排序值',
|
|
|
|
- dataIndex: 'sort',
|
|
|
|
- width: '100',
|
|
|
|
- align: 'center'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '是否启用',
|
|
|
|
- width: '100',
|
|
|
|
- align: 'center',
|
|
|
|
- dataIndex: 'isEnable',
|
|
|
|
- customRender: function(text) {
|
|
|
|
- if (text == 1) {
|
|
|
|
- return '启用'
|
|
|
|
- } else {
|
|
|
|
- return '禁用'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '创建时间',
|
|
|
|
- dataIndex: 'createDate',
|
|
|
|
- width: '120',
|
|
|
|
- align: 'center'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '备注',
|
|
|
|
- dataIndex: 'remarks',
|
|
|
|
- width: '100',
|
|
|
|
- align: 'center'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '操作',
|
|
|
|
- width: '100',
|
|
|
|
- align: 'center',
|
|
|
|
- scopedSlots: { customRender: 'action' }
|
|
|
|
|
|
+ {
|
|
|
|
+ title: '排序值',
|
|
|
|
+ dataIndex: 'sort',
|
|
|
|
+ width: '100',
|
|
|
|
+ align: 'center'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '是否启用',
|
|
|
|
+ width: '100',
|
|
|
|
+ align: 'center',
|
|
|
|
+ dataIndex: 'isEnable',
|
|
|
|
+ customRender: function (text) {
|
|
|
|
+ if (text == 1) {
|
|
|
|
+ return '启用'
|
|
|
|
+ } else {
|
|
|
|
+ return '禁用'
|
|
}
|
|
}
|
|
- ],
|
|
|
|
- // 加载数据方法 必须为 Promise 对象
|
|
|
|
- loadData: parameter => {
|
|
|
|
- console.log(parameter, 'parameter')
|
|
|
|
-
|
|
|
|
- return getLookUpItem(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
|
- const no = (res.data.pageNo - 1) * res.data.pageSize
|
|
|
|
- for (let i = 0; i < res.data.list.length; i++) {
|
|
|
|
- const _item = res.data.list[i]
|
|
|
|
- _item.no = no + i + 1
|
|
|
|
- _item.isEnable = _item.isEnable + '' === '1'
|
|
|
|
- }
|
|
|
|
- return res.data
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- optionAlertShow: false
|
|
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '创建时间',
|
|
|
|
+ dataIndex: 'createDate',
|
|
|
|
+ width: '120',
|
|
|
|
+ align: 'center'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '备注',
|
|
|
|
+ dataIndex: 'remarks',
|
|
|
|
+ width: '100',
|
|
|
|
+ align: 'center'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '操作',
|
|
|
|
+ width: '100',
|
|
|
|
+ align: 'center',
|
|
|
|
+ scopedSlots: { customRender: 'action' }
|
|
}
|
|
}
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
-
|
|
|
|
- // 获取字典列表
|
|
|
|
- getCodeList () {
|
|
|
|
- console.log({code:this.code})
|
|
|
|
- listLookUp({code:this.code}).then(res => {
|
|
|
|
- console.log(res, 'res1111111')
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.codeList = res.data
|
|
|
|
- this.noData = false
|
|
|
|
- if (!res.data.length) {
|
|
|
|
- this.noData = true
|
|
|
|
- }
|
|
|
|
|
|
+ ],
|
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
|
+ loadData: parameter => {
|
|
|
|
+ return getLookUpItem(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
|
+ const no = (res.data.pageNo - 1) * res.data.pageSize
|
|
|
|
+ for (let i = 0; i < res.data.list.length; i++) {
|
|
|
|
+ const _item = res.data.list[i]
|
|
|
|
+ _item.no = no + i + 1
|
|
|
|
+ _item.isEnable = _item.isEnable + '' === '1'
|
|
}
|
|
}
|
|
|
|
+ return res.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 添加字典
|
|
|
|
- addCode () {
|
|
|
|
- this.showCodeModal = true
|
|
|
|
- this.codeData = {}
|
|
|
|
- },
|
|
|
|
- // 编辑字典
|
|
|
|
- editCode () {
|
|
|
|
- if (!this.selectedKey.length) {
|
|
|
|
- return this.$message.warning('您还未选择要编辑的字典');
|
|
|
|
- }
|
|
|
|
- this.showCodeModal = true
|
|
|
|
- this.codeData = this.codeList[this.selectedKey]
|
|
|
|
- },
|
|
|
|
- // 删除字典
|
|
|
|
- delectCode () {
|
|
|
|
- if (!this.selectedKey.length) {
|
|
|
|
- return this.$message.warning('您还未选择要删除的字典');
|
|
|
|
- }
|
|
|
|
- let _this = this
|
|
|
|
- let id = this.codeList[this.selectedKey].id
|
|
|
|
- this.$confirm({
|
|
|
|
- title: '警告',
|
|
|
|
- content: `确定要删除 ${this.codeList[this.selectedKey].name} 吗?`,
|
|
|
|
- okText: '确定',
|
|
|
|
- cancelText: '取消',
|
|
|
|
- onOk () {
|
|
|
|
- delLookUp({
|
|
|
|
- id: id
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- _this.$message.success('删除成功')
|
|
|
|
- _this.getCodeList()
|
|
|
|
- }
|
|
|
|
- }).catch(() => {
|
|
|
|
- _this.$message.success('删除失败, 请稍后重试')
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
+ optionAlertShow: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 获取字典列表
|
|
|
|
+ getCodeList () {
|
|
|
|
+ listLookUp({ code: this.code }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.codeList = res.data
|
|
|
|
+ this.noData = false
|
|
|
|
+ if (!res.data.length) {
|
|
|
|
+ this.noData = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 添加字典
|
|
|
|
+ addCode () {
|
|
|
|
+ this.showCodeModal = true
|
|
|
|
+ this.codeData = {}
|
|
|
|
+ },
|
|
|
|
+ // 编辑字典
|
|
|
|
+ editCode () {
|
|
|
|
+ if (!this.selectedKey.length) {
|
|
|
|
+ return this.$message.warning('您还未选择要编辑的字典')
|
|
|
|
+ }
|
|
|
|
+ this.showCodeModal = true
|
|
|
|
+ this.codeData = this.codeList[this.selectedKey]
|
|
|
|
+ },
|
|
|
|
+ // 删除字典
|
|
|
|
+ delectCode () {
|
|
|
|
+ if (!this.selectedKey.length) {
|
|
|
|
+ return this.$message.warning('您还未选择要删除的字典')
|
|
|
|
+ }
|
|
|
|
+ const _this = this
|
|
|
|
+ const id = this.codeList[this.selectedKey].id
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '警告',
|
|
|
|
+ content: `确定要删除 ${this.codeList[this.selectedKey].name} 吗?`,
|
|
|
|
+ okText: '确定',
|
|
|
|
+ cancelText: '取消',
|
|
|
|
+ onOk () {
|
|
|
|
+ delLookUp({
|
|
|
|
+ id: id
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success('删除成功')
|
|
|
|
+ _this.getCodeList()
|
|
|
|
+ } else {
|
|
|
|
+ _this.$message.error(res.message)
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ _this.$message.success('删除失败, 请稍后重试')
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 字典 取消选择
|
|
// 字典 取消选择
|
|
cancelSel () {
|
|
cancelSel () {
|
|
this.selectedKey = []
|
|
this.selectedKey = []
|
|
this.selectedMenu = ''
|
|
this.selectedMenu = ''
|
|
},
|
|
},
|
|
-
|
|
|
|
- // 新增数据
|
|
|
|
- openCodeItemModal () {
|
|
|
|
- if (!this.selectedKey.length) {
|
|
|
|
- return this.$message.warning('请先选择一个字典类别');
|
|
|
|
- }
|
|
|
|
- this.showItemCodeModal = true
|
|
|
|
- this.itemCodeData = {lookupCode:this.codeList[this.selectedKey].code}
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- // 批量删除数据
|
|
|
|
- delectAll () {
|
|
|
|
- if (!this.selectedNum) {
|
|
|
|
- return this.$message.warning('您还未选择要删除的数据');
|
|
|
|
- }
|
|
|
|
- let _this = this
|
|
|
|
- this.$confirm({
|
|
|
|
- title: '警告',
|
|
|
|
- content: `确定要删除您选择的这${this.selectedNum}条数据吗?`,
|
|
|
|
- okText: '确定',
|
|
|
|
- cancelText: '取消',
|
|
|
|
- onOk () {
|
|
|
|
- // delectUserPower({
|
|
|
|
- // id: row.id
|
|
|
|
- // }).then(res => {
|
|
|
|
- // if (res.status == 200) {
|
|
|
|
- // _this.$message.success('删除成功')
|
|
|
|
- // _this.$refs.table.refresh()
|
|
|
|
- // }
|
|
|
|
- // }).catch(() => {
|
|
|
|
- // _this.$message.success('删除失败, 请稍后重试')
|
|
|
|
- // })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 删除
|
|
|
|
- delect (row) {
|
|
|
|
- let _this = this
|
|
|
|
- this.$confirm({
|
|
|
|
- title: '警告',
|
|
|
|
- content: '确定要删除吗?',
|
|
|
|
- okText: '确定',
|
|
|
|
- cancelText: '取消',
|
|
|
|
- onOk () {
|
|
|
|
- delLookUpItem({
|
|
|
|
- id: row.id
|
|
|
|
- }).then(res => {
|
|
|
|
- console.log(res, 'res1111')
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- _this.$message.success('删除成功')
|
|
|
|
- _this.$refs.table.refresh()
|
|
|
|
- }
|
|
|
|
- }).catch(() => {
|
|
|
|
- _this.$message.success('删除失败, 请稍后重试')
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- handleEdit (row) {
|
|
|
|
- console.log(row, 'row')
|
|
|
|
- this.showItemCodeModal = true
|
|
|
|
- this.itemCodeData = row
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- mounted () {
|
|
|
|
- },
|
|
|
|
- beforeCreate () {
|
|
|
|
- this.form = this.$form.createForm(this, { name: 'miniForm' })
|
|
|
|
|
|
+ // 新增数据
|
|
|
|
+ openCodeItemModal () {
|
|
|
|
+ if (!this.selectedKey.length) {
|
|
|
|
+ return this.$message.warning('请先选择一个字典类别')
|
|
|
|
+ }
|
|
|
|
+ this.showItemCodeModal = true
|
|
|
|
+ this.itemCodeData = { lookupCode: this.codeList[this.selectedKey].code }
|
|
},
|
|
},
|
|
- beforeRouteEnter (to, from, next) {
|
|
|
|
- next(vm => {
|
|
|
|
- vm.getCodeList()
|
|
|
|
|
|
+ // 批量删除数据
|
|
|
|
+ delectAll () {
|
|
|
|
+ if (!this.selectedNum) {
|
|
|
|
+ return this.$message.warning('您还未选择要删除的数据')
|
|
|
|
+ }
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '警告',
|
|
|
|
+ content: `确定要删除您选择的这${this.selectedNum}条数据吗?`,
|
|
|
|
+ okText: '确定',
|
|
|
|
+ cancelText: '取消',
|
|
|
|
+ onOk () {
|
|
|
|
+ // delectUserPower({
|
|
|
|
+ // id: row.id
|
|
|
|
+ // }).then(res => {
|
|
|
|
+ // if (res.status == 200) {
|
|
|
|
+ // _this.$message.success('删除成功')
|
|
|
|
+ // _this.$refs.table.refresh()
|
|
|
|
+ // }
|
|
|
|
+ // }).catch(() => {
|
|
|
|
+ // _this.$message.success('删除失败, 请稍后重试')
|
|
|
|
+ // })
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- watch: {
|
|
|
|
- selectedKey(newValue, oldValue) {
|
|
|
|
- console.log(newValue, 'newValue')
|
|
|
|
- if (newValue.length) {
|
|
|
|
-
|
|
|
|
- this.selectedMenu = this.codeList[this.selectedKey].name + " " + '(' + this.codeList[this.selectedKey].code + ')'
|
|
|
|
- this.queryParam.lookupCode = this.codeList[this.selectedKey].code
|
|
|
|
- this.$refs.table.refresh(true)
|
|
|
|
|
|
+ // 删除
|
|
|
|
+ delect (row) {
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '警告',
|
|
|
|
+ content: '确定要删除吗?',
|
|
|
|
+ okText: '确定',
|
|
|
|
+ cancelText: '取消',
|
|
|
|
+ onOk () {
|
|
|
|
+ delLookUpItem({
|
|
|
|
+ id: row.id
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success('删除成功')
|
|
|
|
+ _this.$refs.table.refresh()
|
|
|
|
+ } else {
|
|
|
|
+ _this.$message.error(res.message)
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ _this.$message.success('删除失败, 请稍后重试')
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
+ handleEdit (row) {
|
|
|
|
+ this.showItemCodeModal = true
|
|
|
|
+ this.itemCodeData = row
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ beforeCreate () {
|
|
|
|
+ this.form = this.$form.createForm(this, { name: 'miniForm' })
|
|
|
|
+ },
|
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
|
+ next(vm => {
|
|
|
|
+ vm.getCodeList()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ selectedKey (newValue, oldValue) {
|
|
|
|
+ if (newValue.length) {
|
|
|
|
+ this.selectedMenu = this.codeList[this.selectedKey].name + ' ' + '(' + this.codeList[this.selectedKey].code + ')'
|
|
|
|
+ this.queryParam.lookupCode = this.codeList[this.selectedKey].code
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
@@ -369,7 +361,7 @@
|
|
width: 6px;
|
|
width: 6px;
|
|
height: 6px ;
|
|
height: 6px ;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
.menu-box::-webkit-scrollbar-thumb{
|
|
.menu-box::-webkit-scrollbar-thumb{
|
|
width: 6px;
|
|
width: 6px;
|
|
height: 6px ;
|
|
height: 6px ;
|
|
@@ -377,7 +369,7 @@
|
|
-webkit-box-shadow: inset 0 0 2px #d1d1d1;
|
|
-webkit-box-shadow: inset 0 0 2px #d1d1d1;
|
|
background: #e4e4e4;
|
|
background: #e4e4e4;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
.textCount{
|
|
.textCount{
|
|
border: 1px solid #91d5ff;
|
|
border: 1px solid #91d5ff;
|
|
background-color: #e6f7ff;
|
|
background-color: #e6f7ff;
|