|
@@ -614,7 +614,17 @@
|
|
|
justify-content: space-between;
|
|
|
"
|
|
|
>
|
|
|
- <p>订单总金额:{{ accMul(ruleForm.good_num, ruleForm.new_good_price) || 0 }}</p>
|
|
|
+ <p>
|
|
|
+ 订单总金额:
|
|
|
+ {{
|
|
|
+ priceAccMul(
|
|
|
+ ruleForm && ruleForm.good_num ? ruleForm.good_num : "0",
|
|
|
+ ruleForm && ruleForm.new_good_price
|
|
|
+ ? ruleForm && ruleForm.new_good_price
|
|
|
+ : "0"
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </p>
|
|
|
<el-button :size="'mini'" type="primary" @click="submitForm">保 存 </el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -638,6 +648,7 @@ import showVoucherModel from "@/components/show-voucher-model";
|
|
|
import searchGoodOnlineModal from "@/components/search-good-online-modal";
|
|
|
import { addColumns } from "./ShowDataTableColumns";
|
|
|
import { mapGetters } from "vuex";
|
|
|
+import { accMul } from "@/utils/validate";
|
|
|
export default {
|
|
|
name: "salesOrderDetail",
|
|
|
mixins: [mixinPage, resToken],
|
|
@@ -928,20 +939,8 @@ export default {
|
|
|
this.initForm();
|
|
|
},
|
|
|
methods: {
|
|
|
- //乘法精度问题
|
|
|
- accMul(arg1, arg2) {
|
|
|
- var m = 0,
|
|
|
- s1 = arg1.toString(),
|
|
|
- s2 = arg2.toString();
|
|
|
- try {
|
|
|
- m += s1.split(".")[1].length;
|
|
|
- } catch (e) {}
|
|
|
- try {
|
|
|
- m += s2.split(".")[1].length;
|
|
|
- } catch (e) {}
|
|
|
- return (
|
|
|
- (Number(s1.replace(".", "")) * Number(s2.replace(".", ""))) / Math.pow(10, m)
|
|
|
- );
|
|
|
+ priceAccMul(a, b) {
|
|
|
+ return accMul(a, b);
|
|
|
},
|
|
|
async initForm() {
|
|
|
this.status = "";
|
|
@@ -1189,7 +1188,6 @@ export default {
|
|
|
}
|
|
|
if (!this.priceLoding) {
|
|
|
const { isok, price, stock } = await this.set_salegetprice();
|
|
|
- console.log(this.accMul(price, 1));
|
|
|
this.ruleForm.good_price = isok ? price : 0;
|
|
|
}
|
|
|
|
|
@@ -1326,8 +1324,8 @@ export default {
|
|
|
model.addrlist = [];
|
|
|
model.customer_code = model.customer_code.toString();
|
|
|
const { good_price, new_good_price } = model;
|
|
|
- let a = this.accMul(good_price, "1"),
|
|
|
- b = this.accMul(new_good_price, "1");
|
|
|
+ let a = accMul(good_price, "1"),
|
|
|
+ b = accMul(new_good_price, "1");
|
|
|
if (a !== b) {
|
|
|
model.good_price = model.new_good_price;
|
|
|
}
|