userDetailsTemp.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <template>
  2. <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
  3. <div class="contentx" v-if="item!=null" >
  4. <div class="desct">
  5. 基本信息
  6. </div>
  7. <el-descriptions title="" :column="3" border>
  8. <el-descriptions-item label="会员id" >
  9. <span v-if="item!=null">{{item.userId}}</span>
  10. </el-descriptions-item>
  11. <el-descriptions-item label="用户昵称" >
  12. <span v-if="item!=null">{{item.nickName}}</span>
  13. </el-descriptions-item>
  14. <el-descriptions-item label="用户头像" >
  15. <el-image v-if="item.avatar!=null"
  16. style="width: 50px;"
  17. :src="item.avatar">
  18. </el-image>
  19. </el-descriptions-item>
  20. <el-descriptions-item label="手机号码" >
  21. <span v-if="item!=null">{{item.phone}}</span>
  22. </el-descriptions-item>
  23. <el-descriptions-item label="用户积分" >
  24. <span v-if="item!=null">{{item.integral}}</span>
  25. </el-descriptions-item>
  26. <el-descriptions-item label="状态" >
  27. <span v-if="item!=null">
  28. <dict-tag :options="userOptions" :value="item.status"/>
  29. </span>
  30. </el-descriptions-item>
  31. <el-descriptions-item label="上级昵称" >
  32. <span v-if="item!=null">{{item.tuiName}}</span>
  33. </el-descriptions-item>
  34. <el-descriptions-item label="上级手机号码" >
  35. <span v-if="item!=null">{{item.tuiPhone}}</span>
  36. </el-descriptions-item>
  37. <el-descriptions-item label="推广员关联时间" >
  38. <span v-if="item!=null">{{item.tuiTime}}</span>
  39. </el-descriptions-item>
  40. <el-descriptions-item label="下级人数" >
  41. <span v-if="item!=null">{{item.tuiUserCount}}</span>
  42. </el-descriptions-item>
  43. <el-descriptions-item label="最后一次登录ip" >
  44. <span v-if="item!=null">{{item.lastIp}}</span>
  45. </el-descriptions-item>
  46. <el-descriptions-item label="余额" >
  47. <span v-if="item!=null">{{item.balance}}</span>
  48. </el-descriptions-item>
  49. <el-descriptions-item label="创建时间" >
  50. <span v-if="item!=null">{{item.createTime}}</span>
  51. </el-descriptions-item>
  52. <el-descriptions-item label="更新时间" >
  53. <span v-if="item!=null">{{item.updateTime}}</span>
  54. </el-descriptions-item>
  55. </el-descriptions>
  56. </div>
  57. <!-- 积分记录 -->
  58. <div class="contentx" v-if="item!=null" >
  59. <div class="desct" style="display: flex; justify-content: space-between; align-items: center;">
  60. <span>用户积分记录</span>
  61. <el-button type="primary" @click="handleIntegralPurchase">积分购</el-button>
  62. </div>
  63. <userIntegralDetails ref="userIntegralDetail" />
  64. </div>
  65. <div class="contentx" v-if="item!=null">
  66. <div class="desct"> 优惠劵领取信息</div>
  67. <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
  68. <el-tab-pane label="全部" name="10"></el-tab-pane>
  69. <el-tab-pane v-for="(item,index) in couponStatusOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
  70. </el-tabs>
  71. <el-table v-loading="loading" :data="userCouponList">
  72. <el-table-column label="优惠劵标题" align="center" prop="title" />
  73. <el-table-column label="券号" align="center" prop="couponCode" />
  74. <el-table-column label="会员昵称" align="center" prop="nickName" />
  75. <el-table-column label="会员电话" align="center" prop="phone" />
  76. <el-table-column label="关联订单ID" align="center" prop="businessId" />
  77. <el-table-column label="订单类型" align="center" prop="businessType">
  78. <template slot-scope="scope">
  79. <dict-tag :options="businessTypeOptions" :value="scope.row.businessType"/>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="状态" align="center" prop="status">
  83. <template slot-scope="scope">
  84. <dict-tag :options="couponStatusOptions" :value="scope.row.status"/>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="领取时间" align="center" prop="createTime" width="180"/>
  88. <el-table-column label="使用时间" align="center" prop="useTime" width="180"/>
  89. </el-table>
  90. <pagination
  91. v-show="total>0"
  92. :total="total"
  93. :page.sync="queryParams.pageNum"
  94. :limit.sync="queryParams.pageSize"
  95. @pagination="getList"
  96. />
  97. </div>
  98. <div class="contentx" v-if="item!=null">
  99. <div class="desct">
  100. <span v-if="patientInfo">
  101. {{ patientInfo }}
  102. </span>
  103. <span v-else>
  104. 患者信息
  105. </span>
  106. </div>
  107. <userPatietDetails ref="userPatietDetail" />
  108. </div>
  109. <div class="contentx" v-if="item!=null" >
  110. <div class="desct">
  111. 用户地址
  112. </div>
  113. <userAddDetails ref="userAddDetail" />
  114. </div>
  115. <div class="contentx" v-if="item!=null" >
  116. <div class="desct">
  117. 用户药品订单
  118. </div>
  119. <userStorerDetails ref="userDetails" />
  120. </div>
  121. <div class="contentx" v-if="item!=null" >
  122. <div class="desct">
  123. 用户问诊订单
  124. </div>
  125. <userInquiryOrderDetails ref="InquiryDetails" />
  126. </div>
  127. <!-- 积分购弹窗 -->
  128. <el-dialog
  129. title="积分购"
  130. :visible.sync="integralPurchaseVisible"
  131. width="60%"
  132. append-to-body
  133. >
  134. <!-- 积分购弹窗 -->
  135. <add-order-dialog
  136. :key="currentUserId + '-' + refreshKey"
  137. :userId="currentUserId"
  138. @closePackage="integralPurchaseVisible = false"
  139. />
  140. </el-dialog>
  141. </div>
  142. </template>
  143. <script>
  144. import { listPatient, getPatient, delPatient, addPatient, updatePatient, exportPatient ,getPatientByUserId} from "@/api/store/patient";
  145. import { listUser, getUser, delUser, addUser, updateUser, exportUser ,getUserAddr} from "@/api/store/user";
  146. import { getListUserCoupon } from "@/api/store/userCoupon";
  147. import userStorerDetails from "../components/userStorerDetails.vue";
  148. import userPatietDetails from "../components/userPatietDetails.vue";
  149. import userInquiryOrderDetails from "../components/userInquiryOrderDetails.vue";
  150. import userAddDetails from "../components/userAddDetails.vue";
  151. import userIntegralDetails from "../components/userIntegralDetails.vue";
  152. import AddOrderDialog from "../../hisStore/integralOrder/addOrder.vue"; // 导入积分购组件
  153. export default {
  154. name: "storedet",
  155. props:["data"],
  156. components: {
  157. userStorerDetails,
  158. userInquiryOrderDetails,
  159. userPatietDetails,
  160. userAddDetails,
  161. userIntegralDetails,
  162. AddOrderDialog // 注册积分购组件
  163. },
  164. data() {
  165. return {
  166. refreshKey: 0, // 每次点击刷新用
  167. patientInfo: process.env.VUE_APP_PATIENT_INFO,
  168. addr:[],
  169. patient:[],
  170. userOptions: [],
  171. statusOptions: [],
  172. sexOptions: [],
  173. pOptions: [],
  174. item:null,
  175. total: 0,
  176. loading: true,
  177. // 积分购相关
  178. integralPurchaseVisible: false,
  179. currentUserId: null,
  180. // 会员优惠券表格数据
  181. userCouponList: [],
  182. queryParams: {
  183. pageNum: 1,
  184. pageSize: 10,
  185. userId: null,
  186. couponId: null,
  187. },
  188. actName:"10",
  189. businessTypeOptions:[],
  190. couponStatusOptions:[],
  191. }
  192. },
  193. created() {
  194. this.getDicts("sys_user_status").then(response => {
  195. this.userOptions = response.data;
  196. });
  197. this.getDicts("sys_company_status").then(response => {
  198. this.statusOptions = response.data;
  199. });
  200. this.getDicts("sys_patient_status").then(response => {
  201. this.pOptions = response.data;
  202. });
  203. this.getDicts("sys_patient_sex").then(response => {
  204. this.sexOptions = response.data;
  205. });
  206. this.getDicts("sys_coupon_business_type").then(response => {
  207. this.businessTypeOptions = response.data;
  208. });
  209. this.getDicts("sys_coupon_status").then(response => {
  210. this.couponStatusOptions = response.data;
  211. });
  212. },
  213. methods: {
  214. // 积分购相关方法
  215. handleIntegralPurchase() {
  216. if (this.item && this.item.userId) {
  217. this.currentUserId = this.item.userId;
  218. this.refreshKey++; // 每次点击都强制刷新
  219. this.integralPurchaseVisible = true;
  220. } else {
  221. this.$message.warning('无法获取用户信息');
  222. }
  223. },
  224. handleCloseIntegralPurchase() {
  225. this.integralPurchaseVisible = false;
  226. this.currentUserId = null;
  227. },
  228. handleClickX(tab, event) {
  229. if(tab.name=="10"){
  230. this.queryParams.status=null;
  231. }else{
  232. this.queryParams.status=tab.name;
  233. }
  234. this.queryParams.pageNum = 1;
  235. this.getList();
  236. },
  237. getList() {
  238. this.loading = true;
  239. getListUserCoupon(this.queryParams).then(response => {
  240. this.userCouponList = response.rows;
  241. this.total = response.total;
  242. this.loading = false;
  243. });
  244. },
  245. getDetails(orderId) {
  246. this.item=null;
  247. getUser(orderId).then(response => {
  248. this.item = response.data;
  249. setTimeout(() => {
  250. this.$refs.userDetails.getUserDetails(orderId);
  251. }, 1);
  252. setTimeout(() => {
  253. this.$refs.InquiryDetails.getInquiryDetails(orderId,1);
  254. }, 1);
  255. setTimeout(() => {
  256. this.$refs.userPatietDetail.getPatList(orderId);
  257. }, 1);
  258. setTimeout(() => {
  259. this.$refs.userAddDetail.getAddList(orderId);
  260. }, 1);
  261. setTimeout(() => {
  262. this.$refs.userIntegralDetail.getIntegralLogs(orderId);
  263. }, 1);
  264. });
  265. this.patient=null;
  266. getPatientByUserId(orderId).then(response => {
  267. this.patient = response.data;
  268. });
  269. getUserAddr(orderId).then(response => {
  270. this.addr = response.data;
  271. });
  272. this.queryParams.userId=orderId;
  273. this.getList();
  274. },
  275. }
  276. }
  277. </script>
  278. <style>
  279. .contentx{
  280. height: 100%;
  281. background-color: #fff;
  282. padding: 0px 20px 20px;
  283. margin: 20px;
  284. }
  285. .el-descriptions-item__label.is-bordered-label{
  286. font-weight: normal;
  287. }
  288. .el-descriptions-item__content {
  289. max-width: 150px;
  290. min-width: 100px;
  291. }
  292. .desct{
  293. padding-top: 20px;
  294. padding-bottom: 20px;
  295. color: #524b4a;
  296. font-weight: bold;
  297. }
  298. </style>