detail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. <template>
  2. <view>
  3. <view class="head">
  4. <view class="title u-line-1">{{ detail.storename || '' }}</view>
  5. <view class="content">
  6. <view class="left">
  7. <view class="tag-box">
  8. <view v-if="detail.storetype" class="storetype">
  9. {{ detail.storetype }}
  10. </view>
  11. <view v-if="detail.markettype" class="markettype">
  12. {{ detail.markettype }}
  13. </view>
  14. </view>
  15. <view class="row">
  16. <text class="iconfont icon-renyuan-hui" />
  17. <text>
  18. {{ detail.name }}
  19. </text>
  20. <text style="margin-left: 5px;">
  21. {{ detail.phonenumber }}
  22. </text>
  23. </view>
  24. <view class="row">
  25. <text class="iconfont icon-dizhi-hui1" />
  26. {{ getCity(detail) }}
  27. </view>
  28. <view class="row">
  29. 状态:<text :style="{ color: detail.color }">{{ detail.status }}</text>
  30. </view>
  31. </view>
  32. <view class="right">
  33. <u--image :src="detail.cover" :width="tovw(100)" :height="tovw(100)" radius="5">
  34. <template v-slot:loading>
  35. <u-loading-icon color="red"></u-loading-icon>
  36. </template>
  37. </u--image>
  38. </view>
  39. </view>
  40. </view>
  41. <u-tabs :scrollable="false" lineColor="#C30D23" :activeStyle="{ color: '#C30D23', fontWeight: 'bold' }" :list="tabs"
  42. @click="changeCurrent" :current="current" />
  43. <view v-show="current == 0">
  44. <displayCell :showList="showList" :detail="detail" />
  45. <view :style="{ height: detail.status == '审核' ? '30px' : '75px' }" />
  46. </view>
  47. <view v-show="current == 1">
  48. <view class="user-head">
  49. <view class="title">
  50. 门店人员
  51. </view>
  52. <view class="funs">
  53. <view class="item" hover-class="navigator" @click="changeSearchShow">
  54. <text class="iconfont icon-sousuo" />
  55. </view>
  56. <navigator v-if="authOption.includes('storeInsertUser')" class="item" @click="onInsert"
  57. :url="'/store/insert/member?id=' + detail.sa_storeid">
  58. <text class="iconfont icon-xinzeng" />
  59. </navigator>
  60. </view>
  61. </view>
  62. <u-transition :show="searchShow">
  63. <view class="My_search-box">
  64. <My_search :focus="searchShow" :value="content.where.condition" @onSearch="onSearch" />
  65. </view>
  66. </u-transition>
  67. <My_listbox ref="List" @getlist="getList" :bottomHeight="detail.status != '审核' ? 70 : 30">
  68. <user-list :list="list" @onClick="onClick" :isDelete="authOption.includes('storeDeleteUser')"
  69. @onDelete="onDelete" />
  70. </My_listbox>
  71. </view>
  72. <view v-if="detail.status != '审核'" class="footer">
  73. <view class="insert" style="flex:1;" :class="detail.status == '新建' ? '' : 'forbidden'"
  74. @click="detail.status == '新建' ? toEdit() : ''">
  75. 编辑门店信息
  76. </view>
  77. <view v-if="authOption.includes('storeComeUpForReview')" class="invite"
  78. @click="detail.status == '新建' ? submit() : revocation()">
  79. {{ detail.status == '新建' ? '提交门店信息' : '撤回' }}
  80. </view>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import userList from "../../components/userList";
  86. export default {
  87. components: { userList },
  88. data() {
  89. return {
  90. current: 0,
  91. sa_storeid: 0,
  92. detail: {},
  93. tabs: [{ name: "门店详情" }, { name: "门店人员" }],
  94. showList: [],
  95. "content": {
  96. "where": {
  97. "condition": ""
  98. }
  99. },
  100. list: null,
  101. searchShow: false,
  102. authOption: [],
  103. }
  104. },
  105. onLoad(options) {
  106. this.sa_storeid = options.id;
  107. this.content.sa_storeid = options.id;
  108. this.getDetail();
  109. uni.setNavigationBarTitle({
  110. title: '门店信息'
  111. });
  112. let auth = this.getApps('工作台', "/team/team/index");
  113. if (auth) this.authOption = auth.option;
  114. },
  115. onShow() {
  116. setTimeout(() => {
  117. this.$refs.List.setHeight();
  118. }, 300)
  119. },
  120. onUnload() {
  121. delete this.$Http.uploadStoreDetail;
  122. delete this.$Http.uploadUserList;
  123. },
  124. methods: {
  125. changeSearchShow() {
  126. this.searchShow = !this.searchShow;
  127. setTimeout(() => {
  128. this.$refs.List.setHeight();
  129. }, 300)
  130. },
  131. getDetail() {
  132. this.$Http.basic({
  133. "id": "20240410095402",
  134. "content": {
  135. "sa_storeid": this.sa_storeid
  136. }
  137. }).then(res => {
  138. console.log("店铺详情", res)
  139. if (this.cutoff(res.msg)) return;
  140. switch (res.data.status) {
  141. case '提交':
  142. res.data.color = '#009270'
  143. break;
  144. case '审核':
  145. res.data.color = '#095DE0'
  146. break;
  147. default:
  148. res.data.color = '#333333'
  149. break;
  150. }
  151. res.data.cover = res.data.attinfos.length ? this.getSpecifiedImage(res.data.attinfos[0], 'compressed') || uni.getStorageSync("site").logo : uni.getStorageSync("site").logo
  152. this.detail = res.data;
  153. this.showList = [{
  154. label: "门店名称",
  155. key: "storename"
  156. }, {
  157. label: "面积(m²)",
  158. key: "area"
  159. }, {
  160. label: "负责人",
  161. key: "name"
  162. }, {
  163. label: "负责人电话",
  164. key: "phonenumber",
  165. funName: "callPhone"
  166. }, {
  167. label: "负责人账号",
  168. key: "accountno"
  169. }, {
  170. label: "门店售前电话",
  171. key: "sale_phonenmber",
  172. funName: "callPhone"
  173. }, {
  174. label: "门店售后电话",
  175. key: "service_phonenmber",
  176. funName: "callPhone"
  177. }, {
  178. label: "门店类型",
  179. key: 'storetype'
  180. }, {
  181. label: "卖场类型",
  182. key: "markettype"
  183. }, {
  184. label: "门店地址",
  185. value: this.getCity(res.data)
  186. }, {
  187. label: "所属经销商",
  188. key: "enterprisename"
  189. },]
  190. })
  191. },
  192. toEdit() {
  193. this.$Http.uploadStoreDetail = this.getDetail.bind(this);
  194. uni.navigateTo({
  195. url: "/store/insert/store?title=编辑门店信息&data=" + JSON.stringify(this.detail)
  196. })
  197. },
  198. getList(init = false) {
  199. if (this.paging(this.content, init)) return;
  200. this.$Http.basic({
  201. "id": "20240410150702",
  202. content: this.content
  203. }).then(res => {
  204. this.$refs.List.RefreshToComplete()
  205. console.log("获取门店人员列表", res)
  206. this.$refs.List.setHeight();
  207. if (this.cutoff(res.msg)) return;
  208. this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
  209. this.content = this.$refs.List.paging(this.content, res)
  210. })
  211. },
  212. submit() {
  213. let that = this;
  214. uni.showModal({
  215. title: '提交门店信息',
  216. content: '是否确定提交门店信息?',
  217. success: function ({ confirm }) {
  218. if (confirm) that.$Http.basic({
  219. "id": "20240410110302",
  220. "content": {
  221. "sa_storeid": that.detail.sa_storeid
  222. }
  223. }).then(res => {
  224. console.log('提交门店信息', res)
  225. if (that.cutoff(res.msg, '提交成功!')) return;
  226. that.$Http.uploadStoreList && that.$Http.uploadStoreList();
  227. that.getDetail();
  228. })
  229. }
  230. });
  231. },
  232. revocation() {
  233. let that = this;
  234. uni.showModal({
  235. title: '提交门店信息',
  236. content: '是否确定撤回提交门店信息?',
  237. success: function ({ confirm }) {
  238. if (confirm) that.$Http.basic({
  239. "id": "20240410110802",
  240. "content": {
  241. "sa_storeid": that.detail.sa_storeid
  242. }
  243. }).then(res => {
  244. console.log('撤回提交门店信息', res)
  245. if (that.cutoff(res.msg, '撤回提交成功!')) return;
  246. that.$Http.uploadStoreList && that.$Http.uploadStoreList();
  247. that.getDetail();
  248. })
  249. }
  250. });
  251. },
  252. changeCurrent({ index, name }) {
  253. this.current = index;
  254. if (name == '门店人员') {
  255. uni.pageScrollTo({
  256. scrollTop: 0,
  257. duration: 0,
  258. });
  259. if (this.list == null) {
  260. this.getList(true);
  261. } else {
  262. setTimeout(() => {
  263. this.$refs.List.setHeight();
  264. }, 300)
  265. }
  266. }
  267. },
  268. onClick(item) {
  269. uni.navigateTo({
  270. url: '/team/userCenter/personal?id=' + item.sys_enterprise_hrid
  271. });
  272. this.onInsert();
  273. },
  274. onDelete(item) {
  275. this.onInsert();
  276. let that = this;
  277. uni.showModal({
  278. title: '提示',
  279. content: `是否确定将“${item.name}”移除门店?`,
  280. success: ({ confirm }) => {
  281. if (confirm) that.$Http.basic({
  282. "id": "20240410153602",
  283. "content": {
  284. "sa_store_hrids": [
  285. item.sa_store_hrid
  286. ]
  287. }
  288. }).then(res => {
  289. console.log("删除门店成员", res)
  290. if (that.cutoff(res.msg, `移除成员成功`)) return;
  291. that.$Http.uploadUserList();
  292. })
  293. },
  294. })
  295. },
  296. onInsert() {
  297. this.$Http.uploadUserList = function () {
  298. if (this.content.pageNumber && this.content.pageNumber >= 2) {
  299. let content = this.paging(this.content, true, true)
  300. this.$Http.basic({
  301. "id": "20240410150702",
  302. content
  303. }).then(res => {
  304. console.log("更新人员列表", res)
  305. if (this.cutoff(res.msg)) return;
  306. this.$refs.List.setHeight()
  307. this.list = res.data;
  308. this.$refs.List.paging(content, res, true)
  309. })
  310. }
  311. }.bind(this)
  312. },
  313. onSearch(condition) {
  314. this.content.where.condition = condition;
  315. this.getList(true)
  316. }
  317. },
  318. }
  319. </script>
  320. <style lang="scss" scoped>
  321. .head {
  322. width: 100vw;
  323. background: #FFFFFF;
  324. border-radius: 8px;
  325. padding: 10px;
  326. box-sizing: border-box;
  327. margin-bottom: 10px;
  328. .title {
  329. line-height: 24px;
  330. font-family: Source Han Sans SC, Source Han Sans SC;
  331. font-weight: bold;
  332. font-size: 16px;
  333. color: #333333;
  334. }
  335. .content {
  336. position: relative;
  337. .left {
  338. width: 220px;
  339. .tag-box {
  340. display: flex;
  341. .storetype,
  342. .markettype {
  343. font-family: Source Han Sans SC, Source Han Sans SC;
  344. font-size: 12px;
  345. color: #FFFFFF;
  346. height: 24px;
  347. line-height: 24px;
  348. padding: 0 4px;
  349. border-radius: 2px;
  350. margin-top: 5px;
  351. }
  352. .storetype {
  353. background: #095DE0;
  354. }
  355. .markettype {
  356. background: #FC9228;
  357. margin-left: 5px;
  358. }
  359. }
  360. .row {
  361. line-height: 17px;
  362. font-family: Source Han Sans SC, Source Han Sans SC;
  363. font-size: 12px;
  364. color: #888888;
  365. margin-top: 5px;
  366. .iconfont {
  367. margin-right: 5px;
  368. font-size: 12px;
  369. }
  370. }
  371. }
  372. .right {
  373. position: absolute;
  374. right: 0;
  375. bottom: 0;
  376. }
  377. }
  378. }
  379. .user-head {
  380. height: 60px;
  381. width: 100vw;
  382. display: flex;
  383. align-items: center;
  384. justify-content: space-between;
  385. padding: 10px;
  386. box-sizing: border-box;
  387. .title {
  388. font-family: PingFang SC, PingFang SC;
  389. font-weight: 500;
  390. font-size: 16px;
  391. color: #333333;
  392. }
  393. .funs {
  394. display: flex;
  395. .item {
  396. width: 40px;
  397. height: 40px;
  398. text-align: center;
  399. line-height: 40px;
  400. background: #FFFFFF;
  401. border-radius: 4px;
  402. border: 1px solid #CCCCCC;
  403. font-size: 18px;
  404. color: #666666;
  405. margin-left: 10px;
  406. }
  407. }
  408. }
  409. .My_search-box {
  410. padding: 10px;
  411. padding-top: 0px;
  412. }
  413. .footer {
  414. position: fixed;
  415. bottom: 0;
  416. display: flex;
  417. justify-content: space-between;
  418. width: 100vw;
  419. height: 65px;
  420. background: #FFFFFF;
  421. box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
  422. padding: 5px 10px;
  423. box-sizing: border-box;
  424. .insert {
  425. display: flex;
  426. align-items: center;
  427. justify-content: center;
  428. width: 168px;
  429. height: 45px;
  430. background: #FFFFFF;
  431. border-radius: 5px;
  432. border: 1px solid #999999;
  433. font-family: PingFang SC, PingFang SC;
  434. font-size: 16px;
  435. color: #666666;
  436. box-sizing: border-box;
  437. }
  438. .invite {
  439. display: flex;
  440. align-items: center;
  441. justify-content: center;
  442. width: 177px;
  443. height: 45px;
  444. background: #C30D23;
  445. border-radius: 5px;
  446. font-family: PingFang SC, PingFang SC;
  447. font-weight: 500;
  448. font-size: 16px;
  449. color: #FFFFFF;
  450. margin-left: 10px;
  451. }
  452. .forbidden {
  453. opacity: .6;
  454. }
  455. }
  456. </style>