17 changed files with 605 additions and 484 deletions
Split View
Diff Options
-
13api/saas.js
-
1pages/home/index/index.js
-
67pages/process/outside-add/index.js
-
21pages/process/outside-add/index.wxml
-
13pages/process/outside-check/index.js
-
66pages/process/outside-info/index.js
-
3pages/process/outside-info/index.json
-
256pages/process/outside-info/index.wxml
-
103pages/process/outside-item/index.js
-
8pages/process/outside-item/index.json
-
100pages/process/outside-item/index.wxml
-
23pages/process/outside-item/index.wxss
-
30pages/process/outside-list/index.js
-
68pages/process/outside-list/index.wxml
-
130pages/process/outside-price/index.js
-
1pages/process/outside-price/index.json
-
186pages/process/outside-price/index.wxml
@ -0,0 +1,103 @@ |
|||
// pages/message/index.js
|
|||
const util = require('../../../utils/util') |
|||
const math = require('../../../utils/math') |
|||
|
|||
Component({ |
|||
options: { |
|||
addGlobalClass: true, |
|||
multipleSlots: true |
|||
}, |
|||
properties: { |
|||
item: { |
|||
type: Object, |
|||
value: null, |
|||
observer(value) { |
|||
this.setValues(value); |
|||
}}, |
|||
index: { type: Number, value: 0 }, |
|||
status: { type: Number, value: 0 } |
|||
}, |
|||
data: { |
|||
focus: 0, |
|||
fileList: [] |
|||
}, |
|||
methods: { |
|||
setValues: function(value){ |
|||
if(value && value.weightNoteImage){ |
|||
this.data.fileList = [] |
|||
for (let index = 0; index < value.weightNoteImage.length; index++) { |
|||
this.data.fileList.push({url: value.weightNoteImage[index]}) |
|||
} |
|||
this.setData({fileList: this.data.fileList}) |
|||
} |
|||
}, |
|||
bindInput: function (e) { |
|||
this.data.item[e.currentTarget.id] = e.detail.value |
|||
if(e.currentTarget.id == 'grossWeight' || e.currentTarget.id == 'tareWeight'){ |
|||
if(Number(this.data.item.grossWeight) > 0){ |
|||
if(Number(this.data.item.tareWeight) > 0){ |
|||
if(Number(this.data.item.grossWeight) > Number(this.data.item.tareWeight)){ |
|||
var netWeight = math.minus(this.data.item.grossWeight, this.data.item.tareWeight) |
|||
var estimatedAmount = math.times(netWeight, this.data.item.unitPrice).toFixed(2) |
|||
this.setData({['item.netWeight']: netWeight, ['item.estimatedAmount']: estimatedAmount}) |
|||
} else { |
|||
this.setData({['item.netWeight']: null, ['item.estimatedAmount']: null}) |
|||
} |
|||
} else { |
|||
this.setData({['item.netWeight']: Number(this.data.item.grossWeight), ['item.estimatedAmount']: null}) |
|||
} |
|||
} else { |
|||
this.setData({['item.netWeight']: null, ['item.estimatedAmount']: null}) |
|||
} |
|||
} else 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.totalWeight, 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.totalWeight), 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 }) |
|||
}, |
|||
fileChange: function({detail}){ |
|||
this.data.fileList = detail.fileList |
|||
var imageUrls = [] |
|||
for (let index = 0; index < this.data.fileList.length; index++) { |
|||
imageUrls.push(this.data.fileList[index].url) |
|||
} |
|||
this.data.item.weightNoteImage = imageUrls |
|||
wx.nextTick(() => { |
|||
this.triggerEvent('change', {index: this.data.index, item: this.data.item}); |
|||
}) |
|||
} |
|||
} |
|||
|
|||
}) |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": { |
|||
"van-cell": "/components/cell/index", |
|||
"van-checkbox": "/components/checkbox/index", |
|||
"van-uploader": "/components/uploader/index" |
|||
} |
|||
} |
|||
@ -0,0 +1,100 @@ |
|||
<!--pages/message/index.wxml--> |
|||
<van-cell clickable center> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="text-black">废纸品类{{index + 1}}</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="text-black">预估单价(元/公斤)</view> |
|||
<view class="{{item.unitPrice ? 'text-black' : 'text-gray'}}">{{item.unitPrice || '请输入单价'}}</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" wx:if="{{status == 0}}">*</view> |
|||
<text>毛重(公斤)</text> |
|||
</view> |
|||
<input id="grossWeight" type="digit" placeholder-style="color:#aaa" style="text-align: right" |
|||
maxlength="8" placeholder="请输入毛重" disabled="{{status != 0}}" value="{{item.grossWeight || ''}}" bindinput="bindInput" /> |
|||
</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" wx:if="{{status == 0}}">*</view> |
|||
<text>皮重(公斤)</text> |
|||
</view> |
|||
<input id="tareWeight" type="digit" placeholder-style="color:#aaa" style="text-align: right" |
|||
maxlength="8" placeholder="请输入皮重" disabled="{{status != 0}}" value="{{item.tareWeight || ''}}" 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="text-black">预估金额(元)</view> |
|||
<view class="{{item.estimatedAmount ? 'text-black' : 'text-gray'}}">{{item.estimatedAmount || ''}}</view> |
|||
</view> |
|||
</van-cell> |
|||
<view class="bg-white" style="padding: 24rpx 32rpx 20rpx 32rpx"> |
|||
<view class="flex flex-justify" style="padding-bottom: 24rpx"> |
|||
<view class="flex flex-center text-black"> |
|||
<view class="text-red text-xl" style="line-height: 10px; padding-top: 8px" wx:if="{{status == 0}}">*</view> |
|||
<text>过磅凭证</text> |
|||
</view> |
|||
<text class="text-gray">3-6张,每图片大小限制5M</text> |
|||
</view> |
|||
<van-uploader file-list="{{ item.fileList }}" multiple max-count="6" deletable="{{status == 0}}" show-upload="{{status == 0}}" |
|||
max-size="{{1024 * 1024 * 5}}" bind:file-change="fileChange" /> |
|||
</view> |
|||
<van-cell wx:if="{{status == 1}}"> |
|||
<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 wx:if="{{status == 1}}"> |
|||
<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 wx:if="{{status == 1}}"> |
|||
<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 wx:if="{{status == 1}}"> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="text-black">结算重量(公斤)</view> |
|||
<view class="text-gray">{{form.settleWeight || '- -'}}</view> |
|||
</view> |
|||
</van-cell> |
|||
<van-cell wx:if="{{status == 1}}"> |
|||
<view slot="title" class="flex flex-justify"> |
|||
<view class="text-black">结算金额(元)</view> |
|||
<view class="text-gray">{{form.settlePrice || '- -'}}</view> |
|||
</view> |
|||
</van-cell> |
|||
@ -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); |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save