--no commit message
Showing
4 changed files
with
167 additions
and
1026 deletions
| 1 | <!-- | ||
| 2 | * @Description: | ||
| 3 | * @Autor: renchao | ||
| 4 | * @LastEditTime: 2023-07-28 09:34:54 | ||
| 5 | --> | ||
| 6 | <template> | ||
| 7 | <div class="clmlmx-box"> | ||
| 8 | <div class="title">申请材料目录</div> | ||
| 9 | <lb-table :column="column" :key="key" :heightNumSetting="true" :pagination="false" :data="formData.data"> | ||
| 10 | </lb-table> | ||
| 11 | <div class="text-center"> | ||
| 12 | <el-button @click="$popupCacel">取消</el-button> | ||
| 13 | </div> | ||
| 14 | </div> | ||
| 15 | </template> | ||
| 16 | <script> | ||
| 17 | import store from '@/store/index.js' | ||
| 18 | import { InitClml, saveClml, deleteSjClml, moveClml } from "@/api/clxx.js"; | ||
| 19 | export default { | ||
| 20 | props: { | ||
| 21 | formData: { | ||
| 22 | type: Object, | ||
| 23 | default: () => { | ||
| 24 | return {} | ||
| 25 | } | ||
| 26 | } | ||
| 27 | }, | ||
| 28 | data () { | ||
| 29 | return { | ||
| 30 | column: [ | ||
| 31 | { | ||
| 32 | width: "50", | ||
| 33 | label: '序号', | ||
| 34 | type: 'index' | ||
| 35 | }, | ||
| 36 | { | ||
| 37 | prop: "isrequired", | ||
| 38 | label: "是否必选", | ||
| 39 | width: "80", | ||
| 40 | render: (h, scope) => { | ||
| 41 | if (scope.row.sfxjcl === "1") { | ||
| 42 | return ( | ||
| 43 | <div> | ||
| 44 | <span>可选</span> | ||
| 45 | </div> | ||
| 46 | ); | ||
| 47 | } | ||
| 48 | else { | ||
| 49 | return ( | ||
| 50 | <div> | ||
| 51 | <span>必选</span> | ||
| 52 | </div> | ||
| 53 | ); | ||
| 54 | } | ||
| 55 | }, | ||
| 56 | }, | ||
| 57 | { | ||
| 58 | prop: "sjmc", | ||
| 59 | label: "材料名称", | ||
| 60 | }, | ||
| 61 | { | ||
| 62 | prop: "sjlx", | ||
| 63 | label: "材料类型", | ||
| 64 | width: "80", | ||
| 65 | render: (h, scope) => { | ||
| 66 | return ( | ||
| 67 | <div> | ||
| 68 | <span>{this.dicStatus(scope.row.sjlx, "A40")}</span> | ||
| 69 | </div> | ||
| 70 | ); | ||
| 71 | }, | ||
| 72 | }, | ||
| 73 | { | ||
| 74 | prop: "sjsl", | ||
| 75 | label: "份数", | ||
| 76 | width: "50" | ||
| 77 | }, | ||
| 78 | { | ||
| 79 | prop: "smzt", | ||
| 80 | label: "扫描状态", | ||
| 81 | width: "80", | ||
| 82 | render: (h, scope) => { | ||
| 83 | if (scope.row.children && scope.row.children.length > 0) { | ||
| 84 | return ( | ||
| 85 | <div> | ||
| 86 | <span>已扫描</span> | ||
| 87 | </div> | ||
| 88 | ); | ||
| 89 | } else { | ||
| 90 | return ( | ||
| 91 | <div> | ||
| 92 | <span>未扫描</span> | ||
| 93 | </div> | ||
| 94 | ); | ||
| 95 | } | ||
| 96 | }, | ||
| 97 | }, | ||
| 98 | { | ||
| 99 | label: "扫描页数", | ||
| 100 | width: "80", | ||
| 101 | render: (h, scope) => { | ||
| 102 | if (scope.row.children && scope.row.children.length > 0) { | ||
| 103 | return ( | ||
| 104 | <div> | ||
| 105 | <span>{scope.row.children.length}</span> | ||
| 106 | </div> | ||
| 107 | ); | ||
| 108 | } else { | ||
| 109 | return ( | ||
| 110 | <div> | ||
| 111 | <span>0</span> | ||
| 112 | </div> | ||
| 113 | ); | ||
| 114 | } | ||
| 115 | }, | ||
| 116 | }, | ||
| 117 | { | ||
| 118 | label: "操作", | ||
| 119 | width: "80", | ||
| 120 | render: (h, scope) => { | ||
| 121 | return ( | ||
| 122 | <div> | ||
| 123 | <el-button | ||
| 124 | type="text" | ||
| 125 | disabled={scope.$index == 0} | ||
| 126 | onClick={() => { | ||
| 127 | this.moveUpward(scope.$index, scope.row); | ||
| 128 | }} | ||
| 129 | > | ||
| 130 | 上移 | ||
| 131 | </el-button> | ||
| 132 | <el-button | ||
| 133 | type="text" | ||
| 134 | disabled={scope.$index + 1 == this.tableData.length} | ||
| 135 | onClick={() => { | ||
| 136 | this.moveDown(scope.$index, scope.row); | ||
| 137 | }} | ||
| 138 | > | ||
| 139 | 下移 | ||
| 140 | </el-button> | ||
| 141 | </div> | ||
| 142 | ); | ||
| 143 | }, | ||
| 144 | }, | ||
| 145 | ], | ||
| 146 | key: 0, | ||
| 147 | tableData: [] | ||
| 148 | } | ||
| 149 | }, | ||
| 150 | created () { | ||
| 151 | console.log(this.formData.data, 'formData'); | ||
| 152 | }, | ||
| 153 | methods: { | ||
| 154 | // 材料目录明细初始化 | ||
| 155 | /** | ||
| 156 | * @description: 材料目录明细初始化 | ||
| 157 | * @author: renchao | ||
| 158 | */ | ||
| 159 | clmlInitList () { | ||
| 160 | return new Promise(resolve => { | ||
| 161 | this.unitData = this.$parent.unitData; | ||
| 162 | var formdata = new FormData(); | ||
| 163 | formdata.append("bsmSldy", this.unitData[0]?.bsmSldy); | ||
| 164 | formdata.append("bsmSlsq", this.$route.query.bsmSlsq); | ||
| 165 | formdata.append("clfl", 2); | ||
| 166 | InitClml(formdata).then((res) => { | ||
| 167 | if (res.code == 200) { | ||
| 168 | resolve(res.code) | ||
| 169 | if (res.result && res.result.length > 0) { | ||
| 170 | this.data = res.result; | ||
| 171 | } else { | ||
| 172 | this.data = [] | ||
| 173 | } | ||
| 174 | } else { | ||
| 175 | this.$message.error(res.message) | ||
| 176 | } | ||
| 177 | }) | ||
| 178 | }) | ||
| 179 | }, | ||
| 180 | // 上移 | ||
| 181 | /** | ||
| 182 | * @description: 上移 | ||
| 183 | * @param {*} index | ||
| 184 | * @param {*} row | ||
| 185 | * @author: renchao | ||
| 186 | */ | ||
| 187 | moveUpward (index, row) { | ||
| 188 | let obj = { | ||
| 189 | xh: row.xh, | ||
| 190 | bsmSlsq: row.bsmSlsq, | ||
| 191 | moveDirection: "UP", | ||
| 192 | }; | ||
| 193 | // 接口待调 | ||
| 194 | /** | ||
| 195 | * @description: 接口待调 | ||
| 196 | * @param {*} obj | ||
| 197 | * @author: renchao | ||
| 198 | */ | ||
| 199 | moveClml(obj).then(async (res) => { | ||
| 200 | if (res.code == 200) { | ||
| 201 | let res = await this.clmlInitList() | ||
| 202 | if (res == 200) { | ||
| 203 | this.$message({ | ||
| 204 | message: '上移成功', | ||
| 205 | type: 'success' | ||
| 206 | }) | ||
| 207 | this.$parent.setTableData(this.data) | ||
| 208 | } | ||
| 209 | } else { | ||
| 210 | this.$message.error(res.message); | ||
| 211 | } | ||
| 212 | }) | ||
| 213 | }, | ||
| 214 | // 下移 | ||
| 215 | /** | ||
| 216 | * @description: 下移 | ||
| 217 | * @param {*} index | ||
| 218 | * @param {*} row | ||
| 219 | * @author: renchao | ||
| 220 | */ | ||
| 221 | moveDown (index, row) { | ||
| 222 | let obj = { | ||
| 223 | xh: row.xh, | ||
| 224 | bsmSlsq: row.bsmSlsq, | ||
| 225 | moveDirection: "DOWN", | ||
| 226 | } | ||
| 227 | // 接口待调 | ||
| 228 | /** | ||
| 229 | * @description: 接口待调 | ||
| 230 | * @param {*} obj | ||
| 231 | * @author: renchao | ||
| 232 | */ | ||
| 233 | moveClml(obj).then(async (res) => { | ||
| 234 | if (res.code == 200) { | ||
| 235 | let res = await this.clmlInitList() | ||
| 236 | if (res == 200) { | ||
| 237 | this.$message({ | ||
| 238 | message: '下移成功', | ||
| 239 | type: 'success' | ||
| 240 | }) | ||
| 241 | } | ||
| 242 | } else { | ||
| 243 | this.$message.error(res.message); | ||
| 244 | } | ||
| 245 | }) | ||
| 246 | }, | ||
| 247 | // 材料目录删除 | ||
| 248 | /** | ||
| 249 | * @description: 材料目录删除 | ||
| 250 | * @param {*} index | ||
| 251 | * @param {*} row | ||
| 252 | * @author: renchao | ||
| 253 | */ | ||
| 254 | handleDelete (index, row) { | ||
| 255 | let that = this | ||
| 256 | this.$confirm('此操作将永久删除该 是否继续?', '提示', { | ||
| 257 | confirmButtonText: '确定', | ||
| 258 | cancelButtonText: '取消', | ||
| 259 | type: 'warning' | ||
| 260 | }).then(() => { | ||
| 261 | deleteSjClml({ sjBsm: row.bsmSj }).then(async (res) => { | ||
| 262 | if (res.code == 200) { | ||
| 263 | let res = await that.clmlInitList() | ||
| 264 | if (res == 200) { | ||
| 265 | that.$message({ | ||
| 266 | message: "删除成功", | ||
| 267 | type: "success", | ||
| 268 | }) | ||
| 269 | // this.$parent.setTableData(this.data) | ||
| 270 | } | ||
| 271 | } | ||
| 272 | }) | ||
| 273 | }).catch(() => { | ||
| 274 | this.$message({ | ||
| 275 | type: 'info', | ||
| 276 | message: '已取消删除' | ||
| 277 | }) | ||
| 278 | }) | ||
| 279 | }, | ||
| 280 | // 字典 | ||
| 281 | /** | ||
| 282 | * @description: 字典 | ||
| 283 | * @param {*} val | ||
| 284 | * @param {*} code | ||
| 285 | * @author: renchao | ||
| 286 | */ | ||
| 287 | dicStatus (val, code) { | ||
| 288 | let data = store.getters.dictData[code], | ||
| 289 | name = "暂无"; | ||
| 290 | if (data) { | ||
| 291 | data.map((item) => { | ||
| 292 | if (item.dcode == val) { | ||
| 293 | name = item.dname; | ||
| 294 | } | ||
| 295 | }); | ||
| 296 | return name; | ||
| 297 | } | ||
| 298 | } | ||
| 299 | } | ||
| 300 | } | ||
| 301 | </script> | ||
| 302 | <style scoped lang='scss'> | ||
| 303 | @import "~@/styles/mixin.scss"; | ||
| 304 | .clmlmx-box { | ||
| 305 | margin: 0 auto; | ||
| 306 | |||
| 307 | .title { | ||
| 308 | text-align: center; | ||
| 309 | height: 60px; | ||
| 310 | line-height: 60px; | ||
| 311 | border: 1px solid #dfe6ec; | ||
| 312 | font-size: 20px; | ||
| 313 | background: #81d3f81a; | ||
| 314 | margin-bottom: -1px; | ||
| 315 | } | ||
| 316 | } | ||
| 317 | </style> | 
| 1 | <!-- | ||
| 2 | * @Description: | ||
| 3 | * @Autor: renchao | ||
| 4 | * @LastEditTime: 2023-07-28 09:35:31 | ||
| 5 | --> | ||
| 6 | <template> | ||
| 7 | <div class="clxx"> | ||
| 8 | <div class="left"> | ||
| 9 | <div v-for="item in menuList" :key="item.id" :class="['item', checkedId == item.id ? 'active' : '']" | ||
| 10 | @click="menuClick(item)"> | ||
| 11 | {{ item.label }} | ||
| 12 | </div> | ||
| 13 | </div> | ||
| 14 | <div class="right"> | ||
| 15 | <!-- 材料目录明细 --> | ||
| 16 | <div class="clmlmx-box" v-if="checkedId == '1'"> | ||
| 17 | <div class="title">申请材料目录</div> | ||
| 18 | <lb-table :column="column" :key="key" :heightNum="150" :pagination="false" :data="tableData"> | ||
| 19 | </lb-table> | ||
| 20 | </div> | ||
| 21 | <!-- 材料预览 --> | ||
| 22 | <div class="clyl-box" v-else> | ||
| 23 | <div class="menu-tree"> | ||
| 24 | <div class="item"> | ||
| 25 | 材料目录({{tableData.length}}) | ||
| 26 | <div> | ||
| 27 | <div v-for="(item,index) in tableData" :key="item.bsmSj" | ||
| 28 | :class="['child', treeCheckId == item.bsmSj ? 'checked' : '']" @click="treeClick(item,index)"> | ||
| 29 | <span v-if="item.isrequired==1" class="required">必选</span> | ||
| 30 | {{ item.sjmc }} | ||
| 31 | <span class="cl_number">({{item.children.length}})</span> | ||
| 32 | </div> | ||
| 33 | </div> | ||
| 34 | </div> | ||
| 35 | </div> | ||
| 36 | <image-preview ref='imageRef' v-if="tableData.length>0" :ableOperation="ableOperation" :previewImg="previewImg" @updateList="updateList" | ||
| 37 | @nextPriview="nextPriview" | ||
| 38 | @prevPriview="prevPriview" /> | ||
| 39 | </div> | ||
| 40 | </div> | ||
| 41 | <clxxAddDialog v-model="isDialog" /> | ||
| 42 | </div> | ||
| 43 | </template> | ||
| 44 | <script> | ||
| 45 | import { mapGetters } from "vuex"; | ||
| 46 | import clxxAddDialog from "../dialog/clxxAddDialog.vue"; | ||
| 47 | import imagePreview from '@/views/components/imagePreview.vue' | ||
| 48 | import { InitClml, saveClml, deleteSjClml, moveClml } from "@/api/clxx.js"; | ||
| 49 | export default { | ||
| 50 | components: { clxxAddDialog, imagePreview }, | ||
| 51 | data () { | ||
| 52 | return { | ||
| 53 | //表单是否可操作 | ||
| 54 | ableOperation: true, | ||
| 55 | isDialog: false, | ||
| 56 | menuList: [ | ||
| 57 | { | ||
| 58 | id: "1", | ||
| 59 | label: "材料目录明细", | ||
| 60 | }, | ||
| 61 | { | ||
| 62 | id: "2", | ||
| 63 | label: "材料预览", | ||
| 64 | }, | ||
| 65 | ], | ||
| 66 | iclass: "", | ||
| 67 | // 材料目录选中 | ||
| 68 | treeCheckIndex: 0, | ||
| 69 | treeCheckId: "", | ||
| 70 | checkedId: "1", | ||
| 71 | column: [ | ||
| 72 | { | ||
| 73 | width: "50", | ||
| 74 | renderHeader: (h, scope) => { | ||
| 75 | return ( | ||
| 76 | <div> | ||
| 77 | { | ||
| 78 | this.ableOperation ? '序号' : | ||
| 79 | <i | ||
| 80 | class="el-icon-plus pointer" | ||
| 81 | onClick={() => { | ||
| 82 | this.handleAdd() | ||
| 83 | }} | ||
| 84 | ></i> | ||
| 85 | } | ||
| 86 | </div> | ||
| 87 | ) | ||
| 88 | }, | ||
| 89 | render: (h, scope) => { | ||
| 90 | // 新建的材料,可删除 | ||
| 91 | // v-show='scope.row.sfxjcl == 1' | ||
| 92 | return ( | ||
| 93 | <div> | ||
| 94 | { | ||
| 95 | this.ableOperation ? <span>{scope.$index + 1}</span> : | ||
| 96 | <i | ||
| 97 | class="el-icon-minus pointer" | ||
| 98 | |||
| 99 | onClick={() => { | ||
| 100 | this.handleDelete(scope.$index, scope.row); | ||
| 101 | }} | ||
| 102 | ></i> | ||
| 103 | } | ||
| 104 | </div> | ||
| 105 | ) | ||
| 106 | } | ||
| 107 | }, | ||
| 108 | { | ||
| 109 | prop: "isrequired", | ||
| 110 | label: "是否必选", | ||
| 111 | width: "50", | ||
| 112 | render: (h, scope) => { | ||
| 113 | if (scope.row.sfxjcl === "1") { | ||
| 114 | return ( | ||
| 115 | <div> | ||
| 116 | <span>可选</span> | ||
| 117 | </div> | ||
| 118 | ); | ||
| 119 | } | ||
| 120 | else { | ||
| 121 | return ( | ||
| 122 | <div> | ||
| 123 | <span>必选</span> | ||
| 124 | </div> | ||
| 125 | ); | ||
| 126 | } | ||
| 127 | }, | ||
| 128 | }, | ||
| 129 | { | ||
| 130 | prop: "sjmc", | ||
| 131 | label: "材料名称", | ||
| 132 | }, | ||
| 133 | { | ||
| 134 | prop: "sjlx", | ||
| 135 | label: "材料类型", | ||
| 136 | width: "80", | ||
| 137 | render: (h, scope) => { | ||
| 138 | return ( | ||
| 139 | <div> | ||
| 140 | <span>{this.dicStatus(scope.row.sjlx, "A40")}</span> | ||
| 141 | </div> | ||
| 142 | ); | ||
| 143 | }, | ||
| 144 | }, | ||
| 145 | { | ||
| 146 | prop: "sjsl", | ||
| 147 | label: "份数", | ||
| 148 | width: "50" | ||
| 149 | }, | ||
| 150 | { | ||
| 151 | prop: "smzt", | ||
| 152 | label: "扫描状态", | ||
| 153 | width: "80", | ||
| 154 | render: (h, scope) => { | ||
| 155 | if (scope.row.children.length > 0) { | ||
| 156 | return ( | ||
| 157 | <div> | ||
| 158 | <span>已扫描</span> | ||
| 159 | </div> | ||
| 160 | ); | ||
| 161 | } else { | ||
| 162 | return ( | ||
| 163 | <div> | ||
| 164 | <span>未扫描</span> | ||
| 165 | </div> | ||
| 166 | ); | ||
| 167 | } | ||
| 168 | }, | ||
| 169 | }, | ||
| 170 | { | ||
| 171 | prop: "ys", | ||
| 172 | label: "扫描页数", | ||
| 173 | width: "50" | ||
| 174 | }, | ||
| 175 | { | ||
| 176 | label: "操作", | ||
| 177 | width: "80", | ||
| 178 | render: (h, scope) => { | ||
| 179 | return ( | ||
| 180 | <div> | ||
| 181 | <el-button | ||
| 182 | type="text" | ||
| 183 | disabled={scope.$index == 0} | ||
| 184 | onClick={() => { | ||
| 185 | this.moveUpward(scope.$index, scope.row); | ||
| 186 | }} | ||
| 187 | > | ||
| 188 | 上移 | ||
| 189 | </el-button> | ||
| 190 | <el-button | ||
| 191 | type="text" | ||
| 192 | disabled={scope.$index + 1 == this.tableData.length} | ||
| 193 | onClick={() => { | ||
| 194 | this.moveDown(scope.$index, scope.row); | ||
| 195 | }} | ||
| 196 | > | ||
| 197 | 下移 | ||
| 198 | </el-button> | ||
| 199 | </div> | ||
| 200 | ); | ||
| 201 | }, | ||
| 202 | }, | ||
| 203 | ], | ||
| 204 | key: 0, | ||
| 205 | tableData: [], | ||
| 206 | previewImg: { | ||
| 207 | // 收件标识码 | ||
| 208 | bsmSj: '', | ||
| 209 | bsmSlsq: this.$parent.bsmSlsq, | ||
| 210 | index: 0, | ||
| 211 | selectedIndex: 0, | ||
| 212 | imgList: [] | ||
| 213 | } | ||
| 214 | } | ||
| 215 | }, | ||
| 216 | computed: { | ||
| 217 | ...mapGetters(["dictData"]) | ||
| 218 | }, | ||
| 219 | created () { | ||
| 220 | this.ableOperation = this.$parent.currentSelectTab.ableOperation | ||
| 221 | this.clmlInitList() | ||
| 222 | }, | ||
| 223 | methods: { | ||
| 224 | // 自动预览 | ||
| 225 | /** | ||
| 226 | * @description: 自动预览 | ||
| 227 | * @author: renchao | ||
| 228 | */ | ||
| 229 | nextPriview () { | ||
| 230 | if (this.treeCheckIndex < this.tableData.length) { | ||
| 231 | this.treeCheckIndex++ | ||
| 232 | this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj | ||
| 233 | this.previewImg.index = 0 | ||
| 234 | this.previewImg.imgList = this.tableData[this.treeCheckIndex].children | ||
| 235 | this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj | ||
| 236 | } | ||
| 237 | }, | ||
| 238 | /** | ||
| 239 | * @description: prevPriview | ||
| 240 | * @author: renchao | ||
| 241 | */ | ||
| 242 | prevPriview () { | ||
| 243 | if (this.treeCheckIndex >= 1) { | ||
| 244 | this.treeCheckIndex-- | ||
| 245 | this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj | ||
| 246 | this.previewImg.index = this.previewImg.imgList.length | ||
| 247 | this.previewImg.imgList = this.tableData[this.treeCheckIndex].children | ||
| 248 | this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj | ||
| 249 | } | ||
| 250 | }, | ||
| 251 | // 材料目录明细初始化 | ||
| 252 | /** | ||
| 253 | * @description: 材料目录明细初始化 | ||
| 254 | * @author: renchao | ||
| 255 | */ | ||
| 256 | clmlInitList () { | ||
| 257 | return new Promise(resolve => { | ||
| 258 | this.unitData = this.$parent.unitData; | ||
| 259 | var formdata = new FormData(); | ||
| 260 | formdata.append("bsmSldy", this.unitData[0]?.bsmSldy); | ||
| 261 | formdata.append("bsmSlsq", this.$parent.bsmSlsq); | ||
| 262 | formdata.append("clfl", 2); | ||
| 263 | InitClml(formdata).then((res) => { | ||
| 264 | if (res.result.code == 200) { | ||
| 265 | resolve(res.code) | ||
| 266 | if (res.result.result && res.result.result.length > 0) { | ||
| 267 | this.tableData = res.result.result; | ||
| 268 | this.treeCheckId = this.tableData[0].bsmSj; | ||
| 269 | this.title = this.tableData[0].sjmc; | ||
| 270 | this.titleYs = 1; | ||
| 271 | this.titleNum = this.tableData[0].children.length; | ||
| 272 | |||
| 273 | this.previewImg.imgList = this.tableData[0]?.children; | ||
| 274 | this.previewImg.bsmSj = this.tableData[0]?.bsmSj; | ||
| 275 | } | ||
| 276 | } else { | ||
| 277 | this.$message.error(res.result.message) | ||
| 278 | } | ||
| 279 | }) | ||
| 280 | }) | ||
| 281 | }, | ||
| 282 | /** | ||
| 283 | * @description: updateList | ||
| 284 | * @param {*} val | ||
| 285 | * @author: renchao | ||
| 286 | */ | ||
| 287 | updateList (val) { | ||
| 288 | let that = this | ||
| 289 | if (val != null) { //删除最后一张图片时 val=null | ||
| 290 | this.tableData.forEach(item => { | ||
| 291 | if (item.bsmSj === val.bsmSj) { | ||
| 292 | item.children = val.children | ||
| 293 | } | ||
| 294 | }) | ||
| 295 | this.previewImg.imgList = _.cloneDeep(val.children) | ||
| 296 | if (this.previewImg.index == this.previewImg.imgList.length) { | ||
| 297 | this.previewImg.index = this.previewImg.index - 1 | ||
| 298 | } | ||
| 299 | } else { | ||
| 300 | this.previewImg.imgList = [] | ||
| 301 | this.tableData.forEach((item, index) => { | ||
| 302 | if (this.treeCheckId == item.bsmSj) { | ||
| 303 | item.children = [] | ||
| 304 | that.treeCheckIndex = index | ||
| 305 | } | ||
| 306 | }) | ||
| 307 | } | ||
| 308 | |||
| 309 | }, | ||
| 310 | // 左侧菜单点击 | ||
| 311 | /** | ||
| 312 | * @description: 左侧菜单点击 | ||
| 313 | * @param {*} item | ||
| 314 | * @author: renchao | ||
| 315 | */ | ||
| 316 | menuClick (item) { | ||
| 317 | this.checkedId = item.id | ||
| 318 | }, | ||
| 319 | // 添加材料目录 | ||
| 320 | /** | ||
| 321 | * @description: 添加材料目录 | ||
| 322 | * @author: renchao | ||
| 323 | */ | ||
| 324 | handleAdd () { | ||
| 325 | this.isDialog = true; | ||
| 326 | }, | ||
| 327 | // 上移 | ||
| 328 | /** | ||
| 329 | * @description: 上移 | ||
| 330 | * @param {*} index | ||
| 331 | * @param {*} row | ||
| 332 | * @author: renchao | ||
| 333 | */ | ||
| 334 | moveUpward (index, row) { | ||
| 335 | let obj = { | ||
| 336 | xh: row.xh, | ||
| 337 | bsmSlsq: row.bsmSlsq, | ||
| 338 | moveDirection: "UP", | ||
| 339 | }; | ||
| 340 | // 接口待调 | ||
| 341 | moveClml(obj).then(async (res) => { | ||
| 342 | if (res.code == 200) { | ||
| 343 | let res = await this.clmlInitList() | ||
| 344 | if (res == 200) this.$message({ | ||
| 345 | message: '上移成功', | ||
| 346 | type: 'success' | ||
| 347 | }) | ||
| 348 | } else { | ||
| 349 | this.$message.error(res.message); | ||
| 350 | } | ||
| 351 | }) | ||
| 352 | }, | ||
| 353 | // 下移 | ||
| 354 | /** | ||
| 355 | * @description: 下移 | ||
| 356 | * @param {*} index | ||
| 357 | * @param {*} row | ||
| 358 | * @author: renchao | ||
| 359 | */ | ||
| 360 | moveDown (index, row) { | ||
| 361 | let obj = { | ||
| 362 | xh: row.xh, | ||
| 363 | bsmSlsq: row.bsmSlsq, | ||
| 364 | moveDirection: "DOWN", | ||
| 365 | } | ||
| 366 | // 接口待调 | ||
| 367 | moveClml(obj).then(async (res) => { | ||
| 368 | if (res.code == 200) { | ||
| 369 | let res = await this.clmlInitList() | ||
| 370 | if (res == 200) this.$message({ | ||
| 371 | message: '下移成功', | ||
| 372 | type: 'success' | ||
| 373 | }) | ||
| 374 | } else { | ||
| 375 | this.$message.error(res.message); | ||
| 376 | } | ||
| 377 | }) | ||
| 378 | }, | ||
| 379 | // 新增弹窗保存 | ||
| 380 | /** | ||
| 381 | * @description: 新增弹窗保存 | ||
| 382 | * @param {*} data | ||
| 383 | * @author: renchao | ||
| 384 | */ | ||
| 385 | addSave (data) { | ||
| 386 | let obj = { | ||
| 387 | bsmSlsq: this.$parent.bsmSlsq, | ||
| 388 | isrequired: "1", | ||
| 389 | sjmc: data.clmc, | ||
| 390 | sjsl: 0, | ||
| 391 | smzt: '', | ||
| 392 | ys: 0, | ||
| 393 | sjlx: data.cllx, | ||
| 394 | sfxjcl: "1", // 是否必选 | ||
| 395 | }; | ||
| 396 | saveClml(obj).then(async (res) => { | ||
| 397 | if (res.code == 200) { | ||
| 398 | let res = await this.clmlInitList() | ||
| 399 | if (res == 200) this.$message({ | ||
| 400 | message: "新增成功", | ||
| 401 | type: "success", | ||
| 402 | }) | ||
| 403 | } | ||
| 404 | }); | ||
| 405 | }, | ||
| 406 | // 材料目录删除 | ||
| 407 | /** | ||
| 408 | * @description: 材料目录删除 | ||
| 409 | * @param {*} index | ||
| 410 | * @param {*} row | ||
| 411 | * @author: renchao | ||
| 412 | */ | ||
| 413 | handleDelete (index, row) { | ||
| 414 | let that = this | ||
| 415 | this.$confirm('此操作将永久删除该 是否继续?', '提示', { | ||
| 416 | confirmButtonText: '确定', | ||
| 417 | cancelButtonText: '取消', | ||
| 418 | type: 'warning' | ||
| 419 | }).then(() => { | ||
| 420 | deleteSjClml({ sjBsm: row.bsmSj }).then(async (res) => { | ||
| 421 | if (res.code == 200) { | ||
| 422 | let res = await that.clmlInitList() | ||
| 423 | if (res == 200) that.$message({ | ||
| 424 | message: "删除成功", | ||
| 425 | type: "success", | ||
| 426 | }) | ||
| 427 | } | ||
| 428 | }) | ||
| 429 | }).catch(() => { | ||
| 430 | this.$message({ | ||
| 431 | type: 'info', | ||
| 432 | message: '已取消删除' | ||
| 433 | }) | ||
| 434 | }) | ||
| 435 | }, | ||
| 436 | // 材料目录点击选中 | ||
| 437 | /** | ||
| 438 | * @description: 材料目录点击选中 | ||
| 439 | * @param {*} item | ||
| 440 | * @param {*} index | ||
| 441 | * @author: renchao | ||
| 442 | */ | ||
| 443 | treeClick (item, index) { | ||
| 444 | this.previewImg.index = 0 | ||
| 445 | this.treeCheckId = item?.bsmSj | ||
| 446 | this.treeCheckIndex = index | ||
| 447 | this.previewImg.imgList = item.children ? item.children : [] | ||
| 448 | this.previewImg.bsmSj = item?.bsmSj | ||
| 449 | }, | ||
| 450 | // 小图片点击 | ||
| 451 | /** | ||
| 452 | * @description: 小图片点击 | ||
| 453 | * @param {*} item | ||
| 454 | * @param {*} index | ||
| 455 | * @author: renchao | ||
| 456 | */ | ||
| 457 | imgClick (item, index) { | ||
| 458 | this.showImg = item; | ||
| 459 | this.titleYs = index + 1; | ||
| 460 | }, | ||
| 461 | // 字典 | ||
| 462 | /** | ||
| 463 | * @description: 字典 | ||
| 464 | * @param {*} val | ||
| 465 | * @param {*} code | ||
| 466 | * @author: renchao | ||
| 467 | */ | ||
| 468 | dicStatus (val, code) { | ||
| 469 | let data = this.$store.getters.dictData[code], | ||
| 470 | name = "暂无"; | ||
| 471 | if (data) { | ||
| 472 | data.map((item) => { | ||
| 473 | if (item.dcode == val) { | ||
| 474 | name = item.dname; | ||
| 475 | } | ||
| 476 | }); | ||
| 477 | return name; | ||
| 478 | } | ||
| 479 | }, | ||
| 480 | }, | ||
| 481 | }; | ||
| 482 | </script> | ||
| 483 | <style scoped lang='scss'> | ||
| 484 | @import "~@/styles/mixin.scss"; | ||
| 485 | |||
| 486 | .active { | ||
| 487 | background: $light-blue !important; | ||
| 488 | color: #fff; | ||
| 489 | } | ||
| 490 | |||
| 491 | .required { | ||
| 492 | font-size: 12px; | ||
| 493 | color: $pink; | ||
| 494 | float: left; | ||
| 495 | } | ||
| 496 | |||
| 497 | .cl_number { | ||
| 498 | float: right; | ||
| 499 | } | ||
| 500 | |||
| 501 | .clxx { | ||
| 502 | width: 100%; | ||
| 503 | display: flex; | ||
| 504 | padding-left: 5px; | ||
| 505 | height: calc(100vh - 125px); | ||
| 506 | |||
| 507 | .left { | ||
| 508 | display: flex; | ||
| 509 | flex-direction: column; | ||
| 510 | justify-content: space-between; | ||
| 511 | |||
| 512 | .item { | ||
| 513 | width: 28px; | ||
| 514 | height: 49%; | ||
| 515 | @include flex-center; | ||
| 516 | background-color: #e4e7ed; | ||
| 517 | border-bottom-right-radius: 10px; | ||
| 518 | padding: 5px; | ||
| 519 | cursor: pointer; | ||
| 520 | transition: all 0.3s; | ||
| 521 | |||
| 522 | &:hover { | ||
| 523 | @extend .active; | ||
| 524 | } | ||
| 525 | } | ||
| 526 | } | ||
| 527 | |||
| 528 | .right { | ||
| 529 | width: 100%; | ||
| 530 | height: 100%; | ||
| 531 | |||
| 532 | .clmlmx-box { | ||
| 533 | margin: 0 auto; | ||
| 534 | |||
| 535 | .title { | ||
| 536 | text-align: center; | ||
| 537 | height: 60px; | ||
| 538 | line-height: 60px; | ||
| 539 | border: 1px solid #dfe6ec; | ||
| 540 | font-size: 20px; | ||
| 541 | background: #81d3f81a; | ||
| 542 | margin-bottom: -1px; | ||
| 543 | } | ||
| 544 | } | ||
| 545 | |||
| 546 | .clyl-box { | ||
| 547 | width: 100%; | ||
| 548 | height: 100%; | ||
| 549 | display: flex; | ||
| 550 | |||
| 551 | .menu-tree { | ||
| 552 | width: 20%; | ||
| 553 | min-width: 160px; | ||
| 554 | height: 100%; | ||
| 555 | margin-right: 10px; | ||
| 556 | border-right: 1px dotted #d9d9d9; | ||
| 557 | padding: 0 15px; | ||
| 558 | |||
| 559 | .item { | ||
| 560 | line-height: 30px; | ||
| 561 | padding-top: 5px; | ||
| 562 | border-bottom: 1px solid #e8e8e8; | ||
| 563 | font-size: 16px; | ||
| 564 | text-align: center; | ||
| 565 | color: $light-blue; | ||
| 566 | |||
| 567 | .itemIcon { | ||
| 568 | float: right; | ||
| 569 | line-height: 60px; | ||
| 570 | cursor: pointer; | ||
| 571 | } | ||
| 572 | |||
| 573 | .child { | ||
| 574 | line-height: 32px; | ||
| 575 | border-bottom: 1px solid #e8e8e8; | ||
| 576 | padding-left: 10px; | ||
| 577 | color: #6b6b6b; | ||
| 578 | cursor: pointer; | ||
| 579 | box-sizing: border-box; | ||
| 580 | border-radius: 6px; | ||
| 581 | line-height: 20px; | ||
| 582 | transition: all 0.3s; | ||
| 583 | padding: 8px 0; | ||
| 584 | } | ||
| 585 | |||
| 586 | .child:hover { | ||
| 587 | color: $light-blue; | ||
| 588 | transform: scale(1.1); | ||
| 589 | } | ||
| 590 | |||
| 591 | .checked { | ||
| 592 | border: 1px solid $light-blue; | ||
| 593 | color: $light-blue; | ||
| 594 | } | ||
| 595 | } | ||
| 596 | } | ||
| 597 | |||
| 598 | .clyl-img { | ||
| 599 | width: 75%; | ||
| 600 | height: 100%; | ||
| 601 | background: #f3f4f7; | ||
| 602 | margin: 0 auto; | ||
| 603 | position: relative; | ||
| 604 | } | ||
| 605 | } | ||
| 606 | } | ||
| 607 | } | ||
| 608 | </style> | 
| ... | @@ -9,39 +9,73 @@ | ... | @@ -9,39 +9,73 @@ | 
| 9 | <!-- 材料预览 --> | 9 | <!-- 材料预览 --> | 
| 10 | <div class="clyl-box"> | 10 | <div class="clyl-box"> | 
| 11 | <div class="menu-tree"> | 11 | <div class="menu-tree"> | 
| 12 | <el-button type="primary" native-type="submit" @click="viewDetail" style="width:100%;margin-top:10px;">查看明细</el-button> | 12 | <el-button | 
| 13 | type="primary" | ||
| 14 | native-type="submit" | ||
| 15 | @click="viewDetail" | ||
| 16 | style="width: 100%; margin-top: 10px" | ||
| 17 | >查看明细</el-button | ||
| 18 | > | ||
| 13 | <div class="item"> | 19 | <div class="item"> | 
| 14 | 材料目录({{tableData.length}}) | 20 | 材料目录({{ tableData.length }}) | 
| 15 | <div style="margin-top:10px"> | 21 | <div style="margin-top: 10px"> | 
| 16 | <div style="text-align: center;line-height:20px;color:black;font-size:14px" v-if="tableData.length == 0">暂无数据</div> | 22 | <div | 
| 17 | <div v-for="(item,index) in tableData" :key="item.bsmSj" | 23 | style=" | 
| 18 | :class="['child', treeCheckId == item.bsmSj ? 'checked' : '']" @click="treeClick(item,index)"> | 24 | text-align: center; | 
| 19 | <span v-if="item.isrequired==1" class="required">必选</span> | 25 | line-height: 20px; | 
| 26 | color: black; | ||
| 27 | font-size: 14px; | ||
| 28 | " | ||
| 29 | v-if="tableData.length == 0" | ||
| 30 | > | ||
| 31 | 暂无数据 | ||
| 32 | </div> | ||
| 33 | <div | ||
| 34 | v-for="(item, index) in tableData" | ||
| 35 | :key="item.bsmSj" | ||
| 36 | :class="['child', treeCheckId == item.bsmSj ? 'checked' : '']" | ||
| 37 | @click="treeClick(item, index)" | ||
| 38 | > | ||
| 39 | <span v-if="item.isrequired == 1" class="required">必选</span> | ||
| 20 | {{ item.sjmc }} | 40 | {{ item.sjmc }} | 
| 21 | <span class="cl_number">({{item.children ? item.children.length : 0}})</span> | 41 | <span class="cl_number" | 
| 42 | >({{ item.children ? item.children.length : 0 }})</span | ||
| 43 | > | ||
| 22 | </div> | 44 | </div> | 
| 23 | </div> | 45 | </div> | 
| 24 | </div> | 46 | </div> | 
| 25 | <el-button type="primary" native-type="submit" style="width:100%" @click="handleAdd()" | 47 | <el-button | 
| 26 | v-if="ableOperation">新增</el-button> | 48 | type="primary" | 
| 49 | native-type="submit" | ||
| 50 | style="width: 100%" | ||
| 51 | @click="handleAdd()" | ||
| 52 | v-if="ableOperation" | ||
| 53 | >新增</el-button | ||
| 54 | > | ||
| 27 | </div> | 55 | </div> | 
| 28 | <image-preview ref='imageRef' v-if="tableData.length>0" :previewImg="previewImg" :ableOperation="ableOperation" @updateList="updateList" | 56 | <image-preview | 
| 57 | ref="imageRef" | ||
| 58 | v-if="tableData.length > 0" | ||
| 59 | :previewImg="previewImg" | ||
| 60 | :ableOperation="ableOperation" | ||
| 61 | @updateList="updateList" | ||
| 29 | @nextPriview="nextPriview" | 62 | @nextPriview="nextPriview" | 
| 30 | @prevPriview="prevPriview" /> | 63 | @prevPriview="prevPriview" | 
| 64 | /> | ||
| 31 | </div> | 65 | </div> | 
| 32 | </div> | 66 | </div> | 
| 33 | <clxxAddDialog v-model="isDialog" /> | 67 | <clxxAddDialog v-model="isDialog" /> | 
| 34 | </div> | 68 | </div> | 
| 35 | </template> | 69 | </template> | 
| 36 | <script> | 70 | <script> | 
| 37 | import { mapGetters } from "vuex"; | 71 | import { mapGetters } from "vuex"; | 
| 38 | import clxxAddDialog from "../dialog/clxxAddDialog.vue"; | 72 | import clxxAddDialog from "../dialog/clxxAddDialog.vue"; | 
| 39 | import clxxDetailDialog from "../dialog/clxxDetailDialog.vue"; | 73 | import clxxDetailDialog from "../dialog/clxxDetailDialog.vue"; | 
| 40 | import imagePreview from '@/views/components/imagePreview.vue' | 74 | import imagePreview from "@/views/components/imagePreview.vue"; | 
| 41 | import { InitClml, saveClml } from "@/api/clxx.js"; | 75 | import { InitClml, saveClml } from "@/api/clxx.js"; | 
| 42 | export default { | 76 | export default { | 
| 43 | components: { clxxAddDialog, imagePreview, clxxDetailDialog }, | 77 | components: { clxxAddDialog, imagePreview, clxxDetailDialog }, | 
| 44 | data () { | 78 | data() { | 
| 45 | return { | 79 | return { | 
| 46 | //表单是否可操作 | 80 | //表单是否可操作 | 
| 47 | ableOperation: true, | 81 | ableOperation: true, | 
| ... | @@ -54,32 +88,40 @@ | ... | @@ -54,32 +88,40 @@ | 
| 54 | tableData: [], | 88 | tableData: [], | 
| 55 | previewImg: { | 89 | previewImg: { | 
| 56 | // 收件标识码 | 90 | // 收件标识码 | 
| 57 | bsmSj: '', | 91 | bsmSj: "", | 
| 58 | bsmSlsq: this.$parent.bsmSlsq, | 92 | bsmSlsq: this.$parent.bsmSlsq, | 
| 59 | index: 0, | 93 | index: 0, | 
| 60 | selectedIndex: 0, | 94 | selectedIndex: 0, | 
| 61 | imgList: [] | 95 | imgList: [], | 
| 62 | } | 96 | }, | 
| 63 | } | 97 | }; | 
| 64 | }, | 98 | }, | 
| 65 | computed: { | 99 | computed: { | 
| 66 | ...mapGetters(["dictData"]) | 100 | ...mapGetters(["dictData"]), | 
| 67 | }, | 101 | }, | 
| 68 | created () { | 102 | created() { | 
| 69 | this.clmlInitList(1) | 103 | this.clmlInitList(1); | 
| 70 | }, | 104 | }, | 
| 71 | computed: { | 105 | computed: { | 
| 72 | ...mapGetters(['workFresh']) | 106 | ...mapGetters(["workFresh"]), | 
| 73 | }, | 107 | }, | 
| 74 | watch: { | 108 | watch: { | 
| 75 | workFresh: { | 109 | workFresh: { | 
| 76 | handler (newVal, oldVal) { | 110 | handler(newVal, oldVal) { | 
| 77 | if (newVal) this.clmlInitList(1) | 111 | if (newVal) this.clmlInitList(1); | 
| 78 | } | 112 | }, | 
| 79 | } | ||
| 80 | }, | 113 | }, | 
| 81 | mounted () { | 114 | }, | 
| 82 | this.ableOperation = this.$parent.ableOperation | 115 | mounted() { | 
| 116 | console.log( | ||
| 117 | "bestepid: this.$route.query.bestepid,", | ||
| 118 | this.$route.query.bestepid | ||
| 119 | ); | ||
| 120 | console.log( | ||
| 121 | "bestepid: this.$route.query.sqywbm,", | ||
| 122 | this.$route.query.sqywbm | ||
| 123 | ); | ||
| 124 | this.ableOperation = this.$parent.ableOperation; | ||
| 83 | }, | 125 | }, | 
| 84 | methods: { | 126 | methods: { | 
| 85 | // 自动预览 | 127 | // 自动预览 | 
| ... | @@ -87,26 +129,26 @@ | ... | @@ -87,26 +129,26 @@ | 
| 87 | * @description: 自动预览 | 129 | * @description: 自动预览 | 
| 88 | * @author: renchao | 130 | * @author: renchao | 
| 89 | */ | 131 | */ | 
| 90 | nextPriview () { | 132 | nextPriview() { | 
| 91 | if (this.treeCheckIndex < this.tableData.length) { | 133 | if (this.treeCheckIndex < this.tableData.length) { | 
| 92 | this.treeCheckIndex++ | 134 | this.treeCheckIndex++; | 
| 93 | this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj | 135 | this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj; | 
| 94 | this.previewImg.index = 0 | 136 | this.previewImg.index = 0; | 
| 95 | this.previewImg.imgList = this.tableData[this.treeCheckIndex].children | 137 | this.previewImg.imgList = this.tableData[this.treeCheckIndex].children; | 
| 96 | this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj | 138 | this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj; | 
| 97 | } | 139 | } | 
| 98 | }, | 140 | }, | 
| 99 | /** | 141 | /** | 
| 100 | * @description: prevPriview | 142 | * @description: prevPriview | 
| 101 | * @author: renchao | 143 | * @author: renchao | 
| 102 | */ | 144 | */ | 
| 103 | prevPriview () { | 145 | prevPriview() { | 
| 104 | if (this.treeCheckIndex >= 1) { | 146 | if (this.treeCheckIndex >= 1) { | 
| 105 | this.treeCheckIndex-- | 147 | this.treeCheckIndex--; | 
| 106 | this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj | 148 | this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj; | 
| 107 | this.previewImg.index = this.previewImg.imgList.length | 149 | this.previewImg.index = this.previewImg.imgList.length; | 
| 108 | this.previewImg.imgList = this.tableData[this.treeCheckIndex].children | 150 | this.previewImg.imgList = this.tableData[this.treeCheckIndex].children; | 
| 109 | this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj | 151 | this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj; | 
| 110 | } | 152 | } | 
| 111 | }, | 153 | }, | 
| 112 | // 材料目录明细初始化 | 154 | // 材料目录明细初始化 | 
| ... | @@ -115,38 +157,48 @@ | ... | @@ -115,38 +157,48 @@ | 
| 115 | * @param {*} type | 157 | * @param {*} type | 
| 116 | * @author: renchao | 158 | * @author: renchao | 
| 117 | */ | 159 | */ | 
| 118 | clmlInitList (type) { | 160 | clmlInitList(type) { | 
| 119 | //type 1:列表初始化 2:新增材料 | 161 | //type 1:列表初始化 2:新增材料 | 
| 120 | return new Promise(resolve => { | 162 | return new Promise((resolve) => { | 
| 121 | this.unitData = this.$parent.unitData; | 163 | this.unitData = this.$parent.unitData; | 
| 122 | var formdata = new FormData(); | 164 | var formdata = new FormData(); | 
| 123 | formdata.append("bsmSldy", this.unitData[0]?.bsmSldy); | 165 | |
| 124 | formdata.append("bsmSlsq", this.$parent.bsmSlsq); | 166 | formdata.append("bsmSlsq", this.$parent.bsmSlsq); | 
| 167 | if (this.$route.query.sqywbm == "DJBBL") { | ||
| 168 | formdata.append("bsmSldy", this.$parent.bsmRepair); | ||
| 169 | formdata.append("clfl", 3); | ||
| 170 | } else { | ||
| 171 | formdata.append("bsmSldy", this.unitData[0]?.bsmSldy); | ||
| 125 | formdata.append("clfl", 2); | 172 | formdata.append("clfl", 2); | 
| 173 | } | ||
| 174 | |||
| 126 | InitClml(formdata).then((res) => { | 175 | InitClml(formdata).then((res) => { | 
| 127 | if (res.code == 200) { | 176 | if (res.code == 200) { | 
| 128 | resolve(res.code) | 177 | resolve(res.code); | 
| 129 | if (res.result && res.result.length > 0) { | 178 | if (res.result && res.result.length > 0) { | 
| 130 | this.tableData = res.result; | 179 | this.tableData = res.result; | 
| 131 | if (type == 1) { | 180 | if (type == 1) { | 
| 132 | this.treeClick(this.tableData[0], 0); | 181 | this.treeClick(this.tableData[0], 0); | 
| 133 | } else { | 182 | } else { | 
| 134 | //新增材料后刷新列表焦点置于新增的对象上 | 183 | //新增材料后刷新列表焦点置于新增的对象上 | 
| 135 | this.treeClick(this.tableData[this.tableData.length - 1], this.tableData.length - 1); | 184 | this.treeClick( | 
| 185 | this.tableData[this.tableData.length - 1], | ||
| 186 | this.tableData.length - 1 | ||
| 187 | ); | ||
| 136 | } | 188 | } | 
| 137 | } | 189 | } | 
| 138 | } else { | 190 | } else { | 
| 139 | this.$message.error(res.message) | 191 | this.$message.error(res.message); | 
| 140 | } | 192 | } | 
| 141 | }) | 193 | }); | 
| 142 | }) | 194 | }); | 
| 143 | }, | 195 | }, | 
| 144 | /** | 196 | /** | 
| 145 | * @description: setChecked | 197 | * @description: setChecked | 
| 146 | * @param {*} item | 198 | * @param {*} item | 
| 147 | * @author: renchao | 199 | * @author: renchao | 
| 148 | */ | 200 | */ | 
| 149 | setChecked (item) { | 201 | setChecked(item) { | 
| 150 | this.treeCheckId = item.bsmSj; | 202 | this.treeCheckId = item.bsmSj; | 
| 151 | this.title = item.sjmc; | 203 | this.title = item.sjmc; | 
| 152 | this.titleYs = 1; | 204 | this.titleYs = 1; | 
| ... | @@ -159,26 +211,27 @@ | ... | @@ -159,26 +211,27 @@ | 
| 159 | * @param {*} val | 211 | * @param {*} val | 
| 160 | * @author: renchao | 212 | * @author: renchao | 
| 161 | */ | 213 | */ | 
| 162 | updateList (val) { | 214 | updateList(val) { | 
| 163 | let that = this | 215 | let that = this; | 
| 164 | if (val.children.length != 0) { //删除最后一张图片时 val=null | 216 | if (val.children.length != 0) { | 
| 165 | this.tableData.forEach(item => { | 217 | //删除最后一张图片时 val=null | 
| 218 | this.tableData.forEach((item) => { | ||
| 166 | if (item.bsmSj === val.bsmSj) { | 219 | if (item.bsmSj === val.bsmSj) { | 
| 167 | item.children = val.children | 220 | item.children = val.children; | 
| 168 | } | 221 | } | 
| 169 | }) | 222 | }); | 
| 170 | this.previewImg.imgList = _.cloneDeep(val.children) | 223 | this.previewImg.imgList = _.cloneDeep(val.children); | 
| 171 | if (this.previewImg.index == this.previewImg.imgList.length) { | 224 | if (this.previewImg.index == this.previewImg.imgList.length) { | 
| 172 | this.previewImg.index = this.previewImg.index - 1 | 225 | this.previewImg.index = this.previewImg.index - 1; | 
| 173 | } | 226 | } | 
| 174 | } else { | 227 | } else { | 
| 175 | this.previewImg.imgList = [] | 228 | this.previewImg.imgList = []; | 
| 176 | this.tableData.forEach((item, index) => { | 229 | this.tableData.forEach((item, index) => { | 
| 177 | if (this.treeCheckId == item.bsmSj) { | 230 | if (this.treeCheckId == item.bsmSj) { | 
| 178 | item.children = [] | 231 | item.children = []; | 
| 179 | that.treeCheckIndex = index | 232 | that.treeCheckIndex = index; | 
| 180 | } | 233 | } | 
| 181 | }) | 234 | }); | 
| 182 | } | 235 | } | 
| 183 | }, | 236 | }, | 
| 184 | // 添加材料目录 | 237 | // 添加材料目录 | 
| ... | @@ -186,7 +239,7 @@ | ... | @@ -186,7 +239,7 @@ | 
| 186 | * @description: 添加材料目录 | 239 | * @description: 添加材料目录 | 
| 187 | * @author: renchao | 240 | * @author: renchao | 
| 188 | */ | 241 | */ | 
| 189 | handleAdd () { | 242 | handleAdd() { | 
| 190 | this.isDialog = true; | 243 | this.isDialog = true; | 
| 191 | }, | 244 | }, | 
| 192 | // 新增弹窗保存 | 245 | // 新增弹窗保存 | 
| ... | @@ -195,24 +248,25 @@ | ... | @@ -195,24 +248,25 @@ | 
| 195 | * @param {*} data | 248 | * @param {*} data | 
| 196 | * @author: renchao | 249 | * @author: renchao | 
| 197 | */ | 250 | */ | 
| 198 | addSave (data) { | 251 | addSave(data) { | 
| 199 | let obj = { | 252 | let obj = { | 
| 200 | bsmSlsq: this.$parent.bsmSlsq, | 253 | bsmSlsq: this.$parent.bsmSlsq, | 
| 201 | isrequired: "1", | 254 | isrequired: "1", | 
| 202 | sjmc: data.clmc, | 255 | sjmc: data.clmc, | 
| 203 | sjsl: 0, | 256 | sjsl: 0, | 
| 204 | smzt: '', | 257 | smzt: "", | 
| 205 | ys: 0, | 258 | ys: 0, | 
| 206 | sjlx: data.cllx, | 259 | sjlx: data.cllx, | 
| 207 | sfxjcl: "1", // 是否必选 | 260 | sfxjcl: "1", // 是否必选 | 
| 208 | }; | 261 | }; | 
| 209 | saveClml(obj).then(async (res) => { | 262 | saveClml(obj).then(async (res) => { | 
| 210 | if (res.code == 200) { | 263 | if (res.code == 200) { | 
| 211 | let res = await this.clmlInitList(2) | 264 | let res = await this.clmlInitList(2); | 
| 212 | if (res == 200) this.$message({ | 265 | if (res == 200) | 
| 266 | this.$message({ | ||
| 213 | message: "新增成功", | 267 | message: "新增成功", | 
| 214 | type: "success", | 268 | type: "success", | 
| 215 | }) | 269 | }); | 
| 216 | } | 270 | } | 
| 217 | }); | 271 | }); | 
| 218 | }, | 272 | }, | 
| ... | @@ -223,12 +277,12 @@ | ... | @@ -223,12 +277,12 @@ | 
| 223 | * @param {*} index | 277 | * @param {*} index | 
| 224 | * @author: renchao | 278 | * @author: renchao | 
| 225 | */ | 279 | */ | 
| 226 | treeClick (item, index) { | 280 | treeClick(item, index) { | 
| 227 | this.previewImg.index = 0 | 281 | this.previewImg.index = 0; | 
| 228 | this.treeCheckId = item?.bsmSj | 282 | this.treeCheckId = item?.bsmSj; | 
| 229 | this.treeCheckIndex = index | 283 | this.treeCheckIndex = index; | 
| 230 | this.previewImg.imgList = item.children ? item.children : [] | 284 | this.previewImg.imgList = item.children ? item.children : []; | 
| 231 | this.previewImg.bsmSj = item?.bsmSj | 285 | this.previewImg.bsmSj = item?.bsmSj; | 
| 232 | }, | 286 | }, | 
| 233 | // 小图片点击 | 287 | // 小图片点击 | 
| 234 | /** | 288 | /** | 
| ... | @@ -237,7 +291,7 @@ | ... | @@ -237,7 +291,7 @@ | 
| 237 | * @param {*} index | 291 | * @param {*} index | 
| 238 | * @author: renchao | 292 | * @author: renchao | 
| 239 | */ | 293 | */ | 
| 240 | imgClick (item, index) { | 294 | imgClick(item, index) { | 
| 241 | this.showImg = item; | 295 | this.showImg = item; | 
| 242 | this.titleYs = index + 1; | 296 | this.titleYs = index + 1; | 
| 243 | }, | 297 | }, | 
| ... | @@ -248,55 +302,61 @@ | ... | @@ -248,55 +302,61 @@ | 
| 248 | * @param {*} code | 302 | * @param {*} code | 
| 249 | * @author: renchao | 303 | * @author: renchao | 
| 250 | */ | 304 | */ | 
| 251 | dicStatus (val, code) { | 305 | dicStatus(val, code) { | 
| 252 | let data = this.$store.getters.dictData[code], | 306 | let data = this.$store.getters.dictData[code], | 
| 253 | name = "暂无"; | 307 | name = "暂无"; | 
| 254 | if (data) { | 308 | if (data) { | 
| 255 | data.map((item) => { | 309 | data.map((item) => { | 
| 256 | if (item.dcode == val) { | 310 | if (item.dcode == val) { | 
| 257 | name = item.dname | 311 | name = item.dname; | 
| 258 | } | 312 | } | 
| 259 | }); | 313 | }); | 
| 260 | return name | 314 | return name; | 
| 261 | } | 315 | } | 
| 262 | }, | 316 | }, | 
| 263 | //查看明细 | 317 | //查看明细 | 
| 264 | viewDetail () { | 318 | viewDetail() { | 
| 265 | this.$store.dispatch('user/reWorkFresh', false) | 319 | this.$store.dispatch("user/reWorkFresh", false); | 
| 266 | this.$popupDialog("查看明细", "workflow/components/dialog/clxxDetailDialog", { | 320 | this.$popupDialog( | 
| 321 | "查看明细", | ||
| 322 | "workflow/components/dialog/clxxDetailDialog", | ||
| 323 | { | ||
| 267 | data: this.tableData, | 324 | data: this.tableData, | 
| 268 | unitData: this.$parent.unitData, | 325 | unitData: this.$parent.unitData, | 
| 269 | ableOperation: this.$parent.ableOperation | 326 | ableOperation: this.$parent.ableOperation, | 
| 270 | }, "60%", true) | 327 | }, | 
| 328 | "60%", | ||
| 329 | true | ||
| 330 | ); | ||
| 271 | }, | 331 | }, | 
| 272 | //设置tableData | 332 | //设置tableData | 
| 273 | setTableData (tableData) { | 333 | setTableData(tableData) { | 
| 274 | this.$nextTick(res => { | 334 | this.$nextTick((res) => { | 
| 275 | this.tableData = tableData; | 335 | this.tableData = tableData; | 
| 276 | }) | 336 | }); | 
| 277 | }, | 337 | }, | 
| 278 | }, | 338 | }, | 
| 279 | }; | 339 | }; | 
| 280 | </script> | 340 | </script> | 
| 281 | <style scoped lang='scss'> | 341 | <style scoped lang="scss"> | 
| 282 | @import "~@/styles/mixin.scss"; | 342 | @import "~@/styles/mixin.scss"; | 
| 283 | 343 | ||
| 284 | .active { | 344 | .active { | 
| 285 | background: $light-blue !important; | 345 | background: $light-blue !important; | 
| 286 | color: #fff; | 346 | color: #fff; | 
| 287 | } | 347 | } | 
| 288 | 348 | ||
| 289 | .required { | 349 | .required { | 
| 290 | font-size: 12px; | 350 | font-size: 12px; | 
| 291 | color: $pink; | 351 | color: $pink; | 
| 292 | float: left; | 352 | float: left; | 
| 293 | } | 353 | } | 
| 294 | 354 | ||
| 295 | .cl_number { | 355 | .cl_number { | 
| 296 | float: right; | 356 | float: right; | 
| 297 | } | 357 | } | 
| 298 | 358 | ||
| 299 | .clxx { | 359 | .clxx { | 
| 300 | width: 100%; | 360 | width: 100%; | 
| 301 | display: flex; | 361 | display: flex; | 
| 302 | padding-left: 5px; | 362 | padding-left: 5px; | 
| ... | @@ -402,5 +462,5 @@ | ... | @@ -402,5 +462,5 @@ | 
| 402 | } | 462 | } | 
| 403 | } | 463 | } | 
| 404 | } | 464 | } | 
| 405 | } | 465 | } | 
| 406 | </style> | 466 | </style> | ... | ... | 
- 
Please register or sign in to post a comment