已重命名17个文件
已修改17个文件
已添加5个文件
已删除13个文件
| | |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | // 获取物资配置数据 |
| | | getMaterial: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialWork/material/queryByWorkTypeOrLevel`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | }; |
| | | } |
| | |
| | | } |
| | | }, |
| | | { |
| | | path: '/screenPage', |
| | | name: 'screenPage', |
| | | component: () => import('/@/views/riskWarningSys/warningBigScreen/indexs/index.vue'), |
| | | meta: { |
| | | title: '预警预报' |
| | | } |
| | | }, |
| | | { |
| | | path: '/material', |
| | | name: 'material', |
| | | component: () => import('/@/views/specialWorkSystem/foundationSet/material/index.vue'), |
| | | meta: { |
| | | title: '物资管理' |
| | | } |
| | | }, |
| | | { |
| | | path: '/msgDetail', |
| | | name: 'msgDetail', |
| | | component: () => import('/@/views/riskWarningSys/warningBigScreen/indexs/msgDetail.vue'), |
| | | meta: { |
| | | title: 'spi报告详情' |
| | | } |
| | | }, |
| | | { |
| | | path: '/material', |
| | | name: 'material', |
| | | component: () => import('/@/views/specialWorkSystem/foundationSet/material/index.vue'), |
| | | meta: { |
| | | title: '作业物资' |
| | | } |
| | | } |
| | | ]; |
| | |
| | | import { Plus, Search, Delete, Edit, Download, Refresh, View, EditPen } from '@element-plus/icons-vue'; |
| | | // import OpenSee from '/@/views/contingencyManagement/emergencyPlanStartRecord/component/openSee.vue'; |
| | | // import UpData from '/@/views/contingencyManagement/panManagement/component/upData.vue'; |
| | | // import EmergencySupplies from '/@/components/emergencySupplies/index.vue'; |
| | | // import EmergencySupplies from '/@/components/emergencySupplies/spi.vue'; |
| | | // import OpenAdd from '/@/views/contingencyManagement/emergencyResources/maintenanceOfEmergencyMaterials/component/openAdd.vue'; |
| | | // import { contingencyApi } from '/@/api/contingency'; |
| | | // import { emergencySuppliesMaintainApi } from '/@/api/emergencySuppliesMaintain'; |
| | |
| | | }; |
| | | // 去风险大屏 |
| | | const toRiskPlatform = () => { |
| | | // router.push({ |
| | | // name: "warningScreen" |
| | | // }); |
| | | window.open('http://39.104.85.193:8585/'); |
| | | router.push({ |
| | | name: "warningScreen" |
| | | }); |
| | | // window.open('http://39.104.85.193:8585/'); |
| | | }; |
| | | const throttle = (renderMenu: any, delay: number) => { |
| | | let flag = true; |
| | |
| | | 100% { |
| | | position: absolute; |
| | | left: 0; |
| | | } |
| | | } |
| | | @keyframes upDown { |
| | | 50% { |
| | | -webkit-transform: translateY(-8px); |
| | | -ms-transform: translateY(-8px); |
| | | -o-transform: translateY(-8px); |
| | | transform: translateY(-8px); |
| | | } |
| | | 100% { |
| | | -webkit-transform: translateY(0); |
| | | -ms-transform: translateY(0); |
| | | -o-transform: translateY(0); |
| | | transform: translateY(0); |
| | | } |
| | | } |
| | | @media screen and (min-width: 1400px) { |
| | |
| | | overflow: hidden; |
| | | cursor: pointer; |
| | | transition: 0.3s; |
| | | border: none; |
| | | border: 2px solid rgba(255,255,255,0); |
| | | |
| | | &:hover { |
| | | border-radius: 16px; |
| | | background-image: radial-gradient(ellipse farthest-side at 50% 100%, #48a3ff 0%, #fff 120%); |
| | | box-shadow: -8px -8px 24px rgba(20, 97, 234, 0.2), 8px 8px 24px rgba(20, 97, 234, 0.2); |
| | | border: 2px solid #fff; |
| | | |
| | | .iconImg{ |
| | | animation: upDown 0.3s 1 ease-in-out forwards; |
| | | filter: drop-shadow(0 0 12px rgba(20, 97, 234, 0.4)); |
| | | } |
| | | } |
| | | } |
| | | .cont-bg-1 { |
文件名从 src/views/specialWorkSystem/workAlert/alertRecord/index.vue 修改 |
| | |
| | | } |
| | | |
| | | export default { |
| | | name: 'alertRecord', |
| | | name: 'alerts', |
| | | components: {}, |
| | | setup() { |
| | | const userInfo = useUserInfo(); |
文件名从 src/views/specialWorkSystem/workFlow/approveBasic/index.vue 修改 |
| | |
| | | <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="modifiedUname" label="最后修改人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gmtModified" label="最后修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column property="status" label="状态" width="60" /> |
| | | <!-- <el-table-column property="status" label="状态" width="60" />--> |
| | | <el-table-column fixed="right" label="操作" align="center" width="300"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="View" @click="openApproveBasicDialog('查看', scope.row)">查看</el-button> |
| | |
| | | import { ElTable, ElMessage, ElMessageBox } from 'element-plus'; |
| | | import { approveBasicApi } from '/@/api/specialWorkSystem/approveBasic'; |
| | | import { departmentApi } from '/@/api/systemManage/department'; |
| | | import approveBasicDialog from '/@/views/specialWorkSystem/workFlow/approveBasic/components/approveBasicDialog.vue'; |
| | | import approveBasicDialog from '/@/views/specialWorkSystem/flow/basicApprove/components/approveBasicDialog.vue'; |
| | | let global: any = { |
| | | homeChartOne: null, |
| | | homeChartTwo: null, |
文件名从 src/views/specialWorkSystem/workFlow/approveRule/components/approveLevelDialog.vue 修改 |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, ref, nextTick, onMounted } from 'vue'; |
| | | import approveItemDialog from '/@/views/specialWorkSystem/workFlow/approveRule/components/approveItemDialog.vue'; |
| | | import approveItemDialog from '/@/views/specialWorkSystem/flow/ruleofApp/components/approveItemDialog.vue'; |
| | | import { ElMessage } from 'element-plus/es'; |
| | | import { safetyActionApi } from '/@/api/specialWorkSystem/safetyAction'; |
| | | import { approveBasicApi } from '/@/api/specialWorkSystem/approveBasic'; |
文件名从 src/views/specialWorkSystem/workFlow/approveRule/components/approveRuleDialog.vue 修改 |
| | |
| | | import { ElMessage } from 'element-plus/es'; |
| | | import { approveRuleApi } from '/@/api/specialWorkSystem/approveRule'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue'; |
| | | import approveLevelDialog from '/@/views/specialWorkSystem/workFlow/approveRule/components/approveLevelDialog.vue'; |
| | | import approveLevelDialog from '/@/views/specialWorkSystem/flow/ruleofApp/components/approveLevelDialog.vue'; |
| | | interface dataState { |
| | | title: string; |
| | | pointTitle: string; |
文件名从 src/views/specialWorkSystem/workFlow/approveRule/index.vue 修改 |
| | |
| | | import { toRefs, reactive, ref, onMounted } from 'vue'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue'; |
| | | import { ElTable, ElMessage, ElMessageBox } from 'element-plus'; |
| | | import approveRuleDialog from '/@/views/specialWorkSystem/workFlow/approveRule/components/approveRuleDialog.vue'; |
| | | import approveRuleDialog from '/@/views/specialWorkSystem/flow/ruleofApp/components/approveRuleDialog.vue'; |
| | | import { departmentApi } from '/@/api/systemManage/department'; |
| | | import { approveRuleApi } from '/@/api/specialWorkSystem/approveRule/index'; |
| | | import { userApi } from '/@/api/systemManage/user'; |
| | |
| | | <el-checkbox :label="i.materialName" v-model="checkData[index].list[x].checked"> |
| | | </el-checkbox> |
| | | <el-form v-if="checkData[index].list[x].checked" :model="checkData[index].list[x]" label-width="100px" ref="addListRef" :rules="addListRules"> |
| | | <el-form-item label="默认值" prop="defaultVal"><el-input v-model="checkData[index].list[x].defaultVal"/></el-form-item> |
| | | <el-form-item label="配置级别" prop="configurationLevel"> |
| | | <el-select v-model="checkData[index].list[x].configurationLevel"> |
| | | <el-option key="0" label="必选" value="0"/> |
| | |
| | | <el-option key="2" label="高配" value="2"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="checkData[index].list[x].configurationLevel==0" label="默认值" prop="defaultVal"><el-input v-model="checkData[index].list[x].defaultVal"/></el-form-item> |
| | | <el-form-item label="是否耗材" prop="consumables"> |
| | | <el-radio-group v-model="checkData[index].list[x].consumables"> |
| | | <el-radio :label=true>是</el-radio> |
| | |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <div v-if="chosenIndex != null" style="color: #79bbff">注:修改配置数据须重新填写配置</div> |
| | | </el-form-item> |
| | | <el-form-item label="描述" prop="info"> |
| | | <el-input v-model="addRecord.info" type="textarea" autosize :rows="2"/> |
| | |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { teamManageApi } from '/@/api/systemManage/basicDateManage/personShiftManage/teamManage'; |
| | | import { materialApi } from '/@/api/specialWorkSystem/material'; |
| | | |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface stateType { |
| | |
| | | checked: false, |
| | | materialName: item.name, |
| | | consumables: null, |
| | | defaultVal: null, |
| | | defaultVal: 0, |
| | | configurationLevel: null, |
| | | materialType: item.materialType, |
| | | materialTypeName: item.materialTypeName, |
| | |
| | | materialDetailList: state.addRecord.materialDetailList |
| | | }; |
| | | console.log(data.materialDetailList,'data.materialDetailList') |
| | | if(data.materialDetailList.length==0 || data.materialDetailList.some((e) => e.defaultVal == null) || data.materialDetailList.some((e) => e.configurationLevel == null) || data.materialDetailList.some((e) => e.consumables == null)){ |
| | | if(data.materialDetailList.length==0 || data.materialDetailList.some((e) => e.configurationLevel == null) || data.materialDetailList.some((e) => e.consumables == null)){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '请完善物资配置必填数据' |
| | | message: '请选择物资配置并完善必填数据' |
| | | }); |
| | | }else{ |
| | | if (state.chosenIndex == null) { |
| | | await addRecord(data); |
| | | } else { |
| | | data.id = state.addRecord.id; |
| | | await editRecord(data); |
| | | } |
| | | state.dialogAddRecord = false; |
| | | return |
| | | } |
| | | if (state.chosenIndex == null) { |
| | | await addRecord(data); |
| | | } else { |
| | | data.id = state.addRecord.id; |
| | | await editRecord(data); |
| | | } |
| | | state.dialogAddRecord = false; |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="context" label="措施内容"></el-table-column> |
| | | <el-table-column property="context" label="措施内容" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="correctVal" label="正确值" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <span> |
| | |
| | | <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="modifiedUname" label="最后修改人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gmtModified" label="最后修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column property="status" label="状态" width="60" /> |
| | | <!-- <el-table-column property="status" label="状态" width="60" />--> |
| | | <el-table-column fixed="right" label="操作" align="center" width="300"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="View" @click="openSafetyActionDialog('查看', scope.row)">查看</el-button> |
文件名从 src/views/specialWorkSystem/workProcess/workCheck/index.vue 修改 |
| | |
| | | url: string; |
| | | } |
| | | export default { |
| | | name: 'workCheck', |
| | | name: 'analysis', |
| | | components: { |
| | | permitNo: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workProcess/components/dialogPermitNo.vue')) |
| | | permitNo: defineAsyncComponent(() => import('/@/views/specialWorkSystem/process/components/dialogPermitNo.vue')) |
| | | }, |
| | | setup() { |
| | | const userInfo = useUserInfo(); |
文件名从 src/views/specialWorkSystem/workProcess/gasCheck/index.vue 修改 |
| | |
| | | export default { |
| | | name: 'gasCheck', |
| | | components: { |
| | | permitNo: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workProcess/components/dialogPermitNo.vue')) |
| | | permitNo: defineAsyncComponent(() => import('/@/views/specialWorkSystem/process/components/dialogPermitNo.vue')) |
| | | }, |
| | | setup() { |
| | | const userInfo = useUserInfo(); |
| | |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button> |
| | | <el-button link type="success" size="small" :icon="Finished" @click="viewStatus(scope.row)">进度</el-button> |
| | | <el-button link type="primary" size="small" :icon="Download" @click="downLoadBtn(scope.row)">导出</el-button> |
| | | <el-button :disabled="scope.row.status == 7 ? false : true" link type="primary" size="small" :icon="Download" @click="downLoadBtn(scope.row)">导出作业票</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | // 填写表单 |
| | | const toApply = () => { |
| | | router.push({ |
| | | path: 'workApply' |
| | | path: 'apply' |
| | | }); |
| | | }; |
| | | |
文件名从 src/views/specialWorkSystem/workTicket/workApply/components/broken.vue 修改 |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="选择关联物资"> |
| | | <el-button type="primary" @click="getMaList">选择物资标准</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <el-dialog v-model="equipmentDialog" title="关联物资标准" width="40%" center @close="closeMaterial"> |
| | | <el-tabs tab-position="left" class="demo-tabs" type="border-card"> |
| | | <el-tab-pane v-for="(item,index) in materialList" :label="item.materialTypeName" :key="index"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-form label-width="150px" label-position="top"> |
| | | <div v-if="item.mustList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">必选</div> |
| | | <el-form-item v-if="item.mustList.length>0" class="tab-i" v-for="(i,x) in item.mustList" :key="x" :label="item.mustList[x].materialName + ':'" prop="defaultVal" :rules="[{ type: 'defaultVal', required: true, message: '该内容不能为空', trigger: 'blur'}]"> |
| | | <el-input size="default" type="number" v-model="item.mustList[x].value" @change="(val)=>toZero(val,index,'mustList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.mustList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <div v-if="item.unList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">其他</div> |
| | | <el-form-item v-if="item.unList.length>0" class="tab-i" v-for="(i,x) in item.unList" :key="x" :label="item.unList[x].materialName + ':'"> |
| | | <el-input size="default" type="number" v-model="item.unList[x].value" @change="(val)=>toZero(val,index,'unList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.unList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="equipmentDialog = false" size="default">取消</el-button> |
| | | <el-button type="primary" @click="conFirmDevices" size="default">确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | |
| | | import axios from 'axios'; |
| | | |
| | | interface stateType { |
| | | equipmentDialog: boolean, |
| | | form: Object, |
| | | csDepList: Array<any>, |
| | | fileList: Array<file>, |
| | |
| | | imgLimit: number, |
| | | casProps: {}, |
| | | casProps2: {}, |
| | | isOverSize: boolean |
| | | isOverSize: boolean, |
| | | materialList: Array<any> |
| | | } |
| | | interface file { |
| | | url: string; |
| | |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 5, |
| | |
| | | bcPath: [], |
| | | involvedDepIds: [] |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | materialList: [], |
| | | isOverSize: false, |
| | | fileList: [], |
| | | imgLimit: 3, |
| | |
| | | "workDetail.bcPath": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.involvedDepIds": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | |
| | | const toZero = (value: string | number,index: number,name: string,x:number) =>{ |
| | | if(!value){ |
| | | state.materialList[index][name][x].value = 0 |
| | | } |
| | | } |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].postList = [...state.materialList[i].mustList,...state.materialList[i].unList] |
| | | state.form.wmAddReqDTOList = [...state.form.wmAddReqDTOList,...state.materialList[i].postList] |
| | | } |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.materialList = [] |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | // 确认物资标准 |
| | | const getMaList = async() =>{ |
| | | if(state.materialList.length == 0){ |
| | | const data = {workType: 5,workLevel: null} |
| | | const res = await workApplyApi().getMaterial(data) |
| | | if (res.data.code === '200') { |
| | | if(res.data.data.materialTypeList && res.data.data.materialTypeList!=null&&res.data.data.materialTypeList.length>0){ |
| | | state.materialList = JSON.parse(JSON.stringify(res.data.data.materialTypeList)) |
| | | for(let i in state.materialList){ |
| | | state.materialList[i].mustList = [] |
| | | state.materialList[i].unList = [] |
| | | state.materialList[i].mdList = state.materialList[i].mdList?.map((item:any) => { |
| | | if(item.configurationLevel == 0){ |
| | | state.materialList[i].mustList.push(item) |
| | | return |
| | | }else{ |
| | | state.materialList[i].unList.push(item) |
| | | return |
| | | } |
| | | }) |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | } |
| | | state.equipmentDialog = true |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '暂时查询不到物资标准信息' |
| | | }); |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }else{ |
| | | state.materialList = state.materialList |
| | | state.equipmentDialog = true |
| | | } |
| | | } |
| | | const conFirmDevices = ()=>{ |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | |
| | | } |
| | | ElMessageBox.confirm('是否确认物资及数量配置?') |
| | | .then(() => { |
| | | state.equipmentDialog = false |
| | | }) |
| | | .catch(() => { |
| | | // catch error |
| | | }) |
| | | } |
| | | |
| | | const closeMaterial = ()=>{ |
| | | |
| | | } |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | toZero, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | handlePreview, |
| | | getUploadUrl, |
| | | beforeRemove, |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业等级" prop="workLevel"> |
| | | <el-select v-model="form.workLevel"> |
| | | <el-option |
| | | v-for="item in workLevelList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="危害辨识" prop="hazardIdentification"> |
| | | <el-input |
| | | v-model="form.hazardIdentification" |
| | | placeholder="请输入危害辨识" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-divider border-style="dashed"/> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="动火方式" prop="workDetail.hotMethod"> |
| | | <el-input |
| | | v-model="form.workDetail.hotMethod" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入动火方式" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联作业" prop="workDetail.otherSpecialWork"> |
| | | <el-select v-model="form.workDetail.otherSpecialWork" multiple> |
| | | <el-option |
| | | v-for="item in otherWorkList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="选择关联物资"> |
| | | <el-button type="primary" @click="getMaList">选择物资标准</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <el-dialog v-model="equipmentDialog" title="关联物资标准" width="40%" center @close="closeMaterial"> |
| | | <el-tabs tab-position="left" class="demo-tabs" type="border-card"> |
| | | <el-tab-pane v-for="(item,index) in materialList" :label="item.materialTypeName" :key="index"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-form label-width="150px" label-position="top"> |
| | | <div v-if="item.mustList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">必选</div> |
| | | <el-form-item v-if="item.mustList.length>0" class="tab-i" v-for="(i,x) in item.mustList" :key="x" :label="item.mustList[x].materialName + ':'" prop="defaultVal" :rules="[{ type: 'defaultVal', required: true, message: '该内容不能为空', trigger: 'blur'}]"> |
| | | <el-input size="default" type="number" v-model="item.mustList[x].value" @change="(val)=>toZero(val,index,'mustList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.mustList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <div v-if="item.unList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">其他</div> |
| | | <el-form-item v-if="item.unList.length>0" class="tab-i" v-for="(i,x) in item.unList" :key="x" :label="item.unList[x].materialName + ':'"> |
| | | <el-input size="default" type="number" v-model="item.unList[x].value" @change="(val)=>toZero(val,index,'unList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.unList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="equipmentDialog = false" size="default">取消</el-button> |
| | | <el-button type="primary" @click="conFirmDevices" size="default">确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workLevelList: Array<any>, |
| | | otherWorkList: Array<any>, |
| | | equipmentDialog: boolean, |
| | | materialList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'fireForm', |
| | | components: {}, |
| | | props:['workerList'], |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | materialList: [], |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 1, |
| | | workLevel: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | hazardIdentification: '', |
| | | workDetail:{ |
| | | hotMethod: '', |
| | | otherSpecialWork: [] |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workLevelList: [ |
| | | { |
| | | label: "一级动火作业", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "二级动火作业", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "特级动火作业", |
| | | value: 3 |
| | | } |
| | | ], |
| | | otherWorkList: [ |
| | | { |
| | | label: "动火作业", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "受限空间作业", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "吊装作业", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "动土作业", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "断路作业", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "高处作业", |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: "临时用电作业", |
| | | value: 7 |
| | | }, |
| | | { |
| | | label: "盲板抽堵作业", |
| | | value: 8 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.hotMethod": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | |
| | | }); |
| | | const toZero = (value: string | number,index: number,name: string,x:number) =>{ |
| | | if(!value){ |
| | | state.materialList[index][name][x].value = 0 |
| | | } |
| | | } |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | if (state.materialList.length == 0){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '请确认关联物资的配置' |
| | | }); |
| | | return |
| | | } |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].postList = [...state.materialList[i].mustList,...state.materialList[i].unList] |
| | | state.form.wmAddReqDTOList = [...state.form.wmAddReqDTOList,...state.materialList[i].postList] |
| | | } |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | data.workDetail.otherSpecialWork = data.workDetail.otherSpecialWork.join(',') |
| | | const res = await workApplyApi().postFireApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.materialList = [] |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 确认物资标准 |
| | | const getMaList = async() =>{ |
| | | if(state.materialList.length == 0){ |
| | | const data = {workType: 1,workLevel: state.form.workLevel} |
| | | const res = await workApplyApi().getMaterial(data) |
| | | if (res.data.code === '200') { |
| | | if(res.data.data.materialTypeList && res.data.data.materialTypeList!=null&&res.data.data.materialTypeList.length>0){ |
| | | state.materialList = JSON.parse(JSON.stringify(res.data.data.materialTypeList)) |
| | | for(let i in state.materialList){ |
| | | state.materialList[i].mustList = [] |
| | | state.materialList[i].unList = [] |
| | | state.materialList[i].mdList = state.materialList[i].mdList?.map((item:any) => { |
| | | if(item.configurationLevel == 0){ |
| | | state.materialList[i].mustList.push(item) |
| | | return |
| | | }else{ |
| | | state.materialList[i].unList.push(item) |
| | | return |
| | | } |
| | | }) |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | } |
| | | state.equipmentDialog = true |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '暂时查询不到物资标准信息' |
| | | }); |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }else{ |
| | | state.materialList = state.materialList |
| | | state.equipmentDialog = true |
| | | } |
| | | } |
| | | |
| | | const conFirmDevices = ()=>{ |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | } |
| | | ElMessageBox.confirm('是否确认物资及数量配置?') |
| | | .then(() => { |
| | | state.equipmentDialog = false |
| | | }) |
| | | .catch(() => { |
| | | // catch error |
| | | }) |
| | | } |
| | | |
| | | const closeMaterial = ()=>{ |
| | | |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | toZero, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding-top: 15px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | |
| | | .tab-i{ |
| | | margin-bottom: 15px; |
| | | |
| | | &:last-of-type{ |
| | | margin-bottom: 0; |
| | | } |
| | | ::v-deep(.el-form-item){ |
| | | .el-form-item__label{ |
| | | margin-bottom: 4px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
文件名从 src/views/specialWorkSystem/workTicket/workApply/components/ground.vue 修改 |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="选择关联物资"> |
| | | <el-button type="primary" @click="getMaList">选择物资标准</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <el-dialog v-model="equipmentDialog" title="关联物资标准" width="40%" center @close="closeMaterial"> |
| | | <el-tabs tab-position="left" class="demo-tabs" type="border-card"> |
| | | <el-tab-pane v-for="(item,index) in materialList" :label="item.materialTypeName" :key="index"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-form label-width="150px" label-position="top"> |
| | | <div v-if="item.mustList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">必选</div> |
| | | <el-form-item v-if="item.mustList.length>0" class="tab-i" v-for="(i,x) in item.mustList" :key="x" :label="item.mustList[x].materialName + ':'" prop="defaultVal" :rules="[{ type: 'defaultVal', required: true, message: '该内容不能为空', trigger: 'blur'}]"> |
| | | <el-input size="default" type="number" v-model="item.mustList[x].value" @change="(val)=>toZero(val,index,'mustList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.mustList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <div v-if="item.unList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">其他</div> |
| | | <el-form-item v-if="item.unList.length>0" class="tab-i" v-for="(i,x) in item.unList" :key="x" :label="item.unList[x].materialName + ':'"> |
| | | <el-input size="default" type="number" v-model="item.unList[x].value" @change="(val)=>toZero(val,index,'unList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.unList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="equipmentDialog = false" size="default">取消</el-button> |
| | | <el-button type="primary" @click="conFirmDevices" size="default">确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | |
| | | |
| | | |
| | | interface stateType { |
| | | equipmentDialog: boolean, |
| | | form: Object, |
| | | csDepList: Array<any>, |
| | | otherWorkList: Array<any>, |
| | |
| | | dialogImageUrl: string | null, |
| | | imgLimit: number, |
| | | casProps: {}, |
| | | isOverSize: Boolean |
| | | isOverSize: Boolean, |
| | | materialList: Array<any> |
| | | } |
| | | interface file { |
| | | url: string; |
| | |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 4, |
| | |
| | | gbPath: [], |
| | | otherSpecialWork: [] |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | isOverSize: false, |
| | | fileList: [], |
| | | materialList: [], |
| | | imgLimit: 3, |
| | | uploadUrl: '', |
| | | dialogVisible: false, |
| | |
| | | "workDetail.gbMethod": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.gbPath": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const toZero = (value: string | number,index: number,name: string,x:number) =>{ |
| | | if(!value){ |
| | | state.materialList[index][name][x].value = 0 |
| | | } |
| | | } |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].postList = [...state.materialList[i].mustList,...state.materialList[i].unList] |
| | | state.form.wmAddReqDTOList = [...state.form.wmAddReqDTOList,...state.materialList[i].postList] |
| | | } |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.materialList = [] |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | |
| | | // console.log('2111111111111') |
| | | // }; |
| | | |
| | | // 确认物资标准 |
| | | const getMaList = async() =>{ |
| | | if(state.materialList.length == 0){ |
| | | const data = {workType: 4,workLevel: null} |
| | | const res = await workApplyApi().getMaterial(data) |
| | | if (res.data.code === '200') { |
| | | if(res.data.data.materialTypeList && res.data.data.materialTypeList!=null&&res.data.data.materialTypeList.length>0){ |
| | | state.materialList = JSON.parse(JSON.stringify(res.data.data.materialTypeList)) |
| | | for(let i in state.materialList){ |
| | | state.materialList[i].mustList = [] |
| | | state.materialList[i].unList = [] |
| | | state.materialList[i].mdList = state.materialList[i].mdList?.map((item:any) => { |
| | | if(item.configurationLevel == 0){ |
| | | state.materialList[i].mustList.push(item) |
| | | return |
| | | }else{ |
| | | state.materialList[i].unList.push(item) |
| | | return |
| | | } |
| | | }) |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | } |
| | | state.equipmentDialog = true |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '暂时查询不到物资标准信息' |
| | | }); |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }else{ |
| | | state.materialList = state.materialList |
| | | state.equipmentDialog = true |
| | | } |
| | | } |
| | | const conFirmDevices = ()=>{ |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | |
| | | } |
| | | ElMessageBox.confirm('是否确认物资及数量配置?') |
| | | .then(() => { |
| | | state.equipmentDialog = false |
| | | }) |
| | | .catch(() => { |
| | | // catch error |
| | | }) |
| | | } |
| | | |
| | | const closeMaterial = ()=>{ |
| | | |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | |
| | | Plus, |
| | | ruleFormRef, |
| | | applyRules, |
| | | toZero, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | handlePreview, |
| | | getUploadUrl, |
| | | beforeRemove, |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业等级" prop="workLevel"> |
| | | <el-select v-model="form.workLevel"> |
| | | <el-option |
| | | v-for="item in workLevelList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="危害辨识" prop="hazardIdentification"> |
| | | <el-input |
| | | v-model="form.hazardIdentification" |
| | | placeholder="请输入危害辨识" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-divider border-style="dashed"/> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业单位" prop="workDetail.operationDepId"> |
| | | <!-- <el-select v-model="form.workDetail.operationDepId">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in heDepList"--> |
| | | <!-- :key="item.value"--> |
| | | <!-- :label="item.label"--> |
| | | <!-- :value="item.value"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader v-model="form.workDetail.operationDepId" :options="departList" :props="casProps" :show-all-levels="false" @change="handleChange" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业高度" prop="workDetail.operationHeight"> |
| | | <el-input |
| | | v-model="form.workDetail.operationHeight" |
| | | type="number" |
| | | placeholder="请输入" |
| | | > |
| | | <template #append>米(m)</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联作业" prop="workDetail.otherSpecialWork"> |
| | | <el-select v-model="form.workDetail.otherSpecialWork" multiple> |
| | | <el-option |
| | | v-for="item in otherWorkList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="选择关联物资"> |
| | | <el-button type="primary" @click="getMaList">选择物资标准</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <el-dialog v-model="equipmentDialog" title="关联物资标准" width="40%" center @close="closeMaterial"> |
| | | <el-tabs tab-position="left" class="demo-tabs" type="border-card"> |
| | | <el-tab-pane v-for="(item,index) in materialList" :label="item.materialTypeName" :key="index"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-form label-width="150px" label-position="top"> |
| | | <div v-if="item.mustList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">必选</div> |
| | | <el-form-item v-if="item.mustList.length>0" class="tab-i" v-for="(i,x) in item.mustList" :key="x" :label="item.mustList[x].materialName + ':'" prop="defaultVal" :rules="[{ type: 'defaultVal', required: true, message: '该内容不能为空', trigger: 'blur'}]"> |
| | | <el-input size="default" type="number" v-model="item.mustList[x].value" @change="(val)=>toZero(val,index,'mustList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.mustList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <div v-if="item.unList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">其他</div> |
| | | <el-form-item v-if="item.unList.length>0" class="tab-i" v-for="(i,x) in item.unList" :key="x" :label="item.unList[x].materialName + ':'"> |
| | | <el-input size="default" type="number" v-model="item.unList[x].value" @change="(val)=>toZero(val,index,'unList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.unList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="equipmentDialog = false" size="default">取消</el-button> |
| | | <el-button type="primary" @click="conFirmDevices" size="default">确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | equipmentDialog: boolean, |
| | | form: Object, |
| | | workTypeList: Array<any>, |
| | | workLevelList: Array<any>, |
| | | heDepList: Array<any>, |
| | | otherWorkList: Array<any>, |
| | | casProps:{}, |
| | | materialList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'heightForm', |
| | | components: {}, |
| | | props:['workerList','departList'], |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 6, |
| | | workLevel: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | hazardIdentification: '', |
| | | workDetail:{ |
| | | operationDepId: '', |
| | | operationHeight: null, |
| | | otherSpecialWork: [] |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | heDepList: [ |
| | | { |
| | | label: "单位一", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "单位二", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "单位三", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "单位四", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "单位五", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "单位六", |
| | | value: 6 |
| | | } |
| | | ], |
| | | materialList: [], |
| | | casProps: { |
| | | emitPath: false, |
| | | value: 'depId', |
| | | label: 'depName', |
| | | multiple: false, |
| | | expandTrigger: 'hover', |
| | | checkStrictly: true |
| | | }, |
| | | workTypeList: [ |
| | | { |
| | | label: "类型一", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "类型二", |
| | | value: 2 |
| | | } |
| | | ], |
| | | workLevelList: [ |
| | | { |
| | | label: "一级高处作业", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "二级高处作业", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "三级高处作业", |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: "特级高处作业", |
| | | value: 7 |
| | | } |
| | | ], |
| | | otherWorkList: [ |
| | | { |
| | | label: "动火作业", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "受限空间作业", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "吊装作业", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "动土作业", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "断路作业", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "高处作业", |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: "临时用电作业", |
| | | value: 7 |
| | | }, |
| | | { |
| | | label: "盲板抽堵作业", |
| | | value: 8 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.operationDepId": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.operationHeight": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | |
| | | const toZero = (value: string | number,index: number,name: string,x:number) =>{ |
| | | if(!value){ |
| | | state.materialList[index][name][x].value = 0 |
| | | } |
| | | } |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].postList = [...state.materialList[i].mustList,...state.materialList[i].unList] |
| | | state.form.wmAddReqDTOList = [...state.form.wmAddReqDTOList,...state.materialList[i].postList] |
| | | } |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | data.workDetail.otherSpecialWork = data.workDetail.otherSpecialWork.join(',') |
| | | const res = await workApplyApi().postHeightApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.materialList = [] |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 确认物资标准 |
| | | const getMaList = async() =>{ |
| | | if(state.materialList.length == 0){ |
| | | const data = {workType: 6,workLevel: state.form.workLevel} |
| | | const res = await workApplyApi().getMaterial(data) |
| | | if (res.data.code === '200') { |
| | | if(res.data.data.materialTypeList && res.data.data.materialTypeList!=null&&res.data.data.materialTypeList.length>0){ |
| | | state.materialList = JSON.parse(JSON.stringify(res.data.data.materialTypeList)) |
| | | for(let i in state.materialList){ |
| | | state.materialList[i].mustList = [] |
| | | state.materialList[i].unList = [] |
| | | state.materialList[i].mdList = state.materialList[i].mdList?.map((item:any) => { |
| | | if(item.configurationLevel == 0){ |
| | | state.materialList[i].mustList.push(item) |
| | | return |
| | | }else{ |
| | | state.materialList[i].unList.push(item) |
| | | return |
| | | } |
| | | }) |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | } |
| | | state.equipmentDialog = true |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '暂时查询不到物资标准信息' |
| | | }); |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }else{ |
| | | state.materialList = state.materialList |
| | | state.equipmentDialog = true |
| | | } |
| | | } |
| | | const conFirmDevices = ()=>{ |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | |
| | | } |
| | | ElMessageBox.confirm('是否确认物资及数量配置?') |
| | | .then(() => { |
| | | state.equipmentDialog = false |
| | | }) |
| | | .catch(() => { |
| | | // catch error |
| | | }) |
| | | } |
| | | |
| | | const closeMaterial = ()=>{ |
| | | |
| | | } |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | toZero, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding-top: 15px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | :deep(.el-cascader){ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业等级" prop="workLevel"> |
| | | <el-select v-model="form.workLevel"> |
| | | <el-option |
| | | v-for="item in workLevelList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="危害辨识" prop="hazardIdentification"> |
| | | <el-input |
| | | v-model="form.hazardIdentification" |
| | | placeholder="请输入危害辨识" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-divider border-style="dashed"/> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="吊装工具名称" prop="workDetail.hoistingToolName"> |
| | | <el-input |
| | | v-model="form.workDetail.hoistingToolName" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="起吊物体质量" prop="workDetail.weightMass"> |
| | | <el-input |
| | | v-model="form.workDetail.weightMass" |
| | | type="number" |
| | | placeholder="请输入" |
| | | > |
| | | <template #append>吨(t)</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="选择关联物资"> |
| | | <el-button type="primary" @click="getMaList">选择物资标准</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <el-dialog v-model="equipmentDialog" title="关联物资标准" width="40%" center @close="closeMaterial"> |
| | | <el-tabs tab-position="left" class="demo-tabs" type="border-card"> |
| | | <el-tab-pane v-for="(item,index) in materialList" :label="item.materialTypeName" :key="index"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-form label-width="150px" label-position="top"> |
| | | <div v-if="item.mustList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">必选</div> |
| | | <el-form-item v-if="item.mustList.length>0" class="tab-i" v-for="(i,x) in item.mustList" :key="x" :label="item.mustList[x].materialName + ':'" prop="defaultVal" :rules="[{ type: 'defaultVal', required: true, message: '该内容不能为空', trigger: 'blur'}]"> |
| | | <el-input size="default" type="number" v-model="item.mustList[x].value" @change="(val)=>toZero(val,index,'mustList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.mustList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <div v-if="item.unList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">其他</div> |
| | | <el-form-item v-if="item.unList.length>0" class="tab-i" v-for="(i,x) in item.unList" :key="x" :label="item.unList[x].materialName + ':'"> |
| | | <el-input size="default" type="number" v-model="item.unList[x].value" @change="(val)=>toZero(val,index,'unList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.unList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="equipmentDialog = false" size="default">取消</el-button> |
| | | <el-button type="primary" @click="conFirmDevices" size="default">确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | equipmentDialog: boolean, |
| | | form: Object, |
| | | workLevelList: Array<any>, |
| | | materialList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'hoistForm', |
| | | components: {}, |
| | | props:['workerList'], |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 3, |
| | | workLevel: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | hazardIdentification: '', |
| | | workDetail:{ |
| | | hoistingToolName: '', |
| | | weightMass: null |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | materialList: [], |
| | | workLevelList: [ |
| | | { |
| | | label: "一级吊装作业", |
| | | value: 8 |
| | | }, |
| | | { |
| | | label: "二级吊装作业", |
| | | value: 9 |
| | | }, |
| | | { |
| | | label: "三级吊装作业", |
| | | value: 10 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.hoistingToolName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.weightMass": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | |
| | | const toZero = (value: string | number,index: number,name: string,x:number) =>{ |
| | | if(!value){ |
| | | state.materialList[index][name][x].value = 0 |
| | | } |
| | | } |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].postList = [...state.materialList[i].mustList,...state.materialList[i].unList] |
| | | state.form.wmAddReqDTOList = [...state.form.wmAddReqDTOList,...state.materialList[i].postList] |
| | | } |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | data.workDetail.weightMass = Number(data.workDetail.weightMass) |
| | | const res = await workApplyApi().postHoistApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.materialList = [] |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 确认物资标准 |
| | | const getMaList = async() =>{ |
| | | if(state.materialList.length == 0){ |
| | | const data = {workType: 3,workLevel: state.form.workLevel} |
| | | const res = await workApplyApi().getMaterial(data) |
| | | if (res.data.code === '200') { |
| | | if(res.data.data.materialTypeList && res.data.data.materialTypeList!=null&&res.data.data.materialTypeList.length>0){ |
| | | state.materialList = JSON.parse(JSON.stringify(res.data.data.materialTypeList)) |
| | | for(let i in state.materialList){ |
| | | state.materialList[i].mustList = [] |
| | | state.materialList[i].unList = [] |
| | | state.materialList[i].mdList = state.materialList[i].mdList?.map((item:any) => { |
| | | if(item.configurationLevel == 0){ |
| | | state.materialList[i].mustList.push(item) |
| | | return |
| | | }else{ |
| | | state.materialList[i].unList.push(item) |
| | | return |
| | | } |
| | | }) |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | } |
| | | state.equipmentDialog = true |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '暂时查询不到物资标准信息' |
| | | }); |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }else{ |
| | | state.materialList = state.materialList |
| | | state.equipmentDialog = true |
| | | } |
| | | } |
| | | const conFirmDevices = ()=>{ |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | |
| | | } |
| | | ElMessageBox.confirm('是否确认物资及数量配置?') |
| | | .then(() => { |
| | | state.equipmentDialog = false |
| | | }) |
| | | .catch(() => { |
| | | // catch error |
| | | }) |
| | | } |
| | | |
| | | const closeMaterial = ()=>{ |
| | | |
| | | } |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | toZero, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding-top: 15px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
文件名从 src/views/specialWorkSystem/workTicket/workApply/components/plate.vue 修改 |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="选择关联物资"> |
| | | <el-button type="primary" @click="getMaList">选择物资标准</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <el-dialog v-model="equipmentDialog" title="关联物资标准" width="40%" center @close="closeMaterial"> |
| | | <el-tabs tab-position="left" class="demo-tabs" type="border-card"> |
| | | <el-tab-pane v-for="(item,index) in materialList" :label="item.materialTypeName" :key="index"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-form label-width="150px" label-position="top"> |
| | | <div v-if="item.mustList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">必选</div> |
| | | <el-form-item v-if="item.mustList.length>0" class="tab-i" v-for="(i,x) in item.mustList" :key="x" :label="item.mustList[x].materialName + ':'" prop="defaultVal" :rules="[{ type: 'defaultVal', required: true, message: '该内容不能为空', trigger: 'blur'}]"> |
| | | <el-input size="default" type="number" v-model="item.mustList[x].value" @change="(val)=>toZero(val,index,'mustList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.mustList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <div v-if="item.unList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">其他</div> |
| | | <el-form-item v-if="item.unList.length>0" class="tab-i" v-for="(i,x) in item.unList" :key="x" :label="item.unList[x].materialName + ':'"> |
| | | <el-input size="default" type="number" v-model="item.unList[x].value" @change="(val)=>toZero(val,index,'unList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.unList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="equipmentDialog = false" size="default">取消</el-button> |
| | | <el-button type="primary" @click="conFirmDevices" size="default">确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | |
| | | dialogVisible: Boolean, |
| | | dialogImageUrl: string | null, |
| | | imgLimit: number, |
| | | isOverSize: boolean |
| | | isOverSize: boolean, |
| | | equipmentDialog: boolean, |
| | | materialList: Array<any> |
| | | } |
| | | interface file { |
| | | url: string; |
| | | } |
| | | export default defineComponent({ |
| | | name: 'brokenForm', |
| | | name: 'plateForm', |
| | | components: {}, |
| | | props:['workerList'], |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | materialList: [], |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 8, |
| | |
| | | uninstallBpTime: '', |
| | | otherSpecialWork: [] |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | |
| | | "workDetail.bpLocation": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bpLocationMapPath": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | |
| | | const toZero = (value: string | number,index: number,name: string,x:number) =>{ |
| | | if(!value){ |
| | | state.materialList[index][name][x].value = 0 |
| | | } |
| | | } |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].postList = [...state.materialList[i].mustList,...state.materialList[i].unList] |
| | | state.form.wmAddReqDTOList = [...state.form.wmAddReqDTOList,...state.materialList[i].postList] |
| | | } |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | state.form.workDetail.installBpTime = JSON.parse(JSON.stringify(state.form.workDetail.installLine))[0] |
| | |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.materialList = [] |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | // 确认物资标准 |
| | | const getMaList = async() =>{ |
| | | if(state.materialList.length == 0){ |
| | | const data = {workType: 8,workLevel: state.form.workLevel} |
| | | const res = await workApplyApi().getMaterial(data) |
| | | if (res.data.code === '200') { |
| | | if(res.data.data.materialTypeList && res.data.data.materialTypeList!=null&&res.data.data.materialTypeList.length>0){ |
| | | state.materialList = JSON.parse(JSON.stringify(res.data.data.materialTypeList)) |
| | | for(let i in state.materialList){ |
| | | state.materialList[i].mustList = [] |
| | | state.materialList[i].unList = [] |
| | | state.materialList[i].mdList = state.materialList[i].mdList?.map((item:any) => { |
| | | if(item.configurationLevel == 0){ |
| | | state.materialList[i].mustList.push(item) |
| | | return |
| | | }else{ |
| | | state.materialList[i].unList.push(item) |
| | | return |
| | | } |
| | | }) |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | } |
| | | state.equipmentDialog = true |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '暂时查询不到物资标准信息' |
| | | }); |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }else{ |
| | | state.materialList = state.materialList |
| | | state.equipmentDialog = true |
| | | } |
| | | } |
| | | const conFirmDevices = ()=>{ |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | |
| | | } |
| | | ElMessageBox.confirm('是否确认物资及数量配置?') |
| | | .then(() => { |
| | | state.equipmentDialog = false |
| | | }) |
| | | .catch(() => { |
| | | // catch error |
| | | }) |
| | | } |
| | | |
| | | const closeMaterial = ()=>{ |
| | | |
| | | } |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | toZero, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | handlePreview, |
| | | getUploadUrl, |
| | | beforeRemove, |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="危害辨识" prop="hazardIdentification"> |
| | | <el-input |
| | | v-model="form.hazardIdentification" |
| | | placeholder="请输入危害辨识" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-divider border-style="dashed"/> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="电源接入点" prop="workDetail.powerAccessPoint"> |
| | | <el-input |
| | | v-model="form.workDetail.powerAccessPoint" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工作电压" prop="workDetail.workingVoltage"> |
| | | <el-input |
| | | v-model="form.workDetail.workingVoltage" |
| | | type="number" |
| | | placeholder="请输入" |
| | | > |
| | | <template #append>伏特(v)</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用电设备及功率" prop="workDetail.equipmentAndPower"> |
| | | <el-input |
| | | v-model="form.workDetail.equipmentAndPower" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="选择关联物资"> |
| | | <el-button type="primary" @click="getMaList">选择物资标准</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <el-dialog v-model="equipmentDialog" title="关联物资标准" width="40%" center @close="closeMaterial"> |
| | | <el-tabs tab-position="left" class="demo-tabs" type="border-card"> |
| | | <el-tab-pane v-for="(item,index) in materialList" :label="item.materialTypeName" :key="index"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-form label-width="150px" label-position="top"> |
| | | <div v-if="item.mustList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">必选</div> |
| | | <el-form-item v-if="item.mustList.length>0" class="tab-i" v-for="(i,x) in item.mustList" :key="x" :label="item.mustList[x].materialName + ':'" prop="defaultVal" :rules="[{ type: 'defaultVal', required: true, message: '该内容不能为空', trigger: 'blur'}]"> |
| | | <el-input size="default" type="number" v-model="item.mustList[x].value" @change="(val)=>toZero(val,index,'mustList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.mustList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <div v-if="item.unList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">其他</div> |
| | | <el-form-item v-if="item.unList.length>0" class="tab-i" v-for="(i,x) in item.unList" :key="x" :label="item.unList[x].materialName + ':'"> |
| | | <el-input size="default" type="number" v-model="item.unList[x].value" @change="(val)=>toZero(val,index,'unList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.unList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="equipmentDialog = false" size="default">取消</el-button> |
| | | <el-button type="primary" @click="conFirmDevices" size="default">确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workLevelList: Array<any>, |
| | | equipmentDialog: boolean, |
| | | materialList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'powerForm', |
| | | components: {}, |
| | | props:['workerList'], |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | materialList: [], |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 7, |
| | | workLevel: 0, |
| | | workContent: '', |
| | | workLocation: '', |
| | | hazardIdentification: '', |
| | | workDetail:{ |
| | | powerAccessPoint: '', |
| | | workingVoltage: null, |
| | | equipmentAndPower: '' |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workLevelList: [ |
| | | { |
| | | label: "一级吊装作业", |
| | | value: 8 |
| | | }, |
| | | { |
| | | label: "二级吊装作业", |
| | | value: 9 |
| | | }, |
| | | { |
| | | label: "三级吊装作业", |
| | | value: 10 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.powerAccessPoint": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.workingVoltage": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.equipmentAndPower": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | |
| | | const toZero = (value: string | number,index: number,name: string,x:number) =>{ |
| | | if(!value){ |
| | | state.materialList[index][name][x].value = 0 |
| | | } |
| | | } |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].postList = [...state.materialList[i].mustList,...state.materialList[i].unList] |
| | | state.form.wmAddReqDTOList = [...state.form.wmAddReqDTOList,...state.materialList[i].postList] |
| | | } |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | // data.workDetail.weightMass = Number(data.workDetail.weightMass) |
| | | const res = await workApplyApi().postPowerApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.materialList = [] |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | // 确认物资标准 |
| | | const getMaList = async() =>{ |
| | | if(state.materialList.length == 0){ |
| | | const data = {workType: 7,workLevel: null} |
| | | const res = await workApplyApi().getMaterial(data) |
| | | if (res.data.code === '200') { |
| | | if(res.data.data.materialTypeList && res.data.data.materialTypeList!=null&&res.data.data.materialTypeList.length>0){ |
| | | state.materialList = JSON.parse(JSON.stringify(res.data.data.materialTypeList)) |
| | | for(let i in state.materialList){ |
| | | state.materialList[i].mustList = [] |
| | | state.materialList[i].unList = [] |
| | | state.materialList[i].mdList = state.materialList[i].mdList?.map((item:any) => { |
| | | if(item.configurationLevel == 0){ |
| | | state.materialList[i].mustList.push(item) |
| | | return |
| | | }else{ |
| | | state.materialList[i].unList.push(item) |
| | | return |
| | | } |
| | | }) |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | } |
| | | state.equipmentDialog = true |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '暂时查询不到物资标准信息' |
| | | }); |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }else{ |
| | | state.materialList = state.materialList |
| | | state.equipmentDialog = true |
| | | } |
| | | } |
| | | const conFirmDevices = ()=>{ |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | |
| | | } |
| | | ElMessageBox.confirm('是否确认物资及数量配置?') |
| | | .then(() => { |
| | | state.equipmentDialog = false |
| | | }) |
| | | .catch(() => { |
| | | // catch error |
| | | }) |
| | | } |
| | | |
| | | const closeMaterial = ()=>{ |
| | | |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | toZero, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding-top: 15px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="危害辨识" prop="hazardIdentification"> |
| | | <el-input |
| | | v-model="form.hazardIdentification" |
| | | placeholder="请输入危害辨识" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-divider border-style="dashed" /> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="受限空间所属单位" prop="workDetail.csDepId"> |
| | | <!-- <el-select v-model="form.workDetail.csDepId">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in csDepList"--> |
| | | <!-- :key="item.value"--> |
| | | <!-- :label="item.label"--> |
| | | <!-- :value="item.value"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader v-model="form.workDetail.csDepId" :options="departList" :props="casProps" :show-all-levels="false" @change="handleChange" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="受限空间名称" prop="workDetail.csName"> |
| | | <el-input |
| | | v-model="form.workDetail.csName" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="空间内原有介质" prop="workDetail.csOriginalName"> |
| | | <el-input |
| | | v-model="form.workDetail.csOriginalName" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联作业" prop="workDetail.otherSpecialWork"> |
| | | <el-select v-model="form.workDetail.otherSpecialWork" multiple> |
| | | <el-option v-for="item in otherWorkList" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="选择关联物资"> |
| | | <el-button type="primary" @click="getMaList">选择物资标准</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <el-dialog v-model="equipmentDialog" title="关联物资标准" width="40%" center @close="closeMaterial"> |
| | | <el-tabs tab-position="left" class="demo-tabs" type="border-card"> |
| | | <el-tab-pane v-for="(item,index) in materialList" :label="item.materialTypeName" :key="index"> |
| | | <div style="margin-bottom: 20px"> |
| | | <el-form label-width="150px" label-position="top"> |
| | | <div v-if="item.mustList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">必选</div> |
| | | <el-form-item v-if="item.mustList.length>0" class="tab-i" v-for="(i,x) in item.mustList" :key="x" :label="item.mustList[x].materialName + ':'" prop="defaultVal" :rules="[{ type: 'defaultVal', required: true, message: '该内容不能为空', trigger: 'blur'}]"> |
| | | <el-input size="default" type="number" v-model="item.mustList[x].value" @change="(val)=>toZero(val,index,'mustList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.mustList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <div v-if="item.unList.length>0" style="width: 100%;border-bottom: 1px solid #ccc;padding-bottom: 6px;margin-bottom: 10px;font-weight: bolder">其他</div> |
| | | <el-form-item v-if="item.unList.length>0" class="tab-i" v-for="(i,x) in item.unList" :key="x" :label="item.unList[x].materialName + ':'"> |
| | | <el-input size="default" type="number" v-model="item.unList[x].value" @change="(val)=>toZero(val,index,'unList',x)" placeholder="请输入配置数量,空值默认为0"> |
| | | <template #append>{{'库存:' + item.unList[x].stock}}</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="equipmentDialog = false" size="default">取消</el-button> |
| | | <el-button type="primary" @click="conFirmDevices" size="default">确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | csDepList: Array<any>, |
| | | otherWorkList: Array<any>, |
| | | casProps: {}, |
| | | equipmentDialog: boolean, |
| | | materialList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'spaceForm', |
| | | components: {}, |
| | | props:['workerList','departList'], |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | materialList: [], |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 2, |
| | | workLevel: 0, |
| | | workContent: '', |
| | | workLocation: '', |
| | | hazardIdentification: '', |
| | | workDetail:{ |
| | | csDepId: null, |
| | | csName: '', |
| | | csOriginalName: '', |
| | | otherSpecialWork: [] |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | csDepList: [ |
| | | { |
| | | label: "单位一", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "单位二", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "单位三", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "单位四", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "单位五", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "单位六", |
| | | value: 6 |
| | | } |
| | | ], |
| | | casProps: { |
| | | emitPath: false, |
| | | value: 'depId', |
| | | label: 'depName', |
| | | multiple: false, |
| | | expandTrigger: 'hover', |
| | | checkStrictly: true |
| | | }, |
| | | otherWorkList: [ |
| | | { |
| | | label: '动火作业', |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: '受限空间作业', |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: '吊装作业', |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: '动土作业', |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: '断路作业', |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: '高处作业', |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: '临时用电作业', |
| | | value: 7 |
| | | }, |
| | | { |
| | | label: '盲板抽堵作业', |
| | | value: 8 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.csDepId": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.csName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.csOriginalName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | |
| | | const toZero = (value: string | number,index: number,name: string,x:number) =>{ |
| | | if(!value){ |
| | | state.materialList[index][name][x].value = 0 |
| | | } |
| | | } |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | defaultVal: item.value, |
| | | id: item.id |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].postList = [...state.materialList[i].mustList,...state.materialList[i].unList] |
| | | state.form.wmAddReqDTOList = [...state.form.wmAddReqDTOList,...state.materialList[i].postList] |
| | | } |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | data.workDetail.otherSpecialWork = data.workDetail.otherSpecialWork.join(',') |
| | | console.log(data,'data') |
| | | const res = await workApplyApi().postSpaceApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | state.materialList = [] |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 确认物资标准 |
| | | const getMaList = async() =>{ |
| | | if(state.materialList.length == 0){ |
| | | const data = {workType: 2,workLevel: null} |
| | | const res = await workApplyApi().getMaterial(data) |
| | | if (res.data.code === '200') { |
| | | if(res.data.data.materialTypeList && res.data.data.materialTypeList!=null&&res.data.data.materialTypeList.length>0){ |
| | | state.materialList = JSON.parse(JSON.stringify(res.data.data.materialTypeList)) |
| | | for(let i in state.materialList){ |
| | | state.materialList[i].mustList = [] |
| | | state.materialList[i].unList = [] |
| | | state.materialList[i].mdList = state.materialList[i].mdList?.map((item:any) => { |
| | | if(item.configurationLevel == 0){ |
| | | state.materialList[i].mustList.push(item) |
| | | return |
| | | }else{ |
| | | state.materialList[i].unList.push(item) |
| | | return |
| | | } |
| | | }) |
| | | state.materialList[i].mustList = state.materialList[i].mustList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | state.materialList[i].unList = state.materialList[i].unList.map((item:any)=>{ |
| | | const obj = { |
| | | value: item.defaultVal, |
| | | materialName: item.materialName, |
| | | configurationLevel: item.configurationLevel, |
| | | id: item.id, |
| | | stock: item.stock |
| | | } |
| | | return {...obj} |
| | | }) |
| | | } |
| | | state.equipmentDialog = true |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '暂时查询不到物资标准信息' |
| | | }); |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }else{ |
| | | state.materialList = state.materialList |
| | | state.equipmentDialog = true |
| | | } |
| | | } |
| | | const conFirmDevices = ()=>{ |
| | | for(let i in state.materialList){ |
| | | for(let j in state.materialList[i].mustList){ |
| | | if(state.materialList[i].mustList[j].value>state.materialList[i].mustList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | for(let j in state.materialList[i].unList){ |
| | | if(state.materialList[i].unList[j].value>state.materialList[i].unList[j].stock){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '部分物资库存不足,请重新配置数量。' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | |
| | | } |
| | | ElMessageBox.confirm('是否确认物资及数量配置?') |
| | | .then(() => { |
| | | state.equipmentDialog = false |
| | | }) |
| | | .catch(() => { |
| | | // catch error |
| | | }) |
| | | } |
| | | |
| | | const closeMaterial = ()=>{ |
| | | |
| | | } |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | toZero, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding-top: 15px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | :deep(.el-cascader){ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
文件名从 src/views/specialWorkSystem/workTicket/workApply/index.vue 修改 |
| | |
| | | departmentList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'workTicket', |
| | | name: 'apply', |
| | | components: { |
| | | fireForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/workApply/components/fire.vue')), |
| | | spaceForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/workApply/components/space.vue')), |
| | | hoistForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/workApply/components/hoist.vue')), |
| | | groundForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/workApply/components/ground.vue')), |
| | | brokenForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/workApply/components/broken.vue')), |
| | | heightForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/workApply/components/height.vue')), |
| | | powerForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/workApply/components/power.vue')), |
| | | plateForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/workApply/components/plate.vue')) |
| | | fireForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/apply/components/fire.vue')), |
| | | spaceForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/apply/components/space.vue')), |
| | | hoistForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/apply/components/hoist.vue')), |
| | | groundForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/apply/components/ground.vue')), |
| | | brokenForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/apply/components/broken.vue')), |
| | | heightForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/apply/components/height.vue')), |
| | | powerForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/apply/components/power.vue')), |
| | | plateForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/apply/components/plate.vue')) |
| | | }, |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | |
| | | <div class="stepCard"> |
| | | <el-card class="box-card" shadow="always"> |
| | | <div class="text"> |
| | | 审批结果:<span>{{ item.approvalResultDesc }}</span> |
| | | 审批结果:<span class="bold-text">{{ item.approvalResultDesc }}</span> |
| | | </div> |
| | | <div class="text"> |
| | | 审批层级:<span>{{ item.typeDesc }}</span> |
| | | 审批层级:<span class="bold-text">{{ item.typeDesc }}</span> |
| | | </div> |
| | | <div class="text" v-if="item.auditTypeDesc"> |
| | | 审批类型:<span>{{ item.auditTypeDesc }}</span> |
| | | 审批类型:<span class="bold-text">{{ item.auditTypeDesc }}</span> |
| | | </div> |
| | | <div class="text" v-show="item.startApprovalTime != null"> |
| | | 开始时间:<span>{{ item.startApprovalTime }}</span> |
| | |
| | | // 填写表单 |
| | | const toApply = () => { |
| | | router.push({ |
| | | path: 'workApply' |
| | | path: 'apply' |
| | | }); |
| | | }; |
| | | |
| | |
| | | padding-left: 10px; |
| | | |
| | | span { |
| | | font-weight: bolder; |
| | | color: #409eff; |
| | | } |
| | | |
| | | .bold-text{ |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | &:last-of-type { |
| | | margin-bottom: 0; |
| | | } |
| | |
| | | <el-form-item label="图片"> |
| | | <el-image v-for="item in details.workDetail.bcPath" :preview-src-list="details.workDetail.bcPath" style="width: 150px; height: 150px;margin-right: 50px;margin-bottom: 20px" :src="item" fit="cover" /> |
| | | </el-form-item> |
| | | <el-form-item label="关联物资"> |
| | | <el-table :data="details.workMaterial" style="width: 100%" border> |
| | | <el-table-column prop="materialTypeName" label="物资类型" align="center"/> |
| | | <el-table-column prop="materialName" label="物资名称" align="center"/> |
| | | <el-table-column prop="consumables" label="是否耗材" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.consumables?'耗材':'非耗材'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="defaultVal" label="配置数量" align="center"/> |
| | | </el-table> |
| | | </el-form-item> |
| | | <el-form-item label="期望开始时间"> |
| | | <el-input v-model="details.expStartTime" readonly /> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="作业方式"> |
| | | <el-input v-model="details.workDetail.hotMethod" readonly type="textarea" /> |
| | | </el-form-item> |
| | | <el-form-item label="关联物资"> |
| | | <el-table :data="details.workMaterial" style="width: 100%" border> |
| | | <el-table-column prop="materialTypeName" label="物资类型" align="center"/> |
| | | <el-table-column prop="materialName" label="物资名称" align="center"/> |
| | | <el-table-column prop="consumables" label="是否耗材" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.consumables?'耗材':'非耗材'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="defaultVal" label="配置数量" align="center"/> |
| | | </el-table> |
| | | </el-form-item> |
| | | <el-form-item label="关联其他作业"> |
| | | <el-input v-model="details.workDetail.otherSpecialWork" readonly type="textarea" /> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="动土方式"> |
| | | <el-input v-model="details.workDetail.gbMethod" readonly type="textarea" /> |
| | | </el-form-item> |
| | | <el-form-item label="关联物资"> |
| | | <el-table :data="details.workMaterial" style="width: 100%" border> |
| | | <el-table-column prop="materialTypeName" label="物资类型" align="center"/> |
| | | <el-table-column prop="materialName" label="物资名称" align="center"/> |
| | | <el-table-column prop="consumables" label="是否耗材" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.consumables?'耗材':'非耗材'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="defaultVal" label="配置数量" align="center"/> |
| | | </el-table> |
| | | </el-form-item> |
| | | <el-form-item label="关联其他作业"> |
| | | <el-input v-model="details.workDetail.otherSpecialWork" readonly type="textarea"/> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="作业高度"> |
| | | <el-input v-model="details.workDetail.operationHeight" readonly type="textarea"><template #append>米(m)</template></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="关联物资"> |
| | | <el-table :data="details.workMaterial" style="width: 100%" border> |
| | | <el-table-column prop="materialTypeName" label="物资类型" align="center"/> |
| | | <el-table-column prop="materialName" label="物资名称" align="center"/> |
| | | <el-table-column prop="consumables" label="是否耗材" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.consumables?'耗材':'非耗材'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="defaultVal" label="配置数量" align="center"/> |
| | | </el-table> |
| | | </el-form-item> |
| | | <el-form-item label="关联其他作业"> |
| | | <el-input v-model="details.workDetail.otherSpecialWork" readonly type="textarea"/> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="起吊物体重量"> |
| | | <el-input v-model="details.workDetail.weightMass" readonly type="textarea"><template #append>吨(t)</template></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="关联物资"> |
| | | <el-table :data="details.workMaterial" style="width: 100%" border> |
| | | <el-table-column prop="materialTypeName" label="物资类型" align="center"/> |
| | | <el-table-column prop="materialName" label="物资名称" align="center"/> |
| | | <el-table-column prop="consumables" label="是否耗材" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.consumables?'耗材':'非耗材'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="defaultVal" label="配置数量" align="center"/> |
| | | </el-table> |
| | | </el-form-item> |
| | | <el-form-item label="关联其他作业"> |
| | | <el-input v-model="details.workDetail.otherSpecialWork" readonly type="textarea"/> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="拆盲板时间"> |
| | | <el-input v-model="details.workDetail.uninstallBpTime" readonly/> |
| | | </el-form-item> |
| | | <el-form-item label="关联物资"> |
| | | <el-table :data="details.workMaterial" style="width: 100%" border> |
| | | <el-table-column prop="materialTypeName" label="物资类型" align="center"/> |
| | | <el-table-column prop="materialName" label="物资名称" align="center"/> |
| | | <el-table-column prop="consumables" label="是否耗材" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.consumables?'耗材':'非耗材'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="defaultVal" label="配置数量" align="center"/> |
| | | </el-table> |
| | | </el-form-item> |
| | | <el-form-item label="关联其他作业"> |
| | | <el-input v-model="details.workDetail.otherSpecialWork" readonly type="textarea"/> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="用电设备及功率"> |
| | | <el-input v-model="details.workDetail.equipmentAndPower" readonly type="textarea" /> |
| | | </el-form-item> |
| | | <el-form-item label="关联物资"> |
| | | <el-table :data="details.workMaterial" style="width: 100%" border> |
| | | <el-table-column prop="materialTypeName" label="物资类型" align="center"/> |
| | | <el-table-column prop="materialName" label="物资名称" align="center"/> |
| | | <el-table-column prop="consumables" label="是否耗材" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.consumables?'耗材':'非耗材'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="defaultVal" label="配置数量" align="center"/> |
| | | </el-table> |
| | | </el-form-item> |
| | | <el-form-item label="关联其他作业"> |
| | | <el-input v-model="details.workDetail.otherSpecialWork" readonly type="textarea"/> |
| | | </el-form-item> |
| | |
| | | <el-input v-model="details.workContent" readonly type="textarea" /> |
| | | </el-form-item> |
| | | <el-form-item label="作业地址"> |
| | | <el-input v-model="details.workLocation" readonly type="textarea" /> |
| | | <el-input v-model="details.workLocation" readonly type="textarea"/> |
| | | </el-form-item> |
| | | <el-form-item label="受限空间所属单位"> |
| | | <el-input v-model="details.workDetail.csDepId" readonly type="textarea" /> |
| | |
| | | <el-form-item label="空间原有介质名称"> |
| | | <el-input v-model="details.workDetail.csOriginalName" readonly type="textarea" /> |
| | | </el-form-item> |
| | | <el-form-item label="关联物资"> |
| | | <el-table :data="details.workMaterial" style="width: 100%" border> |
| | | <el-table-column prop="materialTypeName" label="物资类型" align="center"/> |
| | | <el-table-column prop="materialName" label="物资名称" align="center"/> |
| | | <el-table-column prop="consumables" label="是否耗材" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.consumables?'耗材':'非耗材'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="defaultVal" label="配置数量" align="center"/> |
| | | </el-table> |
| | | </el-form-item> |
| | | <el-form-item label="关联其他作业"> |
| | | <el-input v-model="details.workDetail.otherSpecialWork" readonly type="textarea" /> |
| | | </el-form-item> |
| | |
| | | <el-tag :type="scope.row.status==2?'success':(scope.row.status==8||scope.row.status==9)?'warning':'danger'">{{ scope.row.statusDesc }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" align="center" width="250"> |
| | | <el-table-column fixed="right" label="操作" align="center" width="300"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button> |
| | | <el-button link type="success" size="small" :icon="Finished" @click="viewStatus(scope.row)">进度</el-button> |
| | | <el-button link type="warning" size="small" :icon="Delete" @click="deleteRecordBtn(scope.row)">取消</el-button> |
| | | <el-button link type="primary" size="small" :icon="Download" @click="downLoadBtn(scope.row)">导出</el-button> |
| | | <el-button :disabled="scope.row.status == 7 ? false : true" link type="primary" size="small" :icon="Download" @click="downLoadBtn(scope.row)">导出作业票</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <div class="stepCard"> |
| | | <el-card class="box-card" shadow="always"> |
| | | <div class="text"> |
| | | 审批结果:<span>{{ item.approvalResultDesc }}</span> |
| | | 审批结果:<span class="bold-text">{{ item.approvalResultDesc }}</span> |
| | | </div> |
| | | <div class="text"> |
| | | 审批类型:<span>{{ item.typeDesc }}</span> |
| | | 审批类型:<span class="bold-text">{{ item.typeDesc }}</span> |
| | | </div> |
| | | <div class="text" v-if="item.auditTypeDesc"> |
| | | 审批类型:<span>{{ item.auditTypeDesc }}</span> |
| | | 审批类型:<span class="bold-text">{{ item.auditTypeDesc }}</span> |
| | | </div> |
| | | <div class="text" v-show="item.startApprovalTime != null"> |
| | | 开始时间:<span>{{ item.startApprovalTime }}</span> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="text" v-show="item.expFinishApprovalTime != null"> |
| | | <div class="text" v-show="item.expFinishApprovalTime && item.expFinishApprovalTime != null"> |
| | | 期望结束时间:<span>{{ item.expFinishApprovalTime }}</span> |
| | | </div> |
| | | <div class="text" v-show="item.finishApprovalTime != null"> |
| | |
| | | // 填写表单 |
| | | const toApply = () => { |
| | | router.push({ |
| | | path: 'workApply' |
| | | path: 'apply' |
| | | }); |
| | | }; |
| | | |
| | |
| | | } |
| | | }; |
| | | |
| | | // 分页获取工作时间组列表 |
| | | // 分页获取 |
| | | const getListByPage = async () => { |
| | | const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: { workType: state.searchWord } }; |
| | | let res = await workApplyApi().getApplyListPage(data); |
| | | if (res.data.code === '200') { |
| | | state.applyData = JSON.parse(JSON.stringify(res.data.data)); |
| | | console.log(state.applyData,'applyData') |
| | | state.applyData = state.applyData.map((item) => { |
| | | if (item.operators == null || item.operators == []) { |
| | | item.operators = []; |
| | |
| | | padding-left: 10px; |
| | | |
| | | span { |
| | | font-weight: bolder; |
| | | color: #409eff; |
| | | } |
| | | |
| | | .bold-text{ |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | &:last-of-type { |
| | | margin-bottom: 0; |
| | | } |