            <template>
              <div class="app-container calendar-list-container">
                <el-row :gutter="20">
                    <el-col :span="6">
                      <el-tag type="success" >{{mminfo.id}}</el-tag> 
                    </el-col>   
                </el-row>
                <el-row :gutter="10">
                  <el-col :span="6">&nbsp;</el-col>
                </el-row>
                <el-form :rules="rules" ref="addForm" :model="addmminfo" label-position="left" label-width="80px"
                    style='width: 1200px;margin-left:20px'>
                    <el-row :gutter="24" style="margin-bottom: 15px;">
                    <el-col :span="8">
                      <div class="grid-content bg-purple" style="width: 300px;">
                        <el-form-item  :label="$t('querylist.truename')" prop="truename" style="width: 300px;">
                          <div class="block">
                        <el-input v-model="addmminfo.truename"> </el-input>
                          </div>
                        </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.idcard')" prop="idcard">
                          <el-input v-model="addmminfo.idcard" style="width: 220px;" @blur="getnp"></el-input>
                        </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.status')">
                          <el-select v-model="addmminfo.status" style="width: 220px;">
                            <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" >
                            </el-option>
                          </el-select>
                        </el-form-item>
                      </div>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24" style="margin-bottom: 15px;">  
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.gender')" prop="gender">
                          <el-rate v-model="addmminfo.gender" style="width: 220px;"></el-rate>
                        </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple" style="width: 300px;">
                        <el-form-item  :label="$t('querylist.np')" prop="np">
                        <el-select v-model="addmminfo.np" style="width: 220px;" >
                          <el-option v-for="item in provinceoptions" :disabled="true" :key="item.code" :label="item.name" :value="item.code" >
                          </el-option>
                        </el-select>
                        </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple" style="width: 300px;">
                        <el-form-item  :label="$t('querylist.serviceid')" prop="salt">
                         <el-input v-model="addmminfo.salt" style="width: 220px;" @blur="getsalt"></el-input>
                        </el-form-item>
                      </div>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24" style="margin-bottom: 15px;">
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.seniority')" prop="seniority">
                        <el-input v-model="addmminfo.seniority" style="width: 220px;"></el-input>
                        </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple" style="width: 300px;"> 
                        <el-form-item  :label="$t('querylist.cityname')" prop="cityname">
                          <el-select v-if="mktEnable" disabled class="filter-item" v-model="addmminfo.cityname" multiple default-first-optionplaceholder="请选择城市" style="width: 220px;">
                            <el-option v-for="item in branchesOptions" :key="item.branche_code" :label="item.branche_name" :value="item.branche_code">
                            </el-option>
                         </el-select>
                         <el-select v-else class="filter-item" v-model="addmminfo.cityname" multiple default-first-optionplaceholder="请选择城市" style="width: 220px;">
                            <el-option v-for="item in branchesOptions" :key="item.branche_code" :label="item.branche_name" :value="item.branche_code">
                            </el-option>
                         </el-select>
                       </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple" style="width: 300px;">
                        <el-form-item  :label="$t('querylist.babynumber')" prop="babynumber">
                        <el-input v-model="addmminfo.babynumber"></el-input>
                        </el-form-item>
                      </div>
                    </el-col>
                  </el-row> 

                  <el-row :gutter="24" style="margin-bottom: 15px;">
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.servicesdays')">
                        <el-input v-model="addmminfo.servicesdays" style="width: 220px;"></el-input>
                        </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.characters')" prop="characters">
                          <el-select class="filter-item" v-model="addmminfo.characters" multiple style="width: 220px;">
                            <el-option v-for="item in charactersOptions" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                         </el-select>
                       </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.twins')" >
                        <el-select v-model="addmminfo.twins" style="width: 230px;" >
                          <el-option v-for="item in twinsOptions" :key="item.value" :label="item.label" :value="item.value" >
                          </el-option>
                        </el-select>
                        </el-form-item>
                      </div>
                    </el-col>
                  </el-row>

                  <el-row :gutter="24" style="margin-bottom: 15px;">
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.mobilephone')"  prop="mobile_phone">
                        <el-input v-model="addmminfo.mobile_phone" style="width: 220px;"></el-input>
                        </el-form-item>
                      </div>
                    </el-col>

                    <el-col :span="8">
                      <div class="grid-content bg-purple" style="width: 300px;">
                        <el-form-item  :label="$t('querylist.ethnicgroup')" prop="ethnicgroup">
                         <el-select v-model="addmminfo.ethnicgroup" style="width: 220px;" >
                          <el-option v-for="item in ethnicgroupptions" :key="item.id" :label="item.ethnicgroup" :value="item.id" >
                          </el-option>
                        </el-select>
                        </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.weight')" prop="weight">
                        <el-input v-model="addmminfo.weight" style="width: 220px;" placeholder="请输入公斤"></el-input>
                        </el-form-item>
                      </div>
                    </el-col>
                    
                  </el-row>


                  <el-row :gutter="24" style="margin-bottom: 15px;">
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.height')" prop="height">
                        <el-input v-model="addmminfo.height" style="width: 220px;" placeholder="请输入厘米"></el-input>
                        </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple" style="width: 300px;">
                        <el-form-item  :label="$t('querylist.constellation')" prop="constellation">
                        <el-select class="filter-item" v-model="addmminfo.constellation" style="width: 220px;">
                            <el-option v-for="item in constellationoptions" :disabled="true" :key="item.id" :label="item.name" :value="item.id">
                            </el-option>
                         </el-select>
                        </el-form-item>
                        
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.zodiac')" prop="zodiac">
                        <el-select class="filter-item" v-model="addmminfo.zodiac" style="width: 220px;">
                            <el-option v-for="item in zodiacoptions" :key="item.id" :disabled="disabledZodiac" :label="item.name" :value="item.id">
                            </el-option>
                         </el-select>
                        </el-form-item>
                      </div>
                    </el-col>
                    
                  </el-row>


                  <el-row :gutter="24" style="margin-bottom: 15px;">
                    <el-col :span="8">
                      <div class="grid-content bg-purple" style="width: 300px;">
                        <el-form-item  :label="$t('querylist.marriage')" prop="marriage">
                          <el-select class="filter-item" v-model="addmminfo.marriage" style="width: 220px;">
                            <el-option v-for="item in marriageOptions" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                         </el-select>
                       </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple">
                        <el-form-item  :label="$t('querylist.education')" prop="education">
                        <el-select v-model="addmminfo.education" style="width: 220px;" >
                          <el-option v-for="item in educationOptions" :key="item.value" :label="item.label" :value="item.value" >
                          </el-option>
                        </el-select>
                        </el-form-item>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="grid-content bg-purple" style="width: 300px;">
                        <el-form-item  :label="$t('querylist.highlight')" prop="highlight">
                        <el-input v-model="addmminfo.highlight"></el-input>
                        </el-form-item>
                      </div>
                    </el-col>
                  </el-row>
                  <el-row :gutter="24" style="margin-bottom: 15px;">
                    <el-col :span="8"><div>&nbsp;</div></el-col>
                    <el-col :span="12">
                      <div>
                        <el-button  type="primary" @click="confirmEdit" :loading ="buttonloading">{{$t('table.confirm')}}</el-button>
                        <el-button @click="resetForm()">{{$t('navbar.reset')}}</el-button>
                      </div>
                    </el-col>
                    <el-col :span="6"><div>&nbsp;</div></el-col>
                  </el-row>


              </el-form>
                <el-dialog title="Reading statistics" :visible.sync="dialogPvVisible">
                  <el-table :data="pvData" border fit highlight-current-row style="width: 100%">
                    <el-table-column prop="key" label="Channel"></el-table-column>
                    <el-table-column prop="pv" label="Pv"></el-table-column>
                  </el-table>
                  <span slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="dialogPvVisible = false">{{$t('table.confirm')}}</el-button>
                  </span>
                </el-dialog>
              </div>
            </template>
            <script>
              import { fetchPv, updatejlServiceUser, getConstellation, getZodiac, updateArticle, findMM, getNP, idcardCheck, SaltCheck, getEthnicGroup, getProvince, getBranches, queryEditServiceUser } from '@/api/article'
              import waves from '@/directive/waves' // 水波纹指令
              import { parseTime } from '@/utils'
              import regex from '@/utils/regex'
              // arr to obj ,such as { CN : "China", US : "USA" }
              export default {
                name: 'mmadmininfo-edit112233',
                directives: {
                  waves
                },
                data() {
                  return {
                    userMkt: null,
                    mktEnable: null,
                    marriageOptions: [{ value: 'y', label: '已婚' }, { value: 'n', label: '未婚' }],
                    charactersOptions: [{ value: '1', label: '话少，踏实型' }, { value: '2', label: '有主见，能干型' }, { value: '3', label: '开朗乐观型' }],
                    educationOptions: [{ value: '1', label: '初中' }, { value: '2', label: '高中' }, { value: '3', label: '大专' }, { value: '4', label: '大本' }, { value: '5', label: '硕士' }, { value: '6', label: '博士' }],
                    sortOptions: [{ label: 'ID Ascending', key: '+id' }, { label: 'ID Descending', key: '-id' }],
                    statusOptions: [{ label: '正常', value: '1' }, { label: '封存', value: '4' }],
                    genderOptions: [{ label: 1, value: 1 }, { label: 2, value: 2 }, { label: 3, value: 3 }, { label: 4, value: 4 }, { label: 5, value: 5 }],
                    twinsOptions: [{ label: '是', value: 1 }, { label: '否', value: 0 }],
                    ethnicgroupptions: '',
                    provinceoptions: [],
                    branchesOptions: [],
                    constellationoptions: [],
                    zodiacoptions: [],
                    tableKey: 0,
                    list: null,
                    total: null,
                    listLoading: true,
                    buttonloading: false,
                    idcardquery: {
                      idcard: null
                    },
                    checkidcard: {
                      idcard: undefined
                    },
                    checksalt: {
                      salt: undefined
                    },
                    listQuery: {
                      page: 1,
                      limit: 10,
                      id: 1
                    },
                    disabledZodiac: true,
                    addmminfo: {
                      id: null,
                      salt: null,
                      truename: null,
                      idcard: null,
                      mobile_phone: null,
                      seniority: null,
                      babynumber: null,
                      gender: 0,
                      np: null,
                      cityname: null,
                      constellation: null,
                      zodiac: null,
                      ethnicgroup: null,
                      education: null,
                      height: null,
                      marriage: null,
                      highlight: null,
                      weight: null,
                      citycode: null,
                      status: null,
                      servicesdays: null,
                      characters: [],
                      twins: null
                    },
                    addmminfocancel: {
                      id: null,
                      salt: null,
                      truename: null,
                      idcard: null,
                      mobile_phone: null,
                      seniority: null,
                      babynumber: null,
                      gender: 0,
                      np: null,
                      cityname: null,
                      constellation: null,
                      zodiac: null,
                      ethnicgroup: null,
                      education: null,
                      height: null,
                      marriage: null,
                      highlight: null,
                      weight: null,
                      citycode: null,
                      status: null,
                      servicesdays: null,
                      characters: null,
                      twins: null
                    },
                    seachQuery: {
                      id: null
                    },
                    mminfo: {
                      id: null,
                      name: null,
                      servant_code: null
                    },
                    listMMinfo: {
                      id: null
                    },
                    rules: {
                      truename: [{ required: true, min: 1, max: 20, message: '请正确录入姓名', trigger: 'blur' }],
                      salt: [{ required: true, min: 1, max: 20, message: '请正确录入编号', trigger: 'blur' }],
                      idcard: [{ required: true, message: '请正确身份证', trigger: 'blur' },
                        { pattern: regex.IDCARD, message: '身份证格式不正确', trigger: 'blur' }],
                      mobile_phone: [{ message: '请输入手机号码', trigger: 'blur' },
                        { pattern: regex.REPHONE, message: '手机号格式错误', trigger: 'blur' }],
                      seniority: [{ required: true, min: 1, max: 3, message: '请正确输入服务经验', trigger: 'blur' },
                        { pattern: regex.NUMBER, max: 2, message: '请正确输入服务经验', trigger: 'blur' }],
                      babynumber: [{ required: true, min: 1, max: 5, message: '请正确录入带宝个数', trigger: 'blur' },
                        { pattern: regex.UNDER100, message: '请正确录入带宝个数', trigger: 'blur' }],
                      gender: [{ required: true, message: '请正确录入星级', trigger: 'blur' }],
                      np: [{ required: true, message: '请正确录入籍贯', trigger: 'blur' }],
                      cityname: [{ required: true, message: '请正确录入服务城市', trigger: 'blur' }],
                      zodiac: [{ required: true, message: '请选择属相', trigger: 'blur' }],
                      weight: [{ required: true, min: 1, max: 3, message: '请正确录入体重', trigger: 'blur' },
                        { pattern: regex.NUMBER, max: 4, message: '体重输入错误', trigger: 'blur' }],
                      height: [{ required: true, min: 1, max: 3, message: '请正确录入身高', trigger: 'blur' },
                        { pattern: regex.NUMBER, max: 4, message: '身高输入错误', trigger: 'blur' }],
                      highlight: [{ max: 40, message: '请正确录入特长', trigger: 'blur' }]
                    },
                    showReviewer: false,
                    trainoptions: '',
                    modifyresult: '',
                    train_name: '',
                    visible2: false,
                    deltraininfo: {
                      id: undefined
                    },
                    dialogFormVisible: false,
                    dialogStatus: '',
                    textMap: {
                      update: 'Edit',
                      create: '添加月嫂'
                    },
                    dialogPvVisible: false,
                    pvData: [],
                    downloadLoading: false,
                    view: {
                      name: undefined,
                      path: undefined,
                      title: undefined
                    }
                  }
                },
                destroyed() {
                  this.view.name = 'mmadmininfo-edit'
                  this.view.path = '/mmadmin/edit-form'
                  this.view.title = 'mmadmininfoedit'
                  this.$store.dispatch('delVisitedViews', this.view)
                },
                created() {
                  if (this.$route.params.userId == null) {
                    this.$route.params.userId = global.LastUpdate
                  } else {
                    global.LastUpdate = this.$route.params.userId
                  }
                  this.userMkt = this.$store.getters.mkt
                  if (this.userMkt !== 'ALL') {
                    this.seachQuery.cityname = this.userMkt
                    this.mktEnable = true
                  }
                  // this.getList()
                  this.list = []
                  this.listLoading = false
                  this.getlist()
                  findMM(this.listMMinfo).then(response2 => {
                    this.mminfo.id = '月嫂工号:' + response2.data.salt
                    this.mminfo.name = '月嫂姓名:' + response2.data.truename
                    this.mminfo.servant_code = response2.data.id
                  })
                  getEthnicGroup().then(response3 => {
                    this.ethnicgroupptions = response3.data
                  })
                  getProvince().then(response4 => {
                    this.provinceoptions = response4.data
                  })
                  getConstellation().then(response5 => {
                    this.constellationoptions = response5.data
                  })
                  getZodiac().then(response6 => {
                    this.zodiacoptions = response6.data
                  })
                  getBranches().then(response7 => {
                    this.branchesOptions = response7.data
                  })
                },
                methods: {
                  getlist() {
                    this.listMMinfo.id = this.$route.params.userId
                    this.seachQuery.id = this.$route.params.userId
                    queryEditServiceUser(this.seachQuery).then(response => {
                      this.addmminfo.truename = response.data.items[0].truename
                      this.addmminfo.salt = response.data.items[0].salt
                      this.addmminfo.idcard = response.data.items[0].idcard
                      this.addmminfo.seniority = response.data.items[0].seniority
                      this.addmminfo.babynumber = response.data.items[0].babynumber
                      this.addmminfo.constellation = Number(response.data.items[0].constellation)
                      this.addmminfo.zodiac = Number(response.data.items[0].zodiac)
                      this.addmminfo.ethnicgroup = Number(response.data.items[0].ethnicgroup)
                      this.addmminfo.education = response.data.items[0].education
                      this.addmminfo.height = response.data.items[0].height
                      this.addmminfo.marriage = response.data.items[0].marriage
                      this.addmminfo.highlight = response.data.items[0].highlight
                      this.addmminfo.weight = response.data.items[0].weight
                      this.addmminfo.citycode = response.data.items[0].citycode
                      this.addmminfo.gender = Number(response.data.items[0].gender)
                      this.addmminfo.np = response.data.items[0].city
                      this.addmminfo.status = response.data.items[0].status
                      this.addmminfo.mobile_phone = response.data.items[0].mobile_phone
                      this.addmminfo.servicesdays = response.data.items[0].servicesdays
                      this.addmminfo.twins = response.data.items[0].twins
                      if (response.data.items[0].citycode != null) {
                        this.addmminfo.cityname = response.data.items[0].citycode.split(',')
                      }
                      if (response.data.items[0].characters !== null && response.data.items[0].characters !== '') {
                        this.addmminfo.characters = response.data.items[0].characters.split(',')
                      }
                      // addmminfocancel
                      this.addmminfocancel.truename = response.data.items[0].truename
                      this.addmminfocancel.salt = response.data.items[0].salt
                      this.addmminfocancel.idcard = response.data.items[0].idcard
                      this.addmminfocancel.seniority = response.data.items[0].seniority
                      this.addmminfocancel.babynumber = response.data.items[0].babynumber
                      this.addmminfocancel.constellation = Number(response.data.items[0].constellation)
                      this.addmminfocancel.zodiac = Number(response.data.items[0].zodiac)
                      this.addmminfocancel.ethnicgroup = Number(response.data.items[0].ethnicgroup)
                      this.addmminfocancel.education = response.data.items[0].education
                      this.addmminfocancel.height = response.data.items[0].height
                      this.addmminfocancel.marriage = response.data.items[0].marriage
                      this.addmminfocancel.highlight = response.data.items[0].highlight
                      this.addmminfocancel.weight = response.data.items[0].weight
                      this.addmminfocancel.citycode = response.data.items[0].citycode
                      this.addmminfocancel.gender = Number(response.data.items[0].gender)
                      this.addmminfocancel.np = response.data.items[0].city
                      this.addmminfocancel.status = response.data.items[0].status
                      this.addmminfocancel.mobile_phone = response.data.items[0].mobile_phone
                      this.addmminfocancel.servicesdays = response.data.items[0].servicesdays
                      this.addmminfocancel.twins = response.data.items[0].twins
                      if (response.data.items[0].citycode != null) {
                        this.addmminfocancel.cityname = response.data.items[0].citycode.split(',')
                      }
                      if (response.data.items[0].characters !== null && response.data.items[0].characters !== '') {
                        this.addmminfocancel.characters = response.data.items[0].characters.split(',')
                      }
                    })
                  },
                  handleSizeChange(val) {
                    this.listQuery.limit = val
                    this.getList()
                  },
                  handleCurrentChange(val) {
                    this.listQuery.page = val
                    this.getList()
                  },
                  handleModifyStatus(row, status) {
                    this.$message({
                      message: '操作成功',
                      type: 'success'
                    })
                    row.status = status
                  },
                  resetmminfo() {
                    this.addmminfo = {
                      salt: null,
                      truename: null,
                      idcard: null,
                      mobile_phone: null,
                      seniority: null,
                      babynumber: null,
                      gender: null,
                      np: null,
                      cityname: null,
                      constellation: null,
                      zodiac: null
                    }
                  },
                  getnp() {
                    if (this.addmminfocancel.idcard !== this.addmminfo.idcard) {
                      var reg = regex.IDCARD
                      this.idcardquery.IDcard = this.addmminfo.idcard
                      this.checkidcard.idcard = this.addmminfo.idcard
                      if (reg.test(this.addmminfo.idcard)) {
                        idcardCheck(this.checkidcard).then(response => {
                          if (response.data > 0) {
                            this.$message.error('身份证重复，请确认！')
                            this.addmminfo.idcard = this.addmminfocancel.idcard
                          } else {
                            getNP(this.idcardquery).then(response => {
                              if (Number(response.data.zodiac) === 0) {
                                this.addmminfo.zodiac = null
                                this.disabledZodiac = false
                              } else {
                                this.addmminfo.zodiac = Number(response.data.zodiac)
                              }
                              this.addmminfo.constellation = Number(response.data.constellation)
                              this.addmminfo.npv = response.data.province
                              this.addmminfo.np = response.data.np
                            })
                          }
                        })
                      } else {
                        this.addmminfo.zodiac = null
                        this.addmminfo.constellation = null
                        this.addmminfo.np = null
                      }
                    }
                  },
                  getsalt() {
                    if (this.addmminfocancel.salt !== this.addmminfo.salt) {
                      this.checksalt.salt = this.addmminfo.salt
                      SaltCheck(this.checksalt).then(response => {
                        if (response.data > 0) {
                          this.$message.error('编号重复，请确认！')
                          this.addmminfo.salt = this.addmminfocancel.salt
                        }
                      })
                    }
                  },
                  handleCreate() {
                    this.resetmminfo()
                    this.dialogStatus = 'create'
                    this.dialogFormVisible = true
                    this.$nextTick(() => {
                      this.$refs['addTrains'].clearValidate()
                    })
                  },
                  handleUpdate(row) {
                    this.temp = Object.assign({}, row) // copy obj
                    this.temp.timestamp = new Date(this.temp.timestamp)
                    this.dialogStatus = 'update'
                    this.dialogFormVisible = true
                    this.$nextTick(() => {
                      this.$refs['dataForm'].clearValidate()
                    })
                  },
                  updateData() {
                    this.$refs['dataForm'].validate((valid) => {
                      if (valid) {
                        const tempData = Object.assign({}, this.temp)
                        tempData.timestamp = +new Date(tempData.timestamp) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464
                        updateArticle(tempData).then(() => {
                          for (const v of this.list) {
                            if (v.id === this.temp.id) {
                              const index = this.list.indexOf(v)
                              this.list.splice(index, 1, this.temp)
                              break
                            }
                          }
                          this.dialogFormVisible = false
                          this.$notify({
                            title: '成功',
                            message: '更新成功',
                            type: 'success',
                            duration: 2000
                          })
                        })
                      }
                    })
                  },
                  handleDelete(row) {
                    this.$notify({
                      title: '成功',
                      message: '删除成功',
                      type: 'success',
                      duration: 2000
                    })
                    const index = this.list.indexOf(row)
                    this.list.splice(index, 1)
                  },
                  handleFetchPv(pv) {
                    fetchPv(pv).then(response => {
                      this.pvData = response.data.pvData
                      this.dialogPvVisible = true
                    })
                  },
                  handleDownload() {
                    this.downloadLoading = true
                    import('@/vendor/Export2Excel').then(excel => {
                      const tHeader = ['timestamp', 'title', 'type', 'importance', 'status']
                      const filterVal = ['timestamp', 'title', 'type', 'importance', 'status']
                      const data = this.formatJson(filterVal, this.list)
                      excel.export_json_to_excel(tHeader, data, 'table-list')
                      this.downloadLoading = false
                    })
                  },
                  formatJson(filterVal, jsonData) {
                    return jsonData.map(v => filterVal.map(j => {
                      if (j === 'timestamp') {
                        return parseTime(v[j])
                      } else {
                        return v[j]
                      }
                    }))
                  },
                  cancelEdit() {
                    this.getList()
                  },
                  resetForm() {
                    this.addmminfo.truename = this.addmminfocancel.truename
                    this.addmminfo.salt = this.addmminfocancel.salt
                    this.addmminfo.idcard = this.addmminfocancel.idcard
                    this.addmminfo.seniority = this.addmminfocancel.seniority
                    this.addmminfo.babynumber = this.addmminfocancel.babynumber
                    this.addmminfo.constellation = this.addmminfocancel.constellation
                    this.addmminfo.zodiac = this.addmminfocancel.zodiac
                    this.addmminfo.ethnicgroup = this.addmminfocancel.ethnicgroup
                    this.addmminfo.education = this.addmminfocancel.education
                    this.addmminfo.height = this.addmminfocancel.height
                    this.addmminfo.marriage = this.addmminfocancel.marriage
                    this.addmminfo.highlight = this.addmminfocancel.highlight
                    this.addmminfo.weight = this.addmminfocancel.weight
                    this.addmminfo.citycode = this.addmminfocancel.citycode
                    this.addmminfo.gender = this.addmminfocancel.gender
                    this.addmminfo.np = this.addmminfocancel.np
                    this.addmminfo.status = this.addmminfocancel.status
                    this.addmminfocancel.status = this.addmminfocancel.status
                    this.addmminfo.cityname = this.addmminfocancel.cityname
                    this.addmminfo.mobile_phone = this.addmminfocancel.mobile_phone
                    this.addmminfo.servicesdays = this.addmminfocancel.servicesdays
                    this.addmminfo.characters = this.addmminfocancel.characters
                    this.addmminfo.twins = this.addmminfocancel.twins
                  },
                  confirmEdit() {
                    this.$refs['addForm'].validate((valid) => {
                      if (valid) {
                        if (this.addmminfo.cityname.length > 0) {
                          this.buttonloading = true
                          var newcityname = ''
                          for (var i = 0; i < this.addmminfo.cityname.length; i++) {
                            newcityname = newcityname + this.addmminfo.cityname[i] + ','
                          }
                          this.addmminfo.cityname = newcityname.substring(0, newcityname.length - 1)
                          var newcharacters = ''
                          for (var value2 of this.addmminfo.characters) {
                            newcharacters = newcharacters + value2 + ','
                          }
                          if (newcharacters != null) {
                            this.addmminfo.characters = newcharacters.substring(0, newcharacters.length - 1)
                          }
                        }
                        this.addmminfo.id = this.$route.params.userId
                        updatejlServiceUser(this.addmminfo).then(response => {
                          this.buttonloading = false
                          if (response.data < 1) {
                            this.$notify({
                              title: '失败',
                              message: '更新失败',
                              type: 'warning',
                              duration: 2000
                            })
                            this.resetForm()
                          } else {
                            this.getlist()
                            this.$notify({
                              title: '成功',
                              message: '更新成功',
                              type: 'success',
                              duration: 2000
                            })
                          }
                        })
                      }
                    })
                  }
                }
              }
            </script>
            <style scoped>
          .edit-input {
            padding-right: 100px;
          }
          .cancel-btn {
            position: absolute;
            right: 15px;
            top: 10px;
          }
          </style>