qingyiay
2023-06-20 3f10299a92e23fd902e4bd51a6d59f9bf0c7d7ec
pages/customer-page/customer-my/userMange/userManageEdit/userManageEdit.vue
@@ -1,32 +1,72 @@
<template>
   <view class="main">
      <view class="main-block">
         <u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm" :errorType="errorType">
            <u-form-item label="服务部门" labelWidth="20%" @click="treeOpen" borderBottom prop="deptIds">
               <u--input placeholder="请选择服务部门" v-model="model1.deptIds" class="input" type="text"></u--input>
               <qian-tree ref="tkitree" :range="department" confirmColor="#4e8af7" :multiple="true" :selectParent="true" title="选择部门" @confirm="treeChooseValue" />
         <u--form labelPosition="left"
            :model="model1"
            :rules="rules"
            ref="uForm"
            :errorType="errorType">
            <u-form-item label="服务部门"
               labelWidth="20%"
               @click="treeOpen"
               borderBottom
               prop="deptIds">
               <u--input placeholder="请选择服务部门"
                  v-model="model1.deptIds"
                  class="input"
                  type="text"></u--input>
               <qian-tree ref="tkitree"
                  :range="department"
                  confirmColor="#4e8af7"
                  :multiple="true"
                  :selectParent="true"
                  title="选择部门"
                  @confirm="treeChooseValue" />
            </u-form-item>
            <u-form-item label="身份证" labelWidth="20%" borderBottom prop="idCard">
               <u--input border="none" v-model="model1.idCard" placeholder="请输入身份证"></u--input>
            <u-form-item label="身份证"
               labelWidth="20%"
               borderBottom
               prop="idCard">
               <u--input border="none"
                  v-model="model1.idCard"
                  placeholder="请输入身份证"></u--input>
            </u-form-item>
            <u-form-item label="真实姓名" labelWidth="20%" borderBottom prop="name">
               <u--input border="none" v-model="model1.name" placeholder="请输入真实姓名"></u--input>
            <u-form-item label="真实姓名"
               labelWidth="20%"
               borderBottom
               prop="name">
               <u--input border="none"
                  v-model="model1.name"
                  placeholder="请输入真实姓名"></u--input>
            </u-form-item>
            <u-form-item label="手机号" labelWidth="20%" borderBottom prop="phone">
               <u--input border="none" v-model="model1.phone" placeholder="请输入手机号"></u--input>
            <u-form-item label="手机号"
               labelWidth="20%"
               borderBottom
               prop="phone">
               <u--input border="none"
                  v-model="model1.phone"
                  placeholder="请输入手机号"></u--input>
            </u-form-item>
            <u-form-item label="密码" labelWidth="20%" borderBottom prop="password">
               <u--input border="none" v-model="model1.password" placeholder="请输入密码"></u--input>
            <u-form-item label="密码"
               labelWidth="20%"
               borderBottom
               prop="password">
               <u--input border="none"
                  v-model="model1.password"
                  placeholder="请输入密码"></u--input>
            </u-form-item>
         </u--form>
      </view>
      <view class="submit-button"><u-button :text="userId ? '确认修改' : '确认提交'" type="primary" @click="submitMsg"></u-button></view>
      <view class="submit-button"><u-button :text="userId ? '确认修改' : '确认提交'"
            type="primary"
            @click="submitMsg"></u-button></view>
   </view>
</template>
<script>
let url = 'http://192.168.31.14:9999';
import qianTree from '@/components/qian-tree/qian-tree.vue';
   import { BaseUrl } from '@/api/publicInterface.js'
export default {
   components: {
      qianTree
@@ -102,7 +142,7 @@
   methods: {
      fetchTree() {
         uni.request({
            url: `${url}/admin/dept/ownTree`,
               url: `${BaseUrl}/admin/dept/ownTree`,
            header: {
               Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'),
               CLIENT_TOC: 'Y'
@@ -123,7 +163,8 @@
               if (res.data.deptIds == null) {
                  this.diffdeptId = '全部';
               } else {
                  this.diffdeptId = this.findNameById(this.department, res.data.deptIds.split(',')).join();
                     this.diffdeptId = this.findNameById(this.department, res.data.deptIds.split(','))
                     .join();
               }
               this.model1 = {
                  ...res.data,
@@ -175,7 +216,8 @@
            .then(res => {
               if (this.userId) {
                  this.model1.deptIds = this.ismodifyDept ? this.diffdeptId : this.tempdeptIds;
                  this.$reqAllJson('appUpdateById', this.model1, { method: 'PUT', 'Content-type': 'application/json' }).then(res => {
                     this.$reqAllJson('appUpdateById', this
                  .model1, { method: 'PUT', 'Content-type': 'application/json' }).then(res => {
                     if (res.code == 0) {
                        this.$u.toast('修改成功');
                        let timer = setTimeout(() => {
@@ -214,16 +256,20 @@
};
</script>
<style lang="scss" scoped>
<style lang="scss"
   scoped>
.main {
   width: 100%;
   &-block {
      width: 94%;
      margin: vww(15);
   }
   .submit-button {
      position: relative;
      bottom: vww(-20);
      /deep/ .u-button {
         width: 631rpx;
         height: 74rpx;