Commit 84789ecf authored by 张海景's avatar 张海景

update:修改查看更新列表

parent 19c4fba6
<template>
<el-dialog
title="工单变更记录"
<el-dialog
title="工单更新记录"
v-if="showFlag"
:visible.sync="showFlag"
:modal="true"
width="80%"
append-to-body
center
>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!-- <el-form-item label="工单id" prop="workorderId">
<el-input
v-model="queryParams.workorderId"
placeholder="请输入工单id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item label="工单名称" prop="workorderName">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
inline
v-show="showSearch"
label-width="110px"
>
<el-form-item label="工单名称" prop="workorderName">
<el-input
v-model="queryParams.workorderName"
placeholder="请输入工单名称"
......@@ -35,163 +33,109 @@
</el-form-item>
<el-form-item label="请求类型" prop="actionType">
<el-select v-model="queryParams.actionType" placeholder="请选择请求类型" clearable>
<el-option label="请选择字典生成" value="" />
</el-select>
<el-option
v-for="dict in dict.type.sap_action_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
>
</el-option> </el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="工单名称" align="center" prop="workorderName" />
</el-form>
<el-table
v-loading="loading"
:data="processRoutesList"
>
<el-table-column label="工单名称" align="center" prop="workorderName" />
<el-table-column label="工单编码" align="center" prop="workorderCode" />
<el-table-column label="请求类型" align="center" prop="actionType" />
<el-table-column label="更新时间" align="center" prop="createTime" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer">
<!-- <el-button type="primary" @click="confirmSelect">确 定</el-button> -->
<el-button @click="showFlag = false">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/md/record";
import { listRecord } from "@/api/mes/pro/workorderRecord";
export default {
name: "Record",
name: "workorderRecordSelect",
dicts: ['sap_action_type'],
components: {},
props: {
data: {
type: Object,
default: {}
}
},
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
showFlag: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 工单变更记录表格数据
recordList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
processList: [],
// 品牌表格数据
processRoutesList: [],
loading: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
workorderId: null, workorderName: null, workorderCode: null, actionType: null, requestBody: null, },
// 表单参数
form: {},
// 表单校验
rules: {
}
pageSize: 10
},
};
},
watch: {
data: {
handler() {
this.getList()
this.queryParams.pageNum = 1
},
deep: true,
immediate:true
}
},
created() {
this.getList();
// this.getList();
},
methods: {
/** 查询工单变更记录列表 */
/** 查询工列表 */
getList() {
this.queryParams.workorderId = this.data.workorderId
this.loading = true;
listRecord(this.queryParams).then(response => {
this.recordList = response.rows;
listRecord(this.queryParams).then((response) => {
this.processRoutesList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null, workorderId: null, workorderName: null, workorderCode: null, actionType: null, requestBody: null, createTime: null, createBy: null, updateTime: null, updateBy: null };
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加工单变更记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getRecord(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改工单变更记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateRecord(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRecord(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除工单变更记录编号为"' + ids + '"的数据项?').then(function() {
return delRecord(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('md/record/export', {
...this.queryParams
}, `record_${new Date().getTime()}.xlsx`)
}
}
},
};
</script>
<template>
<el-dialog
title="工单更新记录"
v-if="showFlag"
:visible.sync="showFlag"
:modal="true"
width="80%"
append-to-body
center
>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
inline
v-show="showSearch"
label-width="110px"
>
<el-form-item label="工单名称" prop="workorderName">
<el-input
v-model="queryParams.workorderName"
placeholder="请输入工单名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工单编码" prop="workorderCode">
<el-input
@keyup.enter.native="handleQuery"
v-model="queryParams.workorderCode"
placeholder="请输入工单编码"
clearable
/>
</el-form-item>
<el-form-item label="请求类型" prop="actionType">
<el-select v-model="queryParams.actionType" placeholder="请选择请求类型" clearable>
<el-option
v-for="dict in dict.type.sap_action_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
>
</el-option> </el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="processRoutesList"
highlight-current-row
@current-change="handleCurrent"
@row-dblclick="handleRowDbClick"
height="400"
>
<el-table-column label="工单名称" align="center" prop="workorderName" />
<el-table-column label="工单编码" align="center" prop="workorderCode" />
<el-table-column label="请求类型" align="center" prop="actionType" />
<el-table-column label="更新时间" align="center" prop="createTime" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer">
<!-- <el-button type="primary" @click="confirmSelect">确 定</el-button> -->
<el-button @click="showFlag = false">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import { listProroute } from "@/api/mes/pro/proroute";
import { listRouteprocess } from "@/api/mes/pro/routeprocess";
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/mes/pro/workorderRecord";
export default {
name: "RoutesProcessSelectSingle",
components: {},
dicts: [
"sap_action_type"
], data() {
return {
showFlag: false,
// 选中数组
selectedRouteId: undefined,
selectedRows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
processList: [],
// 品牌表格数据
processRoutesList: [],
// // 品牌名称
// brandName: undefined,
defaultProps: {
children: "children",
label: "label",
},
processLoading: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
routeCode: null,
routeName: null,
routeDesc: null,
enableFlag: null,
},
};
},
created() {
this.getList();
},
methods: {
/** 查询工厂列表 */
getList() {
this.loading = true;
listRecord(this.queryParams).then((response) => {
this.processRoutesList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
handleCurrent(row) {
const params = {
pageNum: 1,
pageSize: 1000,
routeId: row.routeId,
};
this.processLoading = true;
listRouteprocess(params)
.then(({ rows }) => {
this.processList = rows;
this.processLoading = false;
})
.catch(() => {
this.processLoading = false;
});
if (row) {
this.selectedRows = row;
}
},
getProcess() {},
// 单选选中数据
handleRowChange(row) {
if (row) {
this.selectedRows = row;
}
},
//双击选中
handleRowDbClick(row) {
if (row) {
this.selectedRows = row;
this.$emit("onSelected", this.selectedRows);
this.showFlag = false;
}
},
//确定选中
confirmSelect() {
if (this.selectedRouteId == null || this.selectedRouteId == 0) {
this.$notify({
title: "提示",
type: "warning",
message: "请至少选择一条数据!",
});
return;
}
this.$emit("onSelected", this.selectedRows);
this.showFlag = false;
},
},
};
</script>
......@@ -142,7 +142,7 @@
</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
......@@ -468,11 +468,11 @@
size="mini"
type="text"
icon="el-icon-search"
@click="$refs['RoutesProcessSelectRef2'].showFlag = true"
@click="handleViewRecord(scope.row)"
>查看更新记录
</el-button>
<el-button
size="mini"
type="text"
......@@ -816,18 +816,15 @@
<ArrangeInfo :group-code="groupCode" :addBtn="false"></ArrangeInfo>
</el-dialog>
<WorkorderRecordSelect
ref="RoutesProcessSelectRef2"
@onSelected="onWorkorderRecordSelect"
ref="WorkorderRecordSelectRef"
:data="currentData"
/>
</div>
</template>
<script>
import RoutesProcessSelect from "@/components/routesProcessSelect/index.vue";
import WorkorderRecordSelect from "@/components/workorderRecordSelect2/index.vue";
import { listRouteprocess } from "@/api/mes/pro/routeprocess";
import {listRecord} from "@/api/mes/pro/workorderRecord";
import WorkorderRecordSelect from "@/components/workorderRecordSelect/index.vue";
import {
listWorkorder,
......@@ -876,6 +873,7 @@ export default {
},
data() {
return {
currentData: {},
//自动生成编码
autoGenFlag: false,
optType: undefined,
......@@ -982,6 +980,10 @@ export default {
this.getList();
},
methods: {
handleViewRecord(row){
this.currentData = row
this.$refs.WorkorderRecordSelectRef.showFlag = true
},
showCombDetail(combinationCode) {
this.combOpen = true;
this.combinationCodes = [combinationCode];
......@@ -1255,23 +1257,6 @@ export default {
this.$router.push("/mes/pro/workorder/changerecord");
},
onWorkorderRecordSelect(row) {
if (row != undefined && row != null) {
// this.form.routeId = row.routeId;
// this.form.routeName = row.routeName;
const params2 = {
pageNum: 1,
pageSize: 1000,
workorderId: row.workorderId,
};
listRecord(params2).then(({ rows }) => {
this.$refs["ProogingProcessRef"].setList(rows);
});
}
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment