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

update:修改查看更新列表

parent 19c4fba6
<template> <template>
<el-dialog <el-dialog
title="工单变更记录" title="工单更新记录"
v-if="showFlag" v-if="showFlag"
:visible.sync="showFlag" :visible.sync="showFlag"
:modal="true" :modal="true"
width="80%" width="80%"
append-to-body append-to-body
center
> >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
<!-- <el-form-item label="工单id" prop="workorderId"> :model="queryParams"
<el-input ref="queryForm"
v-model="queryParams.workorderId" size="small"
placeholder="请输入工单id" inline
clearable v-show="showSearch"
@keyup.enter.native="handleQuery" label-width="110px"
/> >
</el-form-item> -->
<el-form-item label="工单名称" prop="workorderName"> <el-form-item label="工单名称" prop="workorderName">
<el-input <el-input
v-model="queryParams.workorderName" v-model="queryParams.workorderName"
...@@ -35,8 +33,13 @@ ...@@ -35,8 +33,13 @@
</el-form-item> </el-form-item>
<el-form-item label="请求类型" prop="actionType"> <el-form-item label="请求类型" prop="actionType">
<el-select v-model="queryParams.actionType" placeholder="请选择请求类型" clearable> <el-select v-model="queryParams.actionType" placeholder="请选择请求类型" clearable>
<el-option label="请选择字典生成" value="" /> <el-option
</el-select> 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-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
...@@ -44,154 +47,95 @@ ...@@ -44,154 +47,95 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange"> v-loading="loading"
<el-table-column type="selection" width="55" align="center" /> :data="processRoutesList"
>
<el-table-column label="工单名称" align="center" prop="workorderName" /> <el-table-column label="工单名称" align="center" prop="workorderName" />
<el-table-column label="工单编码" align="center" prop="workorderCode" /> <el-table-column label="工单编码" align="center" prop="workorderCode" />
<el-table-column label="请求类型" align="center" prop="actionType" /> <el-table-column label="请求类型" align="center" prop="actionType" />
<el-table-column label="更新时间" align="center" prop="createTime" /> <el-table-column label="更新时间" align="center" prop="createTime" />
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @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> </el-dialog>
</template> </template>
<script> <script>
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/md/record"; import { listRecord } from "@/api/mes/pro/workorderRecord";
export default { export default {
name: "Record", name: "workorderRecordSelect",
dicts: ['sap_action_type'],
components: {},
props: {
data: {
type: Object,
default: {}
}
},
data() { data() {
return { return {
// 遮罩层 showFlag: false,
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
// 工单变更记录表格数据 processList: [],
recordList: [], // 品牌表格数据
// 弹出层标题 processRoutesList: [],
title: "", loading: false,
// 是否显示弹出层
open: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10
workorderId: null, workorderName: null, workorderCode: null, actionType: null, requestBody: null, }, },
// 表单参数
form: {},
// 表单校验
rules: {
}
}; };
}, },
watch: {
data: {
handler() {
this.getList()
this.queryParams.pageNum = 1
},
deep: true,
immediate:true
}
},
created() { created() {
this.getList(); // this.getList();
}, },
methods: { methods: {
/** 查询工单变更记录列表 */ /** 查询工列表 */
getList() { getList() {
this.queryParams.workorderId = this.data.workorderId
this.loading = true; this.loading = true;
listRecord(this.queryParams).then(response => { listRecord(this.queryParams).then((response) => {
this.recordList = response.rows; this.processRoutesList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; 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() { handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); 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> </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>
...@@ -468,7 +468,7 @@ ...@@ -468,7 +468,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-search" icon="el-icon-search"
@click="$refs['RoutesProcessSelectRef2'].showFlag = true" @click="handleViewRecord(scope.row)"
>查看更新记录 >查看更新记录
</el-button> </el-button>
...@@ -816,18 +816,15 @@ ...@@ -816,18 +816,15 @@
<ArrangeInfo :group-code="groupCode" :addBtn="false"></ArrangeInfo> <ArrangeInfo :group-code="groupCode" :addBtn="false"></ArrangeInfo>
</el-dialog> </el-dialog>
<WorkorderRecordSelect <WorkorderRecordSelect
ref="RoutesProcessSelectRef2" ref="WorkorderRecordSelectRef"
@onSelected="onWorkorderRecordSelect" :data="currentData"
/> />
</div> </div>
</template> </template>
<script> <script>
import RoutesProcessSelect from "@/components/routesProcessSelect/index.vue"; import RoutesProcessSelect from "@/components/routesProcessSelect/index.vue";
import WorkorderRecordSelect from "@/components/workorderRecordSelect2/index.vue"; import WorkorderRecordSelect from "@/components/workorderRecordSelect/index.vue";
import { listRouteprocess } from "@/api/mes/pro/routeprocess";
import {listRecord} from "@/api/mes/pro/workorderRecord";
import { import {
listWorkorder, listWorkorder,
...@@ -876,6 +873,7 @@ export default { ...@@ -876,6 +873,7 @@ export default {
}, },
data() { data() {
return { return {
currentData: {},
//自动生成编码 //自动生成编码
autoGenFlag: false, autoGenFlag: false,
optType: undefined, optType: undefined,
...@@ -982,6 +980,10 @@ export default { ...@@ -982,6 +980,10 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
handleViewRecord(row){
this.currentData = row
this.$refs.WorkorderRecordSelectRef.showFlag = true
},
showCombDetail(combinationCode) { showCombDetail(combinationCode) {
this.combOpen = true; this.combOpen = true;
this.combinationCodes = [combinationCode]; this.combinationCodes = [combinationCode];
...@@ -1255,23 +1257,6 @@ export default { ...@@ -1255,23 +1257,6 @@ export default {
this.$router.push("/mes/pro/workorder/changerecord"); 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) { handleUpdate(row) {
this.reset(); 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