1ab48d09 by renchao@pashanhoo.com

style:登记薄模块功跳转材料信息模

1 parent f2140c02
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-14 17:11:15 4 * @LastEditTime: 2023-09-19 09:30:13
5 --> 5 -->
6 <template> 6 <template>
7 <transition name="msgbox-fade"> 7 <transition name="msgbox-fade">
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
160 .mask-content { 160 .mask-content {
161 padding: 5px 20px 30px 20px; 161 padding: 5px 20px 30px 20px;
162 width: 100%; 162 width: 100%;
163 min-height: 253px; 163 min-height: 360px;
164 max-height: 90vh; 164 max-height: 90vh;
165 overflow-y: scroll; 165 overflow-y: scroll;
166 } 166 }
......
1 <!-- 这是补录的业务流程模块 -->
...\ No newline at end of file ...\ No newline at end of file
1 这是登记薄材料明细
2 补录数据和临时数据
...\ No newline at end of file ...\ No newline at end of file
1 <!-- 这是补录信息的材料文件 -->
...\ No newline at end of file ...\ No newline at end of file
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-18 16:49:25 4 * @LastEditTime: 2023-09-18 17:04:46
5 --> 5 -->
6 <template> 6 <template>
7 <dialogBox title="新建材料信息" width="20%" isMain v-model="myValue" @closeDialog="closeDialog" @submitForm="handleSubmit" 7 <dialogBox title="新建材料信息" width="20%" isMain v-model="myValue" @closeDialog="closeDialog" @submitForm="handleSubmit"
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
47 ruleForm: { 47 ruleForm: {
48 cllx: "", 48 cllx: "",
49 clmc: "", 49 clmc: "",
50 clbm: "" 50 clbm: "",
51 sfggcl: "0"
51 }, 52 },
52 rules: { 53 rules: {
53 cllx: [ 54 cllx: [
...@@ -77,7 +78,8 @@ ...@@ -77,7 +78,8 @@
77 this.ruleForm = { 78 this.ruleForm = {
78 cllx: "", 79 cllx: "",
79 clmc: "", 80 clmc: "",
80 clbm: "" 81 clbm: "",
82 sfggcl: "0"
81 } 83 }
82 }, 84 },
83 /** 85 /**
...@@ -91,7 +93,8 @@ ...@@ -91,7 +93,8 @@
91 this.ruleForm = { 93 this.ruleForm = {
92 cllx: "", 94 cllx: "",
93 clmc: "", 95 clmc: "",
94 clbm: "" 96 clbm: "",
97 sfggcl: "0"
95 } 98 }
96 this.$emit("input", false); 99 this.$emit("input", false);
97 } else { 100 } else {
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-14 11:14:54 4 * @LastEditTime: 2023-09-19 08:53:58
5 --> 5 -->
6 <template> 6 <template>
7 <div class="clmlmx-box"> 7 <div class="clmlmx-box">
8 <lb-table :column="column" :key="key" row-key="bsmMaterial" ref="listTable" :heightNumSetting="true" :calcHeight="500" :pagination="false" 8 <lb-table :column="column" :key="key" row-key="bsmSj" ref="listTable" :heightNumSetting="true" :calcHeight="600"
9 :data="tableData"> 9 :pagination="false" :data="tableData">
10 </lb-table> 10 </lb-table>
11 <div class="text-center"> 11 <div class="text-center">
12 <el-button @click="handleCancel">取消</el-button> 12 <el-button @click="$popupCacel">取消</el-button>
13 <el-button type="primary" @click="handleSubmit" :loading="loading">保存</el-button> 13 <el-button type="primary" @click="handleSubmit" v-if="formData.ableOperation && tableData.length>0" :loading="loading">保存</el-button>
14 </div> 14 </div>
15 </div> 15 </div>
16 </template> 16 </template>
17 <script> 17 <script>
18 import store from '@/store/index.js' 18 import Vue from 'vue'
19 import Sortable from 'sortablejs' 19 import Sortable from 'sortablejs'
20 import store from '@/store/index.js'
20 import { ywPopupCacel } from "@/utils/popup.js"; 21 import { ywPopupCacel } from "@/utils/popup.js";
21 import { editCompanyMaterialList } from "@/api/company.js"; 22 import { InitClml, updateClml } from "@/api/clxx.js";
22 export default { 23 export default {
23 props: { 24 props: {
24 formData: { 25 formData: {
...@@ -34,11 +35,41 @@ ...@@ -34,11 +35,41 @@
34 sortable: null, 35 sortable: null,
35 column: [ 36 column: [
36 { 37 {
38 prop: "isrequired",
39 label: "是否必选",
40 width: "80",
41 render: (h, scope) => {
42 if (scope.row.isrequired === "1") {
43 return (
44 <div>
45 <span>必选</span>
46 </div>
47 );
48 }
49 else {
50 return (
51 <div>
52 <span>可选</span>
53 </div>
54 )
55 }
56 }
57 },
58 {
37 label: "材料名称", 59 label: "材料名称",
38 render: (h, scope) => { 60 render: (h, scope) => {
39 return ( 61 return (
40 (scope.row.sfxjcl == '1') ? 62 (this.formData.ableOperation && scope.row.sfxjcl == '1') ?
41 <el-input value={scope.row.clmc} onInput={(val) => { scope.row.clmc = val }}></el-input> : <span>{scope.row.clmc}</span> 63 <el-input value={scope.row.sjmc} onInput={(val) => { scope.row.sjmc = val }}></el-input> : <span>{scope.row.sjmc}</span>
64 )
65 }
66 },
67 {
68 label: "材料编码",
69 render: (h, scope) => {
70 return (
71 (this.formData.ableOperation && scope.row.sfxjcl == '1') ?
72 <el-input value={scope.row.sjbm} onInput={(val) => { scope.row.sjbm = val }}></el-input> : <span>{scope.row.sjbm}</span>
42 ) 73 )
43 } 74 }
44 }, 75 },
...@@ -47,8 +78,9 @@ ...@@ -47,8 +78,9 @@
47 width: "110", 78 width: "110",
48 render: (h, scope) => { 79 render: (h, scope) => {
49 return ( 80 return (
50 <el-select value={scope.row.cllx} 81 this.formData.ableOperation ?
51 onChange={(val) => { scope.row.cllx = val }}> 82 <el-select value={scope.row.sjlx}
83 onChange={(val) => { scope.row.sjlx = val }}>
52 { 84 {
53 store.getters.dictData['A40'].map(option => { 85 store.getters.dictData['A40'].map(option => {
54 return ( 86 return (
...@@ -56,18 +88,40 @@ ...@@ -56,18 +88,40 @@
56 ) 88 )
57 }) 89 })
58 } 90 }
59 </el-select> 91 </el-select> : <span>{this.dicStatus(scope.row.sjlx, "A40")}</span>
60 ) 92 )
61 } 93 }
62 }, 94 },
63 { 95 {
64 label: "页数", 96 prop: "sjsl",
97 label: "收件数量",
65 width: "80", 98 width: "80",
66 render: (h, scope) => { 99 render: (h, scope) => {
67 if (scope.row.count && scope.row.count > 0) { 100 return (
101 (this.formData.ableOperation) ?
102 <el-input value={scope.row.sjsl} onInput={(val) => { scope.row.sjsl = val }}></el-input> : <span>{
103 scope.row.sjsl
104 }</span>
105 )
106 }
107 },
108 {
109 label: "扫描时间",
110 width: "140",
111 render: (h, scope) => {
112 return (
113 <span>{scope.row.sjsj}</span>
114 )
115 }
116 },
117 {
118 label: "页数",
119 width: "60",
120 render: (h, scope) => {
121 if (scope.row.ys && scope.row.ys > 0) {
68 return ( 122 return (
69 <div> 123 <div>
70 <span>{scope.row.count}</span> 124 <span>{scope.row.ys}</span>
71 </div> 125 </div>
72 ); 126 );
73 } else { 127 } else {
...@@ -80,6 +134,21 @@ ...@@ -80,6 +134,21 @@
80 }, 134 },
81 }, 135 },
82 { 136 {
137 label: "是否新建材料",
138 width: "80",
139 render: (h, scope) => {
140 if (scope.row.sfxjcl && scope.row.sfxjcl == '1') {
141 return (
142 <span></span>
143 );
144 } else {
145 return (
146 <span></span>
147 );
148 }
149 },
150 },
151 {
83 label: "操作", 152 label: "操作",
84 width: "100", 153 width: "100",
85 render: (h, scope) => { 154 render: (h, scope) => {
...@@ -87,7 +156,7 @@ ...@@ -87,7 +156,7 @@
87 <el-button 156 <el-button
88 type="text" 157 type="text"
89 icon="el-icon-delete" 158 icon="el-icon-delete"
90 disabled={scope.row.count != 0} 159 disabled={!(scope.row.ys == 0 && scope.row.sfxjcl == '1') || !this.formData.ableOperation}
91 onClick={() => { 160 onClick={() => {
92 this.handleDelete(scope.$index, scope.row); 161 this.handleDelete(scope.$index, scope.row);
93 }} 162 }}
...@@ -102,15 +171,6 @@ ...@@ -102,15 +171,6 @@
102 tableData: [] 171 tableData: []
103 } 172 }
104 }, 173 },
105 mounted () {
106 this.initSort()
107 this.tableData = _.cloneDeep(this.formData.data)
108 },
109 beforeDestroy () {
110 if (this.sortable) {
111 this.sortable.destroy();
112 }
113 },
114 watch: { 174 watch: {
115 'formData.data': { 175 'formData.data': {
116 handler: function (val, oldVal) { 176 handler: function (val, oldVal) {
...@@ -120,32 +180,61 @@ ...@@ -120,32 +180,61 @@
120 deep: true 180 deep: true
121 } 181 }
122 }, 182 },
123 methods: { 183 mounted () {
124 handleCancel () { 184 this.initSort()
125 ywPopupCacel() 185 },
186 beforeDestroy () {
187 if (this.sortable) {
188 this.sortable.destroy();
189 }
126 }, 190 },
191 methods: {
127 handleSubmit () { 192 handleSubmit () {
128 this.loading = true 193 this.loading = true
129 store.dispatch('user/reWorkFresh', false) 194 store.dispatch('user/reWorkFresh', false)
130 editCompanyMaterialList(this.tableData, this.formData.bsmCompany).then(res => { 195 updateClml(this.tableData, this.formData.bsmSldy, Vue.prototype.$currentRoute.query.bsmSlsq).then(res => {
131 this.loading = false 196 this.loading = false
132 if (res.code == 200) { 197 if (res.code == 200) {
133 this.$message({ 198 this.$message({
134 message: '保存成功', 199 message: '保存成功',
135 type: 'success' 200 type: 'success'
136 }) 201 })
137 store.dispatch('user/reWorkFresh', true)
138 ywPopupCacel() 202 ywPopupCacel()
203 store.dispatch('user/reWorkFresh', true)
139 } 204 }
140 }).catch(() => { 205 }).catch(() => {
141 this.loading = false 206 this.loading = false
142 }) 207 })
143 }, 208 },
144 /** 209 /**
210 * @description: 材料目录明细初始化
211 * @author: renchao
212 */
213 clmlInitList () {
214 return new Promise(resolve => {
215 this.unitData = this.$parent.unitData;
216 var formdata = new FormData();
217 formdata.append("bsmSlsq", Vue.prototype.$currentRoute.query.bsmSlsq);
218 formdata.append("bsmSldy", this.formData.bsmRepair);
219 formdata.append("clfl", 3);
220 InitClml(formdata).then((res) => {
221 if (res.code == 200) {
222 resolve(res.code)
223 if (res.result && res.result.length > 0) {
224 this.tableData = res.result;
225 } else {
226 this.tableData = []
227 }
228 } else {
229 this.$message.error(res.message)
230 }
231 })
232 })
233 },
234 /**
145 * @description: 材料目录删除 235 * @description: 材料目录删除
146 * @param {*} index 236 * @param {*} index
147 * @param {*} row 237 * @param {*} row
148 * @author: renchao
149 */ 238 */
150 handleDelete (index, row) { 239 handleDelete (index, row) {
151 this.$confirm('此操作将永久删除该 是否继续?', '提示', { 240 this.$confirm('此操作将永久删除该 是否继续?', '提示', {
...@@ -173,7 +262,19 @@ ...@@ -173,7 +262,19 @@
173 this.tableData.splice(evt.newIndex, 0, targetRow); 262 this.tableData.splice(evt.newIndex, 0, targetRow);
174 } 263 }
175 }) 264 })
265 },
266 dicStatus (val, code) {
267 let data = store.getters.dictData[code],
268 name = '暂无'
269 if (data) {
270 data.map((item) => {
271 if (item.dcode == val) {
272 name = item.dname
176 } 273 }
274 })
275 return name
276 }
277 },
177 } 278 }
178 } 279 }
179 </script> 280 </script>
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-14 16:24:07 4 * @LastEditTime: 2023-09-18 17:11:37
5 --> 5 -->
6 <template> 6 <template>
7 <div class="rlPopup"> 7 <div class="rlPopup">
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 <div class="img-list-wrap" v-Loading="loading"> 14 <div class="img-list-wrap" v-Loading="loading">
15 <img src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan" alt="高拍仪"> 15 <img src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan" alt="高拍仪">
16 <div v-for="(img, i) in previewImg.imgList" :key="i" v-else> 16 <div v-for="(img, i) in previewImg.imgList" :key="i" v-else>
17 <photo-zoom :url="img.fileurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2" 17 <photo-zoom :url="img.fjurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2"
18 overlayStyle="width: 100%;height:100%"> 18 overlayStyle="width: 100%;height:100%">
19 </photo-zoom> 19 </photo-zoom>
20 </div> 20 </div>
...@@ -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.fileurl"> 44 <img :src="img.fjurl">
45 </li> 45 </li>
46 </ul> 46 </ul>
47 </div> 47 </div>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
53 <script> 53 <script>
54 import PhotoZoom from '@/components/PhotoZoom' 54 import PhotoZoom from '@/components/PhotoZoom'
55 import { getAltimeterInfo, getUuid } from '@/utils/operation.js' 55 import { getAltimeterInfo, getUuid } from '@/utils/operation.js'
56 import { uploadBatch, deleteFile, move } from "@/api/company.js" 56 import { uploadBatch, deleteClmx, move } from "@/api/clxx.js";
57 import publicPicture from '@/components/publicPicture/index.vue' 57 import publicPicture from '@/components/publicPicture/index.vue'
58 export default { 58 export default {
59 name: 'PreviewImage', 59 name: 'PreviewImage',
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
86 // 缩略图 86 // 缩略图
87 thumbnailImages: [], 87 thumbnailImages: [],
88 showViewer: false, 88 showViewer: false,
89 initialIndex: 0, 89 initialIndex: undefined,
90 allLi: [], 90 allLi: [],
91 } 91 }
92 }, 92 },
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
94 previewImg: { 94 previewImg: {
95 handler (newValue, oldValue) { 95 handler (newValue, oldValue) {
96 if (newValue.imgList && newValue.imgList.length > 0) { 96 if (newValue.imgList && newValue.imgList.length > 0) {
97 this.allLi = _.cloneDeep(newValue.imgList).map(item => item.fileurl) 97 this.allLi = _.cloneDeep(newValue.imgList).map(item => item.fjurl)
98 this.thumbnailImages = newValue.imgList 98 this.thumbnailImages = newValue.imgList
99 } else { 99 } else {
100 this.allLi = [] 100 this.allLi = []
...@@ -134,18 +134,14 @@ ...@@ -134,18 +134,14 @@
134 setTimeout(() => { 134 setTimeout(() => {
135 this.scanTitle = '关闭高拍仪' 135 this.scanTitle = '关闭高拍仪'
136 this.loading = false 136 this.loading = false
137 }, 3000) 137 }, 4000)
138 } else { 138 } else {
139 this.scanTitle = '打开高拍仪' 139 this.scanTitle = '打开高拍仪'
140 } 140 }
141 }, 141 },
142 /** 142 // 左右移动
143 * @description: 左右移动
144 * @param {*} direction
145 * @author: renchao
146 */
147 handleMove (direction) { 143 handleMove (direction) {
148 move(this.previewImg.imgList[this.previewImg.index].bsmFile, direction).then(res => { 144 move(direction, this.previewImg.imgList[this.previewImg.index].bsmClmx).then(res => {
149 if (res.code == 200) { 145 if (res.code == 200) {
150 if (direction == 'left') { 146 if (direction == 'left') {
151 this.previewImg.index = this.previewImg.index - 1 147 this.previewImg.index = this.previewImg.index - 1
...@@ -153,7 +149,7 @@ ...@@ -153,7 +149,7 @@
153 this.previewImg.index = this.previewImg.index + 1 149 this.previewImg.index = this.previewImg.index + 1
154 } 150 }
155 this.initialIndex = this.previewImg.index 151 this.initialIndex = this.previewImg.index
156 this.$emit('updateList', { children: res.result, bsmMaterial: this.previewImg.bsmMaterial }) 152 this.$emit('updateList', { children: res.result, bsmSj: this.previewImg.bsmSj })
157 this.$message({ 153 this.$message({
158 message: '移动成功!', 154 message: '移动成功!',
159 type: 'success' 155 type: 'success'
...@@ -195,7 +191,7 @@ ...@@ -195,7 +191,7 @@
195 let file = blobToFile(blob); 191 let file = blobToFile(blob);
196 var formData = new FormData(); 192 var formData = new FormData();
197 formData.append('file', file) 193 formData.append('file', file)
198 formData.append("bsmMaterial ", this.previewImg.bsmMaterial); 194 formData.append("bsmSj", this.previewImg.bsmSj);
199 formData.append("bsmSlsq", this.previewImg.bsmSlsq); 195 formData.append("bsmSlsq", this.previewImg.bsmSlsq);
200 uploadSjClmx(formData).then((res) => { 196 uploadSjClmx(formData).then((res) => {
201 if (res.code == 200) { 197 if (res.code == 200) {
...@@ -292,13 +288,14 @@ ...@@ -292,13 +288,14 @@
292 this.key++ 288 this.key++
293 return; 289 return;
294 } 290 }
295 formData.append("bsmMaterial", this.previewImg.bsmMaterial); 291 formData.append("bsmSj", this.previewImg.bsmSj);
292 formData.append("bsmSlsq", this.previewImg.bsmSlsq);
296 if (this.previewImg.imgList.length > 0) { 293 if (this.previewImg.imgList.length > 0) {
297 formData.append("index", this.previewImg.imgList[this.previewImg.index].sxh); 294 formData.append("index", this.previewImg.imgList[this.previewImg.index].sxh);
298 } 295 }
299 uploadBatch(formData).then((res) => { 296 uploadBatch(formData).then((res) => {
300 if (res.code == 200) { 297 if (res.code == 200) {
301 this.$emit('updateList', { children: res.result, bsmMaterial: this.previewImg.bsmMaterial }) 298 this.$emit('updateList', { children: res.result, bsmSj: this.previewImg.bsmSj })
302 this.$message({ 299 this.$message({
303 message: '上传成功!', 300 message: '上传成功!',
304 type: 'success' 301 type: 'success'
...@@ -320,12 +317,12 @@ ...@@ -320,12 +317,12 @@
320 cancelButtonText: '取消', 317 cancelButtonText: '取消',
321 type: 'warning' 318 type: 'warning'
322 }).then(async () => { 319 }).then(async () => {
323 let bsmFile = this.previewImg.imgList[this.previewImg.index].bsmFile 320 let bsmClmx = this.previewImg.imgList[this.previewImg.index].bsmClmx
324 let bsmMaterial = this.previewImg.imgList[this.previewImg.index].bsmMaterial 321 let bsmSj = this.previewImg.imgList[this.previewImg.index].bsmSj
325 this.previewImg.imgList = this.previewImg.imgList.filter(item => item.bsmFile != bsmFile) 322 this.previewImg.imgList = this.previewImg.imgList.filter(item => item.bsmClmx != bsmClmx)
326 deleteFile(bsmFile).then(res => { 323 deleteClmx(bsmClmx).then(res => {
327 if (res.code == 200) { 324 if (res.code == 200) {
328 that.$emit('updateList', { children: this.previewImg.imgList, bsmMaterial: bsmMaterial }) 325 that.$emit('updateList', { children: this.previewImg.imgList, bsmSj: bsmSj })
329 that.$message({ 326 that.$message({
330 message: '删除成功!', 327 message: '删除成功!',
331 type: 'success' 328 type: 'success'
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-18 16:57:31 4 * @LastEditTime: 2023-09-19 09:28:13
5 --> 5 -->
6 <template> 6 <template>
7 <div class="clxx"> 7 <div class="clxx">
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
29 </div> 29 </div>
30 <div 30 <div
31 v-for="(item, index) in tableData" 31 v-for="(item, index) in tableData"
32 :key="item.bsmMaterial" 32 :key="item.bsmSj"
33 :class="['child', treeCheckId == item.bsmMaterial ? 'checked' : '']" 33 :class="['child', treeCheckId == item.bsmSj ? 'checked' : '']"
34 @click="treeClick(item, index)"> 34 @click="treeClick(item, index)">
35 {{ item.clmc }} 35 <span v-if="item.isrequired == 1" class="required">必选</span>
36 <span class="cl_number" :key="key" v-if="item.count">({{ item.count }})</span> 36 {{ item.sjmc }}
37 <span class="cl_number" :key="key" v-else>(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>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
62 import imagePreview from "./dialog/imagePreview.vue"; 62 import imagePreview from "./dialog/imagePreview.vue";
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 { repairInitClml, saveClml } from "@/api/clxx.js"; 65 import { repairInitClml, saveClml, getClmxList } from "@/api/clxx.js";
66 export default { 66 export default {
67 components: { clxxAddDialog, imagePreview, clxxDetailDialog }, 67 components: { clxxAddDialog, imagePreview, clxxDetailDialog },
68 props: { 68 props: {
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
83 key: 0, 83 key: 0,
84 tableData: [], 84 tableData: [],
85 previewImg: { 85 previewImg: {
86 bsmMaterial: "", 86 bsmSj: "",
87 index: 0, 87 index: 0,
88 selectedIndex: 0, 88 selectedIndex: 0,
89 imgList: [] 89 imgList: []
...@@ -116,19 +116,19 @@ ...@@ -116,19 +116,19 @@
116 if (this.treeCheckIndex < this.tableData.length) { 116 if (this.treeCheckIndex < this.tableData.length) {
117 this.treeCheckIndex++; 117 this.treeCheckIndex++;
118 if (this.tableData[this.treeCheckIndex]) { 118 if (this.tableData[this.treeCheckIndex]) {
119 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial; 119 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj;
120 // 判断页数 120 // 判断页数
121 let ys = this.tableData[this.treeCheckIndex].ys 121 let ys = this.tableData[this.treeCheckIndex].ys
122 this.previewImg.index = 0; 122 this.previewImg.index = 0;
123 // 获取材料明细 123 // 获取材料明细
124 if (ys > 0) { 124 if (ys > 0) {
125 getFileListByBsmMaterial(this.treeCheckId).then(res => { 125 getClmxList(this.treeCheckId).then(res => {
126 this.previewImg.imgList = res.result ? res.result : [] 126 this.previewImg.imgList = res.result ? res.result : []
127 }) 127 })
128 } else { 128 } else {
129 this.previewImg.imgList = [] 129 this.previewImg.imgList = []
130 } 130 }
131 this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial; 131 this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj;
132 } else { 132 } else {
133 this.$message.error('没有最后一张了'); 133 this.$message.error('没有最后一张了');
134 } 134 }
...@@ -141,11 +141,11 @@ ...@@ -141,11 +141,11 @@
141 prevPriview () { 141 prevPriview () {
142 if (this.treeCheckIndex >= 1) { 142 if (this.treeCheckIndex >= 1) {
143 this.treeCheckIndex--; 143 this.treeCheckIndex--;
144 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial; 144 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj;
145 // 判断页数 145 // 判断页数
146 let ys = this.tableData[this.treeCheckIndex].ys 146 let ys = this.tableData[this.treeCheckIndex].ys
147 if (ys > 0) { 147 if (ys > 0) {
148 getFileListByBsmMaterial(this.treeCheckId).then(res => { 148 getClmxList(this.treeCheckId).then(res => {
149 this.previewImg.imgList = res.result ? res.result : [] 149 this.previewImg.imgList = res.result ? res.result : []
150 this.previewImg.index = this.previewImg.imgList.length - 1; 150 this.previewImg.index = this.previewImg.imgList.length - 1;
151 }) 151 })
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
153 this.previewImg.imgList = []; 153 this.previewImg.imgList = [];
154 this.previewImg.index = 0 154 this.previewImg.index = 0
155 } 155 }
156 this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial; 156 this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj;
157 } else { 157 } else {
158 this.$message.error('没有第一张了'); 158 this.$message.error('没有第一张了');
159 } 159 }
...@@ -193,12 +193,12 @@ ...@@ -193,12 +193,12 @@
193 * @author: renchao 193 * @author: renchao
194 */ 194 */
195 setChecked (item) { 195 setChecked (item) {
196 this.treeCheckId = item.bsmMaterial; 196 this.treeCheckId = item.bsmSj;
197 this.title = item.sjmc; 197 this.title = item.sjmc;
198 this.titleYs = 1; 198 this.titleYs = 1;
199 this.titleNum = item.children.length; 199 this.titleNum = item.children.length;
200 this.previewImg.imgList = item.children; 200 this.previewImg.imgList = item.children;
201 this.previewImg.bsmMaterial = item.bsmMaterial; 201 this.previewImg.bsmSj = item.bsmSj;
202 }, 202 },
203 /** 203 /**
204 * @description: updateList 204 * @description: updateList
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
210 if (val.children.length != 0) { 210 if (val.children.length != 0) {
211 //删除最后一张图片时 val=null 211 //删除最后一张图片时 val=null
212 this.tableData.forEach((item) => { 212 this.tableData.forEach((item) => {
213 if (item.bsmMaterial == val.bsmMaterial) { 213 if (item.bsmSj == val.bsmSj) {
214 item.count = val.children.length 214 item.count = val.children.length
215 } 215 }
216 }); 216 });
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
222 } else { 222 } else {
223 this.previewImg.imgList = []; 223 this.previewImg.imgList = [];
224 this.tableData.forEach((item, index) => { 224 this.tableData.forEach((item, index) => {
225 if (this.treeCheckId == item.bsmMaterial) { 225 if (this.treeCheckId == item.bsmSj) {
226 item.count = 0; 226 item.count = 0;
227 that.treeCheckIndex = index; 227 that.treeCheckIndex = index;
228 } 228 }
...@@ -242,16 +242,35 @@ ...@@ -242,16 +242,35 @@
242 * @author: renchao 242 * @author: renchao
243 */ 243 */
244 addSave (data) { 244 addSave (data) {
245 saveClml({ ...data, bsmSldy: this.$parent.bsmRepair, bsmSlsq: this.$parent.bsmSlsq }).then(async (res) => { 245 let obj = {
246 bsmSlsq: this.$parent.bsmSlsq,
247 isrequired: "1",
248 sjmc: data.clmc,
249 sjsl: 0,
250 smzt: "",
251 ys: 0,
252 sjlx: data.cllx,
253 sjbm: data.clbm,
254 sfxjcl: "1", // 是否必选
255 sfggcl: data.sfggcl,
256 };
257 //是否公共材料
258 if (data.sfggcl == "0") {
259 obj["bsmSldy"] = this.$parent.currentSelectProps.bsmSldy;
260 }
261 if (this.$route.query.sqywbm == "DJBBL") {
262 obj.bsmSldy = this.$parent.bsmRepair
263 }
264 saveClml(obj).then(async (res) => {
246 if (res.code == 200) { 265 if (res.code == 200) {
247 let res = await this.clmlInitList(2); 266 let res = await this.clmlInitList(2);
248 if (res == 200) 267 if (res == 200)
249 this.$message({ 268 this.$message({
250 message: "新增成功", 269 message: "新增成功",
251 type: "success" 270 type: "success",
252 }) 271 });
253 } 272 }
254 }) 273 });
255 }, 274 },
256 /** 275 /**
257 * @description: 材料目录点击选中 276 * @description: 材料目录点击选中
...@@ -261,12 +280,12 @@ ...@@ -261,12 +280,12 @@
261 */ 280 */
262 treeClick (item, index) { 281 treeClick (item, index) {
263 this.previewImg.index = 0; 282 this.previewImg.index = 0;
264 this.treeCheckId = item?.bsmMaterial; 283 this.treeCheckId = item?.bsmSj;
265 this.treeCheckIndex = index; 284 this.treeCheckIndex = index;
266 getFileListByBsmMaterial(item.bsmMaterial).then(res => { 285 getClmxList(item.bsmSj).then(res => {
267 this.previewImg.imgList = res.result ? res.result : [] 286 this.previewImg.imgList = res.result ? res.result : []
268 }) 287 })
269 this.previewImg.bsmMaterial = item?.bsmMaterial; 288 this.previewImg.bsmSj = item?.bsmSj;
270 }, 289 },
271 /** 290 /**
272 * @description: 小图片点击 291 * @description: 小图片点击
...@@ -281,7 +300,7 @@ ...@@ -281,7 +300,7 @@
281 //查看明细 300 //查看明细
282 viewDetail () { 301 viewDetail () {
283 store.dispatch("user/reWorkFresh", false); 302 store.dispatch("user/reWorkFresh", false);
284 ywPopupDialog("申请材料目录", "xxba/components/clxx/dialog/clxxDetailDialog", { 303 ywPopupDialog("申请材料目录", "djbworkflow/components/clxx/dialog/clxxDetailDialog", {
285 data: this.tableData, 304 data: this.tableData,
286 }, "60%", true, false) 305 }, "60%", true, false)
287 }, 306 },
...@@ -393,6 +412,7 @@ ...@@ -393,6 +412,7 @@
393 line-height: 20px; 412 line-height: 20px;
394 transition: all 0.3s; 413 transition: all 0.3s;
395 padding: 8px 0; 414 padding: 8px 0;
415 overflow: hidden;
396 } 416 }
397 417
398 .child:hover { 418 .child:hover {
......
1 <!--
2 * @Description:
3 * @Autor: renchao
4 * @LastEditTime: 2023-09-15 15:38:53
5 -->
6 <template>
7 <div class="clmlmx-box">
8 <lb-table :column="column" :key="key" row-key="bsmMaterial" ref="listTable" :heightNumSetting="true" :calcHeight="500" :pagination="false"
9 :data="tableData">
10 </lb-table>
11 <div class="text-center">
12 <el-button @click="handleCancel">取消</el-button>
13 <el-button type="primary" @click="handleSubmit" :loading="loading">保存</el-button>
14 </div>
15 </div>
16 </template>
17 <script>
18 import store from '@/store/index.js'
19 import Sortable from 'sortablejs'
20 import { ywPopupCacel } from "@/utils/popup.js";
21 import { editCompanyMaterialList } from "@/api/company.js";
22 export default {
23 props: {
24 formData: {
25 type: Object,
26 default: () => {
27 return {}
28 }
29 }
30 },
31 data () {
32 return {
33 loading: false,
34 sortable: null,
35 column: [
36 {
37 label: "材料名称",
38 render: (h, scope) => {
39 return (
40 <el-input value={scope.row.clmc} onInput={(val) => { scope.row.clmc = val }}></el-input>
41 )
42 }
43 },
44 {
45 label: "材料编码",
46 render: (h, scope) => {
47 return (
48 <el-input value={scope.row.clbm} onInput={(val) => { scope.row.clbm = val }}></el-input>
49 )
50 }
51 },
52 {
53 label: "材料类型",
54 width: "110",
55 render: (h, scope) => {
56 return (
57 <el-select value={scope.row.cllx}
58 onChange={(val) => { scope.row.cllx = val }}>
59 {
60 store.getters.dictData['A40'].map(option => {
61 return (
62 <el-option label={option.dname} value={option.dcode}></el-option>
63 )
64 })
65 }
66 </el-select>
67 )
68 }
69 },
70 {
71 label: "页数",
72 width: "80",
73 render: (h, scope) => {
74 if (scope.row.count && scope.row.count > 0) {
75 return (
76 <div>
77 <span>{scope.row.count}</span>
78 </div>
79 );
80 } else {
81 return (
82 <div>
83 <span>0</span>
84 </div>
85 );
86 }
87 },
88 },
89 {
90 label: "操作",
91 width: "100",
92 render: (h, scope) => {
93 return (
94 <el-button
95 type="text"
96 icon="el-icon-delete"
97 disabled={scope.row.count != 0}
98 onClick={() => {
99 this.handleDelete(scope.$index, scope.row);
100 }}
101 >
102 删除
103 </el-button>
104 )
105 }
106 }
107 ],
108 key: 0,
109 tableData: []
110 }
111 },
112 mounted () {
113 this.initSort()
114 this.tableData = _.cloneDeep(this.formData.data)
115 },
116 beforeDestroy () {
117 if (this.sortable) {
118 this.sortable.destroy();
119 }
120 },
121 watch: {
122 'formData.data': {
123 handler: function (val, oldVal) {
124 this.tableData = _.cloneDeep(val)
125 },
126 immediate: true,
127 deep: true
128 }
129 },
130 methods: {
131 handleCancel () {
132 ywPopupCacel()
133 },
134 handleSubmit () {
135 this.loading = true
136 store.dispatch('user/reWorkFresh', false)
137 editCompanyMaterialList(this.tableData, this.formData.bsmCompany).then(res => {
138 this.loading = false
139 if (res.code == 200) {
140 this.$message({
141 message: '保存成功',
142 type: 'success'
143 })
144 store.dispatch('user/reWorkFresh', true)
145 ywPopupCacel()
146 }
147 }).catch(() => {
148 this.loading = false
149 })
150 },
151 /**
152 * @description: 材料目录删除
153 * @param {*} index
154 * @param {*} row
155 * @author: renchao
156 */
157 handleDelete (index, row) {
158 this.$confirm('此操作将永久删除该 是否继续?', '提示', {
159 confirmButtonText: '确定',
160 cancelButtonText: '取消',
161 type: 'warning'
162 }).then(() => {
163 this.tableData.splice(index, 1);
164 }).catch(() => {
165 this.$message({
166 type: 'info',
167 message: '已取消删除'
168 })
169 })
170 },
171 initSort () {
172 const el = this.$refs.listTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0]
173 this.sortable = Sortable.create(el, {
174 ghostClass: 'sortable-ghost',
175 setData: function (dataTransfer) {
176 dataTransfer.setData('Text', '')
177 },
178 onEnd: evt => {
179 const targetRow = this.tableData.splice(evt.oldIndex, 1)[0];
180 this.tableData.splice(evt.newIndex, 0, targetRow);
181 }
182 })
183 }
184 }
185 }
186 </script>
187 <style scoped lang='scss'>
188 @import "~@/styles/mixin.scss";
189 .clmlmx-box {
190 margin: 0 auto;
191 .title {
192 text-align: center;
193 height: 60px;
194 line-height: 60px;
195 border: 1px solid #dfe6ec;
196 font-size: 20px;
197 background: #81d3f81a;
198 margin-bottom: -1px;
199 }
200 }
201 </style>
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-14 16:24:07 4 * @LastEditTime: 2023-09-19 09:55:41
5 --> 5 -->
6 <template> 6 <template>
7 <div class="rlPopup"> 7 <div class="rlPopup">
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
12 <i class="el-icon-arrow-right"></i> 12 <i class="el-icon-arrow-right"></i>
13 </div> 13 </div>
14 <div class="img-list-wrap" v-Loading="loading"> 14 <div class="img-list-wrap" v-Loading="loading">
15 <img src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan" alt="高拍仪"> 15 <img src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan" alt="">
16 <div v-for="(img, i) in previewImg.imgList" :key="i" v-else> 16 <div v-for="(img, i) in previewImg.imgList" :key="i" v-else>
17 <photo-zoom :url="img.fileurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2" 17 <photo-zoom :url="img.fjurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2"
18 overlayStyle="width: 100%;height:100%"> 18 overlayStyle="width: 100%;height:100%">
19 </photo-zoom> 19 </photo-zoom>
20 </div> 20 </div>
...@@ -23,25 +23,24 @@ ...@@ -23,25 +23,24 @@
23 <div class="thumb-wrap"> 23 <div class="thumb-wrap">
24 <div class="thumb-wrap-button"> 24 <div class="thumb-wrap-button">
25 <el-button type="primary" @click="clickImage" v-if="previewImg.imgList.length>0">(放大) 显示(缩小)</el-button> 25 <el-button type="primary" @click="clickImage" v-if="previewImg.imgList.length>0">(放大) 显示(缩小)</el-button>
26 <el-upload class="fileUpdate" ref="upload" :key="key" action="" :show-file-list="false" :multiple="true" :auto-upload="false" 26 <!-- <el-upload class="fileUpdate" ref="upload" :key="key" action="" :show-file-list="false" :multiple="true" :auto-upload="false"
27 :on-change="handleChange" 27 :on-change="handleChange"
28 accept=".JPG, .PNG, .JPEG,.jpg, .png, .jpeg"> 28 accept=".JPG, .PNG, .JPEG,.jpg, .png, .jpeg">
29 <el-button icon="el-icon-upload" type="primary" v-if="ableOperation">上传</el-button> 29 <el-button icon="el-icon-upload" type="primary" v-if="ableOperation">上传</el-button>
30 </el-upload> 30 </el-upload> -->
31 <!-- 左移右移 --> 31 <!-- <el-button type="primary" @click="handleMove('left')" v-if="ableOperation">左移</el-button>
32 <el-button type="primary" @click="handleMove('left')" v-if="ableOperation">左移</el-button> 32 <el-button type="primary" @click="handleMove('right')" v-if="ableOperation">右移</el-button> -->
33 <el-button type="primary" @click="handleMove('right')" v-if="ableOperation">右移</el-button> 33 <!-- <el-button type="primary" icon="el-icon-delete-solid" @click="handleDelete"
34 <el-button type="primary" icon="el-icon-delete-solid" @click="handleDelete"
35 v-if="thumbnailImages.length>0 && ableOperation">删除</el-button> 34 v-if="thumbnailImages.length>0 && ableOperation">删除</el-button>
36 <div v-if="ableOperation" class="pl-5"> 35 <div v-if="ableOperation" class="pl-5">
37 <el-button type="primary" @click="handleOpenScan" v-if="ableOperation" :loading="loading">{{scanTitle}}</el-button> 36 <el-button type="primary" @click="handleOpenScan" v-if="ableOperation" :loading="loading">{{scanTitle}}</el-button>
38 <el-button type="primary" @click="handleViewScan" v-if="isScan && ableOperation">拍照</el-button> 37 <el-button type="primary" @click="handleViewScan" v-if="isScan && ableOperation">拍照</el-button>
39 </div> 38 </div> -->
40 </div> 39 </div>
41 <ul> 40 <ul>
42 <li v-for="(img, index) in thumbnailImages" :key="index" :class="{ active: previewImg.index === index }" 41 <li v-for="(img, index) in thumbnailImages" :key="index" :class="{ active: previewImg.index === index }"
43 @click="showCurrent(index)"> 42 @click="showCurrent(index)">
44 <img :src="img.fileurl"> 43 <img :src="img.fjurl">
45 </li> 44 </li>
46 </ul> 45 </ul>
47 </div> 46 </div>
...@@ -52,8 +51,6 @@ ...@@ -52,8 +51,6 @@
52 </template> 51 </template>
53 <script> 52 <script>
54 import PhotoZoom from '@/components/PhotoZoom' 53 import PhotoZoom from '@/components/PhotoZoom'
55 import { getAltimeterInfo, getUuid } from '@/utils/operation.js'
56 import { uploadBatch, deleteFile, move } from "@/api/company.js"
57 import publicPicture from '@/components/publicPicture/index.vue' 54 import publicPicture from '@/components/publicPicture/index.vue'
58 export default { 55 export default {
59 name: 'PreviewImage', 56 name: 'PreviewImage',
...@@ -94,7 +91,7 @@ ...@@ -94,7 +91,7 @@
94 previewImg: { 91 previewImg: {
95 handler (newValue, oldValue) { 92 handler (newValue, oldValue) {
96 if (newValue.imgList && newValue.imgList.length > 0) { 93 if (newValue.imgList && newValue.imgList.length > 0) {
97 this.allLi = _.cloneDeep(newValue.imgList).map(item => item.fileurl) 94 this.allLi = _.cloneDeep(newValue.imgList).map(item => item.fjurl)
98 this.thumbnailImages = newValue.imgList 95 this.thumbnailImages = newValue.imgList
99 } else { 96 } else {
100 this.allLi = [] 97 this.allLi = []
...@@ -119,99 +116,6 @@ ...@@ -119,99 +116,6 @@
119 } 116 }
120 }, 117 },
121 methods: { 118 methods: {
122 /**
123 * @description: 打开高拍仪
124 * @author: renchao
125 */
126 handleOpenScan () {
127 this.isScan = !this.isScan
128 if (this.isScan) {
129 this.loading = true
130 this.$message({
131 message: '正在启动程序请稍等',
132 type: 'success'
133 })
134 setTimeout(() => {
135 this.scanTitle = '关闭高拍仪'
136 this.loading = false
137 }, 3000)
138 } else {
139 this.scanTitle = '打开高拍仪'
140 }
141 },
142 /**
143 * @description: 左右移动
144 * @param {*} direction
145 * @author: renchao
146 */
147 handleMove (direction) {
148 move(this.previewImg.imgList[this.previewImg.index].bsmFile, direction).then(res => {
149 if (res.code == 200) {
150 if (direction == 'left') {
151 this.previewImg.index = this.previewImg.index - 1
152 } else {
153 this.previewImg.index = this.previewImg.index + 1
154 }
155 this.initialIndex = this.previewImg.index
156 this.$emit('updateList', { children: res.result, bsmMaterial: this.previewImg.bsmMaterial })
157 this.$message({
158 message: '移动成功!',
159 type: 'success'
160 })
161 } else {
162 this.$message.error(res.message);
163 }
164 })
165 },
166 /**
167 * @description: 拍照
168 * @author: renchao
169 */
170 handleViewScan () {
171 function dataURLtoBlob (base64String) {
172 const arr = base64String.split(',');
173 if (arr.length !== 2) {
174 throw new Error('Invalid Base64 format');
175 }
176 const mime = arr[0].match(/:(.*?);/)[1];
177 if (!mime) {
178 throw new Error('Cannot retrieve MIME type');
179 }
180 const bstr = atob(arr[1]);
181 const n = bstr.length;
182 const u8arr = new Uint8Array(n);
183 for (let i = 0; i < n; i++) {
184 u8arr[i] = bstr.charCodeAt(i);
185 }
186 return new Blob([u8arr], { type: mime });
187 }
188 function blobToFile (blob) {
189 let name = getUuid(8) + '.jpg'
190 const file = new File([blob], name);
191 return file;
192 }
193 getAltimeterInfo().then(res => {
194 let blob = dataURLtoBlob('data:image/png;base64,' + res.data.photoBase64);
195 let file = blobToFile(blob);
196 var formData = new FormData();
197 formData.append('file', file)
198 formData.append("bsmMaterial ", this.previewImg.bsmMaterial);
199 formData.append("bsmSlsq", this.previewImg.bsmSlsq);
200 uploadSjClmx(formData).then((res) => {
201 if (res.code == 200) {
202 this.$emit('updateList', res.result)
203 this.$message({
204 message: '上传成功!',
205 type: 'success'
206 })
207 }
208 })
209 })
210 },
211 /**
212 * @description: prev
213 * @author: renchao
214 */
215 prev () { 119 prev () {
216 let len = this.previewImg.imgList.length 120 let len = this.previewImg.imgList.length
217 if (this.isFirst || len == 0) { 121 if (this.isFirst || len == 0) {
...@@ -254,90 +158,6 @@ ...@@ -254,90 +158,6 @@
254 */ 158 */
255 clickImage () { 159 clickImage () {
256 this.showViewer = true 160 this.showViewer = true
257 },
258 /**
259 * @description: handleChange
260 * @param {*} file
261 * @param {*} files
262 * @author: renchao
263 */
264 async handleChange (file, fileList) {
265 let length = fileList.length;
266 this.maxFileLength = Math.max(length, this.maxFileLength)
267 var formData = new FormData();
268 setTimeout(() => {
269 if (this.maxFileLength !== length) {
270 return
271 }
272 let num = 0, max = 0;
273 const isLt5M = file.size / 1024 / 1024 < 5;
274 fileList.forEach(item => {
275 if (!isLt5M) {
276 max++
277 }
278 if (!['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(item.raw.type)) {
279 num++
280 } else {
281 formData.append('file', item.raw)
282 }
283 })
284 if (num >= 1) {
285 this.$message.error("请选择jpeg/png/jpg/bmp/gif格式的图片后重试")
286 // 移除不支持的文件类型
287 this.key++
288 return;
289 }
290 if (max >= 1) {
291 this.$message.error('上传图片大小不能超过 5MB!');
292 this.key++
293 return;
294 }
295 formData.append("bsmMaterial", this.previewImg.bsmMaterial);
296 if (this.previewImg.imgList.length > 0) {
297 formData.append("index", this.previewImg.imgList[this.previewImg.index].sxh);
298 }
299 uploadBatch(formData).then((res) => {
300 if (res.code == 200) {
301 this.$emit('updateList', { children: res.result, bsmMaterial: this.previewImg.bsmMaterial })
302 this.$message({
303 message: '上传成功!',
304 type: 'success'
305 })
306 this.$refs.upload.clearFiles();
307 this.maxFileLength = 0
308 }
309 })
310 }, 0)
311 },
312 /**
313 * @description: handleDelete
314 * @author: renchao
315 */
316 handleDelete () {
317 let that = this
318 this.$confirm('此操作将永久删除, 是否继续?', '提示', {
319 confirmButtonText: '确定',
320 cancelButtonText: '取消',
321 type: 'warning'
322 }).then(async () => {
323 let bsmFile = this.previewImg.imgList[this.previewImg.index].bsmFile
324 let bsmMaterial = this.previewImg.imgList[this.previewImg.index].bsmMaterial
325 this.previewImg.imgList = this.previewImg.imgList.filter(item => item.bsmFile != bsmFile)
326 deleteFile(bsmFile).then(res => {
327 if (res.code == 200) {
328 that.$emit('updateList', { children: this.previewImg.imgList, bsmMaterial: bsmMaterial })
329 that.$message({
330 message: '删除成功!',
331 type: 'success'
332 })
333 }
334 })
335 }).catch(() => {
336 this.$message({
337 type: 'info',
338 message: '已取消删除'
339 })
340 })
341 } 161 }
342 } 162 }
343 } 163 }
...@@ -378,14 +198,14 @@ ...@@ -378,14 +198,14 @@
378 } 198 }
379 199
380 .next { 200 .next {
381 right: 1%; 201 right: 5%;
382 } 202 }
383 203
384 .img-list-wrap { 204 .img-list-wrap {
385 width: 100%; 205 width: calc(100% - 30px);
386 display: flex; 206 display: flex;
387 justify-content: center; 207 justify-content: center;
388 height: calc(100% - 80px); 208 height: calc(100% - 150px);
389 align-items: center; 209 align-items: center;
390 background: rgba(194, 190, 190, 0.1); 210 background: rgba(194, 190, 190, 0.1);
391 overflow: scroll; 211 overflow: scroll;
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-18 16:14:31 4 * @LastEditTime: 2023-09-19 09:47:05
5 --> 5 -->
6 <template> 6 <template>
7 <div class="clxx"> 7 <div class="clxx">
8 <div class="right">
9 <!-- 材料预览 --> 8 <!-- 材料预览 -->
10 <div class="clyl-box"> 9 <div class="clyl-box">
11 <div class="menu-tree"> 10 <div class="menu-tree">
12 <el-button 11 <!-- <el-button
13 type="primary" 12 type="primary"
14 native-type="submit" 13 native-type="submit"
15 @click="viewDetail" 14 @click="viewDetail"
16 style="width: 100%; margin-top: 10px" v-if="tableData.length > 0">申请材料目录</el-button> 15 style="width: 100%; margin-top: 10px" v-if="tableData.length > 0">申请材料目录</el-button> -->
17 <div class="item"> 16 <div class="item">
18 材料目录({{ tableData.length }}) 17 材料目录({{ tableData.length }})
19 <div style="margin-top: 10px"> 18 <div style="margin-top: 10px">
...@@ -29,40 +28,31 @@ ...@@ -29,40 +28,31 @@
29 </div> 28 </div>
30 <div 29 <div
31 v-for="(item, index) in tableData" 30 v-for="(item, index) in tableData"
32 :key="item.bsmMaterial" 31 :key="item.bsmSj"
33 :class="['child', treeCheckId == item.bsmMaterial ? 'checked' : '']" 32 :class="['child', treeCheckId == item.bsmSj ? 'checked' : '']"
34 @click="treeClick(item, index)"> 33 @click="treeClick(item, index)">
35 {{ item.clmc }} 34 <span v-if="item.isrequired == 1" class="required">必选</span>
36 <span class="cl_number" :key="key" v-if="item.count">({{ item.count }})</span> 35 {{ item.sjmc }}
37 <span class="cl_number" :key="key" v-else>(0)</span> 36 <span class="cl_number" :key="key">({{ item.ys ? item.ys : 0 }})</span>
38 </div> 37 </div>
39 </div> 38 </div>
40 </div> 39 </div>
41 <el-button
42 type="primary"
43 native-type="submit"
44 style="width: 100%"
45 @click="handleAdd()">新增</el-button>
46 </div> 40 </div>
47 <image-preview 41 <image-preview
48 ref="imageRef" 42 ref="imageRef"
49 v-if="tableData.length > 0" 43 v-if="tableData.length > 0"
50 :previewImg="previewImg" 44 :previewImg="previewImg"
51 @updateList="updateList"
52 @nextPriview="nextPriview" 45 @nextPriview="nextPriview"
53 @prevPriview="prevPriview" /> 46 @prevPriview="prevPriview" />
54 </div> 47 </div>
55 </div> 48 </div>
56 </div>
57 </template> 49 </template>
58 <script> 50 <script>
59 import store from '@/store/index.js' 51 import store from '@/store/index.js'
60 import { ywPopupDialog } from "@/utils/popup.js";
61 import imagePreview from "./dialog/imagePreview.vue"; 52 import imagePreview from "./dialog/imagePreview.vue";
62 import clxxDetailDialog from "./dialog/clxxDetailDialog.vue"; 53 import { repairInitClml, getClmxList } from "@/api/clxx.js";
63 import { repairInitClml, saveClml, getClmxList } from "@/api/clxx.js";
64 export default { 54 export default {
65 components: { imagePreview, clxxDetailDialog }, 55 components: { imagePreview },
66 props: { 56 props: {
67 formData: { 57 formData: {
68 type: Object, 58 type: Object,
...@@ -80,7 +70,7 @@ ...@@ -80,7 +70,7 @@
80 key: 0, 70 key: 0,
81 tableData: [], 71 tableData: [],
82 previewImg: { 72 previewImg: {
83 bsmMaterial: "", 73 bsmSj: "",
84 index: 0, 74 index: 0,
85 selectedIndex: 0, 75 selectedIndex: 0,
86 imgList: [] 76 imgList: []
...@@ -113,19 +103,19 @@ ...@@ -113,19 +103,19 @@
113 if (this.treeCheckIndex < this.tableData.length) { 103 if (this.treeCheckIndex < this.tableData.length) {
114 this.treeCheckIndex++; 104 this.treeCheckIndex++;
115 if (this.tableData[this.treeCheckIndex]) { 105 if (this.tableData[this.treeCheckIndex]) {
116 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial; 106 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj;
117 // 判断页数 107 // 判断页数
118 let ys = this.tableData[this.treeCheckIndex].ys 108 let ys = this.tableData[this.treeCheckIndex].ys
119 this.previewImg.index = 0; 109 this.previewImg.index = 0;
120 // 获取材料明细 110 // 获取材料明细
121 if (ys > 0) { 111 if (ys > 0) {
122 getFileListByBsmMaterial(this.treeCheckId).then(res => { 112 getClmxList(this.treeCheckId).then(res => {
123 this.previewImg.imgList = res.result ? res.result : [] 113 this.previewImg.imgList = res.result ? res.result : []
124 }) 114 })
125 } else { 115 } else {
126 this.previewImg.imgList = [] 116 this.previewImg.imgList = []
127 } 117 }
128 this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial; 118 this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj;
129 } else { 119 } else {
130 this.$message.error('没有最后一张了'); 120 this.$message.error('没有最后一张了');
131 } 121 }
...@@ -138,11 +128,11 @@ ...@@ -138,11 +128,11 @@
138 prevPriview () { 128 prevPriview () {
139 if (this.treeCheckIndex >= 1) { 129 if (this.treeCheckIndex >= 1) {
140 this.treeCheckIndex--; 130 this.treeCheckIndex--;
141 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial; 131 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj;
142 // 判断页数 132 // 判断页数
143 let ys = this.tableData[this.treeCheckIndex].ys 133 let ys = this.tableData[this.treeCheckIndex].ys
144 if (ys > 0) { 134 if (ys > 0) {
145 getFileListByBsmMaterial(this.treeCheckId).then(res => { 135 getClmxList(this.treeCheckId).then(res => {
146 this.previewImg.imgList = res.result ? res.result : [] 136 this.previewImg.imgList = res.result ? res.result : []
147 this.previewImg.index = this.previewImg.imgList.length - 1; 137 this.previewImg.index = this.previewImg.imgList.length - 1;
148 }) 138 })
...@@ -150,7 +140,7 @@ ...@@ -150,7 +140,7 @@
150 this.previewImg.imgList = []; 140 this.previewImg.imgList = [];
151 this.previewImg.index = 0 141 this.previewImg.index = 0
152 } 142 }
153 this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial; 143 this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj;
154 } else { 144 } else {
155 this.$message.error('没有第一张了'); 145 this.$message.error('没有第一张了');
156 } 146 }
...@@ -190,41 +180,12 @@ ...@@ -190,41 +180,12 @@
190 * @author: renchao 180 * @author: renchao
191 */ 181 */
192 setChecked (item) { 182 setChecked (item) {
193 this.treeCheckId = item.bsmMaterial; 183 this.treeCheckId = item.bsmSj;
194 this.title = item.sjmc; 184 this.title = item.sjmc;
195 this.titleYs = 1; 185 this.titleYs = 1;
196 this.titleNum = item.children.length; 186 this.titleNum = item.children.length;
197 this.previewImg.imgList = item.children; 187 this.previewImg.imgList = item.children;
198 this.previewImg.bsmMaterial = item.bsmMaterial; 188 this.previewImg.bsmSj = item.bsmSj;
199 },
200 /**
201 * @description: updateList
202 * @param {*} val
203 * @author: renchao
204 */
205 updateList (val) {
206 let that = this;
207 if (val.children.length != 0) {
208 //删除最后一张图片时 val=null
209 this.tableData.forEach((item) => {
210 if (item.bsmMaterial == val.bsmMaterial) {
211 item.count = val.children.length
212 }
213 });
214 this.previewImg.imgList = _.cloneDeep(val.children);
215 if (this.previewImg.index == this.previewImg.imgList.length) {
216 this.previewImg.index = this.previewImg.index - 1;
217 }
218 this.key++
219 } else {
220 this.previewImg.imgList = [];
221 this.tableData.forEach((item, index) => {
222 if (this.treeCheckId == item.bsmMaterial) {
223 item.count = 0;
224 that.treeCheckIndex = index;
225 }
226 })
227 }
228 }, 189 },
229 /** 190 /**
230 * @description: 材料目录点击选中 191 * @description: 材料目录点击选中
...@@ -234,12 +195,12 @@ ...@@ -234,12 +195,12 @@
234 */ 195 */
235 treeClick (item, index) { 196 treeClick (item, index) {
236 this.previewImg.index = 0; 197 this.previewImg.index = 0;
237 this.treeCheckId = item?.bsmMaterial; 198 this.treeCheckId = item?.bsmSj;
238 this.treeCheckIndex = index; 199 this.treeCheckIndex = index;
239 getClmxList(item.bsmMaterial).then(res => { 200 getClmxList(item.bsmSj).then(res => {
240 this.previewImg.imgList = res.result ? res.result : [] 201 this.previewImg.imgList = res.result ? res.result : []
241 }) 202 })
242 this.previewImg.bsmMaterial = item?.bsmMaterial; 203 this.previewImg.bsmSj = item?.bsmSj;
243 }, 204 },
244 /** 205 /**
245 * @description: 小图片点击 206 * @description: 小图片点击
...@@ -251,14 +212,6 @@ ...@@ -251,14 +212,6 @@
251 this.showImg = item; 212 this.showImg = item;
252 this.titleYs = index + 1; 213 this.titleYs = index + 1;
253 }, 214 },
254 //查看明细
255 viewDetail () {
256 store.dispatch("user/reWorkFresh", false);
257 ywPopupDialog("申请材料目录", "xxba/components/clxx/dialog/clxxDetailDialog", {
258 data: this.tableData,
259 bsmCompany: this.formData.bsmCompany
260 }, "50%", true, false)
261 },
262 //设置tableData 215 //设置tableData
263 setTableData (tableData) { 216 setTableData (tableData) {
264 this.$nextTick((res) => { 217 this.$nextTick((res) => {
...@@ -287,10 +240,8 @@ ...@@ -287,10 +240,8 @@
287 240
288 .clxx { 241 .clxx {
289 width: 100%; 242 width: 100%;
290 height: 94%; 243 height: 100%;
291 min-height: 360px; 244 min-height: 600px;
292 display: flex;
293 padding-left: 5px;
294 .left { 245 .left {
295 display: flex; 246 display: flex;
296 flex-direction: column; 247 flex-direction: column;
...@@ -312,10 +263,6 @@ ...@@ -312,10 +263,6 @@
312 } 263 }
313 } 264 }
314 265
315 .right {
316 width: 100%;
317 height: 100%;
318
319 .clmlmx-box { 266 .clmlmx-box {
320 margin: 0 auto; 267 margin: 0 auto;
321 268
...@@ -334,6 +281,7 @@ ...@@ -334,6 +281,7 @@
334 width: 100%; 281 width: 100%;
335 height: 100%; 282 height: 100%;
336 display: flex; 283 display: flex;
284 position: absolute;
337 285
338 .menu-tree { 286 .menu-tree {
339 width: 20%; 287 width: 20%;
...@@ -368,6 +316,7 @@ ...@@ -368,6 +316,7 @@
368 line-height: 20px; 316 line-height: 20px;
369 transition: all 0.3s; 317 transition: all 0.3s;
370 padding: 8px 0; 318 padding: 8px 0;
319 overflow: hidden;
371 } 320 }
372 321
373 .child:hover { 322 .child:hover {
...@@ -391,5 +340,4 @@ ...@@ -391,5 +340,4 @@
391 } 340 }
392 } 341 }
393 } 342 }
394 }
395 </style> 343 </style>
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-18 15:48:15 4 * @LastEditTime: 2023-09-19 09:12:32
5 --> 5 -->
6 <template> 6 <template>
7 <div class="tableBox"> 7 <div class="tableBox">
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-18 16:28:16 4 * @LastEditTime: 2023-09-18 17:22:36
5 --> 5 -->
6 <template> 6 <template>
7 <div class="clxx"> 7 <div class="clxx">
...@@ -261,6 +261,7 @@ ...@@ -261,6 +261,7 @@
261 smzt: "", 261 smzt: "",
262 ys: 0, 262 ys: 0,
263 sjlx: data.cllx, 263 sjlx: data.cllx,
264 sjbm: data.clbm,
264 sfxjcl: "1", // 是否必选 265 sfxjcl: "1", // 是否必选
265 sfggcl: data.sfggcl, 266 sfggcl: data.sfggcl,
266 }; 267 };
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-15 10:04:28 4 * @LastEditTime: 2023-09-18 17:21:36
5 --> 5 -->
6 <template> 6 <template>
7 <div class="clmlmx-box"> 7 <div class="clmlmx-box">
...@@ -64,6 +64,15 @@ ...@@ -64,6 +64,15 @@
64 } 64 }
65 }, 65 },
66 { 66 {
67 label: "材料编码",
68 render: (h, scope) => {
69 return (
70 (this.formData.ableOperation && scope.row.sfxjcl == '1') ?
71 <el-input value={scope.row.sjbm} onInput={(val) => { scope.row.sjbm = val }}></el-input> : <span>{scope.row.sjbm}</span>
72 )
73 }
74 },
75 {
67 label: "材料类型", 76 label: "材料类型",
68 width: "110", 77 width: "110",
69 render: (h, scope) => { 78 render: (h, scope) => {
......