|
@@ -461,7 +461,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
if (this.pageStu == "check") {
|
|
|
- console.log("数据", this.row);
|
|
|
+ // console.log("数据", this.row);
|
|
|
this.getDetails(this.row);
|
|
|
} else if (this.pageStu == "edit") {
|
|
|
this.getDetails(this.row);
|
|
@@ -470,26 +470,35 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
// 一个计算属性的 getter
|
|
|
- publishedBooksMessage() {
|
|
|
- // `this` 指向当前组件实例
|
|
|
- // var s = 0
|
|
|
- this.basicForm.serviceFee = 0;
|
|
|
- this.basicForm.itemList.forEach((item) => {
|
|
|
- this.basicForm.serviceFee += Number(item.serviceFee);
|
|
|
- });
|
|
|
- return this.basicForm.serviceFee;
|
|
|
+ publishedBooksMessage: {
|
|
|
+ get() {
|
|
|
+ this.basicForm.serviceFee = this.basicForm.itemList.reduce(
|
|
|
+ (sum, item) => {
|
|
|
+ return (sum += this.getToFixed(item.ratio * 0.01 * item.amount));
|
|
|
+ },
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ return this.basicForm.serviceFee;
|
|
|
+ },
|
|
|
+ set() {},
|
|
|
},
|
|
|
- publishedBooksMessage2() {
|
|
|
- // `this` 指向当前组件实例
|
|
|
- // var s = 0
|
|
|
- this.basicForm.totalAmount = 0;
|
|
|
- this.basicForm.itemList.forEach((item) => {
|
|
|
- this.basicForm.totalAmount += Number(item.amount);
|
|
|
- });
|
|
|
- return this.basicForm.totalAmount;
|
|
|
+ publishedBooksMessage2: {
|
|
|
+ get() {
|
|
|
+ this.basicForm.totalAmount = this.basicForm.itemList.reduce(
|
|
|
+ (sum, item) => {
|
|
|
+ return (sum += this.getToFixed(item.qty * item.price));
|
|
|
+ },
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ return this.basicForm.totalAmount;
|
|
|
+ },
|
|
|
+ set() {},
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ getToFixed(prop, val = 2) {
|
|
|
+ return Number(prop.toFixed(val));
|
|
|
+ },
|
|
|
getDetails(row) {
|
|
|
Mxdetail(row.id).then((res) => {
|
|
|
if (res.code === 200) {
|
|
@@ -521,8 +530,6 @@ export default {
|
|
|
// return item.id
|
|
|
// })
|
|
|
this.ids = selection;
|
|
|
- // console.log('选中数组1', selection)
|
|
|
- console.log("选中数组", this.ids);
|
|
|
},
|
|
|
editLine() {
|
|
|
if (this.ids.length <= 0) {
|
|
@@ -556,7 +563,6 @@ export default {
|
|
|
} catch (error) {}
|
|
|
},
|
|
|
confirm() {
|
|
|
- console.log(this.ids);
|
|
|
console.log("修改值", this.dialogForm);
|
|
|
this.ids.forEach((item) => {
|
|
|
item[this.dialogForm.region] = this.dialogForm.info;
|
|
@@ -588,8 +594,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
changeFei(index, row) {
|
|
|
- console.log(index);
|
|
|
- console.log(row);
|
|
|
row.amount = row.qty * row.price;
|
|
|
row.serviceFee = (row.ratio * 0.01 * row.amount).toFixed(2);
|
|
|
// this.basicForm.serviceFee = this.basicForm.itemList.map(item => {
|