Files
foton-laws-system-front/src/pages/regulatoryRepository/nonConfomity/pages/rectificationDatabase.vue
T
2021-12-05 17:35:38 +08:00

1272 lines
45 KiB
Vue

<!--未符合项整改数据库-->
<template>
<div id="rectification-dataBase">
<div class="search-area">
<div class="content-top">
<el-form :modal="nonConformitySearch" inline class="label-input-form">
<el-form-item label="标准号/标准名称" class="search-item">
<el-input v-model="nonConformitySearch.standSerialNumber"
placeholder="请输入"
clearable
:maxlength="100"></el-input>
</el-form-item>
<el-form-item label="项目名称" class="search-item">
<el-input v-model="nonConformitySearch.productName"
placeholder="请输入"
clearable
:maxlength="100"></el-input>
</el-form-item>
<el-form-item label="责任部门" class="search-item">
<el-select v-model="nonConformitySearch.responsibleUnit" placeholder="根据责任部门查找" clearable>
<el-option v-for="opt in zrbmOptions" :value="opt.value === undefined ? '' :opt.value" :key="opt.value"
:label="opt.label">
{{ opt.label }}
</el-option>
</el-select>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
type="primary"
class="common-button-primary"
size="mini"
v-btn-permission="'b3aaea6d18f5871b68825d3783eb736a'"
@click="getTableByPage('')">
查询
</el-button>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
class="common-button-default"
size="mini"
v-btn-permission="'5905d0743c3504799aee83ac9697f8c5'"
@click="clearAllSearch">
清空
</el-button>
</el-form-item>
</el-form>
</div>
</div>
<div class="content-center">
<el-button
class="common-button-primary"
size="small"
type="primary"
v-btn-permission="''"
@click="addModel"
><i class="el-icon-plus"></i>新增
</el-button>
<el-button
class="common-button-primary"
type="primary"
size="mini"
@click="exportStandard()"
title="不勾选时默认导出所有筛选项;勾选时仅导出勾选项"
v-btn-permission="'620e6da5808bf104e576c763546a33b6'"
><i class="iconfont">&#xe6e9;</i>导出
</el-button>
<el-button
class="common-button-primary"
type="primary"
size="mini"
@click="batchClose()"
v-btn-permission="'503f373e13fc62a8b50d52898fcd50cd'"
><i class="iconfont">&#xe611;</i>批量关闭
</el-button>
<el-button
class="common-button-primary"
size="mini"
type="primary"
@click="historyClick"
style="float: right; margin-right: 10px;"
v-btn-permission="'173e7a3ce7e9544578f63eaf11dd48de'"
>历史数据
</el-button>
</div>
<div class="container">
<loading :loading="loading">数据获取中....</loading>
<div class="table-wrap">
<div class="inner-wrap">
<el-table
:data="nonList"
tooltip-effect="dark"
height="100%"
border
max-height="100%"
class="table"
v-loading="myLoading.loadData"
@selection-change="standSelectChange"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
>
<el-table-column
type="selection"
width="55"
fixed="left"
align="center">
</el-table-column>
<el-table-column
prop="standSerialNumber"
fixed="left"
min-width="180"
label="标准号">
<template slot-scope="scope">
<a class="table-jump" @click="handlePreview(scope.row)">{{ scope.row.standSerialNumber }}</a>
</template>
</el-table-column>
<el-table-column
prop="standName"
fixed="left"
min-width="300"
show-overflow-tooltip
label="标准名称">
<template slot-scope="scope">
<a @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column
prop="itemsNum"
min-width="100"
label="条款号">
</el-table-column>
<el-table-column
prop="itemsName"
min-width="300"
show-overflow-tooltip
label="条款名称">
</el-table-column>
<el-table-column
prop="productType"
width="100"
label="产品类型">
</el-table-column>
<el-table-column
prop="productLine"
width="180"
label="产品线">
</el-table-column>
<el-table-column
prop="productName"
min-width="300"
show-overflow-tooltip
label="项目名称">
</el-table-column>
<el-table-column
prop="reason"
width="180"
label="不合规项目">
</el-table-column>
<el-table-column
prop="responsibleUnit"
width="180"
show-overflow-tooltip
label="责任部门">
</el-table-column>
<el-table-column
prop="dutyEngineer"
width="100"
label="责任工程师">
</el-table-column>
<el-table-column
prop="authEngineer"
width="150"
show-overflow-tooltip
label="认证工程师">
</el-table-column>
<el-table-column
prop="qaEngineer"
width="150"
show-overflow-tooltip
label="质量工程师">
</el-table-column>
<el-table-column
prop="planCloseTime"
width="150"
sortable="custom"
label="计划关闭时间">
<template slot-scope="scope">
{{ (scope.row.planCloseTime ? scope.row.planCloseTime.substring(0, 11) : "") }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="50">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<!--未符合项整改库-查看-->
<el-dropdown-item :command="[scope.row, '查看']"
v-btn-permission="'374cb5206597fa201e57f561ff2f8ed7'">查看
</el-dropdown-item>
<el-dropdown-item :command="[scope.row, '编辑']" v-btn-permission="''">编辑</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div class="footer">
<pagination :total="totalNo" @pageChange="pageChangeNo" @pageSizeChange="pageSizeChangeNo"></pagination>
<el-drawer
title="查看"
:visible.sync="historySee"
destroy-on-close
:wrapperClosable="false"
class="seeHisToryDraw"
size="600px"
>
<div class="demo-drawer-content">
<div class="el-drawer-form" style="height: auto">
<el-form
class="label-input-form"
label-width="150px"
ref="nonAddForm"
style="width: 100%;"
:model="historySeeForm"
>
<el-form-item class="add-form-item" label="标准号:">
<div class="seeItem">{{ historySeeForm.standSerialNumber }}</div>
</el-form-item>
<el-form-item class="add-form-item" label="标准名称:">
<div class="seeItem">{{ historySeeForm.standName }}</div>
</el-form-item>
<el-form-item class="add-form-item" label="条款号:">
<div class="seeItem">{{ historySeeForm.itemsNum }}</div>
</el-form-item>
<el-form-item class="add-form-item" label="条款名称:">
<div class="seeItem">{{ historySeeForm.itemsName }}</div>
</el-form-item>
<el-form-item class="add-form-item" label="产品线:">
<div class="seeItem">{{ historySeeForm.productLine }}</div>
</el-form-item>
<el-form-item class="add-form-item" label="项目名称:">
<div class="seeItem">{{ historySeeForm.productName }}</div>
</el-form-item>
<el-form-item class="add-form-item" label="不合规项目:">
<div class="seeItem">{{ historySeeForm.reason }}</div>
</el-form-item>
<el-form-item class="add-form-item" label="责任部门:">
<div class="seeItem">{{ historySeeForm.responsibleUnit }}</div>
</el-form-item>
<el-form-item class="add-form-item" label="责任工程师:">
<div class="seeItem">{{ historySeeForm.dutyEngineer }}</div>
</el-form-item>
<el-form-item class="add-form-item" label="认证工程师:">
<div class="seeItem">{{ historySeeForm.authEngineer }}</div>
</el-form-item>
<el-form-item class="add-form-item" label="质量工程师:">
<div class="seeItem">{{ historySeeForm.qaEngineer }}</div>
</el-form-item>
<el-form-item class="add-form-item" label="计划关闭时间:">
<div class="seeItem">
{{ historySeeForm.planCloseTime ? historySeeForm.planCloseTime.substring(0, 11) : "-" }}
</div>
</el-form-item>
</el-form>
</div>
<div class="typebox"
v-if="historySeeForm.inconItemEOList != null && historySeeForm.inconItemEOList.length > 0">
<el-divider content-position="left">不符合项</el-divider>
<div class="typeitem" v-for="(item, index) in historySeeForm.inconItemEOList" :key="index">
<div class="typeitems">
<div class="itemsLeft">条款号:</div>
<div class="itemsRight">{{ item.itemNum }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">涉及项目:</div>
<div class="itemsRight">{{ item.productNameShow }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">目前状态:</div>
<!-- <div class="itemsRight" v-if="item.itemState == '2'">符合</div>-->
<div class="itemsRight">不符合</div>
</div>
<div class="typeitems">
<div class="itemsLeft">设计完成时间:</div>
<div class="itemsRight">{{ (item.stepFirTime ? item.stepFirTime.substring(0, 10) : "") }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">佐证材料:</div>
<!-- <div class="itemsRight">{{item.supportFile}}</div>-->
<div class="itemsRight">
<p
class="files-title"
v-for="(file, fileIndex) in item.supportFileList"
:key="fileIndex"
>
<span>{{ file.oldFileName }}</span>
<i title="下载" @click="downloadFile(file.id)" class="icon-download" />
</p>
</div>
</div>
<div class="typeitems">
<div class="itemsLeft">备注信息:</div>
<div class="itemsRight">{{ item.remark }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">验证完成时间:</div>
<div class="itemsRight">{{ (item.stepSecTime ? item.stepSecTime.substring(0, 10) : "") }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">佐证材料:</div>
<div class="itemsRight">
<p
class="files-title"
v-for="(file, fileIndex) in item.secSupportFileList"
:key="fileIndex"
>
<span>{{ file.oldFileName }}</span>
<i title="下载" @click="downloadFile(file.id)" class="icon-download" />
</p>
</div>
</div>
<div class="typeitems">
<div class="itemsLeft">备注信息:</div>
<div class="itemsRight">{{ item.secRemark }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">整改完成时间:</div>
<div class="itemsRight">{{ (item.stepThiTime ? item.stepThiTime.substring(0, 10) : "") }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">佐证材料:</div>
<div class="itemsRight">
<p
class="files-title"
v-for="(file, fileIndex) in item.thrSupportFileList"
:key="fileIndex"
>
<span>{{ file.oldFileName }}</span>
<i title="下载" @click="downloadFile(file.id)" class="icon-download" />
</p>
</div>
</div>
<div class="typeitems">
<div class="itemsLeft">备注信息:</div>
<div class="itemsRight">{{ item.thrRemark }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">责任部门:</div>
<div class="itemsRight">{{ item.responsibleUnitShow }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">责任工程师:</div>
<div class="itemsRight">{{ item.responseEnginShow }}</div>
</div>
</div>
</div>
<div class="typebox"
v-if="historySeeForm.besureItemEOList != null && historySeeForm.besureItemEOList.length > 0">
<el-divider content-position="left">待验证项</el-divider>
<div class="typeitem" v-for="(item, index) in historySeeForm.besureItemEOList" :key="index">
<div class="typeitems">
<div class="itemsLeft">条款号:</div>
<div class="itemsRight">{{ item.itemNum }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">涉及项目:</div>
<div class="itemsRight">{{ item.productNameShow }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">责任部门:</div>
<div class="itemsRight">{{ item.responsibleUnitShow }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">责任工程师:</div>
<div class="itemsRight">{{ item.responseEnginShow }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">验证时间:</div>
<div class="itemsRight">{{ (item.validTime ? item.validTime.substring(0, 11) : "") }}</div>
</div>
<div class="typeitems">
<div class="itemsLeft">验证结果:</div>
<div class="itemsRight">待验证</div>
</div>
</div>
</div>
</div>
</el-drawer>
</div>
</div>
<el-dialog :visible.sync="exportModelFlag" title="导出文件" width="300px">
<el-form :inline="true" class="label-input-form search-area">
<el-form-item label="导出名称" class="search-item">
<el-input v-model="exportName" placeholder="请输入导出文件名称" :maxlength="30" clearable label="导出名称" />
</el-form-item>
</el-form>
<span slot="footer" class="demo-drawer-footer">
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="cancal">取消</el-button>
<el-button type="primary" size="mini" class="common-button-primary" icon="el-icon-check"
@click="exportTestItem">提交</el-button>
</span>
</el-dialog>
<!-- 填写未符合项信息表单-->
<el-drawer
size="700px"
:before-close="addDrawerClose"
:title="drawerTitle"
:visible.sync="drawerTable">
<div class="demo-drawer-content" v-if="drawerTable">
<div class="content">
<div class="standard-table-search">
<el-row :gutter="24">
<el-col :span="24">
<el-form :model="addForm" inline class="label-input-form" :rules="formRules" label-width="180px"
ref="addForm">
<el-form-item prop="productName" label="项目名称" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-select v-model="addForm.productName" filterable @change="handleChange" placeholder="请选择项目名称">
<el-option
v-for="item in ProjectDatas"
:key="item.id"
:label="item.projectName"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item prop="projectNumber" label="项目编号" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-input
:disabled="true"
v-model="addForm.projectNumber"
placeholder="请输入项目编号"
/>
</el-form-item>
<el-form-item prop="productType" label="产品类型" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-input
:disabled="true"
v-model="addForm.productType"
placeholder="请输入产品类型"
/>
</el-form-item>
<el-form-item prop="productLine" label="产品线" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-input
:disabled="true"
v-model="addForm.productLine"
placeholder="请输入产品线"
/>
</el-form-item>
<el-form-item prop="standSerialNumber" label="标准号" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-select
v-model="addForm.standSerialNumber"
filterable
:disabled="serialNumber"
@change="standChange"
placeholder="请选择标准号">
<el-option
v-for="item in dataList"
:key="item.standId"
:label="item.standSort + '-' + item.standNumber + '-' + item.standYear"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item prop="standName" label="标准名称" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-input
:disabled="true"
v-model="addForm.standName"
placeholder="请输入标准名称"
/>
</el-form-item>
<el-form-item prop="itemsNum" label="条款号" style="width: 100%; margin-right:10px"
class="add-form-item add-input">
<el-input
v-model="addForm.itemsNum"
placeholder="请输入条款号"
:maxlength="500">
</el-input>
</el-form-item>
<el-form-item prop="itemsName" label="条款名称" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-input
v-model="addForm.itemsName"
placeholder="请输入条款名称"
:maxlength="500" />
</el-form-item>
<el-form-item prop="responsibleUnit" label="责任部门" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-input
v-model="addForm.responsibleUnit"
placeholder="请输入责任部门"
@click.native="choiceZRBM"
/>
</el-form-item>
<el-form-item prop="reason" label="不合规项目" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-input
v-model="addForm.reason"
placeholder="请输入不合规项目"
:maxlength="500" />
</el-form-item>
<el-form-item prop="dutyEngineer" label="责任工程师" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-input
v-model="addForm.dutyEngineer"
placeholder="请输入责任工程师"
@click.native="choiceZRR"
/>
</el-form-item>
<el-form-item prop="authEngineer" label="认证工程师" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-input
v-model="addForm.authEngineer"
placeholder="请输入认证工程师"
@click.native="choiceMore('authEngineer','选择认证工程师',addForm.authEngineer)"
/>
</el-form-item>
<el-form-item prop="qaEngineer" label="质量工程师" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-input
v-model="addForm.qaEngineer"
placeholder="请输入质量工程师"
@click.native="choiceMore('qaEngineer','选择质量工程师',addForm.qaEngineer)"
/>
</el-form-item>
<el-form-item prop="planCloseTime" label="计划关闭时间" style="width: 100%; margin-right:10px"
class="add-form-item">
<el-date-picker
v-model="addForm.planCloseTime"
type="date"
placeholder="请选择计划关闭时间"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-form>
</el-col>
</el-row>
</div>
</div>
</div>
<div class="demo-drawer-footer">
<el-button
size="mini"
class="common-button-primary"
icon="el-icon-check"
type="primary"
:loading="submiting"
@click="submit">提交
</el-button>
<el-button
size="mini"
class="common-button-default"
icon="el-icon-close"
@click="addDrawerClose">取消
</el-button>
</div>
</el-drawer>
<Role-tree
check-box
is-title="选择责任工程师"
:is-visible.sync="roleShowflag"
:nodeList="nodeList"
@checkedRole="drawerCheck"
/>
<Role-tree
:is-title="titleMore"
:is-visible.sync="roleShowMore"
:nodeList="nodeListMore"
@checkedRole="drawerMore"
/>
<MechanismTree
is-title="选择部门信息"
:is-visible.sync="modalshowflagZRBM"
:nodeList="nodeListZRBM"
@checkedRole="drawerCheckZRBM"
/>
</div>
</template>
<script>
import { interfaceUrl } from "@/sysConfig";
import { addUn, editUn } from "@/api/unqualProcess";
export default {
name: "rectificationDatabase",
data() {
return {
loading: false,
nonList: [], //未符合项表格数据
replaceLoading: false,
//项目数据
ProjectDatas: [],
itemsData: [],
selectItems: [],
dataList: [],
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
total: 0,
drawerTitle: "",
//存放被勾选的项目的数据
selectList: [],
addForm: {
closeState: "1",
standSerialNumber: "", //标准号
standName: "", //标准名称
standId: "",
itemsNum: "", //条款号
itemsName: "", //条款名称
productType: "",
projectNumber: "",
productLine: "", //产品线
productName: "", //项目名称
reason: "", //不合规项目
responsibleUnit: "", //责任部门
dutyEngineer: "", //责任工程师
authEngineer: "", //认证工程师
qaEngineer: "", //质量工程师
planCloseTime: "" //计划关闭时间
}, //表单数据
formRules: {
standSerialNumber: [
{ required: true, message: "请输入标准号", trigger: "blur" }
],
standName: [
{ required: true, message: "请输入标准名称", trigger: "blur" }
],
// itemsNum: [
// { required: true, message: "请输入条款号", trigger: "blur" }
// ],
// itemsName: [
// { required: true, message: "请输入条款名称", trigger: "blur" }
// ],
productType: [
{ required: true, message: "请输入产品类型", trigger: "blur" }
],
productLine: [
{ required: true, message: "请输入产品线", trigger: "blur" }
],
productName: [
{ required: true, message: "请输入项目名称", trigger: "change" }
],
projectNumber: [
{ required: true, message: "请输入项目编号", trigger: "change" }
],
reason: [
{ required: true, message: "请输入不合规项目", trigger: "blur" }
],
responsibleUnit: [
{ required: true, message: "请输入责任部门", trigger: "blur" }
],
dutyEngineerName: [
{ required: true, message: "请输入责任工程师", trigger: "blur" }
],
planCloseTime: [
{ required: true, message: "请选择计划关闭时间", trigger: "blur" }
]
},
drawerTable: false, //表单模态窗
exportModelFlag: false, //导出模态窗
tableHeight: null, //表格高度
exportName: "",
selectedList: [], //标准选中的数据
saveExportType: "",// 导出文件模态框控制,和文件名称
// 总数
totalNo: 0,
// 当前页数
pageNo: 1,
nonConformitySearch: {
standId: "", // 标准号/名称
standSerialNumber: "",
productName: "", // 项目名称
responsibleUnit: "" // 责任部门
},
zrbmOptions: [], // 责任部门下拉框
// 责任部门
zNodesSItem: [],
myLoading: {
loadData: false
},
//数据查看
historySee: false,
historySeeForm: {},
// 新增编辑框的disabled
serialNumber: true,
// 提交按钮loading
submiting: false,
// 选择人(单选)
roleShowflag: false,
nodeList: [],
// 选择人(多选)
titleMore: '',
nodeListMore: [],
roleShowMore: false,
// 选择责任部门
nodeListZRBM: [],
modalshowflagZRBM: false
};
},
methods: {
getData() {
// 从数据库中查询各下拉框数据
this.$http.get("sys/dictype/getDicTypeListCode", "", {
_this: this
}, res => {
this.zrbmOptions = res.data.ZRBMCLASS; // 责任部门
this.getTableByPage();
}, e => {
})
},
// 查询未符合项table列表
getTableByPage() {
this.myLoading.loadData = true;
this.$http.get("sarStandUnqualified/sar-stand-unqualified", {
...this.nonConformitySearch,
current: this.pageNo,
size: this.$store.getters.userInfo.configContent
}, {
_this: this
}, res => {
this.myLoading.loadData = false;
this.totalNo = res.data.total;
this.pageNo = 1;
this.nonList = res.data.records;
this.nonList.forEach(item => {
// 责任部门转换
if (item.responsibleUnit !== null || item.responsibleUnit !== "") {
let k = (item.responsibleUnit || "").split(",");
for (let i in this.zrbmOptions) {
for (let m = 0; m < k.length; m++) {
if (this.zrbmOptions[i].value === k[m]) {
k[m] = this.zrbmOptions[i].label;
}
item.responsibleUnit = k.join(",");
}
}
}
});
}, e => {
this.myLoading.loadData = false;
});
},
// 点击历史记录按钮事件
historyClick() {
this.$router.push({
name: "HistoricalData"
});
},
//导出
exportStandard() {
if (this.selectedList.length > 0) {
this.saveExportType = "apart";
} else {
this.saveExportType = "all";
}
this.exportName = "";
this.exportModelFlag = true;
},
//取消导出
cancal() {
this.exportModelFlag = false;
},
//确认导出
exportTestItem() {
if (this.saveExportType === "apart") {
if (this.selectedList != null && this.selectedList != "") {
const exportURL = interfaceUrl + "sarStandUnqualified/sar-stand-unqualified/exportStandUnqulifiedExcel?" +
"exportType" + this.saveExportType + "&ids=" + this.selectedList.join(",") + "&exportName=" + this.exportName;
window.open(exportURL);
this.$message.success("导出信息成功");
}
} else if (this.saveExportType === "all") {
const exportURL = interfaceUrl + "sarStandUnqualified/sar-stand-unqualified/exportStandUnqulifiedExcel?" +
"exportType" + this.saveExportType + "&ids=" + this.selectedList.join(",") + "&exportName=" + this.exportName;
window.open(exportURL);
this.$message.success("导出信息成功");
}
this.exportModelFlag = false;
this.selectedList = [];
},
//批量关闭
batchClose() {
if (this.selectedList.length === 0) {
this.$message.warning("请选择一条数据进行关闭");
} else {
this.$confirm("确认关闭这些数据?", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "common-button-primary",
cancelButtonTxe: "取消",
type: "warning",
roundButton: false
}).then(() => {
this.$http.post("sarStandUnqualified/sar-stand-unqualified/close", {
ids: this.selectedList
}, {
_this: this
}, res => {
if (res.ok) {
this.getTableByPage();
this.selectedList = [];
this.$message.success("关闭成功");
}
});
}).catch(() => {
});
}
},
// 获取组织机构数据
getOrgTreeSource() {
this.$http.get("sys/org/getTree", {}, {
_this: this
},
res => {
if (res.ok) {
let treeNode = [];
res.data.map((item, index) => {
let treeItem = {};
for (let key in item) {
if (key === "orgName") {
treeItem.name = item[key];
} else {
treeItem[key] = item[key];
}
}
treeNode[index] = treeItem;
});
this.zNodesS = JSON.parse(JSON.stringify(treeNode));
this.zNodesSItem = JSON.parse(JSON.stringify(treeNode));
this.searchInlandNodes = JSON.parse(JSON.stringify(treeNode));
}
}, e => {
});
},
treeClickSearch(treeId, treeNode) {
this.nonConformitySearch.responsibleUnit = treeNode.id;
this.nonConformitySearch.responsibleUnitShow = treeNode.name;
},
// 清空 查询条件
clearAllSearch(search = true) {
this.nonConformitySearch = {
standId: "",
productName: "",
responsibleUnit: ""
};
this.getTableByPage();
},
// 修改成表格样式后,选择项勾选改变
standSelectChange(data) {
this.selectedList = [];
for (let i = 0; i < data.length; i++) {
this.selectedList.push(data[i].id);
}
},
// 更多
handleCommand(command) {
switch (command[1]) {
case "查看":
this.showUser(command[0]);
break;
case "编辑":
this.projectEdit(command[0]);
break;
}
},
//获取项目数据
getProjectData() {
this.$http.get("sarStandProjectLibrary/queryProjectWorkFlow", {
page: this.page,
pageSize: this.pageSize,
...this.projectSearch
}, {
_this: this
}, res => {
if (res.data === null) {
this.ProjectDatas = "";
this.total = 0;
} else {
this.ProjectDatas = res.data.Maintenance.records;
this.total = res.data.Maintenance.total;
}
});
},
//提交
submit() {
const id = this.addForm.id;
const closeState = this.addForm.closeState;
const standId = this.addForm.productId // 此处standId储存项目下的标准的id
const standSerialNumber = this.addForm.standSerialNumber;
const standName = this.addForm.standName;
const itemsNum = this.addForm.itemsNum;
const itemsName = this.addForm.itemsName;
const productType = this.addForm.productType;
const productLine = this.addForm.productLine;
const productName = this.addForm.productName;
const productId = this.addForm.projectNumber;
const reason = this.addForm.reason;
const responsibleUnit = this.addForm.responsibleUnit;
const dutyEngineer = this.addForm.dutyEngineer;
const authEngineer = this.addForm.authEngineer;
const qaEngineer = this.addForm.qaEngineer;
const planCloseTime = this.addForm.planCloseTime;
if (this.drawerTitle === "新增") {
this.$refs["addForm"].validate((valid) => {
if (valid) {
this.submiting = true
addUn(
closeState, standId, standSerialNumber,
standName, itemsNum, itemsName, productType,
productLine, productName, productId,reason,
responsibleUnit, dutyEngineer,
authEngineer, qaEngineer, planCloseTime).then(res => {
if (res.ok) {
this.submiting = false
this.$message.success("新增成功");
this.drawerTable = false;
this.getTableByPage();
}
});
} else {
this.$message.warning("请完善基础信息");
this.submiting = false
}
});
} else {
this.$refs["addForm"].validate((valid) => {
if (valid) {
this.submiting = true
editUn(
closeState, standId, standSerialNumber,
standName, itemsNum, itemsName, productType,
productLine, productName, reason, responsibleUnit,
dutyEngineer, authEngineer, qaEngineer,
planCloseTime, id).then(res => {
if (res.ok) {
this.submiting = false
this.$message.success("编辑成功");
this.drawerTable = false;
this.getTableByPage();
}
});
} else {
this.$message.warning("请完善基础信息");
this.submiting = false
}
});
}
},
addDrawerClose() {
this.addForm = {}
if (this.drawerTitle === '编辑') {
this.getData()
}
this.drawerTable = false;
}, // 关闭新增drawer
//带入条款确定事件
replaceLawsNumModelBt() {
if (this.selectItems.length > 1) {
this.$message.warning("您只能选择一条数据进行带入");
} else if (this.selectItems.length <= 0) {
this.$message.warning("请至少选择一条数据进行带入");
} else {
this.addForm.itemsName = this.selectItems[0].itemsName;
this.addForm.itemsNum = this.selectItems[0].itemsNum;
this.itemModel = false;
}
},
//查询项目下的标准
getStandData(productId) {
this.$http.get("sarStandProjectLibrary/queryStandInfo", { id: productId }, {
_this: this
}, res => {
res.data.records.forEach(item => {
if (item.zrbm === "[]") {
item.zrbm = "";
}
});
this.dataList = res.data.records;
/*this.dataList.forEach(item => {
// 责任部门转换
if (item.zrbm !== null || item.zrbm !== "") {
let k = (item.zrbm || "").split(",");
for (let i in this.zrbmOptions) {
for (let m = 0; m < k.length; m++) {
if (this.zrbmOptions[i].value === k[m]) {
k[m] = this.zrbmOptions[i].label;
}
item.zrbm = k.join(",");
}
}
}
});*/
});
},
//新增事件
addModel() {
this.dataList = []
this.serialNumber = true
this.drawerTitle = "新增";
this.getProjectData()
this.drawerTable = true
},
//编辑事件
projectEdit(row) {
this.drawerTitle = "编辑";
this.addForm = row
let productId = row.standId
this.getProjectData()
this.getStandData(productId)
this.serialNumber = false
this.drawerTable = true;
},
//点击查看按钮事件
showUser(row) {
this.historySeeForm = JSON.parse(JSON.stringify(row));
this.historySee = true;
this.$nextTick(() => {
const arr = [];
let questionType = [];
if (this.historySeeForm.quesType) {
questionType = this.historySeeForm.quesType.split(",");
questionType.map((item) => {
this.optionList.map((opr) => {
if (item === opr.value) {
item = opr.label;
arr.push(item);
}
});
});
this.historySeeForm.quesType = arr.toString();
}
});
},
// 点击查看
handlePreview(item) {
let routeUrl = this.$router.resolve({
name: "OtherStandardDetails",
params: {
id: item.standId,
pageType: "FOREIGN_STAND"
// pageType: item.standType + '_STAND'
}
});
window.open(routeUrl.href, "_blank");
},
detailsStandard(item) {
this.$http.post("lawss/sarTestItem/validateStandNumber", {
standNumber: item.standNum
}, {
_this: this
}, res => {
this.pageType = res.data.standType;
let name = "";
switch (this.pageType) {
case "FOREIGN_LAWS":
name = "OtherLawsDetails";
break;
case "INLAND_STAND":
name = "OtherStandardDetails";
break;
case "FOREIGN_STAND":
name = "OtherStandardDetails";
break;
}
let routeUrl = this.$router.resolve({
name: name,
params: {
id: res.data.standid,
pageType: this.pageType
}
});
window.open(routeUrl.href, "_blank");
}, e => {
});
},
// 分页事件
pageChangeNo(page) {
this.pageNo = page;
this.getTableByPage();
},
pageSizeChangeNo(pageSize) {
this.pageSizeNo = pageSize;
this.getTableByPage();
},
/** 项目名称change事件 */
handleChange(val) {
console.log(val);
if (this.drawerTitle === '编辑') {
this.addForm.standName = ''
this.addForm.standSerialNumber = ''
}
this.addForm.productId = val.id
this.addForm.projectNumber = val.projectNumber
this.addForm.productLine = val.productLine
this.addForm.productName = val.projectName
this.addForm.productType = val.projectPlatfor
this.serialNumber = false
let productId = val.id
this.getStandData(productId)
},
/** 标准号change事件 */
standChange(item) {
this.addForm.standName = item.standName
this.addForm.standSerialNumber = item.standSort + '-' + item.standNumber + '-' + item.standYear
},
/** 责任工程师选择 */
choiceZRR(type, title, id) {
this.nodeList = []
this.nodeList.push(id)
this.type = type
this.roleShowflag = true
},
drawerCheck(data) {
this.addForm.dutyEngineer = data[0].name
this.roleShowflag = false
},
/** 选择认证工程师和质量工程师 */
choiceMore(type, title, id) {
this.nodeListMore = []
this.nodeListMore.push(id)
this.type = type
this.titleMore = title
this.roleShowMore = true
},
drawerMore(data) {
var idList = ''
var nameList = ''
data.forEach(item => {
if (nameList.length > 0) {
nameList += ','
idList += ','
}
idList += item.id
nameList += item.name
})
if (this.type === 'authEngineer') {
this.addForm.authEngineer = nameList
} else {
this.addForm.qaEngineer = nameList
}
this.roleShowMore = true
},
/** 选择责任部门 */
choiceZRBM(type, title, id) {
this.nodeListZRBM = []
this.nodeListZRBM.push(id)
this.modalshowflagZRBM = true
},
drawerCheckZRBM(data) {
let idList = ''
let nameList = ''
data.forEach(item => {
if (nameList.length > 0) {
nameList += ','
idList += ','
}
idList += item.id
nameList += item.name
})
this.addForm.responsibleUnit = nameList;
},
},
mounted() {
//查询已维护的项目
this.getProjectData();
this.getData()
// 加载所有的部门
this.getOrgTreeSource();
}
};
</script>
<style lang="less" scoped>
.el-select-dropdown__item.selected {
color: #606266 !important;
}
#rectification-dataBase {
/deep/ .el-table__fixed {
height: 100% !important; //设置高优先,以覆盖内联样式
}
/deep/ .el-table__fixed-right {
height: 100% !important; //设置高优先,以覆盖内联样式
}
/deep/ .table-wrap {
.el-table__fixed {
height: calc(~'100% - 20px') !important;
}
}
height: 100%;
display: flex;
flex-direction: column;
.content-center {
margin-left: 10px;
margin-bottom: 10px;
}
.container {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
.table-wrap {
flex: 1;
overflow: hidden;
position: relative;
.inner-wrap {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
.footer {
/deep/ .pagination {
position: static;
}
}
}
.add-form-item {
/deep/ .el-input__inner {
width: 370px;
}
}
/deep/.label-input-form .add-form-item .el-input--suffix {
padding-right: 0px;
}
.add-input {
/deep/ .el-input__inner {
width: 370px;
}
}
.tableFooter {
height: 49px;
float: right;
}
.demo-drawer-content {
.content {
.standard-table-search {
/deep/.el-input.is-disabled .el-input__inner {
background-color: #fff;
color: #7e8083;
}
}
}
}
}
</style>