导购换店开发。

feature_0521
kevin jiang 6 years ago
parent f8b35f9a91
commit 07f8a6a523

@ -18,8 +18,7 @@
:columns="columns1"
:data="data1"
style="margin-top: 20px;"
size="small"
>
size="small">
<template slot-scope="{ row }" slot="qrCodeAction">
<img
:src="require('../../../static/img/qrCode-init.png')"
@ -27,16 +26,16 @@
style="margin-left: 5px;margin-top: 5px;width:30px;height:30px;"
/>
</template>
<template slot-scope="{ row, index }" slot="state">
<i-switch
size="large"
:value="row.qrCodeState"
@on-change="onSwitchChangeLister(row, index)"
>
<span slot="open">开启</span>
<span slot="close">关闭</span>
</i-switch>
</template>
<!-- <template slot-scope="{ row, index }" slot="accountFlag">-->
<!-- <i-switch-->
<!-- size="large"-->
<!-- :value="row.accountFlag"-->
<!-- @on-change="onSwitchChangeLister"-->
<!-- >-->
<!-- <span slot="open">开启</span>-->
<!-- <span slot="close">关闭</span>-->
<!-- </i-switch>-->
<!-- </template>-->
<template slot-scope="{ row }" slot="action">
<Button
@ -44,17 +43,15 @@
type="primary"
size="small"
style="border: 0px;color:#2074E2"
@click="open(2, row)"
>修改
@click="open(2, row)">修改
</Button>
<Button
ghost
type="error"
size="small"
style="border: 0px"
@click="remove(row)"
>删除</Button
>
@click="remove(row)">删除
</Button>
</template>
</Table>
@ -63,14 +60,13 @@
v-model="isShow"
:footer-hide="true"
width="230"
class-name="vertical-center-modal"
>
class-name="vertical-center-modal">
<div slot="header">
<p></p>
</div>
<p>{{ this.showStoreCode }}</p>
<p>{{ this.showStoreName }}</p>
<img :src="qrCodeImage" style="width:200px;height:200px;" />
<img :src="qrCodeImage" style="width:200px;height:200px;"/>
<div style="text-align: center;">
<Button ghost type="primary" @click="download(rowData)"></Button>
</div>
@ -130,18 +126,21 @@
</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" :true-value="1" :false-value="2"></Checkbox>
<Checkbox :disabled="formValidate.type === 1 ? true : false" v-model="formValidate.type"
:true-value="1" :false-value="2"></Checkbox>
</FormItem>
<FormItem style="text-align: left;">
<Row>
<i-col span="16">
<Button type="primary" @click="handleSubmit(formValidate)"
>保存</Button
>保存
</Button
>
<Button
@click="handleReset('formValidate')"
style="margin-left: 8px"
>取消</Button
>取消
</Button
>
</i-col>
</Row>
@ -167,7 +166,8 @@
type="error"
style="width: 100px;margin-left: 20px"
@click="deleteStaff"
>确认删除</Button
>确认删除
</Button
>
</div>
</Modal>
@ -186,10 +186,10 @@
</template>
<script>
import data from "../../utils/PhoneRegionData";
import http from "../../services/store/IncreaseStoreManager";
import staff from "../../services/staff/staff";
import data from "../../utils/PhoneRegionData";
import http from "../../services/store/IncreaseStoreManager";
import accountManagementService from '../../services/account/AccountManagement';
import staff from "../../services/staff/staff";
export default {
name: "IncreaseStaffManager",
@ -257,7 +257,30 @@ import staff from "../../services/staff/staff";
},
{
title: '停用/启用',
slot: 'status',
key: 'accountFlag',
render: (h, params) => {
let _this = this;
return h('div', [
h('i-switch', {
props: {
value: params.row.accountFlag,
'true-value': true,//
'false-value': false,//
size: 'large'
},
on: { //
'on-change': function (value) {
//
_this.modifyStatus(params.row.accountId, value);
}
},
scopedSlots: {
open: () => h('span', '开启'),
close: () => h('span', '关闭')
}
})
])
}
},
{
title: '操作',
@ -338,7 +361,12 @@ import staff from "../../services/staff/staff";
if (datas.records == null) {
datas.records = [];
}
that.data1 = datas.records;
for (let i = 0; i < datas.records.length; i++) {
let item = datas.records[i];
that.data1.push(item);
}
}
}, function () {
that.loading = false;
@ -427,26 +455,27 @@ import staff from "../../services/staff/staff";
})
},
searchCustomerDataBtnClick: function() {
searchCustomerDataBtnClick: function () {
this.listOfLogistics();
},
changeData: function(value) {
changeData: function (value) {
if (value == 0) {
return null;
}
return value;
},
//
handlePage: function(value) {
handlePage: function (value) {
this.pageNum = value;
this.listOfLogistics();
},
downRegionChange: function() {
downRegionChange: function () {
this.downShopData();
},
onChangeDateLister: function() {},
onChangeDateLister: function () {
},
//
show: function(index) {
show: function (index) {
this.isShow = true;
this.showStoreName = "姓名:" + index.name;
this.showStoreCode = "工号:" + index.staffCode;
@ -454,18 +483,19 @@ import staff from "../../services/staff/staff";
this.rowData = index;
},
//
download: function(index) {
download: function (index) {
let name = index.staffCode + "-" + index.name + "-导购码";
http.downloadImg(
{
url: index.epWechatQrCode,
},
name,
function(/*data*/) {}
function (/*data*/) {
}
);
},
// 广
open: function(flag, row) {
open: function (flag, row) {
this.flag = flag;
this.isShowAdd = true;
let role;
@ -493,21 +523,21 @@ import staff from "../../services/staff/staff";
this.handleAdd(this.formValidate);
}
},
back: function() {
this.$router.push({ path: "/shop/increase/manager" });
back: function () {
this.$router.push({path: "/shop/increase/manager"});
},
//
remove: function(row) {
remove: function (row) {
this.modal13 = true;
this.deleteId = row.id;
},
//
deleteStaff: function() {
deleteStaff: function () {
let requset = {
staffId: this.deleteId,
};
let that = this;
staff.removeStaff(requset, function(data) {
staff.removeStaff(requset, function (data) {
data = data.data;
if (data.results) {
that.$Message.success("删除成功!");
@ -519,7 +549,28 @@ import staff from "../../services/staff/staff";
});
},
// switch
onSwitchChangeLister: function() {},
modifyStatus(accountId, val) {
debugger
let that = this;
let status;
if (val) {
status = 1;
} else {
status = 2;
}
let request = {
accountId: accountId,
status: status
};
accountManagementService.postAccountModifyStatus(request, function (res) {
let data = res.data;
if (data.code !== "0000") {
that.$Message.error("修改失败");
}
}, function (res) {
});
},
handleSubmit(value) {
if (value) {
let request = {};
@ -586,11 +637,11 @@ import staff from "../../services/staff/staff";
value.checkbox = ["vail"];
},
},
};
};
</script>
<style scoped>
.table-staff {
.table-staff {
margin-top: 20px !important;
}
}
</style>

@ -44,11 +44,21 @@ export function listRoleInfoApi(params, call) {
return http.get('/role/info/list', params).then(call);
}
/**
* 修改账号状态
* @param params
* @param call
* @returns {Promise<any | never>}
*/
export function postAccountModifyStatus(params, call, p) {
return http.post('account/modify/status', params).then(call);
}
export default {
listAccountInfoApi,
removeAccountApi,
listAllShopApi,
listRoleInfoApi
listRoleInfoApi,
postAccountModifyStatus
}

Loading…
Cancel
Save