| | |
| | | <template> |
| | | <!-- <transition name="fade" mode="out-in">--> |
| | | <!-- <keep-alive :exclude="excludeList">--> |
| | | <!-- <router-view v-if="!$route.meta.iskeepAlive" :key="$route.id"></router-view>--> |
| | | <!-- </keep-alive>--> |
| | | <!-- </transition>--> |
| | | <!-- <transition name="fade" mode="out-in">--> |
| | | <!-- <keep-alive :exclude="excludeList">--> |
| | | <!-- <router-view v-if="!$route.meta.iskeepAlive" :key="$route.path"></router-view>--> |
| | | <!-- </keep-alive>--> |
| | | <!-- </transition>--> |
| | | <!-- <router-view v-if="!$route.meta.iskeepAlive" v-slot="{ Component }">--> |
| | | <!-- <transition name="fade" mode="in-out">--> |
| | | <!-- <keep-alive :exclude="excludeList" :include="includeList">--> |
| | |
| | | } else if (response.data.code && response.data.code === 'A0215') { |
| | | ElMessage.error('token失效'); |
| | | // logOut; |
| | | useLoginApi() |
| | | .signOut() |
| | | .then(() => { |
| | | Session.clear(); |
| | | window.location.href = '/'; |
| | | }); |
| | | // useLoginApi() |
| | | // .signOut() |
| | | // .then(() => { |
| | | // Session.clear(); |
| | | // window.location.href = '/'; |
| | | // }); |
| | | } |
| | | // if(response.data.code && response.data.code !== '200'){ |
| | | return Promise.resolve(response); |
| | |
| | | alert('您的浏览器不支持socket'); |
| | | } else { |
| | | // 实例化socket |
| | | debugger |
| | | let uid = userInfos.value.uid.toString() |
| | | var url = state.path + uid + '*' + id; |
| | | console.log(url,'url',uid,'uid') |
| | |
| | | |
| | | // 接口获取数据 |
| | | const getLine = async (id:string) => { |
| | | debugger |
| | | let res = await lineApi().getLine({ id: id }); |
| | | if (res.data.code === '200') { |
| | | userInfos.value.dataList = res.data.data; |
| | |
| | | |
| | | const hasUserCodeOrPassword =()=> { |
| | | if (localStorage.getItem('userCode') && localStorage.getItem('userPassword')) { |
| | | state.ruleForm.username = localStorage.getItem('userCode') |
| | | state.ruleForm.username = localStorage.getItem('userCode') as string |
| | | state.ruleForm.password = Base64.decode(localStorage.getItem('userPassword'))//解密 |
| | | state.saveCode = true |
| | | } |
| | |
| | | let res = await materialApi().getRecordList(); |
| | | if (res.data.code === '200') { |
| | | state.allList = JSON.parse(JSON.stringify(res.data.data)) |
| | | state.checkData = state.allList.map((item)=>{ |
| | | if(item.list && item.list != null){ |
| | | console.log('1111111111111') |
| | | item.list.map((i)=>{ |
| | | i.checked = false |
| | | i.defaultVal = null |
| | | i.configurationLevel = null |
| | | i.consumables = false |
| | | return { |
| | | checked: i.checked, |
| | | materialName: i.name, |
| | | consumables: i.consumables, |
| | | defaultVal: i.defaultVal, |
| | | configurationLevel: i.configurationLevel, |
| | | materialType: i.materialType, |
| | | materialTypeName: i.materialTypeName, |
| | | emergencyMaterialId: i.id |
| | | } |
| | | }) |
| | | } |
| | | return item |
| | | }) |
| | | // const test = [{id:1,name:'1',children:[{one:1,two:'1'},]},{id:2,name:'2',children:[{one:2,two:'2'},]}] |
| | | // test.map(item => { |
| | | // item.children.map(i =>{ |
| | | // debugger |
| | | // return { |
| | | // three:true |
| | | // } |
| | | // const obj = i |
| | | // console.log(obj); |
| | | // }) |
| | | // return item |
| | | // }) |
| | | // console.log(test); |
| | | for(let i in state.allList){ |
| | | state.allList[i].list = state.allList[i].list?.map((item:any) => { |
| | | const obj = { |
| | | checked: false, |
| | | materialName: item.name, |
| | | consumables: false, |
| | | defaultVal: null, |
| | | configurationLevel: null, |
| | | materialType: item.materialType, |
| | | materialTypeName: item.materialTypeName, |
| | | emergencyMaterialId: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | } |
| | | state.checkData = JSON.parse(JSON.stringify(state.allList)) |
| | | // state.checkData = state.allList.map((item)=>{ |
| | | // if(item.list && item.list != null){ |
| | | // console.log('1111111111111') |
| | | // item.list.map((i)=>{ |
| | | // i.checked = false |
| | | // i.defaultVal = null |
| | | // i.configurationLevel = null |
| | | // i.consumables = false |
| | | // debugger |
| | | // const obj = { |
| | | // checked: i.checked, |
| | | // materialName: i.name, |
| | | // consumables: i.consumables, |
| | | // defaultVal: i.defaultVal, |
| | | // configurationLevel: i.configurationLevel, |
| | | // materialType: i.materialType, |
| | | // materialTypeName: i.materialTypeName, |
| | | // emergencyMaterialId: i.id |
| | | // } |
| | | // return {...obj} |
| | | // }) |
| | | // } |
| | | // return item |
| | | // }) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | <el-col v-if="(approveItemForm.type === 2 || approveItemForm.type === 3) && personType !== 3" :span="24" style="margin-bottom: 24px"> |
| | | <el-form-item label="措施名称" prop="measureId"> |
| | | <el-select v-model="approveItemForm.measureId" placeholder="请选择措施" class="input-add" clearable filterable> |
| | | <el-option v-for="item in actionList" :key="item.id" :value="item.id" :label="item.context"></el-option> |
| | | <el-option v-for="item in approveTypeList" :key="item.id" :value="item.id" :label="item.context"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | approveItemFormRule: {}; |
| | | actionList: Array<type>; |
| | | typeList: Array<type>; |
| | | approveTypeList: Array<type>; |
| | | smTypeList: Array<type>; |
| | | standardList: []; |
| | | order: number | null; |
| | |
| | | interface type { |
| | | id: number; |
| | | name: string; |
| | | type?:number; |
| | | } |
| | | export default { |
| | | name: 'approveItemDialog', |
| | |
| | | }, |
| | | actionList: [], |
| | | typeList: [], |
| | | approveTypeList: [], |
| | | smTypeList: [ |
| | | { id: 1, name: '标准' }, |
| | | { id: 2, name: '措施' } |
| | |
| | | const clearValue = () => { |
| | | if (data.approveItemForm.type === 1) { |
| | | data.approveItemForm.measureId = null; |
| | | }else if(data.approveItemForm.type === 2){ |
| | | data.approveItemForm.standId = null; |
| | | data.approveTypeList = data.actionList.filter(item => item.type === 1) |
| | | } else { |
| | | data.approveItemForm.standId = null; |
| | | data.approveTypeList = data.actionList.filter(item => item.type === 2) |
| | | } |
| | | }; |
| | | |
| | |
| | | userList: []; |
| | | timeList: Array<type>; |
| | | typeList: Array<type>; |
| | | approveTypeList: Array<type>; |
| | | workLevelList: []; |
| | | standardList: Array<stand>; |
| | | actionList: Array<action>; |
| | |
| | | { id: 1, name: '单人' }, |
| | | { id: 2, name: '多人' }, |
| | | { id: 3, name: '分析人' } |
| | | ], |
| | | approveTypeList: [ |
| | | { id: 1, name: '数值' }, |
| | | { id: 2, name: '选项' }, |
| | | { id: 3, name: '填空' } |
| | | ], |
| | | workLevelList: [], |
| | | actionList: [], |
| | |
| | | |
| | | const parseNumber = (value: number, type: string) => { |
| | | if (type === '审批项类型') { |
| | | return data.typeList.find((item) => item.id === value)?.name; |
| | | return data.approveTypeList.find((item) => item.id === value)?.name; |
| | | } else if (type === '措施名称') { |
| | | return data.actionList.find((item) => item.id === value)?.context; |
| | | } else { |
| | |
| | | <el-form :model="departmentForm" size="default" label-width="90px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="部门等级"> |
| | | <el-select v-model="departmentForm.depLevel" placeholder="请输入部门等级" class="input-add" clearable> |
| | | <el-option |
| | | v-for="item in depLevelList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="上级部门"> |
| | | <el-cascader :options="deptData" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请选择部门" clearable class="w100" v-model="departmentForm.parentDepId"> </el-cascader> |
| | | <el-cascader :options="deptData" class="input-add" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请选择部门" clearable v-model="departmentForm.parentDepId"> </el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="部门名称"> |
| | | <el-input v-model="departmentForm.depName" placeholder="请输入部门名称" clearable></el-input> |
| | | <el-input v-model="departmentForm.depName" class="input-add" placeholder="请输入部门名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="部门描述"> |
| | | <el-input v-model="departmentForm.depInfo" type="textarea" placeholder="请输入部门描述" maxlength="150"></el-input> |
| | | <el-input v-model="departmentForm.depInfo" class="input-add" type="textarea" placeholder="请输入部门描述" maxlength="150"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | depName: string; |
| | | depInfo: string; |
| | | parentDepId: string; |
| | | depLevel:null | number |
| | | }; |
| | | deptData: Array<TableDataRow>; |
| | | depLevelList: Array<Type>; |
| | | } |
| | | interface Type{ |
| | | id:number; |
| | | name:string |
| | | } |
| | | |
| | | export default defineComponent({ |
| | |
| | | departmentForm: { |
| | | depName: '', |
| | | parentDepId: '', |
| | | depInfo: '' |
| | | depInfo: '', |
| | | depLevel:null, |
| | | }, |
| | | deptData: [] // 部门数据 |
| | | deptData: [], // 部门数据 |
| | | depLevelList: [ |
| | | {id:1,name:'公司'}, |
| | | {id:2,name:'事业部'}, |
| | | {id:3,name:'车间'}, |
| | | {id:4,name:'班组'} |
| | | ] // 部门数据 |
| | | }); |
| | | |
| | | // 打开弹窗 |
| | | const openDialog = (type: string, value: any, departmentList: []) => { |
| | | state.isShowDialog = true; |
| | |
| | | state.departmentForm = { |
| | | depName: '', |
| | | parentDepId: '', |
| | | depLevel:null, |
| | | depInfo: '' |
| | | }; |
| | | } else { |