Browse Source

修改客户退货和申请数字精度

wms3.0_pda
lijuncheng 10 months ago
parent
commit
e49387b9ed
  1. 8
      common/calc.js
  2. 27
      common/record.js
  3. 2
      mycomponents/item/itemQty.vue
  4. 4
      mycomponents/qty/balanceQtyEdit.vue
  5. 4
      mycomponents/record/recordComDetailCard.vue
  6. 2
      mycomponents/status/balanceStatus.vue
  7. 5
      pages/customerReturn/record/returnRecord.vue
  8. 3
      pages/customerReturn/request/customerReturnRequestCreate.vue
  9. 2
      static/config.json

8
common/calc.js

@ -2,16 +2,16 @@
import { Decimal } from 'decimal.js';//引入
class Calc {
add(num1,num2) {
return new Decimal(num1).add(new Decimal(num2))
return new Decimal(num1).add(new Decimal(num2)).toNumber()
}
sub(num1,num2) {
return new Decimal(num1).sub(new Decimal(num2))
return new Decimal(num1).sub(new Decimal(num2)).toNumber()
}
mul(num1,num2) {
return new Decimal(num1).mul(new Decimal(num2))
return new Decimal(num1).mul(new Decimal(num2)).toNumber()
}
div(num1,num2) {
return new Decimal(num1).div(new Decimal(num2))
return new Decimal(num1).div(new Decimal(num2)).toNumber()
}
}
export const calc = new Calc();

27
common/record.js

@ -6,6 +6,10 @@ import {
getDirectoryItemArray,
} from '@/common/directory.js';
import { calc } from '@/common/calc'
import { Decimal } from 'decimal.js';//引入
import {
deepCopyData
} from '@/common/basic.js';
export function createItemInfo(balance, pack) {
let item = {
@ -13,25 +17,24 @@ export function createItemInfo(balance, pack) {
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
qty: Number(balance.qty),
handleQty: 0,
qty: new Decimal(balance.qty).toNumber(),
handleQty:new Decimal(0).toNumber(),
uom: pack.uom,
subList: []
}
return item;
}
export function createDetailInfo(data, pack) {
data.scaned = true;
export function createDetailInfo(balance, pack) {
balance.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
// data.inventoryStatus = data.inventoryStatus;
let detail = {};
Object.assign(detail, data)
detail.balanceQty = Number(detail.qty)
detail.qty = Number(detail.qty);
detail.stdPackQty = Number(pack.stdPackQty)
let detail = deepCopyData(balance);
detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(detail.qty).toNumber();
detail.stdPackQty = new Decimal(pack.stdPackQty).toNumber()
detail.stdPackUnit = pack.stdPackUnit
detail.handleQty =0;
detail.handleQty = new Decimal(detail.qty).toNumber() ;
detail.package = pack;
return detail;
@ -40,10 +43,10 @@ export function createDetailInfo(data, pack) {
//计算实际数量
export function calcHandleQty(detailSource) {
for (let item of detailSource) {
item.qty = 0;
item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
item.qty = calc.add(item.qty,detail.qty);
item.handleQty = calc.add(item.handleQty,detail.handleQty);
}
}
}

2
mycomponents/item/itemQty.vue

@ -6,7 +6,7 @@
<view>
<balanceQty v-if="showItemQty" :dataContent="dataContent"></balanceQty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="Number(handleQty)" :isShowStatus="false">
:handleQty="dataContent.handleQty" :isShowStatus="false">
</compare-qty>
</view>
<!-- <view v-else>

4
mycomponents/qty/balanceQtyEdit.vue

@ -77,7 +77,7 @@
import StdUom from '@/mycomponents/qty/StdUom.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
components: {
uom,
@ -142,7 +142,7 @@
this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus
this.toInventoryStatus = this.dataContent.toInventoryStatus
this.allQty = Number(handleQty)
this.allQty = handleQty
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 500)

4
mycomponents/record/recordComDetailCard.vue

@ -88,7 +88,7 @@
isShowItemQty: {
type: Boolean,
default: true
default: false
},
},
watch: {
@ -150,7 +150,7 @@
edit(item) {
this.editItem = item;
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.qty);
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.handleQty);
},
detail(item) {

2
mycomponents/status/balanceStatus.vue

@ -4,7 +4,7 @@
<text :class="statusStyle(status)" style='font-size: 38rpx;margin-right: 15rpx;'>
{{statusDesc(status) }}</text>
<!-- v-show="allowEdit" -->
<image style="width: 40rpx; height:40rpx" src="/static/icons/icons_edit.svg" @click="open">
<image v-if="allowEdit" style="width: 40rpx; height:40rpx" src="/static/icons/icons_edit.svg" @click="open">
</image>
</view>
<status-edit :status='status' ref="statusEdit" @updateStatus="updateStatus"></status-edit>

5
pages/customerReturn/record/returnRecord.vue

@ -149,8 +149,10 @@
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
@ -316,7 +318,6 @@
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
@ -346,7 +347,7 @@
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.qty = detail.handleQty;
submitItem.package ="";
subList.push(submitItem)

3
pages/customerReturn/request/customerReturnRequestCreate.vue

@ -56,6 +56,7 @@
</template>
<script>
import { calc } from '@/common/calc'
import {
customerReturnRequestSubmit,
getBasicCustomerList
@ -210,7 +211,7 @@
});
},
calcHandleQty() {
calcHandleQty(this.detailSource)
calcHandleQty(this.detailSource);
this.$forceUpdate();
},

2
static/config.json

@ -18,7 +18,7 @@
"request_url": {
"name": "request_url",
"value": "http://192.168.0.158:12080/admin-api",
"value": "http://dev.ccwin-in.com:25100/api/admin-api",
"dev2": "http://192.168.0.157:12080/admin-api",
"chefang": "http://192.168.0.176:12080/admin-api",
"chenxinming": "http://192.179.0.230:12080/admin-api",

Loading…
Cancel
Save