Browse Source

经销商选择范围修改

xiaohaizhao 2 years ago
parent
commit
1f2b52fe4a

+ 24 - 23
Eservice/saler/agentList/index.js

@@ -6,25 +6,26 @@ Page({
    * 页面的初始数据
    */
   data: {
-    param:{
-      "id": "20221216145803",
-      "version":1,
+    param: {
+      "id": "20220920083901",
       "content": {
-        "pageSize":20,
-        "pageNumber":1,
-        "where":{
-          "condition":""
+        nocache: true,
+        "pageSize": 20,
+        "pageNumber": 1,
+        "where": {
+          "condition": "",
+          type: 9
         }
       }
     },
-    list:[]
+    list: []
   },
-  async listData () {
+  async listData() {
     const res = await api._post(this.data.param)
-
+    console.log(res)
     if (res.data.length > 0) {
       this.setData({
-        list:this.data.list.concat(res.data)
+        list: this.data.list.concat(res.data)
       })
     } else {
       wx.showToast({
@@ -34,7 +35,7 @@ Page({
       })
     }
   },
-  onSubmit (data) {
+  onSubmit(data) {
     this.data.param.content.where.condition = data.detail.value
     this.data.list = []
     this.data.param.content.pageNumber = 1
@@ -46,32 +47,32 @@ Page({
     this.data.param.content.pageNumber = 1
     this.listData()
   },
-  onClick (data) {
+  onClick(data) {
     let item = data.currentTarget.dataset.item
     let form = getApp().globalData.formData
     form.data.formLayoutData.formInfo.unshift({
-      label: '经销商',//标题
+      label: '经销商', //标题
       type: 'cell', //表单类型 text,upload,picker,datepicker
-      id: 'enterprisename',   //表单id
-      placeholder: '',//设置文本框默认提示
-      inputValue:item.enterprisename,
+      id: 'enterprisename', //表单id
+      placeholder: '', //设置文本框默认提示
+      inputValue: item.enterprisename,
       data: [], //填充表单的数据 例如下拉框
       role: {
         type: 'reg',
       },
-      force: false,//是否必输入
+      force: false, //是否必输入
     })
-    form.data.formLayoutData.formInfo.forEach(e=>{
-      if (e.id === 'sys_enterpriseid' ) {
+    form.data.formLayoutData.formInfo.forEach(e => {
+      if (e.id === 'sys_enterpriseid') {
         e.inputValue = item.sys_enterpriseid
       }
     })
     form.setData({
-      formLayoutData:form.data.formLayoutData
+      formLayoutData: form.data.formLayoutData
     })
 
     wx.navigateBack({
-      delta:0
+      delta: 0
     })
   },
   /**
@@ -122,7 +123,7 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom() {
-    this.data.param.content.pageNumber ++
+    this.data.param.content.pageNumber++
     this.listData()
   },
 

+ 23 - 27
Eservice/saler/agentList/index.wxml

@@ -1,34 +1,30 @@
 <view class="example-search">
   <t-search model:value="{{value}}" bind:submit="onSubmit" bind:clear="onClear" placeholder="搜索" />
 </view>
-<t-pull-down-refresh
-  value="{{baseRefresh.value}}"
-  loadingProps="{{loadingProps}}"
-  loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}"
-  bind:refresh="onPullDownRefresh"
-  bind:scrolltolower="onReachBottom"
->
-<view style="padding:10px;">
-  <t-card wx:for="{{list}}" wx:key="sa_orderid" data-item="{{item}}" bindtap="onClick">
-    <view style="flex:1" slot="content">
-      <view class="flex-align-center flex-between card__header">
-        <view>
-          <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{item.enterprisename}}</t-tag>
-          <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{item.type}}</t-tag>
+<t-pull-down-refresh value="{{baseRefresh.value}}" loadingProps="{{loadingProps}}" loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" bind:refresh="onPullDownRefresh" bind:scrolltolower="onReachBottom">
+  <view style="padding:10px;">
+    <t-card wx:for="{{list}}" wx:key="sa_orderid" data-item="{{item}}" bindtap="onClick">
+      <view style="flex:1" slot="content">
+        <view wx:if="{{item.type}}" class="flex-align-center flex-between card__header">
+          <view>
+            <t-tag class="mr-5" variant="light" shape="round" theme="primary" size="small">{{item.type}}</t-tag>
+          </view>
         </view>
-      </view>
-      <view class="card__body">
-        <view class="small colorInfo">
-          联系人:{{item.contact}}
-        </view>
-        <view class="small colorInfo">
-          联系电话:{{item.phonenumber}}
-        </view>
-        <view class="small colorInfo">
-          地址:{{item.province}}{{item.city}}{{item.county}}{{item.address}}
+        <view class="card__body">
+          <view class="small ">
+            经销商:{{item.enterprisename ||" --"}}
+          </view>
+          <view class="small colorInfo">
+            联系人:{{item.contact ||" --"}}
+          </view>
+          <view class="small colorInfo">
+            联系电话:{{item.phonenumber ||" --"}}
+          </view>
+          <view class="small colorInfo">
+            地址:{{item.province?item.province+item.city+item.county+item.address: " --"}}
+          </view>
         </view>
       </view>
-    </view>
-  </t-card>
-</view>
+    </t-card>
+  </view>
 </t-pull-down-refresh>

+ 24 - 23
Eservice/workerLeader/agentList/index.js

@@ -6,25 +6,26 @@ Page({
    * 页面的初始数据
    */
   data: {
-    param:{
-      "id": "20221216145803",
-      "version":1,
+    param: {
+      "id": "20220920083901",
       "content": {
-        "pageSize":20,
-        "pageNumber":1,
-        "where":{
-          "condition":""
+        nocache: true,
+        "pageSize": 20,
+        "pageNumber": 1,
+        "where": {
+          "condition": "",
+          type: 9
         }
       }
     },
-    list:[]
+    list: []
   },
-  async listData () {
+  async listData() {
     const res = await api._post(this.data.param)
 
     if (res.data.length > 0) {
       this.setData({
-        list:this.data.list.concat(res.data)
+        list: this.data.list.concat(res.data)
       })
     } else {
       wx.showToast({
@@ -34,44 +35,44 @@ Page({
       })
     }
   },
-  onSubmit (data) {
+  onSubmit(data) {
     this.data.param.content.where.condition = data.detail.value
     this.data.list = []
     this.data.param.content.pageNumber = 1
     this.listData()
   },
-  onSubmit (data) {
+  onSubmit(data) {
     this.data.param.content.where.condition = ''
     this.data.list = []
     this.data.param.content.pageNumber = 1
     this.listData()
   },
-  onClick (data) {
+  onClick(data) {
     let item = data.currentTarget.dataset.item
     let form = getApp().globalData.formData
     form.data.formLayoutData.formInfo.unshift({
-      label: '经销商',//标题
+      label: '经销商', //标题
       type: 'cell', //表单类型 text,upload,picker,datepicker
-      id: 'enterprisename',   //表单id
-      placeholder: '',//设置文本框默认提示
-      inputValue:item.enterprisename,
+      id: 'enterprisename', //表单id
+      placeholder: '', //设置文本框默认提示
+      inputValue: item.enterprisename,
       data: [], //填充表单的数据 例如下拉框
       role: {
         type: 'reg',
       },
-      force: false,//是否必输入
+      force: false, //是否必输入
     })
-    form.data.formLayoutData.formInfo.forEach(e=>{
-      if (e.id === 'sys_enterpriseid' ) {
+    form.data.formLayoutData.formInfo.forEach(e => {
+      if (e.id === 'sys_enterpriseid') {
         e.inputValue = item.sys_enterpriseid
       }
     })
     form.setData({
-      formLayoutData:form.data.formLayoutData
+      formLayoutData: form.data.formLayoutData
     })
 
     wx.navigateBack({
-      delta:0
+      delta: 0
     })
   },
   /**
@@ -122,7 +123,7 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom() {
-    this.data.param.content.pageNumber ++
+    this.data.param.content.pageNumber++
     this.listData()
   },