测试问题优化

This commit is contained in:
BianLzhaoMin 2024-05-07 11:14:11 +08:00
parent 4686425fbb
commit 5a7856a150
3 changed files with 869 additions and 668 deletions

View File

@ -1,6 +1,13 @@
<template>
<el-dialog v-dialogDrag v-loading.fullscreen.lock="fullscreenLoading" :before-close="cancel" :title="dialogTitle"
:visible.sync="dialogShowFlag" append-to-body width="600px">
<el-dialog
v-dialogDrag
v-loading.fullscreen.lock="fullscreenLoading"
:before-close="cancel"
:title="dialogTitle"
:visible.sync="dialogShowFlag"
append-to-body
width="600px"
>
<div class="form_box_one" v-if="!isShow">
<el-form ref="dynamicValidateForm" :model="dynamicValidateForm" class="demo-dynamic" label-width="90px">
<div class="bor_box">
@ -8,8 +15,13 @@
<div class="form_box_line"></div>
<div class="form_box_item">
<el-form-item label="报废原因:">
<el-input v-model="dynamicValidateForm.scrapReason" placeholder="请输入" size="small" maxlength="50"
style="width: 350px"></el-input>
<el-input
v-model="dynamicValidateForm.scrapReason"
placeholder="请输入"
size="small"
maxlength="50"
style="width: 350px"
></el-input>
</el-form-item>
<el-form-item label="损坏原因:">
<el-radio-group style="width: 350px" v-model="dynamicValidateForm.scrapType">
@ -27,10 +39,25 @@
:isShowTip="isShowTip"
@fileListChange="fileListChange"
></uploadImage> -->
<upload style="width: 350px" :file-list="fileList" :action-url="actionUrl" :limit="3" :multiple="true"
@remove="handleRemove" @preview="handlePreview" @before-remove="beforeRemove"
@success="handleSuccess">
<upload
style="width: 350px"
:file-list="fileList"
:action-url="actionUrl"
:limit="3"
:multiple="true"
@remove="handleRemove"
@preview="handlePreview"
@before-remove="beforeRemove"
@success="handleSuccess"
>
<template>
<el-row class="upload-tip">
<el-button size="small" type="primary">点击上传</el-button>
</el-row>
<el-row class="upload-tip">
<span class="tip-text">请上传jpgjpegpng格式的图片单张图片大小不可超过5M最多可上传3张</span>
</el-row>
</template>
</upload>
</el-form-item>
</div>
@ -46,17 +73,31 @@
<p class="form_box_title">数量管理设备</p>
<div class="form_box_line"></div>
<div class="form_box_item">
<el-form-item label="报废数量:" prop="scrapNum" :rules="{
<el-form-item
label="报废数量:"
prop="scrapNum"
:rules="{
required: true,
validator: numberIntegerValidator,
trigger: 'blur',
}">
<el-input v-model="dynamicValidateFormTwo.scrapNum" placeholder="请输入" size="small" maxlength="10"
style="width: 350px"></el-input>
}"
>
<el-input
v-model="dynamicValidateFormTwo.scrapNum"
placeholder="请输入"
size="small"
maxlength="10"
style="width: 350px"
></el-input>
</el-form-item>
<el-form-item label="报废原因:">
<el-input v-model="dynamicValidateFormTwo.scrapReason" placeholder="请输入" size="small" maxlength="50"
style="width: 350px"></el-input>
<el-input
v-model="dynamicValidateFormTwo.scrapReason"
placeholder="请输入"
size="small"
maxlength="50"
style="width: 350px"
></el-input>
</el-form-item>
<el-form-item label="损坏原因:">
<el-radio-group style="width: 350px" v-model="dynamicValidateFormTwo.scrapType">
@ -75,10 +116,25 @@
:isShowTip="isShowTip"
@fileListChange="fileListChange"
></uploadImage> -->
<upload style="width: 350px" :file-list="fileList" :action-url="actionUrl" :limit="3" :multiple="true"
@remove="handleRemove" @preview="handlePreview" @before-remove="beforeRemove"
@success="handleSuccess">
<upload
style="width: 350px"
:file-list="fileList"
:action-url="actionUrl"
:limit="3"
:multiple="true"
@remove="handleRemove"
@preview="handlePreview"
@before-remove="beforeRemove"
@success="handleSuccess"
>
<template>
<el-row class="upload-tip">
<el-button size="small" type="primary">点击上传</el-button>
</el-row>
<el-row class="upload-tip">
<span class="tip-text">请上传jpgjpegpng格式的图片单张图片大小不可超过5M最多可上传3张</span>
</el-row>
</template>
</upload>
</el-form-item>
</div>
@ -414,4 +470,14 @@ export default {
justify-content: flex-end;
align-items: center;
}
.upload-tip {
text-align: left;
.tip-text {
font-size: 13px;
color: red;
letter-spacing: 1px;
}
}
</style>

View File

@ -1,23 +1,40 @@
<template>
<div class="app-container" id="repair">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="120px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="关键字" prop="keyword">
<el-input v-model="queryParams.keyword" placeholder="请输入关键字" clearable maxlength="50"
style="width: 240px" @keyup.enter.native="handleQuery" />
<el-input
v-model="queryParams.keyword"
placeholder="请输入关键字"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单位名称" prop="backUnit">
<el-select v-model="queryParams.backUnit" placeholder="请选择单位名称" clearable filterable
style="width: 240px">
<el-option v-for="dict in unitInfoSelectList" :key="dict.unitId" :label="dict.unitName"
:value="dict.unitId" />
<el-select
v-model="queryParams.backUnit"
placeholder="请选择单位名称"
clearable
filterable
style="width: 240px"
>
<el-option
v-for="dict in unitInfoSelectList"
:key="dict.unitId"
:label="dict.unitName"
:value="dict.unitId"
/>
</el-select>
</el-form-item>
<el-form-item label="工程名称" prop="backPro">
<el-select v-model="queryParams.backPro" placeholder="请选择工程名称" clearable filterable
style="width: 240px">
<el-option v-for="dict in projectSelectList" :key="dict.projectId" :label="dict.projectName"
:value="dict.projectId" />
<el-select v-model="queryParams.backPro" placeholder="请选择工程名称" clearable filterable style="width: 240px">
<el-option
v-for="dict in projectSelectList"
:key="dict.projectId"
:label="dict.projectName"
:value="dict.projectId"
/>
</el-select>
</el-form-item>
<el-form-item label="工机具类型" prop="type">
@ -39,19 +56,37 @@
<Tree ref="mychildSon" :width="240" :dataList="deptList" @changeId="selectDrop"></Tree>
</el-form-item>
<el-form-item label="退料单号" prop="backCode">
<el-input v-model="queryParams.backCode" placeholder="退料单号" clearable maxlength="50"
style="width: 240px" @keyup.enter.native="handleQuery" />
<el-input
v-model="queryParams.backCode"
placeholder="退料单号"
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维修状态" prop="repairStatus">
<el-select v-model="queryParams.repairStatus" placeholder="请选择维修状态" clearable filterable
style="width: 240px">
<el-select
v-model="queryParams.repairStatus"
placeholder="请选择维修状态"
clearable
filterable
style="width: 240px"
>
<el-option v-for="dict in dicSelectList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
<el-form-item label="任务创建时间">
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
@ -61,8 +96,9 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button :disabled="!checkResultOne || multiple" type="primary" plain size="mini"
@click="complete(1)">提交审核</el-button>
<el-button :disabled="!checkResultOne || multiple" type="primary" plain size="mini" @click="complete(1)">
提交审核
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
@ -87,11 +123,18 @@
<el-table-column sortable label="维修状态" align="center" prop="repairStatus" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
<template slot-scope="scope">
<el-button size="mini" type="primary" icon="el-icon-zoom-in"
@click="handleSee(scope.row, 'see')">查看</el-button>
<el-button size="mini" type="warning" icon="el-icon-edit"
<el-button size="mini" type="primary" icon="el-icon-zoom-in" @click="handleSee(scope.row, 'see')">
查看
</el-button>
<el-button
size="mini"
type="warning"
icon="el-icon-edit"
:disabled="scope.row.repairStatusCode == '44'"
@click="handleUpdate(scope.row, 'update')">维修</el-button>
@click="handleUpdate(scope.row, 'update')"
>
维修
</el-button>
<!-- <el-button
size="mini"
type="info"
@ -104,47 +147,94 @@
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 维修对话框 -->
<el-dialog :visible.sync="open" width="1650px" append-to-body :before-close="onClose">
<el-form :model="dialogQueryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="100px">
<el-form
:model="dialogQueryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-row>
<el-form-item label="关键字" prop="keyword">
<el-input v-model="dialogQueryParams.keyword" placeholder="请输入关键字" clearable maxlength="50"
style="width: 240px" />
<el-input
v-model="dialogQueryParams.keyword"
placeholder="请输入关键字"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="类型名称" prop="typeName">
<selectTree ref="mychildDialog" style="width: 240px" :treeList="deptList" :treeProps="{
<selectTree
ref="mychildDialog"
style="width: 240px"
:treeList="deptList"
:treeProps="{
children: 'children',
label: 'label',
}" nodeKey="id" :defaultSelect="true" :defaultData="defaultData" :clearable="true"
:placeholder="'请选择类型名称'" @handleNodeClick="selectDropDialog"></selectTree>
}"
nodeKey="id"
:defaultSelect="true"
:defaultData="defaultData"
:clearable="true"
:placeholder="'请选择类型名称'"
@handleNodeClick="selectDropDialog"
></selectTree>
</el-form-item>
<el-form-item label="规格型号" prop="type">
<selectTree ref="mychildDialogTwo" style="width: 240px" :treeList="deptTypeList" :treeProps="{
<selectTree
ref="mychildDialogTwo"
style="width: 240px"
:treeList="deptTypeList"
:treeProps="{
children: 'children',
label: 'label',
}" nodeKey="id" :defaultSelect="true" :defaultData="defaultData" :clearable="true"
:placeholder="'请选择规格型号'" @handleNodeClick="selectDropDialogTwo"></selectTree>
}"
nodeKey="id"
:defaultSelect="true"
:defaultData="defaultData"
:clearable="true"
:placeholder="'请选择规格型号'"
@handleNodeClick="selectDropDialogTwo"
></selectTree>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini"
@click="getDialogList">查询</el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="getDialogList">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQueryDialog">重置</el-button>
</el-form-item>
</el-row>
</el-form>
<div style="margin-bottom: 10px" v-if="type == 'update'">
<el-button :disabled="selectionList.length == 0" size="mini" type="primary"
@click="complete(2)">维修合格</el-button>
<el-button :disabled="selectionList.length == 0 || !checkResult" size="mini" type="primary"
@click="complete(3)">完成维修</el-button>
<el-button :disabled="selectionList.length == 0" size="mini" type="primary" @click="complete(2)">
维修合格
</el-button>
<el-button
:disabled="selectionList.length == 0 || !checkResult"
size="mini"
type="primary"
@click="complete(3)"
>
完成维修
</el-button>
</div>
<el-table v-loading="loading" :data="repairList" height="1000px" max-height="500px"
@selection-change="selectionChange">
<el-table
v-loading="loading"
:data="repairList"
height="1000px"
max-height="500px"
@selection-change="selectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
@ -153,12 +243,17 @@
</el-table-column>
<el-table-column label="类型名称" align="center" prop="typeName" sortable :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="type" sortable :show-overflow-tooltip="true" />
<el-table-column label="编码" sortable align="center" prop="code" width="200"
:show-overflow-tooltip="true" />
<el-table-column label="编码" sortable align="center" prop="code" width="200" :show-overflow-tooltip="true" />
<el-table-column label="维修总量" align="center" sortable prop="repairNum" :show-overflow-tooltip="true" />
<el-table-column label="维修合格数量" align="center" sortable width="200" prop="repairedNum"
:show-overflow-tooltip="true" />
<el-table-column
label="维修合格数量"
align="center"
sortable
width="200"
prop="repairedNum"
:show-overflow-tooltip="true"
/>
<el-table-column label="报废数量" align="center" sortable prop="scrapNum" :show-overflow-tooltip="true" />
<el-table-column label="待修状态" align="center" prop="status" :show-overflow-tooltip="true">
<template v-slot="scope">
@ -167,8 +262,13 @@
</el-table-column>
<el-table-column label="维修人员" align="center" prop="repairer" :show-overflow-tooltip="true" />
<el-table-column label="维修时间" align="center" prop="updateTime" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300px"
v-if="type == 'update'">
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="300px"
v-if="type == 'update'"
>
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="internalRepair(scope.row)">内部维修</el-button>
<el-button size="mini" type="success" @click="backRepair(scope.row)">返厂维修</el-button>
@ -180,12 +280,22 @@
</el-table-column>
</el-table>
<pagination v-show="dialogTotal > 0" :total="dialogTotal" :page.sync="dialogQueryParams.pageNum"
:limit.sync="dialogQueryParams.pageSize" @pagination="getDialogList" />
<pagination
v-show="dialogTotal > 0"
:total="dialogTotal"
:page.sync="dialogQueryParams.pageNum"
:limit.sync="dialogQueryParams.pageSize"
@pagination="getDialogList"
/>
</el-dialog>
<el-dialog v-loading.fullscreen.lock="fullscreenLoading" :title="title" :visible.sync="openOne" append-to-body
width="400px">
<el-dialog
v-loading.fullscreen.lock="fullscreenLoading"
:title="title"
:visible.sync="openOne"
append-to-body
width="400px"
>
<div class="submit_box">
<div>
<i class="el-icon-circle-check" style="color: #ff9900; font-size: 30px"></i>
@ -200,8 +310,13 @@
<el-button type="primary" @click="submitOpenOneForm()">确定</el-button>
</div>
</el-dialog>
<el-dialog v-loading.fullscreen.lock="fullscreenLoading" :title="title" :visible.sync="openTwo" append-to-body
width="400px">
<el-dialog
v-loading.fullscreen.lock="fullscreenLoading"
:title="title"
:visible.sync="openTwo"
append-to-body
width="400px"
>
<div class="submit_box_two">
<div>
<i class="el-icon-circle-check" style="color: #00c196; font-size: 30px"></i>
@ -212,12 +327,27 @@
<el-button @click="cancelTwoForm">返回</el-button>
</div>
</el-dialog>
<dialogOneForm :dialogTitle="title" :isShowFlag.sync="isShowOneFlag" :priKey="priKey" :rowObj="rowObj"
@domainChange="domainChange"></dialogOneForm>
<dialogTwoForm :dialogTitle="title" :isShowFlag.sync="isShowTwoFlag" :priKey="priKey" :rowObj="rowObj"
@domainChange="domainChange"></dialogTwoForm>
<dialogThreeForm :dialogTitle="title" :isShowFlag.sync="isShowThreeFlag" :priKey="priKey" :rowObj="rowObj"
@domainChange="domainChange"></dialogThreeForm>
<dialogOneForm
:dialogTitle="title"
:isShowFlag.sync="isShowOneFlag"
:priKey="priKey"
:rowObj="rowObj"
@domainChange="domainChange"
></dialogOneForm>
<dialogTwoForm
:dialogTitle="title"
:isShowFlag.sync="isShowTwoFlag"
:priKey="priKey"
:rowObj="rowObj"
@domainChange="domainChange"
></dialogTwoForm>
<dialogThreeForm
:dialogTitle="title"
:isShowFlag.sync="isShowThreeFlag"
:priKey="priKey"
:rowObj="rowObj"
@domainChange="domainChange"
></dialogThreeForm>
</div>
</template>
@ -325,13 +455,13 @@ export default {
}
},
created() {
getUnitInfoSelectApi().then((res) => {
getUnitInfoSelectApi().then(res => {
this.unitInfoSelectList = res.data
})
getProjectList().then((res) => {
getProjectList().then(res => {
this.projectSelectList = res.data
})
getDicSelectApi({ value: 'wx_task' }).then((res) => {
getDicSelectApi({ value: 'wx_task' }).then(res => {
this.dicSelectList = res.data
})
},
@ -362,7 +492,7 @@ export default {
this.queryParams.startTime = this.dateRange[0]
this.queryParams.endTime = this.dateRange[1]
getRepairTaskListApi(this.queryParams)
.then((response) => {
.then(response => {
this.typeList = response.rows
this.total = response.total
this.loading = false
@ -372,11 +502,11 @@ export default {
})
},
getTree() {
listPartTypeApi().then((response) => {
listPartTypeApi().then(response => {
this.deptList = response.data
// this.deptList = this.handleTree(response.data, "id");
})
getMaTypeSelectApi().then((response) => {
getMaTypeSelectApi().then(response => {
this.deptTypeList = response.data
})
},
@ -448,19 +578,14 @@ export default {
//
handleSelectionChange(selection) {
this.selectionList = selection
this.checkResultOne = selection.every(
(item) => item.repairStatusCode == '43',
)
this.ids = selection.map((item) => item.dictId)
this.checkResultOne = selection.every(item => item.repairStatusCode == '43')
this.ids = selection.map(item => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
selectionChange(selection) {
this.selectionList = selection
this.checkResult = selection.every(
(item) =>
item.repairNum === item.repairedNum + item.scrapNum,
)
this.checkResult = selection.every(item => item.repairNum === item.repairedNum + item.scrapNum)
},
/** 修改按钮操作 */
handleUpdate(row, type) {
@ -497,7 +622,7 @@ export default {
type: this.dialogQueryParams.type,
}
// this.loading = true;
getRepairMaTypeListApi(params).then((res) => {
getRepairMaTypeListApi(params).then(res => {
if (res.code == 200) {
this.repairList = res.rows
this.dialogTotal = res.total
@ -517,41 +642,41 @@ export default {
this.openOne = false
if (this.typeText == 1) {
addEndRepairTaskApi(this.selectionList)
.then((res) => {
.then(res => {
if (res.code == 200) {
this.openTwo = true
this.openTextThree = '已提交审核!'
// this.getDialogList()
}
})
.catch(() => { })
.catch(() => {})
}
if (this.typeText == 2) {
addFastRepairApplyApi(this.selectionList)
.then((res) => {
.then(res => {
if (res.code == 200) {
this.openTwo = true
this.openTextThree = '维修合格操作完成!'
// this.getDialogList()
}
})
.catch(() => { })
.catch(() => {})
}
if (this.typeText == 3) {
let ids = []
let arr = this.selectionList
arr.map((item) => {
arr.map(item => {
ids.push(item.id)
})
addCompleteRepairApi(ids)
.then((res) => {
.then(res => {
if (res.code == 200) {
this.openTwo = true
this.openTextThree = '完成维修!'
// this.getDialogList()
}
})
.catch(() => { })
.catch(() => {})
}
},
//
@ -569,14 +694,14 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
const dataCondition = this.selectionList.map((item) => item.taskId)
const dataCondition = this.selectionList.map(item => item.taskId)
this.download(
'base/repair/export',
{
...this.queryParams,
dataCondition
dataCondition,
},
`维修单_${new Date().getTime()}.xlsx`,
`维修单_${new Date().getTime()}.xlsx`
)
},
internalRepair(row) {
@ -603,14 +728,14 @@ export default {
this.title = '确认操作'
this.openOne = true
this.openTextOne = '确定提交审核么?'
this.openTextTwo = '确定提交审核么?'
// this.openTextTwo = '?'
}
if (type == 2) {
this.typeText = type
this.title = '确认操作'
this.openOne = true
this.openTextOne = '确定维修合格了么?'
this.openTextTwo = '确定维修合格了么?'
// this.openTextTwo = '?'
}
if (type == 3) {
this.typeText = type
@ -632,9 +757,7 @@ export default {
value: '1',
},
]
const foundItem = statusList.find(
(item) => item.value == status,
)
const foundItem = statusList.find(item => item.value == status)
if (foundItem) {
return foundItem.label
}

View File

@ -1,7 +1,19 @@
<template>
<el-upload class="upload-demo" :action="actionUrl" :on-preview="handlePreview" :on-remove="handleRemove"
:before-remove="beforeRemove" :multiple="multiple" :limit="limit" :on-exceed="handleExceed" :file-list="fileList"
:headers="headers" :on-success="handleSuccess" :data="uploadData" :before-upload="beforeUpload">
<el-upload
class="upload-demo"
:action="actionUrl"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:multiple="multiple"
:limit="limit"
:on-exceed="handleExceed"
:file-list="fileList"
:headers="headers"
:on-success="handleSuccess"
:data="uploadData"
:before-upload="beforeUpload"
>
<slot name="default">
<el-button size="small" type="primary">点击上传</el-button>
</slot>
@ -65,21 +77,21 @@ export default {
this.$emit('exceed', files, fileList)
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name} `)
.then(() => {
this.$emit('before-remove', file, fileList)
})
.catch(() => {})
// return this.$confirm(` ${file.name} `)
// .then(() => {
// this.$emit('before-remove', file, fileList)
// })
// .catch(() => {})
},
beforeUpload(file) {
console.log('file', file)
const isJPGorPNG = file.type == 'image/png' || file.type == 'image/jpg' || file.type == 'image/jpeg'
const isLt5M = file.size / 1024 / 1024 < 2 // 2MB
const isLt5M = file.size / 1024 / 1024 < 5 // 5MB
if (!isJPGorPNG) {
this.$message.error('只能上传 JPG/PNG/jpeg 格式的图片')
this.$message.error('只能上传 jpg、jpeg、png 格式的图片')
}
if (!isLt5M) {
this.$message.error('上传图片大小不能超过 2MB')
this.$message.error('上传图片大小不能超过 5MB')
}
return isJPGorPNG && isLt5M
},