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

+ 94 - 0
components/dkbase/dk-goos-list/dk-goos-list.js

@@ -0,0 +1,94 @@
+
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    list:{
+      type:Array,
+      value:[]
+    },
+    titleCol:{
+      type:String,
+      value:''
+    },
+
+    titleTagCol:{
+      type:String,
+      value:''
+    },
+    descCol:{
+      type:String,
+      value:''
+    },
+
+    priceCol:{
+      type:String,
+      value:''
+    },
+    quantityCol:{
+      type:String,
+      value:'' 
+    },
+    title:{
+      type:String,
+      value:''  
+    },
+    type:{
+      type:String,
+      value:''
+    },
+    no:{
+      type:String,
+      value:''
+    },
+    
+
+  },
+
+  options: {
+    multipleSlots: true
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    expandCard(e) {
+      let cardList = this.data.cardList
+      let index = e.currentTarget.dataset.index
+      if (cardList[index]) {
+        // 收缩的时候需要展示信息
+        let expand = cardList[index].expand
+        cardList[index].info = undefined
+        if (expand) {
+          let form = this.data.form
+          let infoCols = e.currentTarget.dataset.item.infoCols
+          if (infoCols && infoCols.length > 0) {
+            let info = ''
+            infoCols.forEach(it => {
+              if (form[it]) {
+                info += form[it] + '/'
+              }
+            })
+            if (info.length > 0) {
+              info = info.substring(0, info.length - 1);
+              cardList[index].info = info
+            }
+          }
+        }
+        cardList[index].expand = !expand
+        this.setData({
+          cardList: cardList
+        })
+      }
+    },
+  }
+})

+ 67 - 0
components/dkbase/dk-goos-list/dk-goos-list.wxml

@@ -0,0 +1,67 @@
+<view class="dk-card-outer-class">
+  <view class="dk-card-class">
+    <view wx:if="{{title}}" class="item-class">
+      <view class="item-title-class">{{title}}
+        <view style="font-size: 13px;font-weight: 500;">{{no ? list[0][no] : ''}}</view>
+      </view>
+      <view>
+        <dk-tag type="primary" padding="0 20rpx" height="40rpx" color="#9FAEE5" textColor="#FFFFFF" radius="5rpx" roundFlag="{{true}}" value="{{!expand?'展开':'收起'}}" catchtap="expandCard" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
+      </view>
+    </view>
+    <view></view>
+    <view wx:for="{{list}}" data-item="{{item}}" wx:for-item="item" wx:key="index" border="{{ false }}">
+
+      <van-card wx:if="{{item.show || item.show == undefined}}">
+        <view slot="thumb">
+          <van-image radius="5px" width="90" height="90" src="{{item[iconCol] }}" />
+        </view>
+        <view slot="title" style="display: flex;">
+          <view style="display: flex;">
+            <dk-title titleTag="{{item[titleTagCol]}}" title="{{item[titleCol]}}"></dk-title>
+          </view>
+        </view>
+        <view slot="desc" data-item="{{item}}">
+          <view style="display:flex;width: 100%;">
+            <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="700" left="0rpx" contentColor="#FF7B1A" title="" content="{{ item[priceCol]}}"></dk-cell>
+            </view>
+            <view style="width: 40%;text-align: right;">
+              <dk-text fontWeight="nomal" fontWeight="700" value="{{'x ' + item[quantityCol]}}"></dk-text>
+            </view>
+          </view>
+        </view>
+      </van-card>
+
+      <!-- 明细左下 -->
+      <view wx:if="{{card.contentBottomLeft}}" wx:for="{{card.contentBottomLeft}}" style="display: flex;width: 100%;margin-top:5px;align-items: center;" wx:for-item="item_" data-item="{{item_}}" wx:for-index="index_" catchtap="openContentBottomLeft">
+        <view wx:if="{{item_.type=='remarks'}}" style="width: 50%;text-align: left;font-size:14px;color: #95A8CB;">
+          <van-image width="20px" height="20px" src="/static/image/edit.png" />
+          备注:<span style="line-height:56rpx;">{{item[item_.code] ? item[item_.code] : '请输入内容'}}</span>
+        </view>
+      </view>
+
+    </view>
+    <block style="text-align: center; " wx:if="{{card.displayNum && list.length > card.displayNum}}">
+      <view wx:if="{{card.showMore}}" class="expand-class" data-card="{{card}}" data-index="{{cardIndex}}" bindtap='expand'>
+        点击收起部分
+        <van-icon name="arrow-up" />
+      </view>
+      <view wx:else class="expand-class" data-card="{{card}}" data-index="{{cardIndex}}" bindtap='expand'>
+        展开查看更多
+        <van-icon name="arrow-down" />
+      </view>
+    </block>
+    <view class="amount-item-class" wx:if="{{type === 'sale'}}">
+      <!--标价总额-->
+      <dk-cell contentColor="#FF7B1A" titleColor="#95A8CB;" contentFontWeight="700" title="标价总额" content="{{card[sumStandardCol]?card[sumStandardCol]:0}}"></dk-cell>
+      <!--标价折扣-->
+      <dk-cell amount="{{false}}" contentColor="#FF7B1A" contentFontWeight="700" titleColor="#95A8CB;" title="标价折扣" content="{{card[discountStandardCol]?card[discountStandardCol]:''  +'折'}}"></dk-cell>
+    </view>
+  </view>
+
+</view>

+ 34 - 0
components/dkbase/dk-goos-list/dk-goos-list.wxss

@@ -0,0 +1,34 @@
+/**card的外部样式*/
+.dk-card-outer-class {
+  margin: 10px 32rpx 10px 32rpx;
+  margin-top: 10px;
+  border-radius: 15rpx;
+  /* box-shadow: 2px 2px 5px #e5e5e6; */
+}
+
+/**card的样式*/
+.dk-card-class {
+  background: #FFFFFF;
+  border-radius: 16rpx;
+  padding: 5rpx;
+  margin-bottom: 20rpx;
+  box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.08);
+  /* box-shadow: 0px -6px 20px 0px rgba(0, 0, 0, 0.08); */
+  
+
+}
+.item-class {
+  display: flex;
+  font-size: 30rpx;
+  padding: 20rpx;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.item-title-class {
+  margin-left: 14rpx;
+  font-size: 15px;
+  color: #1B365D;
+  font-weight: 600;
+  width: 80%;
+}

+ 15 - 4
package-sales/pages/sales-tracking-report/detail/detail.js

@@ -9,6 +9,9 @@ Page({
     data: {
     // 路由
     routeObjName: 'saleReport',
+    saleList:[],
+    saleReturnList:[],
+    saleOutList:[],
     },
   /**
    * @desc : 查询
@@ -24,11 +27,19 @@ Page({
           let saleList =  res.data.data.filter(item=>{
             return item.type== '销售订单'
           })
-          formData.goodsList = saleList
+          let saleOutList =  res.data.data.filter(item=>{
+            return item.type== '销售出库'
+          })
+          let saleReturnList =  res.data.data.filter(item=>{
+            return item.type== '销售退货'
+          })
+          this.setData({
+            saleList:saleList,
+            saleOutList:saleOutList,
+            saleReturnList:saleReturnList
+          })
         }
-        this.setData({
-          formData:JSON.stringify(formData)
-        })
+  
       }
     })
   },

+ 3 - 0
package-sales/pages/sales-tracking-report/detail/detail.wxml

@@ -65,8 +65,11 @@
 
 
 
+  <dk-goos-list type="sale" list="{{saleList}}" title="商品明细" titleCol="skuName" titleTagCol="brandName" descCol="skuCode" priceCol="priceSale" quantityCol="itemQty"></dk-goos-list>
 
+  <dk-goos-list list="{{saleOutList}}" no="no" title="销售出库" titleCol="skuName" titleTagCol="brandName" descCol="skuCode" priceCol="priceSale" quantityCol="itemQty"></dk-goos-list>
 
+  <dk-goos-list list="{{saleReturnList}}" no="no" title="销售退货" titleCol="skuName" titleTagCol="brandName" descCol="skuCode" priceCol="priceSale" quantityCol="itemQty"></dk-goos-list>