添加套餐类型功能
This commit is contained in:
parent
550b4424ef
commit
c4ec31ce28
2
.env.dev
2
.env.dev
@ -57,4 +57,4 @@ SMS_FXFT_URL=http://47.99.58.23:9001/smsSend.do
|
|||||||
SMS_FXFT_EXT=01
|
SMS_FXFT_EXT=01
|
||||||
|
|
||||||
JWT_TTL=1440
|
JWT_TTL=1440
|
||||||
JWT_REFRESH_TTL=20160
|
JWT_REFRESH_TTL=20160
|
||||||
|
@ -78,6 +78,7 @@ class PackageService extends Service
|
|||||||
'name' => ['required', 'between:2,32', Rule::unique($this->packageRepository->getTable(), 'name')->ignore($attributes['id'])->whereNUll('deleted_at')],
|
'name' => ['required', 'between:2,32', Rule::unique($this->packageRepository->getTable(), 'name')->ignore($attributes['id'])->whereNUll('deleted_at')],
|
||||||
'type' => ['required', 'in:0,2,3'],
|
'type' => ['required', 'in:0,2,3'],
|
||||||
'carrier_operator' => ['required', 'in:0,1,2,3'],
|
'carrier_operator' => ['required', 'in:0,1,2,3'],
|
||||||
|
'package_type' => ['required', 'numeric'],
|
||||||
'cost_price' => ['numeric', 'min:0'],
|
'cost_price' => ['numeric', 'min:0'],
|
||||||
'guide_price' => ['numeric', 'min:0'],
|
'guide_price' => ['numeric', 'min:0'],
|
||||||
'flows' => ['numeric', 'min:0'],
|
'flows' => ['numeric', 'min:0'],
|
||||||
@ -103,6 +104,8 @@ class PackageService extends Service
|
|||||||
'type.in' => '套餐类型不合法',
|
'type.in' => '套餐类型不合法',
|
||||||
'carrier_operator.required' => '请选择运营商',
|
'carrier_operator.required' => '请选择运营商',
|
||||||
'carrier_operator.in' => '运营商不合法',
|
'carrier_operator.in' => '运营商不合法',
|
||||||
|
'package_type.required' => '请选择套餐类型',
|
||||||
|
'package_type.numeric' => '套餐类型不合法',
|
||||||
'cost_price.numeric' => '套餐价格必须是数字',
|
'cost_price.numeric' => '套餐价格必须是数字',
|
||||||
'guide_price.numeric' => '套餐指导价格必须是数字',
|
'guide_price.numeric' => '套餐指导价格必须是数字',
|
||||||
'flows.numeric' => '套餐指导价格必须是数字',
|
'flows.numeric' => '套餐指导价格必须是数字',
|
||||||
|
@ -14,6 +14,7 @@ use App\Models\PackageBase;
|
|||||||
* @property string $name 套餐名称
|
* @property string $name 套餐名称
|
||||||
* @property int $type 套餐类型(0:基础套餐 1:续费包 2:加油包)
|
* @property int $type 套餐类型(0:基础套餐 1:续费包 2:加油包)
|
||||||
* @property int $carrier_operator 运营商(0:联通 1:移动 2:电信)
|
* @property int $carrier_operator 运营商(0:联通 1:移动 2:电信)
|
||||||
|
* @property int $package_type 套餐类型(0:A类套餐 1:B类套餐 2:C类套餐 3:D类套餐)
|
||||||
* @property int $cost_price 成本价格
|
* @property int $cost_price 成本价格
|
||||||
* @property int $guide_price 指导价格
|
* @property int $guide_price 指导价格
|
||||||
* @property int $flows 套餐流量(M)
|
* @property int $flows 套餐流量(M)
|
||||||
@ -71,6 +72,7 @@ class Package extends PackageBase
|
|||||||
'name',
|
'name',
|
||||||
'type',
|
'type',
|
||||||
'carrier_operator',
|
'carrier_operator',
|
||||||
|
'package_type',
|
||||||
'cost_price',
|
'cost_price',
|
||||||
'guide_price',
|
'guide_price',
|
||||||
'flows',
|
'flows',
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class AddPackageTypeToVirtualPackages extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('virtual_packages', function (Blueprint $table) {
|
||||||
|
$table->tinyInteger('package_type')->unsigned()->default(0)->comment('套餐类型(0:A类套餐 1:B类套餐 2:C类套餐 3:D类套餐)')->after('type');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('virtual_packages');
|
||||||
|
}
|
||||||
|
}
|
@ -46,6 +46,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="ui-list" v-if="type == 0">
|
||||||
|
<div class="ui-list-title">
|
||||||
|
<span class="title-require">*</span>套餐类型:
|
||||||
|
</div>
|
||||||
|
<div class="ui-list-content">
|
||||||
|
<Select v-model="params.package_type">
|
||||||
|
<Option :value="k" v-for="(v, k) in settings.package_type" :key="k">{{v}}</Option>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="ui-list">
|
<li class="ui-list">
|
||||||
<div class="ui-list-title">
|
<div class="ui-list-title">
|
||||||
<span class="title-require">*</span>重置周期
|
<span class="title-require">*</span>重置周期
|
||||||
@ -97,28 +108,28 @@
|
|||||||
<li class="ui-list" v-if="[0, 2].indexOf(type) !== -1">
|
<li class="ui-list" v-if="[0, 2].indexOf(type) !== -1">
|
||||||
<div class="ui-list-title">后向套餐</div>
|
<div class="ui-list-title">后向套餐</div>
|
||||||
<div class="ui-list-content">
|
<div class="ui-list-content">
|
||||||
<Switch :false-value="0" :true-value="1" v-model="params.flowed"/>
|
<Switch :false-value="0" :true-value="1" v-model="params.flowed" />
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="ui-list" v-if="type">
|
<li class="ui-list" v-if="type">
|
||||||
<div class="ui-list-title">立即生效</div>
|
<div class="ui-list-title">立即生效</div>
|
||||||
<div class="ui-list-content">
|
<div class="ui-list-content">
|
||||||
<Switch :false-value="1" :true-value="0" v-model="params.effect_months"/>
|
<Switch :false-value="1" :true-value="0" v-model="params.effect_months" />
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="ui-list">
|
<li class="ui-list">
|
||||||
<div class="ui-list-title">LBS服务</div>
|
<div class="ui-list-title">LBS服务</div>
|
||||||
<div class="ui-list-content">
|
<div class="ui-list-content">
|
||||||
<Switch :false-value="0" :true-value="1" v-model="params.has_lbs"/>
|
<Switch :false-value="0" :true-value="1" v-model="params.has_lbs" />
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="ui-list">
|
<li class="ui-list">
|
||||||
<div class="ui-list-title">短信服务</div>
|
<div class="ui-list-title">短信服务</div>
|
||||||
<div class="ui-list-content">
|
<div class="ui-list-content">
|
||||||
<Switch :false-value="0" :true-value="1" v-model="params.has_messages"/>
|
<Switch :false-value="0" :true-value="1" v-model="params.has_messages" />
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -11,7 +11,12 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="f-r">
|
<li class="f-r">
|
||||||
<div class="handle-item">
|
<div class="handle-item">
|
||||||
<Button @click="openEdit(true, null)" icon="md-add" type="primary" v-if="hasPermission('create')">添加套餐</Button>
|
<Button
|
||||||
|
@click="openEdit(true, null)"
|
||||||
|
icon="md-add"
|
||||||
|
type="primary"
|
||||||
|
v-if="hasPermission('create')"
|
||||||
|
>添加套餐</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="handle-item">
|
<div class="handle-item">
|
||||||
@ -97,6 +102,7 @@
|
|||||||
|
|
||||||
<ui-edit
|
<ui-edit
|
||||||
:type="type"
|
:type="type"
|
||||||
|
:settings="editObj.settings"
|
||||||
:data="editObj.data"
|
:data="editObj.data"
|
||||||
:show.sync="editObj.show"
|
:show.sync="editObj.show"
|
||||||
@add-success="index"
|
@add-success="index"
|
||||||
|
@ -15,6 +15,12 @@ export default {
|
|||||||
default() {
|
default() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
settings: {
|
||||||
|
type: Object,
|
||||||
|
default() {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -27,6 +33,7 @@ export default {
|
|||||||
sn: '',
|
sn: '',
|
||||||
name: '',
|
name: '',
|
||||||
carrier_operator: 255,
|
carrier_operator: 255,
|
||||||
|
package_type: 255,
|
||||||
cost_price: 0,
|
cost_price: 0,
|
||||||
guide_price: 0,
|
guide_price: 0,
|
||||||
flows: 0,
|
flows: 0,
|
||||||
@ -74,6 +81,12 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (this.params.package_type === 255) {
|
||||||
|
this.$Message.info('请选择套餐类型');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.params.reset_months) {
|
if (!this.params.reset_months) {
|
||||||
this.$Message.info('请输入重置周期');
|
this.$Message.info('请输入重置周期');
|
||||||
return;
|
return;
|
||||||
@ -132,7 +145,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
let strKeys = ['sn', 'name', 'carrier_operator', 'description'];
|
let strKeys = ['sn', 'name', 'carrier_operator', 'package_type', 'description'];
|
||||||
for (let k in this.params) {
|
for (let k in this.params) {
|
||||||
if (strKeys.indexOf(k) === -1) {
|
if (strKeys.indexOf(k) === -1) {
|
||||||
this.params[k] = 0;
|
this.params[k] = 0;
|
||||||
@ -140,7 +153,6 @@ export default {
|
|||||||
this.params[k] = '';
|
this.params[k] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.my_show = false;
|
this.my_show = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import * as API from "api/virtual/packages";
|
import * as API from "api/virtual/packages";
|
||||||
|
import * as propsAPI from 'api/virtual/properties';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Companies",
|
name: "Companies",
|
||||||
components: {
|
components: {
|
||||||
@ -195,7 +197,6 @@ export default {
|
|||||||
"该套餐已被删除"
|
"该套餐已被删除"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.haveJurisdiction("update")) {
|
if (this.haveJurisdiction("update")) {
|
||||||
html.push(
|
html.push(
|
||||||
h(
|
h(
|
||||||
@ -260,17 +261,48 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
settingsData: {
|
||||||
|
package_type: []
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
window.vmt = this;
|
||||||
|
|
||||||
this.type = Number(this.$route.params.type);
|
this.type = Number(this.$route.params.type);
|
||||||
|
|
||||||
|
if (this.type == 0) {
|
||||||
|
this.settings();
|
||||||
|
}
|
||||||
|
|
||||||
this.index(1);
|
this.index(1);
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
if (this.type == 0) {
|
||||||
|
this.table_titles.splice(5, 0, {
|
||||||
|
title: "套餐类型",
|
||||||
|
key: "",
|
||||||
|
width: 100,
|
||||||
|
render: (h, { row, column, index }) => {
|
||||||
|
let text = this.settingsData.package_type;
|
||||||
|
return h(
|
||||||
|
"Button",
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
type: "primary",
|
||||||
|
size: "small"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
text[row.package_type]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (this.type !== 3) {
|
if (this.type !== 3) {
|
||||||
this.table_titles.splice(7, 0, {
|
this.table_titles.splice(7, 0, {
|
||||||
title: "套餐类型",
|
title: "流量套餐",
|
||||||
key: "",
|
key: "",
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (h, { row, column, index }) => {
|
render: (h, { row, column, index }) => {
|
||||||
@ -332,7 +364,8 @@ export default {
|
|||||||
openEdit(bool, data = null) {
|
openEdit(bool, data = null) {
|
||||||
this.editObj = {
|
this.editObj = {
|
||||||
show: bool,
|
show: bool,
|
||||||
data
|
data,
|
||||||
|
settings: this.settingsData
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -361,6 +394,15 @@ export default {
|
|||||||
}
|
}
|
||||||
this.trashed = null;
|
this.trashed = null;
|
||||||
this.index(1);
|
this.index(1);
|
||||||
|
},
|
||||||
|
settings() {
|
||||||
|
if (!this.settingsData.length) {
|
||||||
|
propsAPI.settings().then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.settingsData = res.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
2
public/css/chunk-42b3944b.68383367.css
Normal file
2
public/css/chunk-42b3944b.68383367.css
Normal file
File diff suppressed because one or more lines are too long
1
public/js/app.b1531160.js
Normal file
1
public/js/app.b1531160.js
Normal file
File diff suppressed because one or more lines are too long
8
public/js/chunk-42b3944b.ac4a95ce.js
Normal file
8
public/js/chunk-42b3944b.ac4a95ce.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-1a1a22d5.6166dab5.css rel=prefetch><link href=/css/chunk-42b3944b.61692546.css rel=prefetch><link href=/js/chunk-1a1a22d5.09fd5492.js rel=prefetch><link href=/js/chunk-29ecfeab.2fbfdf81.js rel=prefetch><link href=/js/chunk-42b3944b.e893f97d.js rel=prefetch><link href=/js/chunk-5b684432.422b14b3.js rel=prefetch><link href=/css/app.42353d5a.css rel=preload as=style><link href=/css/chunk-vendors.a38c182d.css rel=preload as=style><link href=/js/app.e8b91011.js rel=preload as=script><link href=/js/chunk-vendors.a5156fe1.js rel=preload as=script><link href=/css/chunk-vendors.a38c182d.css rel=stylesheet><link href=/css/app.42353d5a.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.a5156fe1.js></script><script src=/js/app.e8b91011.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-1a1a22d5.6166dab5.css rel=prefetch><link href=/css/chunk-42b3944b.68383367.css rel=prefetch><link href=/js/chunk-1a1a22d5.09fd5492.js rel=prefetch><link href=/js/chunk-29ecfeab.2fbfdf81.js rel=prefetch><link href=/js/chunk-42b3944b.ac4a95ce.js rel=prefetch><link href=/js/chunk-5b684432.422b14b3.js rel=prefetch><link href=/css/app.42353d5a.css rel=preload as=style><link href=/css/chunk-vendors.a38c182d.css rel=preload as=style><link href=/js/app.b1531160.js rel=preload as=script><link href=/js/chunk-vendors.a5156fe1.js rel=preload as=script><link href=/css/chunk-vendors.a38c182d.css rel=stylesheet><link href=/css/app.42353d5a.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.a5156fe1.js></script><script src=/js/app.b1531160.js></script></body></html>
|
Loading…
x
Reference in New Issue
Block a user