|
@@ -1,58 +1,48 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-dialog title="修改" width="500px" :visible.sync="soundVisible">
|
|
|
- <el-form
|
|
|
- :model="soundForm"
|
|
|
- label-position="right"
|
|
|
- label-width="120px"
|
|
|
- :inline="true"
|
|
|
- ref="soundForm"
|
|
|
- >
|
|
|
+ <el-dialog title="修改"
|
|
|
+ width="500px"
|
|
|
+ :visible.sync="soundVisible">
|
|
|
+ <el-form :model="soundForm"
|
|
|
+ label-position="right"
|
|
|
+ label-width="120px"
|
|
|
+ :inline="true"
|
|
|
+ ref="soundForm">
|
|
|
<el-form-item label="原乐器">
|
|
|
- <el-input
|
|
|
- style="width: 330px"
|
|
|
- disabled
|
|
|
- v-model="soundForm.originalMusicalGoods"
|
|
|
- ></el-input>
|
|
|
+ <el-input style="width: 330px"
|
|
|
+ disabled
|
|
|
+ v-model="soundForm.originalMusicalGoods"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="原教辅">
|
|
|
- <el-input
|
|
|
- style="width: 330px"
|
|
|
- disabled
|
|
|
- v-model="soundForm.originalAccessories"
|
|
|
- ></el-input>
|
|
|
+ <el-input style="width: 330px"
|
|
|
+ disabled
|
|
|
+ v-model="soundForm.originalAccessories"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="更换乐器">
|
|
|
- <el-input
|
|
|
- style="width: 330px"
|
|
|
- disabled
|
|
|
- v-model="soundForm.changeMusicalGoods"
|
|
|
- ></el-input>
|
|
|
+ <el-input style="width: 330px"
|
|
|
+ disabled
|
|
|
+ v-model="soundForm.changeMusicalGoods"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="更换教辅">
|
|
|
- <el-input
|
|
|
- style="width: 330px"
|
|
|
- disabled
|
|
|
- v-model="soundForm.changeAccessories"
|
|
|
- ></el-input>
|
|
|
+ <el-input style="width: 330px"
|
|
|
+ disabled
|
|
|
+ v-model="soundForm.changeAccessories"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="支付差价">
|
|
|
- <el-input
|
|
|
- style="width: 330px"
|
|
|
- disabled
|
|
|
- v-model="soundForm.money"
|
|
|
- ></el-input>
|
|
|
+ <el-input style="width: 330px"
|
|
|
+ disabled
|
|
|
+ v-model="soundForm.money"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="成本差(元)">
|
|
|
- <el-input
|
|
|
- style="width: 330px"
|
|
|
- v-model="soundForm.costMargin"
|
|
|
- ></el-input>
|
|
|
+ <el-input style="width: 330px"
|
|
|
+ v-model="soundForm.costMargin"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
+ <div slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
<el-button @click="soundVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="resetCostMargin">确 定</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ @click="resetCostMargin">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -64,7 +54,7 @@ import numeral from "numeral";
|
|
|
import { updateCostMargin } from "@/api/businessManager";
|
|
|
export default {
|
|
|
props: ["show", "item"],
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
soundForm: {
|
|
|
originalMusicalGoods: null,
|
|
@@ -78,17 +68,22 @@ export default {
|
|
|
soundVisible: false,
|
|
|
};
|
|
|
},
|
|
|
- mounted() {},
|
|
|
+ mounted () { },
|
|
|
methods: {
|
|
|
- accessoriesFormatter(accessories) {
|
|
|
- let arr = accessories.map((res) => {
|
|
|
- return res.name;
|
|
|
- });
|
|
|
- return arr.join(",");
|
|
|
+ accessoriesFormatter (accessories) {
|
|
|
+ if (accessories?.length > 0) {
|
|
|
+ let arr = accessories.map((res) => {
|
|
|
+ return res.name;
|
|
|
+ });
|
|
|
+ return arr.join(",");
|
|
|
+ } else {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
- resetCostMargin() {
|
|
|
- updateCostMargin({id:this.soundForm.id,costMargin:this.soundForm.costMargin}).then(res=>{
|
|
|
- if(res.code == 200){
|
|
|
+ resetCostMargin () {
|
|
|
+ updateCostMargin({ id: this.soundForm.id, costMargin: this.soundForm.costMargin }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
this.$message.success('修改成功')
|
|
|
this.$emit('getList')
|
|
|
}
|
|
@@ -96,10 +91,10 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
|
- show(val) {
|
|
|
+ show (val) {
|
|
|
this.soundVisible = val;
|
|
|
},
|
|
|
- soundVisible(val) {
|
|
|
+ soundVisible (val) {
|
|
|
if (!val) {
|
|
|
this.$emit("closeReset");
|
|
|
}
|
|
@@ -107,7 +102,7 @@ export default {
|
|
|
item: {
|
|
|
immediate: true,
|
|
|
deep: true,
|
|
|
- handler(row, oldValue) {
|
|
|
+ handler (row, oldValue) {
|
|
|
if (row) {
|
|
|
this.soundForm = {
|
|
|
originalMusicalGoods: row.originalMusicalGoods
|
|
@@ -122,8 +117,8 @@ export default {
|
|
|
this.accessoriesFormatter(row.changeAccessoriesGoods) || null,
|
|
|
money: numeral(
|
|
|
row.changeMusicalPrice +
|
|
|
- row.changeAccessoriesPrice -
|
|
|
- (row.originalMusicalPrice + row.originalAccessoriesPrice)
|
|
|
+ row.changeAccessoriesPrice -
|
|
|
+ (row.originalMusicalPrice + row.originalAccessoriesPrice)
|
|
|
).format("0,0.00"),
|
|
|
costMargin: numeral(row.costMargin).format("0,0.00"),
|
|
|
id: row.id,
|