|
@@ -12,7 +12,7 @@
|
|
|
<el-col class="top-btn">
|
|
|
<el-button type="primary" size="mini" @click="toBack()">返回</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="9" class="one">
|
|
|
+ <el-col :span="10" class="one">
|
|
|
<el-col :span="24" class="add">
|
|
|
<el-col :span="2">
|
|
|
<i class="el-icon-location"></i>
|
|
@@ -27,21 +27,21 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="shop"> <i class="el-icon-s-shop"></i>{{ shop.name }}</el-col>
|
|
|
- <el-col :span="24" v-for="(item, index) in list" :key="index">
|
|
|
- <el-col :span="24" class="goods bode">
|
|
|
+ <el-col :span="24" v-for="item in list" :key="item._id || item.set_id">
|
|
|
+ <el-col :span="24" class="goods bode" v-if="!item.is_set">
|
|
|
<el-col :span="6" v-if="item.file && item.file.length != 0"><el-image class="image" :src="item.file[0].url"></el-image></el-col>
|
|
|
- <el-col :span="6" v-else-if="item.goods && item.goods.file && item.goods.file.length != 0"
|
|
|
- ><el-image class="image" :src="item.goods.file[0].url"></el-image
|
|
|
- ></el-col>
|
|
|
+ <el-col :span="6" v-else-if="item.goods && item.goods.file && item.goods.file.length != 0">
|
|
|
+ <el-image class="image" :src="item.goods.file[0].url"></el-image>
|
|
|
+ </el-col>
|
|
|
<el-col :span="6" v-else><el-image class="image" :src="item.url"></el-image></el-col>
|
|
|
<el-col :span="18">
|
|
|
<el-col :span="12">
|
|
|
- <el-col>
|
|
|
- <p>{{ item.goods.name }}</p>
|
|
|
- </el-col>
|
|
|
- <el-col>
|
|
|
- <p>规格:{{ item.name }}</p>
|
|
|
+ <el-col
|
|
|
+ ><p>{{ item.goods.name }}</p>
|
|
|
</el-col>
|
|
|
+ <el-col
|
|
|
+ ><p>规格:{{ item.name }}</p></el-col
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="12" class="money">
|
|
|
<el-col>
|
|
@@ -54,14 +54,46 @@
|
|
|
<el-col>
|
|
|
<span class="spanfour" style="color: blue" @click="toUrl(item.goods.url)"> 查看商品来源:{{ item.goods.source }}</span>
|
|
|
</el-col>
|
|
|
- <el-col>
|
|
|
- <p>{{ item.is_afterSale == true ? '已申请售后' : '未申请售后' }}</p>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="item.is_afterSale == false" style="text-align: right">
|
|
|
+ <el-button type="danger" @click="toSales('1')" v-if="status == '1'" size="mini"> 取消订单 </el-button>
|
|
|
+ <el-button type="danger" @click="toSales('2')" v-else-if="status == '2' || status == '2-'" size="mini"> 拒收 </el-button>
|
|
|
+ <el-button type="danger" @click="toApply('order', item)" v-else-if="status == '3'" size="mini"> 申请售后 </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" style="text-align: right">
|
|
|
+ <p>{{ item.is_afterSale == true ? '已申请售后' : '未申请售后' }}</p>
|
|
|
+ <p>{{ item.is_rate == true ? '已评价' : '未评价' }}</p>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="goods bode" v-if="item.is_set == '0'">
|
|
|
+ <el-col :span="24" style="text-align: center; font-size: 18px">{{ item.name || '套装名称' }}</el-col>
|
|
|
+ <el-col :span="24" v-for="i in item.goods" :key="i.spec._id">
|
|
|
+ <el-col :span="6" class="image" v-if="i.spec.file && i.spec.file.length != 0"><el-image :src="i.spec.file[0].url"></el-image></el-col>
|
|
|
+ <el-col :span="6" class="image" v-else-if="i.goods.file && i.goods.file.length != 0"><el-image :src="i.goods.file[0].url"></el-image></el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-col :span="24"> {{ i.goods_name }} </el-col>
|
|
|
+ <el-col :span="24"> 规格:{{ i.spec_name }} </el-col>
|
|
|
</el-col>
|
|
|
- <el-col>
|
|
|
- <p>{{ item.is_rate == true ? '已评价' : '未评价' }}</p>
|
|
|
+ <el-col :span="12" class="money">
|
|
|
+ <el-col :span="24"> X{{ i.set_num }} </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <span class="spanfour" style="color: blue" @click="toUrl(i.goods.url)"> 查看商品来源:{{ i.goods.source }}</span>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="i.is_afterSale == false" style="text-align: right">
|
|
|
+ <el-button type="danger" @click="toSales('1')" v-if="status == '1'" size="mini"> 取消订单 </el-button>
|
|
|
+ <el-button type="danger" @click="toSales('2')" v-else-if="status == '2' || status == '2-'" size="mini"> 拒收 </el-button>
|
|
|
+ <el-button type="danger" @click="toApply('set', i, item)" v-else-if="status == '3'" size="mini"> 申请售后 </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" style="text-align: right">
|
|
|
+ <el-col :span="24"> {{ i.is_afterSale == true ? '已申请售后' : '未申请售后' }} </el-col>
|
|
|
+ <el-col :span="24">{{ i.is_rate == true ? '已评价' : '未评价' }}</el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24" style="text-align: right; font-size: 18px"> X{{ item.buy_num }} </el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="bode">
|
|
|
<el-col :span="6">运费</el-col>
|
|
@@ -78,10 +110,10 @@
|
|
|
<el-col :span="6">配送方式</el-col>
|
|
|
<el-col :span="18" class="other">快递配送</el-col>
|
|
|
</el-col>
|
|
|
- <el-col :span="24" class="goods_total bode">
|
|
|
- <el-col :span="6">快递费</el-col>
|
|
|
- <el-col :span="18" class="other">
|
|
|
- <p>¥{{ total_detail.freight_total || '0' }}</p>
|
|
|
+ <el-col :span="24" v-for="(item, index) in total_detail" :key="index">
|
|
|
+ <el-col :span="8">{{ item.zh }}</el-col>
|
|
|
+ <el-col :span="16" class="other">
|
|
|
+ <p>¥{{ item.money }}</p>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="goods_total bode">
|
|
@@ -107,61 +139,53 @@
|
|
|
<el-col :span="18" class="other">{{ transport.shop_transport_name || '暂无快递信息' }}</el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
- <el-col :span="9" class="one">
|
|
|
- <el-button type="danger" @click="toSales('1')" v-if="this.status == '1'"> 取消订单 </el-button>
|
|
|
- <el-button type="danger" @click="toSales('2')" v-if="this.status == '2' || this.status == '2-'"> 拒收 </el-button>
|
|
|
- <el-col v-if="this.status == '3'">
|
|
|
- <el-form :model="form" :rules="rules" ref="form" label-width="180px">
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="售后商品" prop="goods">
|
|
|
- <el-select v-model="form.goods" clearable filterable placeholder="请选择售后商品" size="small" style="width: 100%" @change="goodsChange">
|
|
|
- <el-option v-for="i in list" :key="i.goods.name" :label="i.goods.name" :value="i.id"> </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="售后类型" prop="type">
|
|
|
- <el-select v-model="form.type" clearable filterable placeholder="请选择售后类型" size="small" style="width: 100%" @change="typeChange">
|
|
|
- <el-option v-for="i in typeList" :key="i.value" :label="i.label" :value="i.value"> </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" v-if="this.form.type == '1' || this.form.type == '2'">
|
|
|
- <el-form-item label="退款金额" prop="money">
|
|
|
- <el-input v-model="form.money" placeholder="请输入退款金额" size="small" type="Number" @input="toMoney"></el-input>
|
|
|
- <p>
|
|
|
- 退款金额不得超过<span style="color: red">{{ payMoney.payTotal || '' }}</span
|
|
|
- >元
|
|
|
- <span @click="allMoney" style="color: blue; margin: 0 0 0 10px">全部退款</span>
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="申请理由" prop="reason">
|
|
|
- <el-select v-model="form.reason" clearable filterable placeholder="请选择申请理由" size="small" style="width: 100%">
|
|
|
- <el-option v-for="i in reasonList" :key="i.value" :label="i.label" :value="i.value"> </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="售后描述" prop="desc">
|
|
|
- <el-input v-model="form.desc" placeholder="请输入售后描述" size="small" type="textarea"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="附件" prop="file">
|
|
|
- <c-upload :url="url" v-model="form.file" :limit="6"></c-upload>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="btn">
|
|
|
- <el-button type="primary" size="mini" @click="onSubmit('form')">提交</el-button>
|
|
|
- <el-button type="danger" size="mini" @click="toBack()">取消</el-button>
|
|
|
- </el-col>
|
|
|
- </el-form>
|
|
|
- </el-col>
|
|
|
- </el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <e-dialog :dialog="dialog" @toClose="toClose">
|
|
|
+ <template v-slot:info>
|
|
|
+ <el-form :model="form" :rules="rules" ref="form" label-width="180px">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="售后类型" prop="type">
|
|
|
+ <el-select v-model="form.type" clearable filterable placeholder="请选择售后类型" size="small" style="width: 100%" @change="typeChange">
|
|
|
+ <el-option v-for="i in typeList" :key="i.value" :label="i.label" :value="i.value"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="form.type == '1' || form.type == '2'">
|
|
|
+ <el-form-item label="退款金额" prop="money">
|
|
|
+ <el-input v-model="form.money" placeholder="请输入退款金额" size="small" type="Number" @input="toMoney"></el-input>
|
|
|
+ <p>
|
|
|
+ 退款金额不得超过<span style="color: red">{{ payMoney.payTotal || '' }}</span
|
|
|
+ >元
|
|
|
+ <span @click="allMoney" style="color: blue; margin: 0 0 0 10px">全部退款</span>
|
|
|
+ </p>
|
|
|
+ <p v-if="form.set_id">套装显示全部金额,具体退款金额,请手动填写</p>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="申请理由" prop="reason">
|
|
|
+ <el-select v-model="form.reason" clearable filterable placeholder="请选择申请理由" size="small" style="width: 100%">
|
|
|
+ <el-option v-for="i in reasonList" :key="i.value" :label="i.label" :value="i.value"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="售后描述" prop="desc">
|
|
|
+ <el-input v-model="form.desc" placeholder="请输入售后描述" size="small" type="textarea"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="附件" prop="file">
|
|
|
+ <c-upload :url="url" v-model="form.file" :limit="6"></c-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="btn">
|
|
|
+ <el-button type="primary" size="mini" @click="onSubmit('form')">提交</el-button>
|
|
|
+ <el-button type="danger" size="mini" @click="toBack()">取消</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </template>
|
|
|
+ </e-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -185,7 +209,7 @@ export default {
|
|
|
// 地址
|
|
|
address: {},
|
|
|
// 实付金额
|
|
|
- total_detail: {},
|
|
|
+ total_detail: [],
|
|
|
// 商铺
|
|
|
shop: {},
|
|
|
// 运单号
|
|
@@ -202,6 +226,8 @@ export default {
|
|
|
// 快递公司
|
|
|
shop_transport_typeList: [],
|
|
|
loading: false,
|
|
|
+ // 弹框
|
|
|
+ dialog: { title: '信息管理', show: false, type: '1' },
|
|
|
rules: {
|
|
|
goods: [{ required: true, message: '请选择商品', trigger: 'change' }],
|
|
|
type: [{ required: true, message: '请选择售后类型', trigger: 'change' }],
|
|
@@ -245,14 +271,44 @@ export default {
|
|
|
}
|
|
|
this.loadings = false;
|
|
|
},
|
|
|
- toUrl(url) {
|
|
|
- if (url) {
|
|
|
- window.open(url, '_blank');
|
|
|
- } else {
|
|
|
- this.$message.error('该商品还未添加来源网址,无法跳转');
|
|
|
+ getList(data) {
|
|
|
+ let arr1 = [];
|
|
|
+ let arr2 = [];
|
|
|
+ for (const p1 of data) {
|
|
|
+ if (p1.is_set && p1.is_set == '0') {
|
|
|
+ for (const p2 of p1.goods) {
|
|
|
+ p2.set_name = p1.name;
|
|
|
+ p2.set_id = p1.set_id;
|
|
|
+ p2.spec_id = p2.spec._id;
|
|
|
+ arr1.push(p2);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ p1.spec_id = p1._id;
|
|
|
+ p1.goods_name = p1.goods.name;
|
|
|
+ p1.spec_name = p1.name;
|
|
|
+ arr2.push(p1);
|
|
|
+ }
|
|
|
}
|
|
|
+ let list = [...arr1, ...arr2];
|
|
|
+ },
|
|
|
+ // 跳转供应商网址
|
|
|
+ toUrl(url) {
|
|
|
+ if (url) window.open(url, '_blank');
|
|
|
+ else this.$message.error('该商品还未添加来源网址,无法跳转');
|
|
|
+ },
|
|
|
+ getName(i) {
|
|
|
+ let name = '';
|
|
|
+ if (i.name && i.goods.name) name = i.name + ',' + i.goods.name;
|
|
|
+ else if (i.name) name = i.name;
|
|
|
+ return name;
|
|
|
},
|
|
|
handleSelect(value) {},
|
|
|
+ // 申请售后
|
|
|
+ async toApply(value, i, item) {
|
|
|
+ if (value == 'order') this.$set(this, `form`, { goods: i._id, cgfr: i._id });
|
|
|
+ else if (value == 'set') this.$set(this, `form`, { goods: i.spec._id, set_id: item.set_id, cgfr: item.set_id });
|
|
|
+ this.dialog = { title: '信息管理', show: true, type: '1' };
|
|
|
+ },
|
|
|
async toSales(status) {
|
|
|
if (status == '1') var info = { order_detail: this.id, type: '4' };
|
|
|
else if (status == '2') var info = { order_detail: this.id, type: '5' };
|
|
@@ -264,10 +320,16 @@ export default {
|
|
|
let res = await this.create(info);
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$message({ type: `success`, message: `申请售后成功` });
|
|
|
+ this.toClose();
|
|
|
this.search();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 关闭
|
|
|
+ toClose() {
|
|
|
+ this.form = {};
|
|
|
+ this.dialog = { title: '信息管理', show: false, type: '1' };
|
|
|
+ },
|
|
|
// 选择商品
|
|
|
goodsChange(value) {
|
|
|
this.$set(this.form, `goods`, value);
|
|
@@ -277,12 +339,9 @@ export default {
|
|
|
async typeChange(value) {
|
|
|
this.$set(this.form, `type`, value);
|
|
|
if (value != '3') {
|
|
|
- let info = { order_detail: this.id, goods_id: this.form.goods };
|
|
|
+ let info = { order_detail: this.id, goods_id: this.form.cgfr };
|
|
|
let res = await this.cgfr(info);
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `payMoney`, res.data);
|
|
|
- this.allMoney();
|
|
|
- }
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `payMoney`, res.data);
|
|
|
}
|
|
|
},
|
|
|
// 全部退款
|
|
@@ -307,9 +366,11 @@ export default {
|
|
|
}).then(async () => {
|
|
|
let form = this.form;
|
|
|
form.order_detail = this.id;
|
|
|
+ delete form.cgfr;
|
|
|
let res = await this.create(form);
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$message({ type: `success`, message: `申请售后成功` });
|
|
|
+ this.toClose();
|
|
|
this.search();
|
|
|
}
|
|
|
});
|