mirror of
https://gitee.com/ZhongBangKeJi/crmeb_java.git
synced 2026-04-23 12:08:33 +08:00
更新代码
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<el-input v-model="pram.realName" placeholder="管理员姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="管理员身份" prop="roles">
|
||||
<el-select v-model="pram.roles" placeholder="身份" clearable multiple>
|
||||
<el-select v-model="pram.roles" placeholder="身份" clearable multiple style="width: 100%">
|
||||
<el-option
|
||||
v-for="item,index in roleList.list"
|
||||
:key="index"
|
||||
@@ -29,6 +29,10 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input type="text" v-model="pram.phone" prefix="ios-contact-outline"
|
||||
placeholder="请输入手机号" size="large"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-switch v-model="pram.status" :active-value="true" :inactive-value="false" />
|
||||
</el-form-item>
|
||||
@@ -59,6 +63,15 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const validatePhone = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('请填写手机号'));
|
||||
} else if (!/^1[3456789]\d{9}$/.test(value)) {
|
||||
callback(new Error('手机号格式不正确!'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const validatePass = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('请再次输入密码'))
|
||||
@@ -78,7 +91,8 @@ export default {
|
||||
realName: null,
|
||||
roles: [],
|
||||
status: null,
|
||||
id: null
|
||||
id: null,
|
||||
phone: null
|
||||
},
|
||||
roleList: [],
|
||||
rules: {
|
||||
@@ -87,7 +101,10 @@ export default {
|
||||
pwd: [{ required: true, message: '请填管理员密码', trigger: ['blur', 'change'] }],
|
||||
repwd: [{ required: true, message: '确认密码密码', validator: validatePass, trigger: ['blur', 'change'] }],
|
||||
realName: [{ required: true, message: '管理员姓名', trigger: ['blur', 'change'] }],
|
||||
roles: [{ required: true, message: '管理员身份', type: 'array', trigger: ['blur', 'change'] }]
|
||||
roles: [{ required: true, message: '管理员身份', type: 'array', trigger: ['blur', 'change'] }],
|
||||
phone: [
|
||||
{ validator: validatePhone, trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -111,7 +128,7 @@ export default {
|
||||
},
|
||||
initEditData() {
|
||||
if (this.isCreate !== 1) return
|
||||
const { account, realName, roles, level, status, id } = this.editData
|
||||
const { account, realName, roles, level, status, id, phone } = this.editData
|
||||
this.pram.account = account
|
||||
this.pram.realName = realName
|
||||
const _roles = []
|
||||
@@ -123,6 +140,7 @@ export default {
|
||||
this.pram.roles = _roles
|
||||
this.pram.status = status
|
||||
this.pram.id = id
|
||||
this.pram.phone = phone
|
||||
this.rules.pwd = []
|
||||
this.rules.repwd = []
|
||||
},
|
||||
|
||||
@@ -42,6 +42,11 @@
|
||||
/>
|
||||
<el-table-column label="姓名" prop="realName" min-width="120"/>
|
||||
<el-table-column label="账号" prop="account" min-width="120"/>
|
||||
<el-table-column label="手机号" prop="lastTime" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.phone | filterEmpty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="身份" prop="realName" min-width="230">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" type="info" v-for="(item, index) in scope.row.roleNames.split(',')" class="mr5">{{ item }}</el-tag>
|
||||
@@ -57,9 +62,35 @@
|
||||
<span>{{ scope.row.lastIp | filterEmpty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status" min-width="100">
|
||||
<el-table-column
|
||||
label="状态"
|
||||
min-width="100"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.status | filterShowOrHide }}</span>
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
@change="onchangeIsShow(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="是否接收短信"
|
||||
min-width="100"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isSms"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
:disabled="!scope.row.phone"
|
||||
@click.native="onchangeIsSms(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="删除标记" prop="status" min-width="100">
|
||||
@@ -93,6 +124,7 @@
|
||||
:title="editDialogConfig.isCreate === 0? '创建身份':'编辑身份'"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
width="700px"
|
||||
>
|
||||
<edit
|
||||
v-if="editDialogConfig.visible"
|
||||
@@ -142,6 +174,38 @@ export default {
|
||||
this.handleGetRoleList()
|
||||
},
|
||||
methods: {
|
||||
onchangeIsShow(row) {
|
||||
systemAdminApi.updateStatusApi({id: row.id, status: row.status})
|
||||
.then(async () => {
|
||||
this.$message.success('修改成功');
|
||||
this.handleGetAdminList()
|
||||
}).catch(()=>{
|
||||
row.status = !row.status
|
||||
})
|
||||
},
|
||||
onchangeIsSms(row) {
|
||||
// this.$confirm(`此操作将${!row.isSms ? '开启' : '关闭'}验证, 是否继续?`, "提示", {
|
||||
// confirmButtonText: "确定",
|
||||
// cancelButtonText: "取消",
|
||||
// type: "warning"
|
||||
// }).then(async () => {
|
||||
// row.isSms = !row.isSms
|
||||
// }).catch(() => {
|
||||
// this.$message.error('取消操作')
|
||||
// })
|
||||
|
||||
if(!row.phone) return this.$message({
|
||||
message: '请先为管理员添加手机号!',
|
||||
type: 'warning'
|
||||
});
|
||||
systemAdminApi.updateIsSmsApi({id: row.id})
|
||||
.then(async () => {
|
||||
this.$message.success('修改成功');
|
||||
this.handleGetAdminList()
|
||||
}).catch(()=>{
|
||||
row.isSms = !row.isSms
|
||||
})
|
||||
},
|
||||
handleSearch() {
|
||||
this.listPram.page = 1
|
||||
this.handleGetAdminList()
|
||||
|
||||
@@ -259,10 +259,28 @@ export default {
|
||||
},
|
||||
popoverHide() {},
|
||||
handleClose() {
|
||||
this.dialogVisible = false
|
||||
this.$refs['ruleForm'].resetFields()
|
||||
this.dialogVisible = false
|
||||
this.ruleForm={
|
||||
name: '',
|
||||
type: 1,
|
||||
appoint: false,
|
||||
sort: 0,
|
||||
region: [{
|
||||
first: 1,
|
||||
firstPrice: 1,
|
||||
renewal: 1,
|
||||
renewalPrice: 1,
|
||||
city_ids: []
|
||||
}],
|
||||
undelivery: 0,
|
||||
free: [],
|
||||
undelives: {},
|
||||
city_id3: []
|
||||
}
|
||||
},
|
||||
changeRegion(value) {
|
||||
console.log(value)
|
||||
// console.integralLog(value)
|
||||
},
|
||||
changeRadio(num) {
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<CreatTemplates ref="addTemplates" @getList="getList" />
|
||||
<CreatTemplates ref="addTemplates" @getList="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -115,6 +115,7 @@ export default {
|
||||
components: { CreatTemplates },
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
dialogVisible: false,
|
||||
form: {
|
||||
keywords: ''
|
||||
@@ -133,7 +134,7 @@ export default {
|
||||
handleSubmit() {
|
||||
this.$refs.addTemplates.dialogVisible = true
|
||||
this.$refs.addTemplates.getCityList()
|
||||
this.$refs.addTemplates.changType(0, this.te)
|
||||
this.$refs.addTemplates.changType(0)
|
||||
},
|
||||
handleSearch() {
|
||||
this.page = 1
|
||||
@@ -162,7 +163,6 @@ export default {
|
||||
},
|
||||
// 编辑
|
||||
bindEdit(item) {
|
||||
// this.$refs.addTemplates.dialogVisible = true
|
||||
this.$refs.addTemplates.getCityList()
|
||||
this.$refs.addTemplates.getInfo(item.id, item.appoint)
|
||||
this.$refs.addTemplates.changType(1)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<el-date-picker v-model="timeVal" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 250px;" @change="onchangeTime" />
|
||||
</el-form-item>
|
||||
<el-form-item label="选择门店:">
|
||||
<el-select v-model="tableFrom.storeId" clearable filterable placeholder="请选择" class="selWidth" clearable @change="getList(1)">
|
||||
<el-select v-model="tableFrom.storeId" filterable placeholder="请选择" class="selWidth" clearable @change="getList(1)">
|
||||
<el-option
|
||||
v-for="item in storeSelectList"
|
||||
:key="item.id"
|
||||
|
||||
@@ -189,7 +189,7 @@ export default {
|
||||
//刪除
|
||||
storeDelete(id){
|
||||
let that = this;
|
||||
that.$modalSure().then(() => {
|
||||
that.$modalSure('删除提货点吗?').then(() => {
|
||||
storeDeleteApi({ id: id }).then(() => {
|
||||
that.$message.success('删除成功')
|
||||
that.storeGetCount();
|
||||
|
||||
Reference in New Issue
Block a user