Ver Fonte

1、晚上dk-popup组件

zhoux há 2 anos atrás
pai
commit
d39cc04dec

+ 1 - 1
components/dkbase/dk-cell/dk-cell.wxss

@@ -16,7 +16,7 @@
 .content_class{
   position:absolute;
   /* margin-left: 20rpx; */
-  right:10rpx;
+  right:40rpx;
   overflow-x: auto;
   color: var(--contentColor--);
   font-size: var(--fontSize--);

+ 55 - 35
components/dkbase/dk-form-bill/dk-form-bill.js

@@ -53,21 +53,24 @@ Component({
   data: {
     // 是否显示pop
     show: false,
-    showDate:false,
-    showPop:false,
+    showDate: false,
+    showPop: false,
     $t: app.globalData.lang,
     routeUrl: app.globalData['routeUrl'],
     item: null,
-    dataItem:null,
     index: null,
+    dataItem: null,
+    dataIndex: null,
     card: null,
-    key:null,
+    key: null,
     // 下拉类型
     dropType: null,
     dropCode: null,
     dropName: null,
     itemName: 'goodsList',
     selectGoodsUrl: null,
+    popContent:
+      [{ code: 'quantity', type: 'step', title: '数量', required: true }, { code: 'pricePromotion', type: 'number', title: '销售价格', required: true }, { code: 'warehouseId', name: 'warehouseName', type: 'drop', required: true, dropType: 'warehouse' , required: true}, { code: 'color', type: 'str', title: '批次号' , required: true}, { code: 'giftFlag', type: 'checkbox', title: '赠品标识' }],
     form: {}
   },
   lifetimes: {
@@ -103,13 +106,30 @@ Component({
      * @author : 周兴
      * @date   : 2024/1/26 11:46
      */
-    openChoosedItemInfo(e){
-      console.log('eeee',e);
-      let dataItem = e.currentTarget.dataset.item
-
+    openChoosedItemInfo(e) {
+      let ds = e.currentTarget.dataset;
       this.setData({
-        dataItem:JSON.stringify(dataItem) ,
-        showPop:true,
+        dataIndex: ds.index,
+        dataItem: JSON.stringify(ds.item),
+        showPop: true,
+      })
+      console.log('ffff', this.data.form, this.data.form[this.data.itemName][ds.index]);
+    },
+    /**
+     * @desc   : 关闭Pop后修改数据
+     * @author : 周兴
+     * @date   : 2024/1/26 11:46
+     */
+    editItems(data) {
+      console.log('data', data);
+      let form = this.data.form;
+      let itemName = this.data.itemName;
+      if (form[itemName]) {
+        form[itemName][this.data.dataIndex] = data.detail.form;
+      }
+      this.setData({
+        form: form,
+        value: JSON.stringify(value)
       })
     },
     /**
@@ -157,35 +177,35 @@ Component({
      * @author : 周兴
      * @date   : 2024/2/20 11:46
      */
-    openMulti(e){
+    openMulti(e) {
       let type = e.currentTarget.dataset.type
       let _this = this
       // 选择主从业务员
-      if(type == 'staff'){
+      if (type == 'staff') {
         wx.navigateTo({
           url: '/package-base-select/pages/select-customers/select-customers',
-          events:{
+          events: {
             // 回调后
-            bindData:function(data) {
-              
+            bindData: function (data) {
+
             }
           },
-          success: function(res) {
+          success: function (res) {
             // 通过eventChannel向被打开页面传送数据
             res.eventChannel.emit('params', { data: 'test' })
           }
         })
-      // 选择主从业务部门
-      }else if(type == 'org'){
+        // 选择主从业务部门
+      } else if (type == 'org') {
         wx.navigateTo({
           url: '/package-base-select/pages/select-suppliers/select-suppliers',
-          events:{
+          events: {
             // 回调后
-            bindData:function(data) {
-              
+            bindData: function (data) {
+
             }
           },
-          success: function(res) {
+          success: function (res) {
             // 通过eventChannel向被打开页面传送数据
             res.eventChannel.emit('params', { data: 'test' })
           }
@@ -256,17 +276,17 @@ Component({
         })
       }
     },
-      /**
-     * @desc   : 打开日期pop
-     * @author : 周兴
-     * @date   : 2024/1/26 11:46
-     */
-    openDatePop(e){
+    /**
+   * @desc   : 打开日期pop
+   * @author : 周兴
+   * @date   : 2024/1/26 11:46
+   */
+    openDatePop(e) {
       let item = e.currentTarget.dataset;
       this.setData({
         showDate: true,
         index: item.index,
-        key:item.key,
+        key: item.key,
         card: item.card
       })
     },
@@ -275,9 +295,9 @@ Component({
      * @author : 周兴
      * @date   : 2024/1/26 11:46
      */
-    cancelDatePop(){
+    cancelDatePop() {
       this.setData({
-        showDate:false
+        showDate: false
       })
     },
     /**
@@ -285,13 +305,13 @@ Component({
      * @author : 周兴
      * @date   : 2024/1/26 11:46
      */
-    chooseDate(e){
+    chooseDate(e) {
       let form = this.data.form;
       let index = this.data.index;
       let card = this.data.card;
       let code = this.data.key;
       form[code + '_time'] = e.detail
-      form[code] =  util.toDateStr(e.detail);
+      form[code] = util.toDateStr(e.detail);
       let contentObj = this.data.contentObj;
       if (card && contentObj[card][index]?.errMsg && e.detail) {
         contentObj[card][index].errMsg = undefined;
@@ -299,8 +319,8 @@ Component({
       this.setData({
         value: JSON.stringify(form),
         form: form,
-        contentObj:contentObj,
-        showDate:false
+        contentObj: contentObj,
+        showDate: false
       })
     },
     /**

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

@@ -30,15 +30,15 @@
         <view wx:for="{{form[itemName]}}" data-item="{{item}}" wx:for-item="item" wx:key="index" border="{{ false }}">
           <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}}" catchtap="openChoosedItemInfo">
+              <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 }}" />
               </view>
-              <view slot="title" data-item="{{item}}" data-index="{{index}}" catchtap="openChoosedItemInfo" style="display: flex;">
+              <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>
                 </view>
               </view>
-              <view slot="desc" data-item="{{item}}" data-index="{{index}}" catchtap="openChoosedItemInfo">
+              <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>
                 </view>
@@ -135,5 +135,5 @@
 </van-popup>
 
 
-<dk-popup model:value="{{dataItem}}" show="{{showPop}}">
+<dk-popup type="basic" priceTitle="标价:" priceCol="pricePromotion" subCol="desc" defaultFlagCol="default" title="仓库档案" defaultFlagTitle="默认" value="{{dataItem}}" show="{{showPop}}" contentObj="{{popContent}}" bind:commit="editItems">
 </dk-popup>

+ 5 - 0
components/dkbase/dk-number-input/dk-number-input.js

@@ -39,6 +39,11 @@ Component({
       type: Boolean,
       value: false
     },
+    // 内容是否具有,默认是false
+    contentRight:{
+      type: Boolean,
+      value: false
+    },
     /**
      * 输入的数据
      */

+ 4 - 2
components/dkbase/dk-number-input/dk-number-input.wxml

@@ -1,11 +1,13 @@
 <view style="padding-top: 20rpx; padding-bottom: 20rpx;">
   <view wx:if="{{!focus || disabled}}">
-    <dk-cell height="48rpx" left="{{left}}" signSize="{{signSize}}" fontWeight="{{titleFontWeight}}" fontSize="{{fontSize}}" tail="{{percentSignFlag ? '%' : ''}}" percentSignFlag="{{percentSignFlag}}" contentColor="{{inputColor}}" amount="{{sign?true:false }}" contentFontWeight="{{fontWeight}}" center="{{center=='right'?'flex-end':center}}" title="{{titleValue}}" content="{{(inputValue || inputValue == 0)?inputValue:null}}" titleWid="{{titleWidth}}" catchtap="handleInput" titleColor="{{titleColor}}" placeholder="{{placeholder}}" errorMessage="{{errorMessage}}">
+    <dk-cell height="48rpx" left="{{left}}" signSize="{{signSize}}" fontWeight="{{titleFontWeight}}" fontSize="{{fontSize}}" tail="{{percentSignFlag ? '%' : ''}}" percentSignFlag="{{percentSignFlag}}" contentColor="{{inputColor}}" amount="{{sign?true:false }}" contentFontWeight="{{fontWeight}}" contentRight="{{contentRight}}" center="{{center=='right'?'flex-end':center}}" title="{{titleValue}}" content="{{(inputValue || inputValue == 0)?inputValue:null}}" titleWid="{{titleWidth}}" catchtap="handleInput" titleColor="{{titleColor}}" placeholder="{{placeholder}}" errorMessage="{{errorMessage}}">
     </dk-cell>
   </view>
 
   <view wx:else class="input-class" style="--center--:{{center}}">
     <view wx:if="{{titleValue}}" class="input-title-class" style="--color--:{{titleColor}};--fontSize--:{{fontSize + 'px'}};--left--:{{left}};--width--:{{titleWidth}};--fontWeight--:{{titleFontWeight}}">{{titleValue}}</view>
-    <input disabled="{{readonly}}" style="color:{{inputColor}};font-size:{{fontSize + 'px'}};font-weight: {{fontWeight}}; height: {{fontSize + 'px'}}" type="digit" value="{{inputValue}}" focus='{{focus}}' selection-start='0' selection-start='{{inputValue.length}}' bindinput="bindInput" bindblur='bindBlur'></input>
+    <view class="input_content-class" style="--width--:{{titleWidth}}">
+      <input disabled="{{readonly}}" style="text-align: right;color:{{inputColor}};font-size:{{fontSize + 'px'}};font-weight: {{fontWeight}}; height: {{fontSize + 'px'}}" type="digit" value="{{inputValue}}" focus='{{focus}}' selection-start='0' selection-start='{{inputValue.length}}' bindinput="bindInput" bindblur='bindBlur'></input>
+    </view>
   </view>
 </view>

+ 4 - 0
components/dkbase/dk-number-input/dk-number-input.wxss

@@ -35,4 +35,8 @@
   padding-left:var(--left--) !important;
   width: var(--width--) !important;
   font-weight: var(--fontWeight--) !important;
+}
+
+.input_content-class{
+  width:calc(100% - var(--width--) - 70rpx) !important
 }

+ 255 - 7
components/dkbase/dk-popup/dk-popup.js

@@ -7,17 +7,77 @@
  *		作者				日期					版本				修改内容
  *		周兴		  	2024-2-23  		1.00		   	  新建
  *******************************************************************************/
-const util = require('../../../utils/util.js')
+const util = require('@/utils/util.js')
+const app = getApp();
 Component({
   /**
    * 组件的属性列表
    */
   properties: {
     // 是否显示
-    show:{
-      type:Boolean
+    show: {
+      type: Boolean
     },
-		// 结果集
+    // 类型
+    type:{
+      type:String,
+      value:'sale'
+    },
+    // 图片列名
+    iconCol:{
+      type:String,
+      value:'iconThumPath'
+    },
+    // 标题标签
+    titleTagCol:{
+      type:String,
+      value:'titleTag'
+    },
+    // 标题列名
+    titleCol:{
+      type:String,
+      value:'title'
+    },
+    // 标题
+    title:{
+      type:String,
+    },
+    // 默认列
+    defaultFlagCol:{
+      type:String,
+    },
+    // 默认列标题
+    defaultFlagTitle:{
+      type:String,
+    },
+    // 描述列名
+    descCol:{
+      type:String,
+      value:'desc'
+    },
+    // 价格
+    priceCol:{
+      type:String,
+      value:'price'
+    },
+    // 价格标题
+    priceTitle:{
+      type:String,
+    },
+    // 底部信息名称
+    subCol:{
+      type:String,
+    },
+    // 内容
+    contentObj: {
+      type: Array
+    },
+    // 是否开启校验,默认不开启
+    validFlag:{
+      type: Boolean,
+      value:false
+    },
+    // 结果集
     value: {
       type: String,
       observer: function (newVal) {
@@ -34,15 +94,203 @@ Component({
    * 组件的初始数据
    */
   data: {
-    // $t: app.globalData.lang,
-    form:{}
+    showDrop: false,
+    $t: app.globalData.lang,
+    index: null,
+    // 下拉类型
+    dropType: null,
+    dropCode: null,
+    dropName: null,
   },
 
   /**
    * 组件的方法列表
    */
   methods: {
-    
+    /**
+     * @desc :  关闭弹窗
+     * @author : 周兴
+     * @date : 2024/2/19 12:16
+     */
+    onClosePopup() {
+      this.setData({
+        show: false
+      })
+    },
+    /**
+     * @desc :  选择数据
+     * @author : 周兴
+     * @date : 2024/2/19 12:16
+     */
+    commit() {
+      // 校验
+      if(this.data.validFlag && !this.validData()){
+        return false;
+      }
+      this.triggerEvent("commit", { form: this.data.form })
+      this.setData({
+        show: false
+      })
+    },
+    /**
+     * @desc   : 非空校验
+     * @author : 周兴
+     * @date   : 2024/2/20 11:46
+     */
+    validData() {
+      let flag = true;
+      let form = this.data.form;
+      let contentObj = this.data.contentObj;
+      contentObj.forEach(item => {
+        let title = this.$t(item.title ? item.title : item.code)
+        // 如果必须输入,就要进行判断
+        if (item.required && !form[item.code]) {
+          item.errMsg = title + '为空'
+          flag = false;
+        }
+      })
+      this.setData({
+        contentObj: contentObj
+      })
+      return flag;
+    },
+    /**
+     * @desc   : 打开下拉
+     * @author : 周兴
+     * @date   : 2024/1/26 11:46
+     */
+    open(e) {
+      let item = e.currentTarget.dataset;
+      this.setData({
+        showDrop: true,
+        dropCode: item.key,
+        dropName: item.name,
+        dropType: item.type,
+        index: item.index,
+      })
+    },
+    /**
+     * @desc   : 选择数据
+     * @author : 周兴
+     * @date   : 2024/1/26 11:46
+     */
+    chooseData(e) {
+      let contentObj = this.data.contentObj;
+      let form = this.data.form
+      form[this.data.dropCode] = e.detail.value;
+      form[this.data.dropName] = e.detail.text;
+      // 选择后清空校验提示信息
+      if (contentObj[this.data.index]?.errMsg && e.detail) {
+        contentObj[this.data.index].errMsg = undefined;
+      }
+      this.setData({
+        form: form,
+        contentObj: contentObj
+      })
+      // 如果处理id,name还需要赋值其他,需要在页面事件中自行处理
+      this.triggerEvent("chooseData", { code: this.data.dropCode, item: e.detail.item })
+    },
+    /**
+     * @desc   : 修改复选框的值
+     * @author : 周兴
+     * @date   : 2024/2/2 11:46
+     */
+    changeDefault(e){
+      let form = this.data.form
+      form[this.data.defaultFlagCol] = e.detail
+      this.setData({
+        form: form
+      })
+    },
+    /**
+     * @desc   : 改变step组件的值
+     * @author : 周兴
+     * @date   : 2024/2/2 11:46
+     */
+    changeStep(e){
+      let ds = e.currentTarget.dataset
+      let key = ds.key
+      let item = ds.item
+      let form = this.data.form
+      form[key] = e.detail
+      let contentObj = this.data.contentObj;
+      // 输入值后清空校验提示信息
+      if (item.errMsg && e.detail) {
+        contentObj.errMsg = undefined;
+      }
+      this.setData({
+        form: form,
+        contentObj: contentObj
+      })
+    },
+    /**
+     * @desc   : 修改数值输入框的值
+     * @author : 周兴
+     * @date   : 2024/2/2 11:46
+     */
+    changeNumberField(e) {
+      let ds = e.currentTarget.dataset
+      let key = ds.key
+      let item = ds.item
+      let form = this.data.form
+      form[key] = e.detail.value
+      let contentObj = this.data.contentObj;
+      // 输入值后清空校验提示信息
+      if (item.errMsg && e.detail) {
+        contentObj.errMsg = undefined;
+      }
+      this.setData({
+        form: form,
+        contentObj: contentObj
+      })
+    },
+    /**
+     * @desc   : 改变选择框内容
+     * @author : 周兴
+     * @date   : 2024/1/26 11:46
+     */
+    changeCheckBox(e) {
+      let key = e.currentTarget.dataset.key
+      let checkFlag = e.currentTarget.dataset.value
+      let form = this.data.form
+      form[key] = !checkFlag
+      this.setData({
+        form: form
+      })
+    },
+    /**
+     * @desc   : 修改输入框的值
+     * @author : 周兴
+     * @date   : 2024/2/2 11:46
+     */
+    changeField(e) {
+      let ds = e.currentTarget.dataset
+      let key = ds.key
+      let item = ds.item
+      let form = this.data.form
+      form[key] = e.detail
+      let contentObj = this.data.contentObj;
+      // 输入值后清空校验提示信息
+      if (item.errMsg && e.detail) {
+        contentObj.errMsg = undefined;
+      }
+      this.setData({
+        form: form,
+        contentObj: contentObj
+      })
+    },
+    /**
+     * @desc : 获取语言的方法
+     * @author : 周兴
+     * @date : 2024/1/19
+     */
+    $t(name) {
+      if (this.data.$t[name]) {
+        return this.data.$t[name];
+      } else {
+        return name;
+      }
+    },
   },
   /**
   * 组件生命周期

+ 41 - 62
components/dkbase/dk-popup/dk-popup.wxml

@@ -1,89 +1,68 @@
+<wxs src='../../../utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+
 <!-- 弹窗 编辑/新建-->
 <van-popup show="{{show}}" position="bottom" bind:close="onClosePopup" custom-class="dk-popup">
   <view style="position:relative; top:280rpx;z-index:  1;background-color: transparent; height: 44rpx;"></view>
 
   <!--标题-->
-  <view class="special-topic">
+  <view class="special-topic" wx:if="{{type=='sale'}}">
     <!-- 图片 -->
     <view class="special-topic-content">
-      <van-image radius="15rpx" custom-class="goods-pop-image" fit="fill" src="{{ form.iconThumPath }}"></van-image>
+      <van-image radius="15rpx" custom-class="goods-pop-image" fit="fill" src="{{ form[iconCol] }}"></van-image>
     </view>
     <view class="special-topic-title">
       <!-- 标签 标题-->
-      <dk-title titleTag="{{form.titleTag}}" title="{{form.title}}"></dk-title>
+      <dk-title titleTag="{{form[titleTagCol]}}" title="{{form[titleCol]}}"></dk-title>
       <view style="padding-top: 10rpx;">
-        <dk-text fontWeight="normal" value="{{form.desc}}"></dk-text>
+        <dk-text fontWeight="normal" value="{{form[descCol]}}"></dk-text>
       </view>
       <view style="display: flex;padding-top: 5rpx;">
         <view class="price-pop-class">
-          <dk-cell height="46rpx" spaceWidth="1rpx" left="0" fontSize="14" contentColor="#CAA977" fontWeight="bold" title="标价:" content="{{form.pricePromotion}}"></dk-cell>
+          <dk-cell height="46rpx" spaceWidth="1rpx" left="0" fontSize="14" contentColor="#CAA977" fontWeight="bold" title="{{priceTitle}}" content="{{form[priceCol]}}"></dk-cell>
         </view>
       </view>
       <view style="padding-right: 30rpx;float: right;">
-        <dk-text fontWeight="normal" value="{{form.desc}}"></dk-text>
+        <dk-text fontWeight="normal" value="{{form[subCol]}}"></dk-text>
       </view>
     </view>
   </view>
-
-  <!--内容-->
+  <view class="special-basic-topic" wx:else>
+    <view class="special-basic-topic-title">{{title}}</view>
+    <view class="special-basic-topic-checkbox" wx:if="{{defaultFlagCol}}"><van-checkbox value="{{ form[defaultFlagCol] }}" bind:change="changeDefault" label-class="special-basic-topic-checkbox-label">{{defaultFlagTitle}}</van-checkbox></view>
+  </view>
   <view class="pop-content-class">
-    <van-cell-group border="{{ false }}">
-
-      <!--销售价格-->
-      <van-cell border="{{ false }}" title-width="410rpx">
-        <view slot="title">
-          销售价格
-        </view>
-        <view Cell Slot="value">
-          <dk-number-input center="right" data-key="priceSale" inputValue="{{currentSkuChoosedItem.priceSale}}" bind:triggerBindValue="changeSalesPriceField"></dk-number-input>
-        </view>
-      </van-cell>
-      <van-cell border="{{ false }}" title-width="410rpx">
-        <view slot="title">
-          销售金额
-        </view>
-        <view Cell Slot="value">
-          <dk-number-input center="right" data-key="itemAmount" inputValue="{{currentSkuChoosedItem.itemAmount}}" bind:triggerBindValue="changeItemAmountField"></dk-number-input>
-        </view>
-      </van-cell>
-
-      <!--正常品显示-->
-      <van-cell wx:if="{{currentSkuChoosedItem.promotionType==0}}" border="{{ false }}" title-width="410rpx" disabled="{{currentSkuChoosedItem.flgGift}}">
-        <view slot="title" style="color:#95A8CB">
-          标价折扣
+    <!--内容-->
+    <view wx:for="{{contentObj}}" wx:for-item="item" data-item="{{item}}" wx:key="index">
+      <!--文本框-->
+      <van-field wx:if="{{item.type=='str'}}" label-class="{{item.required?'red-label':'nomal-label' }}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" value="{{ form[item.code]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" readonly="{{!!item.readonly}}" input-class="dk-cell-value-class" maxlength="{{item.maxlength?item.maxlength:50}}" right-icon="{{item.rightIcon}}" bind:change="changeField" errorMessage="{{item.errMsg}}">
+      </van-field>
+      <!--下拉-->
+      <van-field wx:if="{{item.type=='drop'}}" label-class="{{item.required?'red-label':'nomal-label' }}" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" value="{{ form[item.name]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" is-link catchtap="open" autosize border="{{ false }}" readonly="{{true}}" input-class="dk-cell-value-class" data-type='{{item.dropType}}' errorMessage="{{item.errMsg}}">
+      </van-field>
+      <!--选择框-->
+      <van-field wx:if="{{item.type=='checkbox'}}" input-width="200rpx" input-class="dk-cell-value-class" label-class="nomal-label" input-align="right" label="{{item.title?item.title:$t[item.code]}}" autosize border="{{ false }}" readonly="{{true}}" errorMessage="{{item.errMsg}}">
+        <view slot="end" style="text-align: right;padding-left: 10rpx;" data-item="{{item}}" data-index="{{index}}" data-value="{{form[item.code]}}" data-key="{{item.code}}" catchtap="changeCheckBox">
+          <van-checkbox shape="round" value="{{form[item.code]}}" />
         </view>
-        <dk-text color="#1B365D" fontSize="13px" fontWeight="nomal" value="{{(currentSkuChoosedItem.discountStandard  || currentSkuChoosedItem.discountStandard ==0)?(currentSkuChoosedItem.discountStandard+ '%'):'' }}"></dk-text>
-      </van-cell>
-
-      <!--促销品显示-->
-      <van-cell wx:if="{{currentSkuChoosedItem.promotionType !=0 }}" border="{{ false }}" title-width="410rpx">
-        <view slot="title" style="color:#95A8CB">
-          标准售价折扣
-        </view>
-        <dk-text color="#1B365D" fontSize="13px" fontWeight="nomal" value="{{currentSkuChoosedItem.discountPromotion?(currentSkuChoosedItem.discountPromotion+ '%'):'' }}"></dk-text>
+      </van-field>
+      <!--数量step-->
+      <van-cell wx:if="{{item.type=='step'}}" border="{{ false }}" title="数量" title-class="{{item.required?'red-label':'nomal-label' }}">
+        <van-stepper value="{{form[item.code]}}" integer="{{true}}" data-index="{{index}}" min="0" max="{{item.max?item.max:999999999}}" bind:change="changeStep" />
       </van-cell>
+      <!--数字类-->
+      <dk-number-input wx:if="{{item.type=='number'}}" fontSize="14" left="30rpx" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" center="left" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" errorMessage="{{item.errMsg}}" contentRight="true" titleValue="{{item.title?item.title:$t[item.code]}}" inputColor="#1B365D" titleFontWeight="bold" titleColor="{{item.required?'#E4002B':'#95A8CB'}}" inputValue="{{form[item.code]}}" bind:triggerBindValue="changeNumberField"></dk-number-input>
+      <!--备注-->
+      <van-field wx:if="{{item.type=='textarea'}}" type="textarea" label-class="{{item.required?'red-label':'nomal-label' }}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" value="{{ form[item.code]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" readonly="{{!!item.readonly}}" input-class="dk-cell-value-class" maxlength="{{item.maxlength?item.maxlength:500}}" right-icon="{{item.rightIcon}}" bind:change="changeField" errorMessage="{{item.errMsg}}">
+      </van-field>
+    </view>
+  </view>
 
-      <!--赠品标识-->
-      <van-cell title-class="nomal-label" title="赠品标识" border="{{ false }}" value-class="value-class">
-        <van-checkbox shape="round" value="{{ currentSkuChoosedItem.flgGift}}" data-index="{{index}}" data-key="flgGift" bind:change="changeSkuFlgGift" />
-      </van-cell>
-      <view style="height: 100rpx;"></view>
+  <view style="height: 30rpx;background-color: #FFFFFF;"></view>
 
-      <view style="text-align: center;">
-        <van-button round size="large" color="#1B365D" custom-style="height:88rpx;width:640rpx;" type="info" data-item="{{currentSkuChoosedItem}}" size="small" bindtap="updateCurrentSkuChoosedItem">确定</van-button>
-      </view>
-    </van-cell-group>
+  <view style="text-align: center;background-color: #FFFFFF">
+    <van-button round size="large" color="#1B365D" custom-style="height:88rpx;width:640rpx;margin-bottom:40rpx" type="info" size="small" bindtap="commit">确定</van-button>
   </view>
+</van-popup>
 
-  <view style="display: flex; padding:35rpx 34rpx 62rpx 34rpx;">
-    <view style="width:48%">
-      <van-button size="large" plain round color="#1B365D" custom-style="height:88rpx;" bind:click="onClosePopup" type="default">取消
-      </van-button>
-    </view>
-    <view style="width: 4%;"></view>
-    <view style="width:48%;">
-      <van-button size="large" round color="#1B365D" custom-style="height:88rpx;" bind:click="allClean" type="default">保存
-      </van-button>
-    </view>
-  </view>
-</van-popup>
+<!--弹出-->
+<dk-single-dropdown-item show="{{showDrop}}" typeName='{{dropType}}' bind:commit='chooseData' bind:muticlose='muticlose'></dk-single-dropdown-item>

+ 65 - 0
components/dkbase/dk-popup/dk-popup.wxss

@@ -16,6 +16,34 @@
   border-radius: 30rpx 30rpx 0px 0px !important;
 }
 
+.special-basic-topic {
+  width: 96%;
+  height: 120rpx;
+  display: flex;
+  padding-left: 4%;
+  /* 从最下面开始布局 */
+  align-items: center;
+  background: #F8F9FD;
+  border-radius: 30rpx 30rpx 0px 0px !important;
+  justify-content: space-between;
+}
+
+.special-basic-topic-title{
+  font-size: 16px;
+  font-weight: bold;
+  color: #1B365D;
+}
+
+.special-basic-topic-checkbox{
+  margin-right: 50rpx;
+}
+
+.special-basic-topic-checkbox-label{
+  font-size: 14px;
+  color: #1B365D !important;
+  font-weight: bold;
+}
+
 /**pop弹出框的表头标题样式*/
 .special-topic-title{
   width: 90%;
@@ -37,4 +65,41 @@
   border: 1px solid #606EB2;
   border-radius: 15rpx !important;
   margin-bottom: 47rpx;
+}
+
+.pop-content-class{
+  background-color: #FFFFFF;
+  max-height: 600rpx !important;
+  overflow-y: auto;
+  overflow-x: hidden;
+}
+
+/**cell值颜色**/
+.dk-cell-value-class {
+  text-align: right !important;
+  font-size: 13px !important;
+  color: #1B365D !important;
+  font-weight: normal;
+}
+
+/**红色label**/
+.red-label {
+  color: red;
+  font-size: 14px;
+  font-weight: bold;
+}
+
+/**红色label**/
+.red-label,
+.red-label>view {
+  color: #E4002B !important;
+  font-style: normal;
+  font-weight: bold;
+  font-size: 14px;
+}
+
+.nomal-label,
+.nomal-label>view {
+  color: #95A8CB !important;
+  font-size: 14px;
 }

+ 1 - 1
i18n/zh-CN.js

@@ -46,7 +46,7 @@ const columns = {
   customer :'客户',
   supplier:'供应商',
   collectType:'收入类别',
-  
+  warehouseId:'仓库'
 }
 //销售订单
 const saleOrder = {

+ 1 - 0
mixins/index.js

@@ -452,6 +452,7 @@ module.exports = {
       let _this = this;
       // 指定类型
       eventChannel.on('params', function (data) {
+        console.log('t1',data);
         // 获取参数
         if (data.formMode) {
           _this.setData({

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

@@ -257,7 +257,7 @@ Page({
         success: function (res) {
           // 通过eventChannel向被打开页面传送数据
           console.log('bbbb3',choosedGoodsList);
-          res.eventChannel.emit('params', { data: choosedGoodsList })
+          res.eventChannel.emit('choose', { data: choosedGoodsList })
         }
       })
     }

+ 1 - 1
package-basic-data/pages/test/add/add.js

@@ -38,7 +38,7 @@ Page({
     // 接收父页面传递的参数
     const eventChannel = this.getOpenerEventChannel()
     let _this = this;
-    eventChannel.on('params', function (data) {
+    eventChannel.on('choose', function (data) {
       console.log('生命周期函数',data)
       // 设置商品明细
       _this.selectComponent('#' + _this.data.formName).setGoods(data);