提交 3725331b 编写于 作者: ping zhang's avatar ping zhang

增加删除操作

上级 d60b402f
......@@ -54,7 +54,7 @@ service.interceptors.request.use(config => {
}
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境qgit
// console.log('环境变量>>>> ', process.env.BUILD_ENV);
config.headers['token'] = '993044B5B767489286106A32032F076C';
config.headers['token'] = 'C5172D7D7825463CA46752A894236AC2';
// config.headers['token'] = localStorage.getItem('storageToken')
}else{
config.headers['token'] = localStorage.getItem('storageToken')
......
......@@ -273,7 +273,7 @@ export function convertTime(time, isToSlash = true) {
return new Date(time.getTime()).format("yyyy-MM-dd hh:mm:ss");
} else {
return time.replace(/\//g, '-')
}
}
}
}
}
......@@ -309,3 +309,20 @@ export function isEmptyUtils (obj) {
return !isNotEmptyUtils(obj);
};
export function toDecimal2(x) {
if (isNaN(x)) {
return '';
}
let f = x / 100;
let s = f.toString();
let rs = s.indexOf('.');
if (rs < 0) {
rs = s.length;
s += '.';
}
while (s.length <= rs + 2) {
s += '0';
}
return s;
}
......@@ -66,4 +66,15 @@ export const queryShopAuth = (params) => {
params: params,
description: '查询超级管理员权限',
})
};
\ No newline at end of file
};
export const refundApply = (params) => {
return fetch({
headers,
url: getBaseUrl('refund/apply'),
method: 'post',
data: params,
description: '退货',
})
};
......@@ -90,6 +90,7 @@
<el-button v-if="scope.row.storeType == 1 && (scope.row.showStatus == 1 || scope.row.showStatus == 2)" @click="viewLogistics(scope.row)" type="text" size="small">查看物流</el-button>
<el-button v-if="scope.row.storeType == 2 && scope.row.showStatus == 2" @click="distributeComplete(scope.row)" type="text" size="small">配送完成</el-button>
<el-button @click="goDetail(scope.row)" type="text" size="small">查看详情</el-button>
<el-button v-if="(scope.row.storeType == 1 || scope.row.storeType == 2) && scope.row.showStatus == 3" @click="openTuiDialog(scope.row)" type="text" size="small">退款退货</el-button>
</div>
</template>
</el-table-column>
......@@ -204,13 +205,42 @@
</span>
</el-dialog>
</div>
<el-dialog
class="tui-dialog"
title="退款退货"
:visible="showTuiDialog"
@close="showTuiDialog = false"
width="385px"
>
<el-form ref="tuiForm" :model="tuiForm" label-width="120px">
<el-form-item label="退款退货方式:">
<el-select v-model="tuiForm.type" placeholder="请选择退货方式">
<el-option
v-for="item in tuiTypes"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
/>
</el-select>
</el-form-item>
<el-form-item label="退款金额" prop="name">
<el-input v-model="tuiForm.money" :disabled="true"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="confirmTui">完成</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
// import { openLoading, closeLoading } from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue";
import SendSetDialog from "@/components/shop/send-set-dialog";
import { queryOrderList, updateExpress } from "@/utils/shop";
import { queryOrderList, updateExpress, refundApply } from "@/utils/shop";
import { toDecimal2 } from '@/utils';
export default {
components: {
SendSetDialog,
......@@ -232,16 +262,7 @@
pageSize: 10,
},
totalRows: 0,
tableData: [
// {
// id: '',
// name: '',
// type: null,
// status: '',
// num: null,
// createdTime: '',
// }
],
tableData: [],
closeTradeDialog: false,
reasonTxt: '',
changePriceDialog: false,
......@@ -264,6 +285,29 @@
{ required: true, message: '请输入快递单号', trigger: "blur"},
],
},
showTuiDialog: false,
tuiForm: {
order: null,
type: 0,
money: ''
},
tuiTypes: [
{
label: '仅退款,无需退货',
value: 0,
disabled: false
},
{
label: '仅退货,无需退款',
value: 1,
disabled: true
},
{
label: '退款退货',
value: 2,
disabled: true
}
]
}
},
created() {
......@@ -429,6 +473,22 @@
}
})
},
openTuiDialog(item) {
this.tuiForm.order = item;
this.tuiForm.money = toDecimal2(item.amount);
this.showTuiDialog = true;
},
confirmTui() {
refundApply({ orderId: this.tuiForm.order.id }).then(res => {
if (res.code == '000000') {
this.$message.success('操作成功');
this.showTuiDialog = false;
this.searchList();
} else {
this.$message.success('操作失败,请重试');
}
});
},
},
filters: {
toFixed2: function (value) {
......@@ -525,4 +585,12 @@
border-bottom: none;
}
}
.tui-dialog {
.el-dialog__header {
text-align: center;
}
.is-disabled {
width: 193px;
}
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册