|  |  |  | @ -78,6 +78,13 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                         >删除 | 
			
		
	
		
			
				
					|  |  |  |  |                         </el-button | 
			
		
	
		
			
				
					|  |  |  |  |                         > | 
			
		
	
		
			
				
					|  |  |  |  |                        <!-- <el-button | 
			
		
	
		
			
				
					|  |  |  |  |                             type="text" | 
			
		
	
		
			
				
					|  |  |  |  |                             size="small" | 
			
		
	
		
			
				
					|  |  |  |  |                             @click.native="handleAuthBussinessType(scope.$index, scope.row)" | 
			
		
	
		
			
				
					|  |  |  |  |                         >单据类型 | 
			
		
	
		
			
				
					|  |  |  |  |                         </el-button | 
			
		
	
		
			
				
					|  |  |  |  |                         >--> | 
			
		
	
		
			
				
					|  |  |  |  |                     </template> | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-table-column> | 
			
		
	
		
			
				
					|  |  |  |  |             </el-table> | 
			
		
	
	
		
			
				
					|  |  |  | @ -171,6 +178,56 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                 > | 
			
		
	
		
			
				
					|  |  |  |  |             </div> | 
			
		
	
		
			
				
					|  |  |  |  |         </el-dialog> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         <!--扫码单据类型授权--> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-dialog | 
			
		
	
		
			
				
					|  |  |  |  |             title="扫码单据类型授权" | 
			
		
	
		
			
				
					|  |  |  |  |             :close-on-click-modal="false" | 
			
		
	
		
			
				
					|  |  |  |  |             :close-on-press-escape="false" | 
			
		
	
		
			
				
					|  |  |  |  |             :visible.sync="authBussinessTypeFormVisible" | 
			
		
	
		
			
				
					|  |  |  |  |             class="dialog" | 
			
		
	
		
			
				
					|  |  |  |  |         > | 
			
		
	
		
			
				
					|  |  |  |  |             <el-table v-loading="loading" :data="bussinessTypeList" ref="typeList" | 
			
		
	
		
			
				
					|  |  |  |  |                       @selection-change="handleSelectionChange" | 
			
		
	
		
			
				
					|  |  |  |  |                       style="width: 100%"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-table-column | 
			
		
	
		
			
				
					|  |  |  |  |                     type="selection" | 
			
		
	
		
			
				
					|  |  |  |  |                     :reserve-selection="false" | 
			
		
	
		
			
				
					|  |  |  |  |                     width="55"> | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-table-column> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-table-column label="扫码单据类型" prop="name" fixed></el-table-column> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-table-column label="扫码单据类型代码" prop="action" fixed></el-table-column> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-table-column label="是否启用" prop="enable" fixed> | 
			
		
	
		
			
				
					|  |  |  |  |                     <template slot-scope="scope"> | 
			
		
	
		
			
				
					|  |  |  |  |                         <span>{{ enableMap[scope.row.enable] }}</span> | 
			
		
	
		
			
				
					|  |  |  |  |                     </template> | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-table-column> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-table-column label="必须选择业务单据校验" prop="checkEnable" fixed> | 
			
		
	
		
			
				
					|  |  |  |  |                     <template slot-scope="scope"> | 
			
		
	
		
			
				
					|  |  |  |  |                         <span>{{ enableMap[scope.row.checkEnable] }}</span> | 
			
		
	
		
			
				
					|  |  |  |  |                     </template> | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-table-column> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-table-column label="二次核对" prop="secCheckEnable" fixed> | 
			
		
	
		
			
				
					|  |  |  |  |                     <template slot-scope="scope"> | 
			
		
	
		
			
				
					|  |  |  |  |                         <span>{{ enableMap[scope.row.secCheckEnable] }}</span> | 
			
		
	
		
			
				
					|  |  |  |  |                     </template> | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-table-column> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-table-column label="关联业务单据" prop="localName" fixed></el-table-column> | 
			
		
	
		
			
				
					|  |  |  |  |             </el-table> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             <div slot="footer" class="dialog-footer"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-button @click.native="authBussinessTypeFormVisible = !authBussinessTypeFormVisible" | 
			
		
	
		
			
				
					|  |  |  |  |                 >取消 | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-button | 
			
		
	
		
			
				
					|  |  |  |  |                 > | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-button | 
			
		
	
		
			
				
					|  |  |  |  |                     type="primary" | 
			
		
	
		
			
				
					|  |  |  |  |                     @click.native="updateBussinessTypeRole()" | 
			
		
	
		
			
				
					|  |  |  |  |                 >提交 | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-button> | 
			
		
	
		
			
				
					|  |  |  |  |             </div> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         </el-dialog> | 
			
		
	
		
			
				
					|  |  |  |  |     </div> | 
			
		
	
		
			
				
					|  |  |  |  | </template> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -182,6 +239,8 @@ import { | 
			
		
	
		
			
				
					|  |  |  |  |     authRoleSave, | 
			
		
	
		
			
				
					|  |  |  |  |     authRoleDelete | 
			
		
	
		
			
				
					|  |  |  |  | } from "../../../api/auth/authRole"; | 
			
		
	
		
			
				
					|  |  |  |  | import {getBussinessType} from "../../../api/basic/bussinessType"; | 
			
		
	
		
			
				
					|  |  |  |  | import {getBussinessTypeRole, updateBussinessTypeRole} from "../../../api/basic/bussinessTypeRole"; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | const formJson = { | 
			
		
	
		
			
				
					|  |  |  |  |     id: "", | 
			
		
	
	
		
			
				
					|  |  |  | @ -210,6 +269,10 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |             }, | 
			
		
	
		
			
				
					|  |  |  |  |             authLoading: false, | 
			
		
	
		
			
				
					|  |  |  |  |             authFormVisible: false, | 
			
		
	
		
			
				
					|  |  |  |  |             authBussinessTypeFormVisible: false, | 
			
		
	
		
			
				
					|  |  |  |  |             bussinessTypeList: {}, | 
			
		
	
		
			
				
					|  |  |  |  |             multipleSelection: [], | 
			
		
	
		
			
				
					|  |  |  |  |             currentCheckedRoleId: null, | 
			
		
	
		
			
				
					|  |  |  |  |             authFormData: { | 
			
		
	
		
			
				
					|  |  |  |  |                 role_id: "", | 
			
		
	
		
			
				
					|  |  |  |  |                 auth_rules: [] | 
			
		
	
	
		
			
				
					|  |  |  | @ -225,6 +288,10 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |                 0: "否", | 
			
		
	
		
			
				
					|  |  |  |  |                 1: "是", | 
			
		
	
		
			
				
					|  |  |  |  |             }, | 
			
		
	
		
			
				
					|  |  |  |  |             enableMap: { | 
			
		
	
		
			
				
					|  |  |  |  |                 true: "是", | 
			
		
	
		
			
				
					|  |  |  |  |                 false: "否", | 
			
		
	
		
			
				
					|  |  |  |  |             }, | 
			
		
	
		
			
				
					|  |  |  |  |             formLoading: false, | 
			
		
	
		
			
				
					|  |  |  |  |             formVisible: false, | 
			
		
	
		
			
				
					|  |  |  |  |             formData: formJson, | 
			
		
	
	
		
			
				
					|  |  |  | @ -454,6 +521,55 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |                         this.$message.info("取消删除"); | 
			
		
	
		
			
				
					|  |  |  |  |                     }); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         }, | 
			
		
	
		
			
				
					|  |  |  |  |         //单据类型 | 
			
		
	
		
			
				
					|  |  |  |  |         handleAuthBussinessType(index, row) { | 
			
		
	
		
			
				
					|  |  |  |  |             this.authBussinessTypeFormVisible = true; | 
			
		
	
		
			
				
					|  |  |  |  |             this.currentCheckedRoleId = row.id; | 
			
		
	
		
			
				
					|  |  |  |  |             let query = {'roleId': row.id}; | 
			
		
	
		
			
				
					|  |  |  |  |             getBussinessTypeRole(query).then((res) => { | 
			
		
	
		
			
				
					|  |  |  |  |                 this.multipleSelection = []; | 
			
		
	
		
			
				
					|  |  |  |  |                 let count = 0; | 
			
		
	
		
			
				
					|  |  |  |  |                 if (res.data.length > 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                     this.bussinessTypeList.forEach(type => { | 
			
		
	
		
			
				
					|  |  |  |  |                         res.data.forEach(data => { | 
			
		
	
		
			
				
					|  |  |  |  |                             if (type.action == data.action) { | 
			
		
	
		
			
				
					|  |  |  |  |                                 this.$refs.typeList.toggleRowSelection(type, true); | 
			
		
	
		
			
				
					|  |  |  |  |                             } else { | 
			
		
	
		
			
				
					|  |  |  |  |                                 //未匹配上取消勾选,清除数据缓存 | 
			
		
	
		
			
				
					|  |  |  |  |                                 this.$refs.typeList.toggleRowSelection(type, false); | 
			
		
	
		
			
				
					|  |  |  |  |                             } | 
			
		
	
		
			
				
					|  |  |  |  |                         }); | 
			
		
	
		
			
				
					|  |  |  |  |                     }); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |  |         }, | 
			
		
	
		
			
				
					|  |  |  |  |         updateBussinessTypeRole() { | 
			
		
	
		
			
				
					|  |  |  |  |             this.authBussinessTypeFormVisible = false; | 
			
		
	
		
			
				
					|  |  |  |  |             if (this.multipleSelection.length == 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                 this.$message.error("至少选中一行数据") | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |             let actions = this.multipleSelection.join(","); | 
			
		
	
		
			
				
					|  |  |  |  |             let query = { | 
			
		
	
		
			
				
					|  |  |  |  |                 'roleId': this.currentCheckedRoleId, | 
			
		
	
		
			
				
					|  |  |  |  |                 'actions': actions | 
			
		
	
		
			
				
					|  |  |  |  |             }; | 
			
		
	
		
			
				
					|  |  |  |  |             updateBussinessTypeRole(query).then((res) => { | 
			
		
	
		
			
				
					|  |  |  |  |                 if (res.code == 20000) { | 
			
		
	
		
			
				
					|  |  |  |  |                     this.$message.info("授权成功"); | 
			
		
	
		
			
				
					|  |  |  |  |                     this.multipleSelection = []; | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             }).catch((error) => { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |  |             this.multipleSelection = null; | 
			
		
	
		
			
				
					|  |  |  |  |         }, | 
			
		
	
		
			
				
					|  |  |  |  |         handleSelectionChange(row) { | 
			
		
	
		
			
				
					|  |  |  |  |             let _this = this; | 
			
		
	
		
			
				
					|  |  |  |  |             _this.multipleSelection = []; | 
			
		
	
		
			
				
					|  |  |  |  |             row.forEach((item) => { | 
			
		
	
		
			
				
					|  |  |  |  |                 _this.multipleSelection.push(item.action); | 
			
		
	
		
			
				
					|  |  |  |  |             }) | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |  |     filters: { | 
			
		
	
	
		
			
				
					|  |  |  | @ -477,6 +593,10 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |     created() { | 
			
		
	
		
			
				
					|  |  |  |  |         // 加载表格数据 | 
			
		
	
		
			
				
					|  |  |  |  |         this.getList(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         getBussinessType().then((res) => { | 
			
		
	
		
			
				
					|  |  |  |  |             this.bussinessTypeList = res.data.list; | 
			
		
	
		
			
				
					|  |  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | }; | 
			
		
	
		
			
				
					|  |  |  |  | </script> | 
			
		
	
	
		
			
				
					|  |  |  | 
 |