<template>
		<div class="content-height">
			<div class="myorder-content">
				<datacollectionLeft @getCurrentLeft='getCurrentLeft' ref="leftMenu" :agentCode="agentCode"></datacollectionLeft>
				<div class="content-right">
					<div class="content-top">
						<topCrumbs :firstCrumbs="firstCrumbs" :secondCrumbs="secondCrumbs" :thirdCrumbs="thirdCrumbs"></topCrumbs>
						<div>
							<div class="container-o-box default">
								<div class="com-block m-bottom10">
									<div class="content search-tab p10 p-top5">
										<table>
											<tbody>
											<tr v-if="currentType!=1">
												<td class="p-right0 gray-c">账号：</td>
												<td class="account-list">
													<a v-for="item in dataAccount" :key="item.name" :class="listParams.authId==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,1)" >{{item.name}}</a>
												</td>
											</tr>
											<tr>
												<td class="p-right0 gray-c">搜索类型：</td>
												<td>
													<a v-for="item in dataType" :key="item.name" :class="activeType==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,2)" >{{item.name}}</a>
												</td>
											</tr>
											<tr>
												<td class="p-right0 gray-c">搜索内容：</td>
												<td class="tab-separate search-value">
													<div class="productSearchGroup">
														<input class="form-control" style="width:460px;" type="text" v-model="searchContent">
														<button class="btn btn-primary" style="width:52px;" @click="searchActive('',3)">搜索</button>
													</div>
												</td>
											</tr>
											<tr v-if="currentType==3">
												<td class="p-right0 gray-c">审核状态：</td>
												<td>
													<el-checkbox-group v-model="checkBoxData" @change="searchActive('',4)">
														<el-checkbox label="0">审核中</el-checkbox>
														<el-checkbox label="1">已审核</el-checkbox>
														<el-checkbox label="2">被拒绝</el-checkbox>
													</el-checkbox-group>
												</td>
											</tr>
											<tr v-if="currentType==3">
												<td class="p-right0 gray-c">销售类型：</td>
												<td class="account-list">
													<a v-for="item in dataSalesType" :key="item.name" :class="listParams.promoted==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,6)" >{{item.name}}</a>
												</td>
											</tr>
											<tr>
												<td class="p-right0 gray-c border-dashed-top1">排序类型：</td>
												<td class="crawl-date border-dashed-top1">
													<a v-for="item in dataTime" :key="item.name" :class="listParams.orderType==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,5)" >{{item.name}}
														<i class="fa fa-sort-desc " v-if="item.id==listParams.orderType&&!listParams.isAsc"/>
														<i class="fa fa-sort-up tp24" v-if="item.id==listParams.orderType&&listParams.isAsc"/></a>
												</td>
											</tr>
											</tbody>
										</table>
									</div>
								</div>
							</div>
							<div class="content-button">
								<div>
									<el-dropdown  v-if="listParams.publishStatus!=1" @command="handleClickBatch">
										<el-button type="primary">
											批量操作<i class="el-icon-arrow-down el-icon--right"></i>
										</el-button>
										<el-dropdown-menu slot="dropdown">
											<el-dropdown-item command="4" v-if="$_has('delete')&&listParams.publishStatus!=1&&listParams.publishStatus!=4">批量删除</el-dropdown-item>
											<el-dropdown-item command="3" v-if="currentType==1&&currentName!='定时发布'&&$_has('publishP')">批量移入待发布</el-dropdown-item>
											<el-dropdown-item command="1" v-if="currentType!=3&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('publishP')">批量立即发布</el-dropdown-item>
											<el-dropdown-item command="2" v-if="currentType!=3&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('publishP')">批量定时发布</el-dropdown-item>

                      <el-tooltip effect="light" :content="batchModify" placement="top">
                        <el-dropdown-item command="5" divided v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改价格（USD）</el-dropdown-item>
                      </el-tooltip>

											<el-dropdown-item command="6" v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改本地价格</el-dropdown-item>
											<el-dropdown-item command="8" v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改库存</el-dropdown-item>
											<el-dropdown-item command="9" v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改运送时间</el-dropdown-item>
											<el-dropdown-item command="10" v-if="currentType==3&&currentName!='定时发布'&&$_has('standUD')&&listParams.upShelfStatus==1">批量下架</el-dropdown-item>
											<el-dropdown-item command="13" v-if="currentType==3&&currentName!='定时发布'&&$_has('standUD')&&listParams.upShelfStatus==0">批量上架</el-dropdown-item>
											<el-dropdown-item command="11" v-if="currentName=='定时发布'&&$_has('edit')">批量取消定时</el-dropdown-item>
											<el-dropdown-item command="12" v-if="currentType==3&&$_has('add')">运输设置</el-dropdown-item>
										</el-dropdown-menu>
									</el-dropdown>
									<!-- <el-dropdown v-if="currentType!=1">
										<el-button type="primary">
											移动分类<i class="el-icon-arrow-down el-icon--right"></i>
										</el-button>
										<el-dropdown-menu slot="dropdown">
											<el-dropdown-item>所有分类</el-dropdown-item>
											<el-dropdown-item>未分类</el-dropdown-item>
											<el-dropdown-item>卫衣</el-dropdown-item>
											<el-dropdown-item>夹克</el-dropdown-item>
										</el-dropdown-menu>
									</el-dropdown> -->
									<div class="tree-type" v-if="currentType!=1&&listParams.publishStatus!=1&&listParams.publishStatus!=4">
										<div class="tree-select poi" @click="treeShow=!treeShow">移动分类<i class="el-icon-arrow-down ml5"/></div>
										<div class="tree-data" v-if="treeShow">
											<el-tree
												:data="treeData"
												node-key="id"
												ref="tree"
												highlight-current
												@current-change="SwitchNode"
											>
											</el-tree>
										</div>
									</div>
								</div>
								<div>
									<button class="btn btn-primary" v-if="currentType==1&&hasDataBtn" @click="goIndex">采集数据</button>
									<button class="btn btn-primary m-left10" @click="editClick('')" v-if="$_has('add')">创建产品</button>
                  <el-dropdown v-if="currentType==3&&$_has('syncP')" @command="handleProductClick">
                    <el-button type="primary">
                      同步产品<i class="el-icon-arrow-down el-icon--right"></i>
                    </el-button>
                    <el-dropdown-menu slot="dropdown">
                      <el-dropdown-item command="1">同步单个产品</el-dropdown-item>
                      <el-dropdown-item command="2">同步选中产品</el-dropdown-item>
                      <el-dropdown-item command="3">同步国家运费</el-dropdown-item>
                    </el-dropdown-menu>
                  </el-dropdown>
								</div>
							</div>
							<div :class="listParams.upShelfStatus==item.id?'item-collection':'item-collection-white'" v-for="item in dataTabList" :key="item.name" @click="chooseTabs(item.id)" v-if="currentType==3">{{item.name}}({{item.number}})</div>
							<div class="pull-right">
								<el-pagination
									@size-change="handleSizeChange"
									@current-change="handleCurrentChange"
									:current-page="listParams.currentPage"
									:page-sizes="[30, 50, 100, 300]"
									:page-size="listParams.pageSize"
									layout="total, sizes, prev, pager, next, jumper"
									:total="listParams.total"
									style="float:right;display:inline-block"
								></el-pagination>
							</div>
							<div class="tab-content border5 m-bottom10">
									<el-table
										ref="multipleTable"
										:data="tableData"
										tooltip-effect="dark"
										border
										style="width: 100%"
										@selection-change="handleSelectionChange">
										<el-table-column
											type="selection"
											width="30">
										</el-table-column>
										<el-table-column
											align="center"
											label="图片"
											width="75">
											<template slot-scope="scope">
												<img :src="scope.row.mainImageUrl" class="imgCss"/>
												<div class="tl">
													<span>来源</span>
													<a class="el-dropdown-link" :href="scope.row.productFromUrl" target="_blank">{{scope.row.productFromCode}}</a>
												</div>
											</template>
										</el-table-column>
										<el-table-column
											align="center"
											:label="currentType!=3?'标题':'标题/产品ID'"
											width="180"
										>
											<template slot-scope="scope">
												<div>
                          <el-tooltip effect="light" :content="scope.row.title" placement="top">
                            <div class="tl break-two" style="width:140px">{{scope.row.title}}</div>
                          </el-tooltip>
													<div v-if="scope.row.remark" class="g19 tl mb5">备注：{{scope.row.remark}}</div>
													<div v-if="scope.row.msg" class="g19 tl mb5">消息：{{scope.row.msg}}</div>
													<el-popover
														placement="top-start"
														trigger="hover"
														width="50"
														v-if='scope.row.platformProductId'
													>
														<el-button type="primary" size="mini" @click="copyUrl(scope.row.platformProductId)">复制</el-button>
														<div slot="reference" class="f-blue tl mb5" @click="openNewUrl(scope.row.productOnlineUrl)">{{scope.row.platformProductId}}</div>
													</el-popover>
													<span v-if='scope.row.auditStatus' class="audit-status tl mb5">{{scope.row.auditStatus}}</span>
													<span v-if='scope.row.authCode' class="gray-nine tl mb5">「{{scope.row.authCode}}」</span>
													<span v-if='scope.row.ratings' class="f-blue tl mb5">评分：{{scope.row.ratings}}</span>
													<div v-if="scope.row.errorMsg" class="error-message p5">{{scope.row.errorMsg}}</div>
												</div>
											</template>
										</el-table-column>
										<el-table-column
											align="center"
											label="描述"
											width="150"
											v-if="currentType==1"
										>
											<template slot-scope="scope">
												<el-tooltip effect="light" :content="scope.row.description" placement="top">
													<span class="el-dropdown-link break-two" style="width:150px">{{scope.row.description}}</span>
												</el-tooltip>
											</template>
										</el-table-column>
										<el-table-column
											prop="collectCounts"
											label="收藏"
											align="center"
											v-if="currentType==3"
											width="50"
										>
										</el-table-column>
										<el-table-column
											prop="sellCounts"
											label="出售"
											align="center"
											v-if="currentType==3"
											width="50"
										>
										</el-table-column>
										<el-table-column
											prop="spu"
											label="SPU名"
											align="center"
										>
										</el-table-column>
										<el-table-column
											v-if="currentType==2||currentType==3"
											align="center"
											:width="currentType==2?520:420">
											<template slot="header" slot-scope="scope">
												<div class="custom-table-title">
													<span>SKU</span>
													<span>价格(USD)</span>
													<span>本地价格</span>
													<span>库存</span>
													<span v-if="currentType==2">运费($)</span>
												</div>
											</template>
											<template slot-scope="scope">
												<div :class="currentIndex===scope.$index?'control-heightOpen':'control-heightUp'">
													<div v-for="(item,indexTable) in scope.row.unitRespDTOS" :key="item.id" class="custom-table">
															<span>{{item.sku}}<i class="gc f12" v-if="!item.ifShelf&&currentType==3&&listParams.upShelfStatus">(下架)</i></span>
															<el-popover
																placement="bottom"
																width="160"
																v-model="item.visiblea">
																<div class="variant-input-control">
																	<input class="variant-update-input" type="text" :value="item.sellPriceUs" :ref="'playBtna'+scope.$index+indexTable">
																	<div class="tl"><el-checkbox v-model="item.moneyChangeVal"><span class="f12">USD 转换 CNY</span></el-checkbox></div>
																	<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`a${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'a',item.moneyChangeVal)">更新</button>
																	<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'a')">取消</button>
																</div>
																<span slot="reference">{{item.sellPriceUs}}</span>
															</el-popover>
															<el-popover
																placement="bottom"
																width="160"
																v-model="item.visibleb">
																<div class="variant-input-control">
																	<input class="variant-update-input" type="text" :value="item.sellPriceCn" :ref="'playBtnb'+scope.$index+indexTable">
																	<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`b${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'b')">更新</button>
																	<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'b')">取消</button>
																</div>
																<span slot="reference">{{item.sellPriceCn}}</span>
															</el-popover>
															<el-popover
																placement="bottom"
																width="160"
																v-model="item.visiblec">
																<div class="variant-input-control">
																	<input class="variant-update-input" type="text" :value="item.stock" :ref="'playBtnc'+scope.$index+indexTable">
																	<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`c${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'c')">更新</button>
																	<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'c')">取消</button>
																</div>
																<span slot="reference">{{item.stock}}</span>
															</el-popover>
															<el-popover
																v-if="currentType==2"
																placement="bottom"
																width="160"
																v-model="item.visibled">
																<div class="variant-input-control">
																	<input class="variant-update-input" type="text" :value="item.freightPrice" :ref="'playBtnd'+scope.$index+indexTable">
																	<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`d${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'d')">更新</button>
																	<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'d')">取消</button>
																</div>
																<span slot="reference">{{item.freightPrice}}</span>
															</el-popover>
													</div>
												</div>
													<div v-if="scope.row.unitRespDTOS&&scope.row.unitRespDTOS.length>2">
														<div class="unfold-show" @click="unfoldClick(scope.$index,scope.row.unfold,scope.row.id)" v-if="currentIndex!==scope.$index">+ 展开</div>
														<div class="unfold-show" v-else @click="closeClick(scope.$index)">- 收起</div>
													</div>
											</template>
										</el-table-column>
										<el-table-column
											prop="freightPrice"
											label="运费"
											align="center"
											v-if="currentType==3"
											width="50"
										>
											<template slot-scope="scope">
												<div class="tl">
													<span>USD: {{scope.row.freightPrice}}</span>
												</div>
												<div class="tl">
													<span>CNY: {{scope.row.freightPriceCn}}</span>
												</div>
											</template>
										</el-table-column>
										<el-table-column
											prop="sellPriceUs"
											label="售价（USD）"
											align="center"
											v-if="currentType==1"
										>
										</el-table-column>
										<el-table-column
											prop="sellPriceCn"
											label="本地价格"
											align="center"
											v-if="currentType==1"
										>
										</el-table-column>
										<el-table-column
											prop="stock"
											label="库存"
											align="center"
											v-if="currentType==1"
										>
										</el-table-column>
										<el-table-column
											label="时间"
											width="130"
											align="center"
										>
											<template slot-scope="scope">
												<div class="tl gray-nine">创建</div>
												<div class="tl">{{scope.row.createDate}}</div>
												<div class="tl gray-nine">更新</div>
												<div class="tl">{{scope.row.modifyDate}}</div>
											</template>
										</el-table-column>
										<el-table-column
											label="操作"
											width="70"
										>
											<template slot-scope="scope">
												<div class="el-dropdown-link" v-if="currentType==1&&$_has('publishP')" @click="moveWaitRelease(scope.row.id,3)">移入待发布</div>
												<div class="el-dropdown-link" @click="editClick(scope.row.spuId)" v-if="currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">编辑</div>
												<div class="el-dropdown-link" @click="synchronizationClick(scope.row.id,1)" v-if="currentType==3&&$_has('syncP')">同步</div>
												<div v-if="currentType!=3&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('publishP')">
													<el-dropdown @command="(command)=>handleClick(command,scope.row.id)">
														<span class="el-dropdown-link">
															发布<i class="el-icon-arrow-down el-icon--right"></i>
														</span>
														<el-dropdown-menu slot="dropdown">
															<el-dropdown-item command='1'>立即发布</el-dropdown-item>
															<el-dropdown-item command='2'>定时发布</el-dropdown-item>
														</el-dropdown-menu>
													</el-dropdown>
												</div>
												<div class="el-dropdown-link" @click="cancelSetTimeClick(scope.row.id)" v-if="currentName=='定时发布'&&$_has('publishP')">取消定时</div>
												<div v-if="listParams.publishStatus!=1&&listParams.publishStatus!=4">
													<el-dropdown>
														<span class="el-dropdown-link">
															更多<i class="el-icon-arrow-down el-icon--right"></i>
														</span>
														<el-dropdown-menu slot="dropdown">
															<el-dropdown-item @click.native="copyProdect(scope.row.id)" v-if="currentType==3&&$_has('add')">复制为新产品</el-dropdown-item>
															<el-dropdown-item @click.native="downProdect(scope.row.id)" v-if="currentType==3&&$_has('standUD')&&listParams.upShelfStatus==1">下架</el-dropdown-item>
															<el-dropdown-item @click.native="upProdect(scope.row.id)" v-if="currentType==3&&$_has('standUD')&&listParams.upShelfStatus==0">上架</el-dropdown-item>
															<el-dropdown-item @click.native="gotoBinding(scope.row)" v-if="currentType==3">绑定系统产品</el-dropdown-item>
															<el-dropdown-item @click.native="addRemark(scope.row.id)" v-if="$_has('add')&&listParams.publishStatus!=1&&listParams.publishStatus!=4">添加备注</el-dropdown-item>
															<el-dropdown-item @click.native="deleteProdect(scope.row.id)" v-if="$_has('delete')&&listParams.publishStatus!=1&&listParams.publishStatus!=4">删除</el-dropdown-item>
															<el-dropdown-item @click.native="freightSet(scope.row.id)" v-if="currentType==3&&$_has('add')">运费设置</el-dropdown-item>
														</el-dropdown-menu>
													</el-dropdown>
												</div>
											</template>
										</el-table-column>
									</el-table>
							</div>
							<div class="pull-right">
								<el-pagination
									@size-change="handleSizeChange"
									@current-change="handleCurrentChange"
									:current-page="listParams.currentPage"
									:page-sizes="[30, 50, 100, 300]"
									:page-size="listParams.pageSize"
									layout="total, sizes, prev, pager, next, jumper"
									:total="listParams.total"
									style="float:right;display:inline-block"
								></el-pagination>
							</div>
						</div>
					</div>
				</div>
			</div>
			<el-dialog
			 	title="发布"
				:visible.sync="dialogVisibleReleased"
				width="50%"
				@close="dialogVisibleReleased = false">
				<div v-if="currentType!=2">
					<span>选择Wish店铺：</span>
					<el-checkbox v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
					<el-input
						@input="searchShopClick"
						size="mini"
						style="width:200px;float:right"
						placeholder="请输入店铺名称"
						suffix-icon="el-icon-search"
						v-model="shopName">
					</el-input>
					<el-checkbox-group v-model="checkedCities" @change="handleShopChange" class="shop-list">
							<el-checkbox v-for="shop in shopAccount" :label="shop.id" :key="shop.id" class="current-shop">{{shop.name}}</el-checkbox>
					</el-checkbox-group>
				</div>
				<div class="mt20" v-if="command==2&&currentType!=3">
					<span>定时发布时间：</span>
					<el-date-picker
						size="small"
						v-model="publishDate"
						type="datetime"
						placeholder="选择日期时间">
					</el-date-picker>
				</div>
				<div class="ml20" v-if="currentType==2&&command!=2">
					您确认要发布到wish吗？
				</div>
				<el-divider></el-divider>
				<span slot="footer" class="dialog-footer">
					<el-button type="primary" @click="chooseShopClick">确 定</el-button>
					<el-button @click="dialogVisibleReleased = false">取 消</el-button>
				</span>
			</el-dialog>
			<el-dialog
			 	title="备注"
				:visible.sync="dialogVisibleRemark"
				width="40%"
				@close="dialogVisibleRemark = false">
				<el-input
					type="textarea"
					:rows="4"
					placeholder="请输入备注内容，认领到平台采集箱时，备注不会认领过去"
					v-model="textareaRemark">
				</el-input>
				<span slot="footer" class="dialog-footer">
					<el-button type="primary" @click="remarkSure">确 定</el-button>
				</span>
			</el-dialog>
			<el-dialog
			 	title="提示"
				:visible.sync="dialogVisibleDelete"
				width="40%"
				@close="dialogVisibleDelete = false">
				<span>您确定删除吗？</span>
				<span slot="footer" class="dialog-footer">
					<el-button @click="dialogVisibleDelete = false">取 消</el-button>
					<el-button type="primary" @click="dialogVisibleDelete = false">确 定</el-button>
				</span>
			</el-dialog>
			<el-dialog
			 	:title="currentChangeType=='stock'?'批量修改库存':currentChangeType=='deliveryTime'?'批量修改运送时间':'批量修改价格'"
				:visible.sync="dialogVisiblePrice"
				width="40%"
				@close="dialogVisiblePrice = false">
				<div class="modal-price" v-if="currentChangeType!='deliveryTime'">
					<el-radio v-model="radio" label="1">在原有数量上增加(减少用负数)</el-radio>
					<el-input v-model="editPriceAdd" style="width:35%"/>
				</div>
				<div class="mt20 modal-price" v-if="currentChangeType!='deliveryTime'">
					<el-radio v-model="radio" label="2">直接修改</el-radio>
					<el-input v-model="editPrice" style="width:35%"/>
				</div>
				<div class="mt20" v-else>
					<span class="pr5">修改运送时间</span>
					<el-input-number v-model="editStartTime" style="width:30%" :min="2" :max="65"/> 天 -
					<el-input-number v-model="editEndTime" style="width:30%" :min="3" :max="65"/> 天
          <div v-if="editEndTime <= editStartTime" class="f-red">开始时间必须小于结束时间，最大不超过65天</div>
				</div>
				<span slot="footer" class="dialog-footer">
					<el-button @click="dialogVisiblePrice = false">取 消</el-button>
					<el-button type="primary" @click="sureChangePrice">确 定</el-button>
				</span>
			</el-dialog>
			<el-dialog
			 	title="从wish同步产品"
				:visible.sync="dialogVisibleSynchronization"
				width="40%"
				@close="dialogVisibleSynchronization = false">
				<div>状态:  <span class="g19 pl5">{{orderStatus}}</span></div>
				<div>详情:</div>
				<!-- <div class="ml40" v-for="(item,index) in shopSyncOrderRespDTOS" :key="index" v-if="syncType==2">
					yanxiangju,同步完成！共同步成功{{item.successNum}}条数据!
				</div> -->
				<!-- <div class="ml40" v-if="syncType==2||3">
					后台程序正在同步中，请稍后刷新页面查看同步信息
				</div> -->
				<div v-if="syncType==1&&finishSync" class="ml40">
					同步完成！共同步{{successNum}}条数据! <span class="f-red">同步失败{{errorNum}}条数据</span>
				</div>
				<span slot="footer" class="dialog-footer">
					<el-button type="primary" @click="dialogVisibleSynchronization = false">关闭</el-button>
				</span>
			</el-dialog>
			<el-dialog
			 	title="提示"
				:visible.sync="dialogVisibleMessage"
				width="40%"
				@close="dialogVisibleMessage = false">
				<div>校验通过：<span class="txt-blue">{{successNum}}</span></div>
				<div>校验失败：<span class="f-red">{{errorNum}}</span></div>
				<div>失败详情：</div>
				<div class="ml40" v-for="(item,index) in errorMessage" :key="index">
					ID:<span class="f-blue ml10 mr10 poi" @click="editClick(item.id)">{{item.id}}</span>{{item.errorReason}}
				</div>
				<span slot="footer" class="dialog-footer">
					<el-button @click="dialogVisibleMessage = false">取 消</el-button>
					<el-button type="primary" @click="dialogVisibleMessage = false">确 定</el-button>
				</span>
			</el-dialog>
			<el-dialog
			 	title="批量操作"
				:visible.sync="dialogVisibleBatch"
				width="40%"
				@close="dialogVisibleBatch = false">
				<div>状态:  <span class="f-red pl5">已完成</span></div>
				<!-- <div>详情:</div>
				<div class="ml40">
					已成功修改{{successProductNum}}个产品，{{successVariantNum}}个变种
				</div> -->
				<span slot="footer" class="dialog-footer">
					<el-button type="primary" @click="dialogVisibleBatch = false">关闭</el-button>
				</span>
			</el-dialog>
			<el-dialog
					title="绑定系统产品"
					:visible.sync="dialogVisibleSku"
					width="80%"
					@opened="showMatching"
					@close="closeMatching"
					top="10vh"
					>
						<productBindingByPlatformIdDialog
								ref="productBindingDialogRef"
						></productBindingByPlatformIdDialog>
						<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="dialogVisibleSku = false"
				>确 认</el-button
				>
			  </span>
			</el-dialog>
			<el-dialog
			 	title="同步产品"
				:visible.sync="dialogVisibleProductReleased"
				width="60%"
				:close-on-click-modal="false"
				@close="dialogVisibleProductReleased = false">
        <div>
          <span>平台：{{agentCode}}</span>
          <el-input
              @input="searchShopProductClick"
              size="mini"
              style="width:200px;float:right"
              placeholder="请输入店铺名称"
              suffix-icon="el-icon-search"
              v-model="shopProductName">
          </el-input>
          <br/>
        </div>
        <div v-if="redioType=='1'" class="mt20 account-list2">
          <table>
            <tr>
              <td>
                <el-radio-group v-model="selectedShops">
                    <el-radio v-for="shop in shopAccount" :label="shop.name" :key="shop.name" class="current-shop w210 account-list3">{{shop.name}}</el-radio>
                </el-radio-group>
              </td>
            </tr>
          </table>
        </div>
        <br>
        <div v-if="redioType=='1'">
            输入产品名id:<el-input v-model="syncProduct" class="pct50 ml10" size="mini"></el-input>
        </div>
				<el-divider></el-divider>
				<span slot="footer" class="dialog-footer">
					<el-button type="primary" @click="chooseProdectClick">确 定</el-button>
					<el-button @click="dialogVisibleProductReleased = false">取 消</el-button>
				</span>
			</el-dialog>
			<setTemplate :dialogVisibleTemlate="dialogVisibleTemlate" :showInput="false" :tableDataDetail="tableDataDetail" :tableDataAllDetail="tableDataAllDetail" :templateOptions="templateOptions" :id="productReleaseId" @sureSaveClick="sureSaveClick" @cancelClick="cancelTemplateClick"></setTemplate>
			<syncPollingTemplate :syncPollingVisible="syncPollingVisible" :batchCode="syncBatchCode" @closeSync="closeSync" ref="syncFunction"></syncPollingTemplate>
		</div>
</template>
<script>
import datacollectionLeft from '@/components/datacollectionLeft'
import topCrumbs from '@/components/business/topCrumbs'
import util from "@/common/js/util";
import setTemplate from '@/components/business/setTemplate'
import syncPollingTemplate from '@/components/business/syncPollingTemplate'
import productBindingByPlatformIdDialog from "@/components/business/productBindingByPlatformIdDialog";
export default {
	data() {
		return {
			currentType:1,
			agentCode:'wish',
      firstCrumbs: '',
      secondCrumbs: '',
      thirdCrumbs: '',
			textareaUrl:'',
			allShop:[],
			shopAccount:[],
			dataAccount:[{name:'全部',id:0}],
			dataSalesType:[{name:'全部',id:null},{name:'加钻',id:true},{name:'不加钻',id:false}],
			authId:0,
			authIdArry:[],
			dataType:[{name:'SPU',id:0},{name:'标题',id:2}],
			activeType:0,
			dataTime:[{name:'按创建时间',id:'createDate'},{name:'按更新时间',id:'modifyDate'},{name:'按库存量',id:'stock'}],
			listParams:{
				currentPage: 1,
				pageSize: 50,
				total: 0,
				agentCode:'',
				spu:'',
				sku:'',
				title:'',
				platFromProductId:'',
				auditStatus:[],
				authId:0,
				upShelfStatus:1,
				orderType:'createDate',
				isAsc:false,
				publishStatus:'',
				classificationId:0,
				promoted:null
			},
			searchContent:'',
			checkBoxData:[],
			tableData: [],
			productIdSpudicts: [],
			productBindingDialogData: null,
			dialogVisibleSku: false,
			dialogVisibleReleased:false,
			dialogVisibleRemark:false,
			dialogVisibleDelete:false,
			dialogVisibleTime:false,
			dialogVisiblePrice:false,
			dialogVisibleSynchronization:false,
			dialogVisibleBatch:false,
			value1:'',
			textareaRemark:'',
			checkAll: false,
			checkedCities: [],
			currentIndex:'',
			ids:[],
			radio:'1',
			editPriceAdd:'',
			editPrice:'',
			editStartTime:'',
			editEndTime:'',
			currentChangeType:'',
			remarkId:'',
			dataTabList:[{name:'在线',number:0,id:1},{name:'已下架',number:0,id:0}],
			orderStatus:'正在同步产品中...',
			id:'',
			command:'',
			publishDate:'',
			publishIds:'',
			shopSyncOrderRespDTOS:[],
			syncType:1,
			successNum:0,
			errorNum:0,
			finishSync:false,
			dialogVisibleMessage:false,
			errorMessage:[],
			currentName:'',
      batchModify:'若店铺币种为人民币，则对美元价格的修改不生效',
			successProductNum:0,
			successVariantNum:0,
			shopName:'',
			treeData:[],
			treeShow:false,
			dialogVisibleTemlate:false,
			tableDataDetail:[],
			tableDataAllDetail:[],
			templateOptions:[],
			productReleaseId:'',
			hasDataBtn:false,
			dialogVisibleProductReleased:false,
			shopProductName:'',
			checkProductAll: false,
			checkedProductCities:[],
			selectedShops:'',
			platformOptions:[{
				value: '',
				label: '请选择'
			}, {
				value: 'wish',
				label: 'wish'
			}],
			platformValue:'wish',
			syncPollingVisible:false,
			syncBatchCode:'',
			redioType:'1',
			syncProduct:''
		}
	},
	components: {
		datacollectionLeft,topCrumbs,setTemplate,syncPollingTemplate, productBindingByPlatformIdDialog
	},
	methods:{
			handleCheckAllProductChange(val) {
				let newArry=[]
				if(val){
					this.shopAccount.map((item)=>{
						newArry.push(item.id)
					})
				}
				this.checkedProductCities=newArry
      },
      		handleProductChange(value) {
        		let checkedCount = value.length;
				this.checkProductAll = checkedCount === this.shopAccount.length;
			},
			searchShopProductClick(val){
				let shopArry=[]
				this.allShop.map((item)=>{
					if(item.name.indexOf(val)>-1){
						shopArry.push(item)
					}
				})
				this.shopAccount=shopArry
			},
			//同步店铺订单
			chooseProdectClick(){
				if (this.redioType == '1') {
					this.syncByPlatformProductId();
				} else {
					// if (this.checkedProductCities.length > 5) {
					// 	this.$message({
					// 		message: '最多只能选择5个店铺哦~',
					// 		type: 'warning'
					// 	});
					// 	return
					// }
					// let {checkedProductCities}=this
					// console.log(checkedProductCities)
					// this.axios({
					// 	url: 'assistant/syncOrder',
					// 	params:{
					// 		id,
					// 	},
					// 	method: "get"
					// }).then(res => {
					// 	if(res.success){
					// 		this.dialogVisibleProductReleased=false
					// 		this.checkProductAll=false
					// 		this.checkedProductCities=[]
					// 		this.shopProductName=''
					// 		this.shopAccount=this.allShop
					// 	}
					// })
					this.synchronizationClick('', this.syncType)
				}
			},
			freightSet(id){
				this.axios({
					url: 'assistant/product/freightTemplate/findById',
					data:{
						productReleaseId:id,
					},
					method: "post"
				}).then(res => {
					if(res.success){
						this.productReleaseId=id
						this.tableDataDetail=res.module.details
						this.tableDataAllDetail=res.module.details
            this.dialogVisibleTemlate=true
					}
				})
			},
			getTemplateList(){
				this.axios({
						url: 'assistant/product/freightTemplate/query',
						data:{
							currentPage: 1,
							pageSize: 1000,
						},
						method: "post"
					}).then(res => {
						if(res.success){
							this.templateOptions=[]
							res.module.result.map((item)=>{
								if(item.isOpen){
									this.templateOptions.push({value:item.id,label:item.name})
								}
							})
						}
				})
			},
		    syncByPlatformProductId(){
				this.axios({
					url: 'assistant/product/online/syncByPlatformProductId',
					data:{
						agentCode:this.platformValue,
						authCode:this.selectedShops,
						platformProductId:this.syncProduct
					},
					method: "post"
				}).then(res => {
					if(res.success){
            this.$message({
              message: '同步中,请稍后查看',
              type: 'success'
            });
            this.dialogVisibleProductReleased = false
						this.getProductsList()
					}
				})
		    },
			sureSaveClick(val){
				const{productReleaseId,ids}=this
				this.axios({
						url: 'assistant/product/online/bindingFreightTemplate',
						data:{
							details:JSON.stringify(val),
							ids: productReleaseId?JSON.stringify(productReleaseId.split(',')):JSON.stringify(ids),
						},
						method: "post"
					}).then(res => {
						if(res.success){
							this.dialogVisibleTemlate=false
							this.getProductsList()
						}
				})
			},
			cancelTemplateClick(){
				this.dialogVisibleTemlate=false
			},
			searchActive(value,type){
				switch (type) {
					case 1:
						this.listParams.authId=value
						break;
					case 2:
						this.activeType=value
						this.searchTypeChoose()
						break;
					case 3:
						this.searchTypeChoose()
						break;
					case 4:
						this.listParams.auditStatus=JSON.stringify(this.checkBoxData)
						break;
					case 5:
						this.listParams.orderType=value
						this.listParams.isAsc=!this.listParams.isAsc
						break;
					case 6:
						this.listParams.promoted=value
						break;
					default:
						break;
				}
				this.getProductsList()
			},
		gotoBinding(row){
			console.log('绑定系统产品', row)
			this.axios({
				url: "assistant/product/online/querySpu",
				data: {
					"platformProductIds": [row.platformProductId],
					"hasSku":false
				},
				method: "post"
			}).then(res => {
				console.log('res', res)
				if (res.success) {
					this.productDetails = res.module;
					this.productDetails.forEach(element => {
						this.productIdSpudicts = []
						this.productIdSpudicts.push({
							value: element.platformProductId,
							label: element.platformSpu
						})
					});
					console.log('productIdSpudicts', this.productIdSpudicts)
					let platformProductSkuIdList = [];
					row.unitRespDTOS.forEach(dto => {
						platformProductSkuIdList.push(dto.platformProductSkuId);
					})
					this.productBindingDialogData = {
						platformProductId: row.platformProductId,
						productIdSpudicts:this.productIdSpudicts,
						valuePlatform: "platformSku",
						platformProductSkuIdList: platformProductSkuIdList,
						platformProductIdList:[row]
					};
					this.dialogVisibleSku = true;
				}
			})
		},
			showMatching() {
				this.$refs.productBindingDialogRef.listonshow(this.productBindingDialogData);
			},
			closeMatching(){
				this.$refs.productBindingDialogRef.listParamsPlatformProduct.platformProductId = ""
				this.productIdSpudicts = {}
				this.dialogVisibleSku = false
			},
			searchTypeChoose(value){
				const{activeType}=this
				const{searchContent}=this
				if(activeType==0){
					this.listParams.spu=searchContent
					this.listParams.sku=''
					this.listParams.title=''
					this.listParams.platFromProductId=''
				}else if(activeType==1){
					this.listParams.spu=''
					this.listParams.sku=searchContent
					this.listParams.title=''
					this.listParams.platFromProductId=''
				}else if(activeType==2){
					this.listParams.spu=''
					this.listParams.sku=''
					this.listParams.title=searchContent
					this.listParams.platFromProductId=''
				}else{
					this.listParams.spu=''
					this.listParams.sku=''
					this.listParams.title=''
					this.listParams.platFromProductId=searchContent
				}
			},
			chooseTabs(value){
				this.listParams.upShelfStatus=value
				this.getProductsList()
			},
			addRemark(id){
				this.remarkId=id
				this.dialogVisibleRemark=true
			},
			remarkSure(){
				const{textareaRemark,remarkId,currentType}=this
				let url
				if(currentType==1){
					url='assistant/product/collectBox/remark'
				}else if(currentType==2){
					url='assistant/product/release/remark'
				}else{
					url='assistant/product/online/remark'
				}
				this.axios({
						url:url,
						data:{
							id:remarkId,
							remark:textareaRemark
						},
						method: "post"
				}).then(res => {
					if(res.success){
						this.dialogVisibleRemark=false
						this.$message({
							message: '备注成功',
							type: 'success'
						});
						this.getProductsList()
					}
				})
			},
			handleCheckAllChange(val) {
				let newArry=[]
				if(val){
					this.shopAccount.map((item)=>{
						newArry.push(item.id)
					})
				}
				this.checkedCities=newArry
      },
      handleShopChange(value) {
        let checkedCount = value.length;
				this.checkAll = checkedCount === this.shopAccount.length;
			},
			handleClick(command,id){
				this.ids=id.split(',')
				this.command=command
				if(this.currentType==2&&command==1){
					this.chooseShopClick()
				}else{
					this.dialogVisibleReleased=true
				}
			},
			getCurrentLeft(value){
				this.currentName=value.name
				this.currentType=value.type
				this.firstCrumbs='Wish'
				this.secondCrumbs=this.currentType == 1 ? '采集箱' : this.currentType == 2 ? '待发布产品' : '在线产品'
				this.thirdCrumbs = this.currentType != 1 ? this.currentName : ''
				this.listParams.publishStatus=value.name=='定时发布'?4:value.name=='发布中'?1:value.name=='发布失败'?3:''
				if(this.listParams.publishStatus!=''){
					this.listParams.classificationId=''
				}else{
					this.listParams.classificationId=value.pid=='assistion_type'?0:value.pid
				}
				this.dataType=[]
				this.dataTime=[]
				if(this.currentType==3){
					this.dataType.push({name:'SPU',id:0},{name:'SKU',id:1},{name:'标题',id:2},{name:'产品ID',id:3})
					this.dataTime.push({name:'按创建时间',id:'createDate'},{name:'按更新时间',id:'modifyDate'},{name:'按库存量',id:'stock'},{name:'按收藏量',id:'collectCounts'},{name:'按出售量',id:'sellCounts'})
				}else{
					if(this.currentType==1){
						this.dataType.push({name:'SPU',id:0},{name:'标题',id:2})
					}else{
						this.dataType.push({name:'SPU',id:0},{name:'SKU',id:1},{name:'标题',id:2})
					}
					this.dataTime.push({name:'按创建时间',id:'createDate'},{name:'按更新时间',id:'modifyDate'},{name:'按库存量',id:'stock'})
				}
				this.getProductsList()
			},
			unfoldClick(index,isUnfold,id) {
				const {currentType}=this
				if(!isUnfold){
					let url
					if(currentType==2){
						url='assistant/product/release/getReleaseProductInfo'
					}
					if(currentType==3){
						url='assistant/product/online/getEcProductInfo'
					}
					this.axios({
							url,
							params:{id},
							method: "get"
					}).then(res => {
							if(res.success){
								this.tableData[index].unitRespDTOS=[]
								res.module.map((item)=>{
									this.tableData[index].unitRespDTOS.push(item)
								})
								this.$set(this.tableData[index], 'unfold',true)
							}
					})
				}
				this.currentIndex=index

			},
			closeClick(){
				this.currentIndex=''
			},
			cancelClick(rowIndex,arrIndex,type){
				this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], `visible${type}`,false)
			},
			//待发布直接编辑价格及库存
			changeClick(id,item,rowIndex,arrIndex,type,moneyChangeVal){
				let url
				let value=this.$refs[`playBtn${item}`][0].value
				let params={
					id,
					moneyChangeVal
				}
				if(type=='a'){
					// if(moneyChangeVal){
					// 	this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'sellPriceCn', value)
					// }
					// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'sellPriceUs', value)
					params.sellPriceUs=value
				}
				if(type=='b'){
					// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'sellPriceCn', value)
					params.sellPriceCn=value
				}
				if(type=='c'){
					// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'stock', value)
					params.stock=value
				}
				if(type=='d'){
					// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'freightPrice', value)
					params.freightPrice=value
				}
				if(this.currentType==2){
					url='assistant/product/release/edit'
				}else{
					url='assistant/product/online/modifySku'
				}
				this.axios({
						url,
						data:params,
						method: "post"
				}).then(res => {
						if(res.success){
							// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], `visible${type}`,false)
							this.getProductsList()
						}
				})
			},
			sureChangePrice(){
				const {ids,currentChangeType,radio,editPrice,editPriceAdd,editStartTime,editEndTime,currentType}=this
				let url;
				let params={
					ids:JSON.stringify(ids)
				}
				if (currentChangeType==='deliveryTime' && this.editEndTime <= this.editStartTime){
				  this.$message.warning("开始时间必须小于结束时间，最大不超过65")
          return;
        }
				if(currentType==2){
					if(radio==2||currentChangeType=='deliveryTime'){
						url='assistant/product/release/batchDirectEdit'//直接
					}else{
						url='assistant/product/release/batchInDirectEdit'//间接
					}
				}else{
					if(radio==2||currentChangeType=='deliveryTime'){
						url='assistant/product/online/batchModifySku'//直接
					}else{
						url='assistant/product/online/batchModifySkuInDirect'//间接
					}
				}
				switch(currentChangeType){
					case 'sellPriceUs':
						params.sellPriceUs=radio==2?editPrice:editPriceAdd
						params.modifyType=2
						break;
					case 'sellPriceCn':
						params.sellPriceCn=radio==2?editPrice:editPriceAdd
						params.modifyType=1
						break;
					case 'freightPriceUs':
						params.freightPriceUs=radio==2?editPrice:editPriceAdd
						params.modifyType=3
						break;
					case 'stock':
						params.stock=radio==2?editPrice:editPriceAdd
						params.modifyType=4
						break;
					case 'deliveryTime':
						params.deliveryTime=editStartTime+'-'+editEndTime
						params.modifyType=5
						break;
					default:
						break;
				}
				this.axios({
						url: url,
						data:params,
						method: "post"
				}).then(res => {
						if(res.success){
							this.dialogVisiblePrice=false
							this.dialogVisibleBatch=true

							this.syncBatchCode=res.module.batchCode;
							this.syncPollingVisible=true;
							this.$refs.syncFunction.pollingQuery();
							// let data=res.module.batchProductUpdateRespDTO
							// this.successProductNum=data.successProductNum
							// this.successVariantNum=data.successVariantNum
							this.getProductsList()
						}
				})
			},
			getProductsList(){
				let{currentType,listParams}=this
				let url
				this.listParams.agentCode = this.agentCode;
				if(currentType==1){
					url='assistant/product/collectBox/query'
				}
				if(currentType==2){
					url='assistant/product/release/query'
				}
				if(currentType==3){
					url='assistant/product/online/query'
					this.getOnlineNum(listParams)
				}
				this.axios({
						url: url,
						data:listParams,
						method: "post"
					}).then(res => {
						if(res.success){
							if(currentType!=3){
								let data=res.module
								this.tableData=data.result
								this.listParams.total=data.total
							}
							else{
								let data=res.module
								this.tableData=data.page.result
								this.listParams.total=data.page.total
							}
						}
				})
			},
			getOnlineNum(listParams){
				this.axios({
						url: "assistant/product/online/queryShelfCount",
						data:listParams,
						method: "post"
					}).then(res => {
						if(res.success){
							let data=res.module
							this.$set(this.dataTabList[0],'number',data.upShelfCount)
							this.$set(this.dataTabList[1],'number',data.downShelfCount)
						}
				})
			},
			cancelSetTimeClick(id){
				let ids
				if(id){
					ids=id.split(',')
				}else{
					ids=this.ids
				}
				this.$confirm('取消定时发布后，产品将移入到【待发布】页面。您确认要取消吗？', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.axios({
						url: 'assistant/product/release/cancelTimePublish',
						data:{
							ids:JSON.stringify(ids)
						},
						method: "post"
					}).then(res => {
						if(res.success){
							this.$message({
								message: '取消定时成功',
								type: 'success'
							});
							this.getProductsList()
							// this.$refs.leftMenu.getClassifyAndNum();
						}
					})
				})
			},
			moveWaitRelease(val,command){
				this.dialogVisibleReleased=true
				this.command=command
				this.ids=[]
				this.ids.push(val)
			},
			editClick(id){
				const{currentType}=this
				let routeData = this.$router.resolve({
					name: "createProduct",
					query:{id,currentType}
				});
				window.open(routeData.href, '_blank');
			},
			handleSelectionChange(val) {
				this.ids=val.map((item=>{
					return item.id
				}))
			},
			downProdect(id){
				let ids
				if(id){
					ids=id.split(',')
				}else{
					ids=this.ids
				}
				this.$confirm('您确认要下架吗？', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.axios({
						url: 'assistant/product/online/batchDownShelf',
						data:{
							ids:JSON.stringify(ids)
						},
						method: "post"
					}).then(res => {
						if(res.success){
							this.$message({
								message: '下架成功',
								type: 'success'
							});
							this.getProductsList()
						}
					})
				})
			},
			upProdect(id){
				let ids
				if(id){
					ids=id.split(',')
				}else{
					ids=this.ids
				}
				this.$confirm('您确认要上架吗？', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.axios({
						url: 'assistant/product/online/batchUpShelf',
						data:{
							ids:JSON.stringify(ids)
						},
						method: "post"
					}).then(res => {
						if(res.success){
							this.$message({
								message: '上架成功',
								type: 'success'
							});
							this.getProductsList()
						}
					})
				})
			},
			deleteProdect(id){
				const{currentType}=this
				let ids
				if(id){
					ids=id.split(',')
				}else{
					ids=this.ids
				}
				let url
				if(currentType==1){
					url='assistant/product/collectBox/delete'
				}else if(currentType==2){
					url='assistant/product/release/delete'
				}else{
					url='assistant/product/online/delete'
				}
        let message = '您确认要删除吗？'
        if (currentType == 3){
          message = '删除产品同时会删除平台上的产品，不可恢复，是否继续？'
        }
				this.$confirm(message, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.axios({
						url: url,
						data:{
							ids:JSON.stringify(ids)
						},
						method: "post"
					}).then(res => {
						if(res.success){
							this.$message({
								message: '删除成功',
								type: 'success'
							});
							this.getProductsList()
							// this.$refs.leftMenu.getClassifyAndNum();
						}
					})
				})
			},
			closeSync(val){
				this.syncPollingVisible=val;
				this.getProductsList();
				this.syncBatchCode='';
			},
			synchronizationClick(id,type){
				this.finishSync=false
				this.syncType=type
				this.orderStatus='正在同步产品中...'
				this.dialogVisibleProductReleased=false
				this.shopSyncOrderRespDTOS=[]
				this.successNum=0
				this.errorNum=0
				let ids
				let url
				if(id){
					ids=id.split(',')
				}else{
					ids=this.ids
				}
				const{ listParams,authIdArry,checkedProductCities }=this
				if(type==1){
					url='assistant/product/online/syncProduct'
					this.dialogVisibleSynchronization=true
				}else if(type==2){
					url='assistant/product/online/sync'
				}else{
					url='assistant/product/online/getProductsShipping'
				}
				this.axios({
					url,
					data:{
						ids:JSON.stringify(ids),
						// shopIds:listParams.authId==0?JSON.stringify(authIdArry):listParams.authId
						shopIds:type!=1&&listParams.authId==0?JSON.stringify(checkedProductCities):listParams.authId
					},
					method: "post"
				}).then(res => {
					if(res.success){
						let data=res.module
						if (type == 2){
							this.syncBatchCode=res.module.batchCode;
							this.syncPollingVisible=true;
							this.$refs.syncFunction.pollingQuery();
						}else{
							this.orderStatus='已完成！'
							this.finishSync=true
							this.successNum=data.successNum
							this.errorNum=data.errorNum
						}
						this.getProductsList()
					}
					else{
						this.dialogVisibleSynchronization=false
					}
				})
			},
			handleProductClick(command){
				this.checkedProductCities=[]
				let type=command==1?2:command==2?1:3
				this.syncType=type
				if((command==2 || command == 3) && this.ids.length==0){
					this.$message.error('请至少选中一个产品')
					return
				}
				if(command==1){
					this.dialogVisibleProductReleased=true
				}else{
					this.synchronizationClick('',type)
				}
			},
			handleClickBatch(command){
				const{ids}=this
				if(ids.length==0){
					this.$message.error('请至少选中一个产品')
					return
				}
				if(this.listParams.authId==0&&this.currentType!=3&&command==12){
					this.$message.error('请选择店铺')
					return
				}
				switch (command) {
					case '1':
						this.command=command
						this.dialogVisibleReleased=true
						break;
					case '2':
						this.command=command
						this.dialogVisibleReleased=true
						break;
					case '3':
						this.command=command
						this.dialogVisibleReleased=true
						break;
					case '4':
						this.deleteProdect()
						break;
					case '5':
						this.dialogVisiblePrice=true
						this.currentChangeType='sellPriceUs'
						break;
					case '6':
						this.dialogVisiblePrice=true
						this.currentChangeType='sellPriceCn'
						break;
					case '7':
						this.dialogVisiblePrice=true
						this.currentChangeType='freightPriceUs'
						break;
					case '8':
						this.dialogVisiblePrice=true
						this.currentChangeType='stock'
						break;
					case '9':
						this.dialogVisiblePrice=true
						this.currentChangeType='deliveryTime'
						break;
					case '10':
						this.downProdect()
						break;
					case '11':
						this.cancelSetTimeClick()
						break;
					case '12':
						this.freightSet('')
						this.productReleaseId=''
						break;
					case '13':
						this.upProdect()
						break;
					default:
						break;
				}
			},
			copyProdect(id){
				this.dialogVisibleReleased=true
				this.id=id
			},
			chooseShopClick(){
				const {ids,checkedCities,id,currentType,command}=this
				let url
				let that=this
				if(currentType!=3){//wish采集箱定时或立即发布或移入待发布
					if(currentType==1){
						if(command==1){
							url='assistant/product/collectBox/publish'
						}else if(command==2){
							this.publishDate=this.publishDate?(util.formatDate.format(new Date(this.publishDate), "yyyy-MM-dd hh:mm:ss")):''
							url='assistant/product/collectBox/timePublish'
						}else if(command==3){
							url='assistant/product/collectBox/toPublish'
						}
					}else{
						if(command==1){
						url='assistant/product/release/publish'
						}else{
							this.publishDate=this.publishDate?(util.formatDate.format(new Date(this.publishDate), "yyyy-MM-dd hh:mm:ss")):''
							url='assistant/product/release/timePublish'
						}
					}
					this.axios({
						url,
						data:{
							ids:JSON.stringify(ids),
							shopIds:JSON.stringify(checkedCities),
							publishDate:this.publishDate,
						},
						method: "post"
					}).then(res => {
						if(res.success){
							// this.$refs.leftMenu.getClassifyAndNum();
							this.getProductsList()
							this.dialogVisibleReleased=false
							this.checkAll=false
							this.checkedCities=[]
							if(command==3){
									this.$message({
										message: '操作成功',
										type: 'success'
									});
							}else{
								let data=res.module.checkResultRespDTO
								if(data.checkResult){
									this.$message({
										message: '提交发布成功，请到【发布中】，【发布失败】，【在线产品】查看发布情况',
										type: 'success'
									});
									let setTime
									setTime=setInterval(function () {
										if(that.$route.path=='/product/productList'&&that.$refs.leftMenu.getCurSide[1].children[1].number>0){
											// that.$refs.leftMenu.getClassifyAndNum(1);
											this.getProductsList()
										}else{
											clearInterval(setTime)
										}
									}, 3000);
								}else{
									this.dialogVisibleMessage=true
									this.errorMessage=data.productInfos
									this.errorNum=data.errorNum
									this.successNum=data.successNum
								}
							}
							this.shopName=''
							this.shopAccount=this.allShop
						}
					})
				}
				if(currentType==3){//复制为新产品
					this.axios({
						url: 'assistant/product/online/copy',
						data:{
							id,
							shopIds:JSON.stringify(checkedCities)
						},
						method: "post"
					}).then(res => {
						if(res.success){
							this.dialogVisibleReleased=false
							this.checkAll=false
							this.checkedCities=[]
							this.$message({
								message: '复制为新产品成功',
								type: 'success'
							});
							this.$refs.leftMenu.getClassifyAndNum();
						}
					})
				}
			},
			getShopList(){
				this.axios({
						url: 'assistant/getShops',
						data:{
							agentName:'wish'
						},
						method: "post"
					}).then(res => {
						if(res.success){
							res.module.map((item)=>{
								this.allShop.push({name:item.authCode,id:item.id})
								this.shopAccount.push({name:item.authCode,id:item.id})
								this.dataAccount.push({name:item.authCode,id:item.id})
								this.authIdArry.push(item.id)
							})
						}
				})
			},
			handleSizeChange(val) {
				this.listParams.pageSize = val;
				this.getProductsList();
			},
			handleCurrentChange(val) {
				this.listParams.currentPage = val;
				this.getProductsList();
			},
			goIndex(){
				localStorage.setItem('leftMenu','dataCollection');
				let routeData = this.$router.resolve({
					name: "dataCollection",
				});
				window.open(routeData.href, '_blank');
			},
			copyUrl(data){
       util.copyUrl(data)
			},
			searchShopClick(val){
				let shopArry=[]
				this.allShop.map((item)=>{
					if(item.name.indexOf(val)>-1){
						shopArry.push(item)
					}
				})
				this.shopAccount=shopArry
			},
			getClassify(){
				this.axios({
						url: 'assistant/dictionary/getClassificationList',
						data:{},
						method: "post"
				}).then(res => {
					if(res.success){
						this.treeData=res.module.dataTree
					}
				})
			},
			SwitchNode(data,node){
				this.treeShow=false
				if(this.ids.length==0){
					this.$message({
						message:"请至少选择一个产品",
						type:"error"
					})
					return
				}
				this.axios({
						url: this.currentType==2?'assistant/product/release/mobileClassification':'assistant/product/online/mobileClassification',
						data:{
							classificationId:data.pid,
							ids:JSON.stringify(this.ids)
						},
						method: "post"
				}).then(res => {
					if(res.success){
						this.$refs.leftMenu.getClassifyAndNum();
						this.getProductsList();
					}
				})
			},
			openNewUrl(url){
				window.open(url, '_blank');
			},

    getTpye(){
      this.axios({
        url: 'assistant/info/get/typeList',
        data:{},
        method: "post"
      }).then(res => {
        if(res.success){
          this.typeArry=res.module
          this.typeCode=this.typeCode?this.typeCode:res.module[0].code
          this.getSize()
        }
      })
    },
    getSize(){
      const{typeCode,id}=this
      this.axios({
        url: 'assistant/info/get/sizeList',
        data:{
          parentCode:typeCode,
          id
        },
        method: "post"
      }).then(res => {
        if(res.success){
          let data=res.module
          this.tableShow=data.table
          if(data.table){
            this.mulTableData=data.mulTableData
            this.tableConfig=data.tableConfigs
          }else{
            this.otherSizeCodeNew=[]
            this.otherSizeCodeNew=this.sizeCode
            if(typeCode=='custom'){
              if(data.data){
                this.otherSizeCode=data.data.map((item)=>{
                  return item= Object.assign({}, item, { isEdit:false})
                })
              }else{
                this.otherSizeCode=[]
              }
            }else{
              this.otherSizeCode=data.data
            }
          }
        }
      })
    },
	},
	mounted(){
		this.currentType=this.$route.query.id||1
		// this.getCurrentLeft({type:this.currentType,name:'',pid:0})
		this.getShopList()
		this.getClassify()
		if(this.currentType==3){
			this.getTemplateList()
		}
		if(this.currentType==1){
			let btnPermissionList = JSON.parse(localStorage.getItem('permissionsArry'))
			this.hasDataBtn=btnPermissionList.some((item)=>{
				return item.title=='通用板块'
			})
		}
	},
}
</script>
<style lang="less" scoped>
.shop-list{
	display:flex;
	margin:20px 5px;
	flex-wrap:wrap;
	// justify-content:space-between;
	max-height:300px;
	overflow:auto;
	clear:both;
	.current-shop{
		width:120px;
		overflow:hidden
	}
}
.content-right{
	width:85%;
	.content-top{
		background: #FFFFFF;
		.btn {
			display: inline-block;
			vertical-align: middle;
			height: 34px;
			width: 80px;
			margin-right: 10px;
			font-size: 13px;
		}
		.container-o-box{
			.default{
				margin: 0;
				width: 100%;
			}
			.com-block {
				border: 1px solid #ccc;
				width: 100%;
				background-color: #fff;
				box-shadow: 0 0 0 0;
				border-top:none;
				.productSearchGroup input[type="text"] {
						display: inline-block;
						width: 410px;
						vertical-align: middle;
						margin-right: 10px;
						padding-right: 90px;
				}
				.search-tab {
					padding: 5px;
					.border-dashed-top1 {
							border-top: 1px dashed #ccc !important;
					}
					table{
						width:100%;
						tbody > tr > td {
								padding: 2px 5px;
								line-height: 34px;
								vertical-align: top;
						}
						tbody > tr > td:first-child {
								width: 80px;
								min-width: 80px;
								max-width: 100px;
								text-align: left;
								color: #a0a3a6;
						}
						table > tbody > tr > td:nth-child(2) {
								padding: 5px;
						}
						tbody > tr > td .tab-in > a {
								padding: 0 3px;
								cursor: pointer;
						}
						tbody > tr > td > a {
								float: left;
								margin: 5px 20px 5px 0;
								padding: 0 3px;
						}
						a{
							color: #367EE2;
							text-decoration: none;
						}
						a.myj-aFocus {
								display: flex;
								padding: 2px 2px;
								line-height: 18px;
								vertical-align: middle;
						}
						.tp24{
							padding-top:4px;
						}
						.myj-active {
								background-color: #367EE2;
								color: #fff;
						}
						.m-right15 {
								margin-right: 15px !important;
						}
						.p-right0 {
								padding-right: 0 !important;
						}
						.gray-c {
								color: #737679 !important;
						}
						.account-list{
							display: inline-block;
							max-height: 300px;
							overflow: auto;
						}
					}
				}
			}
		}
		.pull-right {
			float: right!important;
			// margin-bottom:10px;
		}
		.post_divA {
			padding-left: 19px;
			background: url(../../assets/img/arrowgreen1.png) no-repeat left -128px;
		}
		.post_crawl .p_style3 {
			background-position-y: -3px !important;
			background: #e4e4e4 url(../../assets/img/arrowgreen1.png) no-repeat 100.2% 0;
			color: #666;
		}
		.post_divA p, .post_divB p {
			margin: 0;
			height: 31px;
			line-height: 21px;
			font-size: 12px;
			float: left;
			text-align: center;
			width: 25%;
		}
		.w120 {
				width: 120px !important;
		}
		.h25 {
				height: 25px !important;
		}
		.m-bottom10{
			margin-bottom: 10px !important
		}
		.lh15-imp {
				line-height: 25px !important;
		}
		.post_crawl .p_style4A {
				background-position-y: -67px !important;
				background: #e4e4e4 url(../../assets/img/arrowgreen1.png) no-repeat 100.2% -65px;
	 			color: #666;
		}
		.border4 {
			border: 1px solid #ccc !important;
			clear: both;
		}
		.tab-content>.active {
				display: block;
				visibility: visible;
		}
		.form-control {
				display: block;
				width: 100%;
				height: auto;
				padding: 6px 12px;
				line-height: 1.42857143;
				color: #555;
				background-color: #fff;
				background-image: none;
				border: 1px solid #ccc;
				border-radius: 4px;
				box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
				transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
		}
		.p-top10 {
				padding-top: 10px!important;
		}
		.p30{
			padding:38px 10px;
		}
		.btn-determine {
				font-size: 13px;
				border-color: #367EE2;
				color: #fff;
				background-color: #367EE2;
		}
		.btn-gray {
				border-color: #d0d3d6;
				font-size: 13px;
				color: #434649;
				background-color: #f2f2f2;
		}
		.m-left8 {
			margin-left: 8px !important;
		}
		.border5{
			clear: both;
			.el-table--border, .el-table--group {
					border: 1px solid #ccc!important;
			}
			.el-table thead{
				color: #333
			}
			.el-table thead tr th {
				background-color: #eee!important;
			}
			.el-dropdown-link {
				cursor: pointer;
				color: #367EE2;
				font-size: 13px;
			}
			.imgCss{
				width: 71px;
				height: 71px;
				display: block;
				border:1px solid #ccc
			}
			.control-heightOpen{
				overflow: hidden;
			}
			.control-heightUp{
				max-height: 141px;
				overflow: hidden;
			}
			.variant-input-control{
				position: absolute;
				top: 0;
				left: 0;
				text-align: center;
				background-color: #F2F2F2;
				z-index: 1;
				width: 100px;
				.variant-update-input{
					padding: 6px;
					width: 100%;
					height: 24px;
					line-height: 24px;
					display: inline-block;
				}
				.btn-edit-enter {
					margin-right: 2px;
					border-radius: 2px;
					padding: 0;
					width: 29px;
					height: 20px;
					font-size: 12px;
					line-height: 18px;
					background-color: #5399D5;
				}
				.btn-edit-restart {
						border-radius: 2px;
						padding: 0;
						width: 29px;
						height: 20px;
						font-size: 12px;
						line-height: 18px;
						background-color: #5399D5;
				}
			}
			.custom-table-title{
				span{
					width: 95px;
					display: inline-block;
				}
			}
			.custom-table{
				border-bottom: 1px solid #EBEEF5;
				span{
					width: 95px;
					display: inline-block;
					cursor: pointer;
				}
				span:first-child{
					cursor: auto;
				}
				.activeInput{
					background: #ccc
				}
			}
			.custom-table:last-child{
				border:none
			}
			.unfold-show{
				color: #367EE2;
				text-align: right;
				font-size: 13px;
			}
		}
		.content-button{
			display: flex;
			justify-content: space-between;
			margin:10px;
			.el-button--primary{
				background-color: #367EE2;
				border-color: #367EE2;
			}
		}
	}
}
.variant-input-control{
	text-align: center;
	background-color: #F2F2F2;

	.variant-update-input{
		padding: 6px;
		width: 100%;
		height: 24px;
		line-height: 24px;
		display: inline-block;
		border: 1px solid #999;
	}
	.btn-edit-enter {
		margin-right: 2px;
		border-radius: 2px;
		padding: 0;
		width: 40px;
		height: 20px;
		line-height: 18px;
		background-color: #5399D5;
		color: #fff
	}
	.btn-edit-restart {
			border-radius: 2px;
			padding: 0;
			width: 40px;
			height: 20px;
			line-height: 18px;
			background-color: #5399D5;
			color: #fff
	}
}
.modal-price{
	  display: flex;
    justify-content: space-between;
    align-items: center;
}
.audit-status{
	border: 1px solid #d6ad1a;
	color: #d6ad1a;
	width:20px;
	height:20px;
	border-radius:4px;
	line-height:20px;
	text-align:center
}
.error-message{
	border-radius: 4px;
	border: 1px solid #ccc;
	color:#ec4339
}
.tree-type{
	position:relative;
	display: inline-block;
	background-color: #367EE2;
	border-radius: 4px;color: #FFF;
	.tree-select{
		min-width:100px;
		height:34px;
		border-color: #367EE2;
		border-radius:4px;
		padding: 6px 12px;
	}
	.tree-data{
		position: absolute;
		top: 34px;
		z-index: 2;
		border: 1px solid #eee;
		min-width:240px;
		max-height:350px;
		overflow:auto;
	}
}
.account-list2{
  max-height: 200px;
  overflow: auto;
}
.account-list3{
  max-width: 250px;
  overflow: auto;
}
</style>

