index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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">
  39. <view> {{ data.projectName }} </view>
  40. </view>
  41. <view class="content-area-row_wrap menu-item">
  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 oaIcon-copy menu-item-icon" @click="copy(data.phone)"> </view>
  51. <view class="iconfont oaIcon-dial menu-item-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. /*----------------------------------依赖引入-----------------------------------*/
  67. import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
  68. import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
  69. /*----------------------------------接口引入-----------------------------------*/
  70. import { crmCustomInfo } from "@/api/business/fireIot/customManage.js";
  71. /*----------------------------------组件引入-----------------------------------*/
  72. /*----------------------------------store引入-----------------------------------*/
  73. import { useStores, commonStores } from "@/store/modules/index";
  74. /*----------------------------------公共方法引入-----------------------------------*/
  75. /*----------------------------------公共变量-----------------------------------*/
  76. const { proxy } = getCurrentInstance();
  77. /*----------------------------------变量声明-----------------------------------*/
  78. const dataList = ref([]);
  79. const pageSize = ref(20);
  80. const current = ref(1);
  81. const total = ref(0);
  82. const data = reactive({
  83. radioList: [
  84. { label: "全部", value: "" },
  85. { label: "30天内到期", value: 30 },
  86. { label: "60天内到期", value: 60 },
  87. { label: "90天内到期", value: 90 },
  88. ],
  89. radioValue: "",
  90. projectName: "",
  91. dropdownShow: false,
  92. });
  93. const { radioList, radioValue, projectName, dropdownShow } = toRefs(data);
  94. /**
  95. * @初始化
  96. */
  97. function init() {
  98. selectListApi();
  99. }
  100. /**
  101. * @列表查询
  102. * @api接口调用
  103. */
  104. function selectListApi() {
  105. crmCustomInfo({
  106. projectName: projectName.value,
  107. current: current.value,
  108. size: pageSize.value,
  109. endTime: radioValue.value ? proxy.$time.getDays(-radioValue.value)[0] + " 00:00:00" : "",
  110. startTime: radioValue.value ? proxy.$time.getDays(-radioValue.value)[1] + " 00:00:00" : "",
  111. }).then((requset) => {
  112. if (requset.status === "SUCCESS") {
  113. dataList.value = requset.data.records;
  114. total.value = requset.data.total;
  115. }
  116. });
  117. }
  118. /**
  119. * @复制粘贴板
  120. */
  121. function copy(value) {
  122. // 触发方法
  123. proxy.$common.uniCopy({
  124. content: value,
  125. success: (res) => {
  126. uni.showToast({
  127. title: res,
  128. icon: "none",
  129. });
  130. },
  131. error: (e) => {
  132. uni.showToast({
  133. title: e,
  134. icon: "none",
  135. duration: 3000,
  136. });
  137. },
  138. });
  139. }
  140. /**
  141. * @单选change事件
  142. */
  143. function radioChange(e) {
  144. radioValue.value = e;
  145. selectListApi();
  146. }
  147. /**
  148. * @scrollView加载数据
  149. */
  150. function load() {
  151. pageSize.value += 10;
  152. selectListApi();
  153. }
  154. /**
  155. * @scrollView刷新数据
  156. */
  157. function refresh() {
  158. radioValue.value = "";
  159. pageSize.value = 20;
  160. selectListApi();
  161. }
  162. onLoad((options) => {
  163. init();
  164. });
  165. onReady(() => {});
  166. onShow(() => {
  167. //调用系统主题颜色
  168. proxy.$settingStore.systemThemeColor([1]);
  169. });
  170. // 自定义导航事件
  171. onNavigationBarButtonTap((e) => {
  172. if (e.float == "right") {
  173. }
  174. });
  175. </script>
  176. <style lang="scss" scoped>
  177. :deep(.uni-page-head__title) {
  178. opacity: 1 !important;
  179. }
  180. .customManage-container {
  181. .search-area {
  182. position: relative;
  183. &-buttom {
  184. margin-top: auto;
  185. margin-bottom: auto;
  186. white-space: nowrap;
  187. }
  188. }
  189. .content-area {
  190. &-top {
  191. font-size: 16px;
  192. font-weight: 600;
  193. color: #000000;
  194. }
  195. &-row_wrap {
  196. font-size: 13px;
  197. flex-flow: row wrap;
  198. &-view {
  199. display: flex;
  200. min-width: 50%;
  201. white-space: nowrap;
  202. > .iconfont {
  203. font-size: 16px;
  204. color: #909399;
  205. margin-left: 5px;
  206. }
  207. }
  208. }
  209. }
  210. }
  211. </style>