bug修复
This commit is contained in:
parent
99914c2533
commit
85eff626b2
@ -21,7 +21,7 @@ class Dicts extends Repository
|
||||
'pay_channel' => ['银行转账' => ['bank'], '余额支付' => ['account'], '微信支付' => ['wx', 'wx_pub', 'wx_pub_qr', 'wx_pub_scan', 'wx_wap', 'wx_lite'], '支付宝' => ['alipay', 'alipay_wap', 'alipay_qr', 'alipay_scan', 'alipay_pc_direct'], '天猫续费' => ['tmall']],
|
||||
'carrier_operator' => ['联通', '移动', '电信', '全网'],
|
||||
'service_type' => ['套餐开通', '套餐续费', '套餐更换', '套餐销售'],
|
||||
'card_status' => ['测试期', '沉默期', '服务期', '已注销'],
|
||||
'card_status' => ['测试期', '沉默期', '服务期', '服务到期', '已注销'],
|
||||
'package_type' => ['基础套餐', '续费包', '加油包', '可选包', '附加包'],
|
||||
'tables' => ['real' => 'RD', 'virtual' => 'VD'],
|
||||
'order_status' => ['已下单', '已取消', '已排单', '已出库', '已发货', '已签收'],
|
||||
|
@ -45,9 +45,9 @@ class CardExport extends AbstractExport implements FromQuery, WithHeadings, With
|
||||
foreach ($rows as $item) {
|
||||
$array[] = [
|
||||
$item['id'],
|
||||
$item['sim'],
|
||||
$item['imsi'],
|
||||
$item['iccid'],
|
||||
$item['sim']."\t",
|
||||
$item['imsi']."\t",
|
||||
$item['iccid']."\t",
|
||||
$item['carrier_operator'],
|
||||
$item['company_name'],
|
||||
$item['package_name'],
|
||||
@ -86,9 +86,6 @@ class CardExport extends AbstractExport implements FromQuery, WithHeadings, With
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'B' => NumberFormat::FORMAT_NUMBER,
|
||||
'C' => NumberFormat::FORMAT_NUMBER,
|
||||
'D' => NumberFormat::FORMAT_NUMBER,
|
||||
'H' => NumberFormat::FORMAT_DATE_YYYYMMDD2,
|
||||
'J' => NumberFormat::FORMAT_DATE_YYYYMMDD2,
|
||||
];
|
||||
|
@ -30,7 +30,7 @@ class PropertyExport extends AbstractExport implements FromCollection, WithHeadi
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
$provinces = $this->settings['province'];
|
||||
$provinces = $this->settings['province'] ?? [];
|
||||
|
||||
$headings = [
|
||||
'*企业ID',
|
||||
@ -62,7 +62,7 @@ class PropertyExport extends AbstractExport implements FromCollection, WithHeadi
|
||||
*/
|
||||
public function rows($rows)
|
||||
{
|
||||
$provinces = $this->settings['province'];
|
||||
$provinces = $this->settings['province'] ?? [];
|
||||
|
||||
$array = [];
|
||||
|
||||
|
@ -305,6 +305,16 @@ class OrderController extends Controller
|
||||
}
|
||||
|
||||
foreach ($segments as $segment) {
|
||||
$interval = intval($segment['end_no']) - intval($segment['start_no']);
|
||||
|
||||
if ($interval < 0) {
|
||||
throw new InvalidArgumentException('结束号段比较大于开始号段');
|
||||
}
|
||||
|
||||
if ($interval > 10000) {
|
||||
throw new InvalidArgumentException('一次排号限制10000张');
|
||||
}
|
||||
|
||||
for ($i = intval($segment['start_no']); $i <= intval($segment['end_no']); $i++) {
|
||||
array_push($simArray, $i);
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ class PropertyController extends Controller
|
||||
$file = $this->request->file('file');
|
||||
|
||||
$settings = app(PropertySettingRepository::class)->getAll();
|
||||
$provinces = $settings['province'];
|
||||
$provinces = $settings['province'] ?? [];
|
||||
|
||||
$data = ImportService::load($file);
|
||||
|
||||
|
@ -118,10 +118,16 @@ trait OrderCardConcern
|
||||
case 0:
|
||||
$query->whereNull('service_start_at')->whereHas('card', function ($relation) {
|
||||
$relation->whereNull('cancelled_at');
|
||||
});
|
||||
})->where('created_at', '<', Carbon::now()->subMonths(6));
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$query->whereNull('service_start_at')->whereHas('card', function ($relation) {
|
||||
$relation->whereNull('cancelled_at');
|
||||
})->where('created_at', '>=', Carbon::now()->subMonths(6));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$query->whereExists(function ($subQuery) {
|
||||
$table = with(new OrderCardPartition)->getTable();
|
||||
$subQuery->from($table)->select('sim')
|
||||
@ -133,7 +139,7 @@ trait OrderCardConcern
|
||||
});
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
$query->whereNotNull('service_start_at')->whereNotIn('sim', function ($subQuery) {
|
||||
$table = with(new OrderCardPartition)->getTable();
|
||||
$subQuery->from($table)->select('sim')
|
||||
@ -144,7 +150,7 @@ trait OrderCardConcern
|
||||
});
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case 4:
|
||||
$query->whereHas('card', function ($relation) {
|
||||
$relation->whereNotNull('cancelled_at');
|
||||
});
|
||||
|
@ -65,8 +65,6 @@ class CardService extends Service
|
||||
$cardStatus = app(Dicts::class)->get('card_status');
|
||||
|
||||
$cards->transform(function ($item) use ($carrierOperators, $cardStatus, $timelines) {
|
||||
$status = static::getStatus($item->card);
|
||||
|
||||
$_timelines = $timelines[$item->sim] ?? [];
|
||||
|
||||
try {
|
||||
@ -74,8 +72,8 @@ class CardService extends Service
|
||||
$package = PackageService::load($timeline['package_id']);
|
||||
$timeline['type_name'] = self::$typeNames[$timeline['type']];
|
||||
$timeline['name'] = $package['name'];
|
||||
$timeline['service_start_at'] = Carbon::parse($timeline['service_start_at'])->format('Y-m');
|
||||
$timeline['service_end_at'] = Carbon::parse($timeline['service_end_at'])->format('Y-m');
|
||||
$timeline['service_start_at'] = $timeline['service_start_at'] ? Carbon::parse($timeline['service_start_at'])->format('Y-m') : '';
|
||||
$timeline['service_end_at'] = $timeline['service_end_at'] ? Carbon::parse($timeline['service_end_at'])->format('Y-m') : '';
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
@ -86,7 +84,7 @@ class CardService extends Service
|
||||
$service_start_at = empty($_timelines) ? '' : min(array_pluck($_timelines, 'service_start_at'));
|
||||
$service_end_at = empty($_timelines) ? '' : max(array_pluck($_timelines, 'service_end_at'));
|
||||
|
||||
return collect([
|
||||
$data = [
|
||||
'id' => sprintf('No%011d', $item->id),
|
||||
'sim' => $item->sim,
|
||||
'imsi' => $item->card['imsi'],
|
||||
@ -95,14 +93,20 @@ class CardService extends Service
|
||||
'company_name' => $company['name'],
|
||||
'package_name' => $package['name'],
|
||||
'virtual_activated_at' => (string)$item->card['virtual_activated_at'],
|
||||
'status' => $status,
|
||||
'status_name' => $cardStatus[$status],
|
||||
'cancelled_at' => (string)$item->card['cancelled_at'],
|
||||
'created_at' => (string)$item->created_at,
|
||||
'updated_at' => (string)$item->updated_at,
|
||||
'service_start_at' => $service_start_at,
|
||||
'service_end_at' => $service_end_at,
|
||||
'timelines' => $_timelines,
|
||||
]);
|
||||
];
|
||||
|
||||
$status = static::getStatus($data);
|
||||
|
||||
$data['status'] = $status;
|
||||
$data['status_name'] = $cardStatus[$status];
|
||||
|
||||
return collect($data);
|
||||
});
|
||||
|
||||
return collect($cards->toArray());
|
||||
@ -116,6 +120,22 @@ class CardService extends Service
|
||||
*/
|
||||
public static function getStatus($card)
|
||||
{
|
||||
return $card['virtual_activated_at'] ? ($card['cancelled_at'] ? 3 : 2) : 1;
|
||||
if ($card['cancelled_at']) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
if (strtotime($card['service_end_at']) < time()) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
if ($card['virtual_activated_at']) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (Carbon::parse($card['created_at'])->diffInMonths(Carbon::now())<= 6) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
2
app/Domains/Virtual/Services/tempCodeRunnerFile.php
Normal file
2
app/Domains/Virtual/Services/tempCodeRunnerFile.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
echo time();
|
@ -1,8 +1,17 @@
|
||||
-- 从旧平台迁移数据
|
||||
|
||||
-- 第一步:复制旧平台 ckb_custom 与 ckb_custom_handle_log 两表至新数据库
|
||||
-- 第一步:复制旧平台 ckb_custom 与 ckb_custom_handle_log 两表至新数据库|修复销售订单服务时间
|
||||
UPDATE ckb_custom_handle_log SET
|
||||
valid_start_time = t.valid_start_time,
|
||||
valid_end_time = t.valid_end_time
|
||||
FROM ckb_custom_handle_log AS t
|
||||
WHERE t.custom_no = ckb_custom_handle_log.custom_no
|
||||
AND t.type = 10
|
||||
AND ckb_custom_handle_log.type = 13
|
||||
AND (ckb_custom_handle_log.valid_start_time = ''OR ckb_custom_handle_log.valid_start_time = '0');
|
||||
|
||||
-- 第二步:建立物化视图
|
||||
-- 第二步:建立视图
|
||||
DROP VIEW IF EXISTS vd_old_orders;
|
||||
CREATE MATERIALIZED VIEW vd_old_orders AS
|
||||
SELECT
|
||||
ckb_custom_handle_log.custom_no,
|
||||
|
@ -17,5 +17,6 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(PermissionSeeder::class);
|
||||
$this->call(CompanyAccountSeeder::class);
|
||||
$this->call(ConfigSeeder::class);
|
||||
$this->call(PropertySettingSeeder::class);
|
||||
}
|
||||
}
|
||||
|
43
database/seeds/PropertySettingSeeder.php
Normal file
43
database/seeds/PropertySettingSeeder.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Domains\Virtual\Repositories\PropertySettingRepository;
|
||||
use function GuzzleHttp\json_encode;
|
||||
|
||||
class PropertySettingSeeder extends Seeder
|
||||
{
|
||||
const PROPERTY_SETTING = [
|
||||
'commercial_vehicle' => ['货车','两客一危','其他','其他商用车'],
|
||||
'company' => ['北斗/GPS运营公司','物联网运营公司','汽车电子后市场','公交集团','企业客户','北斗/GPS/物联网运营公司','北斗/GPS工厂','车厂','汽车电子方案公司'],
|
||||
'customer' => ['行业客户','车后市场客户'],
|
||||
'package' => ['A类套餐'=>['行车记录仪','电子狗'],'B类套餐'=>['智能后视镜'],'C类套餐'=>['物联网终端','北斗/GPS定位器','北斗超长待机终端','车载WIFI'],'D类套餐'=>['北斗/4G部标机']],
|
||||
'package_type' => ['A类套餐','B类套餐','C类套餐','D类套餐'],
|
||||
'platform' => ['TSP平台','API接口','车控宝平台'],
|
||||
'product' => ['物联网终端','北斗/GPS定位器','电子狗','行车记录仪','后视镜','大屏机','北斗/4G部标机','智能后视镜','北斗超长待机终端','车载WIFI'],
|
||||
'province' => ['福建省','广东省','山东省','江西省','安徽省','湖北省','江苏省','浙江省','上海市','四川省','河北省','湖南省','广西壮族自治区','山西省','辽宁省','河南省','贵州省','云南省','北京市','青海省','新疆维吾尔自治区','重庆市','天津市','吉林省','黑龙江省','海南省','陕西省','甘肃省','内蒙古自治区','西藏自治区','宁夏回族自治区','台湾省','香港特别行政区','澳门特别行政区'],
|
||||
'vehicle' => ['乘用车','商用车','其他'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
app(PropertySettingRepository::class)->truncate();
|
||||
|
||||
$data = [];
|
||||
|
||||
foreach (self::PROPERTY_SETTING as $key => $value) {
|
||||
$data[] = [
|
||||
'name' => $key,
|
||||
'value' => json_encode($value, 256),
|
||||
];
|
||||
}
|
||||
|
||||
app(PropertySettingRepository::class)->upsert($data, 'name');
|
||||
|
||||
app(PropertySettingRepository::class)->forgetCached();
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@ var CONFIG = {
|
||||
login_background: '/assets/login_background.jpg',
|
||||
logo_big: '/assets/logo_big.png',
|
||||
logo_small: '/assets/logo_small.png',
|
||||
url: (window.location.hostname === 'localhost') ? 'http://v.denghaoyuan.cn' : '/'
|
||||
url: (window.location.hostname === 'localhost') ? 'http://v.denghaoyuan.cn' : ''
|
||||
};
|
||||
|
||||
window.CONFIG = CONFIG;
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="product-content">
|
||||
<div class="nav">
|
||||
<div class="search umar-t5">
|
||||
<AutoComplete @on-search="handleSearchCompanies" placeholder="输入名称进行过滤"></AutoComplete>
|
||||
<Input v-model="inputValue" placeholder="输入名称进行过滤"></Input>
|
||||
</div>
|
||||
<div class="box">
|
||||
<CellGroup @on-click="index" v-for="item in companies" :key="item.id">
|
||||
|
@ -1,21 +1,35 @@
|
||||
export default {
|
||||
name: 'SoldActivated',
|
||||
name: "SoldActivated",
|
||||
data() {
|
||||
return {
|
||||
params: {
|
||||
company_id: '',
|
||||
starttime: this.moment().startOf('year').format('YYYY-MM'),
|
||||
endtime: this.moment().subtract('1', 'months').format('YYYY-MM')
|
||||
company_id: "",
|
||||
starttime: this.moment()
|
||||
.startOf("year")
|
||||
.format("YYYY-MM"),
|
||||
endtime: this.moment()
|
||||
.subtract("1", "months")
|
||||
.format("YYYY-MM")
|
||||
},
|
||||
search: {
|
||||
show: false
|
||||
},
|
||||
inputValue: "",
|
||||
companies: [],
|
||||
company: { id: 0, name: '请选择企业' },
|
||||
company: { id: 0, name: "请选择企业" },
|
||||
data: [],
|
||||
columns: []
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
inputValue(value) {
|
||||
this.handleCompleteCompanies(value).then(res => {
|
||||
this.companies = res.filter(item => {
|
||||
return item.status === 0;
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initCompleteCompanies().then(res => {
|
||||
this.companies = res.filter(function(item) {
|
||||
@ -27,21 +41,30 @@ export default {
|
||||
setColumns(maxTime) {
|
||||
let columns = [
|
||||
{
|
||||
title: '销售时间',
|
||||
key: 'order_month',
|
||||
title: "销售时间",
|
||||
key: "order_month",
|
||||
minWidth: 110
|
||||
},
|
||||
{
|
||||
title: '销售数',
|
||||
key: 'sells',
|
||||
title: "销售数",
|
||||
key: "sells",
|
||||
minWidth: 110
|
||||
}
|
||||
];
|
||||
|
||||
for (let i = 0; i <= this.moment(maxTime).diff(this.moment(this.params.starttime), 'months'); i++) {
|
||||
for (
|
||||
let i = 0;
|
||||
i <=
|
||||
this.moment(maxTime).diff(this.moment(this.params.starttime), "months");
|
||||
i++
|
||||
) {
|
||||
columns.push({
|
||||
title: this.moment(this.params.starttime).add(i, 'months').format('YYYY-MM'),
|
||||
key: this.moment(this.params.starttime).add(i, 'months').format('YYYY-MM'),
|
||||
title: this.moment(this.params.starttime)
|
||||
.add(i, "months")
|
||||
.format("YYYY-MM"),
|
||||
key: this.moment(this.params.starttime)
|
||||
.add(i, "months")
|
||||
.format("YYYY-MM"),
|
||||
minWidth: 110
|
||||
});
|
||||
}
|
||||
@ -62,32 +85,37 @@ export default {
|
||||
});
|
||||
}
|
||||
|
||||
if (this.params.company_id === '') {
|
||||
return this.$Message.error('请先选择企业');
|
||||
if (this.params.company_id === "") {
|
||||
return this.$Message.error("请先选择企业");
|
||||
}
|
||||
|
||||
this.isShowLoading(true);
|
||||
|
||||
let params = JSON.parse(JSON.stringify(this.params));
|
||||
|
||||
params.starttime = this.moment(params.starttime).format('YYYY-MM');
|
||||
params.endtime = this.moment(params.endtime).format('YYYY-MM');
|
||||
params.starttime = this.moment(params.starttime).format("YYYY-MM");
|
||||
params.endtime = this.moment(params.endtime).format("YYYY-MM");
|
||||
|
||||
service.get('api/stats/sold-activated', {
|
||||
service
|
||||
.get("api/stats/sold-activated", {
|
||||
params
|
||||
}).then(res => {
|
||||
})
|
||||
.then(res => {
|
||||
this.isShowLoading(false);
|
||||
if (res.code == 0) {
|
||||
let data = res.data[this.params.company_id];
|
||||
|
||||
if (data.length) {
|
||||
let maxTime = Object.keys(data[0])[Object.keys(data[0]).length - 1];
|
||||
let maxTime = Object.keys(data[0])[
|
||||
Object.keys(data[0]).length - 1
|
||||
];
|
||||
this.setColumns(maxTime);
|
||||
}
|
||||
|
||||
this.data = data;
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
this.isShowLoading(false);
|
||||
});
|
||||
},
|
||||
@ -100,20 +128,23 @@ export default {
|
||||
this.index();
|
||||
},
|
||||
resetSearch() {
|
||||
this.params.starttime = this.moment().startOf('year').format('YYYY-MM');
|
||||
this.params.endtime = this.moment().subtract('1', 'months').format('YYYY-MM');
|
||||
this.params.starttime = this.moment()
|
||||
.startOf("year")
|
||||
.format("YYYY-MM");
|
||||
this.params.endtime = this.moment()
|
||||
.subtract("1", "months")
|
||||
.format("YYYY-MM");
|
||||
this.index();
|
||||
},
|
||||
handleSearchCompanies(value) {
|
||||
this.handleCompleteCompanies(value).then(res => {
|
||||
this.companies = res.filter(item => {
|
||||
return item.status === 0;
|
||||
});
|
||||
});
|
||||
},
|
||||
exportData() {
|
||||
this.$refs.table.exportCsv({
|
||||
filename: '销售激活统计_' + this.company.name + '_' + this.moment(this.params.starttime).format('YYYYMM') + '-' + this.moment(this.params.endtime).format('YYYYMM')
|
||||
filename:
|
||||
"销售激活统计_" +
|
||||
this.company.name +
|
||||
"_" +
|
||||
this.moment(this.params.starttime).format("YYYYMM") +
|
||||
"-" +
|
||||
this.moment(this.params.endtime).format("YYYYMM")
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -86,10 +86,11 @@
|
||||
|
||||
<li class="handle-item w-250">
|
||||
<Select clearable placeholder="卡状态" v-model="params.card_status">
|
||||
<Option :value="0">沉默期</Option>
|
||||
<Option :value="1">服务期</Option>
|
||||
<Option :value="2">服务到期</Option>
|
||||
<Option :value="3">注销期</Option>
|
||||
<Option :value="0">测试期</Option>
|
||||
<Option :value="1">沉默期</Option>
|
||||
<Option :value="2">服务期</Option>
|
||||
<Option :value="3">服务到期</Option>
|
||||
<Option :value="4">已注销</Option>
|
||||
</Select>
|
||||
</li>
|
||||
|
||||
|
@ -66,6 +66,7 @@ export default {
|
||||
this.$emit('update-success');
|
||||
}
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="product-content">
|
||||
<div class="nav">
|
||||
<div class="search umar-t5">
|
||||
<AutoComplete @on-search="handleSearchCompanies" placeholder="输入名称进行过滤"></AutoComplete>
|
||||
<Input v-model="inputValue" placeholder="输入名称进行过滤"></Input>
|
||||
</div>
|
||||
<div class="box">
|
||||
<CellGroup @on-click="index" v-for="item in companies" :key="item.id">
|
||||
|
@ -1,19 +1,19 @@
|
||||
import * as API from 'api/virtual/products';
|
||||
import * as API from "api/virtual/products";
|
||||
|
||||
export default {
|
||||
name: 'Products',
|
||||
name: "Products",
|
||||
components: {
|
||||
UiEdit: resolve => require(['views/virtual/products/edit'], resolve),
|
||||
UiHistory: resolve => require(['views/virtual/products/history'], resolve)
|
||||
UiEdit: resolve => require(["views/virtual/products/edit"], resolve),
|
||||
UiHistory: resolve => require(["views/virtual/products/history"], resolve)
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
params: {
|
||||
company_id: '',
|
||||
carrier_operator: '',
|
||||
name: '',
|
||||
package_name: '',
|
||||
status: ''
|
||||
company_id: "",
|
||||
carrier_operator: "",
|
||||
name: "",
|
||||
package_name: "",
|
||||
status: ""
|
||||
},
|
||||
editObj: {
|
||||
show: false,
|
||||
@ -27,89 +27,94 @@ export default {
|
||||
search: {
|
||||
show: false
|
||||
},
|
||||
inputValue: "",
|
||||
companies: [],
|
||||
company: { id: 0, name: '请选择企业' },
|
||||
company: { id: 0, name: "请选择企业" },
|
||||
data: [],
|
||||
columns: [
|
||||
{
|
||||
title: '序号',
|
||||
key: '',
|
||||
title: "序号",
|
||||
key: "",
|
||||
width: 80,
|
||||
render: (h, context) => {
|
||||
return h('span', context.row._index + 1);
|
||||
return h("span", context.row._index + 1);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '定价名称',
|
||||
key: 'name',
|
||||
title: "定价名称",
|
||||
key: "name",
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '套餐名称',
|
||||
key: '',
|
||||
title: "套餐名称",
|
||||
key: "",
|
||||
width: 120,
|
||||
render: (h, { row, column, index }) => {
|
||||
if (row.package) {
|
||||
return h('span', row.package.name);
|
||||
return h("span", row.package.name);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '销售价格',
|
||||
key: 'price',
|
||||
title: "销售价格",
|
||||
key: "price",
|
||||
width: 100,
|
||||
render: (h, { row, column, index }) => {
|
||||
return h('span', Number(row.price).toFixed(2));
|
||||
return h("span", Number(row.price).toFixed(2));
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '运营商',
|
||||
key: 'carrier_operator_name',
|
||||
title: "运营商",
|
||||
key: "carrier_operator_name",
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
key: 'remark',
|
||||
title: "备注",
|
||||
key: "remark",
|
||||
minWidth: 150,
|
||||
tooltip: true
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
key: '',
|
||||
title: "状态",
|
||||
key: "",
|
||||
width: 100,
|
||||
render: (h, { row, column, index }) => {
|
||||
let type = ['primary', 'warning', 'error'];
|
||||
let text = ['已启用', '已禁用', '已删除'];
|
||||
let type = ["primary", "warning", "error"];
|
||||
let text = ["已启用", "已禁用", "已删除"];
|
||||
|
||||
return h('Button', {
|
||||
return h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: type[row.status],
|
||||
size: 'small'
|
||||
size: "small"
|
||||
}
|
||||
}, text[row.status]);
|
||||
},
|
||||
text[row.status]
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'created_at',
|
||||
title: "创建时间",
|
||||
key: "created_at",
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
title: '更新时间',
|
||||
key: 'updated_at',
|
||||
title: "更新时间",
|
||||
key: "updated_at",
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 170,
|
||||
render: (h, {
|
||||
row,
|
||||
column,
|
||||
index
|
||||
}) => {
|
||||
render: (h, { row, column, index }) => {
|
||||
if (row.deleted_at) {
|
||||
return h('Tag', { props: { color: 'default' } }, '该定价已被删除');
|
||||
return h(
|
||||
"Tag",
|
||||
{ props: { color: "default" } },
|
||||
"该定价已被删除"
|
||||
);
|
||||
}
|
||||
|
||||
row.price = Number(row.price);
|
||||
@ -117,36 +122,48 @@ export default {
|
||||
|
||||
let html = [];
|
||||
|
||||
html.push(h('Button', {
|
||||
html.push(
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: 'success',
|
||||
size: 'small',
|
||||
type: "success",
|
||||
size: "small",
|
||||
disabled: false,
|
||||
icon: 'md-list'
|
||||
icon: "md-list"
|
||||
},
|
||||
class: ['btn'],
|
||||
class: ["btn"],
|
||||
on: {
|
||||
click: (event) => {
|
||||
click: event => {
|
||||
this.openHistory(true, row);
|
||||
}
|
||||
}
|
||||
}, '历史'));
|
||||
|
||||
if (this.haveJurisdiction('update')) {
|
||||
html.push(h('Button', {
|
||||
props: {
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
disabled: false,
|
||||
icon: 'md-create'
|
||||
},
|
||||
class: ['btn'],
|
||||
"历史"
|
||||
)
|
||||
);
|
||||
|
||||
if (this.haveJurisdiction("update")) {
|
||||
html.push(
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small",
|
||||
disabled: false,
|
||||
icon: "md-create"
|
||||
},
|
||||
class: ["btn"],
|
||||
on: {
|
||||
click: (event) => {
|
||||
click: event => {
|
||||
this.openEdit(true, row);
|
||||
}
|
||||
}
|
||||
}, '编辑'));
|
||||
},
|
||||
"编辑"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -182,13 +199,22 @@ export default {
|
||||
*/
|
||||
|
||||
if (html.length) {
|
||||
return h('div', html);
|
||||
return h("div", html);
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
inputValue(value) {
|
||||
this.handleCompleteCompanies(value).then(res => {
|
||||
this.companies = res.filter(item => {
|
||||
return item.status === 0;
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.type = Number(this.$route.params.type);
|
||||
|
||||
@ -220,21 +246,23 @@ export default {
|
||||
|
||||
if (params.status === 2) {
|
||||
params.status = undefined;
|
||||
params.trashed = 'only';
|
||||
params.trashed = "only";
|
||||
} else {
|
||||
params.trashed = 'without';
|
||||
params.trashed = "without";
|
||||
}
|
||||
|
||||
if (params.type == 3) {
|
||||
params.type = [3, 4, 5];
|
||||
}
|
||||
|
||||
API.index(params).then(res => {
|
||||
API.index(params)
|
||||
.then(res => {
|
||||
this.isShowLoading(false);
|
||||
if (res.code == 0) {
|
||||
this.data = res.data;
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
this.isShowLoading(false);
|
||||
});
|
||||
},
|
||||
@ -275,19 +303,12 @@ export default {
|
||||
},
|
||||
resetSearch() {
|
||||
for (let k in this.params) {
|
||||
if (k !== 'company_id') {
|
||||
this.params[k] = '';
|
||||
if (k !== "company_id") {
|
||||
this.params[k] = "";
|
||||
}
|
||||
}
|
||||
this.index();
|
||||
},
|
||||
handleSearchCompanies(value) {
|
||||
this.handleCompleteCompanies(value).then(res => {
|
||||
this.companies = res.filter(item => {
|
||||
return item.status === 0;
|
||||
});
|
||||
});
|
||||
},
|
||||
handleSearchPackages(value) {
|
||||
this.params.package_id = value;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ var CONFIG = {
|
||||
login_background: '/assets/login_background.jpg',
|
||||
logo_big: '/assets/logo_big.png',
|
||||
logo_small: '/assets/logo_small.png',
|
||||
url: (window.location.hostname === 'localhost') ? 'http://v.denghaoyuan.cn' : '/'
|
||||
url: (window.location.hostname === 'localhost') ? 'http://v.denghaoyuan.cn' : ''
|
||||
};
|
||||
|
||||
window.CONFIG = CONFIG;
|
||||
|
2
public/css/chunk-d8059732.0283c6ec.css
Normal file
2
public/css/chunk-d8059732.0283c6ec.css
Normal file
File diff suppressed because one or more lines are too long
1
public/js/app.267f9187.js
Normal file
1
public/js/app.267f9187.js
Normal file
File diff suppressed because one or more lines are too long
1
public/js/app.b4321af5.js
Normal file
1
public/js/app.b4321af5.js
Normal file
File diff suppressed because one or more lines are too long
14
public/js/chunk-77b548cf.d04cde84.js
Normal file
14
public/js/chunk-77b548cf.d04cde84.js
Normal file
File diff suppressed because one or more lines are too long
14
public/js/chunk-d8059732.5fd361b6.js
Normal file
14
public/js/chunk-d8059732.5fd361b6.js
Normal file
File diff suppressed because one or more lines are too long
@ -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-77b548cf.c0895d74.css rel=prefetch><link href=/css/chunk-996b1e80.5cadf3d0.css rel=prefetch><link href=/js/chunk-00ae0766.d130b440.js rel=prefetch><link href=/js/chunk-07a274ec.55e1b3b0.js rel=prefetch><link href=/js/chunk-77b548cf.c72d66a3.js rel=prefetch><link href=/js/chunk-996b1e80.92847c4e.js rel=prefetch><link href=/css/app.8e379248.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.6a83c72f.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.8e379248.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.6a83c72f.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-996b1e80.5cadf3d0.css rel=prefetch><link href=/css/chunk-d8059732.0283c6ec.css rel=prefetch><link href=/js/chunk-00ae0766.d130b440.js rel=prefetch><link href=/js/chunk-07a274ec.55e1b3b0.js rel=prefetch><link href=/js/chunk-996b1e80.92847c4e.js rel=prefetch><link href=/js/chunk-d8059732.5fd361b6.js rel=prefetch><link href=/css/app.8e379248.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.267f9187.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.8e379248.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.267f9187.js></script></body></html>
|
1
vendor/composer/autoload_classmap.php
vendored
1
vendor/composer/autoload_classmap.php
vendored
@ -537,6 +537,7 @@ return array(
|
||||
'PharIo\\Version\\VersionConstraintParser' => $vendorDir . '/phar-io/version/src/VersionConstraintParser.php',
|
||||
'PharIo\\Version\\VersionConstraintValue' => $vendorDir . '/phar-io/version/src/VersionConstraintValue.php',
|
||||
'PharIo\\Version\\VersionNumber' => $vendorDir . '/phar-io/version/src/VersionNumber.php',
|
||||
'PropertySettingSeeder' => $baseDir . '/database/seeds/PropertySettingSeeder.php',
|
||||
'SebastianBergmann\\CodeCoverage\\CodeCoverage' => $vendorDir . '/phpunit/php-code-coverage/src/CodeCoverage.php',
|
||||
'SebastianBergmann\\CodeCoverage\\CoveredCodeNotExecutedException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/CoveredCodeNotExecutedException.php',
|
||||
'SebastianBergmann\\CodeCoverage\\Driver\\Driver' => $vendorDir . '/phpunit/php-code-coverage/src/Driver/Driver.php',
|
||||
|
1
vendor/composer/autoload_static.php
vendored
1
vendor/composer/autoload_static.php
vendored
@ -1256,6 +1256,7 @@ class ComposerStaticInite79258a3e34ad3e251999111d9f334d9
|
||||
'PharIo\\Version\\VersionConstraintParser' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintParser.php',
|
||||
'PharIo\\Version\\VersionConstraintValue' => __DIR__ . '/..' . '/phar-io/version/src/VersionConstraintValue.php',
|
||||
'PharIo\\Version\\VersionNumber' => __DIR__ . '/..' . '/phar-io/version/src/VersionNumber.php',
|
||||
'PropertySettingSeeder' => __DIR__ . '/../..' . '/database/seeds/PropertySettingSeeder.php',
|
||||
'SebastianBergmann\\CodeCoverage\\CodeCoverage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage.php',
|
||||
'SebastianBergmann\\CodeCoverage\\CoveredCodeNotExecutedException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/CoveredCodeNotExecutedException.php',
|
||||
'SebastianBergmann\\CodeCoverage\\Driver\\Driver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Driver/Driver.php',
|
||||
|
Loading…
x
Reference in New Issue
Block a user