d5cfac56 by renchao@pashanhoo.com

style:材料申请

1 parent e4dcb128
1 /* 1 /*
2 * @Description: 材料信息 2 * @Description: 材料信息
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-13 15:56:03 4 * @LastEditTime: 2023-09-18 16:03:16
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'))
...@@ -157,3 +157,17 @@ export function getClmxList (bsmSj) { ...@@ -157,3 +157,17 @@ export function getClmxList (bsmSj) {
157 } 157 }
158 }) 158 })
159 } 159 }
160 /**
161 * @description: 补录材料目录
162 * @param {*} data
163 * @author: renchao
164 */
165 export function repairInitClml (data) {
166 return request({
167 url: SERVER.SERVERAPI + '/rest/ywbl/clxx/repairInitClml',
168 method: 'post',
169 params: {
170 repair: data.bsmRepair
171 }
172 })
173 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -28,7 +28,7 @@ export function getXtParamsByYwh (ywh) { ...@@ -28,7 +28,7 @@ export function getXtParamsByYwh (ywh) {
28 */ 28 */
29 export function getBlParamsByYwh (ywh, bsmQlxx) { 29 export function getBlParamsByYwh (ywh, bsmQlxx) {
30 return request({ 30 return request({
31 url: SERVER.SERVERAPI + '​/rest​/ywbl​/djyw​/getBlParamsByYwh', 31 url: SERVER.SERVERAPI + '/rest/ywbl/djyw/getBlParamsByYwh',
32 method: 'get', 32 method: 'get',
33 params: { 33 params: {
34 ywh: ywh, 34 ywh: ywh,
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-07 15:04:46 4 * @LastEditTime: 2023-09-18 16:49:25
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"
...@@ -24,6 +24,13 @@ ...@@ -24,6 +24,13 @@
24 </el-form-item> 24 </el-form-item>
25 </el-col> 25 </el-col>
26 </el-row> 26 </el-row>
27 <el-row :gutter="20">
28 <el-col :span="24">
29 <el-form-item label="材料编码" prop="clbm">
30 <el-input v-model="ruleForm.clbm"></el-input>
31 </el-form-item>
32 </el-col>
33 </el-row>
27 </el-form> 34 </el-form>
28 </dialogBox> 35 </dialogBox>
29 </template> 36 </template>
...@@ -40,6 +47,7 @@ ...@@ -40,6 +47,7 @@
40 ruleForm: { 47 ruleForm: {
41 cllx: "", 48 cllx: "",
42 clmc: "", 49 clmc: "",
50 clbm: ""
43 }, 51 },
44 rules: { 52 rules: {
45 cllx: [ 53 cllx: [
...@@ -47,14 +55,17 @@ ...@@ -47,14 +55,17 @@
47 ], 55 ],
48 clmc: [ 56 clmc: [
49 { required: true, message: '请输入材料名称', trigger: 'blur' } 57 { required: true, message: '请输入材料名称', trigger: 'blur' }
58 ],
59 clbm: [
60 { required: true, message: '请输入材料编码', trigger: 'blur' }
50 ] 61 ]
51 } 62 }
52 } 63 }
53 }, 64 },
54 watch: { 65 watch: {
55 value (val) { 66 value (val) {
56 this.myValue = val; 67 this.myValue = val
57 }, 68 }
58 }, 69 },
59 methods: { 70 methods: {
60 /** 71 /**
...@@ -66,6 +77,7 @@ ...@@ -66,6 +77,7 @@
66 this.ruleForm = { 77 this.ruleForm = {
67 cllx: "", 78 cllx: "",
68 clmc: "", 79 clmc: "",
80 clbm: ""
69 } 81 }
70 }, 82 },
71 /** 83 /**
...@@ -79,6 +91,7 @@ ...@@ -79,6 +91,7 @@
79 this.ruleForm = { 91 this.ruleForm = {
80 cllx: "", 92 cllx: "",
81 clmc: "", 93 clmc: "",
94 clbm: ""
82 } 95 }
83 this.$emit("input", false); 96 this.$emit("input", false);
84 } else { 97 } else {
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-15 10:09:10 4 * @LastEditTime: 2023-09-18 16:57:31
5 --> 5 -->
6 <template> 6 <template>
7 <div class="clxx"> 7 <div class="clxx">
...@@ -62,9 +62,7 @@ ...@@ -62,9 +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 { getCompanyMaterialList, addCompanyMaterial, getFileListByBsmMaterial } from "@/api/company.js"; 65 import { repairInitClml, saveClml } from "@/api/clxx.js";
66 import { saveClml, getClmxList } from "@/api/clxx.js";
67 import { repairInitClml } from "@/api/djbRepair.js";
68 export default { 66 export default {
69 components: { clxxAddDialog, imagePreview, clxxDetailDialog }, 67 components: { clxxAddDialog, imagePreview, clxxDetailDialog },
70 props: { 68 props: {
...@@ -100,7 +98,7 @@ ...@@ -100,7 +98,7 @@
100 watch: { 98 watch: {
101 workFresh: { 99 workFresh: {
102 handler (newValue, oldValue) { 100 handler (newValue, oldValue) {
103 this.clmlInitList() 101 if (newValue) this.clmlInitList()
104 }, 102 },
105 deep: true, 103 deep: true,
106 immediate: true 104 immediate: true
...@@ -168,7 +166,7 @@ ...@@ -168,7 +166,7 @@
168 clmlInitList (type) { 166 clmlInitList (type) {
169 // 1:列表初始化 2:新增材料 167 // 1:列表初始化 2:新增材料
170 return new Promise((resolve) => { 168 return new Promise((resolve) => {
171 getCompanyMaterialList(this.formData.bsmCompany).then((res) => { 169 repairInitClml(this.$parent).then((res) => {
172 if (res.code == 200) { 170 if (res.code == 200) {
173 resolve(res.code); 171 resolve(res.code);
174 if (res.result && res.result.length > 0) { 172 if (res.result && res.result.length > 0) {
...@@ -244,12 +242,7 @@ ...@@ -244,12 +242,7 @@
244 * @author: renchao 242 * @author: renchao
245 */ 243 */
246 addSave (data) { 244 addSave (data) {
247 let obj = { 245 saveClml({ ...data, bsmSldy: this.$parent.bsmRepair, bsmSlsq: this.$parent.bsmSlsq }).then(async (res) => {
248 bsmCompany: this.formData.bsmCompany,
249 clmc: data.clmc,
250 cllx: data.cllx
251 };
252 addCompanyMaterial(obj).then(async (res) => {
253 if (res.code == 200) { 246 if (res.code == 200) {
254 let res = await this.clmlInitList(2); 247 let res = await this.clmlInitList(2);
255 if (res == 200) 248 if (res == 200)
...@@ -290,7 +283,6 @@ ...@@ -290,7 +283,6 @@
290 store.dispatch("user/reWorkFresh", false); 283 store.dispatch("user/reWorkFresh", false);
291 ywPopupDialog("申请材料目录", "xxba/components/clxx/dialog/clxxDetailDialog", { 284 ywPopupDialog("申请材料目录", "xxba/components/clxx/dialog/clxxDetailDialog", {
292 data: this.tableData, 285 data: this.tableData,
293 bsmCompany: this.formData.bsmCompany
294 }, "60%", true, false) 286 }, "60%", true, false)
295 }, 287 },
296 //设置tableData 288 //设置tableData
......
1 /* 1 /*
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-15 09:31:37 4 * @LastEditTime: 2023-09-18 16:32:42
5 */ 5 */
6 //流程环节操作按钮 6 //流程环节操作按钮
7 export function getForm (tabName) { 7 export function getForm (tabName) {
...@@ -82,7 +82,7 @@ export function getForm (tabName) { ...@@ -82,7 +82,7 @@ export function getForm (tabName) {
82 form = require("@/views/djbworkflow/djbBook/components/blxxtabs/cfdj.vue"); 82 form = require("@/views/djbworkflow/djbBook/components/blxxtabs/cfdj.vue");
83 break; 83 break;
84 case "clxx": 84 case "clxx":
85 form = require("@/views/djbworkflow/djbBook/components/clxx/index.vue"); 85 form = require("@/views/djbworkflow/components/clxx/index.vue");
86 break; 86 break;
87 case "spyj": 87 case "spyj":
88 form = require("@/views/djbworkflow/djbBook/spyj.vue"); 88 form = require("@/views/djbworkflow/djbBook/spyj.vue");
......
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 <!--
2 * @Description:
3 * @Autor: renchao
4 * @LastEditTime: 2023-09-14 16:24:07
5 -->
6 <template>
7 <div class="rlPopup">
8 <div class="prev handle-btn" v-if="!isScan" @click="prev()">
9 <i class="el-icon-arrow-left"></i>
10 </div>
11 <div class="next handle-btn" v-if="!isScan" @click="next()">
12 <i class="el-icon-arrow-right"></i>
13 </div>
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="高拍仪">
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"
18 overlayStyle="width: 100%;height:100%">
19 </photo-zoom>
20 </div>
21 </div>
22 <!--缩略图-->
23 <div class="thumb-wrap">
24 <div class="thumb-wrap-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"
27 :on-change="handleChange"
28 accept=".JPG, .PNG, .JPEG,.jpg, .png, .jpeg">
29 <el-button icon="el-icon-upload" type="primary" v-if="ableOperation">上传</el-button>
30 </el-upload>
31 <!-- 左移右移 -->
32 <el-button type="primary" @click="handleMove('left')" v-if="ableOperation">左移</el-button>
33 <el-button type="primary" @click="handleMove('right')" v-if="ableOperation">右移</el-button>
34 <el-button type="primary" icon="el-icon-delete-solid" @click="handleDelete"
35 v-if="thumbnailImages.length>0 && ableOperation">删除</el-button>
36 <div v-if="ableOperation" class="pl-5">
37 <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>
39 </div>
40 </div>
41 <ul>
42 <li v-for="(img, index) in thumbnailImages" :key="index" :class="{ active: previewImg.index === index }"
43 @click="showCurrent(index)">
44 <img :src="img.fileurl">
45 </li>
46 </ul>
47 </div>
48 <!-- 点开后的视图 -->
49 <publicPicture v-if="showViewer" :url-list="allLi" :initialIndex="initialIndex" @close-viewer="closeViewer">
50 </publicPicture>
51 </div>
52 </template>
53 <script>
54 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'
58 export default {
59 name: 'PreviewImage',
60 props: {
61 previewImg: {
62 type: Object,
63 default: () => { }
64 },
65 ableOperation: {
66 type: Boolean,
67 default: true
68 }
69 },
70 components: {
71 PhotoZoom,
72 publicPicture
73 },
74 data () {
75 return {
76 loading: false,
77 key: 0,
78 isScan: false,
79 // 打开高拍仪
80 scanTitle: '打开高拍仪',
81 transform: {
82 scale: 1,
83 degree: 0
84 },
85 maxFileLength: 0,
86 // 缩略图
87 thumbnailImages: [],
88 showViewer: false,
89 initialIndex: 0,
90 allLi: [],
91 }
92 },
93 watch: {
94 previewImg: {
95 handler (newValue, oldValue) {
96 if (newValue.imgList && newValue.imgList.length > 0) {
97 this.allLi = _.cloneDeep(newValue.imgList).map(item => item.fileurl)
98 this.thumbnailImages = newValue.imgList
99 } else {
100 this.allLi = []
101 this.thumbnailImages = []
102 }
103 },
104 deep: true,
105 immediate: true
106 }
107 },
108 created () {
109 this.maxLength = 0;
110 this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl)
111 this.thumbnailImages = this.previewImg.imgList
112 },
113 computed: {
114 isFirst () {
115 return this.previewImg.index === 0
116 },
117 isLast () {
118 return this.previewImg.index === this.previewImg.imgList.length - 1
119 }
120 },
121 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 () {
216 let len = this.previewImg.imgList.length
217 if (this.isFirst || len == 0) {
218 this.$emit('prevPriview')
219 } else {
220 this.$parent.previewImg.index = (this.$parent.previewImg.index - 1 + len) % len
221 }
222 },
223 /**
224 * @description: next
225 * @author: renchao
226 */
227 next () {
228 let len = this.previewImg.imgList.length
229 if (this.isLast || len == 0) {
230 this.$emit('nextPriview')
231 } else {
232 this.$parent.previewImg.index = (this.$parent.previewImg.index + 1) % len
233 }
234 },
235 /**
236 * @description: showCurrent
237 * @param {*} index
238 * @author: renchao
239 */
240 showCurrent (index) {
241 this.previewImg.index = index
242 this.initialIndex = index
243 },
244 /**
245 * @description: closeViewer
246 * @author: renchao
247 */
248 closeViewer () {
249 this.showViewer = false
250 },
251 /**
252 * @description: clickImage
253 * @author: renchao
254 */
255 clickImage () {
256 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 }
342 }
343 }
344 </script>
345 <style lang="scss" scoped>
346 // 查看大图
347 .rlPopup {
348 position: relative;
349 width: 100%;
350 text-align: center;
351 height: 100%;
352
353 .handle-btn {
354 position: absolute;
355 top: 50%;
356 transform: translateY(-100%);
357 width: 66px;
358 height: 66px;
359 line-height: 75px;
360 color: #fff;
361 background-color: rgb(239, 239, 239);
362 border-radius: 50%;
363 cursor: pointer;
364 text-align: center;
365 transition: all 0.3s;
366
367 i {
368 font-size: 24px;
369 }
370 }
371
372 .handle-btn:hover {
373 background-color: rgb(185, 183, 183);
374 }
375
376 .prev {
377 left: 1%;
378 }
379
380 .next {
381 right: 1%;
382 }
383
384 .img-list-wrap {
385 width: 100%;
386 display: flex;
387 justify-content: center;
388 height: calc(100% - 80px);
389 align-items: center;
390 background: rgba(194, 190, 190, 0.1);
391 overflow: scroll;
392
393 img {
394 display: block;
395 object-fit: scale-down;
396 transition: all 0.3s;
397 max-width: 100%;
398 }
399 }
400
401 .thumb-wrap {
402 &-button {
403 display: flex;
404 justify-content: center;
405
406 .fileUpdate {
407 margin: 0 10px;
408 }
409 }
410
411 li {
412 float: left;
413 width: 60px;
414 height: 45px;
415 border: solid 1px #ececec;
416 position: relative;
417 margin-right: 5px;
418 cursor: pointer;
419
420 &:last-child {
421 margin-right: 0;
422 }
423
424 img {
425 max-width: 57px;
426 max-height: 42px;
427 display: block;
428 object-fit: scale-down;
429 position: absolute;
430 top: 50%;
431 left: 50%;
432 transform: translate(-50%, -50%);
433 }
434 }
435
436 .active {
437 border-color: #409eff;
438 }
439 }
440 }
441 </style>
442 <style>
443 .zoom-on-hover {
444 position: relative;
445 overflow: hidden;
446 }
447
448 .zoom-on-hover .normal {
449 width: 100%;
450 }
451
452 .zoom-on-hover .zoom {
453 position: absolute;
454 opacity: 0;
455 transform-origin: top left;
456 }
457
458 .zoom-on-hover.zoomed .zoom {
459 opacity: 1;
460 }
461
462 .zoom-on-hover.zoomed .normal {
463 opacity: 0;
464 }
465 </style>
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-15 10:08:50 4 * @LastEditTime: 2023-09-18 16:14:31
5 --> 5 -->
6 <template> 6 <template>
7 <div class="clxx"> 7 <div class="clxx">
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 type="primary" 13 type="primary"
14 native-type="submit" 14 native-type="submit"
15 @click="viewDetail" 15 @click="viewDetail"
16 style="width: 100%; margin-top: 10px">申请材料目录</el-button> 16 style="width: 100%; margin-top: 10px" v-if="tableData.length > 0">申请材料目录</el-button>
17 <div class="item"> 17 <div class="item">
18 材料目录({{ tableData.length }}) 18 材料目录({{ tableData.length }})
19 <div style="margin-top: 10px"> 19 <div style="margin-top: 10px">
...@@ -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.bsmSj" 32 :key="item.bsmMaterial"
33 :class="['child', treeCheckId == item.bsmSj ? 'checked' : '']" 33 :class="['child', treeCheckId == item.bsmMaterial ? 'checked' : '']"
34 @click="treeClick(item, index)"> 34 @click="treeClick(item, index)">
35 <span v-if="item.isrequired == 1" class="required">必选</span> 35 {{ item.clmc }}
36 {{ item.sjmc }} 36 <span class="cl_number" :key="key" v-if="item.count">({{ item.count }})</span>
37 <span class="cl_number" :key="key">({{ item.ys ? item.ys : 0 }})</span> 37 <span class="cl_number" :key="key" v-else>(0)</span>
38 </div> 38 </div>
39 </div> 39 </div>
40 </div> 40 </div>
...@@ -42,37 +42,37 @@ ...@@ -42,37 +42,37 @@
42 type="primary" 42 type="primary"
43 native-type="submit" 43 native-type="submit"
44 style="width: 100%" 44 style="width: 100%"
45 @click="handleAdd()" 45 @click="handleAdd()">新增</el-button>
46 v-if="ableOperation">新增</el-button>
47 </div> 46 </div>
48 <image-preview 47 <image-preview
49 ref="imageRef" 48 ref="imageRef"
50 v-if="tableData.length > 0" 49 v-if="tableData.length > 0"
51 :previewImg="previewImg" 50 :previewImg="previewImg"
52 :ableOperation="ableOperation"
53 @updateList="updateList" 51 @updateList="updateList"
54 @nextPriview="nextPriview" 52 @nextPriview="nextPriview"
55 @prevPriview="prevPriview" /> 53 @prevPriview="prevPriview" />
56 </div> 54 </div>
57 </div> 55 </div>
58 <clxxAddDialog v-model="isDialog" />
59 </div> 56 </div>
60 </template> 57 </template>
61 <script> 58 <script>
62 import { mapGetters } from "vuex"; 59 import store from '@/store/index.js'
63 import clxxAddDialog from "@/views/workflow/components/dialog/clxxAddDialog.vue"; 60 import { ywPopupDialog } from "@/utils/popup.js";
64 import clxxDetailDialog from "@/views/workflow/components/dialog/clxxDetailDialog.vue"; 61 import imagePreview from "./dialog/imagePreview.vue";
65 import imagePreview from "@/views/components/imagePreview.vue"; 62 import clxxDetailDialog from "./dialog/clxxDetailDialog.vue";
66 import { saveClml, getClmxList } from "@/api/clxx.js"; 63 import { repairInitClml, saveClml, getClmxList } from "@/api/clxx.js";
67 import { repairInitClml } from "@/api/djbRepair.js";
68
69 export default { 64 export default {
70 components: { clxxAddDialog, imagePreview, clxxDetailDialog }, 65 components: { imagePreview, clxxDetailDialog },
66 props: {
67 formData: {
68 type: Object,
69 default: () => {
70 return {}
71 }
72 }
73 },
71 data () { 74 data () {
72 return { 75 return {
73 //表单是否可操作
74 ableOperation: true,
75 isDialog: false,
76 iclass: "", 76 iclass: "",
77 // 材料目录选中 77 // 材料目录选中
78 treeCheckIndex: 0, 78 treeCheckIndex: 0,
...@@ -80,34 +80,29 @@ ...@@ -80,34 +80,29 @@
80 key: 0, 80 key: 0,
81 tableData: [], 81 tableData: [],
82 previewImg: { 82 previewImg: {
83 // 收件标识码 83 bsmMaterial: "",
84 bsmSj: "",
85 bsmSlsq: this.$parent.bsmSlsq,
86 index: 0, 84 index: 0,
87 selectedIndex: 0, 85 selectedIndex: 0,
88 imgList: [], 86 imgList: []
89 }, 87 }
90 }; 88 }
91 },
92 computed: {
93 ...mapGetters(["dictData"]),
94 },
95 created () {
96 this.clmlInitList(1);
97 }, 89 },
98 computed: { 90 computed: {
99 // 判断补录数据和临时数据 91 workFresh () {
100 ...mapGetters(["workFresh"]), 92 return store.state.user.workFresh
93 }
101 }, 94 },
102 watch: { 95 watch: {
103 workFresh: { 96 workFresh: {
104 handler (newVal, oldVal) { 97 handler (newValue, oldValue) {
105 if (newVal) this.clmlInitList(1); 98 if (newValue) this.clmlInitList()
106 }, 99 },
107 }, 100 deep: true,
101 immediate: true
102 }
108 }, 103 },
109 mounted () { 104 created () {
110 this.ableOperation = this.$parent.ableOperation; 105 this.clmlInitList()
111 }, 106 },
112 methods: { 107 methods: {
113 /** 108 /**
...@@ -118,19 +113,19 @@ ...@@ -118,19 +113,19 @@
118 if (this.treeCheckIndex < this.tableData.length) { 113 if (this.treeCheckIndex < this.tableData.length) {
119 this.treeCheckIndex++; 114 this.treeCheckIndex++;
120 if (this.tableData[this.treeCheckIndex]) { 115 if (this.tableData[this.treeCheckIndex]) {
121 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj; 116 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial;
122 // 判断页数 117 // 判断页数
123 let ys = this.tableData[this.treeCheckIndex].ys 118 let ys = this.tableData[this.treeCheckIndex].ys
124 this.previewImg.index = 0; 119 this.previewImg.index = 0;
125 // 获取材料明细 120 // 获取材料明细
126 if (ys > 0) { 121 if (ys > 0) {
127 getClmxList(this.treeCheckId).then(res => { 122 getFileListByBsmMaterial(this.treeCheckId).then(res => {
128 this.previewImg.imgList = res.result ? res.result : []; 123 this.previewImg.imgList = res.result ? res.result : []
129 }) 124 })
130 } else { 125 } else {
131 this.previewImg.imgList = [] 126 this.previewImg.imgList = []
132 } 127 }
133 this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj; 128 this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial;
134 } else { 129 } else {
135 this.$message.error('没有最后一张了'); 130 this.$message.error('没有最后一张了');
136 } 131 }
...@@ -143,20 +138,19 @@ ...@@ -143,20 +138,19 @@
143 prevPriview () { 138 prevPriview () {
144 if (this.treeCheckIndex >= 1) { 139 if (this.treeCheckIndex >= 1) {
145 this.treeCheckIndex--; 140 this.treeCheckIndex--;
146 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj; 141 this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial;
147 // 判断页数 142 // 判断页数
148 let ys = this.tableData[this.treeCheckIndex].ys 143 let ys = this.tableData[this.treeCheckIndex].ys
149 if (ys > 0) { 144 if (ys > 0) {
150 // 获取材料明细 145 getFileListByBsmMaterial(this.treeCheckId).then(res => {
151 getClmxList(this.treeCheckId).then(res => { 146 this.previewImg.imgList = res.result ? res.result : []
152 this.previewImg.imgList = res.result ? res.result : [];
153 this.previewImg.index = this.previewImg.imgList.length - 1; 147 this.previewImg.index = this.previewImg.imgList.length - 1;
154 }) 148 })
155 } else { 149 } else {
156 this.previewImg.imgList = []; 150 this.previewImg.imgList = [];
157 this.previewImg.index = 0 151 this.previewImg.index = 0
158 } 152 }
159 this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj; 153 this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial;
160 } else { 154 } else {
161 this.$message.error('没有第一张了'); 155 this.$message.error('没有第一张了');
162 } 156 }
...@@ -167,20 +161,9 @@ ...@@ -167,20 +161,9 @@
167 * @author: renchao 161 * @author: renchao
168 */ 162 */
169 clmlInitList (type) { 163 clmlInitList (type) {
170 //type 1:列表初始化 2:新增材料 164 // 1:列表初始化 2:新增材料
171 return new Promise((resolve) => { 165 return new Promise((resolve) => {
172 this.unitData = this.$parent.unitData; 166 repairInitClml(this.formData).then((res) => {
173 var formdata = new FormData();
174 formdata.append("bsmSlsq", this.$parent.bsmSlsq);
175 if (this.$route.query.sqywbm == "DJBBL") {
176 formdata.append("bsmSldy", this.$parent.bsmRepair);
177 formdata.append("clfl", 3);
178 } else {
179 formdata.append("bsmSldy", this.$parent.currentSelectProps.bsmSldy);
180 formdata.append("clfl", 2);
181 }
182
183 repairInitClml(formdata).then((res) => {
184 if (res.code == 200) { 167 if (res.code == 200) {
185 resolve(res.code); 168 resolve(res.code);
186 if (res.result && res.result.length > 0) { 169 if (res.result && res.result.length > 0) {
...@@ -198,8 +181,8 @@ ...@@ -198,8 +181,8 @@
198 } else { 181 } else {
199 this.$message.error(res.message); 182 this.$message.error(res.message);
200 } 183 }
201 }); 184 })
202 }); 185 })
203 }, 186 },
204 /** 187 /**
205 * @description: setChecked 188 * @description: setChecked
...@@ -207,12 +190,12 @@ ...@@ -207,12 +190,12 @@
207 * @author: renchao 190 * @author: renchao
208 */ 191 */
209 setChecked (item) { 192 setChecked (item) {
210 this.treeCheckId = item.bsmSj; 193 this.treeCheckId = item.bsmMaterial;
211 this.title = item.sjmc; 194 this.title = item.sjmc;
212 this.titleYs = 1; 195 this.titleYs = 1;
213 this.titleNum = item.children.length; 196 this.titleNum = item.children.length;
214 this.previewImg.imgList = item.children; 197 this.previewImg.imgList = item.children;
215 this.previewImg.bsmSj = item.bsmSj; 198 this.previewImg.bsmMaterial = item.bsmMaterial;
216 }, 199 },
217 /** 200 /**
218 * @description: updateList 201 * @description: updateList
...@@ -224,8 +207,8 @@ ...@@ -224,8 +207,8 @@
224 if (val.children.length != 0) { 207 if (val.children.length != 0) {
225 //删除最后一张图片时 val=null 208 //删除最后一张图片时 val=null
226 this.tableData.forEach((item) => { 209 this.tableData.forEach((item) => {
227 if (item.bsmSj === val.bsmSj) { 210 if (item.bsmMaterial == val.bsmMaterial) {
228 item.ys = val.children.length; 211 item.count = val.children.length
229 } 212 }
230 }); 213 });
231 this.previewImg.imgList = _.cloneDeep(val.children); 214 this.previewImg.imgList = _.cloneDeep(val.children);
...@@ -236,54 +219,12 @@ ...@@ -236,54 +219,12 @@
236 } else { 219 } else {
237 this.previewImg.imgList = []; 220 this.previewImg.imgList = [];
238 this.tableData.forEach((item, index) => { 221 this.tableData.forEach((item, index) => {
239 if (this.treeCheckId == item.bsmSj) { 222 if (this.treeCheckId == item.bsmMaterial) {
240 item.ys = 0; 223 item.count = 0;
241 that.treeCheckIndex = index; 224 that.treeCheckIndex = index;
242 } 225 }
243 }); 226 })
244 }
245 },
246 /**
247 * @description: 添加材料目录
248 * @author: renchao
249 */
250 handleAdd () {
251 this.isDialog = true;
252 },
253 /**
254 * @description: 新增弹窗保存
255 * @param {*} data
256 * @author: renchao
257 */
258 addSave (data) {
259 let obj = {
260 bsmSlsq: this.$parent.bsmSlsq,
261 isrequired: "1",
262 sjmc: data.clmc,
263 sjsl: 0,
264 smzt: "",
265 ys: 0,
266 sjlx: data.cllx,
267 sfxjcl: "1", // 是否必选
268 sfggcl: data.sfggcl,
269 };
270 //是否公共材料
271 if (data.sfggcl == "0") {
272 obj["bsmSldy"] = this.$parent.currentSelectProps.bsmSldy;
273 }
274 if (this.$route.query.sqywbm == "DJBBL") {
275 obj.bsmSldy = this.$parent.bsmRepair
276 } 227 }
277 saveClml(obj).then(async (res) => {
278 if (res.code == 200) {
279 let res = await this.clmlInitList(2);
280 if (res == 200)
281 this.$message({
282 message: "新增成功",
283 type: "success",
284 });
285 }
286 });
287 }, 228 },
288 /** 229 /**
289 * @description: 材料目录点击选中 230 * @description: 材料目录点击选中
...@@ -293,13 +234,12 @@ ...@@ -293,13 +234,12 @@
293 */ 234 */
294 treeClick (item, index) { 235 treeClick (item, index) {
295 this.previewImg.index = 0; 236 this.previewImg.index = 0;
296 this.treeCheckId = item?.bsmSj; 237 this.treeCheckId = item?.bsmMaterial;
297 this.treeCheckIndex = index; 238 this.treeCheckIndex = index;
298 // 获取材料明细 239 getClmxList(item.bsmMaterial).then(res => {
299 getClmxList(item.bsmSj).then(res => { 240 this.previewImg.imgList = res.result ? res.result : []
300 this.previewImg.imgList = res.result ? res.result : [];
301 }) 241 })
302 this.previewImg.bsmSj = item?.bsmSj; 242 this.previewImg.bsmMaterial = item?.bsmMaterial;
303 }, 243 },
304 /** 244 /**
305 * @description: 小图片点击 245 * @description: 小图片点击
...@@ -313,20 +253,11 @@ ...@@ -313,20 +253,11 @@
313 }, 253 },
314 //查看明细 254 //查看明细
315 viewDetail () { 255 viewDetail () {
316 this.$store.dispatch("user/reWorkFresh", false); 256 store.dispatch("user/reWorkFresh", false);
317 this.$popupDialog( 257 ywPopupDialog("申请材料目录", "xxba/components/clxx/dialog/clxxDetailDialog", {
318 "申请材料目录", 258 data: this.tableData,
319 "workflow/components/dialog/clxxDetailDialog", 259 bsmCompany: this.formData.bsmCompany
320 { 260 }, "50%", true, false)
321 data: this.tableData,
322 bsmSldy: this.$parent.currentSelectProps.bsmSldy,
323 unitData: this.$parent.unitData,
324 ableOperation: this.$parent.ableOperation,
325 bsmRepair: this.$parent.bsmRepair
326 },
327 "60%",
328 true
329 );
330 }, 261 },
331 //设置tableData 262 //设置tableData
332 setTableData (tableData) { 263 setTableData (tableData) {
...@@ -335,11 +266,10 @@ ...@@ -335,11 +266,10 @@
335 }) 266 })
336 } 267 }
337 } 268 }
338 }; 269 }
339 </script> 270 </script>
340 <style scoped lang="scss"> 271 <style scoped lang="scss">
341 @import "~@/styles/mixin.scss"; 272 @import "~@/styles/mixin.scss";
342
343 .active { 273 .active {
344 background: $light-blue !important; 274 background: $light-blue !important;
345 color: #fff; 275 color: #fff;
...@@ -357,10 +287,10 @@ ...@@ -357,10 +287,10 @@
357 287
358 .clxx { 288 .clxx {
359 width: 100%; 289 width: 100%;
290 height: 94%;
291 min-height: 360px;
360 display: flex; 292 display: flex;
361 padding-left: 5px; 293 padding-left: 5px;
362 height: calc(100vh - 125px);
363
364 .left { 294 .left {
365 display: flex; 295 display: flex;
366 flex-direction: column; 296 flex-direction: column;
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-18 14:42:14 4 * @LastEditTime: 2023-09-18 15:48:15
5 --> 5 -->
6 <template> 6 <template>
7 <div class="tableBox"> 7 <div class="tableBox">
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
97 <script> 97 <script>
98 import Router from '@/router' 98 import Router from '@/router'
99 import { datas } from "../qlxxFormData.js"; 99 import { datas } from "../qlxxFormData.js";
100 import { ywPopupDialog } from "@/utils/popup.js";
100 import printTemplate from "../components/printTemplate.vue"; 101 import printTemplate from "../components/printTemplate.vue";
101 import { getXtParamsByYwh, getBlParamsByYwh } from '@/api/djyw' 102 import { getXtParamsByYwh, getBlParamsByYwh } from '@/api/djyw'
102 export default { 103 export default {
...@@ -234,8 +235,7 @@ ...@@ -234,8 +235,7 @@
234 } else { 235 } else {
235 getBlParamsByYwh(ywh, bsmQlxx).then(res => { 236 getBlParamsByYwh(ywh, bsmQlxx).then(res => {
236 let data = res.result 237 let data = res.result
237 const { href } = Router.resolve('/workFrameView?bsmSlsq=' + data.bsmSlsq + '&bestepid=' + data.bestepid + '&bsmBusiness=' + data.bsmBusiness + '&type=jdcx') 238 ywPopupDialog("材料信息", "registerBook/components/clxx/index", data, "60%", true, false)
238 window.open(href, `urlname${data.bsmSlsq}`)
239 }) 239 })
240 } 240 }
241 } 241 }
......
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-09-15 10:02:12 4 * @LastEditTime: 2023-09-18 16:28:16
5 --> 5 -->
6 <template> 6 <template>
7 <div class="clxx"> 7 <div class="clxx">
...@@ -167,7 +167,6 @@ ...@@ -167,7 +167,6 @@
167 //type 1:列表初始化 2:新增材料 167 //type 1:列表初始化 2:新增材料
168 return new Promise((resolve) => { 168 return new Promise((resolve) => {
169 this.unitData = this.$parent.unitData; 169 this.unitData = this.$parent.unitData;
170 console.log(this.$parent.unitData, 'this.$parent.unitData;');
171 var formdata = new FormData(); 170 var formdata = new FormData();
172 formdata.append("bsmSlsq", this.$parent.bsmSlsq); 171 formdata.append("bsmSlsq", this.$parent.bsmSlsq);
173 if (this.$route.query.sqywbm == "DJBBL") { 172 if (this.$route.query.sqywbm == "DJBBL") {
......