| | |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | // 获取物资配置数据 |
| | | getMaterial: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialWork/material/queryByWorkTypeOrLevel`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | }; |
| | | } |
| | |
| | | <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'; |
| | | import {a} from "pinia-plugin-persistedstate/dist/types-374a3a36"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | 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); |
| | | } |
| | |
| | | </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" 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" 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, |
| | |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | 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)) |
| | |
| | | formEl.resetFields() |
| | | state.form.workDetail.bcPath = [] |
| | | state.fileList = [] |
| | | state.materialList = [] |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | }); |
| | | } |
| | | |
| | | // 确认物资标准 |
| | | 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') { |
| | | 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: 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, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | handlePreview, |
| | | getUploadUrl, |
| | | beforeRemove, |
| | |
| | | </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" 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" 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> |
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | 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 } from 'element-plus' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workTypeList: Array<any>, |
| | | workLevelList: Array<any>, |
| | | otherWorkList: Array<any> |
| | | otherWorkList: Array<any>, |
| | | equipmentDialog: boolean, |
| | | materialList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'fireForm', |
| | |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | materialList: [], |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 1, |
| | |
| | | hotMethod: '', |
| | | otherSpecialWork: [] |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workTypeList: [ |
| | | { |
| | | label: "类型一", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "类型二", |
| | | value: 2 |
| | | } |
| | | ], |
| | | workLevelList: [ |
| | | { |
| | | label: "一级动火作业", |
| | |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.hotMethod": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | |
| | | }); |
| | | |
| | | 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){ |
| | | 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().postFireApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.materialList = [] |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | 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') { |
| | | 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: 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) => { |
| | |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | |
| | | 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> |
| | |
| | | </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" 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" 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, |
| | |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | 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)) |
| | |
| | | formEl.resetFields() |
| | | state.form.workDetail.gbPath = [] |
| | | state.fileList = [] |
| | | state.materialList = [] |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | // 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') { |
| | | 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: 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, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | handlePreview, |
| | | getUploadUrl, |
| | | beforeRemove, |
| | |
| | | </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" 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" 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 {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | 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:{} |
| | | casProps:{}, |
| | | materialList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'heightForm', |
| | |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 6, |
| | |
| | | operationHeight: null, |
| | | otherSpecialWork: [] |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | |
| | | value: 6 |
| | | } |
| | | ], |
| | | materialList: [], |
| | | casProps: { |
| | | emitPath: false, |
| | | value: 'depId', |
| | |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | 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().postHeightApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.materialList = [] |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 确认物资标准 |
| | | 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') { |
| | | 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: 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, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | |
| | | </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" 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" 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 {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | 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> |
| | | workLevelList: Array<any>, |
| | | materialList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'hoistForm', |
| | |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 3, |
| | |
| | | hoistingToolName: '', |
| | | weightMass: null |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | materialList: [], |
| | | workLevelList: [ |
| | | { |
| | | label: "一级吊装作业", |
| | |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | 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: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.materialList = [] |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 确认物资标准 |
| | | 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') { |
| | | 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: 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, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | |
| | | </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" 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" 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: '' |
| | |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | 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] |
| | |
| | | formEl.resetFields() |
| | | state.form.workDetail.bpLocationMapPath = [] |
| | | state.fileList = [] |
| | | state.materialList = [] |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | }); |
| | | } |
| | | |
| | | // 确认物资标准 |
| | | 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') { |
| | | 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: 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, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | handlePreview, |
| | | getUploadUrl, |
| | | beforeRemove, |
| | |
| | | /> |
| | | </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" 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" 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 {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | 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> |
| | | workLevelList: Array<any>, |
| | | equipmentDialog: boolean, |
| | | materialList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'hoistForm', |
| | | name: 'powerForm', |
| | | components: {}, |
| | | props:['workerList'], |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | materialList: [], |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 7, |
| | |
| | | workingVoltage: null, |
| | | equipmentAndPower: '' |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | 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: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.materialList = [] |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | 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') { |
| | | 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: 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) => { |
| | |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | |
| | | </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" 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" 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 {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | |
| | | form: Object, |
| | | csDepList: Array<any>, |
| | | otherWorkList: Array<any>, |
| | | casProps: {} |
| | | casProps: {}, |
| | | equipmentDialog: boolean, |
| | | materialList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'spaceForm', |
| | |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | equipmentDialog: false, |
| | | materialList: [], |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 2, |
| | |
| | | csOriginalName: '', |
| | | otherSpecialWork: [] |
| | | }, |
| | | wmAddReqDTOList: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | for(let i in state.materialList){ |
| | | 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: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.materialList = [] |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 确认物资标准 |
| | | 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') { |
| | | 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: 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, |
| | | getMaList, |
| | | conFirmDevices, |
| | | closeMaterial, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |