|
@@ -117,17 +117,29 @@
|
|
|
:model="form"
|
|
|
class="mt-10">
|
|
|
<el-form-item label="退款类型:">
|
|
|
- <el-select v-model="form.refund_type" @change="handleChange">
|
|
|
+ <el-select
|
|
|
+ v-model="form.refund_type"
|
|
|
+ @change="handleChange"
|
|
|
+ style="width: 60%;">
|
|
|
<el-option label="部分退款" :value="1"></el-option>
|
|
|
<el-option label="整单退款" :value="0"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="退款金额:">
|
|
|
+ <el-input
|
|
|
+ v-model="form.refund_price"
|
|
|
+ @input="form.refund_price=form.refund_price.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
|
|
|
+ placeholder="请输入退款金额"
|
|
|
+ clearable
|
|
|
+ style="width: 60%;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="退款商品选择:" v-show="form.refund_type === 1">
|
|
|
<el-table
|
|
|
ref="multipleTable"
|
|
|
:data="order.products"
|
|
|
tooltip-effect="dark"
|
|
|
style="width: 100%"
|
|
|
+ height="300"
|
|
|
@selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
<el-table-column label="商品名称" prop="product_name"></el-table-column>
|
|
@@ -138,6 +150,13 @@
|
|
|
<el-table-column label="退款金额(元)" prop="product_refund_price"></el-table-column>
|
|
|
</el-table>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="退款备注:">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-model="form.refund_remark"
|
|
|
+ placeholder="请输入退款备注"
|
|
|
+ rows="6" style="width: 60%;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="refundDialogVisible = false">取 消</el-button>
|
|
@@ -147,6 +166,8 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { yuan2Fen } from '@/utils'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'orderDetail',
|
|
|
data () {
|
|
@@ -157,7 +178,9 @@ export default {
|
|
|
refundDialogVisible: false,
|
|
|
form: {
|
|
|
refund_type: 0,
|
|
|
- product_ids: []
|
|
|
+ refund_price: '',
|
|
|
+ product_ids: [],
|
|
|
+ refund_remark: ''
|
|
|
},
|
|
|
booLock: false
|
|
|
}
|
|
@@ -184,10 +207,15 @@ export default {
|
|
|
// 退款
|
|
|
async funRefund () {
|
|
|
this.booLock = true
|
|
|
+ let product_ids = this.order.products.map(item => item.id)
|
|
|
+ if (this.form.refund_type) {
|
|
|
+ product_ids = this.form.product_ids.map(item => item.id)
|
|
|
+ }
|
|
|
const { code } = await this.$fetch('/v1/user/order/refund', {
|
|
|
id: this.$route.query.id,
|
|
|
...this.form,
|
|
|
- product_ids: this.form.product_ids.map(item => item.id)
|
|
|
+ product_ids,
|
|
|
+ refund_price: yuan2Fen(this.form.refund_price)
|
|
|
})
|
|
|
this.booLock = false
|
|
|
if (code === 200) {
|