index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <oa-scroll
  3. customClass="customManage-container 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. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  14. >
  15. <template #default>
  16. <view class="search-area flex bg-white p10">
  17. <u--input
  18. style="width: 100%"
  19. v-model="projectName"
  20. placeholder="搜索"
  21. prefixIcon="search"
  22. prefixIconStyle="font-size: 22px;color: #909399"
  23. customStyle="height:30px;background-color:#f5f6fa; "
  24. @confirm="selectListApi()"
  25. clearable
  26. ></u--input>
  27. <view class="search-area-buttom ml10" @click="dropdownShow = !dropdownShow">筛选</view>
  28. </view>
  29. <oa-dropdown :dropdownShow="dropdownShow" :closeOnClickOverlay="true" @close="dropdownShow = false">
  30. <template #content>
  31. <u-radio-group v-model="radioValue" placement="column" iconPlacement="right" @change="radioChange">
  32. <u-radio v-for="ra in radioList" :key="ra" :activeColor="proxy.$settingStore.themeColor.color" :label="ra.label" :name="ra.value"></u-radio>
  33. </u-radio-group>
  34. </template>
  35. </oa-dropdown>
  36. <view class="content-area menu-list mlr0" v-for="data in dataList" :key="data">
  37. <view class="list-cell" style="color: #666666; line-height: 30px">
  38. <view class="content-area-top menu-item-box">
  39. <view> {{ data.projectName }} </view>
  40. </view>
  41. <view class="content-area-row_wrap menu-item-box">
  42. <view class="content-area-row_wrap-view"> 项目编号:{{ data.projectId }} </view>
  43. <view class="content-area-row_wrap-view"> 到期时间:{{ data.expireTime ? data.expireTime.split("T")[0] : "" }} </view>
  44. <view class="content-area-row_wrap-view"> 客户负责人:{{ data.customPerson }} </view>
  45. <view class="content-area-row_wrap-view">
  46. 维保费:<span style="color: red">¥{{ data.maintainAmount }}</span>
  47. </view>
  48. <view class="content-area-row_wrap-view">
  49. <view style="margin-right: 5px">客户电话:{{ data.phone }}</view>
  50. <view class="iconfont ucicon-a-copy menu-icon" @click="copy(data.phone)"> </view>
  51. <view class="iconfont ucicon-dial menu-icon" @click="proxy.$common.makePhoneCall(data.phone)"> </view>
  52. </view>
  53. <view class="content-area-row_wrap-view">
  54. <view>状态:</view>
  55. <view :style="`color: ${data.maintainStatus == 1 ? '#16bf00' : 'red'} `"> {{ data.maintainStatus == 1 ? "使用中" : "已到期" }}</view>
  56. </view>
  57. <view class="content-area-row_wrap-view"> 客户地址: {{ data.customAddress }} </view>
  58. <view class="content-area-row_wrap-view">销售负责人:{{ data.salePerson }}</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: "30天内到期",
  83. value: 30,
  84. },
  85. {
  86. label: "60天内到期",
  87. value: 60,
  88. },
  89. {
  90. label: "90天内到期",
  91. value: 90,
  92. },
  93. ],
  94. radioValue: "",
  95. projectName: "",
  96. dropdownShow: false,
  97. });
  98. const { radioList, radioValue, projectName, dropdownShow } = toRefs(data);
  99. /**
  100. * @初始化
  101. */
  102. function init() {
  103. selectListApi();
  104. }
  105. /**
  106. * @列表查询
  107. * @api接口调用
  108. */
  109. function selectListApi() {
  110. crmCustomInfo({
  111. projectName: projectName.value,
  112. current: current.value,
  113. size: pageSize.value,
  114. endTime: radioValue.value ? proxy.$common.getDays(-radioValue.value)[0] + " 00:00:00" : "",
  115. startTime: radioValue.value ? proxy.$common.getDays(-radioValue.value)[1] + " 00:00:00" : "",
  116. }).then((requset) => {
  117. if (requset.status === "SUCCESS") {
  118. dataList.value = requset.data.records;
  119. total.value = requset.data.total;
  120. }
  121. });
  122. }
  123. /**
  124. * @复制粘贴板
  125. */
  126. function copy(value) {
  127. // 触发方法
  128. proxy.$common.uniCopy({
  129. content: value,
  130. success: (res) => {
  131. uni.showToast({
  132. title: res,
  133. icon: "none",
  134. });
  135. },
  136. error: (e) => {
  137. uni.showToast({
  138. title: e,
  139. icon: "none",
  140. duration: 3000,
  141. });
  142. },
  143. });
  144. }
  145. /**
  146. * @单选change事件
  147. */
  148. function radioChange(e) {
  149. radioValue.value = e;
  150. selectListApi();
  151. }
  152. /**
  153. * @scrollView加载数据
  154. */
  155. function load() {
  156. pageSize.value += 10;
  157. selectListApi();
  158. }
  159. /**
  160. * @scrollView刷新数据
  161. */
  162. function refresh() {
  163. radioValue.value = "";
  164. pageSize.value = 20;
  165. total.value = 0;
  166. selectListApi();
  167. }
  168. onLoad((options) => {
  169. init();
  170. });
  171. onReady(() => {});
  172. onShow(() => {
  173. //调用系统主题颜色
  174. proxy.$settingStore.systemThemeColor([1]);
  175. });
  176. // 自定义导航事件
  177. onNavigationBarButtonTap((e) => {
  178. if (e.float == "right") {
  179. }
  180. });
  181. </script>
  182. <style lang="scss" scoped>
  183. :deep(.uni-page-head__title) {
  184. opacity: 1 !important;
  185. }
  186. .customManage-container {
  187. .search-area {
  188. position: relative;
  189. &-buttom {
  190. margin-top: auto;
  191. margin-bottom: auto;
  192. white-space: nowrap;
  193. }
  194. }
  195. .content-area {
  196. &-top {
  197. font-size: 16px;
  198. font-weight: 600;
  199. color: #000000;
  200. }
  201. &-row_wrap {
  202. font-size: 13px;
  203. flex-flow: row wrap;
  204. &-view {
  205. display: flex;
  206. min-width: 50%;
  207. white-space: nowrap;
  208. > .iconfont {
  209. font-size: 14px;
  210. color: #909399;
  211. margin-left: 5px;
  212. }
  213. }
  214. }
  215. }
  216. }
  217. </style>