一些修正

This commit is contained in:
邓皓元 2019-03-29 13:56:27 +08:00
parent d3711a5010
commit b4c2c91557
12 changed files with 63 additions and 32 deletions

View File

@ -46,7 +46,7 @@ class OrderController extends Controller
return [
'id' => $item->id,
'sn' => $item->sn,
'package_name' => $item->package->name,
'package_name' => $item->package['name'],
'pay_channel' => CommonService::namePayChannel($item->pay_channel),
'carrier_operator' => $carrierOperators[$item->package->carrier_operator],
'unit_price' => $item->unit_price,

View File

@ -58,13 +58,13 @@ class OrderController extends Controller
'sn' => $item->sn,
'transaction_no' => $item->transaction_no,
'package_id' => $item->package_id,
'package_name' => $item->package->name,
'package_name' => $item->package['name'],
'company_id' => $item->company_id,
'company_name' => $item->company->name,
'company_name' => $item->company['name'],
'pay_channel' => $item->pay_channel,
'pay_channel_name' => CommonService::namePayChannel($item->pay_channel),
'carrier_operator' => $item->package->carrier_operator,
'carrier_operator_name' => $carrierOperators[$item->package->carrier_operator],
'carrier_operator' => $item->package['carrier_operator'],
'carrier_operator_name' => $carrierOperators[$item->package['carrier_operator']],
'unit_price' => $item->unit_price,
'counts' => $item->counts,
'total_price' => $item->total_price,

View File

@ -140,6 +140,8 @@ class OrderService extends Service
if (isset($attributes['unit_price'])) {
$attributes['unit_price'] = intval($attributes['unit_price'] * 100);
$attributes['total_price'] = $attributes['unit_price'] * $attributes['counts'];
$attributes['custom_price'] = $attributes['unit_price'] * $attributes['counts'];
}
if (!$attributes['id']) {
@ -223,6 +225,12 @@ class OrderService extends Service
}
$this->orderRepository->setModel($node)->update($attributes);
if (isset($attributes['unit_price'])) {
$this->orderCardPartitionRepository->where('type', $node->type)->where('order_id', $node->id)->update([
'unit_price' => $attributes['unit_price'],
]);
}
} else {
$maxId = Order::withTrashed()->max('id');
$attributes['id'] = ++$maxId;
@ -231,7 +239,7 @@ class OrderService extends Service
throw new NotAllowedException('非法操作');
}
$attributes['price'] = $product->price;
$attributes['unit_price'] = $product->price;
$attributes['total_price'] = $attributes['unit_price'] * $attributes['counts'];
$attributes['custom_price'] = $attributes['unit_price'] * $attributes['counts'];
$attributes['order_at'] = $attributes['order_at'] ?? date('Y-m-d H:i:s');

View File

@ -85,8 +85,8 @@
<Option :value="'bank'">银行转账</Option>
<Option :value="'wx'">微信支付</Option>
<Option :value="'alipay'">支付宝</Option>
<Option :value="'account'">余额支付</Option>
<Option :value="'tmall'">天猫续费</Option>
<!-- <Option :value="'account'">余额支付</Option> -->
<!-- <Option :value="'tmall'">天猫续费</Option> -->
</Select>
</div>
</li>
@ -113,10 +113,11 @@
<Col span="12">
<li class="ui-list">
<div class="ui-list-title">
<span class="title-require">*</span>订单
<span class="title-require">*</span>订单
</div>
<div class="ui-list-content">
<InputNumber
:disabled="data ? true : false"
v-if="!counts"
:max="100000"
:min="1"

View File

@ -46,7 +46,7 @@
<Input clearable placeholder="流水号" v-model.trim="params.transaction_no"></Input>
</li>
<li class="handle-item w-120" v-if="type === 0">
<li class="handle-item w-250" v-if="type === 0">
<Select clearable placeholder="订单状态" v-model="params.order_status">
<Option :value="0">已下单</Option>
<Option :value="1">已取消</Option>
@ -57,21 +57,23 @@
</Select>
</li>
<li class="handle-item w-120" v-if="type === 0">
<!--
<li class="handle-item w-250" v-if="type === 0">
<Select clearable placeholder="收款状态" v-model="params.transaction_status">
<Option :value="0">未收款</Option>
<Option :value="1">已收款</Option>
<Option :value="2">已退款</Option>
</Select>
</li>
-->
<li class="handle-item w-250">
<Select clearable placeholder="支付方式" v-model="params.pay_channel">
<Option :value="'bank'">银行转账</Option>
<Option :value="'wx'">微信支付</Option>
<Option :value="'alipay'">支付宝</Option>
<Option :value="'account'">余额支付</Option>
<Option :value="'tmall'">天猫续费</Option>
<!-- <Option :value="'account'">余额支付</Option> -->
<!-- <Option :value="'tmall'">天猫续费</Option> -->
</Select>
</li>

View File

@ -112,7 +112,7 @@ export default {
}
if (!this.params.counts) {
return this.$Message.info('请输入订单量');
return this.$Message.info('请输入订单量');
}
if (!this.params.order_at) {
@ -210,6 +210,7 @@ export default {
this.params.counts = 0;
this.params.area = [];
this.my_show = false;
this.groupIndex = '';
},
handleChange(type) {
this.initCompletePackages().then(packages => {
@ -231,7 +232,7 @@ export default {
}
}
if (typeof(this.params.carrier_operator) === 'number') {
if (typeof this.params.carrier_operator === 'number') {
packages = packages.filter(item => {
return item.carrier_operator === this.params.carrier_operator;
});
@ -293,16 +294,19 @@ export default {
case '支付宝':
this.params.pay_channel = 'alipay';
break;
case '余额支付':
this.params.pay_channel = 'account';
break;
case '天猫续费':
this.params.pay_channel = 'tmall';
break;
// case '余额支付':
// this.params.pay_channel = 'account';
// break;
// case '天猫续费':
// this.params.pay_channel = 'tmall';
// break;
default:
break;
}
this.params.carrier_operator = order.carrier_operator;
this.params.unit_price = order.unit_price;
this.params.order_at = order.order_at;
this.params.transaction_no = order.transaction_no;
this.params.contacts = order.contacts;

View File

@ -19,7 +19,10 @@ export default {
carrier_operator: '',
trashed: '',
sim: '',
time: []
time: [
this.moment().subtract('1', 'months').startOf('month').format('YYYY-MM-DD'),
this.moment().subtract('1', 'months').endOf('month').format('YYYY-MM-DD')
]
},
type: 0,
list_data: null,
@ -35,7 +38,7 @@ export default {
show: false
},
search: {
show: false
show: true
},
row: {}, // 当前行
orderConfirmShow: false,
@ -579,6 +582,8 @@ export default {
this.index(1);
},
mounted() {
this.table_titles.splice(10, 1); // 隐藏收款状态
if (this.type === 0) {
this.table_titles.splice(7, 0, {
title: '退货量',
@ -588,7 +593,7 @@ export default {
}
if (this.type !== 0) {
this.table_titles.splice(9, 2);
this.table_titles.splice(9, 1);
}
},
methods: {
@ -625,12 +630,14 @@ export default {
API.exportOrders(params).then(res => {
if (res.code === 0) {
this.downloadFile(res.data);
} else {
this.$Modal.success({
title: '提示',
content: '当前导出数据量大,已进入后台队列导出模式,请稍后至导出列表查看下载。'
});
if (res.data) {
this.downloadFile(res.data);
} else {
this.$Modal.success({
title: '提示',
content: '当前导出数据量大,已进入后台队列导出模式,请稍后至导出列表查看下载。'
});
}
}
this.isShowLoading(false);
}).catch(() => {
@ -682,7 +689,10 @@ export default {
resetSearch() {
for (let k in this.params) {
if (k === 'time') {
this.params[k] = [];
this.params[k] = [
this.moment().subtract('1', 'months').startOf('month').format('YYYY-MM-DD'),
this.moment().subtract('1', 'months').endOf('month').format('YYYY-MM-DD')
];
} else {
this.params[k] = '';
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-7a0075e3.b9f7c25b.css rel=prefetch><link href=/css/chunk-996b1e80.5cadf3d0.css rel=prefetch><link href=/js/chunk-00ae0766.3874cd10.js rel=prefetch><link href=/js/chunk-07a274ec.c3ad5dec.js rel=prefetch><link href=/js/chunk-7a0075e3.998d6baa.js rel=prefetch><link href=/js/chunk-996b1e80.d3b45e46.js rel=prefetch><link href=/css/app.d71a8195.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.c357cc09.js rel=preload as=script><link href=/js/chunk-vendors.ed6443e8.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.d71a8195.css rel=stylesheet></head><body><noscript><strong>很抱歉如果没有启用JavaScript程序不能正常工作若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.ed6443e8.js></script><script src=/js/app.c357cc09.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-7a0075e3.b9f7c25b.css rel=prefetch><link href=/css/chunk-996b1e80.5cadf3d0.css rel=prefetch><link href=/js/chunk-00ae0766.3874cd10.js rel=prefetch><link href=/js/chunk-07a274ec.c3ad5dec.js rel=prefetch><link href=/js/chunk-7a0075e3.b3690026.js rel=prefetch><link href=/js/chunk-996b1e80.d3b45e46.js rel=prefetch><link href=/css/app.d71a8195.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.5a483cca.js rel=preload as=script><link href=/js/chunk-vendors.ed6443e8.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.d71a8195.css rel=stylesheet></head><body><noscript><strong>很抱歉如果没有启用JavaScript程序不能正常工作若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.ed6443e8.js></script><script src=/js/app.5a483cca.js></script></body></html>