use.vue 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066
  1. <template>
  2. <div class="app-container" ref="appFull" style="background: #fff">
  3. <el-form :model="queryParams" ref="queryForm" v-show="showSearch" :inline="true">
  4. <el-form-item label="" prop="userId">
  5. <el-select v-model="queryParams.userId" placeholder="运营/投手" clearable filterable style="width: 140px" size="small">
  6. <el-option v-for="item in userAll" :key="item.id" :label="item.nickName" :value="item.id"/>
  7. </el-select>
  8. </el-form-item>
  9. <el-form-item label="" prop="nickName">
  10. <el-input v-model="queryParams.nickName" placeholder="请输入公众号名称" clearable size="small" style="width: 150px" @keyup.enter.native="handleQuery"/>
  11. </el-form-item>
  12. <el-form-item label="" prop="appid">
  13. <el-input v-model="queryParams.appid" placeholder="请输入APPID" clearable size="small" style="width: 150px" @keyup.enter.native="handleQuery"/>
  14. </el-form-item>
  15. <el-form-item label="" prop="principalName">
  16. <el-input v-model="queryParams.principalName" placeholder="请输入公司主体" clearable size="small" style="width: 150px" @keyup.enter.native="handleQuery"/>
  17. </el-form-item>
  18. <el-form-item label="" prop="resourceGroupId">
  19. <el-select v-model="queryParams.resourceGroupId" placeholder="分组" clearable filterable style="width: 140px" size="small">
  20. <el-option v-for="dict in groupingData" :key="dict.id" :label="dict.groupName" :value="dict.id" />
  21. </el-select>
  22. </el-form-item>
  23. <el-form-item prop="platformId">
  24. <el-select style="width: 140px" v-model="queryParams.platformId" placeholder="请选择平台" filterable clearable size="small">
  25. <el-option v-for="item in bookAll" :key="item.value" :label="item.label" :value="item.value" />
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item prop="authStatus">
  29. <el-select style="width: 140px" v-model="queryParams.authStatus" placeholder="请选择授权状态" filterable clearable size="small">
  30. <el-option v-for="item in [ { label: '未授权', value: 1 }, { label: '已授权', value: 0 }, ]" :key="item.value" :label="item.label" :value="item.value" />
  31. </el-select>
  32. </el-form-item>
  33. <el-form-item>
  34. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  35. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  36. </el-form-item>
  37. </el-form>
  38. <el-row :gutter="10" class="mb8">
  39. <el-col :span="1.5">
  40. <el-button type="primary" size="mini" icon="el-icon-plus" @click="handleAdd()">新增公众号</el-button>
  41. </el-col>
  42. <el-col :span="1.5">
  43. <el-button type="primary" size="mini" :disabled="!(batchAssignPlatForm.mpIds && batchAssignPlatForm.mpIds.length > 0)" @click="handleBatchAdd()">批量指派</el-button>
  44. </el-col>
  45. <el-col :span="1.5" v-if="batchAssignPlatForm.mpIds && batchAssignPlatForm.mpIds.length > 0">
  46. <el-button type="danger" size="mini" @click="clearMpidsHandle">清空已选</el-button>
  47. </el-col>
  48. <el-col :span="1.5" v-if="batchAssignPlatForm.mpIds && batchAssignPlatForm.mpIds.length > 0">
  49. <el-select style="width: 140px" v-model="queryParams.platformId" placeholder="已选公众号" size="mini">
  50. <el-option v-for="item in batchAssignPlatForm.mpIds" :key="item.id" :label="item.nickName" :value="item.id" disabled/>
  51. </el-select>
  52. </el-col>
  53. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  54. </el-row>
  55. <el-table :data="accountList" ref="multipleTable" row-key="id" :row-class-name="tableRowClassName" size="mini" v-loading="loading" @select="handleSelect" @select-all="handleSelectAll"> <!-- @selection-change="handleSelectionChange" -->
  56. <el-table-column type="selection" width="55" align="center" />
  57. <el-table-column label="公众号" prop="account" width="300" fixed>
  58. <template slot-scope="scope">
  59. <el-row
  60. align="middle"
  61. type="flex"
  62. v-if="scope.row.nickName || scope.row.userName || scope.row.appid"
  63. >
  64. <el-avatar
  65. shape="square"
  66. :size="62"
  67. :src="scope.row.headImg"
  68. @error="avatarErr"
  69. >
  70. <img src="../../../assets/image/book.jpg" />
  71. </el-avatar>
  72. <div class="verticalCenter">
  73. <div>
  74. <strong>{{ scope.row.nickName }}</strong>
  75. </div>
  76. <div class="child">
  77. <span class="font12">原始ID:</span>{{ scope.row.userName
  78. }}<i
  79. v-if="scope.row.userName"
  80. class="el-icon-document-copy copy"
  81. @click="Copy(scope.row.userName)"
  82. ></i>
  83. </div>
  84. <div class="child">
  85. <span class="font12">APPID:</span>{{ scope.row.appid
  86. }}<i
  87. v-if="scope.row.appid"
  88. class="el-icon-document-copy copy"
  89. @click="Copy(scope.row.appid)"
  90. ></i>
  91. </div>
  92. </div>
  93. </el-row>
  94. </template>
  95. </el-table-column>
  96. <!-- <el-table-column label="APPID" prop="appid" align="center" width="120" /> -->
  97. <el-table-column prop="operUserInfo" width="100" align="center">
  98. <template slot="header">
  99. <div>
  100. 运营
  101. <el-tooltip effect="dark" content="悬浮可显示号码" placement="top"
  102. ><i class="el-icon-question"></i
  103. ></el-tooltip>
  104. </div>
  105. </template>
  106. <template slot-scope="scope" v-if="scope.row.operUserInfo">
  107. <el-popover :width="200" trigger="hover" placement="top" :title="scope.row.operUserInfo.nickName">
  108. <div style="color: rgb(136, 136, 136); font-size: 13px">
  109. 电话:{{ scope.row.operUserInfo.phone }}
  110. </div>
  111. <div slot="reference">{{ scope.row.operUserInfo.nickName }}</div>
  112. </el-popover>
  113. </template>
  114. </el-table-column>
  115. <el-table-column prop="putUserInfo" width="100" align="center">
  116. <template slot="header">
  117. <div>
  118. 投手
  119. <el-tooltip effect="dark" content="悬浮可显示号码" placement="top"
  120. ><i class="el-icon-question"></i
  121. ></el-tooltip>
  122. </div>
  123. </template>
  124. <template slot-scope="scope" v-if="scope.row.putUserInfo">
  125. <el-popover :width="200" trigger="hover" placement="top" :title="scope.row.putUserInfo.nickName">
  126. <div style="color: rgb(136, 136, 136); font-size: 13px">
  127. 电话:{{ scope.row.putUserInfo.phone }}
  128. </div>
  129. <div slot="reference">{{ scope.row.putUserInfo.nickName }}</div>
  130. </el-popover>
  131. </template>
  132. </el-table-column>
  133. <el-table-column prop="checkUserInfo" width="100" align="center" label="审查">
  134. <template slot-scope="scope" v-if="scope.row.checkUserInfo">
  135. <el-popover :width="200" trigger="hover" placement="top" :title="scope.row.checkUserInfo.nickName">
  136. <div style="color: rgb(136, 136, 136); font-size: 13px">
  137. 电话:{{ scope.row.checkUserInfo.phone }}
  138. </div>
  139. <div slot="reference">{{ scope.row.checkUserInfo.nickName }}</div>
  140. </el-popover>
  141. </template>
  142. </el-table-column>
  143. <el-table-column prop="administratorName" width="115" align="center">
  144. <template slot="header">
  145. <div>
  146. 管理员信息
  147. <el-tooltip
  148. effect="dark"
  149. content="悬浮可显示详细信息"
  150. placement="top"
  151. ><i class="el-icon-question"></i
  152. ></el-tooltip>
  153. </div>
  154. </template>
  155. <template slot-scope="scope">
  156. <el-popover
  157. width="200"
  158. trigger="hover"
  159. placement="top"
  160. :title="scope.row.administratorName"
  161. >
  162. <div style="color: rgb(136, 136, 136); font-size: 13px">
  163. <strong>电话号码:</strong> {{ scope.row.managePhone }}
  164. </div>
  165. <div style="color: rgb(136, 136, 136); font-size: 13px">
  166. <strong>编号:</strong> {{ scope.row.managePhoneNo }}
  167. </div>
  168. <div slot="reference">{{ scope.row.administratorName }}</div>
  169. </el-popover>
  170. </template>
  171. </el-table-column>
  172. <el-table-column prop="account" align="center" width="130">
  173. <template slot="header">
  174. <div>
  175. 公众号账号信息
  176. <el-tooltip
  177. effect="dark"
  178. content="悬浮可显示公众号账号/密码"
  179. placement="top"
  180. ><i class="el-icon-question"></i
  181. ></el-tooltip>
  182. </div>
  183. </template>
  184. <template slot-scope="scope">
  185. <el-popover :width="260" trigger="hover" placement="top">
  186. <div style="color: rgb(136, 136, 136); font-size: 13px">
  187. <strong>账号:</strong> {{ scope.row.account }}
  188. </div>
  189. <div style="color: rgb(136, 136, 136); font-size: 13px">
  190. <strong>密码:</strong> {{ scope.row.password }}
  191. </div>
  192. <div slot="reference" class="myElli">{{ scope.row.account }}</div>
  193. </el-popover>
  194. </template>
  195. </el-table-column>
  196. <el-table-column
  197. label="公司主体"
  198. prop="principalName"
  199. align="center"
  200. width="150"
  201. >
  202. <template slot-scope="scope">
  203. <div class="elli" v-if="scope.row.principalName">
  204. <el-tooltip
  205. class="item"
  206. effect="dark"
  207. :content="scope.row.principalName"
  208. placement="top"
  209. :enterable="false"
  210. >
  211. <span>{{ scope.row.principalName }}</span>
  212. </el-tooltip>
  213. <i
  214. class="el-icon-document-copy copy"
  215. @click="Copy(scope.row.principalName)"
  216. ></i>
  217. </div>
  218. </template>
  219. </el-table-column>
  220. <el-table-column
  221. label="授权状态"
  222. prop="authStatus"
  223. align="center"
  224. width="80"
  225. >
  226. <template slot-scope="scope">
  227. <el-tag :type="scope.row.authStatus === 0 ? 'success' : 'danger'">{{
  228. scope.row.authStatus === 0 ? "已授权" : "未授权"
  229. }}</el-tag>
  230. </template>
  231. </el-table-column>
  232. <el-table-column label="投放状态" prop="resourceInfo" width="80" align="center">
  233. <template slot-scope="scope">
  234. <el-tag type="warning" v-if="scope.row.resourceInfo.putStatus === 'wait'">待投放</el-tag>
  235. <el-tag type="success" v-else-if="scope.row.resourceInfo.putStatus === 'ing'">投放中</el-tag>
  236. <el-tag type="info" v-else-if="scope.row.resourceInfo.putStatus === 'stop'">停投</el-tag>
  237. <el-tag type="danger" v-else-if="scope.row.resourceInfo.putStatus === 'destroy'">账号已注销</el-tag>
  238. <div v-else>--</div>
  239. </template>
  240. </el-table-column>
  241. <el-table-column prop="platformInfo" width="80" align="center" label="书城" :show-overflow-tooltip="true">
  242. <template slot-scope="scope" v-if="scope.row.resourceInfo.platformInfo">
  243. <div>{{ scope.row.resourceInfo.platformInfo.platformName }}</div>
  244. </template>
  245. </el-table-column>
  246. <el-table-column label="项目组" prop="businessGroupInfo" width="80" :show-overflow-tooltip="true" align="center">
  247. <template slot-scope="scope" v-if="scope.row.resourceInfo.businessGroupInfo">
  248. <span>{{scope.row.resourceInfo.businessGroupInfo.businessGroupName}}</span>
  249. </template>
  250. </el-table-column>
  251. <el-table-column label="期数" prop="period" width="100" align="center">
  252. <template slot-scope="scope">
  253. <div class="verticalCenter">
  254. <div v-if="scope.row.resourceInfo.periodInfo">
  255. {{ scope.row.resourceInfo.periodInfo.period }}
  256. </div>
  257. </div>
  258. </template>
  259. </el-table-column>
  260. <el-table-column label="账号信息" prop="platformInfo" width="200">
  261. <template slot-scope="scope">
  262. <div class="elli" v-if="scope.row.resourceInfo.platformAccountInfo && scope.row.resourceInfo.platformAccountInfo.account">
  263. <div style="color: rgb(136, 136, 136); font-size: 12px">
  264. <strong>账号:</strong>
  265. <span>{{ scope.row.resourceInfo.platformAccountInfo.account }}</span>
  266. </div>
  267. <i class="el-icon-document-copy copy" @click="Copy(scope.row.resourceInfo.platformAccountInfo.account)"></i>
  268. </div>
  269. <div class="elli" v-if="scope.row.resourceInfo.platformAccountInfo && scope.row.resourceInfo.platformAccountInfo.password">
  270. <div style="color: rgb(136, 136, 136); font-size: 12px">
  271. <strong>密码:</strong>
  272. <span >{{ scope.row.resourceInfo.platformAccountInfo.password }}</span>
  273. </div>
  274. <i class="el-icon-document-copy copy" @click="Copy(scope.row.resourceInfo.platformAccountInfo.password)"></i>
  275. </div>
  276. </template>
  277. </el-table-column>
  278. <el-table-column label="当前书籍" prop="bookInfo" width="120" align="center">
  279. <template slot-scope="scope" v-if="scope.row.resourceInfo.bookInfo">
  280. <el-popover width="200" trigger="hover" placement="top" :title="scope.row.resourceInfo.bookInfo.bookName">
  281. <div style="color: rgb(136, 136, 136); font-size: 13px">
  282. <strong>来源:</strong>
  283. <span>{{ scope.row.resourceInfo.bookInfo.source }}-{{ scope.row.resourceInfo.bookInfo.author }}</span>
  284. </div>
  285. <div style="color: rgb(136, 136, 136); font-size: 13px">
  286. <strong>信息:</strong>
  287. <span>{{ scope.row.resourceInfo.bookInfo.protagonist }}-{{ scope.row.resourceInfo.bookInfo.channel }}</span>
  288. </div>
  289. <div slot="reference">{{ scope.row.resourceInfo.bookInfo.bookName }}</div>
  290. </el-popover>
  291. </template>
  292. </el-table-column>
  293. <el-table-column label="投放渠道" prop="resourceInfo" width="80" align="center" :show-overflow-tooltip="true">
  294. <template slot-scope="scope" v-if="scope.row.resourceInfo">
  295. <div>{{ scope.row.resourceInfo.putChannel }}</div>
  296. </template>
  297. </el-table-column>
  298. <el-table-column label="充值模板" prop="resourceInfo" width="80" align="center" :show-overflow-tooltip="true">
  299. <template slot-scope="scope" v-if="scope.row.resourceInfo">
  300. <div>{{ scope.row.resourceInfo.rechargeTemplate }}</div>
  301. </template>
  302. </el-table-column>
  303. <el-table-column label="认证/到期时间" prop="authTime" width="120" align="center">
  304. <template slot-scope="scope">
  305. <div>{{ scope.row.authTime }}</div>
  306. <div style="color: red">{{ scope.row.authTimeout }}</div>
  307. </template>
  308. </el-table-column>
  309. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="160">
  310. <template slot-scope="scope">
  311. <el-button v-if="scope.row.authStatus === 1" size="mini" type="text" icon="el-icon-s-promotion" @click="authorizeHandle(scope.row)">授权</el-button>
  312. <el-button size="mini" type="text" icon="el-icon-s-check" @click="handleState(scope.row)">指派</el-button>
  313. <el-dropdown trigger="click" size="mini">
  314. <span class="el-dropdown-link">
  315. 更多<i class="el-icon-arrow-down el-icon--right"></i>
  316. </span>
  317. <el-dropdown-menu slot="dropdown">
  318. <el-dropdown-item><change-record v-model="scope.row" :periodList="periodList" :bookCity="bookCity" :bookList="bookList" :teamsList="teamsList" :userAll="userAll" type="use"/></el-dropdown-item>
  319. <el-dropdown-item><div class="dropdownItem" @click="handleEdit(scope.row)"><i class="el-icon-edit"></i>编辑</div></el-dropdown-item>
  320. <el-dropdown-item><cut-book v-model="scope.row.resourceInfo" :periodList="periodList" :bookCity="bookCity" :bookList="bookList" @change="getList" :teamsList="teamsList"/></el-dropdown-item>
  321. </el-dropdown-menu>
  322. </el-dropdown>
  323. </template>
  324. </el-table-column>
  325. </el-table>
  326. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
  327. <!-- 新增 编辑弹窗 -->
  328. <el-dialog :title="isAdd ? '新增公众号' : '编辑公众号'" :visible.sync="openEdit" width="650px" append-to-body>
  329. <el-form :model="queryPlatform" :rules="rules" ref="platForm" label-position="top" append-to-body :inline="true">
  330. <el-form-item label="开始时间" prop="beginTime" style="width: 100%">
  331. <el-date-picker v-model="queryPlatform.beginTime" size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" placeholder="选择开始时间" />
  332. </el-form-item>
  333. <el-form-item label="公众号名称" prop="nickName">
  334. <el-input v-model="queryPlatform.nickName" style="width: 140px" :disabled="queryPlatform.authStatus == 0 ? true : false" size="small" placeholder="输入公众号名称"/>
  335. </el-form-item>
  336. <el-form-item label="APPID" prop="appid">
  337. <el-input v-model="queryPlatform.appid" style="width: 140px" :disabled="queryPlatform.authStatus == 0 ? true : false" size="small" placeholder="输入APPID"/>
  338. </el-form-item>
  339. <el-form-item label="公众号账号" prop="account">
  340. <el-input v-model="queryPlatform.account" style="width: 140px" size="small" placeholder="输入公众号账号"/>
  341. </el-form-item>
  342. <el-form-item label="公众号密码" prop="password">
  343. <el-input v-model="queryPlatform.password" style="width: 140px" size="small" placeholder="输入公众号密码"/>
  344. </el-form-item>
  345. <el-form-item label="项目组" prop="businessGroupId" v-if="isAdd">
  346. <el-select v-model="queryPlatform.businessGroupId" size="small" placeholder="选择项目组" filterable style="width: 140px" clearable>
  347. <el-option v-for="item in teamsList" :key="item.id" :label="item.businessGroupName" :value="item.id" />
  348. </el-select>
  349. </el-form-item>
  350. <el-form-item label="期数" prop="periodId" v-if="isAdd">
  351. <el-select v-model="queryPlatform.periodId" size="small" placeholder="选择期数" filterable style="width: 140px" clearable>
  352. <el-option v-for="item in periodList" :key="item.id" :label="item.period" :value="item.id" />
  353. </el-select>
  354. </el-form-item>
  355. <el-form-item label="书城" prop="platformId" v-if="isAdd">
  356. <el-select v-model="queryPlatform.platformId" @change="selectZh" size="small" placeholder="选择书城" filterable style="width: 140px" clearable>
  357. <el-option v-for="item in bookCity" :key="item.id" :label="item.platformName" :value="item.id" />
  358. </el-select>
  359. </el-form-item>
  360. <el-form-item label="账号" prop="platformAccountId" v-if="isAdd">
  361. <el-select v-model="queryPlatform.platformAccountId" :disabled="!queryPlatform.platformId" size="small" placeholder="选择账号" filterable style="width: 140px" clearable>
  362. <el-option v-for="item in accList" :key="item.id" :label="item.account" :value="item.id" />
  363. </el-select>
  364. </el-form-item>
  365. <el-form-item label="书" prop="bookId" v-if="isAdd">
  366. <el-select v-model="queryPlatform.bookId" size="small" placeholder="选择书" filterable style="width: 140px" clearable>
  367. <el-option v-for="item in bookList" :key="item.id" :label="item.bookName" :value="item.id" />
  368. </el-select>
  369. </el-form-item>
  370. <el-form-item label="投放状态" prop="putStatus" v-if="isAdd">
  371. <el-select v-model="queryPlatform.putStatus" size="small" placeholder="选择投放状态" filterable style="width: 140px" clearable>
  372. <el-option label="待投放" value="wait" />
  373. <el-option label="投放中" value="ing" />
  374. <el-option label="停投" value="stop" />
  375. <el-option label="账号已注销" value="destroy" />
  376. </el-select>
  377. </el-form-item>
  378. <el-form-item label="投放渠道" prop="putChannel" v-if="isAdd">
  379. <el-select v-model="queryPlatform.putChannel" size="small" placeholder="选择投放渠道" filterable style="width: 140px" clearable>
  380. <el-option label="MP" value="MP" />
  381. <el-option label="GDT" value="GDT" />
  382. <el-option label="头条" value="头条" />
  383. <el-option label="企微" value="企微" />
  384. <el-option label="混投" value="混投" />
  385. </el-select>
  386. </el-form-item>
  387. <el-form-item label="充值模板" prop="rechargeTemplate" v-if="isAdd">
  388. <el-input v-model="queryPlatform.rechargeTemplate" size="small" style="width: 140px" placeholder="输入充值模板" />
  389. </el-form-item>
  390. <el-form-item label="管理员姓名" prop="administratorName">
  391. <el-input v-model="queryPlatform.administratorName" style="width: 140px" size="small" placeholder="输入管理员姓名"/>
  392. </el-form-item>
  393. <el-form-item label="管理员身份证" prop="administratorCard">
  394. <el-input v-model="queryPlatform.administratorCard" style="width: 140px" size="small" placeholder="输入管理员身份证"/>
  395. </el-form-item>
  396. <el-form-item label="管理员手机号码" prop="managePhone">
  397. <el-input v-model="queryPlatform.managePhone" style="width: 140px" size="small" placeholder="输入管理员手机号"/>
  398. </el-form-item>
  399. <el-form-item label="管理员微信" prop="administratorWechat">
  400. <el-input v-model="queryPlatform.administratorWechat" style="width: 140px" size="small" placeholder="输入管理员微信"/>
  401. </el-form-item>
  402. <el-form-item label="管理员手机号码编号" prop="managePhoneNo">
  403. <el-input v-model="queryPlatform.managePhoneNo" style="width: 140px" size="small" placeholder="输入管理员手机号码编号"/>
  404. </el-form-item>
  405. <el-form-item label="法人姓名" prop="legalName">
  406. <el-input v-model="queryPlatform.legalName" style="width: 140px" size="small" placeholder="输入法人姓名"/>
  407. </el-form-item>
  408. <el-form-item label="法人身份证" prop="legalCard">
  409. <el-input v-model="queryPlatform.legalCard" style="width: 140px" size="small" placeholder="输入法人身份证"/>
  410. </el-form-item>
  411. <el-form-item label="法人微信" prop="legalWechat">
  412. <el-input v-model="queryPlatform.legalWechat" style="width: 140px" size="small" placeholder="输入法人微信"/>
  413. </el-form-item>
  414. <el-form-item label="认证开始时间" prop="authTime">
  415. <el-date-picker v-model="queryPlatform.authTime" style="width: 140px" type="date" placeholder="选择开始时间" size="small"/>
  416. </el-form-item>
  417. <el-form-item label="认证结束时间" prop="authTimeout">
  418. <el-date-picker v-model="queryPlatform.authTimeout" style="width: 140px" type="date" placeholder="选择结束时间" size="small"/>
  419. </el-form-item>
  420. </el-form>
  421. <span slot="footer" class="dialog-footer">
  422. <el-button @click="openEdit = false">取 消</el-button>
  423. <el-button type="primary" @click="submit('platForm')">确 定</el-button>
  424. </span>
  425. </el-dialog>
  426. <!-- 指派弹窗 -->
  427. <el-dialog title="批量指派(修改运营和投手后必选)" :visible.sync="batchOpen" width="300px" append-to-body>
  428. <el-form :model="batchAssignPlatForm" :rules="rules" ref="batchplatForm" label-width="80px" label-position="top">
  429. <el-form-item label="开始时间" prop="beginTime">
  430. <el-date-picker
  431. v-model="batchAssignPlatForm.beginTime"
  432. type="date"
  433. format="yyyy-MM-dd"
  434. value-format="yyyy-MM-dd"
  435. placeholder="选择开始时间">
  436. </el-date-picker>
  437. </el-form-item>
  438. <el-form-item label="运营" prop="operUserId">
  439. <el-select v-model="batchAssignPlatForm.operUserId" placeholder="请选择" filterable style="width: 100%" clearable>
  440. <el-option v-for="item in userAll" :key="item.id" :label="item.nickName" :value="item.id" />
  441. </el-select>
  442. </el-form-item>
  443. <el-form-item label="投手" prop="putUserId">
  444. <el-select v-model="batchAssignPlatForm.putUserId" placeholder="请选择" filterable style="width: 100%" clearable>
  445. <el-option v-for="item in userAll" :key="item.id" :label="item.nickName" :value="item.id" />
  446. </el-select>
  447. </el-form-item>
  448. </el-form>
  449. <span slot="footer" class="dialog-footer">
  450. <el-button @click="batchOpen = false">取 消</el-button>
  451. <el-button type="primary" @click="batchSubmit('batchplatForm')">确 定</el-button>
  452. </span>
  453. </el-dialog>
  454. <el-dialog title="指派用户" :visible.sync="openEditType" width="680px" append-to-body>
  455. <el-form :model="assignUSerData" :rules="rulesType1" ref="platFormType" label-width="80px" label-position="top">
  456. <el-form-item label="开始时间(修改运营和投手后必选)" prop="beginTime">
  457. <el-date-picker
  458. v-model="assignUSerData.beginTime"
  459. type="date"
  460. format="yyyy-MM-dd"
  461. value-format="yyyy-MM-dd"
  462. placeholder="选择开始时间">
  463. </el-date-picker>
  464. </el-form-item>
  465. <el-row :gutter="20">
  466. <el-col :span="8">
  467. <el-form-item label="运营" prop="operUserId">
  468. <el-select v-model="assignUSerData.operUserId" placeholder="请选择" filterable style="width: 100%" clearable>
  469. <el-option v-for="item in userAll" :key="item.id" :label="item.nickName" :value="item.id" />
  470. </el-select>
  471. </el-form-item>
  472. </el-col>
  473. <el-col :span="8">
  474. <el-form-item label="投手" prop="putUserId">
  475. <el-select v-model="assignUSerData.putUserId" placeholder="请选择" filterable style="width: 100%" clearable>
  476. <el-option v-for="item in userAll" :key="item.id" :label="item.nickName" :value="item.id" />
  477. </el-select>
  478. </el-form-item>
  479. </el-col>
  480. <el-col :span="8">
  481. <el-form-item label="审查" prop="checkUserId">
  482. <el-select v-model="assignUSerData.checkUserId" placeholder="请选择" filterable style="width: 100%" clearable>
  483. <el-option v-for="item in userAll" :key="item.id" :label="item.nickName" :value="item.id" />
  484. </el-select>
  485. </el-form-item>
  486. </el-col>
  487. </el-row>
  488. </el-form>
  489. <span slot="footer" class="dialog-footer">
  490. <el-button @click="openEditType = false; assignUSerData = {}">取 消</el-button>
  491. <el-button type="primary" @click="assignUSerHandle">确 定</el-button>
  492. </span>
  493. </el-dialog>
  494. <!-- 变更信息 -->
  495. <AccountUpdate :drawer="drawer" v-if="drawer" @close="drawer = false" :drawerTitle="drawerTitle" :drawerId="drawerId"></AccountUpdate>
  496. </div>
  497. </template>
  498. <script>
  499. import { getAccount, getAccountList, addAccount, editAccount, addGroup, getGroupAllList, editAccountGroup, assignUser, configUser } from "@/api/accounts/account";
  500. import { allUser } from "@/api/system/user";
  501. import { getAllBook } from "@/api/system/books";
  502. import { Copy } from "@/utils";
  503. import AccountUpdate from "./components/accountUpdate.vue";
  504. import { getPeriodAll } from "@/api/accounts/period";
  505. import { getBookPlatInfoAll } from "@/api/accounts/bookCity";
  506. import { getBookAcc, getBookAll } from "@/api/system/books";
  507. import cutBook from './components/cutBook.vue'
  508. import changeRecord from './components/changeRecord.vue'
  509. import { getBusinessGroupAll } from "@/api/admin/teams";
  510. export default {
  511. name: "Account",
  512. components: { AccountUpdate, cutBook, changeRecord },
  513. data() {
  514. return {
  515. groupValue: "",
  516. newGroupName: "",
  517. queryParams: {
  518. pageNum: 1,
  519. pageSize: 10
  520. },
  521. showSearch: true,
  522. // 编辑弹窗
  523. openEdit: false,
  524. // 总条数
  525. total: 0,
  526. // 公众号表格信息
  527. accountList: [],
  528. // 分组数据
  529. groupingData: [],
  530. isAdd: true,
  531. single: true,
  532. queryPlatform: {},
  533. rules: {
  534. beginTime: [
  535. { required: true, message: '请输入开始时间', trigger: 'blur' }
  536. ],
  537. appid: [
  538. { required: true, message: "请输入公众号appid", trigger: "blur" },
  539. ],
  540. nickName: [
  541. { required: true, message: "请输入公众号名称", trigger: "blur" },
  542. ],
  543. putStatus: [
  544. { required: true, message: '请选择投放状态', trigger: 'blur' }
  545. ]
  546. },
  547. userAll: [], //所有用户
  548. bookAll: [], //所有书城
  549. queryPlatformType: {
  550. operUserId: "",
  551. putUserId: "",
  552. platformAccountIds: [],
  553. bookName: "",
  554. approveStatus: "",
  555. },
  556. rulesType: {
  557. platformAccountIds: [
  558. { required: true, message: "请输入公众号appid", trigger: "change" },
  559. ],
  560. bookName: [
  561. { required: true, message: "请输入公众号appid", trigger: "blur" },
  562. ],
  563. approveStatus: [
  564. { required: true, message: "请输入公众号appid", trigger: "change" },
  565. ],
  566. },
  567. state: [
  568. { label: 1, value: "投放中" },
  569. { label: 2, value: "停投" },
  570. { label: 3, value: "已注销" },
  571. ],
  572. batchAssignPlatForm: {
  573. putUserId: "",
  574. operUserId: "",
  575. mpIds: [],
  576. },
  577. batchOpen: false,
  578. // 表格loading
  579. loading: false,
  580. // 信息变更
  581. drawer: false,
  582. drawerTitle: '',
  583. drawerId: null,
  584. openEditType: false,
  585. rulesType1: {
  586. operUserId: [
  587. { required: true, message: "请选择运营", trigger: "change" },
  588. ],
  589. putUserId: [
  590. { required: true, message: "请选择投手", trigger: "change" },
  591. ],
  592. },
  593. assignUSerData: {},
  594. teamsList: [], // 项目组
  595. bookList: [],
  596. accList: [],
  597. bookCity: [],
  598. periodList: []
  599. };
  600. },
  601. mounted() {
  602. this.total = this.accountList.length;
  603. window.addEventListener("storage", (e) => {
  604. if (e.key === "code") {
  605. if (e.newValue === "ok") {
  606. this.$router.go(0);
  607. this.msgSuccess("授权成功");
  608. localStorage.removeItem("code");
  609. } else {
  610. this.$message.error("授权失败");
  611. localStorage.removeItem("code");
  612. }
  613. }
  614. });
  615. },
  616. created() {
  617. this.getAll();
  618. this.getList();
  619. this.getGroupList();
  620. this.getCutXgData()
  621. },
  622. methods: {
  623. /** 清空选中公众号 */
  624. clearMpidsHandle() {
  625. this.batchAssignPlatForm = {
  626. putUserId: "",
  627. operUserId: "",
  628. mpIds: [],
  629. }
  630. this.$nextTick(() => {
  631. this.$refs.multipleTable.clearSelection();
  632. })
  633. },
  634. /** 数组去重 */
  635. dedupe(array){
  636. return Array.from(new Set(array));
  637. },
  638. handleSelect(selection, row) {
  639. let mpIds = this.batchAssignPlatForm.mpIds
  640. if(selection.length > mpIds.length) { // 选中
  641. this.batchAssignPlatForm.mpIds = this.dedupe([...mpIds, {nickName: row.nickName, id: row.id}])
  642. } else { // 取消
  643. this.batchAssignPlatForm.mpIds = mpIds.filter(item => item.id !== row.id)
  644. }
  645. },
  646. handleSelectAll(selection) {
  647. console.log(1111, selection)
  648. let mpIds = this.batchAssignPlatForm.mpIds
  649. if (selection.length > 0) { // 选中
  650. let newMpIds = selection.map(item => ({nickName: item.nickName, id: item.id}))
  651. this.batchAssignPlatForm.mpIds = this.dedupe([...mpIds, ...newMpIds])
  652. } else { // 取消
  653. let newMpIds = this.accountList.map(item => item.id)
  654. this.batchAssignPlatForm.mpIds = mpIds.filter(item => {
  655. if (newMpIds.includes(item.id)) {
  656. return false
  657. }
  658. return true
  659. })
  660. }
  661. },
  662. selectZh(e) {
  663. // 获取所有账号
  664. this.queryPlatform.platformAccountId = null
  665. getBookAcc(e).then(res => {
  666. this.accList = res.data
  667. })
  668. },
  669. /** 新增编辑记录获取数据 */
  670. getCutXgData() {
  671. // 获取项目组
  672. getBusinessGroupAll().then(res => {
  673. this.teamsList = res.data
  674. })
  675. // 获取期数
  676. getPeriodAll().then(response => {
  677. this.periodList = response.data
  678. });
  679. // 获取所有书城
  680. getBookPlatInfoAll().then(res => {
  681. this.bookCity = res.data
  682. })
  683. // 获取所有书
  684. getBookAll().then(res => {
  685. this.bookList = res.data
  686. })
  687. },
  688. /** 指派 */
  689. handleState(value) {
  690. let { id, operUserId, putUserId, checkUserId } = value
  691. this.assignUSerData = { mpId: id, operUserId, putUserId, checkUserId }
  692. this.openEditType = true
  693. },
  694. /** 指派提交 */
  695. assignUSerHandle() {
  696. configUser(this.assignUSerData).then(res => {
  697. if(res.data) {
  698. this.msgSuccess('指派成功')
  699. this.getList()
  700. this.openEditType = false
  701. }
  702. })
  703. },
  704. /** 多选 */
  705. handleSelectionChange(selection) {
  706. this.batchAssignPlatForm.mpIds = selection.map((item) => item.id);
  707. this.single = !selection.length;
  708. },
  709. /** 批量指派打开弹窗 */
  710. handleBatchAdd() {
  711. this.batchOpen = true;
  712. },
  713. /** 批量指派提交 */
  714. batchSubmit(formName) {
  715. this.$refs[formName].validate((valid) => {
  716. if (valid) {
  717. let { mpIds } = this.batchAssignPlatForm
  718. assignUser({ ...this.batchAssignPlatForm, mpIds: mpIds.map(item => item.id) }).then((response) => {
  719. if (response.data) {
  720. this.msgSuccess("指派成功");
  721. this.resetForm(formName);
  722. this.batchOpen = false;
  723. this.batchAssignPlatForm = {
  724. putUserId: "",
  725. operUserId: "",
  726. mpIds: [],
  727. }
  728. this.getList();
  729. } else {
  730. console.error(response);
  731. }
  732. });
  733. } else {
  734. return false;
  735. }
  736. });
  737. },
  738. /**图片返回失败 */
  739. avatarErr() {
  740. return true;
  741. },
  742. /** 获取所有 */
  743. getAll() {
  744. // 所有用户
  745. allUser().then((response) => {
  746. let data = response.data;
  747. this.userAll = data.map((item) => {
  748. return { id: item.userId, nickName: item.nickname };
  749. });
  750. });
  751. // 所有书城平台
  752. getAllBook().then((response) => {
  753. let data = response.data;
  754. this.bookAll = data.map((item) => {
  755. let { platformName, id } = item;
  756. return { label: platformName, value: id };
  757. });
  758. });
  759. },
  760. /** 新增公众号*/
  761. handleAdd() {
  762. this.isAdd = true;
  763. this.openEdit = true;
  764. this.queryPlatform = {}
  765. },
  766. /** 编辑按钮方法 */
  767. handleEdit(value) {
  768. let { id, nickName, authStatus, appid, account, password, authTime, authTimeout, administratorName, managePhone, managePhoneNo, administratorCard, administratorWechat, legalName, legalCard, legalWechat, resourceInfo } = value;
  769. this.queryPlatform = { appid, account, password, authTime, authTimeout,
  770. nickName, administratorName, managePhone, managePhoneNo, authStatus,
  771. administratorCard, administratorWechat, legalName, legalCard,
  772. legalWechat, id, putStatus: resourceInfo.putStatus,
  773. putChannel: resourceInfo.putChannel,
  774. rechargeTemplate: resourceInfo.rechargeTemplate,
  775. periodId: resourceInfo.periodId,
  776. platformId: resourceInfo.platformId,
  777. platformAccountId: resourceInfo.platformAccountId,
  778. bookId: resourceInfo.bookId,
  779. businessGroupId: resourceInfo.businessGroupId
  780. };
  781. this.isAdd = false;
  782. this.openEdit = true;
  783. },
  784. /** 查询公众号列表 */
  785. getList() {
  786. this.loading = true
  787. getAccountList(this.queryParams).then((response) => {
  788. this.loading = false
  789. let data = response.data;
  790. this.accountList = data.records;
  791. this.total = data.total;
  792. if (this.batchAssignPlatForm.mpIds) {
  793. let mpIds = this.batchAssignPlatForm.mpIds.map(item => item.id)
  794. this.$nextTick(() => {
  795. data.records.forEach(item => {
  796. if(mpIds.includes(item.id)) {
  797. this.$refs.multipleTable.toggleRowSelection(item);
  798. }
  799. })
  800. })
  801. }
  802. });
  803. },
  804. /** 搜索 */
  805. handleQuery() {
  806. this.getList();
  807. },
  808. /** 重置搜索条件 */
  809. resetQuery() {
  810. this.resetForm("queryForm");
  811. this.getList();
  812. },
  813. /** 授权 */
  814. authorizeHandle(value) {
  815. let callbackPage =
  816. window.location.origin + "/admin/#/accounts/account/wxCode?uuid=UUID";
  817. getAccount({ callbackPage, id: value.id }).then((response) => {
  818. if (response.data) {
  819. window.open(response.data);
  820. }
  821. });
  822. },
  823. /** 新增 编辑 提交 */
  824. submit(formName) {
  825. this.$refs[formName].validate((valid) => {
  826. if (valid) {
  827. let { authTime, authTimeout } = this.queryPlatform;
  828. let params = { ...this.queryPlatform };
  829. if (authTime) {
  830. authTime = this.parserTime(authTime);
  831. params.authTime = authTime
  832. }
  833. if (authTimeout) {
  834. authTimeout = this.parserTime(authTimeout);
  835. params.authTimeout = authTimeout
  836. }
  837. if (this.isAdd) {
  838. console.log(params)
  839. addAccount(params).then(res => {
  840. if (res.data) {
  841. this.msgSuccess("新增成功");
  842. this.resetForm("platForm");
  843. this.openEdit = false;
  844. this.getList();
  845. } else {
  846. console.error(res);
  847. }
  848. })
  849. } else {
  850. params.id = this.queryPlatform.id;
  851. editAccount(params).then((response) => {
  852. if (response.data) {
  853. this.msgSuccess("修改成功");
  854. this.resetForm("platForm");
  855. this.openEdit = false;
  856. this.getList();
  857. } else {
  858. console.error(response);
  859. }
  860. });
  861. }
  862. } else {
  863. return false;
  864. }
  865. });
  866. },
  867. /** 时间转换 */
  868. parserTime(time) {
  869. const d = new Date(time);
  870. const resDate =
  871. d.getFullYear() +
  872. "-" +
  873. this.p(d.getMonth() + 1) +
  874. "-" +
  875. this.p(d.getDate());
  876. return resDate;
  877. },
  878. p(s) {
  879. return s < 10 ? "0" + s : s;
  880. },
  881. /** 表格状态管理 */
  882. tableRowClassName({ row, rowIndex }) {
  883. if (row.authStatus === 1) {
  884. return "danger-row";
  885. }
  886. return "";
  887. },
  888. /** 分组新政 */
  889. handleAddGroup() {
  890. if (this.groupValue === "") {
  891. this.$message.error("请输入分组");
  892. return;
  893. }
  894. addGroup({ groupName: this.groupValue }).then((response) => {
  895. if (response.data) {
  896. this.getGroupList();
  897. this.msgSuccess("新增成功");
  898. this.groupValue = "";
  899. this.gVis = false;
  900. } else {
  901. console.error(response);
  902. }
  903. });
  904. },
  905. /** 获取分组 */
  906. getGroupList() {
  907. getGroupAllList().then((response) => {
  908. this.groupingData = response.data.map((item) => {
  909. return { ...item, isUpdata: false };
  910. });
  911. });
  912. },
  913. /** 修改公众号分组 */
  914. editAccountGroup(id, resourceGroupId) {
  915. editAccountGroup({ id, resourceGroupId }).then((response) => {
  916. if (response.data) {
  917. this.getList();
  918. this.msgSuccess("设置成功");
  919. } else {
  920. console.error(response);
  921. }
  922. });
  923. },
  924. /** 复制 */
  925. Copy(value) {
  926. Copy(value);
  927. },
  928. },
  929. };
  930. </script>
  931. <style lang="scss">
  932. .el-table {
  933. .warning-row {
  934. background: oldlace;
  935. }
  936. .danger-row {
  937. background: rgb(253, 187, 187);
  938. }
  939. .info-row {
  940. background: #909399;
  941. }
  942. }
  943. .el-table .el-drawer__header span:focus {
  944. outline: 0;
  945. }
  946. .Space {
  947. width: 10px;
  948. display: inline-block;
  949. }
  950. .my_padding {
  951. margin: 0 10px 10px 10px;
  952. }
  953. .verticalCenter {
  954. display: flex;
  955. flex-direction: column;
  956. justify-content: center;
  957. margin-left: 5px;
  958. & > div.child {
  959. color: rgb(136, 136, 136);
  960. font-size: 13px;
  961. & > span {
  962. color: #606266;
  963. }
  964. }
  965. .font12 {
  966. font-size: 12px;
  967. }
  968. }
  969. .copy {
  970. color: #409eff;
  971. margin-left: 5px;
  972. cursor: pointer;
  973. }
  974. .elli {
  975. display: flex;
  976. justify-content: flex-start;
  977. align-items: center;
  978. span {
  979. flex: 1;
  980. overflow: hidden;
  981. text-overflow: ellipsis;
  982. white-space: nowrap;
  983. }
  984. }
  985. .myElli {
  986. overflow: hidden;
  987. text-overflow: ellipsis;
  988. white-space: nowrap;
  989. }
  990. .grouping {
  991. span {
  992. font-size: 12px;
  993. }
  994. button {
  995. padding: 0;
  996. }
  997. }
  998. .groupingNames {
  999. padding: 0;
  1000. li {
  1001. list-style: none;
  1002. padding: 5px 2px;
  1003. box-sizing: border-box;
  1004. position: relative;
  1005. cursor: pointer;
  1006. .gnnone {
  1007. display: none;
  1008. }
  1009. .gnTxt {
  1010. overflow: hidden;
  1011. text-overflow: ellipsis;
  1012. white-space: nowrap;
  1013. }
  1014. .gnBts {
  1015. width: 100%;
  1016. height: 100%;
  1017. position: absolute;
  1018. top: 0;
  1019. left: 0;
  1020. .bts {
  1021. position: absolute;
  1022. top: 0;
  1023. right: 0;
  1024. height: 100%;
  1025. width: 50px;
  1026. padding-right: 10px;
  1027. }
  1028. }
  1029. &:hover .gnnone {
  1030. display: block;
  1031. background-color: rgba(211, 211, 211, 0.5);
  1032. border-radius: 2px;
  1033. }
  1034. i {
  1035. cursor: pointer;
  1036. }
  1037. }
  1038. }
  1039. .el-dropdown-link {
  1040. cursor: pointer;
  1041. color: #409EFF;
  1042. font-size: 12px;
  1043. margin-left: 10px;
  1044. }
  1045. .dropdownItem {
  1046. cursor: pointer;
  1047. color: #409EFF;
  1048. font-size: 12px;
  1049. padding: 4px 0;
  1050. }
  1051. </style>