|
@@ -596,25 +596,53 @@ export default {
|
|
},
|
|
},
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
- amount: [{ required: true, message: '总金额不能为空', trigger: 'blur' }]
|
|
|
|
|
|
+ amount: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: this.$t('orderList.totalAmountRequired'),
|
|
|
|
+ trigger: 'blur'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
// 核销表单校验
|
|
// 核销表单校验
|
|
vFormRules: {
|
|
vFormRules: {
|
|
- verifyCode: [{ required: true, message: '核销码不能为空', trigger: 'blur' }]
|
|
|
|
|
|
+ verifyCode: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: this.$t('orderList.verifyCodeRequired'),
|
|
|
|
+ trigger: 'blur'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
eFormRules: {
|
|
eFormRules: {
|
|
- expressCompany: [{ required: true, message: '物流公司不能为空', trigger: 'blur' }],
|
|
|
|
- expressNo: [{ required: true, message: '物流单号不能为空', trigger: 'blur' }]
|
|
|
|
|
|
+ expressCompany: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: this.$t('orderList.expressCompanyRequired'),
|
|
|
|
+ trigger: 'blur'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ expressNo: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: this.$t('orderList.expressNoRequired'),
|
|
|
|
+ trigger: 'blur'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
rFormRules: {
|
|
rFormRules: {
|
|
- refundAmount: [
|
|
|
|
- { required: true, message: '退款金额不能为空', trigger: 'blur' },
|
|
|
|
- {
|
|
|
|
- pattern: /((^[1-9]\d*)|^0)(\.\d{0,2}){0,1}$/,
|
|
|
|
- message: `请输入正确的退款金额`,
|
|
|
|
- trigger: 'blur'
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ refundAmount: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: this.$t('orderList.refundAmountRequired'),
|
|
|
|
+ trigger: 'blur'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ pattern: /((^[1-9]\d*)|^0)(\.\d{0,2}){0,1}$/,
|
|
|
|
+ message: this.$t('orderList.correctRefundAmount'),
|
|
|
|
+ trigger: 'blur'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -624,321 +652,324 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 查询订单
|
|
// 查询订单
|
|
getList() {
|
|
getList() {
|
|
- const app = this
|
|
|
|
- app.loading = true
|
|
|
|
- app.queryParams.storeIds = app.storeIds ? app.storeIds.join(',') : ''
|
|
|
|
- getOrderList(app.queryParams).then((response) => {
|
|
|
|
- this.list = response.data.paginationResponse.content
|
|
|
|
- this.total = response.data.paginationResponse.totalElements
|
|
|
|
- this.typeList = response.data.typeList
|
|
|
|
- this.statusList = response.data.statusList
|
|
|
|
- this.payStatusList = response.data.payStatusList
|
|
|
|
- this.orderModeList = response.data.orderModeList
|
|
|
|
- this.payTypeList = response.data.payTypeList
|
|
|
|
- this.storeList = response.data.storeList
|
|
|
|
- this.expressCompanyList = response.data.expressCompanyList
|
|
|
|
- this.loading = false
|
|
|
|
- })
|
|
|
|
|
|
+ const app = this;
|
|
|
|
+ app.loading = true;
|
|
|
|
+ app.queryParams.storeIds = app.storeIds ? app.storeIds.join(',') : '';
|
|
|
|
+ getOrderList(app.queryParams).then((response) => {
|
|
|
|
+ this.list = response.data.paginationResponse.content;
|
|
|
|
+ this.total = response.data.paginationResponse.totalElements;
|
|
|
|
+ this.typeList = response.data.typeList;
|
|
|
|
+ this.statusList = response.data.statusList;
|
|
|
|
+ this.payStatusList = response.data.payStatusList;
|
|
|
|
+ this.orderModeList = response.data.orderModeList;
|
|
|
|
+ this.payTypeList = response.data.payTypeList;
|
|
|
|
+ this.storeList = response.data.storeList;
|
|
|
|
+ this.expressCompanyList = response.data.expressCompanyList;
|
|
|
|
+ this.loading = false;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 搜索按钮操作
|
|
// 搜索按钮操作
|
|
handleQuery(isExport) {
|
|
handleQuery(isExport) {
|
|
- this.queryParams.page = 1
|
|
|
|
- if (isExport) {
|
|
|
|
- this.exportExcel()
|
|
|
|
- } else {
|
|
|
|
- this.getList()
|
|
|
|
- }
|
|
|
|
|
|
+ this.queryParams.page = 1;
|
|
|
|
+ if (isExport) {
|
|
|
|
+ this.exportExcel();
|
|
|
|
+ } else {
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 导出excel
|
|
// 导出excel
|
|
exportExcel() {
|
|
exportExcel() {
|
|
- this.download('backendApi/order/export', {
|
|
|
|
- ...this.queryParams
|
|
|
|
- })
|
|
|
|
|
|
+ this.download('backendApi/order/export', {
|
|
|
|
+ ...this.queryParams
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 重置按钮操作
|
|
// 重置按钮操作
|
|
resetQuery() {
|
|
resetQuery() {
|
|
- this.queryParams.status = ''
|
|
|
|
- this.queryParams.mobile = ''
|
|
|
|
- this.queryParams.orderMode = ''
|
|
|
|
- this.queryParams.orderSn = ''
|
|
|
|
- this.queryParams.storeIds = ''
|
|
|
|
- this.storeIds = []
|
|
|
|
- this.resetForm('queryForm')
|
|
|
|
- this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
|
|
|
|
- this.handleQuery()
|
|
|
|
|
|
+ this.queryParams.status = '';
|
|
|
|
+ this.queryParams.mobile = '';
|
|
|
|
+ this.queryParams.orderMode = '';
|
|
|
|
+ this.queryParams.orderSn = '';
|
|
|
|
+ this.queryParams.storeIds = '';
|
|
|
|
+ this.storeIds = [];
|
|
|
|
+ this.resetForm('queryForm');
|
|
|
|
+ this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
|
|
|
|
+ this.handleQuery();
|
|
},
|
|
},
|
|
// 状态修改
|
|
// 状态修改
|
|
handleStatusChange(row) {
|
|
handleStatusChange(row) {
|
|
- let text = row.status == 'A' ? '启用' : '禁用'
|
|
|
|
- this.$modal
|
|
|
|
- .confirm('确认要' + text + '"' + row.orderSn + '"吗?')
|
|
|
|
- .then(function () {
|
|
|
|
- return updateOrderStatus(row.id, row.status)
|
|
|
|
- })
|
|
|
|
- .then(() => {
|
|
|
|
- this.$modal.msgSuccess(text + '成功')
|
|
|
|
- })
|
|
|
|
- .catch(function () {
|
|
|
|
- row.status = row.status === 'N' ? 'A' : 'N'
|
|
|
|
- })
|
|
|
|
|
|
+ let text = row.status === 'A' ? this.$t('orderList.enable') : this.$t('orderList.disable');
|
|
|
|
+ const confirmMsg = this.$t('orderList.confirmChangeOrderStatus', { action: text, orderSn: row.orderSn });
|
|
|
|
+ this.$modal
|
|
|
|
+ .confirm(confirmMsg)
|
|
|
|
+ .then(() => {
|
|
|
|
+ return updateOrderStatus(row.id, row.status);
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ const successMsg = this.$t('orderList.statusChangeSuccess', { action: text });
|
|
|
|
+ this.$modal.msgSuccess(successMsg);
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ row.status = row.status === 'N' ? 'A' : 'N';
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
- this.ids = selection.map((item) => item.id)
|
|
|
|
- this.multiple = !selection.length
|
|
|
|
|
|
+ this.ids = selection.map((item) => item.id);
|
|
|
|
+ this.multiple = !selection.length;
|
|
},
|
|
},
|
|
// 排序触发事件
|
|
// 排序触发事件
|
|
handleSortChange(column, prop, order) {
|
|
handleSortChange(column, prop, order) {
|
|
- this.queryParams.orderByColumn = column.prop
|
|
|
|
- this.queryParams.isAsc = column.order
|
|
|
|
- this.getList()
|
|
|
|
|
|
+ this.queryParams.orderByColumn = column.prop;
|
|
|
|
+ this.queryParams.isAsc = column.order;
|
|
|
|
+ this.getList();
|
|
},
|
|
},
|
|
// 表单重置
|
|
// 表单重置
|
|
reset() {
|
|
reset() {
|
|
- this.form = {
|
|
|
|
- orderId: '',
|
|
|
|
- orderSn: '',
|
|
|
|
- status: 'A',
|
|
|
|
- amount: '',
|
|
|
|
- discount: '',
|
|
|
|
- remark: '',
|
|
|
|
- orderMode: 'oneself'
|
|
|
|
- }
|
|
|
|
- this.resetForm('form')
|
|
|
|
|
|
+ this.form = {
|
|
|
|
+ orderId: '',
|
|
|
|
+ orderSn: '',
|
|
|
|
+ status: 'A',
|
|
|
|
+ amount: '',
|
|
|
|
+ discount: '',
|
|
|
|
+ remark: '',
|
|
|
|
+ orderMode: 'oneself'
|
|
|
|
+ };
|
|
|
|
+ this.resetForm('form');
|
|
},
|
|
},
|
|
// 取消按钮
|
|
// 取消按钮
|
|
cancel() {
|
|
cancel() {
|
|
- this.open = false
|
|
|
|
- this.reset()
|
|
|
|
|
|
+ this.open = false;
|
|
|
|
+ this.reset();
|
|
},
|
|
},
|
|
// 取消核销按钮
|
|
// 取消核销按钮
|
|
cancelVForm() {
|
|
cancelVForm() {
|
|
- this.openVerify = false
|
|
|
|
- this.vForm.orderId = ''
|
|
|
|
- this.vForm.orderSn = ''
|
|
|
|
- this.vForm.verifyCode = ''
|
|
|
|
|
|
+ this.openVerify = false;
|
|
|
|
+ this.vForm.orderId = '';
|
|
|
|
+ this.vForm.orderSn = '';
|
|
|
|
+ this.vForm.verifyCode = '';
|
|
},
|
|
},
|
|
// 提交核销按钮
|
|
// 提交核销按钮
|
|
submitVForm: function () {
|
|
submitVForm: function () {
|
|
- this.$refs['vForm'].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- verifyOrder(this.vForm).then((response) => {
|
|
|
|
- this.$modal.msgSuccess('核销成功!')
|
|
|
|
- this.cancelVForm()
|
|
|
|
- this.getList()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ this.$refs['vForm'].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ verifyOrder(this.vForm).then((response) => {
|
|
|
|
+ this.$modal.msgSuccess(this.$t('orderList.verifySuccess'));
|
|
|
|
+ this.cancelVForm();
|
|
|
|
+ this.getList();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 提交修改按钮
|
|
// 提交修改按钮
|
|
submitForm: function () {
|
|
submitForm: function () {
|
|
- this.$refs['form'].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- saveOrder(this.form)
|
|
|
|
- .then((response) => {
|
|
|
|
- this.$modal.msgSuccess('修改成功!')
|
|
|
|
- this.open = false
|
|
|
|
- this.getList()
|
|
|
|
- })
|
|
|
|
- .catch(function () {
|
|
|
|
- this.$modal.msgError('修改出错啦')
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ saveOrder(this.form)
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$modal.msgSuccess(this.$t('orderList.modifySuccess'));
|
|
|
|
+ this.open = false;
|
|
|
|
+ this.getList();
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.$modal.msgError(this.$t('orderList.modifyError'));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 查看详情按钮操作
|
|
// 查看详情按钮操作
|
|
handleView(row) {
|
|
handleView(row) {
|
|
- this.$router.push({ path: '/order/detail?orderId=' + row.id })
|
|
|
|
|
|
+ this.$router.push({ path: '/order/detail?orderId=' + row.id });
|
|
},
|
|
},
|
|
// 修改按钮操作
|
|
// 修改按钮操作
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
- const app = this
|
|
|
|
- app.reset()
|
|
|
|
- const id = row.id || this.ids
|
|
|
|
- getOrderInfo(id).then((response) => {
|
|
|
|
- let orderInfo = response.data.orderInfo
|
|
|
|
- if (orderInfo) {
|
|
|
|
- app.form.orderId = orderInfo.id
|
|
|
|
- app.form.orderSn = orderInfo.orderSn
|
|
|
|
- app.form.amount = orderInfo.amount
|
|
|
|
- app.form.discount = orderInfo.discount
|
|
|
|
- app.form.remark = orderInfo.remark
|
|
|
|
- app.form.status = orderInfo.status
|
|
|
|
- app.form.orderMode = orderInfo.orderMode + ''
|
|
|
|
- }
|
|
|
|
- this.open = true
|
|
|
|
- this.title = '修改订单'
|
|
|
|
- })
|
|
|
|
|
|
+ const app = this;
|
|
|
|
+ app.reset();
|
|
|
|
+ const id = row.id || this.ids;
|
|
|
|
+ getOrderInfo(id).then((response) => {
|
|
|
|
+ let orderInfo = response.data.orderInfo;
|
|
|
|
+ if (orderInfo) {
|
|
|
|
+ app.form.orderId = orderInfo.id;
|
|
|
|
+ app.form.orderSn = orderInfo.orderSn;
|
|
|
|
+ app.form.amount = orderInfo.amount;
|
|
|
|
+ app.form.discount = orderInfo.discount;
|
|
|
|
+ app.form.remark = orderInfo.remark;
|
|
|
|
+ app.form.status = orderInfo.status;
|
|
|
|
+ app.form.orderMode = orderInfo.orderMode + '';
|
|
|
|
+ }
|
|
|
|
+ this.open = true;
|
|
|
|
+ this.title = this.$t('orderList.modifyOrder');
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 核销按钮操作
|
|
// 核销按钮操作
|
|
handleVerify(row) {
|
|
handleVerify(row) {
|
|
- const app = this
|
|
|
|
- const id = row.id || this.ids
|
|
|
|
- getOrderInfo(id).then((response) => {
|
|
|
|
- let orderInfo = response.data.orderInfo
|
|
|
|
- if (orderInfo) {
|
|
|
|
- app.vForm.orderId = orderInfo.id
|
|
|
|
- app.vForm.orderSn = orderInfo.orderSn
|
|
|
|
- app.vForm.remark = orderInfo.remark
|
|
|
|
- }
|
|
|
|
- app.openVerify = true
|
|
|
|
- })
|
|
|
|
|
|
+ const app = this;
|
|
|
|
+ const id = row.id || this.ids;
|
|
|
|
+ getOrderInfo(id).then((response) => {
|
|
|
|
+ let orderInfo = response.data.orderInfo;
|
|
|
|
+ if (orderInfo) {
|
|
|
|
+ app.vForm.orderId = orderInfo.id;
|
|
|
|
+ app.vForm.orderSn = orderInfo.orderSn;
|
|
|
|
+ app.vForm.remark = orderInfo.remark;
|
|
|
|
+ }
|
|
|
|
+ app.openVerify = true;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 发货按钮
|
|
// 发货按钮
|
|
handleExpress(row) {
|
|
handleExpress(row) {
|
|
- const app = this
|
|
|
|
- const id = row.id || this.ids
|
|
|
|
- getOrderInfo(id).then((response) => {
|
|
|
|
- let orderInfo = response.data.orderInfo
|
|
|
|
- if (orderInfo) {
|
|
|
|
- app.eForm.orderId = orderInfo.id
|
|
|
|
- app.eForm.orderSn = orderInfo.orderSn
|
|
|
|
- app.eForm.expressNo = orderInfo.expressInfo ? orderInfo.expressInfo.expressNo : ''
|
|
|
|
- app.eForm.expressCompany = orderInfo.expressInfo
|
|
|
|
- ? orderInfo.expressInfo.expressCompany
|
|
|
|
- : ''
|
|
|
|
- }
|
|
|
|
- app.openExpress = true
|
|
|
|
- })
|
|
|
|
|
|
+ const app = this;
|
|
|
|
+ const id = row.id || this.ids;
|
|
|
|
+ getOrderInfo(id).then((response) => {
|
|
|
|
+ let orderInfo = response.data.orderInfo;
|
|
|
|
+ if (orderInfo) {
|
|
|
|
+ app.eForm.orderId = orderInfo.id;
|
|
|
|
+ app.eForm.orderSn = orderInfo.orderSn;
|
|
|
|
+ app.eForm.expressNo = orderInfo.expressInfo ? orderInfo.expressInfo.expressNo : '';
|
|
|
|
+ app.eForm.expressCompany = orderInfo.expressInfo
|
|
|
|
+ ? orderInfo.expressInfo.expressCompany
|
|
|
|
+ : '';
|
|
|
|
+ }
|
|
|
|
+ app.openExpress = true;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 取消发货按钮
|
|
// 取消发货按钮
|
|
cancelEForm() {
|
|
cancelEForm() {
|
|
- this.openExpress = false
|
|
|
|
- this.eForm.orderId = ''
|
|
|
|
- this.eForm.orderSn = ''
|
|
|
|
- this.eForm.expressCompany = ''
|
|
|
|
- this.eForm.expressNo = ''
|
|
|
|
|
|
+ this.openExpress = false;
|
|
|
|
+ this.eForm.orderId = '';
|
|
|
|
+ this.eForm.orderSn = '';
|
|
|
|
+ this.eForm.expressCompany = '';
|
|
|
|
+ this.eForm.expressNo = '';
|
|
},
|
|
},
|
|
// 提交发货按钮
|
|
// 提交发货按钮
|
|
submitEForm: function () {
|
|
submitEForm: function () {
|
|
- const app = this
|
|
|
|
- if (app.loading) {
|
|
|
|
- app.$modal.msgError('请求处理中...')
|
|
|
|
- }
|
|
|
|
- app.$refs['eForm'].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- app.loading = true
|
|
|
|
- const param = {
|
|
|
|
- orderId: app.eForm.orderId,
|
|
|
|
- orderSn: app.eForm.orderSn,
|
|
|
|
- expressCompany: app.eForm.expressCompany,
|
|
|
|
- expressNo: app.eForm.expressNo
|
|
|
|
- }
|
|
|
|
- delivered(param).then((response) => {
|
|
|
|
- app.$modal.msgSuccess('提交物流信息成功!')
|
|
|
|
- app.cancelEForm()
|
|
|
|
- app.getList()
|
|
|
|
- app.loading = false
|
|
|
|
- })
|
|
|
|
|
|
+ const app = this;
|
|
|
|
+ if (app.loading) {
|
|
|
|
+ app.$modal.msgError(this.$t('orderList.requestProcessing'));
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ app.$refs['eForm'].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ app.loading = true;
|
|
|
|
+ const param = {
|
|
|
|
+ orderId: app.eForm.orderId,
|
|
|
|
+ orderSn: app.eForm.orderSn,
|
|
|
|
+ expressCompany: app.eForm.expressCompany,
|
|
|
|
+ expressNo: app.eForm.expressNo
|
|
|
|
+ };
|
|
|
|
+ delivered(param).then((response) => {
|
|
|
|
+ app.$modal.msgSuccess(this.$t('orderList.submitExpressSuccess'));
|
|
|
|
+ app.cancelEForm();
|
|
|
|
+ app.getList();
|
|
|
|
+ app.loading = false;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 取消退款按钮
|
|
// 取消退款按钮
|
|
cancelRForm() {
|
|
cancelRForm() {
|
|
- this.openRefundDialog = false
|
|
|
|
- this.rForm.orderId = ''
|
|
|
|
- this.rForm.orderSn = ''
|
|
|
|
- this.rForm.payAmount = ''
|
|
|
|
- this.rForm.payType = ''
|
|
|
|
- this.rForm.refundAmount = ''
|
|
|
|
- this.rForm.remark = ''
|
|
|
|
|
|
+ this.openRefundDialog = false;
|
|
|
|
+ this.rForm.orderId = '';
|
|
|
|
+ this.rForm.orderSn = '';
|
|
|
|
+ this.rForm.payAmount = '';
|
|
|
|
+ this.rForm.payType = '';
|
|
|
|
+ this.rForm.refundAmount = '';
|
|
|
|
+ this.rForm.remark = '';
|
|
},
|
|
},
|
|
// 提交退款按钮
|
|
// 提交退款按钮
|
|
submitRForm: function () {
|
|
submitRForm: function () {
|
|
- const app = this
|
|
|
|
- if (app.loading) {
|
|
|
|
- app.$modal.msgError('请求处理中...')
|
|
|
|
- }
|
|
|
|
- if (parseFloat(app.rForm.refundAmount) > parseFloat(app.rForm.amount)) {
|
|
|
|
- app.$modal.msgError('退款金额不能大于订单总金额!')
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- app.$refs['rForm'].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- app.loading = true
|
|
|
|
- doRefund(app.rForm).then((response) => {
|
|
|
|
- app.$modal.msgSuccess('提交退款成功!')
|
|
|
|
- app.cancelRForm()
|
|
|
|
- app.getList()
|
|
|
|
- app.loading = false
|
|
|
|
- })
|
|
|
|
|
|
+ const app = this;
|
|
|
|
+ if (app.loading) {
|
|
|
|
+ app.$modal.msgError(this.$t('orderList.requestProcessing'));
|
|
|
|
+ }
|
|
|
|
+ if (parseFloat(app.rForm.refundAmount) > parseFloat(app.rForm.amount)) {
|
|
|
|
+ app.$modal.msgError(this.$t('orderList.refundAmountExceed'));
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ app.$refs['rForm'].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ app.loading = true;
|
|
|
|
+ doRefund(app.rForm).then((response) => {
|
|
|
|
+ app.$modal.msgSuccess(this.$t('orderList.submitRefundSuccess'));
|
|
|
|
+ app.cancelRForm();
|
|
|
|
+ app.getList();
|
|
|
|
+ app.loading = false;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 删除按钮操作
|
|
// 删除按钮操作
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
- const name = row.orderSn
|
|
|
|
- this.$modal
|
|
|
|
- .confirm('是否确认删除订单号为"' + name + '"的数据项?')
|
|
|
|
- .then(function () {
|
|
|
|
- return deleteOrder(row.id)
|
|
|
|
- })
|
|
|
|
- .then(() => {
|
|
|
|
- this.getList()
|
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
|
- })
|
|
|
|
- .catch(() => {})
|
|
|
|
|
|
+ const name = row.orderSn;
|
|
|
|
+ const confirmMsg = this.$t('orderList.confirmDeleteOrder', { orderSn: name });
|
|
|
|
+ this.$modal
|
|
|
|
+ .confirm(confirmMsg)
|
|
|
|
+ .then(() => {
|
|
|
|
+ return deleteOrder(row.id);
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.getList();
|
|
|
|
+ this.$modal.msgSuccess(this.$t('orderList.deleteSuccess'));
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
},
|
|
},
|
|
// 打印小票(本地打印)
|
|
// 打印小票(本地打印)
|
|
handlePrint(row) {
|
|
handlePrint(row) {
|
|
- const app = this
|
|
|
|
- app.orderInfo = {}
|
|
|
|
- app.storeInfo = {}
|
|
|
|
- const id = row.id || this.ids
|
|
|
|
- getOrderInfo(id).then((response) => {
|
|
|
|
- let orderInfo = response.data.orderInfo
|
|
|
|
- if (orderInfo) {
|
|
|
|
- app.orderInfo = orderInfo
|
|
|
|
- app.storeInfo = orderInfo.storeInfo
|
|
|
|
- }
|
|
|
|
- app.openOrderPrintDialog = true
|
|
|
|
- })
|
|
|
|
|
|
+ const app = this;
|
|
|
|
+ app.orderInfo = {};
|
|
|
|
+ app.storeInfo = {};
|
|
|
|
+ const id = row.id || this.ids;
|
|
|
|
+ getOrderInfo(id).then((response) => {
|
|
|
|
+ let orderInfo = response.data.orderInfo;
|
|
|
|
+ if (orderInfo) {
|
|
|
|
+ app.orderInfo = orderInfo;
|
|
|
|
+ app.storeInfo = orderInfo.storeInfo;
|
|
|
|
+ }
|
|
|
|
+ app.openOrderPrintDialog = true;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 打印小票(云打印)
|
|
// 打印小票(云打印)
|
|
handlePrintCloud(row) {
|
|
handlePrintCloud(row) {
|
|
- const app = this
|
|
|
|
- const orderId = row.id || this.ids
|
|
|
|
- doPrint(orderId).then((response) => {
|
|
|
|
- let result = response.data
|
|
|
|
- if (result) {
|
|
|
|
- app.$modal.msgSuccess('打印发送成功!')
|
|
|
|
- } else {
|
|
|
|
- app.$modal.msgError('打印发送失败!')
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ const app = this;
|
|
|
|
+ const orderId = row.id || this.ids;
|
|
|
|
+ doPrint(orderId).then((response) => {
|
|
|
|
+ let result = response.data;
|
|
|
|
+ if (result) {
|
|
|
|
+ app.$modal.msgSuccess(this.$t('orderList.printSendSuccess'));
|
|
|
|
+ } else {
|
|
|
|
+ app.$modal.msgError(this.$t('orderList.printSendFail'));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 退款
|
|
// 退款
|
|
handleRefund(row) {
|
|
handleRefund(row) {
|
|
- const app = this
|
|
|
|
- app.rForm.orderId = row.id
|
|
|
|
- app.rForm.orderSn = row.orderSn
|
|
|
|
- app.rForm.payAmount = row.payAmount
|
|
|
|
- app.rForm.payType = getName(app.payTypeList, row.payType)
|
|
|
|
- app.openRefundDialog = true
|
|
|
|
|
|
+ const app = this;
|
|
|
|
+ app.rForm.orderId = row.id;
|
|
|
|
+ app.rForm.orderSn = row.orderSn;
|
|
|
|
+ app.rForm.payAmount = row.payAmount;
|
|
|
|
+ app.rForm.payType = getName(app.payTypeList, row.payType);
|
|
|
|
+ app.openRefundDialog = true;
|
|
},
|
|
},
|
|
// 关掉打印对话框
|
|
// 关掉打印对话框
|
|
closePrintDialog() {
|
|
closePrintDialog() {
|
|
- this.openOrderPrintDialog = false
|
|
|
|
|
|
+ this.openOrderPrintDialog = false;
|
|
},
|
|
},
|
|
// 更多操作触发
|
|
// 更多操作触发
|
|
handleCommand(command, row) {
|
|
handleCommand(command, row) {
|
|
- switch (command) {
|
|
|
|
- case 'handleDelete':
|
|
|
|
- this.handleDelete(row)
|
|
|
|
- break
|
|
|
|
- case 'handlePrint':
|
|
|
|
- this.handlePrint(row)
|
|
|
|
- break
|
|
|
|
- case 'handlePrintCloud':
|
|
|
|
- this.handlePrintCloud(row)
|
|
|
|
- break
|
|
|
|
- case 'handleRefund':
|
|
|
|
- this.handleRefund(row)
|
|
|
|
- break
|
|
|
|
- default:
|
|
|
|
- this.handleView(row)
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
|
|
+ switch (command) {
|
|
|
|
+ case 'handleDelete':
|
|
|
|
+ this.handleDelete(row);
|
|
|
|
+ break;
|
|
|
|
+ case 'handlePrint':
|
|
|
|
+ this.handlePrint(row);
|
|
|
|
+ break;
|
|
|
|
+ case 'handlePrintCloud':
|
|
|
|
+ this.handlePrintCloud(row);
|
|
|
|
+ break;
|
|
|
|
+ case 'handleRefund':
|
|
|
|
+ this.handleRefund(row);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ this.handleView(row);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|