index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <view class="caseInfo_wrap">
  3. <template v-if="clueDetail.id">
  4. <view class="caseInfo_content_wrap">
  5. <view class="caseInfo_title">
  6. <image src="/static/clueDetail/icon-caseInfo.png" mode=""></image>
  7. <text class="info_text">线索基础信息</text>
  8. </view>
  9. <view class="caseInfo_main_wrap">
  10. <template v-if="params.type === '1'">
  11. <view class="Info_item" v-for="(item,index) in caseInfoColumn" :key="item.prop">
  12. <text class="label">{{item.label}}</text>
  13. <text v-if="item.color" class="value highlight" :style="handleStyle(item.color)">
  14. {{clueDetail[item.prop]}}
  15. </text>
  16. <show-real-text :real="clueDetail.telephone" :type='params.type'
  17. v-if="item.prop === 'telephone'"></show-real-text>
  18. <text v-else class="value">{{clueDetail[item.prop]}}</text>
  19. </view>
  20. </template>
  21. <template v-if="params.type === '2'">
  22. <view class="Info_item" v-for="(item,index) in caseInfoColumn" :key="item.prop">
  23. <text class="label">{{item.label}}</text>
  24. <view class="input_wrap" v-if="item.input">
  25. <input v-model="clueDetail[item.prop]" style="text-align: right; padding-right: 10px;"
  26. @blur="updateClueMainInfo" />
  27. </view>
  28. <text v-else-if="item.color" class="value highlight" :style="handleStyle(item.color)">
  29. {{clueDetail[item.prop]}}
  30. </text>
  31. <text v-else class="value">{{clueDetail[item.prop]}}</text>
  32. </view>
  33. </template>
  34. </view>
  35. </view>
  36. </template>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. cloneDeep,
  42. isEqual
  43. } from 'lodash';
  44. const caseInfoColumn = [{
  45. prop: 'name',
  46. label: '姓名',
  47. input: true
  48. },
  49. {
  50. prop: 'telephone',
  51. label: '电话',
  52. input: true
  53. },
  54. {
  55. prop: 'genderTypeCode',
  56. label: '性别',
  57. },
  58. {
  59. prop: 'age',
  60. label: '年龄',
  61. },
  62. {
  63. prop: 'weixin',
  64. label: '微信',
  65. input: true
  66. },
  67. {
  68. prop: 'corporateStatus',
  69. label: '企业号状态',
  70. },
  71. {
  72. prop: 'userDouyinId',
  73. label: '抖音号',
  74. },
  75. {
  76. prop: 'autoAddress',
  77. label: '自动定位城市',
  78. },
  79. {
  80. prop: 'telAddr',
  81. label: '手机号归属地',
  82. },
  83. {
  84. prop: 'createTime',
  85. label: '线索创建时间',
  86. },
  87. {
  88. prop: 'updateTime',
  89. label: '最新修改时间',
  90. },
  91. {
  92. prop: 'address',
  93. label: '详细地址',
  94. },
  95. {
  96. prop: 'remark',
  97. label: '备注',
  98. },
  99. {
  100. prop: 'qq',
  101. label: 'QQ号',
  102. },
  103. {
  104. prop: 'email',
  105. label: '邮箱',
  106. },
  107. {
  108. prop: 'date',
  109. label: '日期',
  110. },
  111. {
  112. prop: 'manualAddressCode',
  113. label: '手动填写地域',
  114. }
  115. ]
  116. export default {
  117. props: {
  118. clueId: {
  119. required: true
  120. },
  121. params: {
  122. type: Object,
  123. required: true
  124. },
  125. },
  126. methods: {
  127. async updateClueMainInfo() {
  128. if (!this.clueDetail.name) {
  129. uni.$u.toast("姓名不能为空");
  130. return;
  131. }
  132. if (!isEqual(this.cloneClueDetail, this.clueDetail)) {
  133. await uni.$u.api.updateClueMainInfo(this.clueDetail);
  134. uni.$u.toast("修改成功");
  135. this.getData();
  136. }
  137. },
  138. async getData() {
  139. const {
  140. data
  141. } = await uni.$u.api.getClueMainInfoById({
  142. id: this.clueId
  143. });
  144. this.clueDetail = data;
  145. this.cloneClueDetail = cloneDeep(data);
  146. }
  147. },
  148. created() {
  149. this.getData();
  150. },
  151. data() {
  152. return {
  153. cloneClueDetail: {},
  154. clueDetail: {},
  155. caseInfoColumn,
  156. }
  157. }
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. .caseInfo_wrap {
  162. min-height: 400px;
  163. .caseInfo_title {
  164. display: flex;
  165. align-items: center;
  166. height: 80rpx;
  167. background: #f4f4f6;
  168. padding-left: 40rpx;
  169. image {
  170. width: 24rpx;
  171. height: 24rpx;
  172. margin-right: 10rpx;
  173. }
  174. .info_text {
  175. font-size: 24rpx;
  176. color: #202020;
  177. }
  178. .tabs_wrap {
  179. display: flex;
  180. .tab_item {
  181. margin-left: 30rpx;
  182. }
  183. }
  184. }
  185. .caseInfo_main_wrap {
  186. .caseCards_list_wrap {
  187. background: #ebf6ff;
  188. margin-bottom: 10rpx;
  189. margin-left: 10rpx;
  190. margin-right: 10rpx;
  191. }
  192. .Info_item {
  193. padding: 18rpx 40rpx;
  194. display: flex;
  195. justify-content: space-between;
  196. .label {
  197. color: #999999;
  198. font-size: 26rpx;
  199. }
  200. .input_wrap {
  201. border-bottom: 1px solid #ddd;
  202. }
  203. .value {
  204. font-size: 26rpx;
  205. color: #202020;
  206. border-radius: 100rpx;
  207. }
  208. .highlight {
  209. font-size: 22rpx;
  210. font-weight: 900;
  211. padding: 6rpx 20rpx;
  212. }
  213. }
  214. }
  215. }
  216. </style>