瀏覽代碼

配件明细行

xiaohaizhao 1 周之前
父節點
當前提交
84e4a48c57

+ 2 - 1
app.json

@@ -67,7 +67,8 @@
         "orderForm/frozenList",
         "fittings/index",
         "writeOff/index",
-        "writeOff/detail"
+        "writeOff/detail",
+        "fittings/rows"
       ]
     },
     {

+ 17 - 0
packageA/fittings/modules/item/index.js

@@ -0,0 +1,17 @@
+Component({
+  properties: {
+    item: {
+      type: Object
+    },
+    borderTop: {
+      type: Boolean
+    },
+    userrole: {
+      type: String
+    },
+    privacyFieldC: {
+      type: Array,
+      value: []
+    }
+  }
+})

+ 4 - 0
packageA/fittings/modules/item/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 6 - 0
packageA/fittings/modules/item/index.scss

@@ -0,0 +1,6 @@
+.box {
+	view {
+		font-size: 24rpx;
+		margin-top: 6rpx;
+	}
+}

+ 35 - 0
packageA/fittings/modules/item/index.wxml

@@ -0,0 +1,35 @@
+<view class="box" style="border-top: {{borderTop?1:0}}px dashed #ddd;margin-top: {{borderTop?'8rpx':''}};">
+	<view>
+		客户:{{item.cardname||" --"}}<text wx:if="{{item.cardphonenumber}}"> {{item.cardphonenumber}}</text>
+	</view>
+	<view>
+		客户地址:{{item.address||" --"}}
+	</view>
+	<view>
+		产品编码:{{item.itemno||" --"}}
+	</view>
+	<view>
+		品名:{{item.itemname||" --"}}
+	</view>
+	<view>
+		型号:{{item.model ||" --"}}
+	</view>
+	<view>
+		数量:{{item.qty ||"0"}}({{item.unit}})
+	</view>
+	<view wx:if="{{userrole=='经销商'}}">
+		<block wx:if="{{item.qty!='0'}}">
+			单价/总金额:{{handleHide.verify((item.price+'/'+item.amount),'列表金额',privacyFieldC)}}
+		</block>
+		<block wx:else>
+			总金额:{{handleHide.verify(item.amount,'列表金额',privacyFieldC)}}
+		</block>
+	</view>
+	<view>
+		未发货数量:{{item.unsoldqty||"0"}}({{item.unit}})
+	</view>
+	<view>
+		备注:{{item.remarks||" --"}}
+	</view>
+</view>
+<wxs src="/utils/hidePrice.wxs" module="handleHide" />

+ 102 - 0
packageA/fittings/rows.js

@@ -0,0 +1,102 @@
+const _Http = getApp().globalData.http;
+import currency from "../../utils/currency";
+const CNY = value => currency(value, {
+  symbol: "¥",
+  precision: 2
+}).format();
+Page({
+  data: {
+    privacyFieldC: [],
+    content: {
+      pageNumber: 1,
+      pageTotal: 1,
+      pageSize: 20,
+      where: {
+        condition: "",
+        begindate: "",
+        enddate: ""
+      }
+    }
+  },
+  onLoad(options) {
+    this.getList()
+    this.setData({
+      userrole: wx.getStorageSync('userrole')
+    })
+
+    try {
+      let privacyFieldC = wx.getStorageSync('auth').worderdetails.forms.list.formcols.map(v => v.title);
+      this.setData({
+        privacyFieldC
+      })
+      console.log("privacyFieldC", privacyFieldC)
+    } catch (error) {
+      console.error(error)
+    }
+  },
+  tabsChange({
+    detail
+  }) {
+    this.data.content.where.status = detail.name || ''
+    this.getList(true)
+  },
+  /* 获取产品 */
+  getList(init = false) {
+    if (init.detail != undefined) init = init.detail;
+    let content = this.data.content;
+    if (init) content.pageNumber = 1;
+    if (content.pageNumber > content.pageTotal) return;
+    this.setListHeight();
+    _Http.basic({
+      "id": 2025090316070203,
+      content
+    }).then(res => {
+      console.log("订单列表", res)
+      if (res.msg != '成功') return wx.showToast({
+        title: res.msg,
+        icon: "none"
+      })
+      this.selectComponent('#ListBox').RefreshToComplete();
+      content.pageNumber = res.pageNumber + 1
+      content.pageTotal = res.pageTotal
+
+      let list = [];
+      res.data.forEach(v => {
+        let index = list.findIndex(item => item.sonum == v.sonum);
+        v.amount = CNY(currency(v.price).multiply(v.qty));
+        v.price = CNY(v.price);
+        if (index != -1) {
+          list[index].productList.push(v)
+        } else {
+          v.productList = []
+          list[list.length] = v;
+        }
+      })
+      this.setData({
+        list: res.pageNumber == 1 ? list : this.data.list.concat(list),
+        content
+      })
+    })
+  },
+  /* 修改查看日期 */
+  changeDate(e) {
+    this.data.content.where[e.currentTarget.dataset.name] = e.detail.value;
+    this.getList(true)
+  },
+  initialize() {
+    this.data.content.where.enddate = "";
+    this.data.content.where.begindate = "";
+    this.getList(true)
+  },
+  /* 搜索 */
+  onSearch({
+    detail
+  }) {
+    this.data.content.where.condition = detail;
+    this.getList(true)
+  },
+  /* 设置页面高度 */
+  setListHeight() {
+    this.selectComponent("#ListBox").setHeight(".top", this);
+  }
+})

+ 5 - 0
packageA/fittings/rows.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "Item": "./modules/item/index"
+  }
+}

+ 30 - 0
packageA/fittings/rows.scss

@@ -0,0 +1,30 @@
+.head {
+	width: 100vw;
+	display: flex;
+	line-height: 60rpx;
+	justify-content: center;
+
+	text {
+			margin: 0 20rpx;
+	}
+}
+
+.item {
+	padding: 10rpx 30rpx;
+	width: 100vw;
+	background-color: #fff;
+	border-bottom: 1px solid #ddd;
+
+	.title {
+			font-size: 28rpx;
+			font-weight: 700;
+			margin-bottom: 10rpx;
+	}
+
+	.product {
+			padding: 4rpx 16rpx;
+			box-sizing: border-box;
+			border: 1px solid #ddd;
+			border-radius: 8rpx;
+	}
+}

+ 22 - 0
packageA/fittings/rows.wxml

@@ -0,0 +1,22 @@
+<van-search use-action-slot placeholder='请输入搜索关键词' shape='round' bind:search="onSearch" bind:clear="onSearch" />
+<!-- <van-tabs active="{{ active }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
+    <van-tab title="全部" name='' />
+    <van-tab title="提交" name='提交' />
+    <van-tab title="审核" name='审核' />
+    <van-tab title="关闭" name='关闭' />
+    <van-tab title="手工关闭" name='手工关闭' />
+</van-tabs> -->
+<view class="top" style="height: 5px;" />
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+    <Yl_Empty wx:if="{{list.length==0}}" />
+    <view class="item" wx:for="{{list}}" wx:key="sa_orderitemsid">
+        <view class="title">
+            {{item.type+' '+item.sonum}} / {{item.billdate}}
+        </view>
+        <view class="product">
+            <Item userrole='{{userrole}}' privacyFieldC='{{privacyFieldC}}' item="{{item}}" />
+            <Item userrole='{{userrole}}' privacyFieldC='{{privacyFieldC}}' borderTop wx:for="{{item.productList}}" wx:for-item="it" item="{{it}}" />
+        </view>
+    </view>
+    <view style="height:150rpx;" />
+</Yl_ListBox>

+ 5 - 0
pages/index/index.js

@@ -166,6 +166,11 @@ Page({
 					key: "wAccessoriesApplication",
 					path: "/packageA/fittings/index",
 					icon: "work-dingdan"
+				},{
+					name: "配件申请明细",
+					key: "wAccessoriesApplicationRows",
+					path: "/packageA/fittings/rows",
+					icon: "work-dingdan"
 				}, {
 					name: "配件核销申请",
 					key: "writeOff",

+ 3 - 0
select/product/index.js

@@ -41,6 +41,9 @@ Page({
 						pageNumber: 1,
 						pageTotal: 1,
 						pageSize: 20,
+						where: {
+							condition: "",
+						}
 					},
 				},
 				cardno