巡检工单填写记录V1

yangwl
wws 1 year ago
parent 414c0e7a24
commit e6de898b81

@ -200,7 +200,7 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col v-if="false" :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain plain
@ -208,9 +208,10 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['device:deviceOrder:add']" v-hasPermi="['device:deviceOrder:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col v-if="false" :span="1.5">
<el-button <el-button
type="success" type="success"
plain plain
@ -219,7 +220,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['device:deviceOrder:edit']" v-hasPermi="['device:deviceOrder:edit']"
>修改</el-button> >修改
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -230,7 +232,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['device:deviceOrder:remove']" v-hasPermi="['device:deviceOrder:remove']"
>删除</el-button> >删除
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -240,22 +243,23 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['device:deviceOrder:export']" v-hasPermi="['device:deviceOrder:export']"
>导出</el-button> >导出
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="deviceOrderList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="deviceOrderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center"/>
<el-table-column label="主键" align="center" prop="orderId" /> <el-table-column label="主键" align="center" prop="orderId"/>
<el-table-column label="计划id" align="center" prop="planId" /> <el-table-column label="计划id" align="center" prop="planId"/>
<el-table-column label="计划编码" align="center" prop="planCode" /> <el-table-column label="计划编码" align="center" prop="planCode"/>
<el-table-column label="计划类型" align="center" prop="planType" /> <el-table-column label="计划类型" align="center" prop="planType"/>
<el-table-column label="单号" align="center" prop="orderCode" /> <el-table-column label="单号" align="center" prop="orderCode"/>
<el-table-column label="车间" align="center" prop="planWorkshop" /> <el-table-column label="车间" align="center" prop="planWorkshop"/>
<el-table-column label="产线" align="center" prop="planProdLine" /> <el-table-column label="产线" align="center" prop="planProdLine"/>
<el-table-column label="循环周期" align="center" prop="planLoop" /> <el-table-column label="循环周期" align="center" prop="planLoop"/>
<el-table-column label="循环周期类型" align="center" prop="planLoopType" /> <el-table-column label="循环周期类型" align="center" prop="planLoopType"/>
<el-table-column label="循环执行时间开始" align="center" prop="planLoopStart" width="180"> <el-table-column label="循环执行时间开始" align="center" prop="planLoopStart" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.planLoopStart, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.planLoopStart, '{y}-{m}-{d}') }}</span>
@ -276,30 +280,30 @@
<span>{{ parseTime(scope.row.orderEnd, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.orderEnd, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备编码" align="center" prop="equipmentCode" /> <el-table-column label="设备编码" align="center" prop="equipmentCode"/>
<el-table-column label="工单状态" align="center" prop="orderStatus" /> <el-table-column label="工单状态" align="center" prop="orderStatus"/>
<el-table-column label="工单费用" align="center" prop="orderCost" /> <el-table-column label="工单费用" align="center" prop="orderCost"/>
<el-table-column label="责任人" align="center" prop="planPerson" /> <el-table-column label="责任人" align="center" prop="planPerson"/>
<el-table-column label="工单用时" align="center" prop="orderCostTime" /> <el-table-column label="工单用时" align="center" prop="orderCostTime"/>
<el-table-column label="签字" align="center" prop="orderSignPerson" /> <el-table-column label="签字" align="center" prop="orderSignPerson"/>
<el-table-column label="工厂" align="center" prop="factoryCode" /> <el-table-column label="工厂" align="center" prop="factoryCode"/>
<el-table-column label="备用字段1" align="center" prop="attr1" /> <el-table-column label="备用字段1" align="center" prop="attr1"/>
<el-table-column label="备用字段2" align="center" prop="attr2" /> <el-table-column label="备用字段2" align="center" prop="attr2"/>
<el-table-column label="备用字段3" align="center" prop="attr3" /> <el-table-column label="备用字段3" align="center" prop="attr3"/>
<el-table-column label="删除标志" align="center" prop="delFlag" /> <el-table-column label="删除标志" align="center" prop="delFlag"/>
<el-table-column label="创建人" align="center" prop="createBy" /> <el-table-column label="创建人" align="center" prop="createBy"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="更新人" align="center" prop="updateBy" /> <el-table-column label="更新人" align="center" prop="updateBy"/>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180"> <el-table-column label="更新时间" align="center" prop="updateTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -307,14 +311,16 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['device:deviceOrder:edit']" v-hasPermi="['device:deviceOrder:edit']"
>修改</el-button> >填写记录
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['device:deviceOrder:remove']" v-hasPermi="['device:deviceOrder:remove']"
>删除</el-button> >删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -328,88 +334,113 @@
/> />
<!-- 添加或修改计划工单对话框 --> <!-- 添加或修改计划工单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="计划id" prop="planId"> <el-tabs type="border-card">
<el-input v-model="form.planId" placeholder="请输入计划id" /> <el-tab-pane label="基础信息">
</el-form-item> <el-descriptions title="">
<el-form-item label="计划编码" prop="planCode"> <el-descriptions-item label="计划编码">{{this.form.planCode}}</el-descriptions-item>
<el-input v-model="form.planCode" placeholder="请输入计划编码" /> <el-descriptions-item label="计划名称">{{this.form.planName}}</el-descriptions-item>
</el-form-item> <el-descriptions-item label="循环周期">{{this.form.planLoop}}{{this.form.planLoopType}}</el-descriptions-item>
<el-form-item label="单号" prop="orderCode"> <el-descriptions-item label="工单编码">{{this.form.orderCode}}</el-descriptions-item>
<el-input v-model="form.orderCode" placeholder="请输入单号" /> <el-descriptions-item label="车间编码">{{this.form.planWorkshop}}</el-descriptions-item>
</el-form-item> <el-descriptions-item label="工作中心">{{this.form.workCenterName}}</el-descriptions-item>
<el-form-item label="车间" prop="planWorkshop"> </el-descriptions>
<el-input v-model="form.planWorkshop" placeholder="请输入车间" /> </el-tab-pane>
</el-form-item> <el-tab-pane label="记录">
<el-form-item label="产线" prop="planProdLine"> <!-- 设备 -->
<el-input v-model="form.planProdLine" placeholder="请输入产线" /> <div v-for="(equ , equIndex) in this.form.equList" :key="equIndex">
</el-form-item> <el-row>
<el-form-item label="循环周期" prop="planLoop"> <el-col :offset="9" :span="6">
<el-input v-model="form.planLoop" placeholder="请输入循环周期" /> <el-form-item label="设备名称">
</el-form-item> {{equ.equipmentName}}
<el-form-item label="循环执行时间开始" prop="planLoopStart"> </el-form-item>
<el-date-picker clearable </el-col>
v-model="form.planLoopStart" </el-row>
type="date" <!-- 检查项 -->
value-format="yyyy-MM-dd" <div v-for="(detail,detailIndex) in equ.detailList" :key="detailIndex">
placeholder="请选择循环执行时间开始"> <el-row>
</el-date-picker> <el-col :span="6">
</el-form-item> <el-form-item label="检查项:">
<el-form-item label="循环执行时间结束" prop="planLoopEnd"> {{detail.itemName}}
<el-date-picker clearable </el-form-item>
v-model="form.planLoopEnd" </el-col>
type="date" </el-row>
value-format="yyyy-MM-dd" <!-- 标准 -->
placeholder="请选择循环执行时间结束"> <div v-for="(standard,standardIndex) in detail.standardList" :key="standardIndex">
</el-date-picker> <el-row v-if="standard.standardType == 'qualitative' ">
</el-form-item> <el-col :span="6">
<el-form-item label="实际开始时间" prop="orderStart"> <el-form-item label="标准:">
<el-date-picker clearable {{standard.standardName}}
v-model="form.orderStart" </el-form-item>
type="date" </el-col>
value-format="yyyy-MM-dd" <el-row>
placeholder="请选择实际开始时间"> <el-form-item label="是否达标">
</el-date-picker> <el-radio v-model="standard.reach" label="0"></el-radio>
</el-form-item> <el-radio v-model="standard.reach" label="1"></el-radio>
<el-form-item label="实际结束时间" prop="orderEnd"> </el-form-item>
<el-date-picker clearable </el-row>
v-model="form.orderEnd" </el-row>
type="date" <el-row v-else>
value-format="yyyy-MM-dd" <el-col :span="6">
placeholder="请选择实际结束时间"> <el-form-item label="标准:">
</el-date-picker> {{standard.standardName}}
</el-form-item> </el-form-item>
<el-form-item label="设备编码" prop="equipmentCode"> </el-col>
<el-input v-model="form.equipmentCode" placeholder="请输入设备编码" /> <el-col :span="4">
</el-form-item> <el-form-item label-width="50px" label="上限:">
<el-form-item label="工单费用" prop="orderCost"> {{standard.detailUpLimit}}
<el-input v-model="form.orderCost" placeholder="请输入工单费用" /> </el-form-item>
</el-form-item> </el-col>
<el-form-item label="责任人" prop="planPerson"> <el-col :span="4">
<el-input v-model="form.planPerson" placeholder="请输入责任人" /> <el-form-item label-width="50px" label="下限:">
</el-form-item> {{standard.detailDownLimit}}
<el-form-item label="工单用时" prop="orderCostTime"> </el-form-item>
<el-input v-model="form.orderCostTime" placeholder="请输入工单用时" /> </el-col>
</el-form-item> <el-col :span="4">
<el-form-item label="签字" prop="orderSignPerson"> <el-form-item label-width="50px" label="单位:">
<el-input v-model="form.orderSignPerson" placeholder="请输入签字" /> {{standard.detailUnit}}
</el-form-item> </el-form-item>
<el-form-item label="工厂" prop="factoryCode"> </el-col>
<el-input v-model="form.factoryCode" placeholder="请输入工厂" /> <el-col :span="4">
</el-form-item> <el-form-item label-width="50px" label="实际值:">
<el-form-item label="备用字段1" prop="attr1"> <el-input v-model="standard.actualValue" placeholder="请输入值"></el-input>
<el-input v-model="form.attr1" placeholder="请输入备用字段1" /> </el-form-item>
</el-form-item> </el-col>
<el-form-item label="备用字段2" prop="attr2"> </el-row>
<el-input v-model="form.attr2" placeholder="请输入备用字段2" /> </div>
</el-form-item> </div>
<el-form-item label="备用字段3" prop="attr3"> <el-divider></el-divider>
<el-input v-model="form.attr3" placeholder="请输入备用字段3" /> </div>
</el-form-item> </el-tab-pane>
<el-form-item label="删除标志" prop="delFlag"> <el-tab-pane label="工单信息修改">
<el-input v-model="form.delFlag" placeholder="请输入删除标志" /> <el-row>
</el-form-item> <el-col :span="16">
<el-form-item label="巡检时间">
<el-date-picker
v-model="form.timeArray"
type="datetimerange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="工单状态">
<el-select v-model="form.orderStatus" placeholder="计划状态" clearable>
<el-option
v-for="dict in dict.type.device_order_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -420,10 +451,17 @@
</template> </template>
<script> <script>
import { listDeviceOrder, getDeviceOrder, delDeviceOrder, addDeviceOrder, updateDeviceOrder } from "@/api/device/deviceOrder"; import {
listDeviceOrder,
getDeviceOrder,
delDeviceOrder,
addDeviceOrder,
updateDeviceOrder
} from "@/api/device/deviceOrder";
export default { export default {
name: "DeviceOrder", name: "DeviceOrder",
dicts: ['device_order_status'],
data() { data() {
return { return {
// //
@ -479,8 +517,7 @@ export default {
// //
form: {}, form: {},
// //
rules: { rules: {}
}
}; };
}, },
created() { created() {
@ -548,7 +585,7 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.orderId) this.ids = selection.map(item => item.orderId)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
@ -560,11 +597,13 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const orderId = row.orderId || this.ids const orderCode = row.orderCode || this.ids
getDeviceOrder(orderId).then(response => { getDeviceOrder(orderCode).then(response => {
this.form = response.data; this.form = response.data;
console.log("这里是回显信息")
console.log(response.data)
this.open = true; this.open = true;
this.title = "修改计划工单"; this.title = "填写记录";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -572,8 +611,9 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.orderId != null) { if (this.form.orderId != null) {
console.log(this.form)
updateDeviceOrder(this.form).then(response => { updateDeviceOrder(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("提交成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
@ -590,12 +630,13 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const orderIds = row.orderId || this.ids; const orderIds = row.orderId || this.ids;
this.$modal.confirm('是否确认删除计划工单编号为"' + orderIds + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除计划工单编号为"' + orderIds + '"的数据项?').then(function () {
return delDeviceOrder(orderIds); return delDeviceOrder(orderIds);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {

Loading…
Cancel
Save