Merge branch 'feature/20200514_version' into feature_05212

feature_0521
root 6 years ago
commit cc57cf7bce

@ -41,8 +41,9 @@
<i-col span="5" class="big-blank"> <i-col span="5" class="big-blank">
</i-col> </i-col>
<i-col span="10" class="big-blank"> <i-col span="10" class="big-blank">
<row class="top-5"><span <row class="top-5">
class="huge-blank-font">{{customerViewVO.allCustomer}}</span></row> <countTo :startVal='lastVal' :endVal='endVal' :duration='3000' class="huge-blank-font"></countTo>
</row>
<row><span class="weight-700">好友总数</span></row> <row><span class="weight-700">好友总数</span></row>
</i-col> </i-col>
@ -58,8 +59,10 @@
<!-- <i-col span="4" class="big-blank">--> <!-- <i-col span="4" class="big-blank">-->
<!-- </i-col>--> <!-- </i-col>-->
<i-col span="4" class="big-blank"> <i-col span="4" class="big-blank">
<row class="top-15"><span <row class="top-15">
class="big-blank-font">{{customerViewVO.newCustomer}}</span></row> <countTo :startVal='lastVal2' :endVal='endVal2' :duration='3000' class="big-blank-font"></countTo>
</row>
<row class="top-10"><span>新增好友</span></row> <row class="top-10"><span>新增好友</span></row>
</i-col> </i-col>
<!-- <i-col span="2" class="big-blank">--> <!-- <i-col span="2" class="big-blank">-->
@ -187,11 +190,14 @@
</div> </div>
</template> </template>
<script> <script>
import customerView from "../../services/datacenter/customerView"; import customerView from "../../services/datacenter/customerView";
import countTo from 'vue-count-to';
export default { export default {
inject: ['setMenuName'], inject: ['setMenuName'],
components: {
countTo
},
data() { data() {
return { return {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId, userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
@ -243,7 +249,13 @@
{'date': '1/1', '新增好友': 30, '新增好友(去重)': 25}, {'date': '1/1', '新增好友': 30, '新增好友(去重)': 25},
] ]
}, },
timer: null timer: null,
startVal: 0,
endVal: 0,
lastVal: 0,
startVal2: 0,
endVal2: 0,
lastVal2: 0
} }
}, },
computed: { computed: {
@ -409,6 +421,8 @@
}, },
getAllCount: function(){ getAllCount: function(){
let that = this; let that = this;
that.lastVal = that.startVal;
customerView.getAllCount({ customerView.getAllCount({
userId: this.userId userId: this.userId
},function (data) { },function (data) {
@ -418,6 +432,8 @@
data = data.data.results; data = data.data.results;
that.customerViewVO.allCustomer = data.allCustomer; that.customerViewVO.allCustomer = data.allCustomer;
that.customerViewVO.allValidCustomer = data.allValidCustomer; that.customerViewVO.allValidCustomer = data.allValidCustomer;
that.endVal = data.allCustomer;
}); });
}, },
/**mainList*/ /**mainList*/
@ -430,6 +446,8 @@
endTime: this.endTime endTime: this.endTime
}; };
let that = this; let that = this;
that.lastVal2 = that.startVal2;
customerView.getMainRequest(request, function (data) { customerView.getMainRequest(request, function (data) {
if (data.data.code !== "0000") { if (data.data.code !== "0000") {
that.$Message.error("系统异常"); that.$Message.error("系统异常");
@ -437,6 +455,8 @@
data = data.data.results; data = data.data.results;
// that.customerViewVO = data;// // that.customerViewVO = data;//
that.customerViewVO.newCustomer = data.newCustomer; that.customerViewVO.newCustomer = data.newCustomer;
that.endVal2 = data.newCustomer;
that.customerViewVO.newValidCustomer = data.newValidCustomer; that.customerViewVO.newValidCustomer = data.newValidCustomer;
that.customerViewVO.customerList = data.customerList; that.customerViewVO.customerList = data.customerList;
that.customerViewVO.validCustomerList = data.validCustomerList; that.customerViewVO.validCustomerList = data.validCustomerList;

@ -83,12 +83,10 @@
</template> </template>
</div> </div>
<Form <Form ref="formValidate"
ref="formValidate"
:model="formValidate" :model="formValidate"
:rules="ruleValidate" :rules="ruleValidate"
:label-width="80" :label-width="80">
>
<FormItem label="名称" prop="name"> <FormItem label="名称" prop="name">
<i-input <i-input
v-model="formValidate.name" v-model="formValidate.name"
@ -99,8 +97,7 @@
<i-input <i-input
v-model="formValidate.phone" v-model="formValidate.phone"
placeholder="成员通过验证该手机号后可加入企业" placeholder="成员通过验证该手机号后可加入企业"
:disabled="flag !== 1" :disabled="flag !== 1">
>
</i-input> </i-input>
</FormItem> </FormItem>
<FormItem label="工号" prop="staffCode"> <FormItem label="工号" prop="staffCode">
@ -110,14 +107,13 @@
:disabled="flag !== 1" :disabled="flag !== 1"
></i-input> ></i-input>
</FormItem> </FormItem>
<FormItem label="角色" prop="role"> <FormItem label="角色" prop="roleId">
<Select <Select
v-model="formValidate.role" v-model="formValidate.roleId"
placeholder="选择角色" placeholder="选择角色"
:disabled="flag !== 1" :disabled="flag !== 1">
> <Option :value="4">店长</Option>
<Option value="DZ-DIANZHANG">店长</Option> <Option :value="5">导购</Option>
<Option value="DG-DAOGOU">导购</Option>
</Select> </Select>
</FormItem> </FormItem>
<FormItem v-if="flag === 1" label="" prop="checkbox"> <FormItem v-if="flag === 1" label="" prop="checkbox">
@ -125,8 +121,8 @@
<Checkbox label="vail">同步开通账号</Checkbox> <Checkbox label="vail">同步开通账号</Checkbox>
</CheckboxGroup> </CheckboxGroup>
</FormItem> </FormItem>
<FormItem v-if="flag !== 1 && formValidate.role === 'DZ-DIANZHANG'" label="主店长" prop="type"> <FormItem v-if="flag !== 1 && formValidate.roleCode === 'DZ-DIANZHANG'" label="主店长" prop="type">
<Checkbox :disabled="formValidate.type === 1 ? true : false" v-model="formValidate.type" <Checkbox :disabled="formValidate.type === 1" v-model="formValidate.type"
:true-value="1" :false-value="2"></Checkbox> :true-value="1" :false-value="2"></Checkbox>
</FormItem> </FormItem>
<FormItem style="text-align: left;"> <FormItem style="text-align: left;">
@ -244,7 +240,7 @@
}, },
{ {
title: '角色', title: '角色',
key: 'role', key: 'roleName',
}, },
{ {
title: '客户数', title: '客户数',
@ -257,21 +253,28 @@
}, },
{ {
title: '停用/启用', title: '停用/启用',
key: 'accountFlag', key: 'status',
render: (h, params) => { render: (h, params) => {
let _this = this; let _this = this;
return h('div', [ return h('div', [
h('i-switch', { h('i-switch', {
props: { props: {
value: params.row.accountFlag, value: params.row.status,
'true-value': true,// 'true-value': 1,//
'false-value': false,// 'false-value': 2,//
size: 'large' size: 'large'
}, },
on: { // on: { //
'on-change': function (value) { 'on-change': function (value) {
// //
_this.modifyStatus(params.row.accountId, value); // _this.modifyStatus(params.row.accountId, value);
let request = {
status: value,
id: _this.formValidate.id
};
debugger
//
_this.editSattf(request);
} }
}, },
scopedSlots: { scopedSlots: {
@ -294,12 +297,13 @@
staffCode: '', staffCode: '',
region: '', region: '',
phone: '', phone: '',
role: '', roleId: 0,
store: '', store: '',
userId: '', userId: '',
type: '', type: '',
status: 0, status: 0,
checkbox: ['vail'] checkbox: ['vail'],
roleCode: ''
}, },
ruleValidate: { ruleValidate: {
name: [ name: [
@ -316,8 +320,8 @@
// { required: true, message: '', trigger: 'blur' }, // { required: true, message: '', trigger: 'blur' },
// { type: 'email', message: '', trigger: 'blur' } // { type: 'email', message: '', trigger: 'blur' }
// ], // ],
role: [ roleId: [
{required: true, message: '请选择角色', trigger: 'change'} {type: 'number', required: true, message: '请选择角色', trigger: 'change'}
], ],
region: [ region: [
{required: true, type: String, message: '请选择区域', trigger: 'change'} {required: true, type: String, message: '请选择区域', trigger: 'change'}
@ -500,27 +504,19 @@
open: function (flag, row) { open: function (flag, row) {
this.flag = flag; this.flag = flag;
this.isShowAdd = true; this.isShowAdd = true;
let role; if (flag === 2) {
if (row && row.type) {
if (row.type === 1 || row.type === 2) {
role = "DZ-DIANZHANG";
} else {
role = "DG-DAOGOU";
}
}
if (flag == 2) {
this.formValidate = { this.formValidate = {
name: row.name, name: row.name,
staffCode: row.staffCode, staffCode: row.staffCode,
phone: row.mobil, phone: row.mobil,
role: role, roleId: row.roleId,
store: row.storeId, store: row.storeId,
type: row.type, type: row.type,
userId: row.userId, userId: row.userId,
id: row.id, id: row.id,
roleCode: row.roleCode
}; };
debugger
} else { } else {
this.handleAdd(this.formValidate); this.handleAdd(this.formValidate);
} }
@ -575,16 +571,16 @@
handleSubmit(value) { handleSubmit(value) {
if (value) { if (value) {
let request = {}; let request = {};
if (this.flag == 1) { if (this.flag === 1) {
if (value.name == null || value.name == "") { if (value.name == null || value.name === "") {
this.$Message.success("名称不能为空!"); this.$Message.success("名称不能为空!");
return; return;
} }
if (value.staffCode == null || value.staffCode == "") { if (value.staffCode == null || value.staffCode === "") {
this.$Message.success("工号不能为空!"); this.$Message.success("工号不能为空!");
return; return;
} }
if (value.role == null || value.role == "") { if (value.roleId == null || value.roleId === 0) {
this.$Message.success("角色不能为空!"); this.$Message.success("角色不能为空!");
return; return;
} }
@ -594,24 +590,18 @@
storeId: this.selectedStore, storeId: this.selectedStore,
mobil: value.phone, mobil: value.phone,
staffCode: value.staffCode, staffCode: value.staffCode,
role: value.role, roleId: value.roleId,
isOpen: this.formValidate.checkbox[0], isOpen: this.formValidate.checkbox[0],
}; };
this.addSattf(request); this.addSattf(request);
} else { } else {
let newRole;
if (value.role === "DZ-DIANZHANG") {
newRole = 1;
} else {
newRole = 4;
}
request = { request = {
name: value.name, name: value.name,
storeId: this.selectedStore, storeId: this.selectedStore,
mobil: value.phone, mobil: value.phone,
staffCode: value.staffCode, staffCode: value.staffCode,
roleId: newRole, roleId: value.roleId,
userId: this.formValidate.userId, userId: this.formValidate.userId,
type: this.formValidate.type, type: this.formValidate.type,
id: this.formValidate.id, id: this.formValidate.id,
@ -632,7 +622,7 @@
value.store = ""; value.store = "";
value.phone = ""; value.phone = "";
value.staffCode = ""; value.staffCode = "";
value.role = ""; value.roleId = 0;
value.type = ""; value.type = "";
value.region = ""; value.region = "";
value.checkbox = ["vail"]; value.checkbox = ["vail"];

Loading…
Cancel
Save