于继渤 2 лет назад
Родитель
Сommit
60df4130c0

+ 1 - 5
api/pages/sale/order.js

@@ -16,11 +16,7 @@ module.exports = {
   
     routeUrl: {
         order: {
-            // 用name代替url,为了传递params,params和url不能一起使用
-            // add: {key: 'add', url: '/pages/index/index2'},
-          // 客户跟进
-          chooseOrg: { key: 'chooseOrg', url: '/package-basic-data/pages/org/choose-org/choose-org'  },
-          staffAdd: {key: 'add', url: '../staff/add/add'},
+          add: {key: 'add', url: '/package-sales/pages/order-billing/add/add'},
         }
     }
 };

+ 78 - 286
package-sales/pages/order-billing/order-billing.js

@@ -5,7 +5,7 @@
  *		2.订单开单
  * 编辑履历:
  *		作者				日期					版本				修改内容
- *		王英杰		        2022-0-12	            1.00		   	    
+ *		于继渤		        2022-0-12	            1.00		   	    
  *******************************************************************************/
 const Constants = require('@/utils/Constants.js');
 const util = require('@/utils/util.js')
@@ -16,58 +16,50 @@ Page({
    * 页面的初始数据 
    */
   data: {
+    routeObjName: 'order',
     // 查询条件
-    searchContent: [{
-      code: 'createtime',
-      title: '近30天',
-      defaultValue: 5,
-      searchType: Constants.searchType.date
-    }, {
-      code: 'staff',
-      title: '业务员',
-      dropType: 'staff'
-    }, {
-      code: 'orderStatus',
-      title: '审批状态',
-      searchType: Constants.searchType.switch,
-      list: [
-        {
-          checked: true,
-          text: "异常",
-          value: "审-异常"
-        },
-        {
-          checked: true,
-          text: "待审",
-          value: "审-待审"
-        },
-        {
-          checked: true,
-          text: "审批中",
-          value: "审-审中"
-        },
-        {
-          checked: true,
-          text: "通过",
-          value: "审-通过"
-        },
-        {
-          checked: true,
-          text: "拒绝",
-          value: "审-拒绝"
-        },
-        {
-          checked: false,
-          text: "冲正",
-          value: "订单状态-冲正"
-        }
-      ]
-      
-    }, {
-      code: 'choose',
-      title: '筛选',
-      searchType: Constants.searchType.pick
-    }],
+    searchContent: [
+      { code: 'createtime', title: '近30天', defaultValue: 5, searchType: Constants.searchType.date },
+      { code: 'staff', title: '业务员', dropType: 'staff' },
+      {
+        code: 'orderStatus', title: '审批状态', searchType: Constants.searchType.switch,
+        list: [
+          {
+            checked: true,
+            text: "异常",
+            value: "审-异常"
+          },
+          {
+            checked: true,
+            text: "待审",
+            value: "审-待审"
+          },
+          {
+            checked: true,
+            text: "审批中",
+            value: "审-审中"
+          },
+          {
+            checked: true,
+            text: "通过",
+            value: "审-通过"
+          },
+          {
+            checked: true,
+            text: "拒绝",
+            value: "审-拒绝"
+          },
+          {
+            checked: false,
+            text: "冲正",
+            value: "订单状态-冲正"
+          }
+        ]
+      },
+      {
+        code: 'choose', title: '筛选', searchType: Constants.searchType.pick
+      }
+    ],
 
     // 查询条件-筛选
     pullMenuList: [{
@@ -95,69 +87,17 @@ Page({
       dataType: 'date'
     }],
 
-    // 假数据
-    dataList: [{
-      salesChannelName: '零售',
-      customerId: 11,
-      customerName: '张三',
-      displayStatus: '成交',
-      orderNo: 'SA-LWYD-ZOO-202401300SBG',
-      customerPhone: '15659741980',
-      addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)1',
-      orgName: '零售部',
-      staffName: '薛玉',
-      tsumAmount: 3000,
-      categoryQuantity: '',
-      tsumQuantity: 1,
-      makeTime: '2023-1-3',collectStatus:'noCollect',collectAmount:1000
-    }, {
-      salesChannelName: '分销',
-      customerName: '李四',
-      displayStatus: '未成交',
-      orderNo: 'SA-LWYD-ZOO-202401300SBD',
-      customerPhone: '15659741980',
-      addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)2',
-      orgName: '零售部',
-      staffName: '薛玉',
-      tsumAmount: 4000,
-      categoryQuantity: '',
-      tsumQuantity: 2,
-      makeTime: '2023-12-3',collectStatus:'noCollect',collectAmount:1000
-    }],
-
     // 列表区(脚部金额)
-    footerAmount: {
-      name: 'tsumAmount',
-      title: '共计金额'
-    },
+    footerAmount: { name: 'sumAmount', title: '共计金额' },
     // 列表区(脚部信息)
-    footerInfo: [{
-      name: 'categoryQuantity',
-      title: '共计'
-    }, {
-      name: 'tsumQuantity',
-      title: '件'
-    }],
+    footerInfo: [{ name: 'sumQuantity', title: ' 件', prefix: '共计', }],
     // 列表区(内容)
-    contentList: [{
-      name: 'orderNo',
-      title: '订单单号'
-    }, {
-      name: 'customerPhone',
-      title: '客户电话'
-    }, {
-      name: 'addressFull',
-      title: '客户地址'
-    }, {
-      name: [{
-        name: 'orgName',
-        title: ''
-      }, {
-        name: 'staffName',
-        title: '业务员'
-      }],
-      title: '门店信息'
-    }],
+    contentList: [
+      { name: 'orderNo', title: '订单单号' },
+      { name: 'cusPhone', title: '客户电话' },
+      { name: 'addressFull', title: '客户地址' },
+      { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员' }], title: '门店信息' }
+    ],
 
     contentObj: {
       '成交': [{
@@ -201,193 +141,45 @@ Page({
     buttonList: [{
       name: 'closingOrder',
       title: '成交订单'
-      }, {
-        name: 'salesOutbound',
-        title: '销售出库'
-      }, {
-        name: 'saleReturn',
-        title: '销售退货'
-      },
-      {
-        name: 'collection',
-        title: '客户收款'
-      }, {
-        name: 'merge',
-        title: '打印票据'
-      }, {
-        name: '',
-        title: '作废'
-      }
+    }, {
+      name: 'salesOutbound',
+      title: '销售出库'
+    }, {
+      name: 'saleReturn',
+      title: '销售退货'
+    },
+    {
+      name: 'collection',
+      title: '客户收款'
+    }, {
+      name: 'merge',
+      title: '打印票据'
+    }, {
+      name: '',
+      title: '作废'
+    }
     ],
 
-    totallength: 0, //视图下方提醒数量
+    buttonSaveList:[{code:'add',title:'新建'}],
+    contentSaveList:[{code:'need',title:'合计金额',type:'str'},{code:'amount',content:2000,type:'number'}]
 
-    // 路由
-    routeObjName: 'customer',
-  },
-  /**
-   * 跳转客户详细
-   */
-  toDetail(e) {
-    let ID = e.currentTarget.dataset.item.customerId
-    this.setData({
-      selectflag: true
-    })
-    wx.navigateTo({
-      url: './detail/detail?ID=' + ID,
-    })
-  },
-  toTitle(e) {
-    console.log('t1', e);
-  },
-  toStatus(e) {
-    console.log('t2', e);
-  },
-  toPoint(e) {
-    console.log('t3', e);
-    this.setData({
-      showShare: true
-    })
-  },
-  toAdd() {
-    wx.navigateTo({
-      url: '../choose-goods/choose-goods',
-    })
-  },
-  /**
-   * @desc : 右上角三个小点 点击回调事件
-   * @date : 2024/2/1 15:49
-   * @author : 王英杰
-   */
-  open(e) {
-     let name = e.detail.name
-     let item = e.detail.item 
-     if(name == 'closingOrder'){  //成交订单
-      wx.navigateTo({
-        url: './deal/deal?orderId=' + encodeURIComponent(JSON.stringify(item.orderId)) + '&page=orderBillingDeal',
-      })
-     }
-     if(name == 'salesOutbound'){  //销售出库
-      wx.navigateTo({
-        url: '../sales-outbound/add/add?item=' + encodeURIComponent(JSON.stringify(item)),
-      })
-     }
-     if(name == 'saleReturn'){  //销售退货
-      wx.navigateTo({
-        url: '../order-return/select-original-order/select-original-order' ,
-      }) 
-     }
-     if(name == 'collection'){  //客户收款
-      wx.navigateTo({
-        url: './collection-confirm/collection-confirm?type=1&dealFalg=false&page=orderBilling&form=' + JSON.stringify(item) + '&orgId=' + item.orgId,
-      })
-     }
-     if(name == 'merge'){  //打印票据
-      wx.navigateTo({
-        url: './../order-printing/order-printing?orderId=' + item.orderId + "&templateId=" + item.tmId,
-      })
-     }
-  
-  },
-  /**
-   * @desc : 校验
-   * @date : 2024/2/1 15:49
-   * @author : 周兴
-   */
-  openValidData(item, name) {
-    console.log('item', item, name, item.customerId);
-    if (!item.customerId) {
-      wx.showToast({
-        title: '无此联系人,或陌生接待',
-        icon: 'none'
-      })
-      return false;
-    }
-    return true;
   },
 
+
   /**
-   * @desc : 查询
-   * @date : 2024/2/1 15:49
-   * @author : 周兴
-   */
+     * @desc : 加载数据
+     * @author : 于继渤
+     * @date : 2024/1/23 9:16
+     */
   getData(params) {
-    console.log('fff', params);
+    return this.excute(this.data.service, this.data.service.selectByCond, params);
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    //按钮权限
-
-    // let Customer_Follow = common.hasButtonRight(Constants.Customer_Follow) //跟进
-    // let Customer_Follow_Task = common.hasButtonRight(Constants.Customer_Follow_Task) //跟进任务
-    // let Customer_Order = common.hasButtonRight(Constants.Customer_Order) //销售订单
-    // let Customer_Receive = common.hasButtonRight(Constants.Customer_Receive) //客户收款
-    // let Customer_Add = common.hasButtonRight(Constants.Customer_Add) //客户新建
-
-    this.setData({
-      Customer_Follow: true,
-      Customer_Follow_Task: true,
-      Customer_Order: true,
-      Customer_Receive: true,
-      Customer_Add: true
 
-    })
-
-
-
-
-    if (JSON.stringify(options) !== '{}') {
-
-      if (options.frommine) {
-
-        let frommine = JSON.parse(options.frommine)
-        var createtime = this.selectComponent('#createtime');
-        createtime.data.dataDefaultSearch = util.jumpPageDate(frommine.date.value)
-        createtime.data.createTimeType = frommine.date
-
-        let keyType = this.selectComponent('#keyType')
-        let keyTypeList = keyType.data.moreList
-        keyTypeList.forEach(kIt => {
-          if (frommine.keyTypeList) {
-            if (frommine.keyTypeList.some(it => kIt.id === it)) {
-              kIt.infotype = 'info'
-            }
-          }
-        })
-        keyType.setData({
-          moreList: keyTypeList
-        })
-
-        let searchForm = {
-          ...this.data.searchForm
-        }
-        searchForm.keyTypeList = frommine.keyTypeNameList
-
-        this.setData({
-          active: frommine.active,
-          createTimeType: frommine.date,
-          searchForm: searchForm,
-          searchFormNumber: (frommine.keyTypeNameList && frommine.keyTypeNameList.length > 0) ? 1 : null,
-          createTimeSearch: util.jumpPageDate(frommine.date.value),
-          staffIds: frommine.staffId ? [frommine.staffId] : [],
-          staffNames: frommine.staffNames,
-        })
-
-        createtime.init()
-      }
-    } else {
-      // this.searchData()
-    }
-  },
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-    if (this.data.selectflag) {
-      // this.searchData()
-    }
   },
+
 })

+ 3 - 6
package-sales/pages/order-billing/order-billing.wxml

@@ -7,14 +7,11 @@
   </dk-dropdown-menu>
 </van-sticky>
 
-<!-- 暂无数据 -->
-<van-empty wx:if="{{dataList.length<=0}}" description="{{$t['nodata']}}"  />
 
 <!-- 列表区 -->
-<dk-list list="{{dataList}}" titleCorner="salesChannelName" title="customerName"collectCol="collectAmount"  status="displayStatus" subTitle="makeTime" content="{{contentList}}" contentObj="{{contentObj}}"  footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" bind:toStatus="toStatus" bind:toPoint="toPoint" routeObjName="{{routeObjName}}" buttonList="{{buttonList}}"  bind:open="open"></dk-list>
 
-<van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}~</van-divider>
-<view style="height: 135rpx;"></view>
+<dk-list list="{{tableData}}" flgSubFormatDate="{{true}}" titleCorner="channelName" title="cusName" status="orderStatusName" subTitle="makeTime" content="{{contentList}}" collectCol="collectStatus" contentObj="{{contentObj}}" contentCol="" footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" bind:toStatus="toStatus" bind:toPoint="toPoint" routeObjName="{{routeObjName}}" buttonList="{{buttonList}}" bind:open="open"></dk-list>
+<view style="height: 200rpx;"></view>
 
 <!-- 新建按钮 -->
-<dk-save-bottom flagTypeName="customers" submitFlag="{{Customer_Add}}" totallength="{{totallength}}" bind:submit="toAdd" />
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="open"></dk-save-button>