|
@@ -42,7 +42,8 @@
|
|
|
</view>
|
|
|
<view v-if="detailData.qualityInspectionManagement.paramType == '2'" class="row row-bottom">
|
|
|
<view class="left">扣重(公斤)</view>
|
|
|
- <input class="right-bottom" placeholder="输入扣重" @input="changeInput" v-model="detailData.buckleMiscellaneous"></input>
|
|
|
+ <input class="right-bottom" placeholder="输入扣重" @input="changeInput"
|
|
|
+ v-model="detailData.buckleMiscellaneous"></input>
|
|
|
</view>
|
|
|
<view class="row row-bottom" style="border: 0;">
|
|
|
<view class="left">净重(公斤)</view>
|
|
@@ -59,41 +60,76 @@
|
|
|
data() {
|
|
|
return {
|
|
|
detailData: {
|
|
|
- tare:0,
|
|
|
- buckleMiscellaneous:0
|
|
|
+ tare: 0,
|
|
|
+ buckleMiscellaneous: 0
|
|
|
},
|
|
|
+ purchasePriceList: []
|
|
|
}
|
|
|
},
|
|
|
- onShow() {},
|
|
|
+ onShow() {
|
|
|
+ this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
|
|
|
+ warehouseId: this.detailData.warehouseId
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.purchasePriceList = res.data.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
onLoad(options) {
|
|
|
this.detailData = JSON.parse(options.detailData)
|
|
|
- if(!this.detailData.buckleMiscellaneous){
|
|
|
+ if (!this.detailData.buckleMiscellaneous) {
|
|
|
this.detailData.buckleMiscellaneous = 0
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- changeInput(){
|
|
|
- this.detailData.netWeight = (parseFloat(this.detailData.grossWeight)-parseFloat(this.detailData.tare)-parseFloat(this.detailData.buckleMiscellaneous)).toFixed(3)
|
|
|
+ changeInput() {
|
|
|
+ this.detailData.netWeight = (parseFloat(this.detailData.grossWeight) - parseFloat(this.detailData.tare) -
|
|
|
+ parseFloat(this.detailData.buckleMiscellaneous)).toFixed(3)
|
|
|
},
|
|
|
- submit(){
|
|
|
+ submit() {
|
|
|
let that = this;
|
|
|
uni.showModal({
|
|
|
- content:"确定提交检斤信息?",
|
|
|
+ content: "确定提交检斤信息?",
|
|
|
success() {
|
|
|
- console.log(that.detailData)
|
|
|
- that.$api.doRequest('post', '/weighingManagement/api/editTare',that.detailData).then(res => {
|
|
|
- if(res.data.code==200){
|
|
|
- that.$refs.uToast.show({
|
|
|
- title: '提交成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- uni.navigateBack({
|
|
|
- })
|
|
|
- }else{
|
|
|
- that.$refs.uToast.show({
|
|
|
- title: '提交失败',
|
|
|
- type: 'error',
|
|
|
- })
|
|
|
+ that.$api.doRequest('get', '/paymentManagement/cumulant', {
|
|
|
+ compId: JSON.parse(localStorage.getItem('pcUserInfo')).data.compId,
|
|
|
+ customerNumberCard: that.detailData.customerNumberCard,
|
|
|
+ goodsName: that.detailData.goodsName,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ for (let i = 0; i < that.purchasePriceList.length; i++) {
|
|
|
+ if (
|
|
|
+ that.detailData.goodsName == that.purchasePriceList[i]
|
|
|
+ .goodsName
|
|
|
+ ) {
|
|
|
+ let count = (that.purchasePriceList[i].saleLimit -
|
|
|
+ res.data.data / 1000).toFixed(2)
|
|
|
+ if (count <= 0) {
|
|
|
+ count = 0
|
|
|
+ that.$api.msg('该客户累计销售' + this.detailData.goodsName + (
|
|
|
+ res.data.data / 1000).toFixed(2) +
|
|
|
+ '吨,还可售粮' +
|
|
|
+ count + '吨', )
|
|
|
+
|
|
|
+ } else {
|
|
|
+ that.$api.doRequest('post', '/weighingManagement/api/editTare',
|
|
|
+ that.detailData).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ title: '提交成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ uni.navigateBack({})
|
|
|
+ } else {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ title: '提交失败',
|
|
|
+ type: 'error',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -104,48 +140,55 @@
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
- uni-page-body{
|
|
|
+ uni-page-body {
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
- .warp{
|
|
|
+
|
|
|
+ .warp {
|
|
|
background: white;
|
|
|
margin: 20rpx;
|
|
|
padding: 20rpx;
|
|
|
border-radius: 20rpx;
|
|
|
- .title{
|
|
|
+
|
|
|
+ .title {
|
|
|
font-size: 28rpx;
|
|
|
font-weight: 500;
|
|
|
color: #333333;
|
|
|
}
|
|
|
}
|
|
|
-.content{
|
|
|
- .row{
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- padding:21rpx 0;
|
|
|
- .right{
|
|
|
- font-size: 28rpx;
|
|
|
- // font-weight: 600;
|
|
|
- color: #333333;
|
|
|
+
|
|
|
+ .content {
|
|
|
+ .row {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 21rpx 0;
|
|
|
+
|
|
|
+ .right {
|
|
|
+ font-size: 28rpx;
|
|
|
+ // font-weight: 600;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- .row-bottom{
|
|
|
- // border: 0;
|
|
|
- .right-bottom{
|
|
|
- width: 300rpx;
|
|
|
- font-size: 28rpx;
|
|
|
- font-weight: 600;
|
|
|
- color: #333333;
|
|
|
- text-align: right;
|
|
|
+
|
|
|
+ .row-bottom {
|
|
|
+
|
|
|
+ // border: 0;
|
|
|
+ .right-bottom {
|
|
|
+ width: 300rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333333;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-.submit{
|
|
|
+
|
|
|
+ .submit {
|
|
|
position: fixed;
|
|
|
- bottom:40rpx;
|
|
|
+ bottom: 40rpx;
|
|
|
width: 90%;
|
|
|
background: #22C572;
|
|
|
border-radius: 50rpx;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
</style>
|