|
|
@@ -1,10 +1,15 @@
|
|
|
<template>
|
|
|
<!-- 报工 -->
|
|
|
<el-dialog :visible.sync="visible" title="报工" width="80%">
|
|
|
- <el-form>
|
|
|
- <el-form-item label="实际起始时间">
|
|
|
+ <el-form
|
|
|
+ ref="ruleForm"
|
|
|
+ :model="formData"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="110px"
|
|
|
+ >
|
|
|
+ <el-form-item label="实际起始时间" prop="time">
|
|
|
<el-date-picker
|
|
|
- v-model="time"
|
|
|
+ v-model="formData.time"
|
|
|
type="datetimerange"
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
range-separator="至"
|
|
|
@@ -13,155 +18,166 @@
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
- <div class="page">
|
|
|
- <div class="content-detail">
|
|
|
- <div class="maintain_equipment_info">
|
|
|
- <HeaderTitle title="报修设备" size="16px"></HeaderTitle>
|
|
|
- <div class="maintain_equipment_info_content">
|
|
|
- <div
|
|
|
- class="equipment_item"
|
|
|
- v-for="item in infoData.planDeviceList"
|
|
|
- :key="item.id"
|
|
|
- >
|
|
|
- <div class="equipment_info" v-if="item.substance">
|
|
|
- <div class="item_info">
|
|
|
- <span class="item_label">设备编码</span>
|
|
|
- <span class="item_value">{{ item.substance.code }}</span>
|
|
|
- </div>
|
|
|
- <div class="item_info">
|
|
|
- <span class="item_label">设备名称</span>
|
|
|
- <span class="item_value">{{ item.substance.name }}</span>
|
|
|
- </div>
|
|
|
- <div class="item_info">
|
|
|
- <span class="item_label">设备型号</span>
|
|
|
- <span class="item_value">{{ item.substance.model }}</span>
|
|
|
- </div>
|
|
|
- <div class="item_info">
|
|
|
- <span class="item_label">工单编号</span>
|
|
|
- <span class="item_value">{{ workCode}}</span>
|
|
|
- </div>
|
|
|
- <div class="item_info">
|
|
|
- <span class="item_label">设备位置</span>
|
|
|
- <span class="item_value">{{
|
|
|
- item.substance.positionNames
|
|
|
- }}</span>
|
|
|
- </div>
|
|
|
- <div class="item_info">
|
|
|
- <span class="item_label">固资编码</span>
|
|
|
- <span class="item_value">{{ item.substance.fixCode }}</span>
|
|
|
- </div>
|
|
|
- <div class="item_info">
|
|
|
- <span class="item_label">编号</span>
|
|
|
- <span class="item_value">{{
|
|
|
- item.substance.extInfo.codeNumber
|
|
|
- }}</span>
|
|
|
+
|
|
|
+ <div class="page">
|
|
|
+ <div class="content-detail">
|
|
|
+ <div class="maintain_equipment_info">
|
|
|
+ <HeaderTitle title="报修设备" size="16px"></HeaderTitle>
|
|
|
+ <div class="maintain_equipment_info_content">
|
|
|
+ <div
|
|
|
+ class="equipment_item"
|
|
|
+ v-for="item in infoData.planDeviceList"
|
|
|
+ :key="item.id"
|
|
|
+ >
|
|
|
+ <div class="equipment_info" v-if="item.substance">
|
|
|
+ <div class="item_info">
|
|
|
+ <span class="item_label">设备编码</span>
|
|
|
+ <span class="item_value">{{ item.substance.code }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="item_info">
|
|
|
+ <span class="item_label">设备名称</span>
|
|
|
+ <span class="item_value">{{ item.substance.name }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="item_info">
|
|
|
+ <span class="item_label">设备型号</span>
|
|
|
+ <span class="item_value">{{ item.substance.model }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="item_info">
|
|
|
+ <span class="item_label">工单编号</span>
|
|
|
+ <span class="item_value">{{ workCode }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="item_info">
|
|
|
+ <span class="item_label">设备位置</span>
|
|
|
+ <span class="item_value">{{
|
|
|
+ item.substance.positionNames
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="item_info">
|
|
|
+ <span class="item_label">固资编码</span>
|
|
|
+ <span class="item_value">{{ item.substance.fixCode }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="item_info">
|
|
|
+ <span class="item_label">编号</span>
|
|
|
+ <span class="item_value">{{
|
|
|
+ item.substance.extInfo.codeNumber
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <p>操作事项</p>
|
|
|
- <div class="ruleMatters_box">
|
|
|
- <el-table :data="item.workItems" border>
|
|
|
- <el-table-column label="序号" width="50">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.$index + 1 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="事项" prop="name" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <span>{{ scope.row.name }}</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="内容" prop="content" width="300">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <span>{{ scope.row.content }}</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作指导" prop="operationGuide">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div class="operationGuide_box">
|
|
|
- <div class="left_content">
|
|
|
- <template v-if="scope.row.operationGuide">
|
|
|
- <div
|
|
|
- v-for="(item, index) in scope.row.operationGuide
|
|
|
- .toolList"
|
|
|
- :key="item.id"
|
|
|
- >{{ index + 1 }}.{{ item.name }}</div
|
|
|
- >
|
|
|
- </template>
|
|
|
+ <p>操作事项</p>
|
|
|
+ <div class="ruleMatters_box">
|
|
|
+ <el-table :data="item.workItems" border>
|
|
|
+ <el-table-column label="序号" width="50">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.$index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="事项" prop="name" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.name }}</span>
|
|
|
</div>
|
|
|
- <div class="line"></div>
|
|
|
- <div class="right_content">
|
|
|
- <template v-if="scope.row.operationGuide">
|
|
|
- <div
|
|
|
- v-for="(item, index) in scope.row.operationGuide
|
|
|
- .procedureList"
|
|
|
- :key="item.id"
|
|
|
- >{{ index + 1 }}.{{ item.content }}</div
|
|
|
- >
|
|
|
- </template>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="内容" prop="content" width="300">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.content }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作指导" prop="operationGuide">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="operationGuide_box">
|
|
|
+ <div class="left_content">
|
|
|
+ <template v-if="scope.row.operationGuide">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in scope.row.operationGuide
|
|
|
+ .toolList"
|
|
|
+ :key="item.id"
|
|
|
+ >{{ index + 1 }}.{{ item.name }}</div
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div class="line"></div>
|
|
|
+ <div class="right_content">
|
|
|
+ <template v-if="scope.row.operationGuide">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in scope.row.operationGuide
|
|
|
+ .procedureList"
|
|
|
+ :key="item.id"
|
|
|
+ >{{ index + 1 }}.{{ item.content }}</div
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="标准" prop="norm" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.norm }}</span>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="标准" prop="norm" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <span>{{ scope.row.norm }}</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="" prop="status" width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <template>
|
|
|
- <el-select
|
|
|
- v-model="scope.row.status"
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- :key="item.value"
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="" prop="status" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <template>
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.status"
|
|
|
+ placeholder="请选择"
|
|
|
>
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ :key="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="结果" prop="result" width="250">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.result"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
</template>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="结果" prop="result" width="250">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.result"
|
|
|
- placeholder="请输入内容"
|
|
|
- ></el-input>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="control">
|
|
|
- <span>处理说明:</span>
|
|
|
- <el-input
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入内容"
|
|
|
- v-model="infoData.reason"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="附件:" prop="attachments">
|
|
|
+ <fileMain v-model="formData.attachments"></fileMain>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="处理说明:" prop="reason">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ v-model="formData.reason"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
<div slot="footer" class="footer">
|
|
|
<el-button @click="cancel">返回</el-button>
|
|
|
+ <!-- <el-button :loading="btnLoading" type="primary" @click="noFinishSubmit"
|
|
|
+ >非完成报工</el-button
|
|
|
+ > -->
|
|
|
<el-button :loading="btnLoading" type="primary" @click="submit"
|
|
|
- >提交</el-button
|
|
|
+ >报工</el-button
|
|
|
>
|
|
|
</div>
|
|
|
+ <!-- <redeployOther ref="redeployOtherRef" @refresh="onClose" /> -->
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
@@ -171,10 +187,22 @@
|
|
|
getById,
|
|
|
getRepairInfoById
|
|
|
} from '@/api/maintenance/patrol_maintenance';
|
|
|
+
|
|
|
+ import fileMain from '@/components/addDoc/index.vue';
|
|
|
+ import redeployOther from '@/views/maintenance/components/redeployOther.vue';
|
|
|
+
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ fileMain,
|
|
|
+ redeployOther
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- time: [],
|
|
|
+ formData: {
|
|
|
+ time: [],
|
|
|
+ reason: '',
|
|
|
+ attachments: []
|
|
|
+ },
|
|
|
btnLoading: false,
|
|
|
options: [
|
|
|
{
|
|
|
@@ -187,46 +215,69 @@
|
|
|
}
|
|
|
],
|
|
|
visible: false,
|
|
|
- infoData: {
|
|
|
- reason: ''
|
|
|
+ infoData: {},
|
|
|
+ workCode: '',
|
|
|
+ rules: {
|
|
|
+ reason: [
|
|
|
+ { required: true, message: '请输入处理说明', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ time: [
|
|
|
+ { required: true, message: '请选择实际起始时间', trigger: 'blur' }
|
|
|
+ ]
|
|
|
},
|
|
|
- workCode:''
|
|
|
+ rowData: {}
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
open(row, isRepaire) {
|
|
|
+ this.rowData = row;
|
|
|
this.getInfo(row, isRepaire);
|
|
|
this.visible = true;
|
|
|
},
|
|
|
cancel() {
|
|
|
this.visible = false;
|
|
|
},
|
|
|
+ onClose() {
|
|
|
+ this.$refs.redeployOtherRef.visible = false;
|
|
|
+ this.getInfo(this.rowData);
|
|
|
+ },
|
|
|
+ // async noFinishSubmit() {
|
|
|
+ // this.$refs.redeployOtherRef.open(this.rowData);
|
|
|
+ // },
|
|
|
async submit() {
|
|
|
- console.log(this.time);
|
|
|
- if (this.time.length > 0) {
|
|
|
- this.infoData.acceptTime = this.time[0];
|
|
|
- this.infoData.finishTime = this.time[1];
|
|
|
- this.infoData.deviceList = this.infoData.planDeviceList;
|
|
|
- console.log(this.infoData);
|
|
|
- this.btnLoading = true;
|
|
|
- let deviceList = this.infoData.deviceList
|
|
|
- .map((item) => {
|
|
|
- return item.workItems;
|
|
|
- })
|
|
|
- .flat();
|
|
|
- let boolen = deviceList.every((item) => item.status > -1);
|
|
|
- this.infoData.isAbnormal = boolen ? 1 : 0;
|
|
|
- report(this.infoData).then((res) => {
|
|
|
- if (res.code == 0) {
|
|
|
- this.$message.success('报工成功');
|
|
|
- this.visible = false;
|
|
|
- this.btnLoading = false;
|
|
|
- this.$emit('refresh');
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$message.error('请选择实际起始时间');
|
|
|
- }
|
|
|
+ this.$refs.ruleForm.validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ // if (this.formData.time.length > 0) {
|
|
|
+ this.infoData.acceptTime = this.formData.time[0];
|
|
|
+ this.infoData.finishTime = this.formData.time[1];
|
|
|
+ this.infoData.deviceList = this.infoData.planDeviceList;
|
|
|
+ this.infoData.reason = this.formData.reason;
|
|
|
+ this.infoData.attachments = this.formData.attachments;
|
|
|
+ console.log(this.infoData);
|
|
|
+ this.btnLoading = true;
|
|
|
+ let deviceList = this.infoData.deviceList
|
|
|
+ .map((item) => {
|
|
|
+ return item.workItems;
|
|
|
+ })
|
|
|
+ .flat();
|
|
|
+ let boolen = deviceList.every((item) => item.status > -1);
|
|
|
+ this.infoData.isAbnormal = boolen ? 1 : 0;
|
|
|
+ report(this.infoData).then((res) => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.$message.success('报工成功');
|
|
|
+ this.visible = false;
|
|
|
+ this.btnLoading = false;
|
|
|
+ this.$emit('refresh');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // } else {
|
|
|
+ // this.$message.error('请选择实际起始时间');
|
|
|
+ // }
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
// 表格数据
|
|
|
async getInfo(row, isRepaire) {
|
|
|
@@ -240,7 +291,7 @@
|
|
|
res = await getById(row.planId);
|
|
|
}
|
|
|
console.log(row);
|
|
|
- this.workCode=row.code
|
|
|
+ this.workCode = row.code;
|
|
|
this.infoData = res.data;
|
|
|
this.infoData.workOrderId = row.id;
|
|
|
}
|
|
|
@@ -255,7 +306,7 @@
|
|
|
}
|
|
|
}
|
|
|
.page {
|
|
|
- padding: 10px;
|
|
|
+ // padding: 10px;
|
|
|
}
|
|
|
.page-title {
|
|
|
background: #fff;
|
|
|
@@ -280,7 +331,7 @@
|
|
|
}
|
|
|
.content-detail {
|
|
|
background: #fff;
|
|
|
- padding: 20px;
|
|
|
+ // padding: 20px;
|
|
|
}
|
|
|
.flows {
|
|
|
.flow-left {
|