| | |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const dialogVisible = ref(false) |
| | | const dialogVisibleProcess = ref(false) |
| | | let roleList = ref([]) |
| | | //工序 |
| | | const processValue = ref() |
| | | let userRole= ref({ |
| | | userId:'', |
| | | roles:[] |
| | | }) |
| | | let processRow = ref({ |
| | | process: null, |
| | | userId:null |
| | | }) |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | |
| | | }, |
| | | }) |
| | | onBeforeMount(()=>{ |
| | | let columns = [{title: t('basicData.operate'), width: 133, slots: { default: 'button_slot' }}] |
| | | let columns = [{title: t('basicData.operate'), width: 213, slots: { default: 'button_slot' }}] |
| | | const columnName = { |
| | | loginName: t('user.userId'), |
| | | userName:t('user.user'), |
| | | // address:'地址', |
| | | address:t('report.workingProcedure'), |
| | | // phone:'电话', |
| | | role:t('role.role'), |
| | | createTime:t('basicData.creationTime') |
| | |
| | | |
| | | }) |
| | | onMounted(()=>{ |
| | | selectProcess(); |
| | | request.get('/userInfo/findAll').then(res=>{ |
| | | let arr = res.data.users[0] |
| | | arr.forEach(item=>{ |
| | |
| | | gridOptions.data = res.data.users[0] |
| | | roleList.value = res.data.role[0] |
| | | }) |
| | | |
| | | }) |
| | | |
| | | const getTableRow = (row,type) => { |
| | |
| | | }) |
| | | break |
| | | } |
| | | case 'editProcess': { |
| | | dialogVisibleProcess.value = true |
| | | processRow.value.userId = row.id |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | const handleClose = (done) => { |
| | | userRole.value.roles = [] |
| | | done() |
| | | } |
| | | |
| | | const selectProcess = () => { |
| | | request.post('userInfo/selectProcess').then(res=>{ |
| | | processRow.value.process=res.data.process |
| | | }) |
| | | } |
| | | |
| | | const roleUpdate = () => { |
| | |
| | | |
| | | }) |
| | | dialogVisible.value = false |
| | | } |
| | | |
| | | const updateProcess = () => { |
| | | let userId=processRow.value.userId |
| | | if (processValue.value!=null){ |
| | | request.post(`userInfo/updateProcess/${userId}/${processValue.value}`).then(res=>{ |
| | | if(res.code==200 && res.data===true){ |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({path:'/main/user/userList',query:{random:Math.random()}}) |
| | | } |
| | | |
| | | }) |
| | | dialogVisible.value = false |
| | | }else { |
| | | ElMessage.warning(t('report.pleaseSelectAProcessFirst')) |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{ $t('user.setUpRoles') }}</el-button> |
| | | <el-button @click="getTableRow(row,'editProcess')" link type="primary" size="small">{{ $t('user.setProcess') }}</el-button> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')"> |
| | | <template #reference> |
| | | <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog |
| | | v-model="dialogVisibleProcess" |
| | | :title="$t('user.roleSelection')" |
| | | width="30%" |
| | | :before-close="handleClose" |
| | | > |
| | | <el-select v-model="processValue" clearable :placeholder="$t('reportingWorks.selectProcess')" default-value="default_city" style="width: 120px"> |
| | | <el-option |
| | | v-for="item in processRow['process']" |
| | | :key="item.id" |
| | | :label="item.basic_name" |
| | | :value="item.basic_name" |
| | | /> |
| | | </el-select> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisibleProcess = false">{{ $t('basicData.cancelButtonText') }}</el-button> |
| | | <el-button type="primary" @click="updateProcess"> |
| | | {{ $t('basicData.confirmButtonText') }} |
| | | </el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |