提交代码
This commit is contained in:
parent
ba976f38d1
commit
f853632424
|
@ -72,7 +72,7 @@
|
|||
<template #default="scope">
|
||||
<el-button type="primary" text class="replayTextBtn" v-hasPermi="['ppeTool:edit']"
|
||||
@click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-divider direction="vertical" class="verticalLine" />
|
||||
<el-divider direction="vertical" class="verticalLine" v-hasPermi="['ppeTool:edit']" />
|
||||
<el-button type="primary" text class="deleteTextBtn" v-hasPermi="['ppeTool:delete']"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
</el-row>
|
||||
<el-row class="myRow" :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="标定信息" prop="fileContent">
|
||||
<el-form-item label="标定信息" :prop="fileContent">
|
||||
<el-upload class="upload-demo" drag action="#" :http-request="requestDocUpload"
|
||||
:file-list="docUploadList" :on-remove="removeDocUpload">
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
|
@ -204,7 +204,7 @@ const handleChoseDependency = (val) => {
|
|||
|
||||
// 标定文件模板下载
|
||||
const downloadDocxTemplate = (val) => {
|
||||
const link = document.createElement('a')
|
||||
const link = document.createElement('a')
|
||||
if (val == 'WI') {
|
||||
link.href = '/附录2:跨接盒检测清单V2.0 HV Adapter Check List.pdf'
|
||||
link.download = '附录2:跨接盒检测清单V2.0 HV Adapter Check List.pdf' // 设置下载文件名
|
||||
|
@ -227,6 +227,7 @@ const requestDocUpload = (options) => {
|
|||
formData.append('file', file);
|
||||
uploadFile(formData).then(res => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess("上传成功")
|
||||
docUploadList.value.push({
|
||||
name: res.originalFilename,
|
||||
url: baseUrl + res.fileName,
|
||||
|
@ -254,10 +255,13 @@ const handleCancel = () => {
|
|||
const handleSubmit = () => {
|
||||
proxy.$refs["ruleFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (docUploadList.value.length == 0) {
|
||||
proxy.$modal.msgWarning("请上传标定文件")
|
||||
return false
|
||||
if (ruleForm.value.toolName == '高压跨接盒标定') {
|
||||
if (docUploadList.value.length == 0) {
|
||||
proxy.$modal.msgWarning("请上传标定文件")
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
ruleForm.value.fileContent = JSON.stringify(docUploadList.value)
|
||||
if (ruleForm.value.id != undefined) {
|
||||
updateBusPpeTools(ruleForm.value).then(response => {
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
<el-text v-if="scope.row.level == 1" type="success" class="successText">建议项</el-text>
|
||||
<el-text v-if="scope.row.level == 2" type="info" class="infoinfoText">一般偏差</el-text>
|
||||
<el-text v-if="scope.row.level == 3" type="danger" class="dangerText">主要偏差</el-text>
|
||||
<el-text v-if="scope.row.level == 4" type="danger" class="yxText">优秀项</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="planDoneTime" label="计划完成时间" width="150">
|
||||
|
@ -63,11 +64,13 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" width="100">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" v-if="scope.row.state == 0 || scope.row.state == 9" text
|
||||
class="replayTextBtn" v-hasPermi="['examinerEscTask:correction']" @click="handleCorrection(scope.row)">立即整改</el-button>
|
||||
|
||||
<el-button type="primary" v-if="scope.row.state == 1 || scope.row.state == 2" text
|
||||
class="replayTextBtn" v-hasPermi="['examinerEscTask:viewDetail']" @click="handleView(scope.row)">查看</el-button>
|
||||
<el-button type="primary" v-if="(scope.row.state == 0 || scope.row.state == 9) && scope.row.correctionFlag == 1" text
|
||||
class="replayTextBtn" v-hasPermi="['examinerEscTask:correction']"
|
||||
@click="handleCorrection(scope.row)">立即整改</el-button>
|
||||
|
||||
<el-button type="primary" v-if="scope.row.state == 1 || scope.row.state == 2 || scope.row.correctionFlag == 0" text
|
||||
class="replayTextBtn" v-hasPermi="['examinerEscTask:viewDetail']"
|
||||
@click="handleView(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -232,6 +235,13 @@ const handleCorrection = (record) => {
|
|||
color: #DD9200;
|
||||
}
|
||||
|
||||
.yxText {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
color: #767C81;
|
||||
}
|
||||
|
||||
.successText {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="部门" prop="deptId">
|
||||
<el-tree-select v-model="ruleForm.deptId" filterable :data="enabledDeptOptions" clearable
|
||||
:props="{ value: 'id', label: 'label', children: 'children' }" value-key="id"
|
||||
placeholder="请选择部门" check-strictly />
|
||||
<el-tree-select v-model="ruleForm.deptId" filterable :data="enabledDeptOptions"
|
||||
clearable :props="{ value: 'id', label: 'label', children: 'children' }"
|
||||
value-key="id" placeholder="请选择部门" check-strictly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
@ -109,6 +109,8 @@
|
|||
class="infoinfoText">一般偏差</el-text>
|
||||
<el-text v-if="scope.row.level == 1 && !scope.row.editFlag" type="success"
|
||||
class="successText">建议项</el-text>
|
||||
<el-text v-if="scope.row.level == 4 && !scope.row.editFlag" type="success"
|
||||
class="yxText">优秀项</el-text>
|
||||
<el-select v-show="scope.row.editFlag" v-model="scope.row.level" placeholder="请选择"
|
||||
clearable style="width: 120px">
|
||||
<el-option v-for="item in leveProList" :key="item.value" :label="item.label"
|
||||
|
@ -116,6 +118,19 @@
|
|||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="correctionFlag" label="是否整改" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<el-text v-if="scope.row.correctionFlag == 1 && !scope.row.editFlag" type="danger"
|
||||
class="dangerText">是</el-text>
|
||||
<el-text v-if="scope.row.correctionFlag == 0 && !scope.row.editFlag" type="danger"
|
||||
class="successText">否</el-text>
|
||||
<el-select v-show="scope.row.editFlag" v-model="scope.row.correctionFlag" placeholder="请选择"
|
||||
clearable style="width: 86px">
|
||||
<el-option v-for="item in correctionFlagList" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="chargeUserName" label="整改负责人" width="120" />
|
||||
<el-table-column prop="planDoneTime" label="计划完成时间" width="160">
|
||||
<template #default="scope">
|
||||
|
@ -138,23 +153,22 @@
|
|||
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<div v-show="!scope.row.editFlag">
|
||||
<el-button link type="primary" @click="handleEditClick(scope.row, scope.$index)"
|
||||
v-hasPermi="['system:config:edit']">编辑</el-button>
|
||||
<el-button link type="primary"
|
||||
@click="handleEditClick(scope.row, scope.$index)">编辑</el-button>
|
||||
<el-divider direction="vertical" class="verticalLine" />
|
||||
<el-button link type="primary" @click="handleRemove(scope.$index)"
|
||||
v-hasPermi="['system:config:remove']">删除</el-button>
|
||||
<el-button link type="primary" @click="handleRemove(scope.$index)">删除</el-button>
|
||||
</div>
|
||||
<div v-show="scope.row.editFlag">
|
||||
<el-button link type="primary" @click="handleSaveClick(scope.row, scope.$index)"
|
||||
v-hasPermi="['system:config:edit']">保存</el-button>
|
||||
<el-button link type="primary"
|
||||
@click="handleSaveClick(scope.row, scope.$index)">保存</el-button>
|
||||
<el-divider direction="vertical" class="verticalLine" />
|
||||
<el-button link type="primary" @click="handleCancelClick(scope.row, scope.$index)"
|
||||
v-hasPermi="['system:config:remove']">取消</el-button>
|
||||
<el-button link type="primary"
|
||||
@click="handleCancelClick(scope.row, scope.$index)">取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button class="problemAddBtn" :disabled="ruleForm.openItemCount == 0" @click="handleAddProblem">
|
||||
<el-button class="problemAddBtn" @click="handleAddProblem">
|
||||
<img :src="grayAddIcon" class="custom-icon" style="margin-right: 10px;" />
|
||||
新增
|
||||
</el-button>
|
||||
|
@ -196,11 +210,16 @@ const showTableData = ref([])
|
|||
// 缓存数据
|
||||
const cachShowTableData = ref([])
|
||||
// 按钮组配置
|
||||
const ToolOptions = ref(['全部', '主要偏差', '一般偏差', '建议项'])
|
||||
const ToolOptions = ref(['全部', '主要偏差', '一般偏差', '建议项', '优秀项'])
|
||||
const leveProList = ref([
|
||||
{ value: 3, label: '主要偏差' },
|
||||
{ value: 2, label: '一般偏差' },
|
||||
{ value: 1, label: '建议项' }
|
||||
{ value: 1, label: '建议项' },
|
||||
{ value: 4, label: '优秀项' }
|
||||
])
|
||||
const correctionFlagList = ref([
|
||||
{ value: 0, label: '否' },
|
||||
{ value: 1, label: '是' }
|
||||
])
|
||||
const activeIndex = ref(0)
|
||||
const levelList = ref([
|
||||
|
@ -324,24 +343,25 @@ const filterDisabledDept = (deptList) => {
|
|||
return true
|
||||
})
|
||||
}
|
||||
// 计算开口项数量
|
||||
const handleCountOpenItemCount = () => {
|
||||
ruleForm.value.openItemCount = showTableData.value.filter(item => item.level == 2 || item.level == 3).length
|
||||
}
|
||||
// 新增问题
|
||||
const handleAddProblem = () => {
|
||||
if (showTableData.value.length < ruleForm.value.openItemCount) {
|
||||
const itemProblem = {
|
||||
safetyReviewId: ruleForm.id ? ruleForm.safetyReviewId : null,
|
||||
remark: null,
|
||||
level: null,
|
||||
chargeUserId: escUserId.value,
|
||||
chargeUserName: escUserName.value,
|
||||
planDoneTime: null,
|
||||
state: 0,
|
||||
editFlag: true
|
||||
}
|
||||
showTableData.value.push(itemProblem)
|
||||
cachShowTableData.value.push(itemProblem)
|
||||
} else {
|
||||
proxy.$modal.msgError("填报问题不允许超出开口项数量!!!");
|
||||
const itemProblem = {
|
||||
safetyReviewId: ruleForm.id ? ruleForm.safetyReviewId : null,
|
||||
remark: null,
|
||||
level: null,
|
||||
correctionFlag: null, // 是否需要整改 0 否 1 是
|
||||
chargeUserId: escUserId.value,
|
||||
chargeUserName: escUserName.value,
|
||||
planDoneTime: null,
|
||||
state: 0,
|
||||
editFlag: true
|
||||
}
|
||||
showTableData.value.push(itemProblem)
|
||||
cachShowTableData.value.push(itemProblem)
|
||||
}
|
||||
// 编辑问题
|
||||
const handleEditClick = (row, rowIndex) => {
|
||||
|
@ -353,6 +373,8 @@ const handleEditClick = (row, rowIndex) => {
|
|||
const handleRemove = (index) => {
|
||||
showTableData.value.splice(index, 1)
|
||||
cachShowTableData.value.splice(index, 1)
|
||||
// 计算开口项数量
|
||||
handleCountOpenItemCount()
|
||||
}
|
||||
// 保存问题
|
||||
const handleSaveClick = (row, rowIndex) => {
|
||||
|
@ -360,12 +382,16 @@ const handleSaveClick = (row, rowIndex) => {
|
|||
var editRow = JSON.stringify(row)
|
||||
showTableData.value[rowIndex] = JSON.parse(editRow)
|
||||
cachShowTableData.value[rowIndex] = JSON.parse(editRow)
|
||||
// 计算开口项数量
|
||||
handleCountOpenItemCount()
|
||||
}
|
||||
// 取消编辑
|
||||
const handleCancelClick = (row, rowIndex) => {
|
||||
const cacheRow = JSON.stringify(cachShowTableData.value[rowIndex])
|
||||
showTableData.value[rowIndex] = JSON.parse(cacheRow)
|
||||
row.editFlag = false
|
||||
// 计算开口项数量
|
||||
handleCountOpenItemCount()
|
||||
}
|
||||
// 问题等级过滤
|
||||
const handleChangeLeve = (index, _level) => {
|
||||
|
@ -373,6 +399,7 @@ const handleChangeLeve = (index, _level) => {
|
|||
if (_level == '主要偏差') showTableData.value = cachShowTableData.value.filter(item => item.level == 3)
|
||||
else if (_level == '一般偏差') showTableData.value = cachShowTableData.value.filter(item => item.level == 2)
|
||||
else if (_level == '建议项') showTableData.value = cachShowTableData.value.filter(item => item.level == 1)
|
||||
else if (_level == '优秀项') showTableData.value = cachShowTableData.value.filter(item => item.level == 4)
|
||||
else showTableData.value = cachShowTableData.value
|
||||
}
|
||||
|
||||
|
@ -390,6 +417,7 @@ const handleSubmit = () => {
|
|||
proxy.$modal.msgWarning("请填报问题")
|
||||
return false
|
||||
}
|
||||
handleCountOpenItemCount()
|
||||
ruleForm.value.reviewProblemList = showTableData.value
|
||||
if (ruleForm.value.id != undefined) {
|
||||
updateBusSafetyReview(ruleForm.value).then(response => {
|
||||
|
@ -525,6 +553,13 @@ const handleSubmit = () => {
|
|||
color: #00B32A;
|
||||
}
|
||||
|
||||
.yxText {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
color: #767C81;
|
||||
}
|
||||
|
||||
.dangerText {
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
|
@ -730,8 +765,8 @@ const handleSubmit = () => {
|
|||
color: #BABDC0;
|
||||
border: 1px dashed #BABDC0;
|
||||
}
|
||||
|
||||
.verticalLine {
|
||||
border-left: 1px solid #0090ff !important;
|
||||
}
|
||||
|
||||
</style>
|
|
@ -104,11 +104,11 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工号" align="center" min-width="130" key="workNo" prop="workNo"
|
||||
v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||
v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="中文姓名" align="center" min-width="130" key="nickName" prop="nickName"
|
||||
v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="英文姓名" align="center" min-width="210" key="englishName" prop="englishName"
|
||||
v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||
v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="登录账号" align="center" min-width="130" key="userName" prop="userName"
|
||||
v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="邮箱" align="center" min-width="280" key="email" prop="email"
|
||||
|
@ -266,7 +266,7 @@
|
|||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="角色">
|
||||
<el-form-item label="角色" prop="roleIds">
|
||||
<el-select v-model="form.roleIds" multiple placeholder="请选择">
|
||||
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId"
|
||||
:disabled="item.status == 1"></el-option>
|
||||
|
@ -376,6 +376,17 @@ const columns = ref([
|
|||
{ key: 6, label: `创建时间`, visible: true }
|
||||
])
|
||||
|
||||
const validateRoles = (rule, value, callback) => {
|
||||
console.log('选择值', value)
|
||||
const forbiddenRoles = ['3', '4', '5']
|
||||
const selectedForbidden = value.filter(role => forbiddenRoles.includes(role))
|
||||
|
||||
if (selectedForbidden.length > 1) {
|
||||
callback(new Error('不能同时选择培训中心审核员、标签审核员和安全审查员角色'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
|
@ -383,7 +394,7 @@ const data = reactive({
|
|||
pageSize: 10,
|
||||
status: undefined,
|
||||
userName: undefined,
|
||||
phonenumber: undefined,
|
||||
phonenumber: undefined,
|
||||
deptId: undefined
|
||||
},
|
||||
rules: {
|
||||
|
@ -397,13 +408,15 @@ const data = reactive({
|
|||
deptId: [{ required: true, message: "请选择归属部门", trigger: ["change"] }],
|
||||
sectionId: [{ required: true, message: "请选择科室", trigger: ["change"] }],
|
||||
dependencyId: [{ required: true, message: "请选择属地", trigger: ["change"] }],
|
||||
roleIds: [{ validator: validateRoles, trigger: 'change' }]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
// 工号输入后 自动关联账号
|
||||
const handleInput = (value) => {
|
||||
form.value.userName = value
|
||||
form.value.userName = value
|
||||
}
|
||||
// 科室数据
|
||||
const sectionData = ref([])
|
||||
|
|
Loading…
Reference in New Issue
Block a user