Просмотр исходного кода

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss_wx_app

姜永辉 2 лет назад
Родитель
Сommit
d90f5e8099

+ 49 - 0
components/dkbase/dk-form-bill/dk-form-bill.js

@@ -34,6 +34,55 @@ Component({
     routeObjName: {
       type: String
     },
+    titleTagCol:{
+      type:String,
+      value:'titleTag'
+    },
+    titleCol:{
+      type:String,
+      value:'title'
+    },
+    iconCol:{
+      type:String,
+      value:'iconThumPath'
+    },
+    // 价格列
+    priceCol:{
+      type:String,
+      value:'priceSale'
+    },
+    // 数量列
+    quantityCol:{
+      type:String,
+      value:'itemQuantity'
+    },
+    // 数量列
+    descCol:{
+      type:String,
+      value:'desc'
+    },
+    sumStandardCol:{
+      type:String,
+      value:'sumStandard'
+    },
+    discountStandardCol:{
+      type:String,
+      value:'discountStandard'
+    },
+    sumAmountCol:{
+      type:String,
+      value:'sumAmount'
+    },
+    // 可用收款列
+    canUseCollectCol:{
+      type:String,
+      value:'canUseCollect'
+    },
+    // 收款列
+    useCollectCol:{
+      type:String,
+      value:'useCollect'
+    },
     // 结果集
     value: {
       type: String,

+ 11 - 11
components/dkbase/dk-form-bill/dk-form-bill.wxml

@@ -21,7 +21,7 @@
       <view style="width: 35%;text-align: right;">
         <dk-tag wx:if="{{card.expandFlag}}" type="primary" padding="0 20rpx" height="40rpx" color="#9FAEE5" textColor="#FFFFFF" radius="5rpx" roundFlag="{{true}}" value="{{!card.expand?'展开':'收起'}}" catchtap="expandCard" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
         <!--明细,增加选择商品按钮-->
-        <dk-tag wx:if="{{card.name == 'items'}}" type="primary" padding="0 20rpx" height="40rpx" color="#77C5D5" textColor="#FFFFFF" radius="5rpx" roundFlag="{{true}}" value="{{'选商品'}}" catchtap="openChooseItems" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
+        <dk-tag wx:if="{{card.name == 'items' && (card.chooseGoodsFlag == undefined || card.chooseGoodsFlag)}}" type="primary" padding="0 20rpx" height="40rpx" color="#77C5D5" textColor="#FFFFFF" radius="5rpx" roundFlag="{{true}}" value="选商品" catchtap="openChooseItems" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
       </view>
     </view>
     <view wx:if="{{card.expandFlag && card.expand || !card.expandFlag}}">
@@ -31,26 +31,26 @@
           <van-swipe-cell right-width="{{ 65 }}" data-index="{{index}}" async-close bind:close="onCloseDel">
             <van-card>
               <view slot="thumb" data-item="{{item}}" data-index="{{index}}" data-card="{{card}}" catchtap="openChoosedItemInfo">
-                <van-image radius="5px" width="70" height="70" src="{{item.iconThumPath }}" />
+                <van-image radius="5px" width="70" height="70" src="{{item[iconCol] }}" />
               </view>
               <view slot="title" data-item="{{item}}" data-index="{{index}}" data-card="{{card}}" catchtap="openChoosedItemInfo" style="display: flex;">
                 <view style="display: flex;">
-                  <dk-title titleTag="{{item.titleTag}}" title="{{item.title}}"></dk-title>
+                  <dk-title titleTag="{{item[titleTagCol]}}" title="{{item[titleCol]}}"></dk-title>
                 </view>
               </view>
               <view slot="desc" data-item="{{item}}" data-index="{{index}}" data-card="{{card}}" catchtap="openChoosedItemInfo">
                 <view style="display:flex;width: 100%;">
-                  <dk-text fontWeight="nomal" value="{{item.desc}}"></dk-text>
+                  <dk-text fontWeight="nomal" value="{{item[descCol]}}"></dk-text>
                 </view>
               </view>
               <view slot="price">
                 <view style="display: flex;width: 100%;justify-content: center;align-items: center;">
                   <view style="width: 60%;">
-                    <dk-cell contentFontSize="16" height="25rpx" fontWeight="bold" left="0rpx" contentColor="#CAA977" title="" content="{{ item.priceSale}}"></dk-cell>
+                    <dk-cell contentFontSize="16" height="25rpx" fontWeight="bold" left="0rpx" contentColor="#CAA977" title="" content="{{ item[priceCol]}}"></dk-cell>
                   </view>
                   <view style="width: 40%;text-align: right;">
                     <!-- <van-stepper integer="{{true}}" value="{{item.itemQuantity}}" data-index="{{index}}" min="0" max="999999999" bind:change="changeItemQuantity" /> -->
-                    <dk-text fontWeight="nomal" value="{{'x ' + item.itemQuantity}}"></dk-text>
+                    <dk-text fontWeight="nomal" value="{{'x ' + item[quantityCol]}}"></dk-text>
                   </view>
                 </view>
               </view>
@@ -60,25 +60,25 @@
         </view>
         <view class="amount-item-class" wx:if="{{type === 'sale'}}">
           <!--标价总额-->
-          <dk-cell contentColor="#CAA977" titleColor="#95A8CB;" title="标价总额" content="{{card.sumStandard}}"></dk-cell>
+          <dk-cell contentColor="#CAA977" titleColor="#95A8CB;" title="标价总额" content="{{card[sumStandardCol]}}"></dk-cell>
           <!--标价折扣-->
-          <dk-cell amount="{{false}}" contentColor="#CAA977" titleColor="#95A8CB;" title="标价折扣" content="{{card.discountStandard  +'折'}}"></dk-cell>
+          <dk-cell amount="{{false}}" contentColor="#CAA977" titleColor="#95A8CB;" title="标价折扣" content="{{card[discountStandardCol]  +'折'}}"></dk-cell>
         </view>
 
         <view class="amount-item-class">
           <!--条数-->
           <dk-cell titleColor="#95A8CB;" title="{{$t['together'] + form[itemName].length + $t['bill']}}" amount="{{false}}"></dk-cell>
           <!--标价折扣-->
-          <dk-cell fontSize="16" fontWeight="bold" contentColor="#CAA977" titleColor="#1B365D;" title="合计金额" content="{{card.sumAmount}}"></dk-cell>
+          <dk-cell fontSize="16" fontWeight="bold" contentColor="#CAA977" titleColor="#1B365D;" title="合计金额" content="{{card[sumAmountCol]}}"></dk-cell>
         </view>
 
         <view class="amount-item-class" wx:if="{{type === 'sale'}}">
           <view style="display: flex;">
             <!--使用收款-->
-            <dk-cell contentColor="#95A8CB" titleColor="#95A8CB" title="使用收款(可用" content="{{card.canUseCollect}}"></dk-cell>
+            <dk-cell contentColor="#95A8CB" titleColor="#95A8CB" title="使用收款(可用" content="{{card[canUseCollectCol]}}"></dk-cell>
             <dk-cell left="0rpx" titleColor="#95A8CB" title=")" amount="{{false}}"></dk-cell>
           </view>
-          <dk-cell contentColor="#CAA977" content="{{card.useCollect }}"></dk-cell>
+          <dk-cell contentColor="#CAA977" content="{{card[useCollectCol] }}"></dk-cell>
         </view>
       </view>
       <!--非明细card-->

+ 4 - 2
components/dkbase/dk-form/dk-form.js

@@ -78,10 +78,12 @@ Component({
      */
     show: function () {
       const location = chooseLocation.getLocation();
-      // console.log('loc', location);
       let form = this.data.form
       if (location) {
         form['address'] = location;
+        form['addressName'] = location.name;
+        form['addressFull'] = location.address + location.name;
+        form['addressGcj02'] = { latitude: location.latitude, longitude: location.longitude };
         // 如果有校验信息就清除掉
         let card = this.data.card;
         let index = this.data.index;
@@ -215,7 +217,7 @@ Component({
       })
       // 是否根据值进行控制其他组件显示、隐藏
       let changeObj = this.data.changeObj
-      let key = util.getKeyByValue(Constants.supType, e.detail.value);
+      let key = util.getKeyByValue(Constants.kindCode, e.detail.value);
       if (changeObj && changeObj[key]) {
         // 显示
         if (changeObj[key]['visible']) {

+ 28 - 95
components/dkbusiness/dk-single-dropdown-item/dk-single-dropdown-item.js

@@ -75,14 +75,11 @@ Component({
         }
         // 给类型赋值
         this.setDataSource();
-        // let datalist = this.data.datalist;
         let datalists = this.data.datalists;
         let datalist = datalists[this.data.typeName] || []
-        // if (datalist.length == 0) {
         if (!datalists[this.data.typeName] || datalists[this.data.typeName].length == 0) {
           let DataSourceCode = this.data.DataSourceCode
           let typeName = this.data.typeName
-
           this.getdata(DataSourceCode).then(res => {
             let list = res.data.data
             if (list == null || list.length <= 0) {
@@ -93,18 +90,16 @@ Component({
             }
 
             let datalist = []
-
-            // 品牌
-            if (typeName === 'brand') {
+            // 部门
+            if (typeName === 'org') {
               let nmb = 0
               let nmb_tenter = 0
               list.forEach(item2 => {
                 let item = {
                   id: item2.id,
-                  code: item2.erpOrgCode,
-                  name: item2.name,
+                  code: item2.orgCode,
+                  name: item2.orgName,
                   checked: item2.id == this.properties.contentID ? true : false,
-
                 }
                 nmb_tenter++
                 if (item2.id == this.properties.contentID) {
@@ -118,42 +113,16 @@ Component({
                 labelKey: 'name'
               })
             }
-            // 供应商类别
-            if (typeName === 'supplierType') {
-
-              let nmb = 0
-              let nmb_tenter = 0
-              list.forEach(item2 => {
-                let item = {
-                  id: item2.code,
-                  name: item2.name,
-                  checked: item2.id == this.properties.contentID ? true : false,
-
-                }
-                nmb_tenter++
-                if (item2.id == this.properties.contentID) {
-                  nmb = nmb_tenter
-                }
-                datalist.push(item)
-              })
-              this.setData({
-                radio: this.properties.contentID ? (nmb - 1) : '',
-
-              })
-            }
-            // 业务部门
-            if (typeName === 'org') {
+            // 员工
+            if (typeName === 'staff') {
               let nmb = 0
               let nmb_tenter = 0
               list.forEach(item2 => {
                 let item = {
                   id: item2.id,
-                  code: item2.erpOrgCode,
-                  name: item2.name,
-                  checked: item2.id == this.properties.contentID ? true : false,
-                  //部门默认的销售渠道
-                  salesChannel: item2.salesChannel,
-                  salesChannelName: item2.salesChannelName
+                  code: item2.staffCode,
+                  name: item2.staffName,
+                  checked: item2.id == this.properties.contentID ? true : false
                 }
                 nmb_tenter++
                 if (item2.id == this.properties.contentID) {
@@ -167,19 +136,15 @@ Component({
                 labelKey: 'name'
               })
             }
-            // 员工
-            else if (typeName === 'staff') {
+            //客户来源
+            if (typeName == 'customerFrom') {
               let nmb = 0
               let nmb_tenter = 0
               list.forEach(item2 => {
                 let item = {
                   id: item2.id,
-                  code: item2.erpStaffCode,
-                  name: item2.name,
-                  orgName: item2.orgName,
-                  orgId: item2.orgId,
-                  orgCode: item2.orgCode,
-                  qvUserid: item2.qvUserid,
+                  code: item2.dataCode,
+                  name: item2.dataValue,
                   checked: item2.id == this.properties.contentID ? true : false
                 }
                 nmb_tenter++
@@ -194,15 +159,15 @@ Component({
                 labelKey: 'name'
               })
             }
-            // 角色
-            else if (typeName === 'role') {
+            //销售渠道
+            if (typeName == 'saleChannel') {
               let nmb = 0
               let nmb_tenter = 0
               list.forEach(item2 => {
                 let item = {
                   id: item2.id,
-                  name: item2.name,
-                  code: item2.code,
+                  code: item2.channelCode,
+                  name: item2.channelName,
                   checked: item2.id == this.properties.contentID ? true : false
                 }
                 nmb_tenter++
@@ -212,14 +177,15 @@ Component({
                 datalist.push(item)
               })
               this.setData({
-                radio: this.properties.contentID ? (nmb - 1) : ''
+                radio: this.properties.contentID ? (nmb - 1) : '',
+                valueKey: 'id',
+                labelKey: 'name'
               })
             }
 
             let finallist = [...datalist]
             datalists[this.data.typeName] = [...datalist]
             this.setData({
-              // datalist: datalist,
               datalists: datalists,
               finallist: finallist
             })
@@ -285,14 +251,13 @@ Component({
     setDataSource() {
       let DataSourceCode = ''
       let typeName = this.data.typeName
-      let docName = this.data.docName
-      let name = ''
-      if (typeName === 'other') {
-        DataSourceCode = '商品规格其他分类'
-        name = '其他分类'
+      let name =''
+      if (typeName === 'customerFrom') {
+        DataSourceCode = 'customerFrom'
+        name = '客户来源'
       }
-      if (typeName === 'salesChannel') {
-        DataSourceCode = 'salesChannel'
+      if (typeName === 'saleChannel') {
+        DataSourceCode = 'saleChannel'
         name = '销售渠道'
       }
 
@@ -300,30 +265,10 @@ Component({
         DataSourceCode = 'org'
         name = '业务部门'
       }
-      if (typeName === 'role') {
-        DataSourceCode = 'role'
-        name = '所属角色'
-      }
       //业务员
       if (typeName === 'staff') {
         DataSourceCode = 'staff'
-        name = '业务员'
-      }
-      if (typeName === 'warehouse') {
-        DataSourceCode = 'warehouse'
-        name = '库区'
-      }
-      if (typeName === 'brand') {
-        DataSourceCode = 'brand'
-        name = '品牌'
-      }
-      if (typeName === 'rejectReasonType') {
-        DataSourceCode = 'rejectReasonType'
-        name = '退货类别'
-      }
-      if (typeName === 'supplierType') {
-        DataSourceCode = 'supplierType'
-        name = '供应商类别'
+        name = '员工'
       }
       this.setData({
         DataSourceCode: DataSourceCode
@@ -337,19 +282,7 @@ Component({
       let param = {
         dataSourceCode: DataSourceCode
       }
-      param.cpId = 1
-      let SELECT_API = 'get_wx_init_data'
-      if (DataSourceCode === 'org' || DataSourceCode === 'staff' || DataSourceCode === 'warehouse' || DataSourceCode === 'estate' || DataSourceCode === 'deliveryType') {
-        if (DataSourceCode === 'warehouse') {
-          param.orgId = this.data.orgId ? this.data.orgId : app.globalData.user.orgId
-        }
-        if (DataSourceCode === 'org' || DataSourceCode === 'staff' || DataSourceCode === 'brand') {
-          param.docName = this.data.docName
-          if (DataSourceCode === 'staff' && this.data.jobIds && this.data.jobIds.length > 0) {
-            param.jobIds = this.data.jobIds
-          }
-        }
-      }
+      let SELECT_API = 'get_init_data'
       return new Promise((resolve, reject) => {
         api.request(Constants.BASIC_COMMON_API + SELECT_API, 'POST', param).then(res => {
           if (res.data.code === 200) {

+ 1 - 0
components/dkbusiness/dk-single-dropdown-item/dk-single-dropdown-item.wxml

@@ -13,6 +13,7 @@
         <van-radio-group value="{{ radio }}" bind:change="onChange">
           <van-radio wx:for="{{datalists[typeName]}}" shape="round" icon-size="16px"  data-index="{{index}}" data-id="{{item.id}}" name="{{index}}" custom-class="custom-class" checked-color="#1B365D" label-class="{{(radio != nul && radio==index)?'label-checked-class':'label-class'}}">{{item.name}}
           </van-radio>
+          {{item}}
         </van-radio-group>
 
         <!-- <view wx:for="{{datalist}}" catchtap="clickcheckitem" class="checkbos_padding" data-index="{{index}}" data-id="{{item.id}}">

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

@@ -29,7 +29,7 @@ Page({
         { code: 'contactPhone', type: 'phone', title: '联系电话', required: false },
       ],
       center:[
-        { code: 'orgId', name: 'orgName', type: 'drop', required: true, dropType: 'org',title:'销售渠道' },
+        { code: 'channelId', name: 'channelName', type: 'drop', required: true, dropType: 'saleChannel',title:'销售渠道' },
         { code: 'staffId', name: 'staffName', type: 'drop', required: true, dropType: 'staff',title:'销售人员' },
         { code: 'orgId', name: 'orgName', type: 'drop', required: true, dropType: 'org',title:'销售部门' },
         { code: 'addressNo', type: 'str', required: false, title:'初次欠款' },

+ 14 - 3
package-purchase/pages/purchase-return/detail/detail.js

@@ -7,10 +7,21 @@ Page({
    * 页面的初始数据
    */
   data: {
-    goodsRejectedAmount:0,
-    afterGoodsRejectedAmount:0,
+    goodsRejectedAmount: 0,
+    afterGoodsRejectedAmount: 0,
+    pageFlag: false,
+    tableData: [],
+    // 路由
+    routeObjName: 'intoReturnItem'
+  },
+  /**
+   * @desc :   加载数据源
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  getData(params) {
+    return this.excute(this.data.service, this.data.service.selectByCond, params);
   },
-
   /**
    * 生命周期函数--监听页面加载
    */

+ 2 - 2
package-purchase/pages/purchase-return/detail/detail.wxml

@@ -87,10 +87,10 @@
     <view wx:for="{{tableData}}" wx:key="index" border="{{ true }}">
       <van-card wx:if="{{index < 2  || collapseFlag}}">
         <view slot="thumb" data-item="{{item}}" data-index="{{index}}" bind:tap="openChoosedItemInfo">
-          <van-image radius="5px" width="80" height="80" src="{{item.iconPath }}" />
+          <van-image radius="5px" width="80" height="80" src="{{item.skuImages? item.skuImages.path : ''}}" />
         </view>
         <view slot="title" data-item="{{item}}" data-index="{{index}}" bind:tap="openChoosedItemInfo">
-          <dk-title titleTag="{{item.brandName}}" title="{{item.skuCode}}"></dk-title>
+          <dk-title titleTag="{{'HEGII'}}" title="{{item.skuCode}}"></dk-title>
         </view>
         <view slot="desc" data-item="{{item}}" data-index="{{index}}" bind:tap="openChoosedItemInfo">
           <dk-text value="{{item.skuName}}"></dk-text>

+ 1 - 1
package-purchase/pages/purchase-return/purchase-return.js

@@ -52,7 +52,7 @@ Page({
       url: this.data.route.detail.url,
       success: function (res) {
         // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
-        res.eventChannel.emit('params', { id: item.returnId, formMode: Constants.formMode.edit,item:item })
+        res.eventChannel.emit('params', { id: item.returnId, formMode: Constants.formMode.index,item:item })
       }
     })
   },

+ 1 - 1
package-purchase/pages/supplier-list/add/add.js

@@ -35,7 +35,7 @@ Page({
           type: 'drop',
           dropType: 'supplierType',
           required: true,
-          changeObj: { pur: { hide: ['serviceCategories'], visible: ['brandId'] }, service: { hide: ['brandId'], visible: ['serviceCategories'] } },
+          changeObj: { supplierPur: { hide: ['serviceCategorie'], visible: ['brandId'] }, supplierService: { hide: ['brandId'], visible: ['serviceCategorie'] } },
         }, { //供应品牌
           code: 'brandId',
           name: 'brandName',

+ 37 - 5
utils/Constants.js

@@ -9,7 +9,7 @@ module.exports = {
   // 默认语言
   lan:'zh_CN',
   //页面加载数据API
-  BASIC_COMMON_API: "mdm-server-dkic-b1/wxapi/basic/common/",
+  BASIC_COMMON_API: "mdm-server-dkic-b1/mst/common/",
   //供应商停用api
   BASIC_SUPLIER_API: "mdm-server-dkic-b1/mst/supplier/",
   // 系统用户接口
@@ -156,10 +156,42 @@ module.exports = {
     all:'收款完成'
   },
 
-  // 供应商类别
-  supType:{
-    pur:'供应商类别-采购',
-    service:'供应商类别-服务'
+  /**
+   * @desc   : 数据种类
+   * @author : 周兴
+   * @date   : 2024/3/9 16:17
+   */
+  kindType: {
+    supType: '供应商类别',
+    serviceCategories: '服务类别',
+    goodsAttr :'商品属性',
+    basicData:'基础资料'
+  },
+
+  /**
+   * @desc   : 数据种类数据
+   * @author : 周兴
+   * @date   : 2024/3/9 16:17
+   */
+  kindCode:{
+    supplierPur:'供应商类别-采购',
+    supplierService:'供应商类别-服务',
+    serviceDelivery:'服务类别-配送',
+    serviceInstall:'服务类别-安装',
+    serviceManu:'服务类别-加工',
+    goodsBrand:'商品属性-品牌',
+    goodsCategory:'商品属性-种类',
+    goodsSeries:'商品属性-系列',
+    goodsUnit:'商品属性-单位',
+    basicWarehouse:'基础资料-仓库',
+    basicChannel:'基础资料-渠道',
+    basicIncome:'基础资料-收入',
+    basicOutlay:'基础资料-支出',
+    basicEnter:'基础资料-入库',
+    basicOut:'基础资料-出库',
+    basicMacType:'基础资料-账户',
+    basicSource:'基础资料-来源',
+    basicTags:'基础资料-标签',
   },
 
   // 收款进度