测试问题优化

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

View File

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

View File

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