index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <oa-scroll
  3. class="scroll-height"
  4. :pageSize="pageSize"
  5. :total="total"
  6. :refresherLoad="true"
  7. :refresherEnabled="true"
  8. :refresherDefaultStyle="'none'"
  9. :refresherThreshold="44"
  10. :refresherBackground="'#f5f6f7'"
  11. @load="load"
  12. @refresh="refresh"
  13. >
  14. <template #default>
  15. <view class="customManage-container" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
  16. <view class="flex bg-white padding-10" style="position: relative">
  17. <u--input
  18. v-model="projectName"
  19. placeholder="搜索"
  20. prefixIcon="search"
  21. prefixIconStyle="font-size: 22px;color: #909399"
  22. customStyle="height:30px;background-color:#f5f6fa;"
  23. @confirm="selectListApi()"
  24. clearable
  25. ></u--input>
  26. <view class="margin-l-10" style="margin-top: auto; margin-bottom: auto" @click="dropdownShow = !dropdownShow">筛选</view>
  27. </view>
  28. <view class="dropdown" :class="dropdownShow ? 'show' : 'none'">
  29. <view class="padding-10">
  30. <u-radio-group v-model="radioValue" placement="column" iconPlacement="right" @change="radioChange">
  31. <u-radio v-for="ra in radioList" :key="ra" :activeColor="proxy.$settingStore.themeColor.color" :label="ra.label" :name="ra.value"></u-radio>
  32. </u-radio-group>
  33. </view>
  34. </view>
  35. <view class="dropdown" :class="dropdownShow ? 'mask' : 'none'" @click="dropdownShow = !dropdownShow"> </view>
  36. <view class="container-area menu-list margin-lr-0" v-for="data in dataList" :key="data">
  37. <view class="list-cell" style="color: #666666; line-height: 30px">
  38. <view class="menu-item-box" style="font-size: 16px; font-weight: 600">
  39. <view> {{ data.projectName }} </view>
  40. </view>
  41. <view class="menu-item-box" style="font-size: 13px">
  42. <view style="width: 50%"> 项目编号:{{ data.projectId }} </view>
  43. <view style="width: 50%"> 到期时间:{{ data.expireTime ? data.expireTime.split("T")[0] : "" }} </view>
  44. </view>
  45. <view class="menu-item-box" style="font-size: 13px">
  46. <view style="width: 50%"> 客户负责人:{{ data.customPerson }} </view>
  47. <view style="width: 50%"> 维保费:¥{{ data.maintainAmount }} </view>
  48. </view>
  49. <view class="menu-item-box" style="font-size: 13px">
  50. <view style="width: 50%; display: flex">
  51. 客户电话:{{ data.phone }}
  52. <view class="iconfont ucicon-a-copy menu-icon" style="font-size: 14px; color: #909399; margin-left: 5px" @click="copy(data.phone)"> </view>
  53. </view>
  54. <view style="width: 50%"> 状态:{{ data.maintainStatus == 1 ? "使用中" : "已到期" }} </view>
  55. </view>
  56. <view class="menu-item-box" style="font-size: 13px">
  57. <view> 客户地址:{{ data.customAddress }} </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. </oa-scroll>
  64. </template>
  65. <script setup>
  66. import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
  67. import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
  68. import { publicStores, useStores } from "@/store/modules/index";
  69. import { crmCustomInfo } from "@/api/common/customManage.js";
  70. const { proxy } = getCurrentInstance();
  71. const dataList = ref([]);
  72. const pageSize = ref(20);
  73. const current = ref(1);
  74. const total = ref(0);
  75. const data = reactive({
  76. radioList: [
  77. {
  78. label: "全部",
  79. value: "",
  80. },
  81. {
  82. label: "7天",
  83. value: 7,
  84. },
  85. {
  86. label: "30天",
  87. value: 30,
  88. },
  89. {
  90. label: "90天",
  91. value: 90,
  92. },
  93. ],
  94. radioValue: "",
  95. startTime: "",
  96. endTime: "",
  97. projectName: "",
  98. dropdownShow: false,
  99. });
  100. const { radioList, radioValue, startTime, endTime, projectName, dropdownShow } = toRefs(data);
  101. /**
  102. * @初始化
  103. */
  104. function init() {
  105. selectListApi();
  106. }
  107. /**
  108. * @列表查询
  109. * @api接口调用
  110. */
  111. function selectListApi() {
  112. crmCustomInfo({
  113. projectName: projectName.value,
  114. current: current.value,
  115. size: pageSize.value,
  116. endTime: endTime.value,
  117. startTime: startTime.value,
  118. }).then((requset) => {
  119. if (requset.status === "SUCCESS") {
  120. dataList.value = requset.data.rows;
  121. total.value = requset.data.total;
  122. }
  123. });
  124. }
  125. /**
  126. * @复制粘贴板
  127. */
  128. function copy(value) {
  129. // 触发方法
  130. proxy.$common.uniCopy({
  131. content: value,
  132. success: (res) => {
  133. uni.showToast({
  134. title: res,
  135. icon: "none",
  136. });
  137. },
  138. error: (e) => {
  139. uni.showToast({
  140. title: e,
  141. icon: "none",
  142. duration: 3000,
  143. });
  144. },
  145. });
  146. }
  147. /**
  148. * @单选change事件
  149. */
  150. function radioChange(e) {
  151. radioValue.value = e;
  152. if (e) {
  153. let getDays = proxy.$common.getDays(e);
  154. startTime.value = getDays.startTime;
  155. endTime.value = getDays.endTime;
  156. }
  157. selectListApi();
  158. }
  159. /**
  160. * @scrollView加载数据
  161. */
  162. function load() {
  163. pageSize.value += 10;
  164. selectListApi();
  165. }
  166. /**
  167. * @scrollView刷新数据
  168. */
  169. function refresh() {
  170. radioValue.value = "";
  171. startTime.value = "";
  172. endTime.value = "";
  173. pageSize.value = 20;
  174. total.value = 0;
  175. selectListApi();
  176. }
  177. onLoad((options) => {
  178. init();
  179. });
  180. onReady(() => {});
  181. onShow(() => {
  182. //调用系统主题颜色
  183. proxy.$settingStore.systemThemeColor([1]);
  184. });
  185. // 自定义导航事件
  186. onNavigationBarButtonTap((e) => {
  187. if (e.float == "right") {
  188. }
  189. });
  190. </script>
  191. <style lang="scss" scoped>
  192. :deep(.uni-page-head__title) {
  193. opacity: 1 !important;
  194. }
  195. .customManage-container {
  196. .container-area {
  197. }
  198. .dropdown {
  199. position: absolute;
  200. width: 100%;
  201. background-color: #fff;
  202. max-height: 0;
  203. overflow: hidden;
  204. z-index: 90;
  205. &.show {
  206. animation: dropdown 3s ease forwards;
  207. }
  208. &.mask {
  209. position: fixed;
  210. top: 0;
  211. left: 0;
  212. right: 0;
  213. bottom: 0;
  214. background-color: transparent;
  215. max-height: 100%;
  216. z-index: 50;
  217. }
  218. }
  219. @keyframes dropdown {
  220. from {
  221. max-height: 0;
  222. }
  223. to {
  224. max-height: 100%;
  225. }
  226. }
  227. }
  228. </style>