<template>
	<div class="app-container">

		<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
			label-width="68px">


			<el-form-item label="开始日期" prop="beginTime">
				<div class="block">
					<el-date-picker  v-model="queryParams.beginTime" value-format="yyyy-MM-dd"
						type="date" placeholder="选择日期" style="width: 200px;">
					</el-date-picker>
				</div>
			</el-form-item>
			<el-form-item label="结束日期" prop="endTime">
				<div class="block">
					<el-date-picker  v-model="queryParams.endTime" type="date"
						value-format="yyyy-MM-dd" placeholder="选择日期" style="width: 200px;">
					</el-date-picker>
				</div>
			</el-form-item>
			<!-- <el-form-item label="店铺名称" prop="shopName">
				<el-input v-model="queryParams.shopName" style="width: 200px;" placeholder="请输入店铺" clearable
					@keyup.enter.native="handleQuery" />
			</el-form-item> -->
			<el-form-item label="游戏" prop="gameAccount">
				<el-select v-model="queryParams.gameId" style="width: 100%" @change="changeGameArea">
					<el-option v-for="(item,index) in gameList" :key="item.id" :label="item.gameName" :value="item.id">
					</el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="游戏账号" prop="gameAccount">
				<el-input v-model="queryParams.gameAccount" style="width: 200px;" placeholder="请输入游戏账号" clearable
					@keyup.enter.native="handleQuery" />
			</el-form-item>
			<el-form-item label="编号" prop="code">
				<el-input v-model="queryParams.code" style="width: 200px;" placeholder="请输入编号" clearable
					@keyup.enter.native="handleQuery" />
			</el-form-item>
			<el-form-item label="手机号" prop="boundMobile">
				<el-input v-model="queryParams.boundMobile" style="width: 200px;" placeholder="请输入手机号" clearable
					@keyup.enter.native="handleQuery" />
			</el-form-item>

			<el-form-item>
				<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索
				</el-button>

				<el-button style="margin-left: 20px;" icon="el-icon-refresh" size="mini" @click="resetQuery">重置
				</el-button>
			</el-form-item>
		</el-form>
		<el-table border :data="tableData" :row-class-name="tableRowClassName"
			:header-cell-style="{background: '#e1effb', color: 'black'}" style="width: 100%">
			<el-table-column prop="stockpileCode" label="系统编号">
			</el-table-column>
			<el-table-column prop="code" label="编号">
			</el-table-column>
			<el-table-column prop="shopName" label="店铺名称">
			</el-table-column>
			<el-table-column prop="boundMobile" label="手机号">
			</el-table-column>
			<el-table-column prop="gameAccount" label="游戏账号">
			</el-table-column>
			<el-table-column prop="acquirePrice" label="收购价格">
			</el-table-column>
			<el-table-column prop="offerPrice" label="出售价格">
			</el-table-column>
			<el-table-column prop="rcustomerService" label="收号客服">
			</el-table-column>
			<el-table-column prop="accountSource" label="账号来源">
			</el-table-column>
			<el-table-column prop="gameNpwd" label="新密码">
			</el-table-column>
			<el-table-column prop="gameOpwd" label="旧密码">
			</el-table-column>
			<el-table-column prop="gameName" label="游戏">
			</el-table-column>
			<el-table-column prop="rank" label="排位">
				<template slot-scope="scope">
					<span v-if="scope.row.rank=='0'">可排位</span>
					<span v-if="scope.row.rank=='1'">不可排位</span>
				</template>
			</el-table-column>
			<el-table-column prop="gameAreaName" label="游戏大区">
			</el-table-column>
			<el-table-column prop="campsiteNumber" label="营地号">
			</el-table-column>
			<el-table-column prop="realNames" label="实名情况">
				<template slot-scope="scope">
					<span v-if="scope.row.realNames=='real_names_1'">不可二次</span>
					<span v-if="scope.row.realNames=='real_names_0'">可二次</span>
					<span v-if="scope.row.realNames=='real_names_2'">包人脸</span>
				</template>
			</el-table-column>
			<el-table-column prop="accountType" label="账号状态">
				<template slot-scope="scope">
					<span v-if="scope.row.accountType=='game_account_type_1'">已上架</span>
					<span v-else>{{scope.row.accountType}}</span>
				</template>
			</el-table-column>
			<el-table-column prop="loggedDevices" label="设备">
			</el-table-column>
			<el-table-column prop="payType" label="打款状态">
				<template slot-scope="scope">
					<span v-if="scope.row.payType=='0'">是</span>
					<span v-if="scope.row.payType=='1'">否</span>
				</template>
			</el-table-column>
			<el-table-column prop="acquireDate" label="收号日期">
			</el-table-column>
			<el-table-column prop="createTime" label="创建时间">
			</el-table-column>
			<el-table-column prop="remark" label="备注">
			</el-table-column>

			<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
				<template slot-scope="scope">
					<el-button size="mini" type="text" v-hasPermi="['system:gameAccountStockpile:edit']"
						icon="el-icon-edit" @click="handleUpdate(scope.row)">修改
					</el-button>
				</template>
			</el-table-column> -->
		</el-table>

		<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
			@pagination="getList" />
		<!-- 查看账号信息对话框 -->
		<el-dialog v-if="add" :title="title" :visible.sync="add" append-to-body width="1000px">
			<div style="padding: 10px;overflow: auto">
				<el-form ref="form3" :model="form3" :rules="rules" label-width="80px">
					<el-row>
						<el-col :span="12">
							<el-form-item label="店铺ID" prop="shopId">
								<el-select filterable v-model="form3.shopId" :disabled='disabled' style="width: 100%"
									clearable placeholder="请选择店铺名称">
									<el-option v-for="(item,index) in deptOptions" :label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="游戏" prop="gameId">
								<el-select filterable v-model="form3.gameId" style="width: 100%"
									@change="changeGameArea">
									<el-option v-for="(item,index) in gameList" :key="item.id" :label="item.gameName"
										:value="item.id">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="游戏大区" prop="gameArea">
								<el-cascader style="width: 100%" v-model="form3.gameArea" :options="qfoptions"
									:props="{ expandTrigger: 'hover' }"></el-cascader>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="游戏账号" prop="gameAccount">
								<el-input v-model="form3.gameAccount" placeholder="请输入游戏账号" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="收号日期" prop="acquireDate">
								<el-date-picker style="width: 100%" value-format="yyyy-MM-dd"
									v-model="form3.acquireDate" type="date" placeholder="请选择收号日期">
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="收购价格" prop="acquirePrice">
								<el-input v-model="form3.acquirePrice" placeholder="请输入收购价格" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="新游戏密码" prop="gameNpwd">
								<el-input v-model="form3.gameNpwd" placeholder="请输入新游戏密码" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="旧游戏密码" prop="gameOpwd">
								<el-input v-model="form3.gameOpwd" placeholder="请输入旧游戏密码" />
							</el-form-item>
						</el-col>

						<el-col :span="12"
							v-if="form3.gameId=='5ed2e37abe2249f5a5d6f9d7e0d13dfb'||form3.gameId=='41d76b3c0e654663b622778b16b01837'">
							<el-form-item label="营地号" prop="campsiteNumber">
								<el-input v-model="form3.campsiteNumber" placeholder="请输入营地号" />
							</el-form-item>
						</el-col>
						<el-col :span="12" v-if="form3.gameId=='7cf7907cc1e74d259bc3e538239c0132'">
							<el-form-item label="排位" prop="rank">
								<el-select v-model="form3.rank" style="width: 100%" placeholder="请选择排位">
									<el-option v-for="item in pwoptions" :key="item.value" :label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="12" v-if="form3.gameId=='8ff0b3270ff84bc0b2eec64db2108c18'">
							<el-form-item label="原号主身份证号" prop="idNumber">
								<el-input v-model="form3.idNumber" placeholder="请输入原号主身份证号" />
							</el-form-item>
						</el-col>
						<el-col :span="12" v-if="form3.gameId=='2e6581c93f85462a94023e94cf92a24d'">
							<el-form-item label="二级密码" prop="gradePwd">
								<el-input v-model="form3.gradePwd" placeholder="请输入二级密码" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="实名情况" prop="realNames">
								<el-select style="width: 100%" v-model="form3.realNames" placeholder="请选择实名情况">
									<el-option v-for="item in smoptions" :key="item.value" :label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="账号状态" prop="accountType">
								<el-cascader @change="change" filterable style="width: 100%" placeholder="请选择账号状态"
									v-model="form3.accountType" :options="zhztoptions">
								</el-cascader>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="状态补充" prop="accountTypeOther"
								v-if="zhzt||form3.accountType=='game_account_type_10'">
								<el-input v-model="form3.accountTypeOther" placeholder="请输入状态补充" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="购买包赔(淘号玩)" prop="guarantee"
								v-if="bp||form3.accountType=='game_account_type_3'">
								<el-select style="width: 100%" v-model="form3.guarantee" placeholder="请选择购买包赔">
									<el-option v-for="item in bpoptions" :key="item.value" :label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="找回日期" prop="retrieveDate"
								v-if="bp||form3.accountType=='game_account_type_3'">
								<el-date-picker style="width: 100%" value-format="yyyy-MM-dd"
									v-model="form3.retrieveDate" type="date" placeholder="请选择找回日期">
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="账号来源" prop="accountSource">
								<el-select v-model="form3.accountSource" placeholder="请选择账号来源" style="width: 100%">
									<el-option v-for="dict in zhlyOptions" :key="dict.value" :label="dict.label"
										:value="dict.value"></el-option>
								</el-select>
								<el-button type="primary" plain icon="el-icon-plus" size="mini"
									@click="handleAddzhly">新增账号来源
								</el-button>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="绑定手机号" prop="boundMobile">
								<el-select filterable remote reserve-keyword :remote-method="remoteMethod"
									v-model="form3.boundMobile" style="width: 100%" clearable placeholder="请选择绑定手机号">
									<el-option v-for="(item,index) in phoneOptions" :label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="收号时登录的设备" prop="loggedDevices">
								<el-select v-model="form3.loggedDevices" placeholder="请选择登录设备" style="width: 100%">
									<el-option v-for="dict in dlsbOptions" :key="dict.value" :label="dict.label"
										:value="dict.value"></el-option>
								</el-select>
								<el-button type="primary" plain icon="el-icon-plus" size="mini"
									@click="handleAddsb">新增设备
								</el-button>
							</el-form-item>
						</el-col>

						<el-col :span="12">
							<el-form-item label="收号客服" prop="rcustomerService">
								<el-select v-model="form3.rcustomerService" placeholder="请选择收号客服" style="width: 100%">
									<el-option v-for="dict in shkfOptions" :key="dict.value" :label="dict.label"
										:value="dict.value"></el-option>
								</el-select>
								<el-button type="primary" plain icon="el-icon-plus" size="mini"
									@click="handleAddkf">新增客服
								</el-button>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="出售价格" prop="offerPrice">
								<el-input v-model="form3.offerPrice" placeholder="请输入出售价格" />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="打款状态" prop="payType">
								<el-select style="width: 100%" v-model="form3.payType" placeholder="请选择打款状态">
									<el-option v-for="item in dkoptions" :key="item.value" :label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="备注" prop="remark">
								<el-input v-model="form3.remark" placeholder="请输入备注" />
							</el-form-item>
						</el-col>

					</el-row>
				</el-form>
			</div>
			<div slot="footer" class="dialog-footer">
				<el-button type="primary" @click="submitForm1">确 定</el-button>
				<el-button @click="cancel">取 消</el-button>
			</div>
		</el-dialog>
		<el-dialog title="新增账号来源" :visible.sync="dialogVisible2" width="30%" :before-close="handleClose">
			<el-input v-model="form6.gameAccountSource" placeholder="请输入来源名称" />
			<span style="margin-top: 10px;color: red;">例此格式:沐沐/沐风/不求人</span>
			<span slot="footer" class="dialog-footer">
				<el-button @click="dialogVisible2 = false">取 消</el-button>
				<el-button type="primary" v-hasPermi="['system:shop:edit']" @click="handleUpdateAll()">确 定</el-button>
			</span>
		</el-dialog>
		<el-dialog title="新增收号客服" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
			<el-input v-model="form4.customerService" placeholder="请输入客服名称" />
			<span style="margin-top: 10px;color: red;">例此格式:小马/小张/小王</span>
			<span slot="footer" class="dialog-footer">
				<el-button @click="dialogVisible = false">取 消</el-button>
				<el-button type="primary" v-hasPermi="['system:shop:edit']" @click="handleUpdateAll()">确 定</el-button>
			</span>
		</el-dialog>
		<el-dialog title="新增登录设备" :visible.sync="dialogVisible1" width="30%" :before-close="handleClose">
			<el-input v-model="form5.loggedDevices" placeholder="请输入登录设备" />
			<span style="margin-top: 10px;color: red;">例此格式:iphoneX/iphone11/iphone12</span>
			<span slot="footer" class="dialog-footer">
				<el-button @click="dialogVisible1 = false">取 消</el-button>
				<el-button type="primary" v-hasPermi="['system:shop:edit']" @click="handleUpdateAll()">确 定</el-button>
			</span>
		</el-dialog>


	</div>
</template>

<script>
	import {
		queryTBusShop,
	} from "@/api/data/goodsPayment";
	import {
		getConfigKey
	} from "@/api/system/config";
	import Treeselect from "@riophae/vue-treeselect";
	import "@riophae/vue-treeselect/dist/vue-treeselect.css";
	import {
		getSysDeptInfo,
		getDeptInfo,
		accountMonitoring,
		edit,
		add,
		view,
		deleteMonitoring,
		getPaymentInfo,
		updateOriginalPrice,
		getTBusGoodsPaymentSum,
		updatePaymentStatus,
		queryTBusPhone,
		getShopInfo,
		shopEdit
	} from "@/api/data/uploadedAccounts";
	import {
		getTBusShopInfo,
	} from "@/api/data/goodsPayment";
	import {
		getInitGoodsManager,
		getGameArea
	} from "@/api/data/goods";
	import Cookies from 'js-cookie';
	import {
		getToken
	} from "@/utils/auth";
	export default {
		dicts: ['game_account_type', 'r_customer_service', 'collection_source'],

		data() {
			return {
				// 收号客服
				dialogVisible: false,
				form4: {},
				// 登录设备
				dialogVisible1: false,
				form5: {},
				// 账号来源
				dialogVisible2: false,
				form6: {},
				add: false,
				pictureServerPath: null,
				path: '',
				srcList: [],
				shopId1: '',
				form2: {},
				form3: {},
				qfoptions: [],
				// 表单参数
				form: {},
				// 统计
				originalprice: 0,
				salesprice: 0,
				paidinprice: 0,
				lr: 0,
				bplr: 0,
				allPrice: 0,
				// 筛选
				// activeNames: ['1'],
				cs: 0,
				cs1: 0,
				cs2: 0,
				cs3: 0,
				input: '',
				ck: false,
				yxbh: false,
				yxdq: false,
				spbh: false,
				sjbh: false,
				disabled: false,
				block: false,
				originalPrice1open: false,
				originalPriceopen: false,
				xz: false,
				open1: false,
				openPicture: false,
				cbj: false,
				cbj1: false,
				cbj2: true,
				fl: false,
				openFkpz1: false,
				bp: false,
				zybd: true,
				sjbd: false,
				bpLr: false,
				// 付款凭证
				attach_list: [],
				carouselImg: [],
				//账号状态
				zhztoptions: [{

					value: 'zc',
					label: '正常',
					disabled: true,
					children: [{
							value: 'game_account_type_0',
							label: '未上架'
						},
						{
							value: 'game_account_type_1',
							label: '已上架'
						},
						{
							value: 'game_account_type_2',
							label: '已出售'
						}
					]

				}, {

					value: 'yc',
					label: '异常',
					children: [{
							value: 'game_account_type_3',
							label: '找回'
						},
						{
							value: 'game_account_type_8',
							label: '未验证'
						}, {
							value: 'game_account_type_4',
							label: '冻结'
						},
						{
							value: 'game_account_type_5',
							label: '人脸'
						},
						{
							value: 'game_account_type_6',
							label: '手机卡无法使用'
						},
						{
							value: 'game_account_type_9',
							label: '自用'
						},
						{
							value: 'game_account_type_7',
							label: '实名被删除等一个月'
						},
						{
							value: 'game_account_type_10',
							label: '其他'
						},
					]

				}],
				//实名情况
				smoptions: [{
						value: 'real_names_0',
						label: '可二次'
					},
					{
						value: 'real_names_1',
						label: '不可二次'
					}, {
						value: 'real_names_2',
						label: '包人脸'
					},
				],
				//排位
				pwoptions: [{
					value: '0',
					label: '可排位'
				}, {
					value: '1',
					label: '不可排位'
				}, ],
				bpoptions: [{
					value: 'Y',
					label: '是'
				}, {
					value: 'N',
					label: '否'
				}, ],
				//是否打款
				dkoptions: [{
					value: '0',
					label: '是'
				}, {
					value: '1',
					label: '否'
				}, ],
				deptOptions: [],
				phoneOptions: [],
				shkfOptions: [],
				dlsbOptions: [],
				zhlyOptions: [],
				rules: {
					accountNumber: [{
						required: true,
						message: '请输入账号',
						trigger: 'blur'
					}],
					shopId: [{
						required: true,
						message: '请选择店铺',
						trigger: 'blur'
					}],
					gameId: [{
						required: true,
						message: '请选择游戏',
						trigger: 'blur'
					}],
					gameArea: [{
						required: true,
						message: '请选择游戏大区',
						trigger: 'blur'
					}],
					gameAccount: [{
						required: true,
						message: '请输入游戏账号',
						trigger: 'blur'
					}],
					acquireDate: [{
						required: true,
						message: '请选择收号日期',
						trigger: 'blur'
					}],
					acquirePrice: [{
						required: true,
						message: '请输入收购价格',
						trigger: 'blur'
					}],
					gameNpwd: [{
						required: true,
						message: '请输入新游戏密码',
						trigger: 'blur'
					}],
					gameOpwd: [{
						required: true,
						message: '请输入旧游戏密码',
						trigger: 'blur'
					}],
					idNumber: [{
						required: true,
						message: '请输入原号主身份证号',
						trigger: 'blur'
					}],
					gradePwd: [{
						required: true,
						message: '请输入二级密码',
						trigger: 'blur'
					}],
					rank: [{
						required: true,
						message: '请选择排位',
						trigger: 'blur'
					}],
					realNames: [{
						required: true,
						message: '请选择实名情况',
						trigger: 'blur'
					}],
					accountType: [{
						required: true,
						message: '请选择账号状态',
						trigger: 'blur'
					}],
					accountSource: [{
						required: true,
						message: '请选择账号来源',
						trigger: 'blur'
					}],
					accountSourceOther: [{
						required: true,
						message: '请输入补充',
						trigger: 'blur'
					}],
					accountTypeOther: [{
						required: true,
						message: '请输入补充',
						trigger: 'blur'
					}],
					guarantee: [{
						required: true,
						message: '请选择是否购买包赔（淘号玩）',
						trigger: 'blur'
					}],
					retrieveDate: [{
						required: true,
						message: '请选择找回日期',
						trigger: 'blur'
					}],
					boundMobile: [{
						required: true,
						message: '请输入绑定手机号',
						trigger: 'blur'
					}],
					loggedDevices: [{
						required: true,
						message: '请输入收号时登录的设备',
						trigger: 'blur'
					}],
					rcustomerService: [{
						required: true,
						message: '请输入收号客服',
						trigger: 'blur'
					}],
					payType: [{
						required: true,
						message: '请选择打款状态',
						trigger: 'blur'
					}],
					offerPrice: [{
						required: true,
						message: '请输入出售价格',
						trigger: 'blur'
					}],
					campsiteNumber: [{
						required: true,
						message: '请输入营地号',
						trigger: 'blur'
					}],
				},
				gameList: [],
				tableData: [],
				// 遮罩层
				loading: true,
				zhzt: false,
				bp: false,
				csjg: false,
				// open:false

				// 总条数
				total: 0,
				// 弹出层标题
				title: "",
				// 显示搜索条件
				showSearch: true,
				// 是否显示弹出层
				open: false,
				// 查询参数
				queryParams: {
					pageNum: 1,
					pageSize: 10,
					accountNumber: null,
					accountPhone: null,
					intervalType: null,
					taskType: null,
					autoSwitchType: null,
				},

				// 表单参数
				form1: {
					accountNumber: null,
					accountPhone: null,
					intervalType: null,
					taskType: null,
					autoSwitchType: null,
					remark: null
				},
				queryForm: {
					accountNumber: null,
					accountPhone: null,
					intervalType: null,
					taskType: null,
					autoSwitchType: null,
				},
			};
		},
		created() {
			this.getList();
			this.initGoodsManager();
		},
		mounted() {
			this.loadAll(); //获取店铺
		},
		methods: {
			tableRowClassName({
				row,
				rowIndex
			}) {
				if (rowIndex === 1 || rowIndex === 5 || rowIndex === 9) {
					return 'warning-row';
				} else if (rowIndex === 3 || rowIndex === 7) {
					return 'success-row';
				}
				return '';
			},
			user() {
				this.shkfOptions = [];
				this.zhlyOptions = [];
				this.dlsbOptions = [];
				getTBusShopInfo().then(res => {
					if (res.data) {
						this.disabled = true;
						this.form3.shopId = res.data.id;
						if (res.data.customerService) {
							let kflist = res.data.customerService.split(/[/]/)
							kflist.forEach(item => {
								this.shkfOptions.push({
									label: item,
									value: item,
								});
							})
						}
						if (res.data.gameAccountSource) {
							let zhly = res.data.gameAccountSource.split(/[/]/)
							zhly.forEach(item => {
								this.zhlyOptions.push({
									label: item,
									value: item,
								});
							})
						}
						if (res.data.loggedDevices) {
							let dlsb = res.data.loggedDevices.split(/[/]/)
							dlsb.forEach(item => {
								this.dlsbOptions.push({
									label: item,
									value: item,
								});
							})
						}
					} else {
						this.disabled = false;
					}
					this.add = true;
					this.title = '新增账号';
				})
			},
			//获取游戏列表
			initGoodsManager() {
				getInitGoodsManager().then(res => {
					this.gameList = res.gameList
				})
			},
			change(e) {
				if (this.form3.accountType[1] == 'game_account_type_10') {
					this.zhzt = true;
				} else {
					this.zhzt = false;
				}
				if (this.form3.accountType[1] == 'game_account_type_3') {
					this.bp = true;
				} else {
					this.bp = false;
				}
			},
			changeGameArea() {
				let that = this
				let gm = {
					gameId: this.form3.gameId
				}
				getGameArea(gm).then(res => {
					that.qfoptions = res.gameArea
				})
			},
			look(item) {
				this.path = item
				this.srcList.push(this.pictureServerPath + item)
				this.openFkpz1 = true
			},
			loadAll() {
				queryTBusShop().then(response => {
					response.data.forEach((item) => {
						this.deptOptions.push({
							label: item.name,
							value: item.id,
						});
					});
				});
				return this.deptOptions;
			},
			remoteMethod(query) {
				this.loadAll1(query); //获取手机号
			},
			loadAll1(item) {
				this.phoneOptions = []
				let query = {
					phone: item
				}
				queryTBusPhone(query).then(response => {
					response.rows.forEach((item) => {
						this.phoneOptions.push({
							label: item.phone,
							value: item.phone,
						});
					});
				});
				return this.phoneOptions;
			},
			/** 新增按钮操作 */
			handleAdd() {
				this.form3 = {};
				this.form4 = {};
				this.form5 = {};
				this.form6 = {};
				this.resetQuery();
				this.user();
			},
			/** 新增账号来源按钮操作 */
			handleAddzhly() {
				this.form6 = {};
				this.getgetShopInfo();
				this.dialogVisible2 = true;
			},
			/** 新增设备按钮操作 */
			handleAddsb() {
				this.form5 = {};
				this.getgetShopInfo();
				this.dialogVisible1 = true;
			},
			/** 新增客服按钮操作 */
			handleAddkf() {
				this.form4 = {};
				this.getgetShopInfo();
				this.dialogVisible = true;
			},
			//修改收号客服等信息
			handleUpdateAll() {
				if (this.dialogVisible == true) {
					this.getshopEdit(this.form4)
				} else if (this.dialogVisible1 == true) {
					this.getshopEdit(this.form5)
				} else if (this.dialogVisible2 == true) {
					this.getshopEdit(this.form6)
				}
			},
			getshopEdit(data) {
				shopEdit(data).then(res => {
					if (res.code == 200) {
						this.$message({
							type: 'success',
							message: '修改成功'
						})
						this.dialogVisible = false;
						this.dialogVisible2 = false;
						this.dialogVisible1 = false;
					}
				})
			},
			handleClose() {
				this.form4 = {};
				this.form5 = {};
				this.form6 = {};
				this.dialogVisible = false;
				this.dialogVisible2 = false;
				this.dialogVisible1 = false;
			},
			getgetShopInfo() {
				getShopInfo(this.form3.shopId).then(res => {
					if (res.data) {
						if (this.dialogVisible == true) {
							this.form4 = res.data
						} else if (this.dialogVisible1 == true) {
							this.form5 = res.data
						} else if (this.dialogVisible2 == true) {
							this.form6 = res.data
						}
					} else {
						alert('请联系管理员!')
					}
				})
			},
			/** 删除按钮操作 */
			handleDelete(row) {
				const id = row.id
				const names = row.gameAccount
				this.$modal.confirm('是否确认删除["' + names + '"]的数据项？').then(function() {
					return deleteMonitoring(id);
				}).then(() => {
					this.getList();
					this.$modal.msgSuccess("删除成功");
				}).catch(() => {});
			},
			change1() {
				this.queryParams.accountType = this.queryParams.accountType[1]
			},

			/** 查询账号信息列表 */
			getList() {
				this.loading = true;
				accountMonitoring(this.queryParams).then(response => {
					this.tableData = response.rows;
					this.total = response.total
					this.loading = false;
				});
			},
			//查看
			handleUpdate(row) {
				this.shkfOptions = [];
				this.zhlyOptions = [];
				this.dlsbOptions = [];
				getTBusShopInfo().then(res => {
					if (res.data) {
						this.disabled = true;
						this.form3.shopId = res.data.id;
						if (res.data.customerService) {
							let kflist = res.data.customerService.split(/[/]/)
							kflist.forEach(item => {
								this.shkfOptions.push({
									label: item,
									value: item,
								});
							})
						}
						if (res.data.gameAccountSource) {
							let zhly = res.data.gameAccountSource.split(/[/]/)
							zhly.forEach(item => {
								this.zhlyOptions.push({
									label: item,
									value: item,
								});
							})
						}
						if (res.data.loggedDevices) {
							let dlsb = res.data.loggedDevices.split(/[/]/)
							dlsb.forEach(item => {
								this.dlsbOptions.push({
									label: item,
									value: item,
								});
							})
						}
					} else {
						this.disabled = false;
					}
				})
				view(row.id).then(res => {
					this.add = true;
					this.form3 = res.data;
					this.title = '修改账号信息'
					this.changeGameArea();
				})
			},


			/** 搜索按钮操作 */
			handleQuery() {
				this.block = false;
				this.queryParams.pageNum = 1;
				this.getList();
			},

			/** 重置按钮操作 */
			resetQuery() {
				this.block = false;
				this.resetForm("queryForm");
				this.handleQuery();
			},
			// 新增确定按钮
			submitForm1() {
				if (this.title == '新增账号') {
					this.$refs["form3"].validate(valid => {
						if (this.form3.gameArea.length == 1) {
							this.form3.gameArea = this.form3.gameArea[0]
						}
						if (this.form3.gameArea.length == 2) {
							this.form3.gameArea = this.form3.gameArea[1]
						}
						this.form3.accountType = this.form3.accountType[1]
						if (valid) {
							add(this.form3).then(res => {
								if (res.code == 200) {
									this.$message({
										type: 'success',
										message: '添加成功'
									})
									this.add = false;
									this.getList();
								} else {
									this.$message.error(res.msg);
								}
							})
						}
					});
				} else {
					this.$refs["form3"].validate(valid => {
						if (this.form3.gameArea.length == 1) {
							this.form3.gameArea = this.form3.gameArea[0]
						}
						if (this.form3.gameArea.length == 2) {
							this.form3.gameArea = this.form3.gameArea[1]
						}
						if (this.form3.accountType.length == 2) {
							this.form3.accountType = this.form3.accountType[1]
						}
						if (valid) {
							edit(this.form3).then(res => {
								if (res.code == 200) {
									this.$message({
										type: 'success',
										message: '修改成功'
									})
									this.add = false;
									this.getList();
								} else {
									this.$message.error(res.msg);
								}
							})
						}
					});
				}

			},


			cancel() {
				this.ck = false;
				this.add = false;
				this.open1 = false;
				this.resetForm("form2");
				this.resetForm("form");
			},



		}
	};
</script>
<style>
	.father {
		height: 80px;
		line-height: 80px;
		font-size: 25px;
		display: flex;
		justify-content: space-around;
	}

	.el-icon-loading {
		color: green;
		margin-right: 5px;
	}

	.el-icon-message-solid {
		color: green;
		margin-right: 5px;
	}

	.el-icon-check {
		color: green;
		margin-right: 5px;
	}

	.el-icon-coin {
		color: green;
		margin-right: 5px;
	}
</style>