设备报修代码提交

dev
郑明梁 2 years ago
parent c20558049f
commit ecbfa33423

@ -33,6 +33,7 @@
import {addDeviceInspectPlanDelect,uploadDeviceInspectPlanDelect} from "@/api/inventory/deviceInspectPlanDelect";
import {isBlank} from "@/utils/strUtil";
import {saveDeviceInspectPlan} from "@/api/inventory/deviceInspectPlan";
import {addDeviceRepairOrderDetail, updateDeviceRepairOrderDetail} from "@/api/inventory/deviceRepairOrderDetail";
export default {
props: {
@ -40,6 +41,10 @@ export default {
type: Object,
required: true
},
type: {
type: Object,
required: true
},
closeDialog: {
type: Function,
required: true
@ -57,31 +62,61 @@ export default {
},
methods: {
onModifySubmit() {
this.$refs["formRef"].validate((valid) => {
if (valid) {
if (isBlank(this.inputQuery.id)) {
addDeviceInspectPlanDelect(this.inputQuery).then((res) => {
if (res.code == 20000) {
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
}else{
uploadDeviceInspectPlanDelect(this.inputQuery).then((res) => {
if (res.code == 20000) {
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
}
}
});
//
if(this.type == "repair"){
this.$refs["formRef"].validate((valid) => {
if (valid) {
if (isBlank(this.inputQuery.id)) {
addDeviceRepairOrderDetail(this.inputQuery).then((res) => {
if (res.code == 20000) {
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
}else{
updateDeviceRepairOrderDetail(this.inputQuery).then((res) => {
if (res.code == 20000) {
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
}
}
});
}else{
//
this.$refs["formRef"].validate((valid) => {
if (valid) {
if (isBlank(this.inputQuery.id)) {
addDeviceInspectPlanDelect(this.inputQuery).then((res) => {
if (res.code == 20000) {
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
}else{
uploadDeviceInspectPlanDelect(this.inputQuery).then((res) => {
if (res.code == 20000) {
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
}
}
});
}
}
},
created() {

@ -95,6 +95,7 @@ import deviceRepairOrderModify from "@/views/inventory/DeviceRepairOrderModify.v
import DeviceProjectSetDialog from "@/views/inventory/DeviceProjectSetDialog"
import {isBlank} from "@/utils/strUtil";
import {addDeviceInspectPlanDelect} from "@/api/inventory/deviceInspectPlanDelect";
import {addDeviceRepairOrderDetail} from "@/api/inventory/deviceRepairOrderDetail";
export default {
@ -108,6 +109,10 @@ export default {
type: Object,
required: true
},
repairType: {
type: Object,
required: true
},
closeDialog: {
type: Function,
required: true
@ -244,15 +249,27 @@ export default {
}
this.selectQuery.remark = this.selectQuery.remak
this.selectQuery.orderIdFk = this.inputQuery.orderIdFk
addDeviceInspectPlanDelect(this.selectQuery).then((res) => {
if (res.code == 20000) {
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
if(this.repairType == 'repair'){
addDeviceRepairOrderDetail(this.selectQuery).then((res) => {
if (res.code == 20000) {
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
}else{
addDeviceInspectPlanDelect(this.selectQuery).then((res) => {
if (res.code == 20000) {
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
}
},
selectDetail(row) {
this.selectQuery = row

@ -92,60 +92,76 @@
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="计划完成日期:" prop="planTime">
<el-date-picker
v-model="repairOrder.planTime"
type="datetime"
placeholder="选择日期"
style="width: 90%"
clearable
value-format="yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="报修说明:">
<el-input v-model="repairOrder.msg" placeholder="请输入报修信息" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="报修图片:">
<el-upload
class="upload-demo"
ref="upload"
:action="this.uploadUrl"
:on-preview="uploadHandlePreview"
:on-remove="uploadHandleRemove"
:headers="headers"
:on-exceed="uploadHandleExceed"
accept=".jpg,.png,.pdf,.doc"
:on-change="uploadOnchange"
:on-success="uploadHandleSuccess"
:on-error="uploadHandleError"
:file-list="fileList"
:data="{ type: 'image2' }"
:auto-upload="true"
>
<el-button
slot="trigger"
size="small"
type="primary"
>
{{ choiceFile }}
</el-button>
<div>只能上传 jpg,png,pdf,doc 文件且不超过 10 MB</div>
</el-upload>
<el-col :span="19">
<el-form-item label="备注:" prop="remark">
<el-input type="textarea" :rows="3" v-model="repairOrder.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card>
<el-row type="flex" justify="end">
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 10px">
<el-button type="primary" @click.native.stop="selectPlanFunction(null)" :loading="loading">选入</el-button>
</el-button-group>
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px">
<el-button type="primary" @click.native.stop="setPlanFunction(null)" :loading="loading">新增</el-button>
</el-button-group>
</el-row>
<el-table :data="detailList" style="width: 100%;" border highlight-current-row max-height="300" height="500"
ref="multipleTable">
<el-table-column label="序号" type="index" width="60"></el-table-column>
<el-table-column label="项目内容" prop="content" width="300"></el-table-column>
<el-table-column label="备注" prop="remark" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="操作" width="120">
<template slot-scope="scope">
<el-button type="text" size="small" @click.stop="true" @click.native="setPlanFunction(scope.row)">编辑
</el-button>
<el-button type="text" size="small" @click.stop="true"
@click.native="delectPlanFunction(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
title="设备巡检设置"
:visible.sync="repairOrderSetVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="40%"
append-to-body
v-if="repairOrderSetVisible"
>
<deviceInspectPlanProjectSet
:inputQuery="inputQuery"
type="repair"
:closeDialog="repairOrderSetCloseDialog"
></deviceInspectPlanProjectSet>
</el-dialog>
<el-dialog
title="设备巡检选入"
:visible.sync="inspectSelectPlanSetVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="80%"
append-to-body
v-if="inspectSelectPlanSetVisible"
>
<deviceProjectSelect
:inputQuery="inputQuery"
type="3"
repairType="repair"
:closeDialog="repairOrderSetCloseDialog"
></deviceProjectSelect>
</el-dialog>
<el-dialog
@ -219,6 +235,7 @@
@pagination="getDeviceList"
></pagination>
</el-card>
</el-dialog>
</div>
@ -228,9 +245,13 @@
import {isBlank} from "@/utils/strUtil";
import {getDeptListByUser} from "@/api/auth/authDept";
import {getInvListByUser} from "@/api/system/invWarehouse";
import {saveDeviceRepairOrder} from "@/api/inventory/deviceRepairOrder";
import {getDeptDeviceList} from "@/api/inventory/deptDevice";
import store from "@/store";
import {saveDeviceRepairOrder} from "@/api/inventory/deviceRepairOrder"
import deviceInspectPlanProjectSet from "@/views/inventory/DeviceInspectPlanProjectSet"
import deviceProjectSelect from "@/views/inventory/DeviceProjectSelect"
import {selectDeviceInspectPlanDelect} from "@/api/inventory/deviceInspectPlanDelect";
import {deleteRepairOrderDetail, filterByorderIdFk} from "@/api/inventory/deviceRepairOrderDetail";
export default {
@ -258,6 +279,7 @@ export default {
page: 1,
limit: 10
},
loading: false,
deviceList: [],
deviceTotal: 0,
deptName: null,
@ -277,7 +299,11 @@ export default {
urgencyType: [{required: true, message: '请选择紧急程度', trigger: 'blur'}],
planTime: [{required: true, message: '请选择计划完成日期', trigger: 'blur'}],
},
check: true
check: true,
detailList: [],
inputQuery: {},
repairOrderSetVisible: false,
inspectSelectPlanSetVisible: false,
};
},
methods: {
@ -327,10 +353,7 @@ export default {
this.$message.error("请选择紧急程度")
return;
}
if (isBlank(this.repairOrder.planTime)) {
this.$message.error("请选择计划完成日期")
return;
}
let formName = isBlank(this.repairOrder.id) ? "add" : "edit";
saveDeviceRepairOrder(this.repairOrder, formName).then((res) => {
if (res.code === 20000) {
@ -482,7 +505,106 @@ export default {
},
uploadHandleError() {
},
selectPlanFunction(row){
if (this.repairOrder.id != null) {
if(isBlank(row)){
this.inputQuery = {};
this.inputQuery.orderIdFk = this.repairOrder.orderId
}else{
this.inputQuery = row
}
this.inspectSelectPlanSetVisible = true;
} else {
this.$refs["dataForm"].validate((valid) => {
if (valid) {
let formName = isBlank(this.repairOrder.id) ? "add" : "edit";
if (formName == "add") {
this.repairOrder.planStatus = 1;
}
saveDeviceRepairOrder(this.repairOrder, formName).then((res) => {
if (res.code === 20000) {
this.repairOrder.id = res.data.id;
this.repairOrder.orderId = res.data.orderId;
this.inputQuery = {};
this.inputQuery.orderIdFk = this.repairOrder.orderId
this.inspectSelectPlanSetVisible = true;
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
});
}
})
}
},
setPlanFunction(row) {
if (this.repairOrder.id != null) {
if(isBlank(row)){
this.inputQuery = {};
this.inputQuery.orderIdFk = this.repairOrder.orderId
}else{
this.inputQuery = row
}
this.repairOrderSetVisible = true;
} else {
this.$refs["dataForm"].validate((valid) => {
if (valid) {
let formName = isBlank(this.repairOrder.id) ? "add" : "edit";
if(formName == "add"){
this.repairOrder.planStatus = 1;
}
saveDeviceRepairOrder(this.repairOrder, formName).then((res) => {
if (res.code === 20000) {
this.repairOrder.id = res.data.id;
this.repairOrder.orderId = res.data.orderId;
this.inputQuery = {};
this.inputQuery.orderIdFk = this.repairOrder.orderId
this.repairOrderSetVisible = true;
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
});
}
})
}
},
delectPlanFunction(row) {
deleteRepairOrderDetail({id: row.id}).then((res) => {
if (res.code == 20000) {
this.selectDevicerepairOrderDelect({orderIdFk: row.orderIdFk})
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
},
repairOrderSetCloseDialog() {
this.repairOrderSetVisible = false;
this.inspectSelectPlanSetVisible = false;
this.selectDevicerepairOrderDelect({orderIdFk: this.inputQuery.orderIdFk})
},
selectDevicerepairOrderDelect(obj) {
filterByorderIdFk(obj).then((res) => {
this.loading = false;
if (res.code === 20000) {
this.detailList = res.data || [];
} else {
this.$message.error(res.message);
this.detailList = [];
}
}).catch((error) => {
this.loading = false;
this.$message.error(error.message);
this.detailList = [];
})
},
},
components:{
deviceInspectPlanProjectSet,deviceProjectSelect
},
created() {
this.uploadUrl = this.BASE_URL + "/udiwms/upload/register/file";
@ -492,6 +614,9 @@ export default {
};
this.repairOrder.uploadImage = null;
this.getDeptList();
if(this.repairOrder.id !=null){
this.selectDevicerepairOrderDelect({orderIdFk: this.repairOrder.orderId})
}
},
}
</script>

@ -82,7 +82,7 @@
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row
<el-table v-loading="loading" :data="list" style="width: 100%" @current-change="handleDetail" highlight-current-row
border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="报修单号" prop="orderId" show-overflow-tooltip width="140"></el-table-column>
@ -107,14 +107,7 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="计划完成时间" prop="planTime" show-overflow-tooltip width="140"></el-table-column>
<el-table-column label="报修说明" prop="msg" show-overflow-tooltip width="180"></el-table-column>
<el-table-column label="报修图片" prop="uploadImage" show-overflow-tooltip width="250">
<template slot-scope="scope">
<div style="color: #1890ff;" @click="showImgViewer(scope.row)">{{ scope.row.uploadImage }}</div>
</template>
</el-table-column>
<el-table-column label="报修状态" prop="status" show-overflow-tooltip width="100">
<template slot-scope="scope">
<el-tag>{{ statusMap[scope.row.status] }}</el-tag>
@ -155,6 +148,26 @@
></pagination>
</el-card>
<el-card class="el-card">
<el-table v-loading="loading" :data="detailList" style="width: 100%" border highlight-current-row>
<el-table-column label="序号" type="index" width="60"></el-table-column>
<el-table-column label="项目内容" prop="content" width="300"></el-table-column>
<el-table-column label="备注" prop="remark" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="datailSelect(scope.row)"
>详情
</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
:title="formMap[formName]"
:visible.sync="formVisible"
@ -172,6 +185,21 @@
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList"/>
<el-dialog
title="报修详情"
:visible.sync="deviceProjectSelectVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="40%"
v-if="deviceProjectSelectVisible"
>
<DeviceInspectPlanProjectSet
:detailQuery="detailQuery"
:closeDialog="detailCloseDialogc"
>
</DeviceInspectPlanProjectSet>
</el-dialog>
</div>
</template>
@ -183,6 +211,9 @@ import {getRepairList, submitAudit, deleteRepairOrder} from "@/api/inventory/dev
import deviceRepairOrderModify from "@/views/inventory/DeviceRepairOrderModify.vue";
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import {previewImage} from "@/api/purchase/supCompany";
import {selectDeviceInspectPlanDelect} from "@/api/inventory/deviceInspectPlanDelect";
import DeviceInspectPlanProjectSet from "@/views/inventory/DeviceInspectProjectSelect";
import {filterByorderIdFk} from "@/api/inventory/deviceRepairOrderDetail";
export default {
@ -234,7 +265,10 @@ export default {
code: null,
msg: null
},
showSearch: true
showSearch: true,
detailList: [],
detailQuery: {},
deviceProjectSelectVisible: false,
};
},
methods: {
@ -393,10 +427,35 @@ export default {
document.body.style.overflow = 'auto';
document.removeEventListener("touchmove", m, true);
},
datailSelect(row){
this.detailQuery = row
this.deviceProjectSelectVisible = true
},
handleDetail(row){
this.orderIds = row.orderId;
this.selectDeviceReceiveOrderDelect({orderIdFk:row.orderId})
},
selectDeviceReceiveOrderDelect(obj) {
filterByorderIdFk(obj).then((res) => {
this.loading = false;
if (res.code === 20000) {
this.detailList = res.data || [];
} else {
this.$message.error(res.message);
this.detailList = [];
}
}).catch((error) => {
this.loading = false;
this.$message.error(error.message);
this.detailList = [];
})
},
detailCloseDialogc() {
this.deviceProjectSelectVisible = false
},
},
components: {
deviceRepairOrderModify, ElImageViewer
deviceRepairOrderModify, ElImageViewer ,DeviceInspectPlanProjectSet
},
filters: {
statusFilterType(status) {

Loading…
Cancel
Save