Compare commits

..

No commits in common. "b340c8ec01aaedc4e1b979df184ff95a04057167" and "0f3675df58c19d9bf3a7f0d1bd345a0aeaad3ea8" have entirely different histories.

3 changed files with 666 additions and 867 deletions

View File

@ -1,13 +1,6 @@
<template> <template>
<el-dialog <el-dialog v-dialogDrag v-loading.fullscreen.lock="fullscreenLoading" :before-close="cancel" :title="dialogTitle"
v-dialogDrag :visible.sync="dialogShowFlag" append-to-body width="600px">
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">
@ -15,13 +8,8 @@
<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 <el-input v-model="dynamicValidateForm.scrapReason" placeholder="请输入" size="small" maxlength="50"
v-model="dynamicValidateForm.scrapReason" style="width: 350px"></el-input>
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">
@ -39,25 +27,10 @@
:isShowTip="isShowTip" :isShowTip="isShowTip"
@fileListChange="fileListChange" @fileListChange="fileListChange"
></uploadImage> --> ></uploadImage> -->
<upload <upload style="width: 350px" :file-list="fileList" :action-url="actionUrl" :limit="3" :multiple="true"
style="width: 350px" @remove="handleRemove" @preview="handlePreview" @before-remove="beforeRemove"
:file-list="fileList" @success="handleSuccess">
: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>
@ -73,31 +46,17 @@
<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 <el-form-item label="报废数量:" prop="scrapNum" :rules="{
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"
<el-input style="width: 350px"></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 <el-input v-model="dynamicValidateFormTwo.scrapReason" placeholder="请输入" size="small" maxlength="50"
v-model="dynamicValidateFormTwo.scrapReason" style="width: 350px"></el-input>
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">
@ -116,25 +75,10 @@
:isShowTip="isShowTip" :isShowTip="isShowTip"
@fileListChange="fileListChange" @fileListChange="fileListChange"
></uploadImage> --> ></uploadImage> -->
<upload <upload style="width: 350px" :file-list="fileList" :action-url="actionUrl" :limit="3" :multiple="true"
style="width: 350px" @remove="handleRemove" @preview="handlePreview" @before-remove="beforeRemove"
:file-list="fileList" @success="handleSuccess">
: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>
@ -470,14 +414,4 @@ 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,40 +1,23 @@
<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" 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-form-item label="关键字" prop="keyword">
<el-input <el-input v-model="queryParams.keyword" placeholder="请输入关键字" clearable maxlength="50"
v-model="queryParams.keyword" style="width: 240px" @keyup.enter.native="handleQuery" />
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 <el-select v-model="queryParams.backUnit" placeholder="请选择单位名称" clearable filterable
v-model="queryParams.backUnit" style="width: 240px">
placeholder="请选择单位名称" <el-option v-for="dict in unitInfoSelectList" :key="dict.unitId" :label="dict.unitName"
clearable :value="dict.unitId" />
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 style="width: 240px"> <el-select v-model="queryParams.backPro" placeholder="请选择工程名称" clearable filterable
<el-option style="width: 240px">
v-for="dict in projectSelectList" <el-option v-for="dict in projectSelectList" :key="dict.projectId" :label="dict.projectName"
:key="dict.projectId" :value="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">
@ -56,37 +39,19 @@
<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 <el-input v-model="queryParams.backCode" placeholder="退料单号" clearable maxlength="50"
v-model="queryParams.backCode" style="width: 240px" @keyup.enter.native="handleQuery" />
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 <el-select v-model="queryParams.repairStatus" placeholder="请选择维修状态" clearable filterable
v-model="queryParams.repairStatus" style="width: 240px">
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 <el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
v-model="dateRange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
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>
@ -96,9 +61,8 @@
<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" @click="complete(1)"> <el-button :disabled="!checkResultOne || multiple" type="primary" plain size="mini"
提交审核 @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>
@ -123,18 +87,11 @@
<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" @click="handleSee(scope.row, 'see')"> <el-button size="mini" type="primary" icon="el-icon-zoom-in"
查看 @click="handleSee(scope.row, 'see')">查看</el-button>
</el-button> <el-button size="mini" type="warning" icon="el-icon-edit"
<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')" @click="handleUpdate(scope.row, 'update')">维修</el-button>
>
维修
</el-button>
<!-- <el-button <!-- <el-button
size="mini" size="mini"
type="info" type="info"
@ -147,94 +104,47 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
v-show="total > 0" :limit.sync="queryParams.pageSize" @pagination="getList" />
: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 <el-form :model="dialogQueryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
:model="dialogQueryParams" label-width="100px">
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 <el-input v-model="dialogQueryParams.keyword" placeholder="请输入关键字" clearable maxlength="50"
v-model="dialogQueryParams.keyword" style="width: 240px" />
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 <selectTree ref="mychildDialog" style="width: 240px" :treeList="deptList" :treeProps="{
ref="mychildDialog"
style="width: 240px"
:treeList="deptList"
:treeProps="{
children: 'children', children: 'children',
label: 'label', label: 'label',
}" }" nodeKey="id" :defaultSelect="true" :defaultData="defaultData" :clearable="true"
nodeKey="id" :placeholder="'请选择类型名称'" @handleNodeClick="selectDropDialog"></selectTree>
: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 <selectTree ref="mychildDialogTwo" style="width: 240px" :treeList="deptTypeList" :treeProps="{
ref="mychildDialogTwo"
style="width: 240px"
:treeList="deptTypeList"
:treeProps="{
children: 'children', children: 'children',
label: 'label', label: 'label',
}" }" nodeKey="id" :defaultSelect="true" :defaultData="defaultData" :clearable="true"
nodeKey="id" :placeholder="'请选择规格型号'" @handleNodeClick="selectDropDialogTwo"></selectTree>
: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" @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-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" @click="complete(2)"> <el-button :disabled="selectionList.length == 0" size="mini" type="primary"
维修合格 @click="complete(2)">维修合格</el-button>
</el-button> <el-button :disabled="selectionList.length == 0 || !checkResult" size="mini" type="primary"
<el-button @click="complete(3)">完成维修</el-button>
:disabled="selectionList.length == 0 || !checkResult"
size="mini"
type="primary"
@click="complete(3)"
>
完成维修
</el-button>
</div> </div>
<el-table <el-table v-loading="loading" :data="repairList" height="1000px" max-height="500px"
v-loading="loading" @selection-change="selectionChange">
: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">
@ -243,17 +153,12 @@
</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" :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 prop="repairNum" :show-overflow-tooltip="true" />
<el-table-column <el-table-column label="维修合格数量" align="center" sortable width="200" prop="repairedNum"
label="维修合格数量" :show-overflow-tooltip="true" />
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">
@ -262,13 +167,8 @@
</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 <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300px"
label="操作" v-if="type == 'update'">
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>
@ -280,22 +180,12 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="dialogTotal > 0" :total="dialogTotal" :page.sync="dialogQueryParams.pageNum"
v-show="dialogTotal > 0" :limit.sync="dialogQueryParams.pageSize" @pagination="getDialogList" />
:total="dialogTotal"
:page.sync="dialogQueryParams.pageNum"
:limit.sync="dialogQueryParams.pageSize"
@pagination="getDialogList"
/>
</el-dialog> </el-dialog>
<el-dialog <el-dialog v-loading.fullscreen.lock="fullscreenLoading" :title="title" :visible.sync="openOne" append-to-body
v-loading.fullscreen.lock="fullscreenLoading" width="400px">
: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>
@ -310,13 +200,8 @@
<el-button type="primary" @click="submitOpenOneForm()">确定</el-button> <el-button type="primary" @click="submitOpenOneForm()">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog v-loading.fullscreen.lock="fullscreenLoading" :title="title" :visible.sync="openTwo" append-to-body
v-loading.fullscreen.lock="fullscreenLoading" width="400px">
: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>
@ -327,27 +212,12 @@
<el-button @click="cancelTwoForm">返回</el-button> <el-button @click="cancelTwoForm">返回</el-button>
</div> </div>
</el-dialog> </el-dialog>
<dialogOneForm <dialogOneForm :dialogTitle="title" :isShowFlag.sync="isShowOneFlag" :priKey="priKey" :rowObj="rowObj"
:dialogTitle="title" @domainChange="domainChange"></dialogOneForm>
:isShowFlag.sync="isShowOneFlag" <dialogTwoForm :dialogTitle="title" :isShowFlag.sync="isShowTwoFlag" :priKey="priKey" :rowObj="rowObj"
:priKey="priKey" @domainChange="domainChange"></dialogTwoForm>
:rowObj="rowObj" <dialogThreeForm :dialogTitle="title" :isShowFlag.sync="isShowThreeFlag" :priKey="priKey" :rowObj="rowObj"
@domainChange="domainChange" @domainChange="domainChange"></dialogThreeForm>
></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>
@ -455,13 +325,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
}) })
}, },
@ -492,7 +362,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
@ -502,11 +372,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
}) })
}, },
@ -578,14 +448,19 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.selectionList = selection this.selectionList = selection
this.checkResultOne = selection.every(item => item.repairStatusCode == '43') this.checkResultOne = selection.every(
this.ids = selection.map(item => item.dictId) (item) => item.repairStatusCode == '43',
)
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(item => item.repairNum === item.repairedNum + item.scrapNum) this.checkResult = selection.every(
(item) =>
item.repairNum === item.repairedNum + item.scrapNum,
)
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row, type) { handleUpdate(row, type) {
@ -622,7 +497,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
@ -642,7 +517,7 @@ 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 = '已提交审核!'
@ -653,7 +528,7 @@ export default {
} }
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 = '维修合格操作完成!'
@ -665,11 +540,11 @@ export default {
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 = '完成维修!'
@ -694,14 +569,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) {
@ -728,14 +603,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
@ -757,7 +632,9 @@ export default {
value: '1', value: '1',
}, },
] ]
const foundItem = statusList.find(item => item.value == status) const foundItem = statusList.find(
(item) => item.value == status,
)
if (foundItem) { if (foundItem) {
return foundItem.label return foundItem.label
} }

View File

@ -1,19 +1,7 @@
<template> <template>
<el-upload <el-upload class="upload-demo" :action="actionUrl" :on-preview="handlePreview" :on-remove="handleRemove"
class="upload-demo" :before-remove="beforeRemove" :multiple="multiple" :limit="limit" :on-exceed="handleExceed" :file-list="fileList"
:action="actionUrl" :headers="headers" :on-success="handleSuccess" :data="uploadData" :before-upload="beforeUpload">
: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>
@ -77,21 +65,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 < 5 // 5MB const isLt5M = file.size / 1024 / 1024 < 2 // 2MB
if (!isJPGorPNG) { if (!isJPGorPNG) {
this.$message.error('只能上传 jpg、jpeg、png 格式的图片') this.$message.error('只能上传 JPG/PNG/jpeg 格式的图片')
} }
if (!isLt5M) { if (!isLt5M) {
this.$message.error('上传图片大小不能超过 5MB') this.$message.error('上传图片大小不能超过 2MB')
} }
return isJPGorPNG && isLt5M return isJPGorPNG && isLt5M
}, },