2024-09-09 17:40:57 +08:00

1312 lines
54 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<!-- 质量问题库 -->
<div class="qualityProblemBank" :class="{ 'qualityProblemBank2': !dialogFormVisible }">
<vue-scroll v-if="dialogFormVisible" style="height: 100%; width: 100%" class="scroll">
<div class="flex content">
<div class="left">
<div class="btn_wrap_box">
<div class="btn_wrap">
<el-button size="small" @click="setCheckedNodes">{{ $t('message.quality.add')
}}{{ $t('message.quality.unfold') }}</el-button>
<el-button size="small" @click="setCheckedKeys">{{ $t('message.quality.add')
}}{{ $t('message.quality.close') }}</el-button>
</div>
<el-button style="margin-left: 15px" type="primary" size="small" @click.stop="isAddPoint(1)">
添加
</el-button>
</div>
<div style="margin-bottom: 15px; display:flex; align-items: center">
<el-input placeholder="请输入组织名称" prefix-icon="el-icon-search" size="small"
v-model="classificationName" clearable>
</el-input>
</div>
<vue-scroll style="height: 88%; width: 100%; font-size: 14px; background-color: #F7F7F7;">
<el-tree class="filter-tree" :highlight-current="true" :data="listData" :props="defaultProps"
@node-click="getCheckedNode" :default-expand-all="showExpand" :filter-node-method="filterNode"
node-key="id" ref="tree">
<span class="custom-tree-node flex3" slot-scope="{ node, data }">
<span v-if="node.label.length <= 10">{{ node.label }}</span>
<el-tooltip v-else class="item" effect="dark" :content="node.label" placement="top">
<span class="ellipsis">{{ node.label }}</span>
</el-tooltip>
<div class="icon-box">
<!-- <el-button type="text" size="mini" >
新增子级
</el-button>
<el-button type="text" size="mini" >
编辑
</el-button>
<el-button type="text" size="mini" >
删除
</el-button> -->
<i class="el-icon-plus" @click.stop="() => isAddPoint(1, node, data)"></i>
<i class="el-icon-edit" @click.stop="() => isAddPoint(2, node, data)"></i>
<i class="el-icon-delete" @click.stop="() => deleteTreeRow(data)"></i>
</div>
<!-- v-permission="{key: 'criterion_stop_open', menuPath: '/project/quality/criterion'}" -->
</span>
</el-tree>
</vue-scroll>
</div>
<div class="right">
<div class="title">
<div style="line-heihgt: 25px; height: 30px">
{{ checkedNodeData && checkedNodeData.dangerName }}
</div>
<div>
<el-form :inline="true" :model="formInline" class="demo-form-inline" size="small">
<el-form-item label="姓名:">
<el-input :placeholder="
$t('message.quality.pleaseEnter')
" v-model="formInline.workerName" clearable style="width: 200px">
</el-input>
</el-form-item>
<el-form-item label="身份证号:">
<el-input :placeholder="
$t('message.quality.pleaseEnter')
" v-model="formInline.idCard" clearable style="width: 200px">
</el-input>
</el-form-item>
<el-form-item label="党内职务:">
<el-select filterable clearable v-model="formInline.partyPosition"
:placeholder="$t('message.personnelPosition.please_select')">
<el-option :label="item.partyPositionName" :value="item.partyPositionName"
v-for="(item, index) in partyPositionList" :key="index">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item :label="$t('message.quality.displayEnabledOnly') + ''">
<el-select v-model="formInline.recordStatus" :placeholder="$t('message.quality.pleaseSelect')">
<el-option :label="$t('message.quality.no')" :value="0"></el-option>
<el-option :label="$t('message.quality.yes')" :value="1"></el-option>
</el-select>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="onSubmit">{{
$t('message.quality.inquire')
}}</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="isAddPoint(3)">新增</el-button>
</el-form-item>
</el-form>
</div>
</div>
<!-- @cell-click="previewDetail" -->
<el-table :data="tableData" ref="multipleTable" class="tables" max-height="590px">
<el-table-column label="序号" type="index" width="50">
</el-table-column>
<el-table-column align="center" prop="workerName" label="姓名">
<template slot-scope="scope">{{
scope.row.workerName
}}</template>
</el-table-column>
<el-table-column align="center" prop="sex" label="性别">
<template slot-scope="scope">
{{ scope.row.sex == 1 ? '男' : '女' }}
</template>
</el-table-column>
<el-table-column align="center" prop="partyPosition" label="党内职务">
<template slot-scope="scope">{{ scope.row.partyPosition }}</template>
</el-table-column>
<el-table-column align="center" prop="nation" label="民族">
<template slot-scope="scope">{{
scope.row.nation
}}</template>
</el-table-column>
<el-table-column align="center" prop="educationalBackground" label="学历">
<template slot-scope="scope">{{
scope.row.educationalBackground ? primarySchoolList[scope.row.educationalBackground - 1].name : ''
}}</template>
</el-table-column>
<el-table-column align="center" prop="nativePlace" label="籍贯">
<template slot-scope="scope">{{
scope.row.nativePlace
}}</template>
</el-table-column>
<el-table-column align="center" prop="personnelCategory" label="人员类别">
<template slot-scope="scope">{{
scope.row.personnelCategory
}}</template>
</el-table-column>
<el-table-column align="center" prop="idCard" label="身份证号">
<template slot-scope="scope">{{
scope.row.idCard
}}</template>
</el-table-column>
<el-table-column align="center" prop="phoneNumber" label="手机号">
<template slot-scope="scope">{{
scope.row.phoneNumber
}}</template>
</el-table-column>
<!-- <el-table-column align="center" prop="commonDiseasePreventionMethodPicture" label="通病防治做法图片">
<template slot-scope="scope">
<div style="display: flex; align-items: center; justify-content:center">
<el-image style="width: 20px; height: 20px"
:src="require('@/assets/images/image-pre.png')" fit="cover"
:preview-src-list="srcListUp(scope.row.commonDiseasePreventionMethodPicture)"></el-image>
{{ scope.row.commonDiseasePreventionMethodPicture.length }}
</div>
</template>
</el-table-column> -->
<!-- 操作 -->
<el-table-column align="center" width="210" :label="$t('message.dangerousBigProject.operation')">
<template slot-scope="scope">
<!-- v-permission="{
key: 'fireWork_delete',
menuPath: '/project/operationManage/heightsWorks',
}" -->
<div class="tableBtns">
<div @click.stop="isAddPoint(4, scope.row)" class="operationText">
<img src="@/assets/images/icon-edit.png" width="15px" height="15px" />
<span>编辑</span>
</div>
<div @click.stop="deleteRow(scope.row)" class="operationText">
<img src="@/assets/images/icon-delete.png" width="15px" height="15px" />
<span>删除</span>
</div>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination style="margin-top: 20px" class="pagerBox" background @size-change="handleSizeChange"
@current-change="handleCurrentChange" :current-page.sync="pageNo" layout="sizes, prev, pager, next"
:page-sizes="[10, 20, 30, 40]" :page-size="pageSize" :total="Number(total)">
</el-pagination>
</div>
<!-- 添加卡片弹框 -->
<el-dialog :destroy-on-close="true" :modal-append-to-body="false" :title="cardDialogTitle"
:visible.sync="cardDialog" :width="isAdd == 1 || isAdd == 2 ? '600px' : '1100px'"
:before-close="handleClose">
<div class="dialog_content">
<el-form size="medium" :model="cardForm" ref="cardForm" :rules="cardFormRules" label-width="170px"
class="dialogFormBox">
<!-- <el-form-item label="申请单位" prop="applicant">
<el-select v-model="cardForm.applicant"
:placeholder="$t('message.personnelPosition.please_select')" filterable>
<el-option :label="item.enterpriseName" :value="item.id"
v-for="(item, index) in cooperatorList" :key="index">
</el-option>
</el-select>
</el-form-item> -->
<el-form-item v-if="isAdd == 1 || isAdd == 2" label="组织名称" prop="classificationName">
<el-input v-model="cardForm.classificationName"
:placeholder="$t('message.personnelPosition.please_enter')"></el-input>
</el-form-item>
<div class="addbox" v-if="isAdd == 3 || isAdd == 4">
<el-form-item label="姓名" prop="workerInfoId">
<el-select filterable v-model="cardForm.workerInfoId"
:placeholder="$t('message.personnelPosition.please_select')" filterable>
<el-option :label="item.workerName" :value="item.id"
v-for="(item, index) in workerListOptions" :key="index">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-select filterable v-model="cardForm.sex"
:placeholder="$t('message.personnelPosition.please_select')">
<el-option :label="item.sexName" :value="item.id"
v-for="(item, index) in sexTypeList" :key="index">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="党内职务" prop="partyPosition">
<el-select filterable v-model="cardForm.partyPosition"
:placeholder="$t('message.personnelPosition.please_select')">
<el-option :label="item.partyPositionName" :value="item.partyPositionName"
v-for="(item, index) in partyPositionList" :key="index">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="民族" prop="nation">
<el-select filterable v-model="cardForm.nation"
:placeholder="$t('message.personnelPosition.please_select')">
<el-option :label="item.name" :value="item.name" v-for="(item, index) in nationList"
:key="index">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="学历" prop="educationalBackground">
<el-select filterable v-model="cardForm.educationalBackground"
:placeholder="$t('message.personnelPosition.please_select')">
<el-option :label="item.name" :value="item.id"
v-for="(item, index) in primarySchoolList" :key="index">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="籍贯" prop="nativePlace">
<el-input v-model="cardForm.nativePlace"
:placeholder="$t('message.personnelPosition.please_enter')"></el-input>
</el-form-item>
<el-form-item label="人员类别" prop="personnelCategory">
<el-select filterable v-model="cardForm.personnelCategory"
:placeholder="$t('message.personnelPosition.please_select')">
<el-option :label="item.personnelCategoryName" :value="item.personnelCategoryName"
v-for="(item, index) in personnelCategoryList" :key="index">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="cardForm.idCard"
:placeholder="$t('message.personnelPosition.please_enter')"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="phoneNumber">
<el-input v-model="cardForm.phoneNumber"
:placeholder="$t('message.personnelPosition.please_enter')"></el-input>
</el-form-item>
</div>
</el-form>
<div class="dialog-footer">
<el-button class="cancleBtn" @click="handleClose" icon="el-icon-circle-close" size="medium">{{
$t("message.personnelPosition.cancel") }}
</el-button>
<el-button type="primary" icon="el-icon-circle-check" @click="saveCardFn" size="medium">{{
$t("message.personnelPosition.determine") }}
</el-button>
</div>
</div>
</el-dialog>
</div>
</vue-scroll>
<div style="height: 100%" v-else>
<el-page-header @back="goBack" :content="dialogTitle" class="backText"
:class="{ dark: styleType == 2 }"></el-page-header>
<!-- <addPlan @cancleSave="goBack" v-if="isAdd"></addPlan> -->
<detail :id="detailId" :isSuperDanger="isSuperDanger" :workType="2" @cancleSave="goBack"
:workDetail="workDetail" v-if="isEdit">
<template v-slot:basicinfo>
<div class="info-content">
<div style="width: 75%">
<div class="info-title">
<div>
{{ workDetail.equipmentName }}
</div>
<div class="info-title_right" v-if="workDetail.isSpecial == 1">
特种设备
</div>
</div>
<el-form class="form-box" :model="workDetail">
<el-form-item label="规格型号:" :label-width="formLabelWidthDetail">
{{ workDetail.partyPosition }}
</el-form-item>
<el-form-item label="项目设备编号:" :label-width="formLabelWidthDetail">
{{ workDetail.workerName ? workDetail.workerName : '--' }}
</el-form-item>
<el-form-item label="设备管理员:" :label-width="formLabelWidthDetail">
{{ workDetail.equipmentManagerName }}
</el-form-item>
<el-form-item label="进场经办人:" :label-width="formLabelWidthDetail">
{{ workDetail.onSiteHandlerName }}
</el-form-item>
<el-form-item label="实际进场时间:" :label-width="formLabelWidthDetail">
{{ workDetail.actualOnSiteDate }}
</el-form-item>
<el-form-item label="出厂日期:" :label-width="formLabelWidthDetail">
{{ workDetail.shipmentDate }}
</el-form-item>
<el-form-item label="状态:" :label-width="formLabelWidthDetail">
<span style="color:#EA3941;">{{ workDetail.status }}</span>
</el-form-item>
<el-form-item label="生产厂商:" :label-width="formLabelWidthDetail">
{{ workDetail.manufacturer }}
</el-form-item>
<el-form-item label="设备来源单位:" :label-width="formLabelWidthDetail">
{{ workDetail.equipmentSourceUnit }}
<!-- <el-tooltip class="item" style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;" effect="dark" :content="workDetail.jobContent"
placement="top-start">
<div>{{ workDetail.jobContent }}</div>
</el-tooltip> -->
</el-form-item>
<el-form-item label="安装拆除单位:" :label-width="formLabelWidthDetail">
{{ workDetail.installationRemovalUnit }}
</el-form-item>
<el-form-item label="使用装置:" :label-width="formLabelWidthDetail">
{{ workDetail.deviceUsed }}
</el-form-item>
<el-form-item label="设备位置:" :label-width="formLabelWidthDetail">
{{ workDetail.equipmentLocation }}
</el-form-item>
<el-form-item label="产权编号:" :label-width="formLabelWidthDetail">
{{ workDetail.ownershipNumber }}
</el-form-item>
<el-form-item label="使用年限:" :label-width="formLabelWidthDetail">
{{ workDetail.serviceLife }}
</el-form-item>
<!-- <el-form-item label="现场作业环境:" :label-width="formLabelWidthDetail">
<div class="img-show">
<el-image v-for="(item, index) in workDetail.fieldWorkingEnvironment" :key="index"
style="width: 100px; height: 100px; margin-right: 10px;margin-bottom: 10px"
:src="item.url" :preview-src-list="[item.url]">
</el-image>
</div>
</el-form-item> -->
</el-form>
</div>
<div
style="display: flex;flex-direction: column;justify-content: center;align-items: center; width: 25%">
<div ref="qrCodeDiv">
<img width="200" height="200" :src="$store.state.FILEURL + workDetail.qrCode" alt="">
</div>
<el-button style="margin-top: 20px" type="primary" @click="printBtn()" size="medium">打印方案二维码
</el-button>
</div>
<!-- <div v-if="COMPANY != 'longguang'" class="qr-box">
<div id="qrCode" ref="qrCodeDiv"></div>
<el-button size="medium" class="print-btn" @click="printBtn">打印危大工程标识</el-button>
</div> -->
</div>
</template>
</detail>
</div>
</div>
</template>
<script>
import detail from "./detail.vue";
import {
getConstructionEquipmentByIdApi,
getConstructionEquipmentFileListApi,
} from '@/assets/js/api/buildEquipToolManage'
import {
getOrganizationConstructionTreeApi,
addOrganizationConstructionTreeApi,
editOrganizationConstructionTreeApi,
deleteOrganizationConstructionTreeApi,
getOrganizationConstructionMemberPageApi,
addOrganizationConstructionMemberApi,
editOrganizationConstructionMemberApi,
deleteOrganizationConstructionMemberApi,
} from '@/assets/js/api/guidancePartyBuilding'
import {
getWorkerInfoData,
} from "@/assets/js/api/laborPerson.js";
import { getWorkerInfoList } from '@/assets/js/api/laborPerson.js'
import { isJSON } from "@/util/nowDate/index";
export default {
name: 'qualityProblemBank',
components: {
detail,
},
data() {
return {
formLabelWidthDetail: "140px",
styleType: 1,
classificationName: '',
defaultProps: {
children: 'children',
label: 'classificationName',
id: 'id'
},
projectSn: '',
checkedNodeData: {},
showExpand: true,
listData: [],
formInline: {
workerName: '',
idCard: '',
partyPosition: '',
recordStatus: 0
},
tableData: [],
multipleSelection: [],
checkboxId: [],
showBatch: true,
projectInfo: {},
cardDialogTitle: "",
cardDialog: false,
cardForm: {},
cardFormRules: {
equipmentName: [
{
required: true,
message: this.$t("message.personnelPosition.required"),
trigger: "blur",
},
],
partyPosition: [
{
required: true,
message: this.$t("message.personnelPosition.required"),
trigger: "blur",
},
],
workerName: [
{
required: true,
message: this.$t("message.personnelPosition.required"),
trigger: "blur",
},
],
equipmentManager: [
{
required: true,
message: this.$t("message.personnelPosition.mandatory"),
trigger: "change",
},
],
actualOnSiteDate: [
{
required: true,
message: this.$t("message.personnelPosition.mandatory"),
trigger: "change",
},
],
shipmentDate: [
{
required: true,
message: this.$t("message.personnelPosition.mandatory"),
trigger: "change",
},
],
status: [
{
required: true,
message: this.$t("message.personnelPosition.required"),
trigger: "blur",
},
],
equipmentSourceUnit: [
{
required: true,
message: this.$t("message.personnelPosition.required"),
trigger: "blur",
},
],
},
specialEquipmentList: [{
id: 1,
specialEquipmentName: "是",
}, {
id: 2,
specialEquipmentName: "否",
}],
isAdd: -1,
pageNo: 1,
pageSize: 10,
total: 10,
workerListOptions: [],
isSuperDanger: "",
workDetail: {},
detailId: '',
dialogTitle: '',
isEdit: false,
dialogFormVisible: true,
//民族
nationList: [
{ name: "汉族", value: 1 },
{ name: "满族", value: 2 },
{ name: "蒙古族", value: 3 },
{ name: "回族", value: 4 },
{ name: "藏族", value: 5 },
{ name: "维吾尔族", value: 6 },
{ name: "苗族", value: 7 },
{ name: "彝族", value: 8 },
{ name: "壮族", value: 9 },
{ name: "布依族", value: 10 },
{ name: "侗族", value: 11 },
{ name: "瑶族", value: 12 },
{ name: "白族", value: 13 },
{ name: "土家族", value: 14 },
{ name: "哈尼族", value: 15 },
{ name: "哈萨克族", value: 16 },
{ name: "傣族", value: 17 },
{ name: "黎族", value: 18 },
{ name: "傈僳族", value: 19 },
{ name: "佤族", value: 20 },
{ name: "畲族", value: 21 },
{ name: "高山族", value: 22 },
{ name: "拉祜族", value: 23 },
{ name: "水族", value: 24 },
{ name: "东乡族", value: 25 },
{ name: "纳西族", value: 26 },
{ name: "景颇族", value: 27 },
{ name: "柯尔克孜族", value: 28 },
{ name: "土族", value: 29 },
{ name: "仫佬族", value: 30 },
{ name: "羌族", value: 31 },
{ name: "布朗族", value: 32 },
{ name: "撒拉族", value: 33 },
{ name: "毛南族", value: 34 },
{ name: "仡佬族", value: 35 },
{ name: "锡伯族", value: 36 },
{ name: "阿昌族", value: 37 },
{ name: "普米族", value: 38 },
{ name: "朝鲜族", value: 39 },
{ name: "塔吉克族", value: 40 },
{ name: "怒族", value: 41 },
{ name: "乌孜别克族", value: 42 },
{ name: "俄罗斯族", value: 43 },
{ name: "鄂温克族", value: 44 },
{ name: "保安族", value: 45 },
{ name: "裕固族", value: 46 },
{ name: "京族", value: 47 },
{ name: "塔塔尔族", value: 48 },
{ name: "独龙族", value: 49 },
{ name: "鄂伦春族", value: 50 },
{ name: "赫哲族", value: 51 },
{ name: "门巴族", value: 52 },
{ name: "珞巴族", value: 53 },
{ name: "基诺族", value: 54 },
],
primarySchoolList: [{
id: 1,
name: "小学",
}, {
id: 2,
name: "初中",
}, {
id: 3,
name: "中专",
}, {
id: 4,
name: "高中",
}, {
id: 5,
name: "大专",
}, {
id: 6,
name: "本科",
}, {
id: 7,
name: "研究生",
}, {
id: 8,
name: "博士",
}, {
id: 9,
name: "博士后",
}],
memberOfChinaList: [{
name: "中共党员",
}, {
name: "共青团团员",
}, {
name: "普通居民",
}, {
name: "其他党派人士",
}],
sexTypeList: [{
id: 1,
sexName: "男"
}, {
id: 2,
sexName: "女"
}],
partyPositionList: [{
partyPositionName: "党总支书记"
}, {
partyPositionName: "党支部书记"
}, {
partyPositionName: "组织兼统战委员"
}, {
partyPositionName: "宣传兼纪委员会"
}],
personnelCategoryList: [{
personnelCategoryName: "正式党员"
}, {
personnelCategoryName: "预备党员"
}],
workerInfo: {},
}
},
created() {
this.projectSn = this.$store.state.projectSn;
this.projectInfo = isJSON(localStorage.getItem("projectInfo")) ? JSON.parse(localStorage.getItem("projectInfo")) : {};
this.getDangerTypeRecordList();
this.getDutyPerson();
},
methods: {
printBtn() {
// setTimeout(() => {
// console.log(this.$refs["qrCodeDiv"].innerHTML)
// },100)
// qrCode
setTimeout(() => {
let printDemo = this.$refs["qrCodeDiv"].innerHTML;
console.log(printDemo);
window.document.body.innerHTML = printDemo;
//没有图片直接打印
window.print();
window.location.reload();
}, 100);
},
//获取左侧---列表信息
getDangerTypeRecordList() {
console.log(22)
let data = {
projectSn: this.projectSn,
classificationName: this.classificationName
}
getOrganizationConstructionTreeApi(data).then((res) => {
if (res.code == 200) {
if (res.result.length > 0) {
if (this.classificationName) {
this.listData = res.result;
this.getCheckedNode(this.listData[0]);
} else {
this.listData = [{
id: "",
children: [],
classificationName: "全部",
}, ...res.result];
this.getCheckedNode(this.listData[0]);
}
this.$nextTick(() => {
// todo 在这里设置
this.$refs.tree.setCurrentKey(this.listData[0].id)
})
} else {
this.listData = []
}
}
})
},
// 删除文件
handleRemove(file, fileList, id) {
const find = this.cardForm.tableList.find((item) => item.id == id);
if (find) {
find.fileList = fileList;
}
},
handleSuccess(res, file, id) {
if (res.status == "SUCCESS") {
const find = this.cardForm.tableList.find((item) => item.id == id);
if (find) {
find.fileList = [{
name: file.name,
url: file.response.data[0].imageUrl,
}]
}
}
},
handleExceed() {
this.$message.warning("文件超出最大限制,请删除上份文件!");
},
//左边节点 输入筛选
filterNode(value, data) {
console.log(value, data);
if (!value) return true
return data.classificationName.indexOf(value) !== -1
},
isAddPoint(type, node, data) {
this.isAdd = type;
this.cardDialog = true;
if (type == 1) {
if (node) {
this.cardForm = {
parentId: data.id,
classificationName: "",
};
this.cardDialogTitle = "新增子级";
} else {
this.initCardFormData();
this.$nextTick(() => {
this.$refs["cardForm"] && this.$refs["cardForm"].resetFields();
});
this.cardDialogTitle = this.$t("message.laborDev.add2");
}
} else if (type == 2) {
this.cardDialogTitle = this.$t("message.laborDev.btn_edit"); //编辑卡片
console.log(node);
this.cardForm = {
...data,
};
} else if (type == 3) {
this.initCardFormData();
this.$nextTick(() => {
this.$refs["cardForm"] && this.$refs["cardForm"].resetFields();
});
this.cardDialogTitle = this.$t("message.laborDev.add2");
} else if (type == 4) {
this.cardDialogTitle = this.$t("message.laborDev.btn_edit"); //编辑卡片
console.log(node);
getConstructionEquipmentFileListApi({
constructionEquipmentToolId: node.id,
// projectSn: this.$store.state.projectSn,
}).then((res) => {
this.cardForm = {
...node,
tableList: res.result ? res.result.map(item => {
return {
id: item.id,
fileName: item.name,
constructionEquipmentToolId: item.constructionEquipmentToolId,
fileList: [{
name: item.originName,
url: item.fileUrl,
}]
}
}) : [],
};
})
}
},
//添加或编辑卡片
saveCardFn() {
this.$refs["cardForm"].validate((valid) => {
if (valid) {
const result = {
...this.cardForm,
projectSn: this.$store.state.projectSn,
}
console.log(result);
if (this.isAdd == 1) {
// this.cardForm.floorId = this.currentFloorDetail.floorId
addOrganizationConstructionTreeApi(result).then((res) => {
this.cardDialog = false;
this.handleClose();
this.getDangerTypeRecordList()
this.getDangerItemRecord()
this.$message.success(
this.$t("message.personnelPosition.add_success")
); //添加成功!
});
} else if (this.isAdd == 2) {
editOrganizationConstructionTreeApi(result).then((res) => {
this.cardDialog = false;
this.handleClose();
this.getDangerTypeRecordList()
this.getDangerItemRecord()
this.$message.success(
this.$t("message.personnelPosition.edit_success")
); //编辑成功!
});
} else if (this.isAdd == 3) {
addOrganizationConstructionMemberApi(result).then((res) => {
this.cardDialog = false;
this.handleClose();
this.getDangerItemRecord()
this.$message.success(
this.$t("message.personnelPosition.add_success")
); //添加成功!
});
} else if (this.isAdd == 4) {
editOrganizationConstructionMemberApi(result).then((res) => {
this.cardDialog = false;
this.handleClose();
this.getDangerItemRecord()
this.$message.success(
this.$t("message.personnelPosition.edit_success")
); //编辑成功!
});
}
} else {
console.log("error submit!!");
return false;
}
});
},
// 初始化
initCardFormData() {
if (this.isAdd == 1 || this.isAdd == 2) {
this.cardForm = {
classificationName: "",
}
} else if (this.isAdd == 3 || this.isAdd == 4) {
this.cardForm = {
partyConstructionOrganizationId: this.checkedNodeData.id,
workerInfoId: "",
sex: "",
partyPosition: "",
nation: "",
educationalBackground: "",
nativePlace: "",
personnelCategory: "",
idCard: "",
phoneNumber: "",
};
}
},
goBack() {
this.dialogFormVisible = true;
// this.initData()
this.isAdd = false;
this.isEdit = false;
this.isUpdate = false;
},
// 关闭前执行
handleClose(done) {
this.initCardFormData();
this.$refs["cardForm"].resetFields();
// console.log(this.$refs["cardForm"].resetFields())
if (done && typeof done === "function") {
done();
} else {
this.cardDialog = false;
}
},
// 添加作业人员数据(起吊作业)
onAddTable() {
this.cardForm.tableList.push({
id: "id-" + Math.random().toString(36).substr(2, 9),
fileName: "",
fileList: [],
});
},
// 删除作业人员数据(起吊作业)
onDeleteTable(row) {
this.$confirm('确定删除该行数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const findIndex = this.cardForm.tableList.findIndex(item => item.id === row.id);
if (findIndex !== -1) {
this.cardForm.tableList.splice(findIndex, 1);
this.$message({
type: 'success',
message: '删除成功!'
});
}
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消删除'
// });
});
},
// 删除作业人员数据(起吊作业)
deleteTreeRow(row) {
console.log(row)
this.$confirm('确定删除该行数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteOrganizationConstructionTreeApi({
id: row.id,
projectSn: this.projectSn
}).then((res) => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.getDangerTypeRecordList()
this.getDangerItemRecord()
})
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消删除'
// });
});
},
deleteRow(row) {
console.log(row)
this.$confirm('确定删除该行数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteOrganizationConstructionMemberApi({
id: row.id,
projectSn: this.projectSn
}).then((res) => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.getDangerItemRecord()
})
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消删除'
// });
});
},
//获取选中的 节点
getCheckedNode(data) {
this.checkedNodeData = data;
console.log(data);
this.getDangerItemRecord()
},
//全部关闭
setCheckedKeys() {
this.defaultExpand = false
for (var i = 0; i < this.$refs.tree.store._getAllNodes().length; i++) {
this.$refs.tree.store._getAllNodes()[i].expanded = this.defaultExpand
}
},
//全部展开
setCheckedNodes() {
this.defaultExpand = true //展开所有节点
for (var i = 0; i < this.$refs.tree.store._getAllNodes().length; i++) {
this.$refs.tree.store._getAllNodes()[i].expanded = this.defaultExpand
}
},
//获取列表数据--右侧
getDangerItemRecord() {
let data = {
projectSn: this.projectSn,
partyConstructionOrganizationId: this.checkedNodeData.id,
workerName: this.formInline.workerName,
idCard: this.formInline.idCard,
partyPosition: this.formInline.partyPosition,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getOrganizationConstructionMemberPageApi(data).then((res) => {
if (res.code == 200) {
this.tableData = res.result.records.map(item => {
return {
...item,
commonDiseasePicture: isJSON(item.commonDiseasePicture) && item.commonDiseasePicture != null ? JSON.parse(item.commonDiseasePicture) : [],
commonDiseasePreventionMethodPicture: isJSON(item.commonDiseasePreventionMethodPicture) && item.commonDiseasePreventionMethodPicture != null ? JSON.parse(item.commonDiseasePreventionMethodPicture) : [],
}
});
this.total = res.result.total;
}
})
},
handleSizeChange() {
this.getDangerItemRecord();
},
handleCurrentChange() {
this.getDangerItemRecord();
},
//列表查询--右侧
onSubmit() {
this.getDangerItemRecord()
},
//表格多选
handleSelectionChange(value) {
if (value.length > 0) {
let arr = []
for (let i = 0; i < value.length; i++) {
arr.push(value[i].id)
}
this.checkboxId = arr
this.showBatch = false
} else {
this.checkboxId = value
this.showBatch = true
}
},
//查询选择人员下拉
getDutyPerson() {
let data = {
projectSn: this.$store.state.projectSn,
// isFilterQualityRegionEnterprise: 1
}
getWorkerInfoList(data).then(res => {
if (res.code == 200) {
this.workerListOptions = res.result.records
console.log('获取施工人员下拉', this.workerListOptions)
} else {
this.$message.error(res.message)
}
})
},
previewDetail(val) {
console.log("!!!!!!!!!!!!!!!!!!", val);
this.dialogFormVisible = false;
this.isEdit = true;
// 详细
this.dialogTitle = this.$t("message.dangerousBigProject.detailed");
this.detailId = val.id;
getConstructionEquipmentByIdApi({
id: val.id,
}).then((res) => {
if (res.result) {
console.log(res.result, 1);
this.workDetail = {
...val,
...res.result,
};
}
});
this.isSuperDanger = val.issuperdanger;
},
//获取详情信息
getWorkerInfo() {
let data = {
workerId: this.cardForm.workerInfoId,
};
getWorkerInfoData(data).then((res) => {
console.log("-------------------10");
if (res.code == 200) {
let data = JSON.parse(JSON.stringify(res.result));
console.log("基本人员信息", data.workerInfo);
this.cardForm.sex= data.workerInfo.sex;
this.cardForm.nation= data.workerInfo.nation;
this.cardForm.educationalBackground= data.workerInfo.educational ? parseInt(data.workerInfo.educational) : "";
this.cardForm.nativePlace= data.workerInfo.nativePlace;
this.cardForm.idCard= data.workerInfo.idCard;
this.cardForm.phoneNumber= data.workerInfo.phoneNumber;
} else {
this.$message.error(res.message);
}
});
},
},
watch: {
// 监听选中的数据
"cardForm.workerInfoId": {
handler(newVal, oldVal) {
this.getWorkerInfo();
},
// immediate: true
},
classificationName(val) {
this.$refs.tree.filter(val)
}
},
computed: {
srcListUp() {
return (list) => {
return list.map(item => {
return this.$store.state.FILEURL + item.url
})
}
},
}
}
</script>
<style lang="less" scoped>
.info-content {
display: flex;
}
.info-title {
display: flex;
align-items: center;
font-size: 18px;
margin-left: 10px;
.info-title_right {
margin-left: 10px;
background-color: #EA3941;
color: #fff;
font-size: 14px;
border-radius: 4px;
padding: 4px;
display: flex;
align-items: center;
justify-content: center;
}
}
.gasanalysis-table1 {
width: 100%;
table {
width: 100%;
// height: 100%;
font-size: 16px;
margin-bottom: 20px;
}
tr {
height: 50px;
}
td {
text-align: center;
min-width: 50px;
.el-select,
/deep/ .el-input {
width: 150px !important;
}
}
table,
td,
th {
border: 1px solid #CDCDCD;
border-collapse: collapse;
// color: white;
}
th {
background-color: #EEEEEE;
}
}
.form-box {
width: 100%;
display: flex;
flex-wrap: wrap;
/deep/.el-form-item {
width: 25%;
padding-right: 10px;
box-sizing: border-box;
}
// /deep/.el-col-12{
// padding-left: 20px;
// }
/deep/.el-input__inner {
width: 100%;
}
/deep/.el-select {
width: 100%;
}
/deep/.el-cascader {
width: 100%;
}
}
.dialogFormBox {
width: initial;
display: flex;
justify-content: space-around;
flex-wrap: wrap;
.addbox {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
}
.icon-box {
>i:not(:first-child) {
margin-left: 10px;
}
}
.flex {
display: flex;
}
.flex2 {
display: flex;
align-items: center;
}
.flex3 {
display: flex;
align-items: center;
justify-content: space-between;
}
.backText {
padding: 0;
padding-left: 10px;
/deep/.el-page-header__content {
font-size: 14px;
}
}
.qualityProblemBank2 {
padding-bottom: 20px;
height: 100%;
background: #fff;
padding: 0 10px;
padding-top: 10px;
box-sizing: border-box;
}
.qualityProblemBank {
width: 100%;
height: 100%;
box-sizing: border-box;
// padding: 16px 20px;
.scroll /deep/ .__view {
height: 100%;
}
.content {
height: 100%;
width: 100%;
}
.left {
width: 20%;
height: 100%;
position: relative;
padding: 16px 20px;
box-sizing: border-box;
background-color: white;
.btn_wrap_box {
margin-bottom: 10px;
display: flex;
justify-content: space-between;
.btn_wrap {
// border-top: 1px solid @borderColor;
// padding-top: 10px;
text-align: center;
// position: absolute;
// bottom: 16px;
// right: 0;
// left: 0;
display: flex;
>.el-button {
margin: 0;
}
>.el-button:first-child {
border-radius: 2px 0 0 2px;
}
>.el-button:last-child {
border-radius: 0 2px 2px 0;
border-left: none;
}
}
}
.ellipsis {
width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.right {
width: 78.8%;
height: 100%;
box-sizing: border-box;
// border-left: 1px solid @borderColor;
padding: 10px 0 16px 20px;
margin-left: 20px;
background-color: white;
.tab_btn_wrap {
margin-top: 15px;
}
}
// .filter-tree {
// color: #606266;
// }
.custom-tree-node {
width: 100%;
}
.stop {
color: #ff0000;
}
}
.el-button--text {
padding-right: 10px;
}
</style>