Your Name
2022-10-13 902a537974ce0374d68d9e717febab7157a69286
冲突
已重命名17个文件
已修改17个文件
已添加5个文件
已删除13个文件
5721 ■■■■■ 文件已修改
src/api/specialWorkSystem/workApply/index.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/route.ts 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/contingencyManagement/emergencyResources/maintenanceOfEmergencyMaterials/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/newHome/index.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/alarm/alerts/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/flow/basicApprove/components/approveBasicDialog.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/flow/basicApprove/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/flow/ruleofApp/components/approveItemDialog.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/flow/ruleofApp/components/approveLevelDialog.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/flow/ruleofApp/components/approveRuleDialog.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/flow/ruleofApp/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/foundationSet/material/index.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/foundationSet/safetyAction/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/plan/appoint/index.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/plan/reservation/index.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/plan/sumReserve/index.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/process/analysis/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/process/components/dialogPermitNo.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/process/gasCheck/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/allApplys/components/brokenLog.vue 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/allApplys/components/fireLog.vue 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/allApplys/components/groundLog.vue 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/allApplys/components/heightLog.vue 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/allApplys/components/hoistLog.vue 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/allApplys/components/plateLog.vue 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/allApplys/components/powerLog.vue 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/allApplys/components/spaceLog.vue 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/allApplys/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/apply/components/broken.vue 184 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/apply/components/fire.vue 502 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/apply/components/ground.vue 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/apply/components/height.vue 547 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/apply/components/hoist.vue 445 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/apply/components/plate.vue 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/apply/components/power.vue 443 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/apply/components/space.vue 513 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/apply/index.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/myApproval/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/myJobApply/components/brokenLog.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/myJobApply/components/fireLog.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/myJobApply/components/groundLog.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/myJobApply/components/heightLog.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/myJobApply/components/hoistLog.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/myJobApply/components/plateLog.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/myJobApply/components/powerLog.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/myJobApply/components/spaceLog.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/myJobApply/index.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/workApply/components/fire.vue 309 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/workApply/components/height.vue 367 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/workApply/components/hoist.vue 262 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/workApply/components/power.vue 264 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/specialWorkSystem/workTicket/workApply/components/space.vue 330 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/specialWorkSystem/workApply/index.ts
@@ -158,6 +158,15 @@
                method: 'post',
                data: data
            });
        },
        // 获取物资配置数据
        getMaterial: (data: object) => {
            return request({
                url: import.meta.env.VITE_API_URL + `/specialWork/material/queryByWorkTypeOrLevel`,
                method: 'post',
                data: data
            });
        }
    };
}
src/router/route.ts
@@ -89,35 +89,11 @@
        }
    },
    {
        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: '作业物资'
        }
    }
];
src/views/contingencyManagement/emergencyResources/maintenanceOfEmergencyMaterials/index.vue
@@ -95,7 +95,7 @@
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';
src/views/newHome/index.vue
@@ -327,10 +327,10 @@
        };
        // 去风险大屏
        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;
@@ -431,6 +431,20 @@
        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) {
@@ -895,11 +909,18 @@
                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/alarm/alerts/index.vue
文件名从 src/views/specialWorkSystem/workAlert/alertRecord/index.vue 修改
@@ -155,7 +155,7 @@
    }
    export default {
        name: 'alertRecord',
        name: 'alerts',
        components: {},
        setup() {
            const userInfo = useUserInfo();
src/views/specialWorkSystem/flow/basicApprove/components/approveBasicDialog.vue
src/views/specialWorkSystem/flow/basicApprove/index.vue
文件名从 src/views/specialWorkSystem/workFlow/approveBasic/index.vue 修改
@@ -61,7 +61,7 @@
                        <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>
@@ -85,7 +85,7 @@
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/flow/ruleofApp/components/approveItemDialog.vue
src/views/specialWorkSystem/flow/ruleofApp/components/approveLevelDialog.vue
文件名从 src/views/specialWorkSystem/workFlow/approveRule/components/approveLevelDialog.vue 修改
@@ -97,7 +97,7 @@
<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/flow/ruleofApp/components/approveRuleDialog.vue
文件名从 src/views/specialWorkSystem/workFlow/approveRule/components/approveRuleDialog.vue 修改
@@ -110,7 +110,7 @@
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/flow/ruleofApp/index.vue
文件名从 src/views/specialWorkSystem/workFlow/approveRule/index.vue 修改
@@ -79,7 +79,7 @@
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';
src/views/specialWorkSystem/foundationSet/material/index.vue
@@ -230,7 +230,6 @@
                            <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"/>
@@ -238,6 +237,7 @@
                                        <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>
@@ -248,6 +248,7 @@
                            </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"/>
@@ -292,7 +293,6 @@
import type { FormInstance, FormRules } from 'element-plus'
import { teamManageApi } from '/@/api/systemManage/basicDateManage/personShiftManage/teamManage';
import { materialApi } from '/@/api/specialWorkSystem/material';
// 定义接口来定义对象的类型
interface stateType {
@@ -576,7 +576,7 @@
                            checked: false,
                            materialName: item.name,
                            consumables: null,
                            defaultVal: null,
                            defaultVal: 0,
                            configurationLevel: null,
                            materialType: item.materialType,
                            materialTypeName: item.materialTypeName,
@@ -722,20 +722,20 @@
                        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);
                }
src/views/specialWorkSystem/foundationSet/safetyAction/index.vue
@@ -48,7 +48,7 @@
                                </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>
@@ -60,7 +60,7 @@
                        <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/plan/appoint/index.vue
src/views/specialWorkSystem/plan/reservation/index.vue
src/views/specialWorkSystem/plan/sumReserve/index.vue
src/views/specialWorkSystem/process/analysis/index.vue
文件名从 src/views/specialWorkSystem/workProcess/workCheck/index.vue 修改
@@ -212,9 +212,9 @@
        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/process/components/dialogPermitNo.vue
src/views/specialWorkSystem/process/gasCheck/index.vue
文件名从 src/views/specialWorkSystem/workProcess/gasCheck/index.vue 修改
@@ -209,7 +209,7 @@
    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();
src/views/specialWorkSystem/workTicket/allApplys/components/brokenLog.vue
文件已删除
src/views/specialWorkSystem/workTicket/allApplys/components/fireLog.vue
文件已删除
src/views/specialWorkSystem/workTicket/allApplys/components/groundLog.vue
文件已删除
src/views/specialWorkSystem/workTicket/allApplys/components/heightLog.vue
文件已删除
src/views/specialWorkSystem/workTicket/allApplys/components/hoistLog.vue
文件已删除
src/views/specialWorkSystem/workTicket/allApplys/components/plateLog.vue
文件已删除
src/views/specialWorkSystem/workTicket/allApplys/components/powerLog.vue
文件已删除
src/views/specialWorkSystem/workTicket/allApplys/components/spaceLog.vue
文件已删除
src/views/specialWorkSystem/workTicket/allApplys/index.vue
@@ -67,7 +67,7 @@
                                    <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>
@@ -342,7 +342,7 @@
        // 填写表单
        const toApply = () => {
            router.push({
                path: 'workApply'
                path: 'apply'
            });
        };
src/views/specialWorkSystem/workTicket/apply/components/broken.vue
文件名从 src/views/specialWorkSystem/workTicket/workApply/components/broken.vue 修改
@@ -117,8 +117,43 @@
                    </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>
@@ -142,6 +177,7 @@
    import axios from 'axios';
    interface stateType {
        equipmentDialog: boolean,
        form: Object,
        csDepList: Array<any>,
        fileList: Array<file>,
@@ -151,7 +187,8 @@
        imgLimit: number,
        casProps: {},
        casProps2: {},
        isOverSize: boolean
        isOverSize: boolean,
        materialList: Array<any>
    }
    interface file {
        url: string;
@@ -164,6 +201,7 @@
            const userInfo = useUserInfo()
            const { userInfos } = storeToRefs(userInfo);
            const state  = reactive<stateType>({
                equipmentDialog: false,
                form: {
                    operatorUids: [],
                    workType: 5,
@@ -178,10 +216,12 @@
                        bcPath: [],
                        involvedDepIds: []
                    },
                    wmAddReqDTOList: [],
                    workTimeLine: [],
                    expStartTime: '',
                    expEndTime: ''
                },
                materialList: [],
                isOverSize: false,
                fileList: [],
                imgLimit: 3,
@@ -243,10 +283,53 @@
                "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))
@@ -267,6 +350,7 @@
                                message: res.data.msg
                            });
                        }
                        state.materialList = []
                    } else {
                        console.log('error submit!', fields)
                    }
@@ -381,6 +465,100 @@
                });
            }
            // 确认物资标准
            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)
@@ -392,6 +570,10 @@
                Search,
                ruleFormRef,
                applyRules,
                toZero,
                getMaList,
                conFirmDevices,
                closeMaterial,
                handlePreview,
                getUploadUrl,
                beforeRemove,
src/views/specialWorkSystem/workTicket/apply/components/fire.vue
对比新文件
@@ -0,0 +1,502 @@
<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/apply/components/ground.vue
文件名从 src/views/specialWorkSystem/workTicket/workApply/components/ground.vue 修改
@@ -119,8 +119,43 @@
                    </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>
@@ -145,6 +180,7 @@
    interface stateType {
        equipmentDialog: boolean,
        form: Object,
        csDepList: Array<any>,
        otherWorkList: Array<any>,
@@ -154,7 +190,8 @@
        dialogImageUrl: string | null,
        imgLimit: number,
        casProps: {},
        isOverSize: Boolean
        isOverSize: Boolean,
        materialList: Array<any>
    }
    interface file {
        url: string;
@@ -167,6 +204,7 @@
            const userInfo = useUserInfo()
            const { userInfos } = storeToRefs(userInfo);
            const state  = reactive<stateType>({
                equipmentDialog: false,
                form: {
                    operatorUids: [],
                    workType: 4,
@@ -181,12 +219,14 @@
                        gbPath: [],
                        otherSpecialWork: []
                    },
                    wmAddReqDTOList: [],
                    workTimeLine: [],
                    expStartTime: '',
                    expEndTime: ''
                },
                isOverSize: false,
                fileList: [],
                materialList: [],
                imgLimit: 3,
                uploadUrl: '',
                dialogVisible: false,
@@ -273,10 +313,51 @@
                "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))
@@ -297,6 +378,7 @@
                                message: res.data.msg
                            });
                        }
                        state.materialList = []
                    } else {
                        console.log('error submit!', fields)
                    }
@@ -413,6 +495,99 @@
            //     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)
@@ -425,6 +600,10 @@
                Plus,
                ruleFormRef,
                applyRules,
                toZero,
                getMaList,
                conFirmDevices,
                closeMaterial,
                handlePreview,
                getUploadUrl,
                beforeRemove,
src/views/specialWorkSystem/workTicket/apply/components/height.vue
对比新文件
@@ -0,0 +1,547 @@
<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>
src/views/specialWorkSystem/workTicket/apply/components/hoist.vue
对比新文件
@@ -0,0 +1,445 @@
<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/apply/components/plate.vue
文件名从 src/views/specialWorkSystem/workTicket/workApply/components/plate.vue 修改
@@ -194,8 +194,43 @@
                    </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>
@@ -228,19 +263,23 @@
        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,
@@ -262,6 +301,7 @@
                        uninstallBpTime: '',
                        otherSpecialWork: []
                    },
                    wmAddReqDTOList: [],
                    workTimeLine: [],
                    expStartTime: '',
                    expEndTime: ''
@@ -362,10 +402,53 @@
                "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]
@@ -392,6 +475,7 @@
                                message: res.data.msg
                            });
                        }
                        state.materialList = []
                    } else {
                        console.log('error submit!', fields)
                    }
@@ -504,6 +588,100 @@
                });
            }
            // 确认物资标准
            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)
@@ -515,6 +693,10 @@
                Search,
                ruleFormRef,
                applyRules,
                toZero,
                getMaList,
                conFirmDevices,
                closeMaterial,
                handlePreview,
                getUploadUrl,
                beforeRemove,
src/views/specialWorkSystem/workTicket/apply/components/power.vue
对比新文件
@@ -0,0 +1,443 @@
<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>
src/views/specialWorkSystem/workTicket/apply/components/space.vue
对比新文件
@@ -0,0 +1,513 @@
<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/apply/index.vue
文件名从 src/views/specialWorkSystem/workTicket/workApply/index.vue 修改
@@ -46,16 +46,16 @@
        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()
src/views/specialWorkSystem/workTicket/myApproval/index.vue
@@ -85,13 +85,13 @@
                            <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>
@@ -301,7 +301,7 @@
        // 填写表单
        const toApply = () => {
            router.push({
                path: 'workApply'
                path: 'apply'
            });
        };
@@ -638,10 +638,13 @@
                    padding-left: 10px;
                    span {
                        font-weight: bolder;
                        color: #409eff;
                    }
                    .bold-text{
                        font-weight: bolder;
                    }
                    &:last-of-type {
                        margin-bottom: 0;
                    }
src/views/specialWorkSystem/workTicket/myJobApply/components/brokenLog.vue
@@ -40,6 +40,18 @@
            <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>
src/views/specialWorkSystem/workTicket/myJobApply/components/fireLog.vue
@@ -28,6 +28,18 @@
            <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>
src/views/specialWorkSystem/workTicket/myJobApply/components/groundLog.vue
@@ -34,6 +34,18 @@
            <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>
src/views/specialWorkSystem/workTicket/myJobApply/components/heightLog.vue
@@ -31,6 +31,18 @@
            <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>
src/views/specialWorkSystem/workTicket/myJobApply/components/hoistLog.vue
@@ -31,6 +31,18 @@
            <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>
src/views/specialWorkSystem/workTicket/myJobApply/components/plateLog.vue
@@ -52,6 +52,18 @@
            <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>
src/views/specialWorkSystem/workTicket/myJobApply/components/powerLog.vue
@@ -34,6 +34,18 @@
            <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>
src/views/specialWorkSystem/workTicket/myJobApply/components/spaceLog.vue
@@ -23,7 +23,7 @@
                <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" />
@@ -34,6 +34,18 @@
            <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>
src/views/specialWorkSystem/workTicket/myJobApply/index.vue
@@ -44,12 +44,12 @@
                                        <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>
@@ -88,13 +88,13 @@
                            <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>
@@ -133,7 +133,7 @@
                                            </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">
@@ -321,7 +321,7 @@
        // 填写表单
        const toApply = () => {
            router.push({
                path: 'workApply'
                path: 'apply'
            });
        };
@@ -353,12 +353,13 @@
            }
        };
        // 分页获取工作时间组列表
        // 分页获取
        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 = [];
@@ -694,10 +695,13 @@
                    padding-left: 10px;
                    span {
                        font-weight: bolder;
                        color: #409eff;
                    }
                    .bold-text{
                        font-weight: bolder;
                    }
                    &:last-of-type {
                        margin-bottom: 0;
                    }
src/views/specialWorkSystem/workTicket/workApply/components/fire.vue
文件已删除
src/views/specialWorkSystem/workTicket/workApply/components/height.vue
文件已删除
src/views/specialWorkSystem/workTicket/workApply/components/hoist.vue
文件已删除
src/views/specialWorkSystem/workTicket/workApply/components/power.vue
文件已删除
src/views/specialWorkSystem/workTicket/workApply/components/space.vue
文件已删除