| xqd
@@ -11,10 +11,10 @@
|
|
|
</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="供应商名称" :rules="[{ message: '姓名不能为空不能为空'}]">
|
|
|
- <el-input v-model="form.name" class="ipwidth" />
|
|
|
+ <el-input v-model="form.name" class="ipwidth" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="供应商账号">
|
|
|
- <el-input v-model="form.account" class="ipwidth" disabled/>
|
|
|
+ <el-input v-model="form.account" class="ipwidth" disabled />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="供应商联系人" :rules="[{ message: '身份证不能为空'}]">
|
|
|
<el-input v-model="form.contacts" class="ipwidth" />
|
| xqd
@@ -26,26 +26,27 @@
|
|
|
<el-input v-model="form.legalPerson" class="ipwidth" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="社会信用代码" :rules="[{ message: '电话号码不能为空'}]">
|
|
|
- <el-input v-model="form.socialCode" class="ipwidth" disabled/>
|
|
|
+ <el-input v-model="form.socialCode" class="ipwidth" disabled />
|
|
|
</el-form-item>
|
|
|
- <el-form-item >
|
|
|
+ <el-form-item>
|
|
|
<el-button type="primary" @click="update">保存修改</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="10" style="padding-left: 30px;" v-if="role===2">
|
|
|
<el-form ref="form" :model="form" label-width="120px">
|
|
|
- <el-form-item label="" >
|
|
|
+ <el-form-item label="">
|
|
|
<span slot="label">
|
|
|
<span style="visibility: hidden;">其他信息</span>
|
|
|
</span>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="供应商认证照片" >
|
|
|
+
|
|
|
+ <el-form-item label="供应商认证照片">
|
|
|
<div style="display: flex;">
|
|
|
<div>
|
|
|
- <el-image style="width: 100px; height: 100px" v-for="(item,index) in form.identifyPics" :key="index" :src="item"
|
|
|
- :preview-src-list="form.identifyPics">
|
|
|
+ <el-image style="width: 100px; height: 100px"
|
|
|
+ v-for="(item,index) in form.identifyPics" :key="index" :src="item"
|
|
|
+ :preview-src-list="form.identifyPics">
|
|
|
</el-image>
|
|
|
</div>
|
|
|
<div class="boximg">
|
| xqd
@@ -58,74 +59,45 @@
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="授权委托书" >
|
|
|
+ <el-form-item label="授权委托书">
|
|
|
<div style="display: flex;">
|
|
|
<div>
|
|
|
- <el-image style="width: 100px; height: 100px" v-for="(item,index) in form.proxyFile" :key="index" :src="item"
|
|
|
- :preview-src-list="form.proxyFile" >
|
|
|
+ <el-image style="width: 100px; height: 100px" v-for="(item,index) in form.proxyFile"
|
|
|
+ :key="index" :src="item" :preview-src-list="form.proxyFile">
|
|
|
</el-image>
|
|
|
</div>
|
|
|
<div>
|
|
|
<el-dialog :visible.sync="dialogVisibleimg">
|
|
|
<img width="100%" :src="form.proxyFile" alt="" />
|
|
|
</el-dialog>
|
|
|
-
|
|
|
+
|
|
|
<el-upload action="https://ht.9026.com/api/File" list-type="picture-card"
|
|
|
:on-success="handleSuccess">
|
|
|
<i class="el-icon-plus" />
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
</el-form-item>
|
|
|
<el-form-item label="修改密码">
|
|
|
- <el-collapse v-model="activeNames" style="width: 80%;">
|
|
|
- <!-- <el-collapse-item title="供应商认证照片" name="3">
|
|
|
- <div class="boximg">
|
|
|
- <el-upload action="https://ht.9026.com/api/File" list-type="picture-card"
|
|
|
- :on-success="handleAvatarSuccess">
|
|
|
- <i class="el-icon-plus" />
|
|
|
- </el-upload>
|
|
|
- <el-dialog :visible.sync="dialogVisibleimg">
|
|
|
- <img width="100%" :src="form.identifyPics" alt="" />
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-image style="width: 100px; height: 100px" v-for="(item,index) in form.identifyPics" :key="index" :src="item"
|
|
|
- :preview-src-list="form.identifyPics">
|
|
|
- </el-image>
|
|
|
- </div>
|
|
|
- </el-collapse-item> -->
|
|
|
- <!-- <el-collapse-item title="授权委托书" name="4">
|
|
|
- <div class="boximg">
|
|
|
- <el-upload action="https://ht.9026.com/api/File" list-type="picture-card"
|
|
|
- :on-success="handleSuccess">
|
|
|
- <i class="el-icon-plus" />
|
|
|
- </el-upload>
|
|
|
- <el-dialog :visible.sync="dialogVisibleimg">
|
|
|
- <img width="100%" :src="form.proxyFile" alt="" />
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-image style="width: 100px; height: 100px" v-for="(item,index) in form.proxyFile" :key="index" :src="item"
|
|
|
- :preview-src-list="form.proxyFile" >
|
|
|
- </el-image>
|
|
|
- </div>
|
|
|
- </el-collapse-item> -->
|
|
|
- <el-collapse-item name="1">
|
|
|
- <el-input v-model="password.oldPassword" placeholder="请输入旧密码" type="password" show-password></el-input>
|
|
|
- <el-input v-model="password.newPassword" placeholder="请输入新密码" type="password" show-password></el-input>
|
|
|
- <el-input v-model="password.ConfirmnewPassword" placeholder="确认新密码" type="password" show-password ></el-input>
|
|
|
- <el-button type="primary" @click="onSubmit">确认修改</el-button>
|
|
|
- </el-collapse-item>
|
|
|
- </el-collapse>
|
|
|
+ <el-collapse v-model="activeNames" style="width: 80%;">
|
|
|
+ <el-collapse-item name="1">
|
|
|
+ <el-input v-model="password.oldPassword" placeholder="请输入旧密码" type="password"
|
|
|
+ show-password></el-input>
|
|
|
+ <el-input v-model="password.newPassword" placeholder="请输入新密码" type="password"
|
|
|
+ show-password></el-input>
|
|
|
+ <el-input v-model="password.ConfirmnewPassword" placeholder="确认新密码" type="password"
|
|
|
+ show-password></el-input>
|
|
|
+ <el-button type="primary" @click="onSubmit">确认修改</el-button>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<!-- 修改密码弹窗 -->
|
|
|
<!-- <el-dialog title="修改密码" :visible.sync="dialogVisible" width="30%">
|
|
|
<el-form ref="form" :model="password" label-width="80px">
|
| xqd
@@ -144,10 +116,10 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-dialog> -->
|
|
|
-
|
|
|
+
|
|
|
</el-col>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="10" style="padding-right: 10px;" v-if="role===1">
|
|
|
<el-form ref="form" :model="form" label-width="140px">
|
|
|
<el-form-item label="" style="border-bottom:1px solid #F4F4F4">
|
| xqd
@@ -165,11 +137,14 @@
|
|
|
<el-input v-model="form.mobile" class="ipwidth" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-collapse v-model="password" style="width: 90%;float: right;">
|
|
|
+ <el-collapse v-model="password" style="width: 90%;float: right;">
|
|
|
<el-collapse-item title="修改密码" name="1">
|
|
|
- <el-input v-model="password.oldPassword" placeholder="请输入旧密码" type="password" show-password></el-input>
|
|
|
- <el-input v-model="password.newPassword" placeholder="请输入新密码" type="password" show-password></el-input>
|
|
|
- <el-input v-model="password.ConfirmnewPassword" placeholder="确认新密码" type="password" show-password></el-input>
|
|
|
+ <el-input v-model="password.oldPassword" placeholder="请输入旧密码" type="password" show-password>
|
|
|
+ </el-input>
|
|
|
+ <el-input v-model="password.newPassword" placeholder="请输入新密码" type="password" show-password>
|
|
|
+ </el-input>
|
|
|
+ <el-input v-model="password.ConfirmnewPassword" placeholder="确认新密码" type="password"
|
|
|
+ show-password></el-input>
|
|
|
<el-button type="primary" @click="onSubmit">确认修改</el-button>
|
|
|
</el-collapse-item>
|
|
|
<el-collapse-item title="忘记密码">
|
| xqd
@@ -178,7 +153,7 @@
|
|
|
</el-collapse>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
-
|
|
|
+
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
| xqd
@@ -189,47 +164,49 @@
|
|
|
data() {
|
|
|
return {
|
|
|
// 弹窗
|
|
|
- dialogVisible:false,
|
|
|
- dialogVisibleimg:false,
|
|
|
+ dialogVisible: false,
|
|
|
+ dialogVisibleimg: false,
|
|
|
role: '',
|
|
|
id: '',
|
|
|
resource: '',
|
|
|
radio: '1',
|
|
|
- activeNames:'',
|
|
|
- proxyFileArray:[],
|
|
|
- identifyPicsArray:[],
|
|
|
+ activeNames: '',
|
|
|
+ proxyFileArray: [],
|
|
|
+ identifyPicsArray: [],
|
|
|
+ startform: '',
|
|
|
form: {
|
|
|
- name:'',
|
|
|
- account:'',
|
|
|
- contacts:'',
|
|
|
- contactsMobile:'',
|
|
|
- id:'',
|
|
|
- socialCode:'',
|
|
|
- legalPerson:'',
|
|
|
- identifyPics:[],
|
|
|
- proxyFile:[],
|
|
|
+ name: '',
|
|
|
+ account: '',
|
|
|
+ contacts: '',
|
|
|
+ contactsMobile: '',
|
|
|
+ id: '',
|
|
|
+ socialCode: '',
|
|
|
+ legalPerson: '',
|
|
|
+ identifyPics: [],
|
|
|
+ proxyFile: [],
|
|
|
},
|
|
|
- password:{
|
|
|
+ password: {
|
|
|
oldPassword: '',
|
|
|
newPassword: '',
|
|
|
- ConfirmnewPassword:'',
|
|
|
+ ConfirmnewPassword: '',
|
|
|
},
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.role = this.$store.state.user.userInfo.type
|
|
|
console.log(this.$store.state.user.userInfo)
|
|
|
- this.id=this.$store.state.user.userInfo.id
|
|
|
+ this.id = this.$store.state.user.userInfo.id
|
|
|
if (this.role === 2) {
|
|
|
this.$request({
|
|
|
- url: '/api/Supplier/'+this.id,
|
|
|
+ url: '/api/Supplier/' + this.id,
|
|
|
method: 'get'
|
|
|
}).then((res) => {
|
|
|
- this.form=res.data
|
|
|
- console.log(res)
|
|
|
- this.form.identifyPics=res.data.identifyPicList
|
|
|
- this.form.proxyFile=res.data.proxyFileList
|
|
|
+ this.form = res.data
|
|
|
+ this.form.identifyPics = res.data.identifyPicList
|
|
|
+ this.form.proxyFile = res.data.proxyFileList
|
|
|
+ this.startform = {
|
|
|
+ ...this.form
|
|
|
+ }
|
|
|
})
|
|
|
} else if (this.role === 1) {
|
|
|
this.$request({
|
| xqd
@@ -242,19 +219,18 @@
|
|
|
},
|
|
|
methods: {
|
|
|
onSubmit() {
|
|
|
- if(this.password.ConfirmnewPassword!==this.password.newPassword){
|
|
|
+ if (this.password.ConfirmnewPassword !== this.password.newPassword) {
|
|
|
this.$message({
|
|
|
- type:"error",
|
|
|
- message:'密码和确认密码不一致'
|
|
|
+ type: "error",
|
|
|
+ message: '密码和确认密码不一致'
|
|
|
})
|
|
|
- }else if(this.password.ConfirmnewPassword.length<6||this.password.newPassword.length<6){
|
|
|
+ } else if (this.password.ConfirmnewPassword.length < 6 || this.password.newPassword.length < 6) {
|
|
|
this.$message({
|
|
|
- type:'error',
|
|
|
- message:'密码至少六位'
|
|
|
+ type: 'error',
|
|
|
+ message: '密码至少六位'
|
|
|
})
|
|
|
- }
|
|
|
- else{
|
|
|
- if(this.role===2){
|
|
|
+ } else {
|
|
|
+ if (this.role === 2) {
|
|
|
this.$request({
|
|
|
url: '/api/Supplier/password',
|
|
|
method: 'post',
|
| xqd
@@ -263,7 +239,7 @@
|
|
|
newPassword: this.password.newPassword
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
- if(res.code===200){
|
|
|
+ if (res.code === 200) {
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: '修改密码成功'
|
| xqd
@@ -272,16 +248,16 @@
|
|
|
}).catch((err) => {
|
|
|
console.log(err)
|
|
|
})
|
|
|
- }else if(this.role===1){
|
|
|
+ } else if (this.role === 1) {
|
|
|
this.$request({
|
|
|
- url:'/api/Account/password',
|
|
|
- method:'post',
|
|
|
- data:{
|
|
|
+ url: '/api/Account/password',
|
|
|
+ method: 'post',
|
|
|
+ data: {
|
|
|
oldPassword: this.password.oldPassword,
|
|
|
newPassword: this.password.newPassword
|
|
|
}
|
|
|
- }).then((res)=>{
|
|
|
- if(res.code===200){
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: '修改密码成功'
|
| xqd
@@ -298,40 +274,53 @@
|
|
|
})
|
|
|
},
|
|
|
handleAvatarSuccess(res) {
|
|
|
- //解构
|
|
|
- let { file } = res.data;
|
|
|
- this.identifyPicsArray.push(file);
|
|
|
- this.form.identifyPics = this.identifyPicsArray;
|
|
|
+ //解构
|
|
|
+ let {
|
|
|
+ file
|
|
|
+ } = res.data;
|
|
|
+ this.identifyPicsArray.push(file);
|
|
|
+ this.form.identifyPics = this.identifyPicsArray;
|
|
|
},
|
|
|
/* 供应商上传委托书图片上传成功 */
|
|
|
handleSuccess(res) {
|
|
|
//解构
|
|
|
- let {file} = res.data;
|
|
|
+ let {
|
|
|
+ file
|
|
|
+ } = res.data;
|
|
|
this.proxyFileArray.push(file);
|
|
|
this.form.proxyFile = this.proxyFileArray;
|
|
|
},
|
|
|
+ // 修改个人信息
|
|
|
update() {
|
|
|
- console.log(this.form)
|
|
|
- this.$request({
|
|
|
- url:'/api/Supplier/update',
|
|
|
- method:'post',
|
|
|
- data:this.form
|
|
|
- }).then((res)=>{
|
|
|
- console.log(res)
|
|
|
- if(res.code===200){
|
|
|
- this.$message({
|
|
|
- type:'success',
|
|
|
- message:'修改成功!'
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.$message({
|
|
|
- type:'error',
|
|
|
- message:'修改失败!'
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ console.log(JSON.stringify(this.startform)==JSON.stringify(this.form))
|
|
|
+ if(JSON.stringify(this.startform)===JSON.stringify(this.form)){
|
|
|
+ this.$message({
|
|
|
+ type:'error',
|
|
|
+ message:'数据没有改变'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$request({
|
|
|
+ url: '/api/Supplier/update',
|
|
|
+ method: 'post',
|
|
|
+ data: this.form
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '修改成功!'
|
|
|
+ })
|
|
|
+ this.startform={...this.form}
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '修改失败!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
}
|
|
|
</script>
|
|
|
|