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';//引入 import { Decimal } from 'decimal.js';//引入
class Calc { class Calc {
add(num1,num2) { add(num1,num2) {
return new Decimal(num1).add(new Decimal(num2)) return new Decimal(num1).add(new Decimal(num2)).toNumber()
} }
sub(num1,num2) { sub(num1,num2) {
return new Decimal(num1).sub(new Decimal(num2)) return new Decimal(num1).sub(new Decimal(num2)).toNumber()
} }
mul(num1,num2) { mul(num1,num2) {
return new Decimal(num1).mul(new Decimal(num2)) return new Decimal(num1).mul(new Decimal(num2)).toNumber()
} }
div(num1,num2) { 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(); export const calc = new Calc();

27
common/record.js

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

4
mycomponents/qty/balanceQtyEdit.vue

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

4
mycomponents/record/recordComDetailCard.vue

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

2
mycomponents/status/balanceStatus.vue

@ -4,7 +4,7 @@
<text :class="statusStyle(status)" style='font-size: 38rpx;margin-right: 15rpx;'> <text :class="statusStyle(status)" style='font-size: 38rpx;margin-right: 15rpx;'>
{{statusDesc(status) }}</text> {{statusDesc(status) }}</text>
<!-- v-show="allowEdit" --> <!-- 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> </image>
</view> </view>
<status-edit :status='status' ref="statusEdit" @updateStatus="updateStatus"></status-edit> <status-edit :status='status' ref="statusEdit" @updateStatus="updateStatus"></status-edit>

5
pages/customerReturn/record/returnRecord.vue

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

3
pages/customerReturn/request/customerReturnRequestCreate.vue

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

2
static/config.json

@ -18,7 +18,7 @@
"request_url": { "request_url": {
"name": "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", "dev2": "http://192.168.0.157:12080/admin-api",
"chefang": "http://192.168.0.176:12080/admin-api", "chefang": "http://192.168.0.176:12080/admin-api",
"chenxinming": "http://192.179.0.230:12080/admin-api", "chenxinming": "http://192.179.0.230:12080/admin-api",

Loading…
Cancel
Save