15 changed files with 331 additions and 236 deletions
Split View
Diff Options
-
7api/saas.js
-
87pages/process/outside-check-item/index.js
-
10pages/process/outside-check-item/index.json
-
65pages/process/outside-check-item/index.wxml
-
23pages/process/outside-check-item/index.wxss
-
130pages/process/outside-check/index.js
-
6pages/process/outside-check/index.json
-
72pages/process/outside-check/index.wxml
-
10pages/process/outside-item/index.js
-
7pages/process/outside-item/index.wxml
-
7pages/process/outside-list/index.js
-
2pages/process/outside-list/index.wxml
-
58pages/process/outside-price/index.js
-
60pages/process/outside-price/index.wxml
-
23pages/process/outside-price/index.wxss
@ -0,0 +1,87 @@ |
|||
// pages/message/index.js
|
|||
const util = require('../../../utils/util') |
|||
const math = require('../../../utils/math') |
|||
|
|||
Component({ |
|||
options: { |
|||
addGlobalClass: true, |
|||
multipleSlots: true |
|||
}, |
|||
properties: { |
|||
form: { type: Object, value: null }, |
|||
item: { type: Object, value: null }, |
|||
index: { type: Number, value: 0 }, |
|||
list: { type: Array, value: [] }, |
|||
columns: { type: Array, value: [] }, |
|||
status: { type: Number, value: 0 } |
|||
}, |
|||
data: { |
|||
visible: false, |
|||
focus: 0 |
|||
}, |
|||
methods: { |
|||
showCategory: function(){ |
|||
this.setData({ visible: true }) |
|||
}, |
|||
onConfirm: function({detail}){ |
|||
var nowItem = this.data.paperList[detail.index] |
|||
for (var i = 0; i < this.data.form.productCategoryInfos.length; i++) { |
|||
if (this.data.form.productCategoryInfos[i].productId == nowItem.id){ |
|||
this.setData({ visible: false }) |
|||
util.showToast('纸品已经存在,请不要重复添加') |
|||
return |
|||
} |
|||
} |
|||
this.data.item.productId = nowItem.id |
|||
this.data.item.settleUnitPrice = nowItem.defaultUnitPrice |
|||
this.data.item.highestUnitPrice = nowItem.highestUnitPrice |
|||
this.data.item.lowestUnitPrice = nowItem.lowestUnitPrice |
|||
this.data.item.productCategoryName = detail.value |
|||
this.statAmount() |
|||
}, |
|||
onHide: function(){ |
|||
this.setData({ visible: false }) |
|||
}, |
|||
bindInput: function (e) { |
|||
this.data.item[e.currentTarget.id] = e.detail.value |
|||
if(e.currentTarget.id == 'deductPercent'){ |
|||
if(util.isEmpty(e.detail.value) || Number(e.detail.value) <= 0){ |
|||
this.data.item.deductWeight = null |
|||
this.data.item.deductPercent = null |
|||
} else { |
|||
this.data.item.deductWeight = math.divide(math.times(this.data.item.netWeight, Number(e.detail.value)), 100).toFixed(2) |
|||
} |
|||
this.statAmount() |
|||
} else if(e.currentTarget.id == 'deductWeight'){ |
|||
if(util.isEmpty(e.detail.value) || Number(e.detail.value) <= 0){ |
|||
this.data.item.deductWeight = null |
|||
this.data.item.deductPercent = null |
|||
} else { |
|||
this.data.item.deductPercent = math.times(math.divide(Number(e.detail.value), this.data.item.netWeight), 100).toFixed(2) |
|||
} |
|||
this.statAmount() |
|||
} else if(e.currentTarget.id == 'settleUnitPrice'){ |
|||
this.statAmount() |
|||
} |
|||
wx.nextTick(() => { |
|||
this.triggerEvent('change', {index: this.data.index, item: this.data.item}); |
|||
}) |
|||
}, |
|||
statAmount: function(){ |
|||
this.data.item.settleWeight = this.data.item.netWeight |
|||
if(!util.isEmpty(this.data.item.deductWeight)){ |
|||
this.data.item.settleWeight = math.minus(this.data.item.netWeight, this.data.item.deductWeight) |
|||
} |
|||
if(!util.isEmpty(this.data.item.settleUnitPrice) && Number(this.data.item.settleUnitPrice) > 0){ |
|||
this.data.item.settlePrice = math.times(this.data.item.settleWeight, this.data.item.settleUnitPrice) |
|||
} else { |
|||
this.data.item.settlePrice = null |
|||
} |
|||
this.setData({ item: this.data.item }) |
|||
}, |
|||
changeDeductType: function(e){ |
|||
this.setData({ ['item.sign']: e.currentTarget.dataset.type, focus: e.currentTarget.dataset.type }) |
|||
} |
|||
} |
|||
|
|||
}) |
|||
@ -0,0 +1,10 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": { |
|||
"van-cell": "/components/cell/index", |
|||
"van-checkbox": "/components/checkbox/index", |
|||
"van-picker": "/components/picker/index", |
|||
"van-popup": "/components/popup/index", |
|||
"van-uploader": "/components/uploader/index" |
|||
} |
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
<!--pages/message/index.wxml--> |
|||
<view style="height:16rpx" wx:if="{{index != 0 }}"></view> |
|||
<van-cell clickable center is-link bind:click="showCategory"> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="flex flex-center text-black"> |
|||
<view class="text-red text-xl" style="line-height: 10px; padding-top: 8px">*</view> |
|||
<text>废纸品类{{index + 1}}</text> |
|||
</view> |
|||
<view class="{{item.productCategoryName ? 'text-black' : 'text-gray'}}">{{item.productCategoryName || '请选择废纸品类'}}</view> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="flex flex-center text-black"> |
|||
<view class="text-red text-xl" style="line-height: 10px; padding-top: 8px">*</view> |
|||
<text>结算单价(元/公斤)</text> |
|||
</view> |
|||
<input id="settleUnitPrice" data-index="{{index}}" type="digit" placeholder-style="color:#aaa" style="text-align: right" |
|||
maxlength="8" placeholder="请输入结算单价" value="{{item.settleUnitPrice || ''}}" bindinput="bindInput" /> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="text-black">净重(公斤)</view> |
|||
<view class="{{item.netWeight ? 'text-black' : 'text-gray'}}">{{item.netWeight || ''}}</view> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="flex flex-center text-black" data-type="1" bindtap="changeDeductType"> |
|||
<van-checkbox value="{{ !item.sign || item.sign == 1 }}" icon-size="32rpx"></van-checkbox> |
|||
<text style="margin-left:8rpx">扣重(公斤)</text> |
|||
</view> |
|||
<input id="deductWeight" type="digit" disabled="{{item.sign == 2}}" focus="{{focus == 1}}" |
|||
placeholder-style="color:#aaa" style="text-align: right" maxlength="10" placeholder="请输入扣重重量" |
|||
value="{{item.deductWeight || ''}}" bindinput="bindInput" data-type="1" bindtap="changeDeductType" /> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="flex flex-center text-black" data-type="2" bindtap="changeDeductType"> |
|||
<van-checkbox value="{{ item.sign == 2 }}" icon-size="32rpx"></van-checkbox> |
|||
<text style="margin-left:8rpx">扣点(%)</text> |
|||
</view> |
|||
<input id="deductPercent" type="digit" disabled="{{form.sign == 1}}" focus="{{focus == 2}}" |
|||
placeholder-style="color:#aaa" style="text-align: right" maxlength="10" placeholder="请输入扣点比例" |
|||
value="{{item.deductPercent}}" bindinput="bindInput" data-type="2" bindtap="changeDeductType" /> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="text-black">结算重量(公斤)</view> |
|||
<view class="{{item.settleWeight ? 'text-black' : 'text-gray'}}">{{ item.settleWeight || item.netWeight }}</view> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="text-black">结算金额(元)</view> |
|||
<view class="{{item.settlePrice ? 'text-black' : 'text-gray'}}">{{ item.settlePrice || '- -' }}</view> |
|||
</view> |
|||
</van-cell> |
|||
|
|||
<van-popup position="bottom" show="{{ visible }}" bind:close="onHide" z-index="29"> |
|||
<van-picker show-toolbar title="选择纸品" columns="{{ columns }}" bind:cancel="onHide" bind:confirm="onConfirm" /> |
|||
</van-popup> |
|||
@ -0,0 +1,23 @@ |
|||
/* pages/mall/shops/index.wxss */ |
|||
.item-content { |
|||
background: rgba(255, 255, 255, 1); |
|||
padding: 32rpx; |
|||
} |
|||
|
|||
.item-cate { |
|||
flex: 5; |
|||
padding: 10rpx 30rpx; |
|||
border-radius: 10rpx; |
|||
border: 1rpx solid #f3f3f3; |
|||
background-color: #f3f3f3; |
|||
} |
|||
|
|||
.cate-tag { |
|||
background-color: #e6f7ff; |
|||
border: 1rpx solid #1890ff; |
|||
} |
|||
|
|||
.transform { |
|||
transform-origin: 50% 50%; |
|||
transform: rotate(180deg); |
|||
} |
|||
@ -1,21 +1,6 @@ |
|||
/* pages/process/order-check/index.wxss */ |
|||
.cate-list { |
|||
margin: 24rpx 30rpx; |
|||
border: 1rpx solid #dcdcdc; |
|||
} |
|||
|
|||
.cate-header { |
|||
min-height: 76rpx; |
|||
background-color: #dcdcdc; |
|||
padding: 0rpx 30rpx; |
|||
} |
|||
|
|||
.cate-index { |
|||
width: 32rpx; |
|||
height: 32rpx; |
|||
line-height: 32rpx; |
|||
text-align: center; |
|||
border-radius: 5000rpx; |
|||
border: 1px solid #666666; |
|||
margin-left: 12rpx |
|||
.info_status{ |
|||
background-image: linear-gradient(90deg, #FF4D2E 6%, #FF952F 100%); |
|||
height:90rpx; |
|||
padding: 0rpx 32rpx; |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save