资源管理1.1

This commit is contained in:
xbx 2023-11-19 20:32:19 +08:00
parent 00dc394dfc
commit 8291e41fd3
7 changed files with 608 additions and 637 deletions

View File

@ -24,11 +24,13 @@
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('家具信息表')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('家具信息表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button> <a-button type="primary" icon="import">导入</a-button>
</a-upload> </a-upload>
<!-- 高级查询区域 --> <!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> <j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item> <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
@ -40,22 +42,14 @@
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a> <a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div> </div>
<a-table <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns"
ref="table" :dataSource="dataSource" :pagination="ipagination" :loading="loading"
size="middle" :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="j-table-force-nowrap"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange"> @change="handleTableChange">
<template slot="htmlSlot" slot-scope="text"> <template slot="htmlSlot" slot-scope="text">
@ -63,17 +57,12 @@
</template> </template>
<template slot="imgSlot" slot-scope="text,record"> <template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;" />
</template> </template>
<template slot="fileSlot" slot-scope="text"> <template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载 下载
</a-button> </a-button>
</template> </template>
@ -123,16 +112,6 @@
description: '家具信息表管理页面', description: '家具信息表管理页面',
// //
columns: [ columns: [
// {
// title: '#',
// dataIndex: '',
// key:'rowIndex',
// width:60,
// align:"center",
// customRender:function (t,r,index) {
// return parseInt(index)+1;
// }
// },
{ {
title: '家具编号', title: '家具编号',
align: "center", align: "center",
@ -151,7 +130,6 @@
dataIndex: 'collectingUnitNumber_dictText', dataIndex: 'collectingUnitNumber_dictText',
width: 200 width: 200
}, },
{ {
title: '分类号', title: '分类号',
align: "center", align: "center",
@ -215,9 +193,9 @@
width: 80 width: 80
}, },
{ {
title:'存放地id', title: '存放地址',
align: "center", align: "center",
dataIndex: 'locationId', dataIndex: 'locationName',
width: 120 width: 120
}, },
{ {

View File

@ -69,8 +69,8 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="存放地id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationId"> <a-form-model-item label="存放地地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationId">
<a-input v-model="model.locationId" placeholder="请输入存放地id" ></a-input> <a-cascader :options="treeData" placeholder="请选择父级存放地址" @change="onChange"></a-cascader>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -80,12 +80,14 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="审核状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalStatus"> <a-form-model-item label="审核状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalStatus">
<j-dict-select-tag type="radio" v-model="model.approvalStatus" dictCode="approval_status" placeholder="请选择审核状态" /> <j-dict-select-tag type="radio" v-model="model.approvalStatus" dictCode="approval_status"
placeholder="请选择审核状态" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="初审状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAudit"> <a-form-model-item label="初审状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAudit">
<j-dict-select-tag type="radio" v-model="model.initialAudit" dictCode="initial_audit" placeholder="请选择初审状态" /> <j-dict-select-tag type="radio" v-model="model.initialAudit" dictCode="initial_audit"
placeholder="请选择初审状态" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -135,7 +137,9 @@
add: "/rms/rmsFurniture/add", add: "/rms/rmsFurniture/add",
edit: "/rms/rmsFurniture/edit", edit: "/rms/rmsFurniture/edit",
queryById: "/rms/rmsFurniture/queryById" queryById: "/rms/rmsFurniture/queryById"
} },
treeData: [],
getTreeUrl: '/rms/rmsLocation/getCascader?type=1'
} }
}, },
computed: { computed: {
@ -146,8 +150,19 @@
created() { created() {
//model //model
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.modelDefault = JSON.parse(JSON.stringify(this.model));
this.getTreeData();
}, },
methods: { methods: {
getTreeData() {
getAction(this.getTreeUrl, {}).then(res => {
if (res.success) {
this.treeData = res.result;
}
});
},
onChange(value) {
this.model.locationId = value[value.length - 1];
},
add() { add() {
this.edit(this.modelDefault); this.edit(this.modelDefault);
}, },

View File

@ -24,11 +24,13 @@
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('仪器信息表')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('仪器信息表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button> <a-button type="primary" icon="import">导入</a-button>
</a-upload> </a-upload>
<!-- 高级查询区域 --> <!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> <j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item> <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
@ -40,22 +42,14 @@
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a> <a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div> </div>
<a-table <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns"
ref="table" :dataSource="dataSource" :pagination="ipagination" :loading="loading"
size="middle" :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="j-table-force-nowrap"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange"> @change="handleTableChange">
<template slot="htmlSlot" slot-scope="text"> <template slot="htmlSlot" slot-scope="text">
@ -63,17 +57,12 @@
</template> </template>
<template slot="imgSlot" slot-scope="text,record"> <template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;" />
</template> </template>
<template slot="fileSlot" slot-scope="text"> <template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载 下载
</a-button> </a-button>
</template> </template>
@ -123,22 +112,6 @@
description: '仪器信息表管理页面', description: '仪器信息表管理页面',
// //
columns: [ columns: [
// {
// title: '#',
// dataIndex: '',
// key:'rowIndex',
// width:60,
// align:"center",
// customRender:function (t,r,index) {
// return parseInt(index)+1;
// }
// },
{
title:'ID',
align:"center",
dataIndex: 'instrumentId',
width:80
},
{ {
title: '仪器编号', title: '仪器编号',
align: "center", align: "center",
@ -219,9 +192,9 @@
dataIndex: 'documentNumber' dataIndex: 'documentNumber'
}, },
{ {
title:'存放地id', title: '存放地址',
align: "center", align: "center",
dataIndex: 'locationId', dataIndex: 'locationName',
width: 120 width: 120
}, },
{ {

View File

@ -64,8 +64,8 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="存放地id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationId"> <a-form-model-item label="存放地地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationId">
<a-input v-model="model.locationId" placeholder="请输入存放地id" ></a-input> <a-cascader :options="treeData" placeholder="请选择父级存放地址" @change="onChange"></a-cascader>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -75,17 +75,14 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="审核状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalStatus"> <a-form-model-item label="审核状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalStatus">
<j-dict-select-tag type="radio" v-model="model.approvalStatus" dictCode="approval_status" placeholder="请选择审核状态" /> <j-dict-select-tag type="radio" v-model="model.approvalStatus" dictCode="approval_status"
placeholder="请选择审核状态" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="初审状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAudit"> <a-form-model-item label="初审状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAudit">
<j-dict-select-tag type="radio" v-model="model.initialAudit" dictCode="initial_audit" placeholder="请选择初审状态" /> <j-dict-select-tag type="radio" v-model="model.initialAudit" dictCode="initial_audit"
</a-form-model-item> placeholder="请选择初审状态" />
</a-col>
<a-col :span="12">
<a-form-model-item label="ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="instrumentId">
<a-input v-model="model.instrumentId" placeholder="请输入ID" ></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@ -130,7 +127,9 @@
add: "/rms/rmsInstrument/add", add: "/rms/rmsInstrument/add",
edit: "/rms/rmsInstrument/edit", edit: "/rms/rmsInstrument/edit",
queryById: "/rms/rmsInstrument/queryById" queryById: "/rms/rmsInstrument/queryById"
} },
treeData: [],
getTreeUrl: '/rms/rmsLocation/getCascader?type=1'
} }
}, },
computed: { computed: {
@ -141,8 +140,19 @@
created() { created() {
//model //model
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.modelDefault = JSON.parse(JSON.stringify(this.model));
this.getTreeData();
}, },
methods: { methods: {
getTreeData() {
getAction(this.getTreeUrl, {}).then(res => {
if (res.success) {
this.treeData = res.result;
}
});
},
onChange(value) {
this.model.locationId = value[value.length - 1];
},
add() { add() {
this.edit(this.modelDefault); this.edit(this.modelDefault);
}, },

View File

@ -72,11 +72,6 @@ export default {
align: "center", align: "center",
dataIndex: 'sortNumber' dataIndex: 'sortNumber'
}, },
{
title: '父级存放地址',
align: "center",
dataIndex: 'parentLocationId'
},
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
@ -109,7 +104,7 @@ export default {
selectedRowKeys = selectedRowKeys.join(',') selectedRowKeys = selectedRowKeys.join(',')
console.log(selectedRowKeys) console.log(selectedRowKeys)
this.queryParam.id = selectedRowKeys this.queryParam.id = selectedRowKeys
this.loadData() this.loadData(1)
}, },
modalFormOk() { modalFormOk() {
this.$refs.locationaTree.getTreeData() this.$refs.locationaTree.getTreeData()

View File

@ -63,7 +63,7 @@ export default {
queryById: "/rms/rmsLocation/queryById" queryById: "/rms/rmsLocation/queryById"
}, },
treeData: [], treeData: [],
getTreeUrl: '/rms/rmsLocation/getCascader' getTreeUrl: '/rms/rmsLocation/getCascader?type=0'
} }
}, },
computed: { computed: {

View File

@ -69,16 +69,16 @@ export default {
// //
this.$emit('onSelect', childKeys); this.$emit('onSelect', childKeys);
}, },
//key
collectChildKeys(node, keys = []) { collectChildKeys(node, keys = []) {
if (!node) { if (!node) {
return keys; return keys;
} }
// children // childrenkey
if (node.children && node.children.length > 0) { if (node.children) {
node.children.forEach(child => { for (let child of node.children) {
keys.push(child.key); keys.push(child.key);
this.collectChildKeys(child, keys); }
});
} }
return keys; return keys;
}, },