index.vue 4.65 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
<template>
	<div style="display: flex;">
		<div class="min_full" style="width: 200px;border-right: 0px;">
			<TreeBase :app='app' @selected='selectedTree'></TreeBase>
		</div>
		<div class="min_full" style="width: calc(100% - 200px)">
			<!-- 查询条件-->
			<div class="search" v-condition >
				<SearchButton :app='app'></SearchButton>
				<!-- 测试 -->
				<el-row :gutter="20" class="search-row-1">
					<el-col :span="6" class="search-col">
						<div class="search-item">
							<span class="search-span">年份:</span>
							<el-input v-model="queryParams.usercx" size="small" class="search-input"></el-input>
						</div>
					</el-col>
					<el-col :span="6" class="search-col">
						<div class="search-item">
							<span class="search-span">月份:</span>
							<el-input v-model="queryParams.phone" size="small" class="search-input"></el-input>
						</div>
					</el-col>
				</el-row>


			</div>
			<!-- 按钮操作-->
			<el-row class="tool-bar">
				<PrintButton :app='app'></PrintButton>
				<ViewButton ref="view" :app='app'></ViewButton>
				<AddButton ref="add" :app='app'></AddButton>
				<CopyButton ref="copy" :app='app'></CopyButton>
				<EditButton ref="edit" :app='app'></EditButton>
				<DeleteButton :app='app'></DeleteButton>
				<FieldButton :app='app'></FieldButton>
				<ExcelButton :app='app'></ExcelButton>
				<!-- 权限-->

			</el-row>
			<!-- 表格-->
			<div class="tablePagers">
				<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
					@getRow='getRow'>
						<template slot="tabCustom">
							<el-table-column label="启用/停用" width="90" header-align="center" >
								<template slot-scope="scope">
									<el-switch @click.native="setEnable(scope.row.id)" :value='tybz(scope)' style="width: 80px;justify-content: center;"
										active-color="#13ce66" inactive-color="#eee">
									</el-switch>
								</template>
							</el-table-column>
						</template>
				</TablePager>
			</div>

		</div>
	</div>

</template>

<script>

	/* 引入需要的接口*/
	import {
		QueryUser,
		QueryApptype,
		AddUser,
		DeleteUser,
		UpdateUser,
		QtUser,
		QueryBm,
		Setcanlogin,
		ResetPassword
	} from "common/src/api/system/dmgSystem.js";
	/* edit页面*/
	import Edit from './edit'
	import {
		tableMixin
	} from 'common'
	export default {
		mixins: [tableMixin],
		name: 'appVersion',

		/* 初始额外赋值*/
		async mounted() {

		},
		data() {
			return {

				/*需要的额外参数 */
				showDialog: false,
				DialogName: '',
				type: '',
				DialogTitle: '',
				powerList: [{
					name: '分配'
				}, {
					name: '复制'
				}, {
					name: '查看'
				}],
				/* 基础url*/
				baseUrl: 'kzzx/user',
				/* 查询参数*/
				queryParams: {
					bmid:'',
					usercx: '',
					phone:'',
					login:'Y',
					tybz:''
				},
				/* 树的标题 */
				treeTitle: '隐患标准分类',
				treeDefaultProps: {
					children: 'children',
					label: 'bmmc'
				},
				/* 表格标题对应参数*/
				tableTitle: [
          {
						prop: 'userid',
						label: '年份',
						width: '120'
					},
          {
          	prop: 'userid',
          	label: '月份',
          	width: '120'
          },
          {
          	prop: 'userid',
          	label: '隐患数量',
          	width: '120'
          },
          {
          	prop: 'userid',
          	label: '未处理完毕数量',
          	width: '120'
          },
          {
          	prop: 'userid',
          	label: '超期数量',
          	width: '120'
          },
          {
          	prop: 'userid',
          	label: '统计日期',
          	width: '120'
          }

				]
			}
		},
		methods: {
			selectedTree(e){
				this.queryParams.bmid=e.id||'root'
				this.$refs['TablePager'].pageQuery()
			},
			tybz(a) {
				let nTy = false
				nTy = (a.row.tybz == 'N' ? true : false)
				return nTy
			},
			/* 基础查询*/
			query: QueryUser,
			/* 基础增*/
			apiAdd: AddUser,
			/* 基础更新*/
			apiUpdate: UpdateUser,
			/* 删除操作*/
			apiDelete: DeleteUser,
			/* treeQuery */
			apiTreeQuery: QueryBm,
			/* 初始化赋值操作*/
			init() {

			},
			/* 启用停用*/
			setEnable(id) {
				this.$confirm('是否启用/停用该角色, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					let params = {
						id: id
					}
					QtUser(params).then(res => {
						if (res.success) {
							this.$success('操作成功')
							this.app.$refs['TablePager'].reLoad()
						} else {
							this.$error(res.message || '操作失败')
						}
					})
				})

			}


		},
		components:{
			Edit
		}


	}
</script>

<style scoped>

</style>