--no commit message
Showing
4 changed files
with
6 additions
and
317 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> |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment