index.php 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-attachment');
  4. ComponentHelper::loadComponentView('com-image');
  5. ComponentHelper::loadComponentView('com-map');
  6. ?>
  7. <div id="app" v-cloak>
  8. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  9. <div slot="header">
  10. <span>{{ custom_text }}管理</span>
  11. <div style="float: right; margin: -5px 0">
  12. <el-button type="primary" @click="addUser(true)" size="small">
  13. 添加{{ custom_text }}
  14. </el-button>
  15. <!-- <el-button type="primary" @click="$navigate({r:'store/client/reserve-staff/add'})" size="small">-->
  16. <!-- 添加{{ custom_text }}-->
  17. <!-- </el-button>-->
  18. </div>
  19. </div>
  20. <div class="table-body">
  21. <el-form size="small" :inline="true">
  22. <el-form-item>
  23. <el-input style="width: 200px" v-model="searchData.user_id" placeholder="请输入用户ID进行搜索" clearable></el-input>
  24. </el-form-item>
  25. <el-form-item>
  26. <el-input style="width: 200px" v-model="searchData.keyword" placeholder="请输入用户昵称/手机号进行搜索" clearable></el-input>
  27. </el-form-item>
  28. <el-form-item>
  29. <el-input style="width: 200px" v-model="searchData.name" placeholder="请输入名称进行搜索" clearable></el-input>
  30. </el-form-item>
  31. <el-form-item>
  32. <el-input style="width: 200px" v-model="searchData.mobile" placeholder="请输入手机号进行搜索" clearable></el-input>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-date-picker size="small" v-model="searchData.date" type="datetimerange" style="float: left" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" @change="selectDateTime" end-placeholder="结束日期">
  36. </el-date-picker>
  37. </el-form-item>
  38. <el-form-item>
  39. <el-button type="primary" @click="searchs" style="padding: 9px 15px !important">搜索</el-button>
  40. </el-form-item>
  41. </el-form>
  42. <el-tabs v-model="activeName" >
  43. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;" >
  44. <el-table-column prop="user_id" label="会员ID" align="center"></el-table-column>
  45. <el-table-column label="会员" >
  46. <template slot-scope="scope">
  47. <div class="table-info-img-text">
  48. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  49. <div slot="error" class="image-slot">
  50. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  51. </div>
  52. </el-image>
  53. <div class="table-info-text">
  54. <div style="color:#000;">{{scope.row.user.nickname}}</div>
  55. <div style="font-size: 12px;">{{scope.row.mobile}}</div>
  56. </div>
  57. </div>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="姓名" prop="name" align="center" ></el-table-column>
  61. <el-table-column :label="custom_text + '等级'" align="center">
  62. <template slot-scope="scope">
  63. {{scope.row.level ? scope.row.level.name : '默认等级'}}
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="资格证书" align="center">
  67. <template slot-scope="scope">
  68. <el-image
  69. v-for="(img, index) in scope.row.qualification_certificate"
  70. :key="index"
  71. style="width: 50px; height: 50px; margin-left: 5px"
  72. :src="img"
  73. :preview-src-list="scope.row.qualification_certificate">
  74. </el-image>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="订单核销数量" prop="store_order_num" align="center"></el-table-column>
  78. <el-table-column label="订单业绩数量(不含退款)" prop="order_count" align="center" min-width="110"></el-table-column>
  79. <el-table-column label="服务地址" prop="address" align="left"></el-table-column>
  80. <!-- <el-table-column label="入驻时间" align="center">-->
  81. <!-- <template slot-scope="scope">-->
  82. <!-- {{scope.row.settle.created_at|dateTimeFormat('Y-m-d H:i:s')}}-->
  83. <!-- </template>-->
  84. <!-- </el-table-column>-->
  85. <el-table-column label="操作" align="center" min-width="200">
  86. <template slot-scope="scope">
  87. <el-button type="text" @click="$navigate({r:'store/client/reserve-staff/detail', id: scope.row.user_id})" class="all_text">查看</el-button>
  88. <el-button type="text" @click="onDelete(scope.row, scope.$index)" class="all_text" style="margin-left: 10px">删除</el-button>
  89. <el-button type="text" @click="association(scope.row)" class="all_text" style="margin-left: 10px">关联商品</el-button>
  90. <el-button type="text" @click="associationSecondaryCard(scope.row)" class="all_text"
  91. style="margin-left: 10px">关联次卡
  92. </el-button>
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. </el-tabs>
  97. <div flex="box:last cross:center">
  98. <div></div>
  99. <div>
  100. <el-pagination v-if="pagination" :page-size="page_size"
  101. style="float: right;" background @current-change="pageChange"
  102. layout="prev, pager, next" :total="pagination.totalCount">
  103. </el-pagination>
  104. </div>
  105. </div>
  106. </div>
  107. <el-dialog title="关联商品" :visible.sync="dialogVisibleAssociation">
  108. <el-button type="text" @click="associationAdd" class="all_text" style="margin-left: 10px">添加商品</el-button>
  109. <el-table :data="gridData">
  110. <el-table-column prop="id" label="商品ID" width="150"></el-table-column>
  111. <el-table-column prop="goods_name" label="商品" width="200">
  112. <template slot-scope="scope">
  113. <div flex="cross:center">
  114. <div style="margin-right: 10px;">
  115. <el-image style="width: 50px; height: 50px;border-radius: 5px;" :src="scope.row.cover_pic"></el-image>
  116. </div>
  117. <el-tooltip class="item" effect="dark" content="商品名称" placement="top">
  118. <span>{{scope.row.goods_name}}</span>
  119. </el-tooltip>
  120. </div>
  121. </template>
  122. </el-table-column>
  123. <el-table-column prop="created_at" label="创建时间">
  124. <template slot-scope="scope">
  125. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="操作" align="center" min-width="80">
  129. <template slot-scope="scope">
  130. <el-button @click="delFun(scope.$index)" type="danger" plain>取消</el-button>
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. <span slot="footer" class="dialog-footer">
  135. <el-button @click="dialogVisibleAssociation = false">取 消</el-button>
  136. <el-button type="primary" @click="handleAssociationStoreGoods">确 定</el-button>
  137. </span>
  138. </el-dialog>
  139. <el-dialog title="关联次卡" :visible.sync="dialogVisibleAssociationSecondaryCard">
  140. <el-button type="text" @click="associationAddSecondaryCard" class="all_text" style="margin-left: 10px">
  141. 添加次卡
  142. </el-button>
  143. <el-table :data="gridDataSecondaryCard">
  144. <el-table-column prop="id" label="次卡ID"></el-table-column>
  145. <el-table-column prop="name" label="次卡名称"></el-table-column>
  146. <el-table-column prop="create_source_type_text" label="创建来源"></el-table-column>
  147. <el-table-column prop="created_at" label="创建时间">
  148. <template slot-scope="scope">
  149. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="操作" align="center">
  153. <template slot-scope="scope">
  154. <el-button @click="delFunSecondaryCard(scope.$index)" type="danger" plain>取消</el-button>
  155. </template>
  156. </el-table-column>
  157. </el-table>
  158. <span slot="footer" class="dialog-footer">
  159. <el-button @click="dialogVisibleAssociationSecondaryCard = false">取 消</el-button>
  160. <el-button type="primary" @click="handleAssociationStoreSecondaryCard">确 定</el-button>
  161. </span>
  162. </el-dialog>
  163. <el-dialog title="添加商品" :visible.sync="dialogVisibleAssociationAdd">
  164. <el-input v-model="searchGoodsData.keyword" placeholder="请输入商品ID或者商品名称" @keyup.enter.native="getAssociationAddList(1)">
  165. <el-button slot="append" @click="getAssociationAddList(1)">搜索</el-button>
  166. </el-input>
  167. <el-table ref="multipleTable" :data="gridDataGoodsList" @selection-change="handleSelectionChange"
  168. >
  169. <el-table-column type="selection" width="55"></el-table-column>
  170. <el-table-column prop="id" label="商品ID" width="150"></el-table-column>
  171. <el-table-column prop="goods_name" label="商品" width="200">
  172. <template slot-scope="scope">
  173. <div flex="cross:center">
  174. <div style="margin-right: 10px;">
  175. <el-image style="width: 50px; height: 50px;border-radius: 5px;" :src="scope.row.cover_pic"></el-image>
  176. </div>
  177. <el-tooltip class="item" effect="dark" content="商品名称" placement="top">
  178. <span>{{scope.row.goods_name}}</span>
  179. </el-tooltip>
  180. </div>
  181. </template>
  182. </el-table-column>
  183. <el-table-column prop="address" label="创建时间">
  184. <template slot-scope="scope">
  185. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  186. </template>
  187. </el-table-column>
  188. </el-table>
  189. <span slot="footer" class="dialog-footer">
  190. <el-button @click="dialogVisibleAssociationAdd = false">取 消</el-button>
  191. <el-button type="primary" @click="associationAddSelected">确 定</el-button>
  192. </span>
  193. <div style="margin-top: 24px;">
  194. <el-row>
  195. <el-pagination
  196. v-if="paginationAdd"
  197. style="display: inline-block;"
  198. background
  199. :page-size="paginationAdd.pageSize"
  200. @current-change="getAssociationAddList"
  201. layout="prev, pager, next"
  202. :total="paginationAdd.total_count">
  203. </el-pagination>
  204. </el-row>
  205. </div>
  206. </el-dialog>
  207. <el-dialog title="添加次卡" :visible.sync="dialogVisibleAssociationAddSecondaryCard">
  208. <el-input v-model="searchSecondaryCardData.keyword" placeholder="请输入次卡ID或者次卡名称"
  209. @keyup.enter.native="getAssociationSecondaryCardAddList(1)">
  210. <el-button slot="append" @click="getAssociationSecondaryCardAddList(1)">搜索</el-button>
  211. </el-input>
  212. <el-table ref="multipleTableSecondaryCard" :data="gridDataSecondaryCardList"
  213. @selection-change="handleSelectionChangeSecondaryCard"
  214. >
  215. <el-table-column type="selection"></el-table-column>
  216. <el-table-column prop="id" label="次卡ID"></el-table-column>
  217. <el-table-column prop="name" label="次卡名称"></el-table-column>
  218. <el-table-column prop="create_source_type_text" label="创建来源"></el-table-column>
  219. <el-table-column prop="address" label="创建时间">
  220. <template slot-scope="scope">
  221. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  222. </template>
  223. </el-table-column>
  224. </el-table>
  225. <span slot="footer" class="dialog-footer">
  226. <el-button @click="dialogVisibleAssociationAddSecondaryCard = false">取 消</el-button>
  227. <el-button type="primary" @click="associationAddSelectedSecondaryCard">确 定</el-button>
  228. </span>
  229. <div style="margin-top: 24px;">
  230. <el-row>
  231. <el-pagination
  232. v-if="paginationAddSecondaryCard"
  233. style="display: inline-block;"
  234. background
  235. :page-size="paginationAddSecondaryCard.pageSize"
  236. @current-change="getAssociationSecondaryCardAddList"
  237. layout="prev, pager, next"
  238. :total="paginationAddSecondaryCard.total_count">
  239. </el-pagination>
  240. </el-row>
  241. </div>
  242. </el-dialog>
  243. </el-card>
  244. <div class="level-edit">
  245. <?= ComponentHelper::loadComponentView('edit', __DIR__) ?>
  246. </div>
  247. </div>
  248. <script>
  249. const app = new Vue({
  250. el: '#app',
  251. data: {
  252. searchData: {
  253. user_id: '',
  254. keyword: '', //会员昵称/手机号
  255. name: '',//用户来源
  256. mobile: '',//注册开始时间
  257. address: '',//注册结束时间
  258. date_start: '',
  259. date_end: '',
  260. date: '',
  261. },
  262. form: {
  263. user_id: '',
  264. level: '',
  265. idcard: '',
  266. idcard_front: '',
  267. idcard_back: '',
  268. address: '',
  269. longitude: '',
  270. latitude: '',
  271. nickname: '',
  272. name: '',
  273. mobile: '',
  274. qualification_certificate: [],
  275. avatar: '',
  276. age: '',
  277. gender: '1',
  278. },
  279. list: [],
  280. loading: false,
  281. btnLoading: false,
  282. activeName: '-1',
  283. pagination: null,
  284. page_size: 10,
  285. currentItem: null,
  286. drawer: false,
  287. direction: 'rtl',
  288. rules: {},
  289. levels: [],
  290. add: true,
  291. origin_level: '',
  292. user: {
  293. keyword: ''
  294. },
  295. lng_lat: '',
  296. page: 1,
  297. custom_text: '',
  298. dialogVisibleAssociation: false,
  299. dialogVisibleAssociationAdd: false,
  300. gridData:[],
  301. gridDataGoodsList:[],
  302. multipleSelection: [2096],
  303. searchGoodsData: {
  304. keyword: '',
  305. },
  306. checkedList:[],
  307. paginationAdd: null,
  308. user_id:'',
  309. selectedGoodsIds:[],
  310. selectedSecondaryCardIds: [],
  311. dialogVisibleAssociationSecondaryCard: false,
  312. dialogVisibleAssociationAddSecondaryCard: false,
  313. gridDataSecondaryCard: [],
  314. gridDataSecondaryCardList: [],
  315. multipleSelectionSecondaryCard: [],
  316. searchSecondaryCardData: {
  317. keyword: '',
  318. },
  319. paginationAddSecondaryCard: null,
  320. },
  321. computed: {
  322. },
  323. mounted() {
  324. this.loadData();
  325. },
  326. methods: {
  327. selectDateTime(e) {
  328. if (e != null) {
  329. this.searchData.date_start = e[0];
  330. this.searchData.date_end = e[1];
  331. } else {
  332. this.searchData.date_start = '';
  333. this.searchData.date_end = '';
  334. }
  335. this.searchs();
  336. },
  337. loadData() {
  338. this.loading = true;
  339. let params = {
  340. r: 'store/client/reserve-staff/index',
  341. page: this.page,
  342. };
  343. params = Object.assign(params, this.searchData);
  344. request({
  345. params: params,
  346. method: 'get',
  347. }).then(e => {
  348. this.loading = false;
  349. if (e.data.code == 0) {
  350. this.list = e.data.data.list;
  351. this.pagination = e.data.data.pagination;
  352. this.page_size = e.data.data.page_size;
  353. this.custom_text = e.data.data.custom_text;
  354. } else {
  355. this.$message.error(e.data.msg);
  356. }
  357. }).catch(e => {
  358. this.loading = false;
  359. });
  360. },
  361. searchs() {
  362. this.page = 1;
  363. this.loadData();
  364. },
  365. pageChange(page) {
  366. this.page = page;
  367. this.loadData();
  368. },
  369. onDelete(item, index) {
  370. this.$confirm(`您是否真的要移除当前${this.custom_text}, 是否继续?`, '删除提醒', {
  371. type: 'warning'
  372. }).then(() => {
  373. this.btnLoading = false;
  374. request({
  375. params: {
  376. r: 'store/client/reserve-staff/delete'
  377. },
  378. method: 'post',
  379. data: {
  380. id: item.user_id,
  381. }
  382. }).then(e => {
  383. this.btnLoading = false;
  384. if (e.data.code == 0) {
  385. this.list.splice(index, 1)
  386. this.$message.success(e.data.msg);
  387. } else {
  388. this.$message.error(e.data.msg);
  389. }
  390. }).catch(e => {
  391. this.btnLoading = false;
  392. });
  393. })
  394. },
  395. submitForm(formName) {
  396. let _this = this;
  397. this.$refs[formName].validate((valid) => {
  398. if (valid) {
  399. _this.btnLoading = true;
  400. request({
  401. params: {
  402. r: 'store/client/reserve-staff/add'
  403. },
  404. method: 'post',
  405. data: {
  406. form: _this.form,
  407. }
  408. }).then(e => {
  409. _this.btnLoading = false
  410. if (e.data.code == 0) {
  411. _this.drawer = false
  412. _this.$message.success(e.data.msg)
  413. this.page = 1;
  414. _this.loadData()
  415. } else {
  416. _this.$message.error(e.data.msg);
  417. }
  418. }).catch(e => {
  419. _this.$message.error(e.data.msg);
  420. _this.btnLoading = false;
  421. });
  422. } else {
  423. console.log('error submit!!');
  424. return false;
  425. }
  426. });
  427. },
  428. addUser(add) {
  429. this.add = add
  430. this.drawer = true
  431. this.getLevels()
  432. },
  433. getLevels() {
  434. let _this = this;
  435. _this.btnLoading = true
  436. let basic_params = {
  437. r: 'store/client/reserve-staff/get-levels',
  438. };
  439. request({
  440. params: basic_params,
  441. method: 'get',
  442. }).then(e => {
  443. _this.btnLoading = false
  444. _this.levels = e.data.data
  445. }).catch(e => {
  446. console.log(e);
  447. });
  448. },
  449. handleClose(done) {
  450. this.drawer = false
  451. done()
  452. },
  453. querySearchAsync(queryString, cb) {
  454. this.user.keyword = queryString;
  455. this.getUser(cb);
  456. },
  457. getUser(cb) {
  458. request({
  459. params: {
  460. r: 'store/client/reserve-staff/search-user',
  461. keyword: this.user.keyword
  462. }
  463. }).then(res => {
  464. if (res.data.code == 0) {
  465. cb(res.data.data.list)
  466. } else {
  467. this.$message.error(res.data.msg);
  468. }
  469. });
  470. },
  471. agentClick(row) {
  472. this.form.user_id = row.id
  473. this.form.nickname = row.nickname
  474. this.handleBlur();
  475. },
  476. selectedImg(e, key) {
  477. this.form[key] = e[0].url;
  478. },
  479. delPic(key) {
  480. this.form[key] = '';
  481. },
  482. mapEvent(e) {
  483. this.form.longitude = e.long;
  484. this.form.latitude = e.lat;
  485. this.form.address = e.address;
  486. this.lng_lat = e.lat + '-' + e.long;
  487. },
  488. association(item) {
  489. this.dialogVisibleAssociation = true;
  490. this.user_id = item.user_id;
  491. let params = {
  492. r: 'store/client/reserve-staff/get-association-store-goods',
  493. user_id:item.user_id
  494. };
  495. request({
  496. params: params,
  497. method: 'get',
  498. }).then(e => {
  499. if (e.data.code == 0) {
  500. this.gridData = e.data.data;
  501. this.gridData.forEach((row)=>{
  502. this.selectedGoodsIds.push(row.id);
  503. });
  504. } else {
  505. this.$message.error(e.data.msg);
  506. }
  507. }).catch(e => {
  508. });
  509. },
  510. associationAdd() {
  511. this.dialogVisibleAssociationAdd = true;
  512. this.getAssociationAddList(1);
  513. },
  514. // 获取待添加商品列表
  515. getAssociationAddList(page){
  516. let params = {
  517. r: 'store/client/reserve-staff/get-store-goods',
  518. page: page,
  519. };
  520. params = Object.assign(params, this.searchGoodsData);
  521. request({
  522. params: params,
  523. method: 'get',
  524. }).then(e => {
  525. if (e.data.code == 0) {
  526. this.gridDataGoodsList = e.data.data.list;
  527. this.paginationAdd = e.data.data.pagination;
  528. this.paginationAdd.pageSize = e.data.data.page_size;
  529. this.paginationAdd.total_count = this.paginationAdd.totalCount;
  530. this.gridData.forEach((item)=>{
  531. this.gridDataGoodsList.forEach((row)=>{
  532. if(row.id == item.id){
  533. this.$nextTick(() => {
  534. this.$refs.multipleTable.toggleRowSelection(row, true);
  535. });
  536. }
  537. })
  538. })
  539. } else {
  540. this.$message.error(e.data.msg);
  541. }
  542. }).catch(e => {
  543. });
  544. },
  545. handleSelectionChange(val) {
  546. this.multipleSelection = val;
  547. },
  548. associationAddSelected(){
  549. if(this.gridData.length<=0){
  550. this.gridData = this.multipleSelection;
  551. this.multipleSelection.forEach((row)=>{
  552. this.selectedGoodsIds.push(row.id);
  553. });
  554. }else{
  555. this.gridData.forEach((item)=>{
  556. this.selectedGoodsIds.push(item.id);
  557. });
  558. this.multipleSelection.forEach((row)=>{
  559. if(!this.selectedGoodsIds.includes(row.id)){
  560. this.selectedGoodsIds.push(row.id);
  561. this.gridData.push(row);
  562. }
  563. });
  564. }
  565. this.dialogVisibleAssociationAdd = false;
  566. },
  567. handleAssociationStoreGoods(){
  568. request({
  569. params: {
  570. r: 'store/client/reserve-staff/handle-association-store-goods',
  571. },
  572. method: 'post',
  573. data: {
  574. goods_ids: this.selectedGoodsIds,
  575. user_id:this.user_id
  576. }
  577. }).then(e => {
  578. if (e.data.code == 0) {
  579. this.$message.success(e.data.msg)
  580. this.dialogVisibleAssociation = false;
  581. this.selectedGoodsIds = [];
  582. this.user_id = '';
  583. this.page = 1;
  584. this.loadData()
  585. } else {
  586. this.$message.error(e.data.msg);
  587. }
  588. }).catch(e => {
  589. this.$message.error(e.data.msg);
  590. });
  591. },
  592. delFun(index) {
  593. this.gridData.splice(index, 1)
  594. this.selectedGoodsIds.splice(index, 1)
  595. },
  596. qualificationCertificatePic(e) {
  597. if (e.length) {
  598. e.forEach((item, index) => {
  599. if (this.form.qualification_certificate.length >= 9) return;
  600. this.form.qualification_certificate.push(item.url);
  601. })
  602. }
  603. },
  604. delQualificationCertificatePic( index) { // 删除图片
  605. this.form.qualification_certificate.splice(index, 1)
  606. },
  607. handleBlur(){
  608. request({
  609. params: {
  610. r: 'store/client/reserve-staff/check-staff-user',
  611. user_id: this.form.user_id
  612. }
  613. }).then(res => {
  614. if (res.data.code == 0) {
  615. this.form = res.data.data.user;
  616. this.form.gender = this.form.gender.toString();
  617. this.lng_lat = res.data.data.user.longitude+'-'+res.data.data.user.latitude;
  618. } else {
  619. this.$message.error(res.data.msg);
  620. }
  621. });
  622. },
  623. associationSecondaryCard(item) {
  624. this.dialogVisibleAssociationSecondaryCard = true;
  625. this.user_id = item.user_id;
  626. let params = {
  627. r: 'store/client/reserve-staff/get-association-store-secondary-card',
  628. user_id: item.user_id
  629. };
  630. request({
  631. params: params,
  632. method: 'get',
  633. }).then(e => {
  634. if (e.data.code == 0) {
  635. this.gridDataSecondaryCard = e.data.data;
  636. this.gridDataSecondaryCard.forEach((row) => {
  637. this.selectedSecondaryCardIds.push(row.id);
  638. });
  639. } else {
  640. this.$message.error(e.data.msg);
  641. }
  642. }).catch(e => {
  643. });
  644. },
  645. associationAddSecondaryCard() {
  646. this.dialogVisibleAssociationAddSecondaryCard = true;
  647. this.getAssociationSecondaryCardAddList(1);
  648. },
  649. getAssociationSecondaryCardAddList(page) {
  650. let params = {
  651. r: 'store/client/reserve-staff/get-store-secondary-card',
  652. page: page,
  653. user_id: this.user_id
  654. };
  655. params = Object.assign(params, this.searchSecondaryCardData);
  656. request({
  657. params: params,
  658. method: 'get',
  659. }).then(e => {
  660. if (e.data.code == 0) {
  661. this.gridDataSecondaryCardList = e.data.data.list;
  662. this.paginationAddSecondaryCard = e.data.data.pagination;
  663. this.paginationAddSecondaryCard.pageSize = e.data.data.page_size;
  664. this.paginationAddSecondaryCard.total_count = this.paginationAddSecondaryCard.totalCount;
  665. this.gridData.forEach((item) => {
  666. this.gridDataSecondaryCardList.forEach((row) => {
  667. if (row.id == item.id) {
  668. this.$nextTick(() => {
  669. this.$refs.multipleTableSecondaryCard.toggleRowSelection(row, true);
  670. });
  671. }
  672. })
  673. })
  674. } else {
  675. this.$message.error(e.data.msg);
  676. }
  677. }).catch(e => {
  678. });
  679. },
  680. associationAddSelectedSecondaryCard() {
  681. if (this.gridDataSecondaryCard.length <= 0) {
  682. this.gridDataSecondaryCard = this.multipleSelectionSecondaryCard;
  683. this.multipleSelectionSecondaryCard.forEach((row) => {
  684. this.selectedSecondaryCardIds.push(row.id);
  685. });
  686. } else {
  687. this.gridDataSecondaryCard.forEach((item) => {
  688. this.selectedGoodsIds.push(item.id);
  689. });
  690. this.multipleSelectionSecondaryCard.forEach((row) => {
  691. if (!this.selectedSecondaryCardIds.includes(row.id)) {
  692. this.selectedSecondaryCardIds.push(row.id);
  693. this.gridDataSecondaryCard.push(row);
  694. }
  695. });
  696. }
  697. this.dialogVisibleAssociationAddSecondaryCard = false;
  698. },
  699. handleSelectionChangeSecondaryCard(val) {
  700. this.multipleSelectionSecondaryCard = val;
  701. },
  702. handleAssociationStoreSecondaryCard() {
  703. request({
  704. params: {
  705. r: 'store/client/reserve-staff/handle-association-store-secondary-card',
  706. },
  707. method: 'post',
  708. data: {
  709. secondary_card_ids: this.selectedSecondaryCardIds,
  710. user_id: this.user_id
  711. }
  712. }).then(e => {
  713. if (e.data.code == 0) {
  714. this.$message.success(e.data.msg)
  715. this.dialogVisibleAssociationSecondaryCard = false;
  716. this.selectedSecondaryCardIds = [];
  717. this.user_id = '';
  718. this.page = 1;
  719. this.loadData()
  720. } else {
  721. this.$message.error(e.data.msg);
  722. }
  723. }).catch(e => {
  724. this.$message.error(e.data.msg);
  725. });
  726. },
  727. delFunSecondaryCard(index) {
  728. this.gridDataSecondaryCard.splice(index, 1)
  729. this.selectedSecondaryCardIds.splice(index, 1)
  730. },
  731. }
  732. });
  733. </script>
  734. <style>
  735. .el-tabs__header {
  736. font-size: 16px;
  737. }
  738. .table-body {
  739. padding: 20px;
  740. background-color: #fff;
  741. }
  742. .table-body .el-button {
  743. padding: 0 !important;
  744. border: 0;
  745. margin: 0 5px;
  746. }
  747. .input-item {
  748. width: 250px;
  749. margin: 0 0 20px;
  750. display: inline-block;
  751. }
  752. /*.input-item .el-input__inner {*/
  753. /* border-right: 0;*/
  754. /*}*/
  755. .input-item .el-input__inner:hover {
  756. border: 1px solid #dcdfe6;
  757. /*border-right: 0;*/
  758. outline: 0;
  759. }
  760. .input-item .el-input__inner:focus {
  761. border: 1px solid #dcdfe6;
  762. /*border-right: 0;*/
  763. outline: 0;
  764. }
  765. .input-item .el-input-group__append {
  766. background-color: #fff;
  767. border-left: 0;
  768. width: 10%;
  769. padding: 0;
  770. }
  771. .input-item .el-input-group__append .el-button {
  772. padding: 0;
  773. }
  774. .input-item .el-input-group__append .el-button {
  775. margin: 0;
  776. }
  777. .batch {
  778. margin: 0 0 20px;
  779. display: inline-block;
  780. }
  781. .batch .el-button {
  782. padding: 9px 15px !important;
  783. }
  784. .el-table th>.cell{
  785. color: #333;
  786. font-weight: bold;
  787. font-size: 14px;
  788. }
  789. .el-table__footer-wrapper, .el-table__header-wrapper{
  790. border-bottom: 1.4px solid #D6D6D6;
  791. }
  792. .el-table th>.cell {
  793. color: #333;
  794. font-weight: bold;
  795. font-size: 14px;
  796. }
  797. .table1 .el-table__footer-wrapper,
  798. .table1 .el-table__header-wrapper {
  799. border-bottom: 1.4px solid #D6D6D6;
  800. }
  801. .user_img{
  802. position: relative;
  803. margin-right: 8px;
  804. /* height: 50px;
  805. width: 50px; */
  806. }
  807. .default-avatar{
  808. width: 50px;
  809. height: 50px;
  810. border-radius: 50%;
  811. margin-right: 8px;
  812. }
  813. .uer-nickname {
  814. flex: 1;
  815. }
  816. .v-modal {
  817. z-index: 200 !important;
  818. }
  819. .add-image-btn {
  820. width: 100px;
  821. height: 100px;
  822. color: #419EFB;
  823. border: 1px solid #e2e2e2;
  824. cursor: pointer;
  825. }
  826. .del-btn {
  827. position: absolute;
  828. right: -14px;
  829. top: -14px;
  830. }
  831. .width-300 {
  832. max-width: 320px;
  833. }
  834. .card-covers {
  835. display: grid;
  836. grid-template-columns: repeat(3, 1fr);
  837. grid-gap: 10px;
  838. grid-auto-rows: minmax(100px, auto);
  839. grid-auto-flow: dense;
  840. }
  841. </style>