| | |
| | | <span>{{ scope.row.lastmodifieddate | parseTime('{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="账户有效期" prop="deadline" align="center" sortable="custom"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.deadline }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="showEditHandle(scope.row)">编辑</el-button> |
| | | <!-- <el-button :disabled="disableRole(scope.row)" type="text" align="center" @click="showAssignRole(scope.row)">分配角色</el-button>--> |
| | | <el-button v-if="scope.row.companyid !=null" type="text" @click="showEditDeadline(scope.row)">修改有效期</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogUserRoleFormVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="assignUserRoleHandle">确认</el-button> |
| | | <el-button type="primary" @click="assignUserRoleHandle()">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="修改有效期" :visible.sync="dialogDeadlineVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="700px"> |
| | | <el-form ref="deadlineForm" :rules="deadlineFormRules" :model="deadlineForm" label-position="right" label-width="100px" style="margin-left:50px;width:500px;" element-loading-text="保存中..."> |
| | | <el-form-item label="有效期:" prop="deadline"> |
| | | <el-date-picker |
| | | v-model.trim="deadlineForm.deadline" |
| | | type="date" |
| | | format="yyyy 年 MM 月 dd 日" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="选择有效期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogDeadlineVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="editDeadline()">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <div style="clear: both;"/> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from 'vuex' |
| | | import { enterpriseUserList, createUser, deleteUser, updateUser, importDistrict,getDistrict,getDistrictByName,updateUserRole} from '@/api/user' |
| | | import { enterpriseUserList, createUser, deleteUser, updateUser, importDistrict,getDistrict,getDistrictByName,updateUserRole,updateDeadline} from '@/api/user' |
| | | import { checkBtnPermission } from '@/utils/permission' |
| | | import { roleList } from '@/api/role' |
| | | import { parseTime, computePageCount, parseUserType } from '@/utils' |
| | |
| | | town: '', |
| | | community: '', |
| | | type:'', |
| | | job:'', |
| | | job:'' |
| | | }, |
| | | deadlineForm:{ |
| | | uid: '', |
| | | deadline: '' |
| | | }, |
| | | importDialogFormVisible: false, |
| | | importDisabled: false, |
| | | dialogFormVisible: false, |
| | | dialogDeadlineVisible: false, |
| | | dialogStatus: '', |
| | | dataFormRules: { |
| | | name: [{ required: true, message: '用户名不能为空', trigger: 'blur' }], |
| | |
| | | confirmPassword: [{ required: true, message: '确认密码不能为空', trigger: 'blur' }], |
| | | type: [{ required: true, message: '用户类型不能为空', trigger: 'blur' }] |
| | | }, |
| | | deadlineFormRules: { |
| | | deadline: [{ required: true, message: '有效期不能为空', trigger: 'blur' }] |
| | | }, |
| | | provinceList:[], |
| | | cityList:[], |
| | | areaList:[], |
| | |
| | | this.townList = [] |
| | | this.communityList = [] |
| | | }, |
| | | resetDeadlineForm(){ |
| | | this.deadlineForm = { |
| | | uid: '', |
| | | deadline: '' |
| | | } |
| | | }, |
| | | showCreateHandle() { |
| | | this.resetDataForm() |
| | | this.dialogStatus = 'create' |
| | |
| | | }) |
| | | |
| | | }, |
| | | |
| | | showEditDeadline(row){ |
| | | this.resetDeadlineForm() |
| | | this.deadlineForm.uid = row.id |
| | | this.dialogDeadlineVisible = true |
| | | }, |
| | | |
| | | editDeadline(){ |
| | | const t = this |
| | | this.$refs['deadlineForm'].validate((valid) => { |
| | | if (valid) { |
| | | const params = this.deadlineForm |
| | | console.log(params,'params') |
| | | updateDeadline(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200) { |
| | | t.dialogDeadlineVisible = false |
| | | t.$message({ |
| | | message: '有效期修改成功', |
| | | type: 'success' |
| | | }) |
| | | t.getUserList() |
| | | } else { |
| | | parseError({ error: res.message, vm: t }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | passwordChangeEvent: function(value) { |
| | | if (this.dataForm.password != value) { |
| | | parseError({ error: '密码输入不一致', vm: this }) |