staffDetail.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view class="container">
  3. <view class="page-block">
  4. <view class="page-title-block">
  5. <view class="title">员工信息</view>
  6. </view>
  7. <view class="content">
  8. <view class="cell flex flex-y-center">
  9. <view class="title-block">
  10. <text>门店</text>
  11. </view>
  12. <view class="desc">
  13. <view class="input-box">{{shop_title}}</view>
  14. </view>
  15. </view>
  16. <view class="cell flex flex-y-center">
  17. <view class="title-block">
  18. <text>员工名称</text>
  19. </view>
  20. <view class="desc">
  21. <view class="input-box">{{info.nickname}}</view>
  22. </view>
  23. </view>
  24. <view class="cell flex flex-y-center">
  25. <view class="title-block">
  26. <text>员工编号</text>
  27. </view>
  28. <view class="desc">
  29. <view class="input-box">{{info.number}}</view>
  30. </view>
  31. </view>
  32. <view class="cell flex flex-y-center">
  33. <view class="title-block">
  34. <text>手机号码</text>
  35. </view>
  36. <view class="desc">
  37. <view class="input-box">{{info.phone}}</view>
  38. </view>
  39. </view>
  40. <view class="cell flex flex-y-center">
  41. <view class="title-block">
  42. <text>密码</text>
  43. </view>
  44. <view class="desc">
  45. <view class="input-box">{{info.pass}}</view>
  46. </view>
  47. </view>
  48. <view class="cell flex flex-y-center">
  49. <view class="title-block">
  50. <text>性别</text>
  51. </view>
  52. <view class="desc">
  53. <view class="input-box">{{info.sex==1?'男':'女'}}</view>
  54. </view>
  55. </view>
  56. <view class="cell flex flex-y-center">
  57. <view class="title-block">
  58. <text>真实姓名</text>
  59. </view>
  60. <view class="desc">
  61. <view class="input-box">{{info.name}}</view>
  62. </view>
  63. </view>
  64. <view class="cell flex flex-y-center">
  65. <view class="title-block">
  66. <text>创建时间</text>
  67. </view>
  68. <view class="desc">
  69. <view class="input-box">{{info.addtime}}</view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view style="height:30rpx;"></view>
  75. <view class="footer-bar" style="height: 100rpx;">
  76. <view class="content flex flex-center" style="height: 100rpx;">
  77. <view class="detail-btn flex flex-center" @click="del" style="border-right: 2rpx solid #F4F5F7;">
  78. <image src="./static/images/icon_16.png" mode="aspectFit" class="btn-icon"></image>
  79. <view style="color:#999999">删除员工</view>
  80. </view>
  81. <view class="detail-btn flex flex-center" @click="enit">
  82. <image src="./static/images/icon_17.png" mode="aspectFit" class="btn-icon"></image>
  83. <view style="color:#3387FF">重新编辑</view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. export default {
  91. data() {
  92. return {
  93. info: {},
  94. type:2,
  95. store_id:'',
  96. id:'',
  97. admin_id:'',tableTypeList:[],shop_title:''
  98. }
  99. },
  100. onLoad(e) {
  101. this.store_id = uni.getStorageSync("store_id");
  102. this.admin_id = uni.getStorageSync("admin_id");
  103. this.id = e.id;
  104. this.type=e.type || 2;
  105. this.shop_store_index();
  106. },
  107. methods: {
  108. shop_store_index() {
  109. this.request({
  110. url: 'Smdcshop/shop_store_index',
  111. data: {
  112. admin_id:this.admin_id,
  113. }
  114. }).then(res => {
  115. if (res.code == 200) {
  116. this.tableTypeList = res.data;
  117. this.getData(this.id)
  118. }
  119. })
  120. },
  121. enit() {
  122. let info = this.info;
  123. uni.redirectTo({
  124. url: `./staffAdd?id=${info.id}&type=${this.type}`
  125. })
  126. },
  127. del() {
  128. uni.showModal({
  129. title: '提示',
  130. content: '是否要删除?',
  131. showCancel: true,
  132. cancelText: '取消',
  133. confirmText: '确定',
  134. success: res => {
  135. if (res.confirm) {
  136. this.request({
  137. url: 'Smdcshop/staff_delect',
  138. data: {
  139. id: this.id,
  140. },
  141. }).then(res => {
  142. console.log(res, "res")
  143. if (res.code === 200 || res.code === "200") {
  144. uni.showToast({
  145. title:res.message,
  146. icon: "none",
  147. })
  148. setTimeout(() => {
  149. uni.navigateBack()
  150. }, 2000)
  151. }
  152. }).catch((res) => {
  153. uni.showToast({
  154. title: res.message,
  155. icon: "none",
  156. })
  157. });
  158. }
  159. },
  160. fail: () => {},
  161. complete: () => {}
  162. });
  163. },
  164. getData(id) {
  165. this.request({
  166. url: 'Smdcshop/staff_info',
  167. data: {
  168. id: id
  169. }
  170. }).then(res => {
  171. if (res.code == "200") {
  172. this.info = res.data;
  173. if(this.tableTypeList.length>0){
  174. for (let i of this.tableTypeList) {
  175. if (i.id == Number(res.data.storeid)) {
  176. this.shop_title = i.title;
  177. }
  178. }
  179. }
  180. }
  181. })
  182. }
  183. }
  184. }
  185. </script>
  186. <style>
  187. @import url("./static/css/common.css");
  188. page {
  189. background-color: #F4F5F7;
  190. }
  191. </style>