37741869 by renchao@pashanhoo.com

style:材料目录

1 parent 0d06b2b2
1 /* 1 /*
2 * @Description: 材料信息 2 * @Description: 材料信息
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-08-01 15:20:21 4 * @LastEditTime: 2023-09-08 13:41:46
5 */ 5 */
6 import request from '@/utils/request' 6 import request from '@/utils/request'
7 let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl')) 7 let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl'))
...@@ -126,3 +126,18 @@ export function uploadUndo (data) { ...@@ -126,3 +126,18 @@ export function uploadUndo (data) {
126 data 126 data
127 }) 127 })
128 } 128 }
129
130 /**
131 * @description: 获取材料明细集合
132 * @param {*} bsmSj
133 * @author: renchao
134 */
135 export function getClmxList (bsmSj) {
136 return request({
137 url: SERVER.SERVERAPI + '/rest/ywbl/clxx/getClmxList',
138 method: 'get',
139 params: {
140 sjBsm: bsmSj
141 }
142 })
143 }
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-04 17:09:21 4 * @LastEditTime: 2023-09-08 14:18:42
5 --> 5 -->
6 <template> 6 <template>
7 <div class="clxx"> 7 <div class="clxx">
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
34 @click="treeClick(item, index)"> 34 @click="treeClick(item, index)">
35 <span v-if="item.isrequired == 1" class="required">必选</span> 35 <span v-if="item.isrequired == 1" class="required">必选</span>
36 {{ item.sjmc }} 36 {{ item.sjmc }}
37 <span class="cl_number" :key="key">({{ item.children ? item.children.length : 0 }})</span> 37 <span class="cl_number" :key="key">({{ item.ys ? item.ys : 0 }})</span>
38 </div> 38 </div>
39 </div> 39 </div>
40 </div> 40 </div>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
63 import clxxAddDialog from "../dialog/clxxAddDialog.vue"; 63 import clxxAddDialog from "../dialog/clxxAddDialog.vue";
64 import clxxDetailDialog from "../dialog/clxxDetailDialog.vue"; 64 import clxxDetailDialog from "../dialog/clxxDetailDialog.vue";
65 import imagePreview from "@/views/components/imagePreview.vue"; 65 import imagePreview from "@/views/components/imagePreview.vue";
66 import { InitClml, saveClml } from "@/api/clxx.js"; 66 import { InitClml, saveClml, getClmxList } from "@/api/clxx.js";
67 export default { 67 export default {
68 components: { clxxAddDialog, imagePreview, clxxDetailDialog }, 68 components: { clxxAddDialog, imagePreview, clxxDetailDialog },
69 data () { 69 data () {
...@@ -107,7 +107,6 @@ ...@@ -107,7 +107,6 @@
107 this.ableOperation = this.$parent.ableOperation; 107 this.ableOperation = this.$parent.ableOperation;
108 }, 108 },
109 methods: { 109 methods: {
110 // 自动预览
111 /** 110 /**
112 * @description: 自动预览 111 * @description: 自动预览
113 * @author: renchao 112 * @author: renchao
...@@ -115,10 +114,23 @@ ...@@ -115,10 +114,23 @@
115 nextPriview () { 114 nextPriview () {
116 if (this.treeCheckIndex < this.tableData.length) { 115 if (this.treeCheckIndex < this.tableData.length) {
117 this.treeCheckIndex++; 116 this.treeCheckIndex++;
117 if (this.tableData[this.treeCheckIndex]) {
118 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj; 118 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj;
119 // 判断页数
120 let ys = this.tableData[this.treeCheckIndex].ys
119 this.previewImg.index = 0; 121 this.previewImg.index = 0;
120 this.previewImg.imgList = this.tableData[this.treeCheckIndex].children; 122 // 获取材料明细
123 if (ys > 0) {
124 getClmxList(this.treeCheckId).then(res => {
125 this.previewImg.imgList = res.result ? res.result : [];
126 })
127 } else {
128 this.previewImg.imgList = []
129 }
121 this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj; 130 this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj;
131 } else {
132 this.$message.error('没有最后一张了');
133 }
122 } 134 }
123 }, 135 },
124 /** 136 /**
...@@ -129,9 +141,21 @@ ...@@ -129,9 +141,21 @@
129 if (this.treeCheckIndex >= 1) { 141 if (this.treeCheckIndex >= 1) {
130 this.treeCheckIndex--; 142 this.treeCheckIndex--;
131 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj; 143 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj;
132 this.previewImg.index = this.previewImg.imgList.length; 144 // 判断页数
133 this.previewImg.imgList = this.tableData[this.treeCheckIndex].children; 145 let ys = this.tableData[this.treeCheckIndex].ys
146 if (ys > 0) {
147 // 获取材料明细
148 getClmxList(this.treeCheckId).then(res => {
149 this.previewImg.imgList = res.result ? res.result : [];
150 this.previewImg.index = this.previewImg.imgList.length - 1;
151 })
152 } else {
153 this.previewImg.imgList = [];
154 this.previewImg.index = 0
155 }
134 this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj; 156 this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj;
157 } else {
158 this.$message.error('没有第一张了');
135 } 159 }
136 }, 160 },
137 /** 161 /**
...@@ -199,7 +223,7 @@ ...@@ -199,7 +223,7 @@
199 //删除最后一张图片时 val=null 223 //删除最后一张图片时 val=null
200 this.tableData.forEach((item) => { 224 this.tableData.forEach((item) => {
201 if (item.bsmSj === val.bsmSj) { 225 if (item.bsmSj === val.bsmSj) {
202 item.children = val.children; 226 item.ys = val.children.length;
203 } 227 }
204 }); 228 });
205 this.previewImg.imgList = _.cloneDeep(val.children); 229 this.previewImg.imgList = _.cloneDeep(val.children);
...@@ -217,7 +241,6 @@ ...@@ -217,7 +241,6 @@
217 }); 241 });
218 } 242 }
219 }, 243 },
220 // 添加材料目录
221 /** 244 /**
222 * @description: 添加材料目录 245 * @description: 添加材料目录
223 * @author: renchao 246 * @author: renchao
...@@ -225,7 +248,6 @@ ...@@ -225,7 +248,6 @@
225 handleAdd () { 248 handleAdd () {
226 this.isDialog = true; 249 this.isDialog = true;
227 }, 250 },
228 // 新增弹窗保存
229 /** 251 /**
230 * @description: 新增弹窗保存 252 * @description: 新增弹窗保存
231 * @param {*} data 253 * @param {*} data
...@@ -244,8 +266,8 @@ ...@@ -244,8 +266,8 @@
244 sfggcl: data.sfggcl, 266 sfggcl: data.sfggcl,
245 }; 267 };
246 //是否公共材料 268 //是否公共材料
247 if(data.sfggcl=="0"){ 269 if (data.sfggcl == "0") {
248 obj["bsmSldy"]=this.$parent.currentSelectProps.bsmSldy; 270 obj["bsmSldy"] = this.$parent.currentSelectProps.bsmSldy;
249 } 271 }
250 if (this.$route.query.sqywbm == "DJBBL") { 272 if (this.$route.query.sqywbm == "DJBBL") {
251 obj.bsmSldy = this.$parent.bsmRepair 273 obj.bsmSldy = this.$parent.bsmRepair
...@@ -261,7 +283,6 @@ ...@@ -261,7 +283,6 @@
261 } 283 }
262 }); 284 });
263 }, 285 },
264 // 材料目录点击选中
265 /** 286 /**
266 * @description: 材料目录点击选中 287 * @description: 材料目录点击选中
267 * @param {*} item 288 * @param {*} item
...@@ -272,10 +293,12 @@ ...@@ -272,10 +293,12 @@
272 this.previewImg.index = 0; 293 this.previewImg.index = 0;
273 this.treeCheckId = item?.bsmSj; 294 this.treeCheckId = item?.bsmSj;
274 this.treeCheckIndex = index; 295 this.treeCheckIndex = index;
275 this.previewImg.imgList = item.children ? item.children : []; 296 // 获取材料明细
297 getClmxList(item.bsmSj).then(res => {
298 this.previewImg.imgList = res.result ? res.result : [];
299 })
276 this.previewImg.bsmSj = item?.bsmSj; 300 this.previewImg.bsmSj = item?.bsmSj;
277 }, 301 },
278 // 小图片点击
279 /** 302 /**
280 * @description: 小图片点击 303 * @description: 小图片点击
281 * @param {*} item 304 * @param {*} item
...@@ -286,7 +309,6 @@ ...@@ -286,7 +309,6 @@
286 this.showImg = item; 309 this.showImg = item;
287 this.titleYs = index + 1; 310 this.titleYs = index + 1;
288 }, 311 },
289 // 字典
290 /** 312 /**
291 * @description: 字典 313 * @description: 字典
292 * @param {*} val 314 * @param {*} val
...@@ -325,9 +347,9 @@ ...@@ -325,9 +347,9 @@
325 setTableData (tableData) { 347 setTableData (tableData) {
326 this.$nextTick((res) => { 348 this.$nextTick((res) => {
327 this.tableData = tableData; 349 this.tableData = tableData;
328 }); 350 })
329 }, 351 }
330 }, 352 }
331 }; 353 };
332 </script> 354 </script>
333 <style scoped lang="scss"> 355 <style scoped lang="scss">
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-07 17:23:02 4 * @LastEditTime: 2023-09-08 14:49:24
5 --> 5 -->
6 <template> 6 <template>
7 <div class="rlPopup"> 7 <div class="rlPopup">
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
41 <ul> 41 <ul>
42 <li v-for="(img, index) in thumbnailImages" :key="index" :class="{ active: previewImg.index === index }" 42 <li v-for="(img, index) in thumbnailImages" :key="index" :class="{ active: previewImg.index === index }"
43 @click="showCurrent(index)"> 43 @click="showCurrent(index)">
44 <img :src="img.fjurl"> 44 <img :src="img.fileurl">
45 </li> 45 </li>
46 </ul> 46 </ul>
47 </div> 47 </div>
...@@ -95,6 +95,9 @@ ...@@ -95,6 +95,9 @@
95 if (newValue.imgList && newValue.imgList.length > 0) { 95 if (newValue.imgList && newValue.imgList.length > 0) {
96 this.allLi = _.cloneDeep(newValue.imgList).map(item => item.fjurl) 96 this.allLi = _.cloneDeep(newValue.imgList).map(item => item.fjurl)
97 this.thumbnailImages = newValue.imgList 97 this.thumbnailImages = newValue.imgList
98 this.thumbnailImages.forEach(item => {
99 item.fjurl = item.fileurl
100 })
98 } else { 101 } else {
99 this.allLi = [] 102 this.allLi = []
100 this.thumbnailImages = [] 103 this.thumbnailImages = []
...@@ -108,6 +111,9 @@ ...@@ -108,6 +111,9 @@
108 this.maxLength = 0; 111 this.maxLength = 0;
109 this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl) 112 this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl)
110 this.thumbnailImages = this.previewImg.imgList 113 this.thumbnailImages = this.previewImg.imgList
114 this.thumbnailImages.forEach(item => {
115 item.fjurl = item.fileurl
116 })
111 }, 117 },
112 computed: { 118 computed: {
113 isFirst () { 119 isFirst () {
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-07 16:54:32 4 * @LastEditTime: 2023-09-08 15:02:18
5 --> 5 -->
6 <template> 6 <template>
7 <div class="clxx"> 7 <div class="clxx">
...@@ -99,10 +99,23 @@ ...@@ -99,10 +99,23 @@
99 nextPriview () { 99 nextPriview () {
100 if (this.treeCheckIndex < this.tableData.length) { 100 if (this.treeCheckIndex < this.tableData.length) {
101 this.treeCheckIndex++; 101 this.treeCheckIndex++;
102 if (this.tableData[this.treeCheckIndex]) {
102 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial; 103 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial;
104 // 判断页数
105 let ys = this.tableData[this.treeCheckIndex].ys
103 this.previewImg.index = 0; 106 this.previewImg.index = 0;
104 this.previewImg.imgList = this.tableData[this.treeCheckIndex].children; 107 // 获取材料明细
108 if (ys > 0) {
109 getFileListByBsmMaterial(this.treeCheckId).then(res => {
110 this.previewImg.imgList = res.result ? res.result : []
111 })
112 } else {
113 this.previewImg.imgList = []
114 }
105 this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial; 115 this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial;
116 } else {
117 this.$message.error('没有最后一张了');
118 }
106 } 119 }
107 }, 120 },
108 /** 121 /**
...@@ -113,9 +126,20 @@ ...@@ -113,9 +126,20 @@
113 if (this.treeCheckIndex >= 1) { 126 if (this.treeCheckIndex >= 1) {
114 this.treeCheckIndex--; 127 this.treeCheckIndex--;
115 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial; 128 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial;
116 this.previewImg.index = this.previewImg.imgList.length; 129 // 判断页数
117 this.previewImg.imgList = this.tableData[this.treeCheckIndex].children; 130 let ys = this.tableData[this.treeCheckIndex].ys
131 if (ys > 0) {
132 getFileListByBsmMaterial(this.treeCheckId).then(res => {
133 this.previewImg.imgList = res.result ? res.result : []
134 this.previewImg.index = this.previewImg.imgList.length - 1;
135 })
136 } else {
137 this.previewImg.imgList = [];
138 this.previewImg.index = 0
139 }
118 this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial; 140 this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial;
141 } else {
142 this.$message.error('没有第一张了');
119 } 143 }
120 }, 144 },
121 /** 145 /**
...@@ -167,14 +191,14 @@ ...@@ -167,14 +191,14 @@
167 */ 191 */
168 updateList (val) { 192 updateList (val) {
169 let that = this; 193 let that = this;
170 if (val.children.length != 0) { 194 if (val.length != 0) {
171 //删除最后一张图片时 val=null 195 //删除最后一张图片时 val=null
172 this.tableData.forEach((item) => { 196 this.tableData.forEach((item) => {
173 if (item.bsmMaterial === val.bsmMaterial) { 197 if (item.bsmMaterial === val.bsmMaterial) {
174 item.children = val.children; 198 item.ys = val.length
175 } 199 }
176 }); 200 });
177 this.previewImg.imgList = _.cloneDeep(val.children); 201 this.previewImg.imgList = _.cloneDeep(val);
178 if (this.previewImg.index == this.previewImg.imgList.length) { 202 if (this.previewImg.index == this.previewImg.imgList.length) {
179 this.previewImg.index = this.previewImg.index - 1; 203 this.previewImg.index = this.previewImg.index - 1;
180 } 204 }
...@@ -183,7 +207,7 @@ ...@@ -183,7 +207,7 @@
183 this.previewImg.imgList = []; 207 this.previewImg.imgList = [];
184 this.tableData.forEach((item, index) => { 208 this.tableData.forEach((item, index) => {
185 if (this.treeCheckId == item.bsmMaterial) { 209 if (this.treeCheckId == item.bsmMaterial) {
186 item.children = []; 210 item.ys = 0;
187 that.treeCheckIndex = index; 211 that.treeCheckIndex = index;
188 } 212 }
189 }) 213 })
......