Commit 7a73609bb4efddc1498d16403b496a2af0d6c01e

Authored by yiming
1 parent 1ef3bf92

档案上架及下架

ruoyi-archives/src/main/resources/mapper/archives/ArchivesBoxMapper.xml
... ... @@ -39,6 +39,7 @@
39 39 where apprvoal='4'
40 40 <if test="archivesBox.deportNodeId =='isNull'"> and deport_node_id is null</if>
41 41 <if test="archivesBox.deportNodeId =='isNotNull'"> and deport_node_id is not null</if>
  42 + <if test="archivesBox.deportNodeId !='' and archivesBox.deportNodeId !='isNull' and archivesBox.deportNodeId !='isNotNull'"> and deport_node_id = #{archivesBox.deportNodeId}</if>
42 43 <if test="ids !=null and ids.length>0">
43 44 and id in
44 45 <foreach item="id" collection="ids" open="(" separator="," close=")">
... ...
ruoyi-service/src/main/java/com/ruoyi/service/domain/DepotNode.java
... ... @@ -40,7 +40,7 @@ public class DepotNode extends BaseEntity
40 40 /** 删除标志(0代表存在 2代表删除) */
41 41 private String delFlag;
42 42  
43   - /** 是否是架子(0不是 1是) */
  43 + /** 是否是架子( 1是 2不是) */
44 44 private String nodeFlag;
45 45  
46 46 /** 库位码 */
... ...
ruoyi-service/src/main/java/com/ruoyi/service/util/TreeSelect.java
... ... @@ -24,6 +24,12 @@ public class TreeSelect implements Serializable
24 24 /** 节点名称 */
25 25 private String label;
26 26  
  27 + /** 库位码 */
  28 + private String depotCode;
  29 +
  30 + private boolean disabled;
  31 +
  32 +
27 33 /** 子节点 */
28 34 @JsonInclude(JsonInclude.Include.NON_EMPTY)
29 35 private List<TreeSelect> children;
... ... @@ -38,6 +44,8 @@ public class TreeSelect implements Serializable
38 44 this.id = depotNode.getId();
39 45 this.label = depotNode.getNodeName();
40 46 this.children = depotNode.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
  47 + this.depotCode = depotNode.getDepotCode();
  48 + this.disabled ="2".equalsIgnoreCase(depotNode.getNodeFlag());
41 49 }
42 50  
43 51  
... ... @@ -78,4 +86,20 @@ public class TreeSelect implements Serializable
78 86 {
79 87 this.children = children;
80 88 }
  89 +
  90 + public String getDepotCode() {
  91 + return depotCode;
  92 + }
  93 +
  94 + public void setDepotCode(String depotCode) {
  95 + this.depotCode = depotCode;
  96 + }
  97 +
  98 + public boolean isDisabled() {
  99 + return disabled;
  100 + }
  101 +
  102 + public void setDisabled(boolean disabled) {
  103 + this.disabled = disabled;
  104 + }
81 105 }
... ...
ruoyi-ui/src/api/service/depot.js
... ... @@ -5,7 +5,7 @@ import {parseStrEmpty} from &quot;@/utils/ruoyi&quot;;
5 5 // 查询库房树结构
6 6 export function treeselect() {
7 7 return request({
8   - url: '/service/depot/treeselect',
  8 + url: '/service/depotNode/treeselect',
9 9 method: 'get'
10 10 })
11 11 }
... ...
ruoyi-ui/src/views/archives/box/filingindex.vue
... ... @@ -334,6 +334,7 @@ export default {
334 334 this.shelveType=1;
335 335 this.shelveOpen = true;
336 336 this.$nextTick(()=>{
  337 + this.$refs.shelve.clearCheck();
337 338 this.$refs.shelve.getList();
338 339 })
339 340 },
... ... @@ -342,6 +343,7 @@ export default {
342 343 this.shelveType=2;
343 344 this.shelveOpen = true;
344 345 this.$nextTick(()=>{
  346 + this.$refs.shelve.clearCheck();
345 347 this.$refs.shelve.getList();
346 348 })
347 349 },handleCheckShelve(){
... ...
ruoyi-ui/src/views/archives/box/shelveindex.vue
... ... @@ -11,8 +11,9 @@
11 11 :default-expand-all=true
12 12 node-key="id"
13 13 ref="tree"
  14 + show-checkbox
14 15 highlight-current
15   - @node-click="handleNodeClick"
  16 + @check="handleNodeClick"
16 17 />
17 18 </div>
18 19 </el-col>
... ... @@ -56,7 +57,6 @@ export default {
56 57 single:true,
57 58 loading: true,
58 59 list: [],
59   - level:undefined,
60 60 queryParams:{
61 61 depotNodeId:undefined
62 62 },
... ... @@ -84,16 +84,25 @@ export default {
84 84 },
85 85 // 节点单击事件
86 86 handleNodeClick(data) {
87   - this.level=data.level;
88   - this.params.depotNodeId=data.dbId;
89   - this.params.depotCode=data.label;
  87 + this.clearCheck();
  88 + this.$refs.tree.setChecked(data.id,true,false);
  89 + this.params.depotNodeId=data.id;
  90 + this.params.depotCode=data.depotCode;
  91 + this.queryParams.deportNodeId=data.depotCode;
  92 + this.getList();
  93 + },
  94 + clearCheck(){
  95 + let arr=this.$refs.tree.getCheckedKeys(true);
  96 + arr.forEach(k=>{
  97 + this.$refs.tree.setChecked(k,false,false);
  98 + })
90 99 },
91 100 getList() {
92 101 this.loading = true;
93 102 if(this.shelveType==1){
94 103 this.queryParams.deportNodeId='isNull'
95 104 }
96   - else if(this.shelveType==2){
  105 + else if(this.shelveType==2 && this.queryParams.deportNodeId==undefined){
97 106 this.queryParams.deportNodeId='isNotNull'
98 107 }
99 108 listByIds(this.queryParams,this.ids).then(response => {
... ... @@ -108,8 +117,8 @@ export default {
108 117 this.multiple = !selection.length
109 118 },
110 119 shelve(){
111   - if(this.level!=6){
112   - this.$message.error('只能上架节点')
  120 + if(this.params.ids==undefined){
  121 + this.$modal.msgWarning("至少选择一条")
113 122 return;
114 123 }
115 124 shelve(this.params).then(response => {
... ... @@ -118,6 +127,10 @@ export default {
118 127 });
119 128 },
120 129 shelveDown(){
  130 + if(this.params.ids==undefined){
  131 + this.$modal.msgWarning("至少选择一条")
  132 + return;
  133 + }
121 134 shelveDown(this.params).then(response => {
122 135 this.$modal.msgSuccess("修改成功");
123 136 this.getList();
... ...
ruoyi-ui/src/views/service/depotNode/index.vue
1 1 <template>
2 2 <div class="app-container">
3 3 <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
4   - <el-form-item label="部门名称" prop="nodeName">
  4 + <el-form-item label="库房名称" prop="nodeName">
5 5 <el-input
6 6 v-model="queryParams.nodeName"
7   - placeholder="请输入部门名称"
  7 + placeholder="请输入库房名称"
8 8 clearable
9 9 @keyup.enter.native="handleQuery"
10 10 />
11 11 </el-form-item>
12 12 <el-form-item label="状态" prop="status">
13   - <el-select v-model="queryParams.status" placeholder="部门状态" clearable>
  13 + <el-select v-model="queryParams.status" placeholder="库房状态" clearable>
14 14 <el-option
15 15 v-for="dict in dict.type.sys_normal_disable"
16 16 :key="dict.value"
... ... @@ -33,7 +33,7 @@
33 33 icon="el-icon-plus"
34 34 size="mini"
35 35 @click="handleAdd"
36   - v-hasPermi="['system:dept:add']"
  36 + v-hasPermi="['service:depotNode:add']"
37 37 >新增</el-button>
38 38 </el-col>
39 39 <el-col :span="1.5">
... ... @@ -97,20 +97,20 @@
97 97 </el-table-column>
98 98 </el-table>
99 99  
100   - <!-- 添加或修改部门对话框 -->
  100 + <!-- 添加或修改库房对话框 -->
101 101 <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
102 102 <el-form ref="form" :model="form" :rules="rules" label-width="80px">
103 103 <el-row>
104 104 <el-col :span="24" v-if="form.parentId !== 0" >
105 105 <el-form-item label="上级" prop="parentId" >
106   - <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" :disabled="type==2"/>
  106 + <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级" :disabled="type==2"/>
107 107 </el-form-item>
108 108 </el-col>
109 109 </el-row>
110 110 <el-row>
111 111 <el-col :span="12">
112 112 <el-form-item label="名称" prop="nodeName">
113   - <el-input v-model="form.nodeName" placeholder="请输入部门名称" />
  113 + <el-input v-model="form.nodeName" placeholder="请输入库房名称" />
114 114 </el-form-item>
115 115 </el-col>
116 116 <el-col :span="12">
... ... @@ -132,7 +132,7 @@
132 132 </el-form-item>
133 133 </el-col>
134 134 <el-col :span="12">
135   - <el-form-item label="部门状态">
  135 + <el-form-item label="库房状态">
136 136 <el-radio-group v-model="form.status">
137 137 <el-radio
138 138 v-for="dict in dict.type.sys_normal_disable"
... ... @@ -158,7 +158,7 @@ import Treeselect from &quot;@riophae/vue-treeselect&quot;;
158 158 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
159 159  
160 160 export default {
161   - name: "Dept",
  161 + name: "DepotNode",
162 162 dicts: ['sys_normal_disable','yes_no'],
163 163 components: { Treeselect },
164 164 data() {
... ... @@ -169,7 +169,7 @@ export default {
169 169 showSearch: true,
170 170 // 表格树数据
171 171 deptList: [],
172   - // 部门树选项
  172 + // 库房树选项
173 173 deptOptions: [],
174 174 // 弹出层标题
175 175 title: "",
... ... @@ -189,27 +189,16 @@ export default {
189 189 // 表单校验
190 190 rules: {
191 191 parentId: [
192   - { required: true, message: "上级部门不能为空", trigger: "blur" }
  192 + { required: true, message: "上级库房不能为空", trigger: "blur" }
193 193 ],
194 194 nodeName: [
195   - { required: true, message: "部门名称不能为空", trigger: "blur" }
  195 + { required: true, message: "库房名称不能为空", trigger: "blur" }
196 196 ],
197 197 orderNum: [
198 198 { required: true, message: "显示排序不能为空", trigger: "blur" }
199 199 ],
200   - email: [
201   - {
202   - type: "email",
203   - message: "请输入正确的邮箱地址",
204   - trigger: ["blur", "change"]
205   - }
206   - ],
207   - phone: [
208   - {
209   - pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
210   - message: "请输入正确的手机号码",
211   - trigger: "blur"
212   - }
  200 + nodeFlag: [
  201 + { required: true, message: "档案架不能为空", trigger: "blur" }
213 202 ]
214 203 },
215 204 type:undefined
... ... @@ -219,7 +208,7 @@ export default {
219 208 this.getList();
220 209 },
221 210 methods: {
222   - /** 查询部门列表 */
  211 + /** 查询库房列表 */
223 212 getList() {
224 213 this.loading = true;
225 214 listDept(this.queryParams).then(response => {
... ... @@ -227,7 +216,7 @@ export default {
227 216 this.loading = false;
228 217 });
229 218 },
230   - /** 转换部门数据结构 */
  219 + /** 转换库房数据结构 */
231 220 normalizer(node) {
232 221 if (node.children && !node.children.length) {
233 222 delete node.children;
... ... @@ -250,9 +239,7 @@ export default {
250 239 parentId: undefined,
251 240 nodeName: undefined,
252 241 orderNum: undefined,
253   - leader: undefined,
254   - phone: undefined,
255   - email: undefined,
  242 + nodeFlag: undefined,
256 243 status: "0"
257 244 };
258 245 this.resetForm("form");
... ... @@ -274,7 +261,7 @@ export default {
274 261 this.form.parentId = row.id;
275 262 }
276 263 this.open = true;
277   - this.title = "添加部门";
  264 + this.title = "添加库房";
278 265 listDept().then(response => {
279 266 this.deptOptions = this.handleTree(response.data, "id");
280 267 });
... ...