瀏覽代碼

销售单选源单

于继渤 2 年之前
父節點
當前提交
51f100bf0d

+ 1 - 0
api/pages/common/common.js

@@ -28,6 +28,7 @@ module.exports = {
         getOrg: 'get_org', //业务部门
         getGoodsCategoryNoPage: 'get_goods_category_no_page', //商品种类不带分页 
         getSupplierAndCustomerData: 'get_supplier_and_customer_by_page',
+        getGoodsForOrderByPage: 'get_goods_for_order_by_page', //商品列表
 
     },
     routeUrl: {

+ 4 - 1
api/pages/mst/customer.js

@@ -33,7 +33,10 @@ module.exports = {
       },
       measureTo:{
         key: 'measureTo', url: '/package-basic-data/pages/customer-reception/measure-to/measure-to'
-      }
+      },
+
+      chooseStaff: { key: 'chooseStaff', url: '/package-base-select/pages/select-choose-staff/select-choose-staff'  },
+      chooseOrg: { key: 'chooseOrg',url: '/package-base-select/pages/select-choose-org/select-choose-org' }, 
     }
   }
 };

+ 2 - 1
app.json

@@ -210,7 +210,8 @@
                 "pages/select-warehouse/select-warehouse",
                 "pages/select-account-category/select-account-category",
                 "pages/select-fund-account/select-fund-account",
-                "pages/select-income-category/select-income-category" 
+                "pages/select-income-category/select-income-category" ,
+                "pages/select-source-sale-order/select-source-sale-order" 
             ]
         }
     ],

+ 1 - 1
package-base-select/pages/select-goods/select-goods.js

@@ -63,7 +63,7 @@ Page({
    */
   getData(params) {
     if (this.data.item == Constants.billType.sale) {
-      return this.excute(this.data.service, this.data.service.selectByCond, params);
+      return this.excute(this.data.commonService, this.data.commonService.getGoodsForOrderByPage, params);
     } else if (this.data.item == Constants.billType.out) {
       return this.excute(this.data.inventoryService, this.data.inventoryService.selectByCond, params);
     } else {

+ 66 - 0
package-base-select/pages/select-source-sale-order/select-source-sale-order.js

@@ -0,0 +1,66 @@
+// package-base-select/pages/select-source-sale-order/select-source-sale-order.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
package-base-select/pages/select-source-sale-order/select-source-sale-order.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 2 - 0
package-base-select/pages/select-source-sale-order/select-source-sale-order.wxml

@@ -0,0 +1,2 @@
+<!--package-base-select/pages/select-source-sale-order/select-source-sale-order.wxml-->
+<text>package-base-select/pages/select-source-sale-order/select-source-sale-order.wxml</text>

+ 1 - 0
package-base-select/pages/select-source-sale-order/select-source-sale-order.wxss

@@ -0,0 +1 @@
+/* package-base-select/pages/select-source-sale-order/select-source-sale-order.wxss */

+ 30 - 7
package-basic-data/pages/customer-list/add/add.js

@@ -18,22 +18,24 @@ Page({
   data: {
     routeObjName: 'customer',
     cardList: ['main', 'center', 'remarks'],
-    buttonSaveList:[{code:'add',title:mixins.$t('save'),width:'120rpx'}],
+    buttonSaveList: [{ code: 'add', title: mixins.$t('save'), width: '120rpx' }],
     contentObj: {
       main: [
         { code: 'cusName', type: 'str', required: true, title: mixins.$t('customerName') },
-        { code: 'cusPhone', type: 'phone', title:  mixins.$t('cusPhone') , required: true },
-        { code: 'addressFull', type: 'address', title:  mixins.$t('addressFull') , required: true },
+        { code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone'), required: true },
+        { code: 'addressFull', type: 'address', title: mixins.$t('addressFull'), required: true },
         { code: 'addressNo', type: 'str', required: true, title: mixins.$t('addressNo') },
         { code: 'cusFrom', name: 'cusFromName', type: 'drop', required: true, dropType: 'customerFrom', title: mixins.$t('customerSource') },
-        { code: 'contactName', type: 'str', required: false, title:  mixins.$t('contactName') },
+        { code: 'contactName', type: 'str', required: false, title: mixins.$t('contactName') },
         { code: 'contactPhone', type: 'str', title: mixins.$t('cpPhone'), required: false },
       ],
       center: [
-        { code: 'channelId', name: 'channelName', type: 'drop', required: true, dropType: 'saleChannel', title: mixins.$t('saleChannel') },
-        { code: 'staffId', name: 'staffName', type: 'drop', required: true, dropType: 'staff', title: mixins.$t('saleStaff') },
-        { code: 'orgId', name: 'orgName', type: 'drop', required: true, dropType: 'org', title: mixins.$t('saleOrg') },
+        { code: 'channelId', name: 'channelName', type: 'choose', required: true, title: mixins.$t('saleChannel') },
+        { code: 'staffId', name: 'staffName', type: 'choose', required: true, title: mixins.$t('saleStaff'), urlKey: 'chooseStaff' },
+        { code: 'orgId', name: 'orgName', type: 'choose', required: true, title: mixins.$t('saleOrg'), urlKey: 'chooseOrg' },
         { code: 'initialDebt', type: 'number', required: false, title: mixins.$t('initialDebtOwed') },
+
+
       ],
       remarks: [
         { code: 'remarks', type: 'textarea', title: mixins.$t('remarks') }
@@ -41,7 +43,28 @@ Page({
     },
   },
 
+  /**
+* @desc : 选择数据源
+* @date : 2024/2/1 15:49
+* @author : 于继渤
+*/
+  chooseData(e) {
+    let formData = JSON.parse(this.data.formData)
+    let code = e.detail.code
+    let data = e.detail.data.data
 
+    if (code == "staffId") { //员工
+      formData.staffId = data.id
+      formData.staffName = data.name
+    }
+    if (code == "orgId") { //部门
+      formData.orgId = data.id
+      formData.orgName = data.name
+    }
+    this.setData({
+      formData: JSON.stringify(formData)
+    })
+  },
 
 
   /**

+ 48 - 330
package-sales/pages/sales-outbound/sales-outbound.js

@@ -5,10 +5,8 @@
  *		2.销售出库列表
  * 编辑履历:
  *		作者				日期					版本				修改内容
- *		王英杰		        2022-0-12	            1.00		   	    
+ *		于继渤		 2024-3-25	    1.00		   	    
  *******************************************************************************/
-const Constants = require('@/utils/Constants.js');
-const util = require('@/utils/util.js') 
 const mixins = require('@/mixins/index.js')
 Page({
   mixins: [mixins],
@@ -16,353 +14,73 @@ Page({
    * 页面的初始数据 
    */
   data: {
-    tagList:[{title:"待出库"},{title:"已出库"}],
-    // 查询条件
-    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: "0"
-        },
-        {
-          checked: false,
-          text: "使用收款",
-          value: "1"
-        },
-      ]
-      
-    }, {
-      code: 'choose',
-      title: '类型',
-      searchType: Constants.searchType.switch,
-   
-    }],
-
-    // 查询条件-筛选
-    pullMenuList: [{
-      code: 'outStatus',
-      pullType: 'mSelect',
-      typeName: 'outStatus'
-    }, {
-      code: 'receiveStatus',
-      pullType: 'mSelect',
-      typeName: 'receiveStatus'
-    }, {
-      code: 'designStatus',
-      pullType: 'mSelect',
-      typeName: 'designStatus'
-    }, {
-      code: 'customerFrom',
-      pullType: 'mSelect',
-      typeName: 'customerFrom'
-    }, {
-      code: 'keyType',
-      pullType: 'mSelect',
-      typeName: 'keyType'
-    }, {
-      code: 'delivery_Time',
-      dataType: 'date'
-    }],
-
-    // 假数据
-    dataList: [{
-      salesChannelName: '',
-      customerId: 11,
-      customerName: '张三',
-      displayStatus: '已收款',
-      orderNo: 'SA-LWYD-ZOO-202401300SBG',
-      customerPhone: '15659741980',
-      addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)1',
-      orgName: '零售部',
-      staffName: '薛玉',
-      tsumAmount: 3000,
-      categoryQuantity: '',
-      tsumQuantity: 1,
-      data:'2024-03-12',
-      amont:1009,
-      makeTime: '2024-03-12' 
-    }, {
-      salesChannelName: '',
-      customerName: '李四',
-      displayStatus: '取消',
-      backgroundColor:'red',
-      orderNo: 'SA-LWYD-ZOO-202401300SBD',
-      customerPhone: '15659741980',
-      addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)2',
-      orgName: '零售部',
-      staffName: '薛玉',
-      tsumAmount: 4000,
-      categoryQuantity: '',
-      tsumQuantity: 2,
-      data:'2024-03-12',
-      amont:1009,
-      makeTime: '2024-03-12' 
-    }],
-
+    tagList: [{ title: "全部" }, { title: "待出库" }, { title: "已出库" }],
     // 列表区(脚部金额)
-    footerAmount: {
-      name: 'tsumAmount',
-      title: '共计金额'
-    },
+    footerAmount: { name: 'outAmt', title: '共计金额' },
     // 列表区(脚部信息)
-    footerInfo: [{
-      name: 'categoryQuantity',
-      title: '共计'
-    }, {
-      name: 'tsumQuantity',
-      title: '件'
-    }],
+    footerInfo: [{ name: 'outQty', title: ' 件', prefix: '共计', }],
     // 列表区(内容)
-    contentList: [{
-      name: 'orderNo',
-      title: '出库单号'
-    },{
-      name: 'customerPhone',
-      title: '客户电话'
-    }, {
-      name: 'addressFull',
-      title: '客户地址'
-    }, {
-      name: [{
-        name: 'orgName',
-        title: ''
-      }, {
-        name: 'staffName',
-        title: '业务员'
-      }],
-      title: '门店信息'
-    }, ],
-
+    contentList: [
+      { name: 'outNo', title: '出库单号' },
+      { name: 'cusPhone', title: '客户电话' },
+      { name: 'addressFull', title: '客户地址' },
+      { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员 ' }], title: '门店信息' }
+    ],
     contentObj: {
-      '成交': [{
-        name: 'orderNo',
-        title: '订单单号'
-      } , {
-        name: [{
-          name: 'orgName',
-          title: ''
-        }, {
-          name: 'staffName',
-          title: '业务员'
-        }],
-        title: '客户地址'
-      }],
-      '未成交': [{
-        name: 'orderNo',
-        title: '订单单号'
-      }, {
-        name: 'customerPhone',
-        title: '客户电话'
-      }, {
-        name: [{
-          name: 'orgName',
-          title: ''
-        }, {
-          name: 'staffName',
-          title: '业务员'
-        }],
-        title: '客户地址'
-      }]
+      '待出库': [
+        { name: 'outNo', title: '出库单号' },
+        { name: 'cusPhone', title: '客户电话' },
+        { name: 'addressFull', title: '客户地址' },
+        { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员 ' }], title: '门店信息' }
+      ],
+      '出库中': [
+        { name: 'outNo', title: '出库单号' },
+        { name: 'cusPhone', title: '客户电话' },
+        { name: 'addressFull', title: '客户地址' },
+        { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员 ' }], title: '门店信息' }
+      ],
+      '已出库': [
+        { name: 'outNo', title: '出库单号' },
+        { name: 'cusPhone', title: '客户电话' },
+        { name: 'addressFull', title: '客户地址' },
+        { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员 ' }], title: '门店信息' }
+      ],
     },
+    buttonSaveList: [{ code: 'add', title: '新建' }],
+    contentSaveList: [{ code: 'need', title: '合计金额', type: 'str' }, { code: 'amount', content: 2000, type: 'number' }],
 
     // 弹出按钮
-    buttonList: [{
-      name: 'customerRefund',
-      title: '出库办理'
-      }, {
-        name: 'customerRefundList',
-        title: '作废'
-      } , {
-        name: 'customerRefundList',
-        title: '打印票据'
-      } 
-     
+    buttonList: [
+      { name: 'salesOutbound', title: '出库办理' },
+      { name: 'merge', title: '打印票据' },
+      { name: '', title: '作废' }
     ],
-
-    totallength: 0, //视图下方提醒数量
-
     // 路由
-    routeObjName: 'customer',
-    active:0
-  },
-   /**
-   * 切换 已出库 未出库
-   */
-  onChangeTabs(e) {
-      let index =   e.detail.detail.index
-      console.log("qeaqwewa", index)
-    console.log("qeaqwewa", e)
-    this.setData({
-      active:index, 
-    })
-     
+    routeObjName: 'outbound',
+    active: 0
   },
   /**
-   * 跳转客户详细
-   */
-  toDetail(e) {
-    if (this.data.active == 0) { // 待出库 明细今入
-    
-      wx.navigateTo({
-        url: './detail/not-outbound-detail?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=outbound-processing',
-      })
-    } else { //已出库明细
-      wx.navigateTo({
-        url: './detail/outbound-detail?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)),
-      })
-    }
-  },
-  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: './add/add',
-    })
-  },
-  /**
-   * @desc : 右上角三个小点 点击回调事件
+   * @desc : 查询
    * @date : 2024/2/1 15:49
-   * @author : 王英杰
+   * @author : 于继渤
    */
-  open(e) {
-     let name = e.detail.name
-     let item = e.detail.item 
-     if(name == 'customerRefund'){  //出库办理
-      wx.navigateTo({
-        url: '/package-sales/pages/order-billing/customer-collection-refund/customer-collection-refund?form='+ encodeURIComponent(JSON.stringify(item)) +'&page=customer-collection' + '&pageIndex=customer-collection',
-      })
-     }
-     if(name == 'customerRefundList'){  //客户退款
-      wx.navigateTo({
-        url: '/package-sales/pages/order-billing/customer-collection/refund-record/refund-record?form='+ encodeURIComponent(JSON.stringify(item)) +'&page=customer-collection',
-      })
-     }
-   
-       
-  
+  getData(params) {
+    return this.excute(this.data.service, this.data.service.selectByCond, params);
   },
   /**
-   * @desc : 校验
+   * @desc : 处理查询数据
    * @date : 2024/2/1 15:49
-   * @author : 周兴
+   * @author : 于继渤
    */
-  openValidData(item, name) {
-    console.log('item', item, name, item.customerId);
-    if (!item.customerId) {
-      wx.showToast({
-        title: '无此联系人,或陌生接待',
-        icon: 'none'
+  handleSearchData(tableData) {
+    if (tableData && tableData.length > 0) {
+      tableData.forEach(res => {
+        res.collectStatus = 'noCollect'
       })
-      return false;
     }
-    return true;
-  },
-
-  /**
-   * @desc : 查询
-   * @date : 2024/2/1 15:49
-   * @author : 周兴
-   */
-  getData(params) {
-    console.log('fff', 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
-
+      tableData: tableData
     })
+  }
 
-
-
-
-    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()
-    }
-  },
 })

+ 4 - 6
package-sales/pages/sales-outbound/sales-outbound.wxml

@@ -9,16 +9,14 @@
   <dk-tabs active="{{active}}" list="{{tagList}}" bind:onChange="onChangeTabs">    </dk-tabs>
 </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>
+<dk-list  list="{{tableData}}" flgSubFormatDate="{{true}}" titleCorner="salesChannelName" title="cusName" collectCol="outAmt"  status="outStatusName" subTitle="makeTime" content="{{contentList}}" contentObj="{{contentObj}}"  footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" bind:toStatus="toStatus" collectName="收款"  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>
+
+<view style="height: 200rpx;"></view>
 
 
 
 <!-- 新建按钮 -->
-<dk-save-bottom   flagTypeName="customer-collection" 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>