|
|
@@ -0,0 +1,113 @@
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: 'AfterSalesDetails',
|
|
|
+ props: {
|
|
|
+ orderStatusOption: {
|
|
|
+ type: Array,
|
|
|
+ default: () => [
|
|
|
+ {label:'全部',value:'1'},
|
|
|
+ {label:'待发货',value:'2'},
|
|
|
+ {label:'已发货',value:'3'}
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ afterSalesDetails:false,
|
|
|
+ costDetails: [
|
|
|
+ {
|
|
|
+ type: '换货寄回',
|
|
|
+ logisticsNo: '',
|
|
|
+ amount: ''
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getRow(){
|
|
|
+ this.afterSalesDetails = true;
|
|
|
+ },
|
|
|
+ handleCancel() {
|
|
|
+ this.afterSalesDetails = false;
|
|
|
+ },
|
|
|
+ handleConfirm() {
|
|
|
+ this.$emit('confirm', this.costDetails);
|
|
|
+ this.afterSalesDetails = false;
|
|
|
+ },
|
|
|
+ addCostItem() {
|
|
|
+ // 添加费用项
|
|
|
+ this.costDetails.push({
|
|
|
+ type: '',
|
|
|
+ logisticsNo: '',
|
|
|
+ amount: ''
|
|
|
+ });
|
|
|
+ },
|
|
|
+ removeCostItem(index) {
|
|
|
+ // 移除费用项
|
|
|
+ if (this.costDetails.length > 1) {
|
|
|
+ this.costDetails.splice(index, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <el-dialog
|
|
|
+ title="费用详情"
|
|
|
+ :visible.sync="afterSalesDetails"
|
|
|
+ width="600px"
|
|
|
+ >
|
|
|
+ <div class="cost-details">
|
|
|
+ <el-table :data="costDetails" style="width: 100%" border>
|
|
|
+ <el-table-column prop="type" label="费用类型" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <DictSelect v-model="scope.row.type" :dictOptions="orderStatusOption" placeholder="请选择"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="logisticsNo" label="物流单号" width="200">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.logisticsNo" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amount" label="金额">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.amount" placeholder="请输入" type="number"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="removeCostItem(scope.$index)"
|
|
|
+ :disabled="costDetails.length <= 1"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="add-cost-item">
|
|
|
+ <el-button type="text" size="small" @click="addCostItem">
|
|
|
+ <i class="el-icon-plus"></i> 添加费用项
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="handleCancel">取消</el-button>
|
|
|
+ <el-button type="primary" @click="handleConfirm">确认</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.cost-details {
|
|
|
+ margin-bottom: 20px;
|
|
|
+
|
|
|
+ .add-cost-item {
|
|
|
+ margin-top: 10px;
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|