Merge branch 'material-ui' of http://192.168.30.2:3000/bonus/bonus-ui into material-ui

This commit is contained in:
zzyuan 2024-11-20 10:07:29 +08:00
commit 6bff12a6de
4 changed files with 2653 additions and 1068 deletions

View File

@ -28,6 +28,7 @@ export function partTypeTreeList(query) {
}) })
} }
// //维修驳回至退料 // //维修驳回至退料
// export function rejectRepair(data) { // export function rejectRepair(data) {
// return request({ // return request({
@ -44,3 +45,31 @@ export function rejectRepair(taskIds) {
}) })
} }
// 维修保存
export function saveCodeList(data) {
return request({
url: '/material/repair/batchRepairApply',
method: 'post',
data: data,
})
}
//维修提交
export function sendList(data) {
return request({
url: '/material/repair/endRepairTask',
method: 'post',
data: data,
})
}
//维修合格
export function auditPass(data) {
return request({
url: '/material/repair/completeRepair',
method: 'post',
data: data,
})
}

View File

@ -29,6 +29,7 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -37,7 +38,8 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
>新增</el-button >新增
</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -80,7 +82,6 @@
</el-table-column> </el-table-column>
<el-table-column label="附件图片" align="center" width="180"> <el-table-column label="附件图片" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -137,21 +138,38 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<!-- <el-form-item label="租赁单位" prop="unitId">-->
<!-- <el-select-->
<!-- v-model="form.unitId"-->
<!-- filterable-->
<!-- placeholder="请选择租赁单位"-->
<!-- style="width: 100%"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in unitList"-->
<!-- :key="item.unitId"-->
<!-- :label="item.unitName"-->
<!-- :value="item.unitId"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="租赁单位" prop="unitId" > <el-form-item label="租赁单位" prop="unitId" >
<el-select <el-cascader
v-model="form.unitId" v-model="unitId"
:show-all-levels="false"
:options="uniteList"
:props="selectTreeProps"
filterable filterable
clearable
collapse-tags
@change="uniteChange"
placeholder="请选择租赁单位" placeholder="请选择租赁单位"
style="width: 100%" style="width: 100%;"
> :disabled="isEdit"
<el-option ></el-cascader>
v-for="item in unitList"
:key="item.unitId"
:label="item.unitName"
:value="item.unitId"
></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -160,6 +178,7 @@
maxlength="50" maxlength="50"
v-model="form.authPerson" v-model="form.authPerson"
placeholder="请输入授权人" placeholder="请输入授权人"
:disabled="isEdits"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -167,7 +186,22 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="租赁工程" prop="proId"> <el-form-item label="租赁工程" prop="projectId">
<el-cascader
v-model="projectId"
:show-all-levels="false"
:options="projectList"
:props="selectTreeProps"
filterable
clearable
collapse-tags
@change="projectChange"
placeholder="请选择租赁工程"
style="width: 100%;"
:disabled="isEdit"
></el-cascader>
</el-form-item>
<!-- <el-form-item label="租赁工程" prop="proId">
<el-select <el-select
v-model="form.proId" v-model="form.proId"
filterable filterable
@ -181,7 +215,7 @@
:value="item.proId" :value="item.proId"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>-->
</el-col> </el-col>
@ -191,6 +225,7 @@
v-model="form.phone" v-model="form.phone"
placeholder="请输入联系电话" placeholder="请输入联系电话"
maxlength="11" maxlength="11"
:disabled="isEdits"
onkeyup="this.value = this.value.replace(/[^\d]/g,'');" onkeyup="this.value = this.value.replace(/[^\d]/g,'');"
/> />
</el-form-item> </el-form-item>
@ -204,6 +239,7 @@
maxlength="50" maxlength="50"
v-model="form.contractCode" v-model="form.contractCode"
placeholder="请输入合同编号" placeholder="请输入合同编号"
:disabled="isEdits"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -217,6 +253,7 @@
:min="0" :min="0"
:max="9999" :max="9999"
style="width: 100%" style="width: 100%"
:disabled="isEdits"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -231,6 +268,7 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="date" type="date"
placeholder="请选择开始日期" placeholder="请选择开始日期"
:disabled="isEdits"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -242,6 +280,7 @@
type="textarea" type="textarea"
placeholder="请输入备注" placeholder="请输入备注"
maxlength="100" maxlength="100"
:disabled="isEdits"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -250,7 +289,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="租赁单位类型"> <el-form-item label="租赁单位类型">
<el-select v-model="form.protocol" placeholder="请选择租赁单位类型" clearable> <el-select style="width: 100%;" v-model="form.protocol" placeholder="请选择租赁单位类型" clearable :disabled="isEdits">
<el-option label="内部单位" value="1"></el-option> <el-option label="内部单位" value="1"></el-option>
<el-option label="外部单位" value="2"></el-option> <el-option label="外部单位" value="2"></el-option>
</el-select> </el-select>
@ -272,6 +311,7 @@
:class="{ disabled: uploadDisabled }" :class="{ disabled: uploadDisabled }"
:on-preview="picturePreview" :on-preview="picturePreview"
:on-remove="handleRemoveElectricianImgList" :on-remove="handleRemoveElectricianImgList"
:disabled="isEdits"
> >
<!-- 文件格式下载图片格式预览 --> <!-- 文件格式下载图片格式预览 -->
@ -305,6 +345,85 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 查看 -->
<el-dialog :title="title" :visible.sync="showSee" width="1000px" append-to-body>
<el-descriptions :column="2" border>
<el-descriptions-item label="租赁单位">
{{ form.unitId }}
</el-descriptions-item>
<el-descriptions-item label="授权人">
{{ form.authPerson }}
</el-descriptions-item>
<el-descriptions-item label="租赁工程">
{{ form.projectId }}
</el-descriptions-item>
<el-descriptions-item label="联系电话">
{{ form.phone }}
</el-descriptions-item>
<el-descriptions-item label="合同编号">
{{ form.contractCode }}
</el-descriptions-item>
<el-descriptions-item label="租赁期限(天)">
{{ form.leaseDay }}
</el-descriptions-item>
<el-descriptions-item label="开始日期">
{{ form.planStartTime }}
</el-descriptions-item>
<el-descriptions-item label="备注">
{{ form.remark }}
</el-descriptions-item>
<el-descriptions-item label="租赁单位类型">
{{ form.protocol === '1' ? '内部单位' : '外部单位' }}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" border style="width: 100%;">
<el-descriptions-item label="营业执照" >
<el-upload
class="upload-demo"
style="width: 197px;"
action="#"
:file-list="businessLicenseListTemp"
:show-file-list="true"
:auto-upload="false"
:key="uploadKey"
list-type="picture-card"
accept=".png, .jpg, .jpeg, .pdf"
:on-change="handleChangeBusinessList"
:class="{ disabled: uploadDisabled }"
:on-preview="picturePreview"
:on-remove="handleRemoveElectricianImgList"
:disabled="isEdits"
>
<!-- 文件格式下载图片格式预览 -->
<div slot="file" slot-scope="{file}">
<img v-if="isImage(file)" class="el-upload-list__item-thumbnail" :src="file.url" alt="">
<div v-else class="picture-card-container">
<img class="picture-card" :src="urlTemp" alt="">
<p class="file-name">{{ file.name }}</p>
</div>
<span class="el-upload-list__item-actions">
<span v-if="updataIf(file)" class="el-upload-list__item-delete" @click="handleDownload(file)">
<i class="el-icon-download"/>
</span>
<span v-else class="el-upload-list__item-preview" @click="picturePreview(file)">
<i class="el-icon-zoom-in"/>
</span>
<span class="el-upload-list__item-delete" @click="handleRemoveElectricianImgList(file)">
<i class="el-icon-delete"/>
</span>
</span>
</div>
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-descriptions-item>
</el-descriptions>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 查看全部图片的弹窗 --> <!-- 查看全部图片的弹窗 -->
<el-dialog :title="title" :visible.sync="showAllImg" width="600px" append-to-body> <el-dialog :title="title" :visible.sync="showAllImg" width="600px" append-to-body>
<el-form ref="form" label-width="120px"> <el-form ref="form" label-width="120px">
@ -322,6 +441,7 @@
:class="{ disabled: uploadDisabled }" :class="{ disabled: uploadDisabled }"
:on-preview="picturePreview" :on-preview="picturePreview"
:on-remove="handleRemoveElectricianImgList" :on-remove="handleRemoveElectricianImgList"
:disabled="isEdits"
> >
<!-- 文件格式下载图片格式预览 --> <!-- 文件格式下载图片格式预览 -->
@ -361,13 +481,24 @@
</template> </template>
<script> <script>
import { getListAgreement,getAgreementDetail,editAgreement,addAgreement,delAgreement,deleteFile, getUnitList, getProjectList, } from "@/api/lease/protocol"; import {
getListAgreement,
getAgreementDetail,
editAgreement,
addAgreement,
delAgreement,
deleteFile,
getUnitList,
getProjectList,
} from "@/api/lease/protocol";
import {imgUpLoadThree, fileUpLoad} from '@/api/system/upload' import {imgUpLoadThree, fileUpLoad} from '@/api/system/upload'
import {downloadFile, downloadFileData} from '@/utils/download' import {downloadFile, downloadFileData} from '@/utils/download'
import {getToken} from '@/utils/auth' import {getToken} from '@/utils/auth'
import {Base64} from 'js-base64' import {Base64} from 'js-base64'
import {forEach} from 'jszip'; import {forEach} from 'jszip';
import {listUser} from "@/api/system/user"; import {listUser} from "@/api/system/user";
import {getListProject, getListUnite} from "@/api/lease/apply";
export default { export default {
name: "supplier", name: "supplier",
data() { data() {
@ -397,6 +528,7 @@ export default {
// //
showSearch: true, showSearch: true,
showHouse: false, showHouse: false,
showSee: false,
showAllImg: false, showAllImg: false,
@ -405,6 +537,22 @@ export default {
totalTwo: 0, totalTwo: 0,
// //
unitList: [], unitList: [],
//
uniteList: [],
selectTreeProps: {
children: "children",
label: "name",
// multiple: false,
value: "id",
// multiple: true,
},
unitId: null,
projectId: null,
maForm: {
unitId: undefined,
projectId: undefined
},
// //
projectList: [], projectList: [],
// //
@ -442,15 +590,15 @@ export default {
unitId: [ unitId: [
{ {
required: true, required: true,
message: '租赁单位不能为空', message: "请选择租赁单位",
trigger: 'blur', trigger: "blur",
}, },
], ],
proId: [ projectId: [
{ {
required: true, required: true,
message: '租赁工程不能为空', message: "请选择租赁工程",
trigger: 'blur', trigger: "blur",
}, },
], ],
@ -479,6 +627,9 @@ export default {
// //
url: process.env.VUE_APP_BASE_API + '/file/upload' url: process.env.VUE_APP_BASE_API + '/file/upload'
}, },
isEdit: false,
isEdits: false,
}; };
}, },
computed: { computed: {
@ -495,7 +646,6 @@ export default {
}, },
methods: { methods: {
//fileList raw //fileList raw
async getFileData() { async getFileData() {
const fileTwo = [] const fileTwo = []
@ -656,17 +806,42 @@ export default {
// ,getUnitList, getProjectList // ,getUnitList, getProjectList
async getUnitList() { async getUnitList() {
getUnitList({}).then((response) => { // getUnitList({}).then((response) => {
this.unitList = response.data // this.unitList = response.data
}) // })
getListUnite({projectId: null}).then((response) => {
this.uniteList = response.data;
});
}, },
async getProjectList() { async getProjectList() {
getProjectList({}).then((response) => { // getProjectList({}).then((response) => {
this.projectList = response.data // this.projectList = response.data
}) // })
getListProject({unitId: null}).then((response) => {
this.projectList = response.data;
});
}, },
uniteChange(val) {
// this.projectList = [];
if (val && val.length > 0) {
this.maForm.unitId = this.unitId[this.unitId.length - 1];
} else if (val && val.length == 0) {
this.maForm.unitId = "";
}
},
projectChange(val) {
if (val && val.length > 0) {
this.maForm.projectId = this.projectId[this.projectId.length - 1];
} else if (val && val.length == 0) {
this.maForm.projectId = "";
}
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset() this.reset()
@ -676,6 +851,9 @@ export default {
this.businessLicenseFileList = []; this.businessLicenseFileList = [];
this.showHouse = true this.showHouse = true
this.showConfirmButton = true this.showConfirmButton = true
this.showSee = false
this.isEdit = false;
this.isEdits = false;
this.title = '新增' this.title = '新增'
}, },
@ -686,9 +864,28 @@ export default {
this.businessLicenseListTemp = []; this.businessLicenseListTemp = [];
this.businessLicenseFileList = []; this.businessLicenseFileList = [];
var id = row.agreementId; var id = row.agreementId;
getAgreementDetail(id).then((response) => { getAgreementDetail(id).then((response) => {
this.form = response.data; this.form = response.data;
this.form.proId = response.data.projectId; this.maForm.unitId = response.data.unitId;
this.maForm.projectId = response.data.projectId;
this.unitId = this.treeParentsById(this.uniteList, this.maForm.unitId);
this.projectId = this.treeParentsById(
this.projectList,
this.maForm.projectId
);
var taskId = this.form.taskId
console.log(taskId)
if(taskId){
this.isEdit = true;
}else{
this.isEdit = false;
}
this.isEdits = false;
console.log(this.isEdit)
if (response.data.bmFileInfos != null) { if (response.data.bmFileInfos != null) {
this.businessLicenseListTemp = response.data.bmFileInfos; this.businessLicenseListTemp = response.data.bmFileInfos;
this.businessLicenseListTemp.forEach(item => { this.businessLicenseListTemp.forEach(item => {
@ -705,6 +902,7 @@ export default {
} }
this.showHouse = true this.showHouse = true
this.showConfirmButton = true this.showConfirmButton = true
this.showSee = false
this.title = '修改' this.title = '修改'
}) })
}, },
@ -732,6 +930,8 @@ export default {
} else { } else {
this.businessLicenseListTemp = []; this.businessLicenseListTemp = [];
} }
this.isEdits = true;
this.showHouse = false this.showHouse = false
this.showConfirmButton = false this.showConfirmButton = false
this.showAllImg = true this.showAllImg = true
@ -749,7 +949,14 @@ export default {
var id = row.agreementId; var id = row.agreementId;
getAgreementDetail(id).then((response) => { getAgreementDetail(id).then((response) => {
this.form = response.data; this.form = response.data;
this.form.proId = response.data.projectId; this.maForm.unitId = response.data.unitId;
this.maForm.projectId = response.data.projectId;
this.unitId = this.treeParentsById(this.uniteList, this.maForm.unitId);
this.projectId = this.treeParentsById(
this.projectList,
this.maForm.projectId
);
if (response.data.bmFileInfos != null) { if (response.data.bmFileInfos != null) {
this.businessLicenseListTemp = response.data.bmFileInfos; this.businessLicenseListTemp = response.data.bmFileInfos;
this.businessLicenseListTemp.forEach(item => { this.businessLicenseListTemp.forEach(item => {
@ -764,7 +971,10 @@ export default {
} else { } else {
this.businessLicenseListTemp = []; this.businessLicenseListTemp = [];
} }
this.showHouse = true this.isEdit = true;
this.isEdits = true;
this.showHouse = false
this.showSee = true
this.showConfirmButton = false this.showConfirmButton = false
this.title = '查询' this.title = '查询'
}) })
@ -774,6 +984,12 @@ export default {
// //
reset() { reset() {
this.form = {}; this.form = {};
this.unitId = null;
this.projectId = null;
this.maForm = {
unitId: undefined,
projectId: undefined
};
this.resetForm("form"); this.resetForm("form");
}, },
@ -788,10 +1004,18 @@ export default {
//** */ //** */
submitForm() { submitForm() {
this.form.unitId = this.maForm.unitId;
this.form.projectId = this.maForm.projectId;
this.$refs["form"].validate(async valid => { this.$refs["form"].validate(async valid => {
this.form.projectId = this.form.proId; console.log("this.maForm", this.maForm)
console.log("this.form", this.form)
// this.form.projectId = this.form.proId;
if (valid) { if (valid) {
if (this.form.agreementId != undefined) { if (this.form.agreementId != undefined) {
this.form.projectName =null;
this.form.unitName =null;
// this.form.fileName =null;
const reqData = new FormData(); const reqData = new FormData();
if (this.businessLicenseListTemp.length != 0) { if (this.businessLicenseListTemp.length != 0) {
await this.getImaUploadEdit(), await this.getImaUploadEdit(),
@ -918,6 +1142,7 @@ export default {
// //
cancel() { cancel() {
this.showHouse = false; this.showHouse = false;
this.showSee = false;
this.showAllImg = false; this.showAllImg = false;
this.delBusinessFileIdList = []; this.delBusinessFileIdList = [];
this.businessLicenseListTemp = [] this.businessLicenseListTemp = []
@ -938,7 +1163,8 @@ export default {
this.$modal.msgSuccess('删除成功') this.$modal.msgSuccess('删除成功')
this.getList() this.getList()
}) })
.catch(() => {}) .catch(() => {
})
}, },
handleExport() { handleExport() {
@ -953,6 +1179,24 @@ export default {
this.getList(); this.getList();
}, },
//
treeParentsById(list, id) {
for (let i in list) {
if (list[i].id == id) {
//value
return [list[i].id];
}
if (list[i].children) {
let node = this.treeParentsById(list[i].children, id);
if (node !== undefined) {
//
node.unshift(list[i].id);
return node;
}
}
}
},
} }
}; };
</script> </script>
@ -963,37 +1207,46 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.deviceCode { .deviceCode {
margin-top: 10px; margin-top: 10px;
padding-bottom: 20px; padding-bottom: 20px;
font-size: 18px; font-size: 18px;
} }
::v-deep.el-table .fixed-width .el-button--mini { ::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important; width: 60px !important;
margin-bottom: 10px; margin-bottom: 10px;
} }
//css //css
::v-deep.disabled { ::v-deep.disabled {
.el-upload--picture-card { .el-upload--picture-card {
display: none; display: none;
} }
} }
::v-deep .el-upload-list--picture-card { ::v-deep .el-upload-list--picture-card {
display: flex; display: flex;
} }
::v-deep .el-upload-list__item { ::v-deep .el-upload-list__item {
margin-bottom: 20px; margin-bottom: 20px;
overflow: revert; overflow: revert;
} }
::v-deep .el-upload-list__item-actions { ::v-deep .el-upload-list__item-actions {
overflow: hidden; overflow: hidden;
} }
.upload-demo { .upload-demo {
display: flex; display: flex;
} }
.el-upload-list__item-thumbnail { .el-upload-list__item-thumbnail {
height: 145px !important; height: 145px !important;
} }
.picture-card-container { .picture-card-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -1002,6 +1255,7 @@ export default {
align-items: center; align-items: center;
position: relative; position: relative;
} }
.picture-card { .picture-card {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -1010,6 +1264,7 @@ export default {
// border: 1px solid #ddd; // border: 1px solid #ddd;
// border-radius: 4px; // border-radius: 4px;
} }
.file-name { .file-name {
width: 90%; width: 90%;
white-space: nowrap; white-space: nowrap;
@ -1023,6 +1278,7 @@ export default {
color: #333; color: #333;
z-index: 999999; z-index: 999999;
} }
.file-overlay { .file-overlay {
position: absolute; position: absolute;
top: 0; top: 0;

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,8 @@
placeholder="请选择" placeholder="请选择"
> >
<el-option <el-option
v-for="dict in dict.type.back_task_status" v-for="dict in dict.type.repair_task_status"
v-if="dict.value == 0 || dict.value == 1 || dict.value == 2"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
@ -60,7 +61,7 @@
<el-button type="primary" plain size="mini" @click="handleAdd">新增</el-button> <el-button type="primary" plain size="mini" @click="handleAdd">新增</el-button>
</el-col> --> </el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain size="mini">提交</el-button> <el-button type="warning" plain size="mini" @click="handleSend">提交</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain size="mini" @click="handleReject">退回</el-button> <el-button type="danger" plain size="mini" @click="handleReject">退回</el-button>
@ -89,16 +90,17 @@
<el-table-column label="创建人" align="center" prop="createName" :show-overflow-tooltip="true"/> <el-table-column label="创建人" align="center" prop="createName" :show-overflow-tooltip="true"/>
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true"/> <el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
<el-table-column label="状态" align="center" :show-overflow-tooltip="true" prop="repairStatusCode"> <el-table-column label="状态" align="center" :show-overflow-tooltip="true" prop="repairStatusCode">
<!-- <template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.back_task_status" :value="scope.row.repairStatusCode"/> <dict-tag :options="dict.type.repair_task_status" :value="scope.row.repairStatusCode"/>
</template> --> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/> <el-table-column label="备注" align="center" prop="remark" :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" plain icon="el-icon-zoom-in" @click="handleSee(scope.row)" >查看</el-button> <el-button size="mini" plain icon="el-icon-zoom-in" @click="handleSee(scope.row)" >查看</el-button>
<el-button size="mini" type="primary" plain icon="el-icon-edit" @click="handleUpdate(scope.row)">维修</el-button> <el-button size="mini" type="primary" plain icon="el-icon-edit" v-if="scope.row.repairStatusCode!='1'" @click="handleUpdate(scope.row)">维修</el-button>
<el-button size="mini" type="danger" icon="el-icon-delete" @click="handleReject(scope.row)">驳回</el-button> <el-button size="mini" type="danger" icon="el-icon-delete" @click="handleReject(scope.row)">驳回</el-button>
<el-button size="mini" type="success" @click="handlePrint(scope.row)">维修任务单</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -109,6 +111,230 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<!-- 维修任务单弹窗 -->
<el-dialog
:title="title"
:visible.sync="openPrint"
width="1100px"
append-to-body
>
<div style="height: 600px; overflow-y: scroll">
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
<div
class="title"
style="text-align: center; font-weight: 600; font-size: 16px"
>
机具设备维修任务单
</div>
<div
class="info"
style="margin-top: 10px; display: flex; flex-wrap: wrap"
>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>日期</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>单号</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>承修单位</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>操作人</span>
</div>
<div
class="item"
style="
width: 100%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>项目名称</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>委托单位</span>
</div>
<div
class="item"
style="
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
"
>
<span>验收人</span>
</div>
</div>
<el-table
:data="printTableData"
class="table"
style="margin-top: 20px; width: 1000px; padding-bottom: 1px"
border
>
<!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column label="序号" align="center" type="index" row="2" /> -->
<el-table-column label="名称" align="center" prop="machineTypeName" />
<el-table-column label="型号" align="center" prop="specificationType"/>
<el-table-column label="编号" align="center" prop="unitName1" />
<el-table-column label="单位" align="center" prop="unitName" />
<el-table-column label="报修数量" align="center" prop="unitName2" />
<el-table-column label="修复数量" align="center" prop="unitName3" />
<el-table-column label="报废数量" align="center" prop="unitName4" />
<el-table-column label="维修费小计" align="center" prop="unitName5" />
</el-table>
<div
class="tabelAll"
>
<div class="columnAllNum">总计</div>
<div class="columnAll">报修数量</div>
<div class="columnAll">修复数量</div>
<div class="columnAll">报废数量</div>
<div class="columnAll">维修费小计</div>
</div>
<div
class="fillIn"
style="
margin-top: 20px;
display: flex;
justify-content: space-between;
"
>
<div class="item" style="text-align: center;width: 100% ;font-weight: 600; font-size: 14px" >
<div>
<span>维修内容</span>
</div>
</div>
</div>
<el-table
:data="printTableData"
class="table"
style="margin-top: 20px; width: 1000px; padding-bottom: 1px"
border
>
<!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column label="序号" align="center" type="index" row="2" /> -->
<el-table-column label="修理项目" align="center" prop="machineTypeName" />
<el-table-column label="更换备品备件/价格" align="center" prop="specificationType"/>
</el-table>
<div
class="tabelAll"
>
<div class="columnAllNum">合计</div>
<div class="columnAll">合计金额</div>
</div>
<div
class="tabelAll"
>
<div class="columnAllNum">报废图片</div>
<div class="columnAll">试验记录</div>
</div>
<div
class="fillIn"
style="
margin-top: 20px;
display: flex;
justify-content: space-between;
"
>
<div class="item" style="width: 50%">
<div>
<span>负责人</span>
</div>
</div>
<div class="item" style="width: 50%">
<div>
<span>完成日期</span>
</div>
</div>
</div>
<div
class="fillIn"
style="
margin-top: 20px;
display: flex;
justify-content: space-between;
"
>
<div class="item" style="width: 33%">
<div>
<span>维修人员</span>
</div>
</div>
<div class="item" style="width: 33%">
<div>
<span>试验人员</span>
</div>
</div>
<div class="item" style="width: 33%">
<div>
<span>检验人员</span>
</div>
</div>
</div>
</vue-easy-print>
</div>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="print"> </el-button>
<el-button @click="openPrint = false"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -116,13 +342,16 @@
import { import {
getRepairTaskList, getRepairTaskList,
rejectRepair rejectRepair,
sendList,
} from '@/api/repair/repair.js' } from '@/api/repair/repair.js'
import { getInfo, h } from '@/api/login' import { getInfo, h } from '@/api/login'
import vueEasyPrint from "vue-easy-print";
export default { export default {
name: '', name: '',
dicts: ['back_task_status'], dicts: ['repair_task_status'],
data() { data() {
return { return {
type: '', type: '',
@ -163,6 +392,12 @@ export default {
companyId: '', companyId: '',
unitList: [], unitList: [],
proList: [], proList: [],
//
openPrint:false,
printData: {},
//taskId
ids:[],
taskList:[],
} }
}, },
created() { created() {
@ -170,6 +405,7 @@ export default {
// this.initSelectData() // this.initSelectData()
// this.InitIGetInfo() // this.InitIGetInfo()
}, },
components: { vueEasyPrint },
methods: { methods: {
// //
InitIGetInfo() { InitIGetInfo() {
@ -208,12 +444,12 @@ export default {
this.$refs.queryForm.resetFields() this.$refs.queryForm.resetFields()
this.handleQuery() this.handleQuery()
}, },
// // //
handleSelectionChange(selection) { // handleSelectionChange(selection) {
this.ids = selection.map((item) => item.taskId) // this.ids = selection.map((item) => item.taskId)
this.single = selection.length != 1 // this.single = selection.length != 1
this.multiple = !selection.length // this.multiple = !selection.length
}, // },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.$emit('handelAdd') this.$emit('handelAdd')
@ -249,6 +485,39 @@ export default {
`维修任务单_${new Date().getTime()}.xlsx`, `维修任务单_${new Date().getTime()}.xlsx`,
) )
}, },
//
handlePrint(row) {
this.openPrint = true;
this.title = "机具设备维修任务单";
},
//
handleSend(row){
if (this.ids.length == 0) {
this.$alert("请至少勾选一条要提交的数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
sendList(this.taskList).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess("通过成功");
}
this.getList()
});
}
},
//
handleSelectionChange(selection) {
this.taskList = [];
this.ids = selection.map((item) => item.taskId);
selection.forEach((item) => {
this.taskList.push({ taskId: item.taskId });
});
this.single = selection.length != 1;
this.multiple = !selection.length;
},
}, },
} }
</script> </script>
@ -300,4 +569,29 @@ export default {
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
} }
.tabelAll {
display: flex;
border: 1px solid #dfe6ec;
margin-bottom: 1px;
width:1000px;
border-bottom: 1px solid #dfe6ec;
border-top: none;
}
.columnAll {
flex: 1;
padding: 5px;
border-left: 1px solid #dfe6ec;
text-align: center;
width:20%;
}
.columnAllNum {
padding: 5px;
text-align: center;
width:50%;
border-left: none;
}
/* 最后一列无右边框 */
.tabelAll .column:last-child {
border-right: none;
}
</style> </style>