Parcourir la source

农业执法资料修改

wulanhaote
庞东旭 il y a 3 ans
Parent
révision
2d28680986
4 fichiers modifiés avec 242 ajouts et 3 suppressions
  1. +9
    -0
      src/api/lawEnforcement/index.js
  2. +9
    -0
      src/router/index.js
  3. +213
    -0
      src/views/lawEnforcement/user/companyInformation.vue
  4. +11
    -3
      src/views/lawEnforcement/user/index.vue

+ 9
- 0
src/api/lawEnforcement/index.js Voir le fichier

@@ -372,3 +372,12 @@ export function treeselectUser() {
method: 'get'
})
}

// 修改农业执法-监管对象(企业)
export function updateCompany(data) {
return request({
url: '/enforce/company/edit',
method: 'post',
data: data
})
}

+ 9
- 0
src/router/index.js Voir le fichier

@@ -1644,6 +1644,15 @@ export const constantRoutes = [
},
component: (resolve) => require(['@/views/lawEnforcement/user/userInformation'], resolve)
},
{
path: '/lawEnforcement/companyInformation',
name: 'lawCompanyInformation',
meta: {
title: '修改信息',
hidden: true,
},
component: (resolve) => require(['@/views/lawEnforcement/user/companyInformation'], resolve)
},
{
path: '/lawEnforcement/indexComplaint',
name: 'indexComplaint',


+ 213
- 0
src/views/lawEnforcement/user/companyInformation.vue Voir le fichier

@@ -0,0 +1,213 @@
<template>
<div class="app-container" :style="{height:height+'px'}">
<van-nav-bar
title="修改信息"
left-arrow
fixed
placeholder
@click-left="onClickLeft"
/>
<van-form @submit="getSubmit">
<van-field v-model="form.phone+' ( 不可修改 )'" type="tel" readonly label="手机号" placeholder="请输入手机号" required :rules="[{ required:true }]" />
<van-field v-model="form.companyName" label="企业名称" placeholder="请输入企业名称"/>
<van-field v-model="form.uniformCode" label="社会信用代码" placeholder="请输入社会信用代码"/>
<van-field v-model="form.legalName" label="法人/负责人" placeholder="请输入法人/负责人"/>
<van-field
v-model="deptName"
is-link
readonly
name="area"
label="所在地区"
placeholder="请选择所在地区"
@click="showArea = true"
/>
<van-popup v-model:show="showArea" position="bottom">
<van-picker
show-toolbar
value-key="label"
:columns="deptOptions"
@confirm="onConfirmAdress"
@cancel="showArea = false"
/>
</van-popup>
<van-field v-model="form.companyBranch" label="企业分支机构" placeholder="请输入企业分支机构"/>
<van-field v-model="form.address" label="详细地址" placeholder="请输入详细地址" />
<van-field v-model="form.investor" label="企业投资人" placeholder="请输入企业投资人" />
<van-field v-model="form.businessMode" label="经营方式" placeholder="请输入经营方式" />
<van-field
v-model="businessTypeText"
is-link
readonly
label="经营类别"
placeholder="请选择经营类别"
@click="showBusiness = true"
/>
<van-popup v-model:show="showBusiness" position="bottom">
<van-picker
title="经营类别"
show-toolbar
:columns="businessTypeOptions"
@confirm="onConfirmBusiness"
value-key="dictLabel"
@cancel="showBusiness = false"
/>
</van-popup>

<van-field v-model="form.businessScope" label="经营范围" placeholder="请输入经营范围" />

<div class="submit">
<van-button round block type="info" color="#007E72" native-type="submit">保存</van-button>
</div>
</van-form>
</div>
</template>

<script>
import { getCodeImg } from "@/api/login";
import { logout ,getInfo } from "@/api/login/index";
import { userRegister } from "@/api/register/index";
import { companyList,treeselectUser , updateCompany } from "@/api/lawEnforcement/index";
import Cookies from "js-cookie";
export default {
name: "companyRegister",
data() {
return {
height:0,
tel:'',
value:'',
confirmPassWord:'',
businessTypeText:'',
showBusiness:false,
// 经营类别
businessTypeOptions: [],
showPicker: false,
columns:[],
deptName:'',
showArea:false,
// 部门列表
deptOptions: [],
form: {},
fieldNames : {
text: 'label',
value: 'value',
children: 'children',
},
codeUrl:''
};
},
created() {
this.getCode();
this.getDicts("economic_type").then(res => {
res.data.map(item => {
this.columns.push(item.dictLabel);
});
});
/** 查询部门下拉树结构 */
treeselectUser().then((response) => {
this.deptOptions = response.data;
this.getInformation();
});

this.getDicts("business_type").then(response => {
this.businessTypeOptions = response.data;
});
this.height = document.body.clientHeight
},
methods: {
getInformation(){
let data = {
userId:this.$route.query.userId,
}
companyList(data).then((res) => {
for (var i = 0 ; i < this.deptOptions.length ; i ++ ){
if (this.deptOptions[i].id == res.data.deptId){
this.deptName = this.deptOptions[i].label;
}else{
for (var j = 0 ; j < this.deptOptions[i].children.length ; j++){
if (this.deptOptions[i].children[j].id == res.data.deptId){
this.deptName = this.deptOptions[i].children[j].label;
}else{
for (var z = 0 ; z < this.deptOptions[i].children[j].children.length ; z++){
if (this.deptOptions[i].children[j].children[z].id == res.data.deptId){
this.deptName = this.deptOptions[i].children[j].children[z].label;
}
}
}
}
}
}
this.form = res.data;
this.businessTypeText = this.selectDictLabel(this.businessTypeOptions, res.data.businessType);
});
},
onConfirmBusiness(value){
this.showBusiness = false;
this.businessTypeText = value.dictLabel;
this.form.businessType = value.dictValue;
},
onConfirmAdress(value){
console.log(value)
this.showArea = false;

this.deptName = value[0]+'/'+value[1]+'/'+value[2]

let array1 = eval(this.deptOptions).filter(function (e) { return e.label == value[0]; });
let array2 = eval(array1[0].children).filter(function (e) { return e.label == value[1]; });
let array3 = eval(array2[0].children).filter(function (e) { return e.label == value[2]; });

this.form.deptId = array3[0].value
},
getCode() {
getCodeImg().then((res) => {
this.form.uuid = res.uuid;
this.codeUrl = "data:image/gif;base64," + res.img;
});
},
onConfirm(value, index) {
this.value = value;
this.showPicker = false;
this.form.supplyDemandType = index + 1 ;
},
getSubmit(){
console.log(this.form)
updateCompany(this.form).then(response => {

this.$dialog.alert({
title: '提示',
message: "修改成功!即将退出登录,重新登录后修改生效!",
}).then(() => {
logout().then(response => {
Cookies.remove("User-Token");
this.$router.push({name:'lawEnforcementLogin'})
});
});
});
},
},
};
</script>

<style scoped lang="scss">
.app-container {
background-color: #FFF;
.code-img {
width: 220px;
}
}
.submit{
position: fixed;
bottom: 0;
width: 100%;
left: 0;
background: #FFF;
padding: 5% 3%;
box-shadow: 0px -5px 9px #eee;
p{
text-align: center;
margin-bottom: 0.2rem;
span{
color: #007E72;
}
}
}
</style>

+ 11
- 3
src/views/lawEnforcement/user/index.vue Voir le fichier

@@ -6,7 +6,7 @@
<van-col :span="24" v-show="loginType">
<p class="userName">{{user.nickName}}<span style="font-size: 0.4rem;float: right;">{{roleGroup}}</span></p>
<!-- <i style="margin-right: 0.5rem;"></i>-->
<p class="userDept">{{user.dept.deptName}}</p>
<p class="userDept"><span style="float: left;">({{companyName}})</span>{{user.dept.deptName}}</p>
<p class="userDept">{{postGroup}}</p>
</van-col>
<van-col :span="24" v-show="loginButton">
@@ -66,7 +66,7 @@
<span class="custom-title">密码修改</span>
</template>
</van-cell>
<van-cell is-link :to="{name:loginType ? 'lawUserInformation':'',params: { userId: user.userId,} }" >
<van-cell is-link :to="{name:loginType ? roleGroup == '企业用户' ? 'lawCompanyInformation' : 'lawUserInformation':'',query: { userId: user.userId,} }" >
<template #title>
<van-icon name="../../../static/images/lawEnforcement/icon/icon_xgxx.png" size="20"></van-icon>
<span class="custom-title">修改信息</span>
@@ -91,7 +91,7 @@
</template>
<script>
import request from "@/utils/request";
import { getUserProfile } from "@/api/lawEnforcement/index";
import { getUserProfile , companyList} from "@/api/lawEnforcement/index";
import { logout ,getInfo } from "@/api/login/index";
import law from "@/components/common/law_footer";
import Cookies from "js-cookie";
@@ -122,6 +122,7 @@ export default {
activeTab: "userinfo",
taskList:[],
activityBusinessTypeOptions:[],
companyName:''
};
},
created() {
@@ -174,6 +175,13 @@ export default {
}
})
}
let data = {
userId:response.data.userId
}
companyList(data).then((res) => {
console.log(res.data.companyName)
this.companyName = res.data.companyName;
});
this.getTaskList();
});
},


Chargement…
Annuler
Enregistrer