Commit 15c38a17 authored by 黄奎's avatar 黄奎

页面修改

parent 9128780b
...@@ -70,20 +70,20 @@ ...@@ -70,20 +70,20 @@
<div class="query-box"> <div class="query-box">
<ul> <ul>
<li> <li>
<span><em>{{$t('admin.admin_group')}}</em> <span><em>姓名</em>
<el-input class='w210' v-model="msg.Name" :placeholder="$t('pub.pleaseImport')" <el-input class='w210' v-model="msg.Name" :placeholder="$t('pub.pleaseImport')"
@keyup.enter.native="getList"></el-input> @keyup.enter.native="getList"></el-input>
</span> </span>
</li> </li>
<li> <li>
<span><em>{{$t('admin.admin_domain')}}</em> <span><em>账号</em>
<el-input class='w210' v-model="msg.Account" :placeholder="$t('pub.pleaseImport')" <el-input class='w210' v-model="msg.Account" :placeholder="$t('pub.pleaseImport')"
@keyup.enter.native="getList"></el-input> @keyup.enter.native="getList"></el-input>
</span> </span>
</li> </li>
<li> <li>
<span><em>{{$t('admin.admin_status')}}</em> <span><em>{{$t('admin.admin_status')}}</em>
<el-select class='w210' clearable v-model="msg.Status" :placeholder="$t('pub.unlimitedSel')"> <el-select class='w210' v-model="msg.Status" :placeholder="$t('pub.unlimitedSel')">
<el-option :label="$t('pub.unlimitedSel')" :value='-1'></el-option> <el-option :label="$t('pub.unlimitedSel')" :value='-1'></el-option>
<el-option label="正常" :value='0'></el-option> <el-option label="正常" :value='0'></el-option>
<el-option label="禁用" :value='1'></el-option> <el-option label="禁用" :value='1'></el-option>
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<li> <li>
<input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')" <input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')"
@click="resetPageIndex(),getList()" /> @click="resetPageIndex(),getList()" />
<input type="button" @click="outerVisible = true,dialogTitle='新增集团信息'" class="normalBtn" <input type="button" @click="outerVisible = true,dialogTitle='新增账号信息'" class="normalBtn"
:value="$t('pub.addBtn')" /> :value="$t('pub.addBtn')" />
</li> </li>
</ul> </ul>
...@@ -110,263 +110,124 @@ ...@@ -110,263 +110,124 @@
<th width="100">操作</th> <th width="100">操作</th>
</tr> </tr>
<tr v-for="(item,index) in DataList" v-loading='loading' :key="index"> <tr v-for="(item,index) in DataList" v-loading='loading' :key="index">
<td>{{item.GroupName}}</td> <td>{{item.Id}}</td>
<td>{{item.Domain}}</td> <td>{{item.Name}}</td>
<td>{{item.VersionsName}}</td> <td>{{item.Account}}</td>
<td>{{item.ContactPersion}}:{{item.MobilePhone}}</td> <td>{{item.StatusStr}}</td>
<td>{{item.Status==0?'开启':'关闭'}}</td> <td>{{item.UpdateByName}} </td>
<td>{{item.EmAccount}}</td> <td> {{item.UpdateTimeStr}}</td>
<td> <td>
<el-tooltip class="item" effect="dark" content="修改" placement="top-start"> <el-tooltip class="item" effect="dark" content="修改" placement="top-start">
<el-button @click="outerVisible = true,dialogTitle='修改集团信息',updateData(item.Id)" type="primary" <el-button @click="outerVisible = true,dialogTitle='修改账号信息',GetAccount(item.Id)" type="primary"
icon="el-icon-edit" circle></el-button> icon="el-icon-edit" circle></el-button>
</el-tooltip> </el-tooltip>
<el-tooltip class="item" effect="dark" content="公司" placement="top-start">
<el-button @click="goUrl('companyManagement',item.Id)" type="primary" icon="iconfont icon-gongsi1" circle>
</el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="管理员" placement="top-start">
<el-button @click="getSystem(item)" type="primary" icon="iconfont icon-guanliyuan" circle></el-button>
</el-tooltip>
</td> </td>
</tr> </tr>
</table> </table>
<el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
layout="total,prev, pager, next, jumper" :page-size=msg.pageSize :total=total> layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total="total">
</el-pagination> </el-pagination>
<el-dialog custom-class='w500' :title="dialogTitle" :visible.sync="outerVisible" center <el-dialog custom-class='w500' :title="dialogTitle" :visible.sync="outerVisible" center>
:before-close="closeChangeMachie"> <el-form :model="addMsg" ref="addMsg" label-width="120px">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="120px"> <el-form-item class='w400' label="姓名">
<el-form-item class='w400' :label="$t('admin.admin_group')" prop="GroupName"> <el-input type="text" v-model="addMsg.Name" placeholder="请输入姓名"></el-input>
<el-input type="text" v-model="addMsg.GroupName" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
<el-form-item class='w400' :label="$t('admin.admin_domain')" prop="Domain">
<el-input type="text" v-model="addMsg.Domain" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
<el-form-item class='w400' label="B2B域名" prop="B2BDomain">
<el-input type="text" v-model="addMsg.B2BDomain " :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
<el-form-item class='w400' :label="$t('admin.admin_address')" prop="Address">
<el-input type="text" v-model="addMsg.Address" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
<el-form-item class='w400' :label="$t('pub.telphone')" prop="Tel">
<el-input type="text" v-model="addMsg.Tel" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
<el-form-item class='w400' label='联系人姓名' prop="ContactPersion">
<el-input type="text" v-model="addMsg.ContactPersion" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item> </el-form-item>
<el-form-item class='w400' label='联系人手机' prop="MobilePhone"> <el-form-item class='w400' label="账号">
<el-input type="text" v-model="addMsg.MobilePhone" :placeholder="$t('pub.pleaseImport')"></el-input> <el-input type="text" v-model="addMsg.Account" placeholder="请输入账号"></el-input>
</el-form-item> </el-form-item>
<el-form-item class='w400' label="供应商">
<el-form-item class='w400' label='系统版本' prop="Versions_Id"> <el-select class='w210' v-model="addMsg.SupplierId" :placeholder="$t('pub.unlimitedSel')">
<el-select v-model="addMsg.Versions_Id" placeholder="请选项" @change='sendVal(addMsg.Versions_Id)'> <el-option :label="$t('pub.unlimitedSel')" :value='-1'></el-option>
<el-option v-for='item in versions' :label='item.VersionsName' :key='item.Id' :value='item.Id'></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class='w400' label='账户数量' prop="EmployeeNum"> <el-form-item class='w400' label="状态">
<el-input type="text" v-model="addMsg.EmployeeNum" :placeholder="$t('pub.pleaseImport')"></el-input> <el-select class='w210' v-model="addMsg.Status" :placeholder="$t('pub.unlimitedSel')">
</el-form-item> <el-option :label="$t('pub.unlimitedSel')" :value='-1'></el-option>
<el-form-item class='w400' label='部门最大层级' prop="MaxDepartmentTier"> <el-option label="正常" :value='0'></el-option>
<el-input type="text" v-model="addMsg.MaxDepartmentTier" :placeholder="$t('pub.pleaseImport')"></el-input> <el-option label="禁用" :value='1'></el-option>
</el-form-item> <el-option label="删除" :value='2'></el-option>
<el-form-item label='Logo'> </el-select>
<el-upload class="avatar-uploader" :http-request="UploadImage" :show-file-list="false"
:on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<i class="el-icon-upload2 avatar-uploader-icon"></i>
<span v-if="imageUrl" class="repUp">{{$t('system.up_againUp')}}</span>
<span v-else class="repUp">{{$t('system.up_upImg')}}</span>
</el-upload>
</el-form-item>
<el-form-item class='w400' label='状态' prop="Status">
<el-switch v-model="addMsg.Status" active-value="0" inactive-value="1"></el-switch>
</el-form-item>
<el-form-item class='w400' label='备注' prop="Remarks">
<el-input type="textarea" v-model="addMsg.Remarks"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="outerVisible = false,resetForm('addMsg')">取 消</button> &nbsp; <button class="hollowFixedBtn" @click="outerVisible = false,clearData()">取 消</button> &nbsp;
<button class="normalBtn" type="primary" @click="submitForm('addMsg')">保存</button> <button class="normalBtn" type="primary" @click="saveSCMAccount()">保存</button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
msgTitle: '添加管理员',
loading: true, loading: true,
value: '',
DataList: '', DataList: '',
versions: [],
chosenIndex: -1,
res: {},
total: 0, total: 0,
pageSize: '',
currentPage: 1, currentPage: 1,
outerVisible: false, outerVisible: false,
innerVisible: false,
isRight: true,
dialogTitle: '', dialogTitle: '',
imageUrl: '', msg: {
//请求数据
msg: { //请求数据
pageIndex: 1, pageIndex: 1,
pageSize: 15, pageSize: 15,
Status: -1, Status: -1,
Name:'', Name: '',
Account: '' Account: ''
}, },
addMsg1: {
GroupId: '',
RoleName: '',
AdminAccount: '',
AdminPassword: '',
AdminName: '',
PostName: '',
EmLoginMobile: ''
},
addMsg: { addMsg: {
Id:0,//编号 Id: 0, //编号
Name:"",//姓名 Name: "", //姓名
Account:"",//账号 Account: "", //账号
Pwd:"",//密码 Pwd: "123456", //密码
SupplierId:0,//供应商编号 SupplierId: 0, //供应商编号
HeadImg:"",//头像 HeadImg: "", //头像
}, },
verSionMsg: {
Status: 0
},
canSave: true,
systemShow: false,
newUserList: []
} }
}, },
mounted() { mounted() {
this.getList(); this.getList();
this.getVersion();
}, },
methods: { methods: {
//上传图片 //保存信息
UploadImage(file) { saveSCMAccount() {
let newArr = []; this.apipost('admin_post_SetAdminAccount', this.addMsg, res => {
newArr.push(file.file);
let fileName = file.file.name;
var path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, x => {
this.imageUrl = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.addMsg.Logo = x.data.FilePath;
});
},
sendVal(id) {
let obj = this.versions.find(item => item.Id === id)
if (obj) {
this.addMsg.EmployeeNum = obj.EmployeeNum
}
},
saveSystem() {
this.apipost('admin_post_SetAdminAccount', this.addMsg1, res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.$message.success(res.data.message); this.$message.success(res.data.message);
this.systemShow = false;
this.getList() this.getList()
this.resetForm1('addMsg1'); this.clearData();
} else { } else {
this.$message.error(res.data.message) this.$message.error(res.data.message)
} }
}, err => {}) }, err => {})
}, },
getSystem(obj) { //清空数据
this.addMsg1.GroupId = obj.Id clearData() {
this.systemShow = true this.addMsg.Id = 0;
if (obj.EmAccount == '' || obj.EmAccount == null) { this.addMsg.Name = "";
this.canSave = true this.addMsg.Account = "";
this.msgTitle = '添加管理员' this.addMsg.Pwd = "123456";
} else { this.addMsg.SupplierId = 0;
this.canSave = false this.addMsg.HeadImg = "";
this.msgTitle = '修改管理员'
}
this.apipost('admin_get_GetAdminAccountForRoleList', {
GroupId: obj.Id
}, res => {
if (res.data.resultCode == 1) {
this.newUserList = res.data.data
this.getSystemInfo(obj.Id)
}
}, err => {})
},
getSystemInfo(id) {
this.apipost('admin_get_GetAdminAccount', {
GroupId: id
}, res => {
if (res.data.resultCode == 1) {
this.addMsg1.PostName = res.data.data.PostName
this.addMsg1.AdminName = res.data.data.AdminName
this.addMsg1.AdminAccount = res.data.data.AdminAccount
this.addMsg1.AdminPassWord = res.data.data.AdminPassWord
this.addMsg1.RoleName = res.data.data.RoleName
this.addMsg1.EmLoginMobile = res.data.data.EmLoginMobile
}
}, err => {})
},
handleAvatarSuccess(res, file) { //上传
if (res.resultCode == 1) {
var img_path = res.data.FullFilePath
this.addMsg.Logo = res.data.FilePath
this.imageUrl = img_path
}
},
beforeAvatarUpload(file) { //上传-
}, },
getList() { //获取数据 getList() { //获取数据
this.loading = true this.loading = true
this.apipost('admin_get_GroupGetPageList', this.msg, res => { this.apipost('scm_get_GetSCMAccountPageListService', this.msg, res => {
this.loading = false;
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.loading = false
this.DataList = res.data.data.pageData; this.DataList = res.data.data.pageData;
this.total = res.data.data.count; this.total = res.data.data.count;
} else {} } else {}
}, err => {}) }, err => {})
}, },
getVersion() { //获取版本信息 //获取账号信息
this.apipost('admin_get_SysVersionsGetList', this.verSionMsg, res => { GetAccount(id) {
this.versions = res.data.data; this.apipost('scm_get_GetSCMAccountService', {
}, err => { Id: id
})
},
addData() { //新增数据
this.apipost('admin_post_GroupSet', this.addMsg, res => {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.outerVisible = false;
this.getList()
this.resetForm('addMsg');
} else {
this.$message.error(res.data.message)
}
}, err => {})
},
updateData(id) {
this.apipost('admin_get_GroupGet', {
GroupId: id
}, res => { }, res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.addMsg = res.data.data; this.addMsg = res.data.data;
this.addMsg.Status = res.data.data.Status.toString() }
this.imageUrl = this.addMsg.Logo;
} else {}
}, err => {}) }, err => {})
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
...@@ -376,48 +237,6 @@ ...@@ -376,48 +237,6 @@
resetPageIndex() { resetPageIndex() {
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
this.currentPage = 1 this.currentPage = 1
},
menuShow(index) {
this.chosenIndex = this.chosenIndex == index ? -1 : index;
},
goUrl(path, id) {
this.$router.push({
name: path,
query: {
"id": id,
blank: 'y',
tab: '公司管理'
}
})
},
submitForm(addMsg) { //提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.addData()
} else {
return false;
}
});
},
submitForm1(addMsg) { //提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.saveSystem()
} else {
return false;
}
});
},
closeChangeMachie(done) { //弹出框关闭初始化弹框内表单
done();
this.resetForm('addMsg');
},
resetForm(formName) { //弹出框取消 初始化谈框内表单
this.$refs[formName].resetFields();
this.addMsg.Id = '-1'
this.addMsg.Logo = '';
this.imageUrl = '';
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment