|
@@ -29,25 +29,22 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="ml-2">
|
|
|
- <el-button type="primary" @click="delModal" size="large">
|
|
|
+ <el-button type="primary" @click="delModal" size="large" :disabled="tableCheckedKeys.length<1">
|
|
|
<HcIcon name="delete-bin-2"/>
|
|
|
<span>删除</span>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
<HcTable :column="tableColumn" :datas="tableData" isCheck @selection-change="tableSelectionChange" :loading="tableLoaing">
|
|
|
- <template #name="{row}">{{ row['name'] }}</template>
|
|
|
- <template #text="{row}">{{ row['text'] }}</template>
|
|
|
- <template #color="{row}">{{ row['color'] }}</template>
|
|
|
<template #action="{row, index}">
|
|
|
<el-button size="small" type="primary" @click="eidtModal(row)">编辑</el-button>
|
|
|
<el-button size="small" type="primary" @click="delModal(row)">删除</el-button>
|
|
|
- <el-button size="small" type="primary" @click="configModalclick">字典配置</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="configModalclick(row)">字典配置</el-button>
|
|
|
|
|
|
</template>
|
|
|
</HcTable>
|
|
|
|
|
|
- <!-- 新增编辑字典 -->
|
|
|
+ <!-- 新增编辑一级字典 -->
|
|
|
<HcDialog bgColor="#ffffff" isToBody :show="codeModal" :title="codeModalTitle" @close="codeModalClose" widths="62rem" @save="saveparentClick">
|
|
|
<el-form label-position="left" label-width="auto" :model="formcode" :rules="formUserRules" size="large">
|
|
|
<el-row :gutter="20">
|
|
@@ -61,14 +58,58 @@
|
|
|
<el-input v-model="formcode.dictName"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="字典排序:" prop="sort">
|
|
|
+ <el-input-number
|
|
|
+ v-model="formcode.sort"
|
|
|
+ controls-position="right"
|
|
|
+ size="large"
|
|
|
+ @change="handleSortChange"
|
|
|
+ style="width: 100%;"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="12">
|
|
|
+ <el-form-item label="封存:" prop="isstorage">
|
|
|
+ <el-switch
|
|
|
+ v-model="formcode.isstorage"
|
|
|
+ size="large"
|
|
|
+ active-text="是"
|
|
|
+ inactive-text="否"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="字典备注:">
|
|
|
+ <el-input v-model="formcode.price"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </HcDialog>
|
|
|
+ <!-- 新增编辑二级 -->
|
|
|
+ <HcDialog bgColor="#ffffff" isToBody :show="configcodeModal" @close="configcodeModalClose" widths="62rem" @save="savechilidClick" :title="configcodeModalTitle">
|
|
|
+ <el-form label-position="left" label-width="auto" :model="configForm" :rules="formUserRules" size="large">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="字典编号:" prop="code">
|
|
|
+ <el-input v-model="configForm.code"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="字典名称:" prop="dictName">
|
|
|
+ <el-input v-model="configForm.dictName"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="12" v-if="isConfigedit">
|
|
|
<el-form-item label="上级字典:" prop="parentId">
|
|
|
- <el-select v-model="formcode.parentId" class="m-2" placeholder="请选择" size="large" style="width: 100%;">
|
|
|
+ <el-select v-model="configForm.parentId" class="m-2" placeholder="请选择" size="large" style="width: 100%;" disabled>
|
|
|
<el-option
|
|
|
- v-for="item in parentoptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item in tableData"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.dictName"
|
|
|
+ :value="item.id"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -76,7 +117,7 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="字典排序:" prop="sort">
|
|
|
<el-input-number
|
|
|
- v-model="formcode.sort"
|
|
|
+ v-model="configForm.sort"
|
|
|
controls-position="right"
|
|
|
size="large"
|
|
|
@change="handleSortChange"
|
|
@@ -103,14 +144,18 @@
|
|
|
</el-form>
|
|
|
</HcDialog>
|
|
|
<!-- 字典配置 -->
|
|
|
- <HcDialog bgColor="#ffffff" isToBody isTable isRowFooter :loading="configModalLoading" :show="configModal" title="[保管期限]字典配置" widths="62rem" @close="closeConfigClick">
|
|
|
+ <HcDialog bgColor="#ffffff" isTable isRowFooter :loading="configModalLoading" :show="configModal" title="字典配置" widths="62rem" @close="closeConfigClick">
|
|
|
<template #header>
|
|
|
- <div class="header-box">
|
|
|
- <div class="w-48">
|
|
|
- <el-input v-model="configsearchForm.queryValue1" clearable placeholder="请输入字典名称进行查询" size="large"/>
|
|
|
+ <div class="w-30">
|
|
|
+ [{{ configItem?.dictName }}] 字典配置
|
|
|
+ </div>
|
|
|
+ <div class="header-box mt-2">
|
|
|
+
|
|
|
+ <div class="w-48 ">
|
|
|
+ <el-input v-model="configsearchForm.dictName" clearable placeholder="请输入字典名称进行查询" size="large"/>
|
|
|
</div>
|
|
|
<div class="w-48 ml-2">
|
|
|
- <el-input v-model="configsearchForm.queryValue2" clearable placeholder="请输入字典编号进行查询" size="large"/>
|
|
|
+ <el-input v-model="configsearchForm.code" clearable placeholder="请输入字典编号进行查询" size="large"/>
|
|
|
</div>
|
|
|
<div class="ml-4">
|
|
|
<el-button type="primary" @click="configsearchClick" size="large">
|
|
@@ -124,14 +169,14 @@
|
|
|
<span>重置</span>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
- <div class="ml-36">
|
|
|
- <el-button type="primary" @click="addClick" size="large">
|
|
|
+ <div class="ml-32">
|
|
|
+ <el-button type="primary" @click="addchildClick" size="large">
|
|
|
<HcIcon name="add-circle"/>
|
|
|
<span>新增</span>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="ml-2">
|
|
|
- <el-button type="primary" @click="batcheditClick" size="large">
|
|
|
+ <el-button type="primary" @click="configdelClick" size="large" :loading="configdelbtnloading" :disabled="configtableCheckedKeys.length<1">
|
|
|
<HcIcon name="delete-bin-2"/>
|
|
|
<span>删除</span>
|
|
|
</el-button>
|
|
@@ -141,14 +186,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
- <HcTable :column="configtableColumn" :datas="configtableData" isCheck @selection-change="configtableSelectionChange">
|
|
|
+ <HcTable :column="configtableColumn" :datas="configtableData" isCheck @selection-change="configtableSelectionChange" :loading="configTableloaing">
|
|
|
<template #name="{row}">{{ row['name'] }}</template>
|
|
|
<template #text="{row}">{{ row['text'] }}</template>
|
|
|
<template #color="{row}">{{ row['color'] }}</template>
|
|
|
<template #action="{row, index}">
|
|
|
- <el-button size="small" type="primary" @click="configeidtModal">编辑</el-button>
|
|
|
- <el-button size="small" type="primary" @click="configdelModal">删除</el-button>
|
|
|
- <el-button size="small" type="primary" @click="addchildrenclick">新增子项</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="configeidtModal(row)">编辑</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="configdelClick(row)" :loading="configdelbtnloading">删除</el-button>
|
|
|
+
|
|
|
|
|
|
</template>
|
|
|
</HcTable>
|
|
@@ -226,6 +271,7 @@ const resetClick = () => {
|
|
|
}
|
|
|
const addClick=()=>{
|
|
|
formcode.value={}
|
|
|
+ codeModalTitle.value='新增'
|
|
|
codeModal.value=true
|
|
|
}
|
|
|
//新增一级科目
|
|
@@ -247,6 +293,27 @@ const saveparentClick=async()=>{
|
|
|
window.$message?.warning(msg)
|
|
|
}
|
|
|
}
|
|
|
+//新增二级科目
|
|
|
+const configForm=ref({})
|
|
|
+const savechilidClick=async()=>{
|
|
|
+ const { error, code, data,msg } = await submitDictionary({
|
|
|
+ type:configItem.value?.type,
|
|
|
+ dictName:configForm.value?.dictName,
|
|
|
+ id:configForm.value?.id||null,
|
|
|
+ code:configForm.value?.code,
|
|
|
+ parentId:configItem.value.id,
|
|
|
+ sort:configForm.value?.sort||null,
|
|
|
+ })
|
|
|
+ configcodeModal.value=false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message?.success(msg)
|
|
|
+
|
|
|
+ getChildListData()
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ window.$message?.warning(msg)
|
|
|
+ }
|
|
|
+}
|
|
|
const batcheditClick=()=>{
|
|
|
|
|
|
}
|
|
@@ -268,10 +335,12 @@ const tableSelectionChange = (rows) => {
|
|
|
const eidtModal=(row)=>{
|
|
|
formcode.value=row
|
|
|
codeModal.value=true
|
|
|
+ codeModalTitle.value='编辑'
|
|
|
}
|
|
|
const delbtnloading=ref(false)
|
|
|
const delModal=(item)=>{
|
|
|
const rows = tableCheckedKeys.value;
|
|
|
+
|
|
|
const ids = arrToId(rows)
|
|
|
delbtnloading.value=true
|
|
|
window?.$messageBox?.alert('您确定要删除该信息吗? 一旦注销数据将彻底清除,请谨慎操作?', '删除提醒', {
|
|
@@ -297,9 +366,15 @@ const delModal=(item)=>{
|
|
|
}
|
|
|
|
|
|
const codeModal=ref(false)
|
|
|
+const configcodeModal=ref(false)
|
|
|
const codeModalTitle=ref('新增')
|
|
|
+const configcodeModalTitle=ref('新增')
|
|
|
const codeModalClose=()=>{
|
|
|
- codeModal.value=false
|
|
|
+
|
|
|
+ codeModal.value=false
|
|
|
+}
|
|
|
+const configcodeModalClose=()=>{
|
|
|
+ configcodeModal.value=false
|
|
|
}
|
|
|
const formcode=ref({})
|
|
|
const formUserRules = {
|
|
@@ -327,54 +402,70 @@ const handleSortChange=(value)=>{
|
|
|
const isConfigedit=ref(false)
|
|
|
const configModalLoading=ref(false)
|
|
|
const configModal=ref(false)
|
|
|
-const configModalclick=()=>{
|
|
|
+const configItem=ref({})
|
|
|
+const configModalclick=(row)=>{
|
|
|
+ configItem.value=row
|
|
|
+ getChildListData()
|
|
|
configModal.value=true
|
|
|
isConfigedit.value=true
|
|
|
}
|
|
|
+//获取二级科目
|
|
|
+const configTableloaing=ref(false)
|
|
|
+const getChildListData=async()=>{
|
|
|
+ configTableloaing.value=true
|
|
|
+ const { error, code, data,msg } = await getChildList({
|
|
|
+ parentId: configItem.value.id,
|
|
|
+ type:configItem.value.type,
|
|
|
+ dictName:configsearchForm.value?.dictName,
|
|
|
+ code:configsearchForm.value?.code
|
|
|
+ })
|
|
|
+ configTableloaing.value=false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ configtableData.value=getArrValue(data)
|
|
|
+ // tab.value = getArrValue(data['records'])
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ configtableData.value=[]
|
|
|
+ window.$message?.warning(msg)
|
|
|
+ }
|
|
|
+}
|
|
|
const closeConfigClick=()=>{
|
|
|
configModal.value=false
|
|
|
isConfigedit.value=false
|
|
|
}
|
|
|
+//新增二级字典
|
|
|
+const addchildClick=()=>{
|
|
|
+ configcodeModal.value=true;
|
|
|
+ configForm.value={}
|
|
|
+ configForm.value.parentId=configItem.value.id
|
|
|
+ configcodeModalTitle.value='新增'
|
|
|
|
|
|
+}
|
|
|
//搜索表单
|
|
|
const configsearchForm = ref({
|
|
|
projectType: null, user: null, project: null,
|
|
|
current: 1, size: 20, total: 0
|
|
|
})
|
|
|
-const configgetTableData=()=>{
|
|
|
|
|
|
-}
|
|
|
//搜索
|
|
|
const configsearchClick = () => {
|
|
|
- configsearchForm.value.current = 1;
|
|
|
- configgetTableData()
|
|
|
+ getChildListData()
|
|
|
}
|
|
|
|
|
|
//重置搜索表单
|
|
|
const configresetClick = () => {
|
|
|
- configsearchForm.value = {current: 1, size: 20, total: 0}
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-//分页被点击
|
|
|
-const configpageChange = ({current, size}) => {
|
|
|
- searchForm.value.current = current
|
|
|
- searchForm.value.size = size
|
|
|
+ configsearchForm.value = {}
|
|
|
+ getChildListData()
|
|
|
}
|
|
|
|
|
|
const configtableColumn = [
|
|
|
- {key: 'key1', name: '字典编号'},
|
|
|
- {key: 'key2', name: '字典名称'},
|
|
|
- {key: 'key3', name: '封存'},
|
|
|
-
|
|
|
+ {key: 'code', name: '字典编号'},
|
|
|
+ {key: 'dictName', name: '字典名称'},
|
|
|
{key: 'action', name: '操作', width:250}
|
|
|
|
|
|
]
|
|
|
-const configtableData = ref([
|
|
|
- {key1: '名称1', key2: '文本1', key3: 'red'},
|
|
|
- {key1: '名称1', key2: '文本1', key3: 'red'},
|
|
|
- {key1: '名称1', key2: '文本1', key3: 'red'},
|
|
|
-])
|
|
|
+
|
|
|
+const configtableData = ref([])
|
|
|
const configtableCheckedKeys = ref([]);
|
|
|
const configtableSelectionChange = (rows) => {
|
|
|
configtableCheckedKeys.value = rows
|
|
@@ -383,37 +474,38 @@ const configtableSelectionChange = (rows) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const configeidtModal=()=>{
|
|
|
-
|
|
|
+const configeidtModal=(row)=>{
|
|
|
+ configForm.value=row;
|
|
|
+ configcodeModalTitle.value='编辑'
|
|
|
+ configcodeModal.value=true
|
|
|
}
|
|
|
-const configdelModal=()=>{
|
|
|
-
|
|
|
+const configdelbtnloading=ref(false)
|
|
|
+const configdelClick=(item)=>{
|
|
|
+ const rows = configtableCheckedKeys.value;
|
|
|
+ const ids = arrToId(rows)
|
|
|
+ configdelbtnloading.value=true
|
|
|
+ window?.$messageBox?.alert('您确定要删除该信息吗? 一旦注销数据将彻底清除,请谨慎操作?', '删除提醒', {
|
|
|
+ showCancelButton: true,
|
|
|
+ confirmButtonText: '确认注销',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ callback: async(action) => {
|
|
|
+ if (action === 'confirm') {
|
|
|
+ const {error, code, msg} = await removeDictionary({
|
|
|
+ ids: ids||item.id,
|
|
|
+ })
|
|
|
+ configdelbtnloading.value=false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window?.$message?.success('删除成功')
|
|
|
+ getChildListData()
|
|
|
+ } else {
|
|
|
+ window?.$message?.warning(msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
-const addchildrenclick=()=>{
|
|
|
|
|
|
-}
|
|
|
-const parentoptions = [
|
|
|
- {
|
|
|
- value: 'Option1',
|
|
|
- label: 'Option1',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option2',
|
|
|
- label: 'Option2',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option3',
|
|
|
- label: 'Option3',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option4',
|
|
|
- label: 'Option4',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option5',
|
|
|
- label: 'Option5',
|
|
|
- },
|
|
|
-]
|
|
|
</script>
|
|
|
<style lang='scss' scoped>
|
|
|
.header-box{
|