优化库存盘点
This commit is contained in:
parent
6c8e4d868a
commit
67207be4f2
|
|
@ -5,12 +5,12 @@ ENV = 'development'
|
|||
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
|
||||
# 测试
|
||||
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||
# 生产
|
||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.96:8000'
|
||||
# 张松
|
||||
VUE_APP_BASE_API = 'http://192.168.2.147:8000/'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.147:8000/'
|
||||
VUE_APP_WS_API = 'ws://192.168.2.128:8000'
|
||||
|
||||
# 是否启用 babel-plugin-dynamic-import-node插
|
||||
|
|
@ -416,3 +416,20 @@ export function isPcBowser() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保留小数n位,不进行四舍五入
|
||||
* num你传递过来的数字,
|
||||
* decimal你保留的几位,默认保留小数后两位
|
||||
*/
|
||||
export function formatDecimal(num, decimal = 2) {
|
||||
num = num.toString();
|
||||
const index = num.indexOf(".");
|
||||
if (index !== -1) {
|
||||
num = num.substring(0, decimal + index + 1);
|
||||
} else {
|
||||
num = num.substring(0);
|
||||
}
|
||||
//截取后保留两位小数
|
||||
return parseFloat(num).toFixed(decimal);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDecimal } from '@/utils'
|
||||
import { tbProductStocktakin, tbProductStocktakinGet } from '@/api/invoicing'
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -109,7 +110,7 @@ export default {
|
|||
return this.form.stocktakinNum - this.detail.stockNumber
|
||||
},
|
||||
profitPrice() {
|
||||
return (this.form.stocktakinNum - this.detail.stockNumber) * this.detail.salePrice
|
||||
return formatDecimal((this.form.stocktakinNum - this.detail.stockNumber) * this.detail.salePrice)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue