Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view>
  3. <view class="">
  4. <scroll-view scroll-x class="bg-white nav text-center solid-bottom">
  5. <view class="cu-item" :class="index==TabCur?'text-orange cur':''"
  6. v-for="(item,index) in topTab" :key="index" @tap="tabSelect" :data-id="index">
  7. {{ item }}
  8. </view>
  9. </scroll-view>
  10. <view class="cu-bar search bg-white ">
  11. <view class="action" @tap="showModal" data-target="RadioModal">
  12. <text class="padding-r">{{ selectman }}</text>
  13. <text class="cuIcon-triangledownfill"></text>
  14. </view>
  15. <view class="search-form round">
  16. <text class="cuIcon-search"></text>
  17. <input @focus="InputFocus" @blur="InputBlur" @input='inputSerach'
  18. @confirm = 'Inputconfirm'
  19. :adjust-position="false" type="text"
  20. placeholder="按客户搜索" confirm-type="search"></input>
  21. </view>
  22. </view>
  23. <view class="cu-modal" :class="modalName=='RadioModal'?'show':''" @tap="hideModal">
  24. <view class="cu-dialog" @tap.stop="">
  25. <radio-group class="block" @change="RadioChange">
  26. <view class="cu-list menu text-left">
  27. <view class="cu-item" v-for="(item,index) in salesman" :key="index">
  28. <label class="flex justify-between align-center flex-sub">
  29. <view class="flex-sub">{{ item.username }}</view>
  30. <radio class="round" :class="radio=='radio' + index?'checked':''"
  31. :checked="radio=='radio' + index?true:false"
  32. :value="'' + index"></radio>
  33. </label>
  34. </view>
  35. </view>
  36. </radio-group>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="middle-line-x"></view>
  41. <view class="cu-bar bg-white solid-bottom">
  42. <view class="action">
  43. <text class="cuIcon-title text-orange"></text> 拍照列表
  44. </view>
  45. </view>
  46. <view class="cu-list menu text-left ">
  47. <view class="cu-item text-grey" v-for="(item,index) in list" :key="index">
  48. <view class="content text-cut " @click="ViewImage(item.url)">
  49. <!-- <text class="cuIcon-title text-grey"></text> -->
  50. <text class="text-sm text-black text-bold">{{ item.author }}</text>
  51. <text class="text-grey padding-l text-sm">{{ item.custname }}</text>
  52. </view>
  53. <view class="action">
  54. <text class="cu-tag sm padding-l">{{ item.photoclass }}</text>
  55. <text class="cu-tag sm padding-l">{{ item.photolabels }}</text>
  56. <text class="cu-tag sm padding-l">{{ item.update }}</text>
  57. </view>
  58. </view>
  59. </view>
  60. <!-- <view class="cu-modal" :class="modalName=='Modal'?'show':''">
  61. <view class="cu-dialog">@tap="showModal(item.id)" data-target="Modal"
  62. <view class="cu-bar bg-white justify-end">
  63. <view class="content">Modal标题</view>
  64. <view class="action" @tap="hideModal">
  65. <text class="cuIcon-close text-red"></text>
  66. </view>
  67. </view>
  68. <view class="padding-xl">
  69. Modal 内容。
  70. </view>
  71. </view>
  72. </view> -->
  73. <!-- <unicloud-db v-slot:default="{data, loading, error, options}"
  74. collection="cb-markImages" field="author,custname,update" :getone="false"
  75. where="">
  76. <view>
  77. {{ data}}
  78. </view>
  79. </unicloud-db> -->
  80. </view>
  81. </template>
  82. <script>
  83. import moment from 'moment'
  84. export default {
  85. data() {
  86. return {
  87. user:'',
  88. salesman:'',
  89. selectman:'业务员',
  90. topTab:['本周','本月','今年','所有'],
  91. TabCur: 0,
  92. list:'',
  93. imgList:[],
  94. modalName: null,
  95. radio: '0',
  96. searchParam:{},
  97. }
  98. },
  99. onLoad() {
  100. this.getlist()
  101. this.getUser()
  102. this.GetSalesmanlist()
  103. },
  104. onPullDownRefresh() {
  105. this.getlist()
  106. setTimeout(function () {
  107. uni.stopPullDownRefresh();
  108. }, 1000);
  109. },
  110. methods: {
  111. getUser(){
  112. try{
  113. this.user = uni.getStorageSync('userinfo')
  114. console.log(this.user);
  115. }catch(e){
  116. //TODO handle the exception
  117. }
  118. },
  119. getlist(search={ }){
  120. // promise方式 联表查询
  121. uniCloud.callFunction({
  122. name: 'cbImages',
  123. data: { type: 2,...search }
  124. })
  125. .then(res => {
  126. this.list = res.result.data
  127. // console.log(res.result.data)
  128. console.log('联表查询',this.list)
  129. this.imgList = res.result.data.map(item=>{
  130. return item.url
  131. })
  132. });
  133. },
  134. // 获取业务员
  135. GetSalesmanlist(){
  136. var param = {
  137. interface: "PhotoRecord/GetSalesmanlist",
  138. work:this.user.work,
  139. }
  140. console.log('业务员请求',this.reparam(param));
  141. this.$webSockRe(this.reparam(param),3000).then(res=>{
  142. this.salesman = res.data.data
  143. console.log('业务员列表',res.data.data);
  144. })
  145. },
  146. ViewImage(e) {
  147. console.log('图片路径',e);
  148. uni.previewImage({
  149. urls: this.imgList,
  150. current: e
  151. });
  152. },
  153. tabSelect(e) {
  154. this.TabCur = e.currentTarget.dataset.id;
  155. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
  156. console.log(this.TabCur);
  157. var key = ''
  158. switch (this.TabCur) {
  159. case 0:
  160. key = 'week';
  161. break;
  162. case 1:
  163. key = 'month';
  164. break;
  165. case 2:
  166. key = 'year';
  167. break;
  168. case 3:
  169. key = 'year';
  170. break;
  171. }
  172. var value = moment().startOf(key).format('YYYY-MM-DD HH:mm:ss');
  173. console.log( value );
  174. this.searchParam.type = 5
  175. this.searchParam.time = value
  176. this.getlist(this.searchParam)
  177. },
  178. showModal(e) {
  179. this.modalName = e.currentTarget.dataset.target
  180. console.log(this.modalName)
  181. },
  182. hideModal(e) {
  183. this.modalName = null
  184. },
  185. RadioChange(e) {
  186. this.modalName = null
  187. this.radio = e.detail.value
  188. this.selectman = this.salesman[this.radio].username
  189. console.log('选择的RADIO',this.radio,this.selectman);
  190. // 执行搜索
  191. this.searchParam.type = 3
  192. this.searchParam.key = 'author'
  193. this.searchParam.val = this.selectman
  194. this.getlist(this.searchParam)
  195. },
  196. InputFocus(e){ //聚焦
  197. console.log(e);
  198. },
  199. InputBlur(e){//失焦
  200. console.log(e);
  201. },
  202. inputSerach(e){
  203. // console.log(e.detail.value);
  204. },
  205. Inputconfirm(e){
  206. this.searchParam.type = 4
  207. this.searchParam.key = 'author'
  208. this.searchParam.val = e.detail.value
  209. console.log(e.detail.value);
  210. }
  211. }
  212. }
  213. </script>
  214. <style>
  215. .cu-item{
  216. min-height: 82rpx !important;
  217. }
  218. </style>