Browse Source

先提交下

dev-烟台0301
mk 3 years ago
parent
commit
ec0ce11f36
  1. 291
      src/views/modules/workSys/articleTag/edit.vue
  2. 3
      src/views/modules/workSys/articleTag/index.vue
  3. 38
      src/views/modules/workSys/emblemManagement/cpts/emblemIfon.vue
  4. 14
      src/views/modules/workSys/emblemManagement/index.vue

291
src/views/modules/workSys/articleTag/edit.vue

@ -5,66 +5,35 @@
<el-form ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
:rules="rules"
:disabled="formType==='detail'"
class="form">
<el-form-item label="角色名称"
prop="name"
<el-form-item label="分类名称"
prop="tagName"
label-width="150px"
style="display: block">
<el-input class="item_width_2"
:disabled="defaultRole==='1'"
placeholder="请输入角色名称"
clearable
v-model="formData.name">
v-model="formData.tagName">
</el-input>
</el-form-item>
<el-form-item label="备注"
prop="remark"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
:disabled="defaultRole==='1'"
maxlength="500"
show-word-limit
:autosize="{ minRows: 5, maxRows: 10 }"
clearable
placeholder="请输入备注"
v-model="formData.remark"></el-input>
</el-form-item>
<el-form-item label="管理平台菜单"
prop="content"
label-width="150px"
style="display: block">
<el-tree class="item_width_1"
:data="menuList"
:props="{ label: 'name', children: 'children' }"
node-key="id"
:default-expanded-keys="['000']"
ref="menuListTree"
accordion
show-checkbox>
</el-tree>
</el-form-item>
<el-form-item label="可视化平台菜单"
prop="content"
label-width="150px"
style="display: block">
<el-tree class="item_width_1 item_border"
:data="menuListShuju"
:props="{ label: 'name', children: 'children' }"
node-key="id"
:default-expanded-keys="['000']"
ref="menuListShujuTree"
accordion
show-checkbox>
</el-tree>
</el-form-item>
<!-- :prop="'formData.'+'agencyList.' +'agencyId'" -->
<el-form-item label="应用范围"
label-width="150px"
prop="agencyId"
>
<el-cascader ref="cascaderUnit"
v-model="formData.agencyId"
:options="orgOptions"
:props="{ checkStrictly: true, emitPath: false,children:'subAgencyList',label:'agencyName',value:'agencyId'}"
clearable
@change="cascaderClick"
/>
</el-form-item>
</el-form>
</div>
@ -90,138 +59,102 @@ import { requestPost, requestGet } from '@/js/dai/request'
let loading //
export default {
data () {
return {
formType: 'add', // addeditdetail
btnDisable: false,
orgOptions:[],
roleId: '',
sbid:'',
menuList: [],
menuListShuju: [],
formData: {
id: '',
name: '',
remark: '',//
menuIdList: [],
customerId: ''
tagName: '',
agencyId:'',
orgIdPath:''
},
formDatam:[],
rules:{
tagName: [
{ required: true, message: '分类名称不能为空', trigger: 'blur' }
],
agencyId:[
{ required: true, message: '应用范围不能为空', trigger: 'blur' }
]
},
defaultRole: '',
}
},
components: {},
async mounted () {
await this.getOrgTreeList()
},
methods: {
async initForm (type, roleId, defaultRole) {
async initForm (type, row, defaultRole) {
this.startLoading()
this.customerId = localStorage.getItem("customerId");
this.formData.customerId = this.customerId
//
await this.getMenuList()
await this.getMenuShujuList()
this.$refs.menuListTree.setCheckedKeys([])
this.$refs.menuListShujuTree.setCheckedKeys([])
this.formType = type
if (roleId) {
this.roleId = roleId
this.formData.id = roleId
this.defaultRole = defaultRole
this.loadFormData()
}
this.formData = {...row}
this.endLoading()
},
async getMenuList () {
const url = "/gov/access/menu/nav"
let params = {}
const { data, code, msg } = await requestGet(url, params)
if (code === 0) {
this.menuList = [
{
id: '000',
name: '全部菜单',
children: [...data]
}
]
// this.menuList = data
} else {
this.$message.error(msg)
}
},
async getMenuShujuList () {
const url = "/gov/access/menu/nav"
let params = {
tableName: 'data_menu'
}
const { data, code, msg } = await requestGet(url, params)
if (code === 0) {
this.menuListShuju = [
{
id: '000',
name: '全部菜单',
children: [...data]
}
]
// this.menuListShuju = data
} else {
this.$message.error(msg)
}
},
async loadFormData () {
// const url = 'http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/detail'
const url = '/gov/access/govrole/' + this.roleId
let params = {
}
const { data, code, msg } = await requestGet(url, params)
if (code === 0) {
this.formData = data
this.formData.menuIdList.forEach(item => {
this.$refs.menuListTree.setChecked(item, true)
})
this.formData.menuIdList.forEach(item => {
this.$refs.menuListShujuTree.setChecked(item, true)
})
this.formData.customerId = this.customerId
async getOrgTreeList() {
const { user } = this.$store.state
this.dataListLoading = true
this.$http
.post('/gov/org/customeragency/staffinagencylist')
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
let { agencyList, subAgencyList } = res.data
// this.optionsA = res.data
// console.log(this.optionsA);
const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }]
this.orgOptions = this.deepTree(_arr)
}
})
.catch(() => {
this.dataListLoading = false
return this.$message.error('网络错误')
})
this.dataListLoading = false
},
deepTree (arr) {
if (Array.isArray(arr)) {
return arr.map(item => {
return {
...item,
subAgencyList: item.subAgencyList.length > 0 && this.deepTree(item.subAgencyList) || null
}
})
}
},
cascaderClick () {
let obj = this.$refs["cascaderUnit"].getCheckedNodes()[0].data
var arr = []
if (obj) {
if (obj.level === "street" && obj.subAgencyList!= null) {
for(let i in obj.subAgencyList){
this.formDatam.push({'agencyId':obj.subAgencyList[i].agencyId,'orgIdPath':obj.orgIdPath})
}
console.log( this.formDatam);
} else {
this.$set(this.formData,'agencyId',obj.agencyId)
this.$set(this.formData,'orgIdPath',obj.orgIdPath)
}
} else {
this.$message.error(msg)
this.formData.agencyId = ''
}
},
},
handleComfirm () {
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
} else {
this.addNat()
}
@ -230,20 +163,6 @@ export default {
},
async addNat () {
this.formData.menuIdList = []
this.formData.menuIdList = [
...this.$refs.menuListTree.getCheckedKeys(),
...this.$refs.menuListTree.getHalfCheckedKeys(),
...this.$refs.menuListShujuTree.getCheckedKeys(),
...this.$refs.menuListShujuTree.getHalfCheckedKeys()
]
this.formData.menuIdList = this.formData.menuIdList.filter(item => item !== '000')
console.log('menuAll', this.formData)
// return false
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
@ -251,18 +170,30 @@ export default {
let url = ''
if (this.formType === 'add') {
url = '/gov/access/govrole/save'
this.formData.roleId = ''
url = '/gov/voice/tag/save'
} else {
url = '/gov/access/govrole/edit'
url = '/gov/voice/tag/update'
}
const { data, code, msg } = await requestPost(url, this.formData)
console.log(this.formData);
const { tagName,orgIdPath,agencyId} = this.formData
let params = {}
if(agencyId &&this.formDatam.length==0){
params = {
tagName,
agencyList:{
orgIdPath,
agencyId,
},
}
}else{
params = {
tagName,
agencyList:this.formDatam
}
}
const { data, code, msg } = await requestPost(url,params)
if (code === 0) {
this.$message({
type: 'success',
@ -276,7 +207,7 @@ export default {
this.btnDisable = false
this.$message.error(msg)
}
this.formDatam = []
},
handleCancle () {
@ -290,12 +221,7 @@ export default {
this.roleId = ''
this.formData = {
id: '',
name: '',
remark: '',//
menuIdList: [],
customerId: ''
tagName: '',
}
this.$refs['ref_form'].resetFields()
},
@ -318,10 +244,7 @@ export default {
computed: {
dataRule () {
return {
name: [
{ required: true, message: '角色名称不能为空', trigger: 'change' }
],
}
},

3
src/views/modules/workSys/articleTag/index.vue

@ -144,6 +144,7 @@
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
destroy-on-close
width="850px"
top="5vh"
class="dialog-h"
@ -267,7 +268,7 @@ export default {
this.formTitle = "修改";
this.formShow = true;
this.$nextTick(() => {
this.$refs.ref_form.initForm("edit", row.id, row.defaultRole);
this.$refs.ref_form.initForm("edit", row);
});
},

38
src/views/modules/workSys/emblemManagement/cpts/emblemIfon.vue

@ -24,12 +24,7 @@
</el-row>
<el-row type="flex" >
<el-col :span="24" style="display: flex;">
<span class="htgl_info_label">手机号:</span> <section style="flex:1">{{emblemObj.mobile||'--'}}</section>
</el-col>
</el-row>
<el-row type="flex" >
<el-col :span="24" style="display: flex;">
<span class="htgl_info_label">备注:</span> <section style="flex:1">{{emblemObj.userName||'--'}}</section>
<span class="htgl_info_label">手机号11111:</span> <section style="flex:1">{{emblemObj.mobile||'--'}}</section>
</el-col>
</el-row>
<el-row type="flex" >
@ -40,8 +35,18 @@
</template>
</el-col>
</el-row>
<el-row type="flex" >
<el-col :span="24" style="display: flex;">
<span class="htgl_info_label">审核原因:</span> <section style="flex:1">{{emblemObj.userName||'--'}}</section>
</el-col>
</el-row>
<el-row>
<el-button size="small"> 取消</el-button>
<el-button > 审核不通过</el-button>
<el-button > 审核通过</el-button>
</el-row>
</div>
</div>
</template>
@ -63,29 +68,12 @@
created() {
// console.log(this.emblemObj);
// this.$set(this.emblemObj,'topicVoices',this.emblemObj)
this.getResiTuomin(emblemObj.userId)
},
mounted(){
},
methods:{
async getResiTuomin(id){
const url = "/data/aggregator/epmetuser/detailByType";
const { data, code, msg } = await requestPost(url, {
id:id,
type: "checkIcResiUser",
});
if(code == 0){
for(let i in this.quanzufangResiList){
this.$set(this.emblemObj,'mobile',data.mobile)
this.$set(this.emblemObj,'idCard',data.idCard)
}
}else {
this.$message.error(msg)
}
},
},

14
src/views/modules/workSys/emblemManagement/index.vue

@ -191,6 +191,7 @@
topicId:'',
tableData:[],
emblemObj:{},
customerId:"",
pageNo: 1,
pageSize: window.localStorage.getItem("pageSize") || 20,
total: 1,
@ -202,6 +203,7 @@
mounted() {
this.getOrgTreeList();
this.getEmblemType()
this.customerId = localStorage.getItem("customerId");
},
methods: {
async getOrgTreeList() {
@ -244,11 +246,12 @@
this.pageNo = 1;
this.getTableData();
},
async getResiTuomin(id){
const url = "/data/aggregator/epmetuser/detailByType";
async getEmblemIfon(row){
const url = "/epmetuser/more/badge/certification/detail";
const { data, code, msg } = await requestPost(url, {
id:id,
type: "checkIcResiUser",
badgeId:row.badgeId,
recordId:row.recordId,
customerId:this.customerId,
});
if(code == 0){
return data
@ -289,8 +292,7 @@
},
async handleWatch (row) {
this.showhtglDialog = true
this.getResiTuomin(row.userId)
this.emblemObj = {row,...this.getResiTuomin(row.userId)}
this.emblemObj = {row,...this.getEmblemIfon(row)}
console.log(row);
},
},

Loading…
Cancel
Save