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

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

Loading…
Cancel
Save