!21 修改合并
This commit is contained in:
commit
e5819f167e
@ -205,5 +205,8 @@
|
|||||||
<div class="load_title">正在加载系统资源,请耐心等待</div>
|
<div class="load_title">正在加载系统资源,请耐心等待</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script type="text/javascript" src="./static/haikang/jquery-1.12.4.min.js"></script>
|
||||||
|
<script type="text/javascript" src="./static/haikang/jsencrypt.min.js"></script>
|
||||||
|
<script type="text/javascript" src="./static/haikang/web-control_1.2.5.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
74
public/static/haikang/jquery-1.12.4.min.js
vendored
Normal file
74
public/static/haikang/jquery-1.12.4.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/static/haikang/jsencrypt.min.js
vendored
Normal file
1
public/static/haikang/jsencrypt.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/static/haikang/web-control_1.2.5.min.js
vendored
Normal file
2
public/static/haikang/web-control_1.2.5.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -42,3 +42,11 @@ export function delProroute(routeId) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 复制
|
||||||
|
export function copyProRoute(routeId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/pro/proroute/copyProRoute/' + routeId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
BIN
src/assets/images/emergencyStop.png
Normal file
BIN
src/assets/images/emergencyStop.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 568 KiB After Width: | Height: | Size: 588 KiB |
@ -1,12 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
<div
|
||||||
|
:class="{ 'has-logo': showLogo }"
|
||||||
|
:style="{
|
||||||
|
backgroundColor:
|
||||||
|
settings.sideTheme === 'theme-dark'
|
||||||
|
? variables.menuBackground
|
||||||
|
: variables.menuLightBackground,
|
||||||
|
}"
|
||||||
|
>
|
||||||
<logo v-if="showLogo" :collapse="isCollapse" />
|
<logo v-if="showLogo" :collapse="isCollapse" />
|
||||||
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
|
<el-scrollbar
|
||||||
|
:class="settings.sideTheme"
|
||||||
|
wrap-class="scrollbar-wrapper"
|
||||||
|
style="height: 80%"
|
||||||
|
>
|
||||||
<el-menu
|
<el-menu
|
||||||
:default-active="activeMenu"
|
:default-active="activeMenu"
|
||||||
:collapse="isCollapse"
|
:collapse="isCollapse"
|
||||||
:background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
|
:background-color="
|
||||||
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
|
settings.sideTheme === 'theme-dark'
|
||||||
|
? variables.menuBackground
|
||||||
|
: variables.menuLightBackground
|
||||||
|
"
|
||||||
|
:text-color="
|
||||||
|
settings.sideTheme === 'theme-dark'
|
||||||
|
? variables.menuColor
|
||||||
|
: variables.menuLightColor
|
||||||
|
"
|
||||||
:unique-opened="true"
|
:unique-opened="true"
|
||||||
:active-text-color="settings.theme"
|
:active-text-color="settings.theme"
|
||||||
:collapse-transition="false"
|
:collapse-transition="false"
|
||||||
@ -20,6 +40,20 @@
|
|||||||
/>
|
/>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
height: 10%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
"
|
||||||
|
@click="stop"
|
||||||
|
>
|
||||||
|
<img src="../../../assets/images/emergencyStop.png" style="width: 90px" />
|
||||||
|
</div>
|
||||||
|
<div style="height: 10%; width: 100%; font-size: 13px">
|
||||||
|
【紧急制动,所有设备全部停止】
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -28,6 +62,7 @@ import { mapGetters, mapState } from "vuex";
|
|||||||
import Logo from "./Logo";
|
import Logo from "./Logo";
|
||||||
import SidebarItem from "./SidebarItem";
|
import SidebarItem from "./SidebarItem";
|
||||||
import variables from "@/assets/styles/variables.scss";
|
import variables from "@/assets/styles/variables.scss";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { SidebarItem, Logo },
|
components: { SidebarItem, Logo },
|
||||||
@ -51,7 +86,61 @@ export default {
|
|||||||
},
|
},
|
||||||
isCollapse() {
|
isCollapse() {
|
||||||
return !this.sidebar.opened;
|
return !this.sidebar.opened;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
stop() {
|
||||||
|
this.$confirm(
|
||||||
|
"确定制动后,车间内所有设备将全部紧急停止运行,请谨慎操作! 如确定要进行紧急制动,请点击【确定】按钮!",
|
||||||
|
"紧急制动确认",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
axios
|
||||||
|
.get("http://192.168.3.53:8077/manage/task/emergencyStop")
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message({
|
||||||
|
message: "紧急制动成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: "紧急制动失败",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: "info",
|
||||||
|
message: "已取消",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.el-message-box {
|
||||||
|
width: 430px !important;
|
||||||
|
border: 0px solid #ebeef5 !important;
|
||||||
|
}
|
||||||
|
.el-message-box__header {
|
||||||
|
background: #922423 !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
.el-message-box__title {
|
||||||
|
color: #fdf3f7 !important;
|
||||||
|
}
|
||||||
|
.el-message-box__content {
|
||||||
|
color: #fdf3f7 !important;
|
||||||
|
background: #cf3533 !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
size="small"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="类型名称" prop="machineryTypeName">
|
<el-form-item label="类型名称" prop="machineryTypeName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.machineryTypeName"
|
v-model="queryParams.machineryTypeName"
|
||||||
@ -10,7 +17,11 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否启用" prop="enableFlag">
|
<el-form-item label="是否启用" prop="enableFlag">
|
||||||
<el-select v-model="queryParams.enableFlag" placeholder="选择是或否" clearable>
|
<el-select
|
||||||
|
v-model="queryParams.enableFlag"
|
||||||
|
placeholder="选择是或否"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.sys_yes_no"
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -20,8 +31,16 @@
|
|||||||
</el-select>
|
</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
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -33,14 +52,25 @@
|
|||||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||||
>
|
>
|
||||||
<el-table-column label="设备类型编码" prop="machineryTypeCode" />
|
<el-table-column label="设备类型编码" prop="machineryTypeCode" />
|
||||||
<el-table-column label="设备类型名称" align="center" prop="machineryTypeName" />
|
<el-table-column
|
||||||
|
label="设备类型名称"
|
||||||
|
align="center"
|
||||||
|
prop="machineryTypeName"
|
||||||
|
/>
|
||||||
<el-table-column label="是否启用" align="center" prop="enableFlag">
|
<el-table-column label="是否启用" align="center" prop="enableFlag">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.enableFlag"/>
|
<dict-tag
|
||||||
|
:options="dict.type.sys_yes_no"
|
||||||
|
:value="scope.row.enableFlag"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -48,14 +78,16 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['mes:dv:machinerytype:edit']"
|
v-hasPermi="['mes:dv:machinerytype:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="handleAdd(scope.row)"
|
@click="handleAdd(scope.row)"
|
||||||
v-hasPermi="['mes:dv:machinerytype:add']"
|
v-hasPermi="['mes:dv:machinerytype:add']"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.parentTypeId != 0"
|
v-if="scope.row.parentTypeId != 0"
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -63,7 +95,8 @@
|
|||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['mes:dv:machinerytype:remove']"
|
v-hasPermi="['mes:dv:machinerytype:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -74,39 +107,70 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24" v-if="form.parentTypeId !== 0">
|
<el-col :span="24" v-if="form.parentTypeId !== 0">
|
||||||
<el-form-item label="父类型" prop="parentTypeId">
|
<el-form-item label="父类型" prop="parentTypeId">
|
||||||
<treeselect v-model="form.parentTypeId" :options="machinerytypeOptions" :normalizer="normalizer" placeholder="请选择父类型" />
|
<treeselect
|
||||||
|
v-model="form.parentTypeId"
|
||||||
|
:options="machinerytypeOptions"
|
||||||
|
:normalizer="normalizer"
|
||||||
|
placeholder="请选择父类型"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="设备类型名称" prop="machineryTypeName">
|
<el-form-item label="设备类型名称" prop="machineryTypeName">
|
||||||
<el-input v-model="form.machineryTypeName" placeholder="请输入设备类型名称" />
|
<el-input
|
||||||
|
v-model="form.machineryTypeName"
|
||||||
|
placeholder="请输入设备类型名称"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="默认设备类型" prop="code">
|
||||||
|
<el-select v-model="form.code" placeholder="请选择默认设备类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.dv_m_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="是否启用" prop="enableFlag">
|
<el-form-item label="是否启用" prop="enableFlag">
|
||||||
<el-radio-group v-model="form.enableFlag" disabled v-if="optType=='view'">
|
<el-radio-group
|
||||||
|
v-model="form.enableFlag"
|
||||||
|
disabled
|
||||||
|
v-if="optType == 'view'"
|
||||||
|
>
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.sys_yes_no"
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<el-radio-group v-model="form.enableFlag" v-else>
|
<el-radio-group v-model="form.enableFlag" v-else>
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.sys_yes_no"
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -120,15 +184,21 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listMachinerytype, getMachinerytype, delMachinerytype, addMachinerytype, updateMachinerytype } from "@/api/mes/dv/machinerytype";
|
import {
|
||||||
|
listMachinerytype,
|
||||||
|
getMachinerytype,
|
||||||
|
delMachinerytype,
|
||||||
|
addMachinerytype,
|
||||||
|
updateMachinerytype,
|
||||||
|
} from "@/api/mes/dv/machinerytype";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Machinerytype",
|
name: "Machinerytype",
|
||||||
dicts: ['sys_yes_no'],
|
dicts: ["sys_yes_no", "dv_m_type"],
|
||||||
components: {
|
components: {
|
||||||
Treeselect
|
Treeselect,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -158,15 +228,18 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
parentTypeId: [
|
parentTypeId: [
|
||||||
{ required: true, message: "父类型不能为空", trigger: "blur" }
|
{ required: true, message: "父类型不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
machineryTypeName: [
|
machineryTypeName: [
|
||||||
{ required: true, message: "设备类型名称不能为空", trigger: "blur" }
|
{ required: true, message: "设备类型名称不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
enableFlag: [
|
enableFlag: [
|
||||||
{ required: true, message: "是否启用不能为空", trigger: "blur" }
|
{ required: true, message: "是否启用不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
}
|
code: [
|
||||||
|
{ required: true, message: "请默认设备类型不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -176,8 +249,12 @@ export default {
|
|||||||
/** 查询设备类型列表 */
|
/** 查询设备类型列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listMachinerytype(this.queryParams).then(response => {
|
listMachinerytype(this.queryParams).then((response) => {
|
||||||
this.machinerytypeList = this.handleTree(response.data, "machineryTypeId", "parentTypeId");
|
this.machinerytypeList = this.handleTree(
|
||||||
|
response.data,
|
||||||
|
"machineryTypeId",
|
||||||
|
"parentTypeId"
|
||||||
|
);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -189,15 +266,19 @@ export default {
|
|||||||
return {
|
return {
|
||||||
id: node.machineryTypeId,
|
id: node.machineryTypeId,
|
||||||
label: node.machineryTypeName,
|
label: node.machineryTypeName,
|
||||||
children: node.children
|
children: node.children,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/** 查询设备类型下拉树结构 */
|
/** 查询设备类型下拉树结构 */
|
||||||
getTreeselect() {
|
getTreeselect() {
|
||||||
listMachinerytype().then(response => {
|
listMachinerytype().then((response) => {
|
||||||
debugger;
|
debugger;
|
||||||
this.machinerytypeOptions = [];
|
this.machinerytypeOptions = [];
|
||||||
const data = this.handleTree(response.data, "machineryTypeId", "parentTypeId")[0];
|
const data = this.handleTree(
|
||||||
|
response.data,
|
||||||
|
"machineryTypeId",
|
||||||
|
"parentTypeId"
|
||||||
|
)[0];
|
||||||
this.machinerytypeOptions.push(data);
|
this.machinerytypeOptions.push(data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -213,12 +294,12 @@ export default {
|
|||||||
machineryTypeName: null,
|
machineryTypeName: null,
|
||||||
parentTypeId: 1,
|
parentTypeId: 1,
|
||||||
ancestors: null,
|
ancestors: null,
|
||||||
enableFlag: 'Y',
|
enableFlag: "Y",
|
||||||
remark: null,
|
remark: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null
|
updateTime: null,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
@ -250,7 +331,7 @@ export default {
|
|||||||
if (row != null) {
|
if (row != null) {
|
||||||
this.form.parentTypeId = row.machineryTypeId;
|
this.form.parentTypeId = row.machineryTypeId;
|
||||||
}
|
}
|
||||||
getMachinerytype(row.machineryTypeId).then(response => {
|
getMachinerytype(row.machineryTypeId).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改设备类型";
|
this.title = "修改设备类型";
|
||||||
@ -258,16 +339,16 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.machineryTypeId != null) {
|
if (this.form.machineryTypeId != null) {
|
||||||
updateMachinerytype(this.form).then(response => {
|
updateMachinerytype(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addMachinerytype(this.form).then(response => {
|
addMachinerytype(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
@ -278,13 +359,19 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal.confirm('是否确认删除设备类型编号为"' + row.machineryTypeId + '"的数据项?').then(function() {
|
this.$modal
|
||||||
|
.confirm(
|
||||||
|
'是否确认删除设备类型编号为"' + row.machineryTypeId + '"的数据项?'
|
||||||
|
)
|
||||||
|
.then(function () {
|
||||||
return delMachinerytype(row.machineryTypeId);
|
return delMachinerytype(row.machineryTypeId);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
})
|
||||||
}
|
.catch(() => {});
|
||||||
}
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
size="small"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="工作站编码" prop="workstationCode">
|
<el-form-item label="工作站编码" prop="workstationCode">
|
||||||
@ -24,7 +31,10 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="所在车间名称" prop="workshopName">
|
<el-form-item label="所在车间名称" prop="workshopName">
|
||||||
<el-select v-model="queryParams.workshopId" placeholder="请选择车间">
|
<el-select
|
||||||
|
v-model="queryParams.workshopId"
|
||||||
|
placeholder="请选择车间"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in workshopOptions"
|
v-for="item in workshopOptions"
|
||||||
:key="item.workshopId"
|
:key="item.workshopId"
|
||||||
@ -50,8 +60,16 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -66,7 +84,8 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['mes:md:workstation:add']"
|
v-hasPermi="['mes:md:workstation:add']"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -77,7 +96,8 @@
|
|||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['mes:md:workstation:edit']"
|
v-hasPermi="['mes:md:workstation:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -88,7 +108,8 @@
|
|||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['mes:md:workstation:remove']"
|
v-hasPermi="['mes:md:workstation:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -98,12 +119,20 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['mes:md:workstation:export']"
|
v-hasPermi="['mes:md:workstation: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="workstationList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="workstationList"
|
||||||
|
@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="workstationCode">
|
<el-table-column label="工作站编号" align="center" prop="workstationCode">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -111,20 +140,40 @@
|
|||||||
type="text"
|
type="text"
|
||||||
@click="handleView(scope.row)"
|
@click="handleView(scope.row)"
|
||||||
v-hasPermi="['mes:md:workstation:query']"
|
v-hasPermi="['mes:md:workstation:query']"
|
||||||
>{{scope.row.workstationCode}}</el-button>
|
>{{ scope.row.workstationCode }}</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="工作站名称" align="center" prop="workstationName" />
|
<el-table-column
|
||||||
<el-table-column label="工作站地点" align="center" prop="workstationAddress" />
|
label="工作站名称"
|
||||||
<el-table-column label="所在车间名称" align="center" prop="workshopName" />
|
align="center"
|
||||||
|
prop="workstationName"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="工作站地点"
|
||||||
|
align="center"
|
||||||
|
prop="workstationAddress"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="所在车间名称"
|
||||||
|
align="center"
|
||||||
|
prop="workshopName"
|
||||||
|
/>
|
||||||
<el-table-column label="所属工序" align="center" prop="processName" />
|
<el-table-column label="所属工序" align="center" prop="processName" />
|
||||||
<el-table-column label="是否启用" align="center" prop="enableFlag">
|
<el-table-column label="是否启用" align="center" prop="enableFlag">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.enableFlag"/>
|
<dict-tag
|
||||||
|
:options="dict.type.sys_yes_no"
|
||||||
|
:value="scope.row.enableFlag"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -132,14 +181,16 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['mes:md:workstation:edit']"
|
v-hasPermi="['mes:md:workstation: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="['mes:md:workstation:remove']"
|
v-hasPermi="['mes:md:workstation:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -158,33 +209,49 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="工作站编号" prop="workstationCode">
|
<el-form-item label="工作站编号" prop="workstationCode">
|
||||||
<el-input v-model="form.workstationCode" placeholder="请输入工作站编码" />
|
<el-input
|
||||||
|
v-model="form.workstationCode"
|
||||||
|
placeholder="请输入工作站编码"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item label-width="80">
|
<el-form-item label-width="80">
|
||||||
<el-switch v-model="autoGenFlag"
|
<el-switch
|
||||||
|
v-model="autoGenFlag"
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
active-text="自动生成"
|
active-text="自动生成"
|
||||||
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'">
|
@change="handleAutoGenChange(autoGenFlag)"
|
||||||
|
v-if="optType != 'view'"
|
||||||
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="工作站名称" prop="workstationName">
|
<el-form-item label="工作站名称" prop="workstationName">
|
||||||
<el-input v-model="form.workstationName" placeholder="请输入工作站名称" />
|
<el-input
|
||||||
|
v-model="form.workstationName"
|
||||||
|
placeholder="请输入工作站名称"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="工作站地点" prop="workstationAddress">
|
<el-form-item label="工作站地点" prop="workstationAddress">
|
||||||
<el-input v-model="form.workstationAddress" placeholder="请输入工作站地点" />
|
<el-input
|
||||||
|
v-model="form.workstationAddress"
|
||||||
|
placeholder="请输入工作站地点"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="所在车间" prop="workshopId">
|
<el-form-item label="所在车间" prop="workshopId">
|
||||||
<el-select v-model="form.workshopId" placeholder="请选择车间">
|
<el-select
|
||||||
|
v-model="form.workshopId"
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="请选择车间"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in workshopOptions"
|
v-for="item in workshopOptions"
|
||||||
:key="item.workshopId"
|
:key="item.workshopId"
|
||||||
@ -196,33 +263,44 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="12">
|
||||||
<el-form-item label="所属工序" prop="processId">
|
<el-form-item label="所属工序" prop="processId">
|
||||||
<el-select v-model="form.processId" placeholder="请选择工序">
|
<el-select
|
||||||
|
v-model="form.processId"
|
||||||
|
multiple
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="请选择工序"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in processOptions"
|
v-for="item in processOptions"
|
||||||
:key="item.processId"
|
:key="item.processId"
|
||||||
:label="item.processName"
|
:label="item.processName"
|
||||||
:value="item.processId"
|
:value="item.processId + ''"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="是否启用" prop="enableFlag">
|
<el-form-item label="是否启用" prop="enableFlag">
|
||||||
<el-radio-group v-model="form.enableFlag" disabled v-if="optType=='view'">
|
<el-radio-group
|
||||||
|
v-model="form.enableFlag"
|
||||||
|
disabled
|
||||||
|
v-if="optType == 'view'"
|
||||||
|
>
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.sys_yes_no"
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<el-radio-group v-model="form.enableFlag" v-else>
|
<el-radio-group v-model="form.enableFlag" v-else>
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.sys_yes_no"
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -230,23 +308,45 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-divider content-position="center" v-if="form.workstationId !=null">工作站资源</el-divider>
|
<el-divider content-position="center" v-if="form.workstationId != null"
|
||||||
<MachinerySelectSingle ref="machinerySelect" @onSelected="onMachineryAdd"></MachinerySelectSingle>
|
>工作站资源</el-divider
|
||||||
|
>
|
||||||
|
<MachinerySelectSingle
|
||||||
|
ref="machinerySelect"
|
||||||
|
@onSelected="onMachineryAdd"
|
||||||
|
></MachinerySelectSingle>
|
||||||
<el-row v-if="form.workstationId != null">
|
<el-row v-if="form.workstationId != null">
|
||||||
<el-col :span=24>
|
<el-col :span="24">
|
||||||
<el-carousel trigger="click" type="card" :autoplay="false">
|
<el-carousel trigger="click" type="card" :autoplay="false">
|
||||||
<el-carousel-item>
|
<el-carousel-item>
|
||||||
<el-card shadow="always" style="width: 450px">
|
<el-card shadow="always" style="width: 450px">
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span>设备资源</span>
|
<span>设备资源</span>
|
||||||
<el-button style="float:right; padding: 3px 0" @click="handleMachineryAdd" v-if="optType !='view'" type="text">新增</el-button>
|
<span v-if="optTypebutton">
|
||||||
|
<el-button
|
||||||
|
style="float: right; padding: 3px 0"
|
||||||
|
@click="handleMachineryAdd"
|
||||||
|
v-if="optType != 'view'"
|
||||||
|
type="text"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<WorkStationMachine ref="machineryList" :optType="optType" :workstationId="form.workstationId" style="align:center"></WorkStationMachine>
|
<WorkStationMachine
|
||||||
|
ref="machineryList"
|
||||||
|
:optType="optType"
|
||||||
|
:workstationId="form.workstationId"
|
||||||
|
style="align: center"
|
||||||
|
></WorkStationMachine>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-carousel-item>
|
</el-carousel-item>
|
||||||
<!-- <el-carousel-item>
|
<!-- <el-carousel-item>
|
||||||
@ -271,7 +371,9 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="cancel" v-if="optType =='view'">返回</el-button>
|
<el-button type="primary" @click="cancel" v-if="optType == 'view'"
|
||||||
|
>返回</el-button
|
||||||
|
>
|
||||||
<el-button type="primary" @click="submitForm" v-else>保 存</el-button>
|
<el-button type="primary" @click="submitForm" v-else>保 存</el-button>
|
||||||
<el-button @click="cancel">关 闭</el-button>
|
<el-button @click="cancel">关 闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -280,24 +382,39 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listWorkstation, getWorkstation, delWorkstation, addWorkstation, updateWorkstation } from "@/api/mes/md/workstation";
|
import {
|
||||||
|
listWorkstation,
|
||||||
|
getWorkstation,
|
||||||
|
delWorkstation,
|
||||||
|
addWorkstation,
|
||||||
|
updateWorkstation,
|
||||||
|
} from "@/api/mes/md/workstation";
|
||||||
//设备资源选择与保存
|
//设备资源选择与保存
|
||||||
import WorkStationMachine from "./components/machine";
|
import WorkStationMachine from "./components/machine";
|
||||||
import MachinerySelectSingle from "@/components/machinerySelect/single.vue";
|
import MachinerySelectSingle from "@/components/machinerySelect/single.vue";
|
||||||
import {addWorkstationmachine} from "@/api/mes/md/workstationmachine";
|
import {
|
||||||
|
listWorkstationmachine,
|
||||||
|
addWorkstationmachine,
|
||||||
|
} from "@/api/mes/md/workstationmachine";
|
||||||
//人力资源选择与保存
|
//人力资源选择与保存
|
||||||
import Workstationworker from "./components/worker";
|
import Workstationworker from "./components/worker";
|
||||||
|
|
||||||
//工装夹具资源选择与保存
|
//工装夹具资源选择与保存
|
||||||
import WorkStationTool from "./components/tool";
|
import WorkStationTool from "./components/tool";
|
||||||
import {getTreeList} from "@/api/mes/wm/warehouse"
|
import { getTreeList } from "@/api/mes/wm/warehouse";
|
||||||
import { listAllProcess } from "@/api/mes/pro/process";
|
import { listAllProcess } from "@/api/mes/pro/process";
|
||||||
import { genCode } from "@/api/system/autocode/rule";
|
import { genCode } from "@/api/system/autocode/rule";
|
||||||
import { listAllWorkshop } from "@/api/mes/md/workshop";
|
import { listAllWorkshop } from "@/api/mes/md/workshop";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Workstation",
|
name: "Workstation",
|
||||||
dicts: ['sys_yes_no'],
|
dicts: ["sys_yes_no"],
|
||||||
components: {WorkStationMachine,MachinerySelectSingle,Workstationworker,WorkStationTool},
|
components: {
|
||||||
|
WorkStationMachine,
|
||||||
|
MachinerySelectSingle,
|
||||||
|
Workstationworker,
|
||||||
|
WorkStationTool,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
//自动生成编码
|
//自动生成编码
|
||||||
@ -307,8 +424,8 @@ export default {
|
|||||||
warehouseOptions: [],
|
warehouseOptions: [],
|
||||||
warehouseProps: {
|
warehouseProps: {
|
||||||
multiple: false,
|
multiple: false,
|
||||||
value: 'pId',
|
value: "pId",
|
||||||
label: 'pName',
|
label: "pName",
|
||||||
},
|
},
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
@ -349,27 +466,29 @@ export default {
|
|||||||
locationId: null,
|
locationId: null,
|
||||||
areaId: null,
|
areaId: null,
|
||||||
enableFlag: null,
|
enableFlag: null,
|
||||||
|
workstationId: null,
|
||||||
},
|
},
|
||||||
|
optTypebutton: true,
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
workstationCode: [
|
workstationCode: [
|
||||||
{ required: true, message: "工作站编号不能为空", trigger: "blur" }
|
{ required: true, message: "工作站编号不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
workstationName: [
|
workstationName: [
|
||||||
{ required: true, message: "工作站名称不能为空", trigger: "blur" }
|
{ required: true, message: "工作站名称不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
enableFlag: [
|
enableFlag: [
|
||||||
{ required: true, message: "是否启用不能为空", trigger: "blur" }
|
{ required: true, message: "是否启用不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
workshopId: [
|
workshopId: [
|
||||||
{ required: true, message: "请选择所属车间", trigger: "blur" }
|
{ required: true, message: "请选择所属车间", trigger: "blur" },
|
||||||
],
|
],
|
||||||
processId: [
|
processId: [
|
||||||
{ required: true, message: "请选择所属工序", trigger: "blur" }
|
{ required: true, message: "请选择所属工序", trigger: "blur" },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -382,7 +501,7 @@ export default {
|
|||||||
/** 查询工作站列表 */
|
/** 查询工作站列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listWorkstation(this.queryParams).then(response => {
|
listWorkstation(this.queryParams).then((response) => {
|
||||||
this.workstationList = response.rows;
|
this.workstationList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -390,31 +509,38 @@ export default {
|
|||||||
},
|
},
|
||||||
//查询车间信息
|
//查询车间信息
|
||||||
getWorkshops() {
|
getWorkshops() {
|
||||||
listAllWorkshop().then( response => {
|
listAllWorkshop().then((response) => {
|
||||||
this.workshopOptions = response.data;
|
this.workshopOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//查询工序信息
|
//查询工序信息
|
||||||
getProcess() {
|
getProcess() {
|
||||||
listAllProcess().then( response =>{
|
listAllProcess().then((response) => {
|
||||||
this.processOptions = response.data;
|
this.processOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取仓库
|
//获取仓库
|
||||||
getWarehouseList() {
|
getWarehouseList() {
|
||||||
getTreeList().then( response =>{
|
getTreeList().then((response) => {
|
||||||
this.warehouseOptions = response.data;
|
this.warehouseOptions = response.data;
|
||||||
this.warehouseOptions.map(w =>{
|
this.warehouseOptions.map((w) => {
|
||||||
w.children.map(l =>{
|
w.children.map((l) => {
|
||||||
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
|
let lstr = JSON.stringify(l.children)
|
||||||
|
.replace(/locationId/g, "lId")
|
||||||
|
.replace(/areaId/g, "pId")
|
||||||
|
.replace(/areaName/g, "pName");
|
||||||
l.children = JSON.parse(lstr);
|
l.children = JSON.parse(lstr);
|
||||||
});
|
});
|
||||||
|
|
||||||
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
|
let wstr = JSON.stringify(w.children)
|
||||||
|
.replace(/warehouseId/g, "wId")
|
||||||
|
.replace(/locationId/g, "pId")
|
||||||
|
.replace(/locationName/g, "pName");
|
||||||
w.children = JSON.parse(wstr);
|
w.children = JSON.parse(wstr);
|
||||||
|
|
||||||
});
|
});
|
||||||
let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName');
|
let ostr = JSON.stringify(this.warehouseOptions)
|
||||||
|
.replace(/warehouseId/g, "pId")
|
||||||
|
.replace(/warehouseName/g, "pName");
|
||||||
this.warehouseOptions = JSON.parse(ostr);
|
this.warehouseOptions = JSON.parse(ostr);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -447,12 +573,12 @@ export default {
|
|||||||
warehouseId: null,
|
warehouseId: null,
|
||||||
locationId: null,
|
locationId: null,
|
||||||
areaId: null,
|
areaId: null,
|
||||||
enableFlag: 'Y',
|
enableFlag: "Y",
|
||||||
remark: null,
|
remark: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null
|
updateTime: null,
|
||||||
};
|
};
|
||||||
this.autoGenFlag = true;
|
this.autoGenFlag = true;
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
@ -486,9 +612,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.workstationId)
|
this.ids = selection.map((item) => item.workstationId);
|
||||||
this.single = selection.length!==1
|
this.single = selection.length !== 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
@ -497,7 +623,7 @@ export default {
|
|||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加工作站";
|
this.title = "添加工作站";
|
||||||
this.optType = "add";
|
this.optType = "add";
|
||||||
genCode('WORKSTATION_CODE').then(response =>{
|
genCode("WORKSTATION_CODE").then((response) => {
|
||||||
this.form.workstationCode = response;
|
this.form.workstationCode = response;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -506,7 +632,7 @@ export default {
|
|||||||
this.reset();
|
this.reset();
|
||||||
this.getWorkshops();
|
this.getWorkshops();
|
||||||
const workstationId = row.workstationId || this.ids;
|
const workstationId = row.workstationId || this.ids;
|
||||||
getWorkstation(workstationId).then(response => {
|
getWorkstation(workstationId).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "查看车间信息";
|
this.title = "查看车间信息";
|
||||||
@ -517,26 +643,41 @@ export default {
|
|||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.getWorkshops();
|
this.getWorkshops();
|
||||||
const workstationId = row.workstationId || this.ids
|
const workstationId = row.workstationId || this.ids;
|
||||||
getWorkstation(workstationId).then(response => {
|
getWorkstation(workstationId).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
this.form.processId = response.data.processId.split(",");
|
||||||
|
console.log(this.form.processId);
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改工作站";
|
this.title = "修改工作站";
|
||||||
this.optType = "edit";
|
this.optType = "edit";
|
||||||
});
|
});
|
||||||
|
var queryParams = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 1000,
|
||||||
|
workstationId: workstationId,
|
||||||
|
};
|
||||||
|
listWorkstationmachine(queryParams).then((response) => {
|
||||||
|
if (response.total == 1) {
|
||||||
|
this.optTypebutton = false;
|
||||||
|
} else {
|
||||||
|
this.optTypebutton = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.workstationId != null) {
|
if (this.form.workstationId != null) {
|
||||||
updateWorkstation(this.form).then(response => {
|
updateWorkstation(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addWorkstation(this.form).then(response => {
|
this.form.processId = this.form.processId.join(",");
|
||||||
|
addWorkstation(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
@ -548,23 +689,31 @@ export default {
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const workstationIds = row.workstationId || this.ids;
|
const workstationIds = row.workstationId || this.ids;
|
||||||
this.$modal.confirm('是否确认删除工作站?').then(function() {
|
this.$modal
|
||||||
|
.confirm("是否确认删除工作站?")
|
||||||
|
.then(function () {
|
||||||
return delWorkstation(workstationIds);
|
return delWorkstation(workstationIds);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('mes/md/workstation/export', {
|
this.download(
|
||||||
...this.queryParams
|
"mes/md/workstation/export",
|
||||||
}, `workstation_${new Date().getTime()}.xlsx`)
|
{
|
||||||
|
...this.queryParams,
|
||||||
|
},
|
||||||
|
`workstation_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
},
|
},
|
||||||
//自动生成编码
|
//自动生成编码
|
||||||
handleAutoGenChange(autoGenFlag) {
|
handleAutoGenChange(autoGenFlag) {
|
||||||
if (autoGenFlag) {
|
if (autoGenFlag) {
|
||||||
genCode('WORKSTATION_CODE').then(response =>{
|
genCode("WORKSTATION_CODE").then((response) => {
|
||||||
this.form.workstationCode = response;
|
this.form.workstationCode = response;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -577,10 +726,10 @@ export default {
|
|||||||
},
|
},
|
||||||
//设备资源选择回调
|
//设备资源选择回调
|
||||||
onMachineryAdd(rows) {
|
onMachineryAdd(rows) {
|
||||||
debugger
|
debugger;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
rows.workstationId = this.form.workstationId;
|
rows.workstationId = this.form.workstationId;
|
||||||
addWorkstationmachine(rows).then(response =>{
|
addWorkstationmachine(rows).then((response) => {
|
||||||
this.$refs.machineryList.getList();
|
this.$refs.machineryList.getList();
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
@ -592,7 +741,7 @@ export default {
|
|||||||
//工装夹具资源新增
|
//工装夹具资源新增
|
||||||
handleToolTypeAdd() {
|
handleToolTypeAdd() {
|
||||||
this.$refs.toolList.handleAdd();
|
this.$refs.toolList.handleAdd();
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -97,16 +97,16 @@ export default {
|
|||||||
type: "category",
|
type: "category",
|
||||||
boundaryGap: true, //坐标轴两边留白
|
boundaryGap: true, //坐标轴两边留白
|
||||||
data: [
|
data: [
|
||||||
|
"2023-03",
|
||||||
|
"2023-04",
|
||||||
|
"2023-05",
|
||||||
|
"2023-06",
|
||||||
|
"2023-07",
|
||||||
"2023-08",
|
"2023-08",
|
||||||
"2023-09",
|
"2023-09",
|
||||||
"2023-10",
|
"2023-10",
|
||||||
"2023-11",
|
"2023-11",
|
||||||
"2023-12",
|
"2023-12",
|
||||||
"2023-13",
|
|
||||||
"2023-14",
|
|
||||||
"2023-15",
|
|
||||||
"2023-16",
|
|
||||||
"2023-17",
|
|
||||||
],
|
],
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
//坐标轴刻度标签的相关设置。
|
//坐标轴刻度标签的相关设置。
|
||||||
|
343
src/views/mes/pro/production/components/video.vue
Normal file
343
src/views/mes/pro/production/components/video.vue
Normal file
@ -0,0 +1,343 @@
|
|||||||
|
<template>
|
||||||
|
<div class="videoMain" ref="playWndBox">
|
||||||
|
<div
|
||||||
|
id="playWnd"
|
||||||
|
class="playWnd"
|
||||||
|
:style="{
|
||||||
|
height: playWndHeight + 'px',
|
||||||
|
width: playWndWidth + 'px',
|
||||||
|
}"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "HikVideo",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 视频盒子的高度
|
||||||
|
playWndHeight: "",
|
||||||
|
// 视频盒子的宽度
|
||||||
|
playWndWidth: "",
|
||||||
|
oWebControl: null,
|
||||||
|
initCount: 0,
|
||||||
|
pubKey: "",
|
||||||
|
cameraIndexCode: "", // 这里面是监控点编号
|
||||||
|
objData: {
|
||||||
|
appkey: "", //海康平台提供的appkey
|
||||||
|
ip: "", //平台地址
|
||||||
|
secret: "", //海康平台提供的secret
|
||||||
|
port: 443,
|
||||||
|
playMode: 0, // 0 预览 1回放
|
||||||
|
layout: "2x2", //页面展示的模块数【16】
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// 首次加载时的到父容器的高度
|
||||||
|
this.playWndHeight = this.$refs.playWndBox.clientHeight;
|
||||||
|
// 首次加载时的到父容器的宽度
|
||||||
|
this.playWndWidth = this.$refs.playWndBox.clientWidth;
|
||||||
|
|
||||||
|
// 初始化播放器插件
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.initPlugin();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 监听scroll事件,使插件窗口尺寸跟随DIV窗口变化
|
||||||
|
window.addEventListener("scroll", () => {
|
||||||
|
if (this.oWebControl != null) {
|
||||||
|
this.oWebControl.JS_Resize(
|
||||||
|
this.$refs.playWndBox.clientWidth,
|
||||||
|
this.$refs.playWndBox.clientHeight
|
||||||
|
);
|
||||||
|
this.setWndCover();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 监听resize事件,使插件窗口尺寸跟随DIV窗口变化
|
||||||
|
window.addEventListener("resize", (e) => {
|
||||||
|
if (this.oWebControl != null) {
|
||||||
|
this.oWebControl.JS_Resize(
|
||||||
|
this.$refs.playWndBox.clientWidth,
|
||||||
|
this.$refs.playWndBox.clientHeight
|
||||||
|
);
|
||||||
|
this.setWndCover();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
if (this.oWebControl != null) {
|
||||||
|
// 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
|
||||||
|
this.oWebControl.JS_HideWnd();
|
||||||
|
// 销毁当前播放的视频
|
||||||
|
this.oWebControl.JS_RequestInterface({ funcName: "destroyWnd" });
|
||||||
|
// 断开与插件服务连接
|
||||||
|
this.oWebControl.JS_Disconnect();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 创建播放实例
|
||||||
|
initPlugin() {
|
||||||
|
let that = this;
|
||||||
|
this.oWebControl = null;
|
||||||
|
that.oWebControl = new WebControl({
|
||||||
|
szPluginContainer: "playWnd", // 指定容器id
|
||||||
|
iServicePortStart: 15900, // 指定起止端口号,建议使用该值
|
||||||
|
iServicePortEnd: 15909,
|
||||||
|
szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 用于IE10使用ActiveX的clsid
|
||||||
|
cbConnectSuccess: () => {
|
||||||
|
// 创建WebControl实例成功
|
||||||
|
that.oWebControl
|
||||||
|
.JS_StartService("window", {
|
||||||
|
// WebControl实例创建成功后需要启动服务
|
||||||
|
// 值"./VideoPluginConnect.dll"写死
|
||||||
|
dllPath: "./VideoPluginConnect.dll",
|
||||||
|
})
|
||||||
|
.then(
|
||||||
|
function () {
|
||||||
|
// 设置消息回调
|
||||||
|
that.oWebControl.JS_SetWindowControlCallback({
|
||||||
|
cbIntegrationCallBack: that.cbIntegrationCallBack,
|
||||||
|
});
|
||||||
|
//JS_CreateWnd创建视频播放窗口,宽高可设定
|
||||||
|
that.oWebControl
|
||||||
|
.JS_CreateWnd("playWnd", 2040, 945, { bEmbed: true })
|
||||||
|
//注:2040,945这是我本人项目视频盒子的大小,你们要根据自己视频盒子的大小进行修改,不然初始化插件的时候会有空白闪烁。
|
||||||
|
.then(function () {
|
||||||
|
// 创建播放实例成功后初始化
|
||||||
|
that.init();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
function () {
|
||||||
|
// 启动插件服务失败
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
// 创建WebControl实例失败
|
||||||
|
cbConnectError: function () {
|
||||||
|
that.oWebControl = null;
|
||||||
|
// alert('插件未启动,正在尝试启动,请稍候...')
|
||||||
|
// that.$message.warning("插件未启动,正在尝试启动,请稍候...");
|
||||||
|
// 程序未启动时执行error函数,采用wakeup来启动程序
|
||||||
|
window.WebControl.JS_WakeUp("VideoWebPlugin://");
|
||||||
|
that.initCount++;
|
||||||
|
if (that.initCount < 3) {
|
||||||
|
setTimeout(function () {
|
||||||
|
that.initPlugin();
|
||||||
|
}, 3000);
|
||||||
|
} else {
|
||||||
|
// that.messageBox = true
|
||||||
|
// alert('插件启动失败,请安装插件并重新启动!')
|
||||||
|
// that.downloadHikVideo()
|
||||||
|
// setTimeout(function () {
|
||||||
|
// that.messageBox = false
|
||||||
|
// }, 5000)
|
||||||
|
// setTimeout(function () {
|
||||||
|
// alert('插件启动失败,请检查插件是否安装!')
|
||||||
|
// that.$message({
|
||||||
|
// message: '插件启动失败,请检查插件是否安装! \n 插件下载地址:https://www.baidu.com',
|
||||||
|
// type: 'warning'
|
||||||
|
// });
|
||||||
|
// }, 5000)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cbConnectClose: () => {
|
||||||
|
// 异常断开:bNormalClose = false
|
||||||
|
// JS_Disconnect正常断开:bNormalClose = true
|
||||||
|
// console.log("cbConnectClose");
|
||||||
|
that.oWebControl = null;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 初始化
|
||||||
|
init(callback) {
|
||||||
|
let that = this;
|
||||||
|
that.getPubKey(() => {
|
||||||
|
let appkey = that.objData.appkey; //综合安防管理平台提供的appkey,必填
|
||||||
|
let secret = that.setEncrypt(that.objData.secret); //综合安防管理平台提供的secret,必填
|
||||||
|
let ip = that.objData.ip; //综合安防管理平台IP地址,必填
|
||||||
|
let playMode = that.objData.playMode; //初始播放模式:0-预览,1-回放
|
||||||
|
let port = that.objData.port; //综合安防管理平台端口,若启用HTTPS协议,默认443
|
||||||
|
let snapDir = "D:\\SnapDir"; //抓图存储路径
|
||||||
|
let videoDir = "D:\\VideoDir"; //紧急录像或录像剪辑存储路径
|
||||||
|
let layout = that.objData.layout; //playMode指定模式的布局
|
||||||
|
let enableHTTPS = 1; //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
|
||||||
|
let encryptedFields = "secret"; //加密字段,默认加密领域为secret
|
||||||
|
let showToolbar = 1; //是否显示工具栏,0-不显示,非0-显示
|
||||||
|
let showSmart = 1; //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示
|
||||||
|
let buttonIDs =
|
||||||
|
"0,16,256,257,258,259,260,512,513,514,515,516,517,768,769"; //自定义工具条按钮
|
||||||
|
// var toolBarButtonIDs = "2049,2304" // 工具栏上自定义按钮
|
||||||
|
that.oWebControl
|
||||||
|
.JS_RequestInterface({
|
||||||
|
funcName: "init",
|
||||||
|
argument: JSON.stringify({
|
||||||
|
appkey: appkey, //API网关提供的appkey
|
||||||
|
secret: secret, //API网关提供的secret
|
||||||
|
ip: ip, //API网关IP地址
|
||||||
|
playMode: playMode, //播放模式(决定显示预览还是回放界面)
|
||||||
|
port: port, //端口
|
||||||
|
snapDir: snapDir, //抓图存储路径
|
||||||
|
videoDir: videoDir, //紧急录像或录像剪辑存储路径
|
||||||
|
layout: layout, //布局
|
||||||
|
enableHTTPS: enableHTTPS, //是否启用HTTPS协议
|
||||||
|
encryptedFields: encryptedFields, //加密字段
|
||||||
|
showToolbar: showToolbar, //是否显示工具栏
|
||||||
|
showSmart: showSmart, //是否显示智能信息
|
||||||
|
buttonIDs, //自定义工具条按钮
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
.then(function (oData) {
|
||||||
|
that.oWebControl.JS_Resize(that.playWndWidth, that.playWndHeight); // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
// 隐藏
|
||||||
|
// that.oWebControl.JS_HideWnd()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取公钥
|
||||||
|
getPubKey(callback) {
|
||||||
|
let that = this;
|
||||||
|
this.oWebControl
|
||||||
|
.JS_RequestInterface({
|
||||||
|
funcName: "getRSAPubKey",
|
||||||
|
argument: JSON.stringify({
|
||||||
|
keyLength: 1024,
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
.then(function (oData) {
|
||||||
|
if (oData.responseMsg.data) {
|
||||||
|
that.pubKey = oData.responseMsg.data;
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// RSA 加密
|
||||||
|
setEncrypt(value) {
|
||||||
|
let that = this;
|
||||||
|
let encrypt = new window.JSEncrypt();
|
||||||
|
encrypt.setPublicKey(that.pubKey);
|
||||||
|
return encrypt.encrypt(value);
|
||||||
|
},
|
||||||
|
// 回调的消息
|
||||||
|
cbIntegrationCallBack(oData) {
|
||||||
|
let { responseMsg: type } = oData;
|
||||||
|
if (type === "error") {
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 视频预览功能
|
||||||
|
previewVideo(data) {
|
||||||
|
let that = this;
|
||||||
|
let cameraIndexCode = data; // 获取输入的监控点编号值,必填
|
||||||
|
let streamMode = 0; // 主子码流标识:0-主码流,1-子码流
|
||||||
|
let transMode = 0; // 传输协议:0-UDP,1-TCP
|
||||||
|
let gpuMode = 0; // 是否启用GPU硬解,0-不启用,1-启用
|
||||||
|
let wndId = -1; // 播放窗口序号(在2x2以上布局下可指定播放窗口)
|
||||||
|
// console.log(cameraIndexCode, "-------cameraIndexCode-");
|
||||||
|
|
||||||
|
that.oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "startPreview",
|
||||||
|
argument: JSON.stringify({
|
||||||
|
cameraIndexCode: cameraIndexCode.trim(), // 监控点编号
|
||||||
|
streamMode: streamMode, // 主子码流标识
|
||||||
|
transMode: transMode, // 传输协议
|
||||||
|
gpuMode: gpuMode, // 是否开启GPU硬解
|
||||||
|
wndId: wndId, // 可指定播放窗口
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 停止全部预览
|
||||||
|
stopAllPreview() {
|
||||||
|
this.oWebControl.JS_RequestInterface({
|
||||||
|
funcName: "stopAllPreview",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 格式化时间
|
||||||
|
dateFormat(oDate, fmt) {
|
||||||
|
let o = {
|
||||||
|
"M+": oDate.getMonth() + 1, //月份
|
||||||
|
"d+": oDate.getDate(), //日
|
||||||
|
"h+": oDate.getHours(), //小时
|
||||||
|
"m+": oDate.getMinutes(), //分
|
||||||
|
"s+": oDate.getSeconds(), //秒
|
||||||
|
"q+": Math.floor((oDate.getMonth() + 3) / 3), //季度
|
||||||
|
S: oDate.getMilliseconds(), //毫秒
|
||||||
|
};
|
||||||
|
if (/(y+)/.test(fmt)) {
|
||||||
|
fmt = fmt.replace(
|
||||||
|
RegExp.$1,
|
||||||
|
(oDate.getFullYear() + "").substr(4 - RegExp.$1.length)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
for (let k in o) {
|
||||||
|
if (new RegExp("(" + k + ")").test(fmt)) {
|
||||||
|
fmt = fmt.replace(
|
||||||
|
RegExp.$1,
|
||||||
|
RegExp.$1.length == 1
|
||||||
|
? o[k]
|
||||||
|
: ("00" + o[k]).substr(("" + o[k]).length)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fmt;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 设置窗口裁剪,当因滚动条滚动导致窗口需要被遮住的情况下需要JS_CuttingPartWindow部分窗口
|
||||||
|
setWndCover() {
|
||||||
|
var iWidth = $(window).width();
|
||||||
|
var iHeight = $(window).height();
|
||||||
|
var oDivRect = $("#playWnd").get(0).getBoundingClientRect();
|
||||||
|
|
||||||
|
var iCoverLeft = oDivRect.left < 0 ? Math.abs(oDivRect.left) : 0;
|
||||||
|
var iCoverTop = oDivRect.top < 0 ? Math.abs(oDivRect.top) : 0;
|
||||||
|
var iCoverRight =
|
||||||
|
oDivRect.right - iWidth > 0 ? Math.round(oDivRect.right - iWidth) : 0;
|
||||||
|
var iCoverBottom =
|
||||||
|
oDivRect.bottom - iHeight > 0
|
||||||
|
? Math.round(oDivRect.bottom - iHeight)
|
||||||
|
: 0;
|
||||||
|
|
||||||
|
iCoverLeft = iCoverLeft > 2041 ? 2041 : iCoverLeft;
|
||||||
|
iCoverTop = iCoverTop > 945 ? 945 : iCoverTop;
|
||||||
|
iCoverRight = iCoverRight > 2041 ? 2041 : iCoverRight;
|
||||||
|
iCoverBottom = iCoverBottom > 945 ? 945 : iCoverBottom;
|
||||||
|
|
||||||
|
this.oWebControl.JS_RepairPartWindow(0, 0, 2041, 946); // 多1个像素点防止还原后边界缺失一个像素条
|
||||||
|
if (iCoverLeft != 0) {
|
||||||
|
this.oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, 946);
|
||||||
|
}
|
||||||
|
if (iCoverTop != 0) {
|
||||||
|
this.oWebControl.JS_CuttingPartWindow(0, 0, 2041, iCoverTop); // 多剪掉一个像素条,防止出现剪掉一部分窗口后出现一个像素条
|
||||||
|
}
|
||||||
|
if (iCoverRight != 0) {
|
||||||
|
this.oWebControl.JS_CuttingPartWindow(
|
||||||
|
2041 - iCoverRight,
|
||||||
|
0,
|
||||||
|
iCoverRight,
|
||||||
|
946
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (iCoverBottom != 0) {
|
||||||
|
this.oWebControl.JS_CuttingPartWindow(
|
||||||
|
0,
|
||||||
|
946 - iCoverBottom,
|
||||||
|
2041,
|
||||||
|
iCoverBottom
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.videoMain {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
@ -139,12 +139,19 @@
|
|||||||
<!-- 第二部分 -->
|
<!-- 第二部分 -->
|
||||||
<div style="height: 75%">
|
<div style="height: 75%">
|
||||||
<div style="height: 50%; display: flex">
|
<div style="height: 50%; display: flex">
|
||||||
<div style="width: 80%">
|
<div style="width: 45%">
|
||||||
<ticket :message="this.ticketData" />
|
<ticket :message="this.ticketData" />
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 24%; margin-top: 50px">
|
<div style="width: 24%; margin-top: 50px">
|
||||||
<defective :message="this.defectiveData" />
|
<defective :message="this.defectiveData" />
|
||||||
</div>
|
</div>
|
||||||
|
<div style="width: 30%; margin-top: 50px">
|
||||||
|
<hkVideo
|
||||||
|
:cameraIndexCode="cameraIndexCode"
|
||||||
|
:objData="objData"
|
||||||
|
ref="hikVideo"
|
||||||
|
></hkVideo>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 50%; display: flex">
|
<div style="height: 50%; display: flex">
|
||||||
<div style="width: 45%">
|
<div style="width: 45%">
|
||||||
@ -252,11 +259,24 @@ import screenfull from "screenfull";
|
|||||||
import defective from "./components/defective.vue";
|
import defective from "./components/defective.vue";
|
||||||
import complete from "./components/complete.vue";
|
import complete from "./components/complete.vue";
|
||||||
import ticket from "./components/ticket.vue";
|
import ticket from "./components/ticket.vue";
|
||||||
|
import hkVideo from "./components/video.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { defective, complete, ticket },
|
components: { defective, complete, ticket, hkVideo },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
cameraIndexCode: "", //wed插件监控点
|
||||||
|
//海康wed插件初始化数据
|
||||||
|
objData: {
|
||||||
|
appkey: "", //综合安防管理平台提供的appkey,必填
|
||||||
|
ip: "", //综合安防管理平台IP地址,必填
|
||||||
|
secret: "", //综合安防管理平台提供的secret,必填
|
||||||
|
port: 443, //综合安防管理平台端口,若启用HTTPS协议,默认443
|
||||||
|
playMode: 0, // 0 预览 1回放
|
||||||
|
layout: "2x2", //页面展示的模块数【16】
|
||||||
|
showToolbar: 1, //是否显示工具栏,0-不显示,非0-显示
|
||||||
|
},
|
||||||
|
|
||||||
screenfull: false,
|
screenfull: false,
|
||||||
title: "生产监控分析",
|
title: "生产监控分析",
|
||||||
titleVisible: false,
|
titleVisible: false,
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
size="small"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
<el-form-item label="工艺路线编号" prop="routeCode">
|
<el-form-item label="工艺路线编号" prop="routeCode">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.routeCode"
|
v-model="queryParams.routeCode"
|
||||||
@ -26,8 +33,16 @@
|
|||||||
/>
|
/>
|
||||||
</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
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -40,7 +55,8 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['mes:pro:proroute:add']"
|
v-hasPermi="['mes:pro:proroute:add']"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -51,7 +67,8 @@
|
|||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['mes:pro:proroute:edit']"
|
v-hasPermi="['mes:pro:proroute:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -62,7 +79,8 @@
|
|||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['mes:pro:proroute:remove']"
|
v-hasPermi="['mes:pro:proroute:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -72,12 +90,20 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['mes:pro:proroute:export']"
|
v-hasPermi="['mes:pro:proroute: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="prorouteList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="prorouteList"
|
||||||
|
@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="routeCode">
|
<el-table-column label="工艺路线编号" align="center" prop="routeCode">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -85,18 +111,26 @@
|
|||||||
type="text"
|
type="text"
|
||||||
@click="handleView(scope.row)"
|
@click="handleView(scope.row)"
|
||||||
v-hasPermi="['mes:pro:proroute:query']"
|
v-hasPermi="['mes:pro:proroute:query']"
|
||||||
>{{scope.row.routeCode}}</el-button>
|
>{{ scope.row.routeCode }}</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="工艺路线名称" align="center" prop="routeName" />
|
<el-table-column label="工艺路线名称" align="center" prop="routeName" />
|
||||||
<el-table-column label="工艺路线说明" align="center" prop="routeDesc" />
|
<el-table-column label="工艺路线说明" align="center" prop="routeDesc" />
|
||||||
<el-table-column label="是否启用" align="center" prop="enableFlag">
|
<el-table-column label="是否启用" align="center" prop="enableFlag">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.enableFlag"/>
|
<dict-tag
|
||||||
|
:options="dict.type.sys_yes_no"
|
||||||
|
:value="scope.row.enableFlag"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -104,14 +138,19 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['mes:pro:proroute:edit']"
|
v-hasPermi="['mes:pro:proroute: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="['mes:pro:proroute:remove']"
|
v-hasPermi="['mes:pro:proroute:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
|
<el-button size="mini" type="text" @click="handlecopy(scope.row)"
|
||||||
|
>复制</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -125,43 +164,63 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改工艺路线对话框 -->
|
<!-- 添加或修改工艺路线对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="1080px" append-to-body>
|
<el-dialog
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="open"
|
||||||
|
width="1080px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="编号" prop="routeCode">
|
<el-form-item label="编号" prop="routeCode">
|
||||||
<el-input v-model="form.routeCode" placeholder="请输入工艺路线编号" />
|
<el-input
|
||||||
|
v-model="form.routeCode"
|
||||||
|
placeholder="请输入工艺路线编号"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<el-form-item label-width="80">
|
<el-form-item label-width="80">
|
||||||
<el-switch v-model="autoGenFlag"
|
<el-switch
|
||||||
|
v-model="autoGenFlag"
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
active-text="自动生成"
|
active-text="自动生成"
|
||||||
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'">
|
@change="handleAutoGenChange(autoGenFlag)"
|
||||||
|
v-if="optType != 'view'"
|
||||||
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<el-form-item label="名称" prop="routeName">
|
<el-form-item label="名称" prop="routeName">
|
||||||
<el-input v-model="form.routeName" placeholder="请输入工艺路线名称" />
|
<el-input
|
||||||
|
v-model="form.routeName"
|
||||||
|
placeholder="请输入工艺路线名称"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="是否启用" prop="enableFlag">
|
<el-form-item label="是否启用" prop="enableFlag">
|
||||||
<el-radio-group v-model="form.enableFlag" disabled v-if="optType=='view'">
|
<el-radio-group
|
||||||
|
v-model="form.enableFlag"
|
||||||
|
disabled
|
||||||
|
v-if="optType == 'view'"
|
||||||
|
>
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.sys_yes_no"
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<el-radio-group v-model="form.enableFlag" v-else>
|
<el-radio-group v-model="form.enableFlag" v-else>
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.sys_yes_no"
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -169,28 +228,46 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="说明" prop="routeDesc">
|
<el-form-item label="说明" prop="routeDesc">
|
||||||
<el-input v-model="form.routeDesc" type="textarea" placeholder="请输入内容" />
|
<el-input
|
||||||
|
v-model="form.routeDesc"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-tabs type="border-card" v-if="form.routeId != null">
|
<el-tabs type="border-card" v-if="form.routeId != null">
|
||||||
<el-tab-pane label="组成工序">
|
<el-tab-pane label="组成工序">
|
||||||
<Routeprocess v-if="form.routeId !=null" :optType="optType" :routeId="form.routeId"></Routeprocess>
|
<Routeprocess
|
||||||
|
v-if="form.routeId != null"
|
||||||
|
:optType="optType"
|
||||||
|
:routeId="form.routeId"
|
||||||
|
></Routeprocess>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="关联产品">
|
<el-tab-pane label="关联产品">
|
||||||
<Routeproduct v-if="form.routeId !=null" :optType="optType" :routeId="form.routeId"></Routeproduct>
|
<Routeproduct
|
||||||
|
v-if="form.routeId != null"
|
||||||
|
:optType="optType"
|
||||||
|
:routeId="form.routeId"
|
||||||
|
></Routeproduct>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="cancel" v-if="optType =='view'">返回</el-button>
|
<el-button type="primary" @click="cancel" v-if="optType == 'view'"
|
||||||
|
>返回</el-button
|
||||||
|
>
|
||||||
<el-button type="primary" @click="submitForm" v-else>确 定</el-button>
|
<el-button type="primary" @click="submitForm" v-else>确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -199,13 +276,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listProroute, getProroute, delProroute, addProroute, updateProroute } from "@/api/mes/pro/proroute";
|
import {
|
||||||
|
listProroute,
|
||||||
|
getProroute,
|
||||||
|
delProroute,
|
||||||
|
addProroute,
|
||||||
|
updateProroute,
|
||||||
|
copyProRoute,
|
||||||
|
} from "@/api/mes/pro/proroute";
|
||||||
import Routeprocess from "./routeprocess";
|
import Routeprocess from "./routeprocess";
|
||||||
import Routeproduct from "./product";
|
import Routeproduct from "./product";
|
||||||
import {genCode} from "@/api/system/autocode/rule"
|
import { genCode } from "@/api/system/autocode/rule";
|
||||||
export default {
|
export default {
|
||||||
name: "Proroute",
|
name: "Proroute",
|
||||||
dicts: ['sys_yes_no'],
|
dicts: ["sys_yes_no"],
|
||||||
components: { Routeprocess, Routeproduct },
|
components: { Routeprocess, Routeproduct },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -244,15 +328,15 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
routeCode: [
|
routeCode: [
|
||||||
{ required: true, message: "工艺路线编号不能为空", trigger: "blur" }
|
{ required: true, message: "工艺路线编号不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
routeName: [
|
routeName: [
|
||||||
{ required: true, message: "工艺路线名称不能为空", trigger: "blur" }
|
{ required: true, message: "工艺路线名称不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
enableFlag: [
|
enableFlag: [
|
||||||
{ required: true, message: "是否启用不能为空", trigger: "blur" }
|
{ required: true, message: "是否启用不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -262,7 +346,7 @@ export default {
|
|||||||
/** 查询工艺路线列表 */
|
/** 查询工艺路线列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listProroute(this.queryParams).then(response => {
|
listProroute(this.queryParams).then((response) => {
|
||||||
this.prorouteList = response.rows;
|
this.prorouteList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -280,12 +364,12 @@ export default {
|
|||||||
routeCode: null,
|
routeCode: null,
|
||||||
routeName: null,
|
routeName: null,
|
||||||
routeDesc: null,
|
routeDesc: null,
|
||||||
enableFlag: 'Y',
|
enableFlag: "Y",
|
||||||
remark: null,
|
remark: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null
|
updateTime: null,
|
||||||
};
|
};
|
||||||
this.autoGenFlag = true;
|
this.autoGenFlag = true;
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
@ -302,9 +386,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.routeId)
|
this.ids = selection.map((item) => item.routeId);
|
||||||
this.single = selection.length!==1
|
this.single = selection.length !== 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
@ -312,7 +396,7 @@ export default {
|
|||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加工艺路线";
|
this.title = "添加工艺路线";
|
||||||
this.optType = "add";
|
this.optType = "add";
|
||||||
genCode('ROUTE_CODE').then(response =>{
|
genCode("ROUTE_CODE").then((response) => {
|
||||||
this.form.routeCode = response;
|
this.form.routeCode = response;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -320,7 +404,7 @@ export default {
|
|||||||
handleView(row) {
|
handleView(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const routeId = row.routeId || this.ids;
|
const routeId = row.routeId || this.ids;
|
||||||
getProroute(routeId).then(response => {
|
getProroute(routeId).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "查看工艺线路信息";
|
this.title = "查看工艺线路信息";
|
||||||
@ -330,8 +414,8 @@ export default {
|
|||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const routeId = row.routeId || this.ids
|
const routeId = row.routeId || this.ids;
|
||||||
getProroute(routeId).then(response => {
|
getProroute(routeId).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改工艺路线";
|
this.title = "修改工艺路线";
|
||||||
@ -340,16 +424,16 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.routeId != null) {
|
if (this.form.routeId != null) {
|
||||||
updateProroute(this.form).then(response => {
|
updateProroute(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addProroute(this.form).then(response => {
|
addProroute(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
@ -361,29 +445,52 @@ export default {
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const routeIds = row.routeId || this.ids;
|
const routeIds = row.routeId || this.ids;
|
||||||
this.$modal.confirm('是否确认删除工艺路线编号为"' + routeIds + '"的数据项?').then(function() {
|
this.$modal
|
||||||
|
.confirm('是否确认删除?')
|
||||||
|
.then(function () {
|
||||||
return delProroute(routeIds);
|
return delProroute(routeIds);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
handlecopy(row) {
|
||||||
|
const routeId = row.routeId || this.ids;
|
||||||
|
copyProRoute(routeId).then((response) => {
|
||||||
|
this.$modal
|
||||||
|
.confirm("是否确认复制?")
|
||||||
|
.then(function () {
|
||||||
|
return delProroute(routeId);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("复制成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('pro/proroute/export', {
|
this.download(
|
||||||
...this.queryParams
|
"pro/proroute/export",
|
||||||
}, `proroute_${new Date().getTime()}.xlsx`)
|
{
|
||||||
|
...this.queryParams,
|
||||||
|
},
|
||||||
|
`proroute_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
},
|
},
|
||||||
//自动生成编码
|
//自动生成编码
|
||||||
handleAutoGenChange(autoGenFlag) {
|
handleAutoGenChange(autoGenFlag) {
|
||||||
if (autoGenFlag) {
|
if (autoGenFlag) {
|
||||||
genCode('ROUTE_CODE').then(response =>{
|
genCode("ROUTE_CODE").then((response) => {
|
||||||
this.form.routeCode = response;
|
this.form.routeCode = response;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.form.routeCode = null;
|
this.form.routeCode = null;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -164,7 +164,7 @@
|
|||||||
>
|
>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
<el-form-item label="序号" prop="orderNum">
|
<el-form-item label="序号" prop="orderNum">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:min="1"
|
:min="1"
|
||||||
@ -173,7 +173,18 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
|
<el-form-item label="工序类型" prop="processTypeId">
|
||||||
|
<treeselect
|
||||||
|
v-model="form.processTypeId"
|
||||||
|
:options="machineryTypeOptions1"
|
||||||
|
:normalizer="normalizer1"
|
||||||
|
placeholder="请选择工序类型"
|
||||||
|
@select="handleNodeProcess"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
<el-form-item label="工序" prop="processId">
|
<el-form-item label="工序" prop="processId">
|
||||||
<el-select v-model="form.processId" placeholder="请选择工序">
|
<el-select v-model="form.processId" placeholder="请选择工序">
|
||||||
<el-option
|
<el-option
|
||||||
@ -311,40 +322,16 @@
|
|||||||
placeholder="请选择设备类型"
|
placeholder="请选择设备类型"
|
||||||
@select="handleNodeClick"
|
@select="handleNodeClick"
|
||||||
/>
|
/>
|
||||||
<!-- :disable-branch-nodes="true" -->
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="12"> -->
|
<el-col
|
||||||
<el-col :span="12" v-if="Typefile">
|
:span="12"
|
||||||
<!-- <el-form-item label="代码上传" prop="">
|
v-if="this.form.code == 'CNC' || this.form.code == 'ROBOT'"
|
||||||
<el-upload
|
|
||||||
ref="codeName"
|
|
||||||
class="upload-demo"
|
|
||||||
:headers="this.headers"
|
|
||||||
action="/prod-api/common/uploadMinio"
|
|
||||||
:before-remove="beforeRemove"
|
|
||||||
:on-change="customUploadChangeImage2"
|
|
||||||
:before-upload="beforeUpload"
|
|
||||||
:on-exceed="handleExceedImage1"
|
|
||||||
accept=".PDF"
|
|
||||||
name="file"
|
|
||||||
multiple
|
|
||||||
:limit="1"
|
|
||||||
:file-list="fileList"
|
|
||||||
>
|
>
|
||||||
<el-button size="small" type="primary" icon="el-icon-upload2"
|
<el-form-item label="选择代码" prop="url">
|
||||||
>点击上传</el-button
|
|
||||||
>
|
|
||||||
<el-button type="primary" size="small" @click.stop="previewFile"
|
|
||||||
> 预览文件</el-button
|
|
||||||
>
|
|
||||||
</el-upload>
|
|
||||||
</el-form-item> -->
|
|
||||||
<el-form-item label="代码上传" prop="url">
|
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.originalName"
|
v-model="form.originalName"
|
||||||
value-key="codeId"
|
value-key="codeId"
|
||||||
placeholder="请选择工序"
|
|
||||||
@change="selectSource($event)"
|
@change="selectSource($event)"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -358,7 +345,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12" v-if="warehousing">
|
<el-col :span="12" v-if="this.form.code == 'STORE'">
|
||||||
<el-form-item label="选择出入库类型" prop="exitType">
|
<el-form-item label="选择出入库类型" prop="exitType">
|
||||||
<el-radio-group v-model="form.exitType">
|
<el-radio-group v-model="form.exitType">
|
||||||
<el-radio label="0">出库</el-radio>
|
<el-radio label="0">出库</el-radio>
|
||||||
@ -368,7 +355,44 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12" v-if="TypeId">
|
<el-col
|
||||||
|
:span="12"
|
||||||
|
v-if="
|
||||||
|
this.form.code == 'AGV_TRANSMIT' ||
|
||||||
|
this.form.code == 'TRANSMIT' ||
|
||||||
|
this.form.code == 'ROBOT_TRANSMIT'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<el-form-item label="传送带转动方向" prop="rotationDirection">
|
||||||
|
<el-radio-group v-model="form.rotationDirection">
|
||||||
|
<el-radio label="0">正转</el-radio>
|
||||||
|
<el-radio label="1">反转</el-radio>
|
||||||
|
<el-radio label="2">停止</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" v-if="this.form.code == 'ROBOT_TRANSMIT'">
|
||||||
|
<el-form-item label="传送带位置" prop="conveyNumber">
|
||||||
|
<el-radio-group v-model="form.conveyNumber">
|
||||||
|
<el-radio label="1">1号传送带</el-radio>
|
||||||
|
<el-radio label="2">2号传送带</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
:span="12"
|
||||||
|
v-if="this.form.code == 'CNC' || this.form.code == 'ROBOT'"
|
||||||
|
>
|
||||||
|
<el-form-item label="安全门状态" prop="securityDoor">
|
||||||
|
<el-radio-group v-model="form.securityDoor">
|
||||||
|
<el-radio label="0">开启</el-radio>
|
||||||
|
<el-radio label="1">关闭</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12" v-if="this.form.code == 'AGV'">
|
||||||
<el-form-item label="选择线路" prop="lineId">
|
<el-form-item label="选择线路" prop="lineId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.lineId"
|
v-model="form.lineId"
|
||||||
@ -385,7 +409,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" v-if="TypeId">
|
<el-col :span="12" v-if="this.form.code == 'AGV'">
|
||||||
<el-form-item label="选择点位" prop="pointId">
|
<el-form-item label="选择点位" prop="pointId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.pointId"
|
v-model="form.pointId"
|
||||||
@ -437,9 +461,13 @@ import {
|
|||||||
addRouteprocess,
|
addRouteprocess,
|
||||||
updateRouteprocess,
|
updateRouteprocess,
|
||||||
} from "@/api/mes/pro/routeprocess";
|
} from "@/api/mes/pro/routeprocess";
|
||||||
import { listAllProcess } from "@/api/mes/pro/process";
|
import { listProcess } from "@/api/mes/pro/process";
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from "@/utils/auth";
|
||||||
import { listMachinerytype } from "@/api/mes/dv/machinerytype";
|
import {
|
||||||
|
listMachinerytype,
|
||||||
|
getMachinerytype,
|
||||||
|
} from "@/api/mes/dv/machinerytype";
|
||||||
|
import * as listType from "@/api/mes/pro/processType";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
export default {
|
export default {
|
||||||
@ -489,6 +517,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 设备类型树选项
|
// 设备类型树选项
|
||||||
machineryTypeOptions: [],
|
machineryTypeOptions: [],
|
||||||
|
machineryTypeOptions1: [],
|
||||||
fileList: [],
|
fileList: [],
|
||||||
//车间线路
|
//车间线路
|
||||||
workshopOptions: [],
|
workshopOptions: [],
|
||||||
@ -505,6 +534,7 @@ export default {
|
|||||||
url: "",
|
url: "",
|
||||||
lineId: "",
|
lineId: "",
|
||||||
pointId: "",
|
pointId: "",
|
||||||
|
code: null,
|
||||||
},
|
},
|
||||||
machineryList: [],
|
machineryList: [],
|
||||||
// 表单校验
|
// 表单校验
|
||||||
@ -532,6 +562,9 @@ export default {
|
|||||||
trigger: "blur",
|
trigger: "blur",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
processTypeId: [
|
||||||
|
{ required: true, message: "请选择工序类型", trigger: "blur" },
|
||||||
|
],
|
||||||
idid: [
|
idid: [
|
||||||
{ required: true, message: "请选择是否工艺节点", trigger: "blur" },
|
{ required: true, message: "请选择是否工艺节点", trigger: "blur" },
|
||||||
],
|
],
|
||||||
@ -544,7 +577,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getProcess();
|
// this.getProcess();
|
||||||
this.getTreeselect();
|
this.getTreeselect();
|
||||||
this.getWorkshops();
|
this.getWorkshops();
|
||||||
},
|
},
|
||||||
@ -558,12 +591,12 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//查询工序信息
|
// //查询工序信息
|
||||||
getProcess() {
|
// getProcess() {
|
||||||
listAllProcess().then((response) => {
|
// listAllProcess().then((response) => {
|
||||||
this.processOptions = response.data;
|
// this.processOptions = response.data;
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
getWorkshops() {
|
getWorkshops() {
|
||||||
findProAgvline().then((response) => {
|
findProAgvline().then((response) => {
|
||||||
this.workshopOptions = response.rows;
|
this.workshopOptions = response.rows;
|
||||||
@ -583,6 +616,15 @@ export default {
|
|||||||
)[0];
|
)[0];
|
||||||
this.machineryTypeOptions.push(data);
|
this.machineryTypeOptions.push(data);
|
||||||
});
|
});
|
||||||
|
listType.listMachinerytype().then((response) => {
|
||||||
|
this.machineryTypeOptions1 = [];
|
||||||
|
const data = this.handleTree(
|
||||||
|
response.data,
|
||||||
|
"processTypeId",
|
||||||
|
"parentTypeId"
|
||||||
|
)[0];
|
||||||
|
this.machineryTypeOptions1.push(data);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 转换设备类型数据结构 */
|
/** 转换设备类型数据结构 */
|
||||||
normalizer(node) {
|
normalizer(node) {
|
||||||
@ -595,28 +637,47 @@ export default {
|
|||||||
children: node.children,
|
children: node.children,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/** 转换设备类型数据结构 */
|
||||||
|
normalizer1(node) {
|
||||||
|
if (node.children && !node.children.length) {
|
||||||
|
delete node.children;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
id: node.processTypeId,
|
||||||
|
label: node.processTypeName,
|
||||||
|
children: node.children,
|
||||||
|
};
|
||||||
|
},
|
||||||
// 节点单击事件
|
// 节点单击事件
|
||||||
handleNodeClick(data) {
|
handleNodeClick(data) {
|
||||||
if (data.machineryTypeId == 229) {
|
console.log(data);
|
||||||
this.TypeId = true;
|
if (data.code == "AGV") {
|
||||||
this.Typefile = false;
|
// this.TypeId = true;
|
||||||
this.warehousing = false;
|
// this.Typefile = false;
|
||||||
|
// this.warehousing = false;
|
||||||
this.form.originalName = "";
|
this.form.originalName = "";
|
||||||
this.form.url = "";
|
this.form.url = "";
|
||||||
this.form.exitType = "";
|
this.form.exitType = "";
|
||||||
} else if (data.machineryTypeId == 230) {
|
} else if (data.code == "STORE") {
|
||||||
this.TypeId = false;
|
// this.TypeId = false;
|
||||||
this.Typefile = false;
|
// this.Typefile = false;
|
||||||
this.warehousing = true;
|
// this.warehousing = true;
|
||||||
this.form.lineId = "";
|
this.form.lineId = "";
|
||||||
this.form.pointId = "";
|
this.form.pointId = "";
|
||||||
this.form.exitType = "0";
|
this.form.exitType = "0";
|
||||||
this.form.originalName = "";
|
this.form.originalName = "";
|
||||||
this.form.url = "";
|
this.form.url = "";
|
||||||
|
} else if (data.code == "CNC" || data.code == "ROBOT") {
|
||||||
|
// this.TypeId = false;
|
||||||
|
// this.Typefile = false;
|
||||||
|
// this.warehousing = true;
|
||||||
|
this.form.lineId = "";
|
||||||
|
this.form.pointId = "";
|
||||||
|
this.form.exitType = "";
|
||||||
} else {
|
} else {
|
||||||
this.TypeId = false;
|
// this.TypeId = false;
|
||||||
this.Typefile = true;
|
// this.Typefile = false;
|
||||||
this.warehousing = false;
|
// this.warehousing = false;
|
||||||
this.form.lineId = "";
|
this.form.lineId = "";
|
||||||
this.form.pointId = "";
|
this.form.pointId = "";
|
||||||
this.form.exitType = "";
|
this.form.exitType = "";
|
||||||
@ -624,11 +685,18 @@ export default {
|
|||||||
this.form.url = "";
|
this.form.url = "";
|
||||||
}
|
}
|
||||||
this.form.machineryTypeName = data.machineryTypeName;
|
this.form.machineryTypeName = data.machineryTypeName;
|
||||||
var queryParams = { machineryTypeId: data.machineryTypeId };
|
this.form.code = data.code;
|
||||||
list(queryParams).then((response) => {
|
var arr = { machineryTypeId: data.machineryTypeId };
|
||||||
|
list(arr).then((response) => {
|
||||||
this.machineryList = response.data;
|
this.machineryList = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleNodeProcess(data) {
|
||||||
|
var arr = { processTypeId: data.processTypeId };
|
||||||
|
listProcess(arr).then((response) => {
|
||||||
|
this.processOptions = response.rows;
|
||||||
|
});
|
||||||
|
},
|
||||||
selectSource(e) {
|
selectSource(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
this.form.url = e.url;
|
this.form.url = e.url;
|
||||||
@ -724,6 +792,10 @@ export default {
|
|||||||
lineId: null,
|
lineId: null,
|
||||||
pointId: null,
|
pointId: null,
|
||||||
exitType: "0",
|
exitType: "0",
|
||||||
|
rotationDirection: "0",
|
||||||
|
processTypeId: null,
|
||||||
|
code: null,
|
||||||
|
securityDoor: null,
|
||||||
};
|
};
|
||||||
this.fileList = [];
|
this.fileList = [];
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
@ -747,7 +819,7 @@ export default {
|
|||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
if (this.form.machineryTypeId == null) {
|
if (this.form.code == null) {
|
||||||
this.TypeId = false;
|
this.TypeId = false;
|
||||||
this.Typefile = false;
|
this.Typefile = false;
|
||||||
this.warehousing = false;
|
this.warehousing = false;
|
||||||
@ -770,40 +842,21 @@ export default {
|
|||||||
const recordId = row.recordId || this.ids;
|
const recordId = row.recordId || this.ids;
|
||||||
getRouteprocess(recordId).then((response) => {
|
getRouteprocess(recordId).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
getMachinerytype(row.machineryTypeId).then((response) => {
|
||||||
|
this.form.code = response.data.code;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改工艺组成";
|
this.title = "修改工艺组成";
|
||||||
});
|
});
|
||||||
if (row.machineryTypeId == null) {
|
});
|
||||||
this.TypeId = false;
|
|
||||||
this.Typefile = false;
|
var arr = { machineryTypeId: row.machineryTypeId };
|
||||||
this.warehousing = false;
|
list(arr).then((response) => {
|
||||||
} else {
|
|
||||||
if (row.machineryTypeId == 229) {
|
|
||||||
this.TypeId = true;
|
|
||||||
this.Typefile = false;
|
|
||||||
this.warehousing = false;
|
|
||||||
// this.form.originalName = "";
|
|
||||||
// this.form.url = "";
|
|
||||||
// this.form.exitType = "";
|
|
||||||
} else if (row.machineryTypeId == 230) {
|
|
||||||
this.TypeId = false;
|
|
||||||
this.Typefile = false;
|
|
||||||
this.warehousing = true;
|
|
||||||
// this.form.lineId = "";
|
|
||||||
// this.form.pointId = "";
|
|
||||||
} else {
|
|
||||||
this.TypeId = false;
|
|
||||||
this.Typefile = true;
|
|
||||||
this.warehousing = false;
|
|
||||||
// this.form.lineId = "";
|
|
||||||
// this.form.pointId = "";
|
|
||||||
// this.form.exitType = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var queryParams = { machineryTypeId: row.machineryTypeId };
|
|
||||||
list(queryParams).then((response) => {
|
|
||||||
this.machineryList = response.data;
|
this.machineryList = response.data;
|
||||||
});
|
});
|
||||||
|
var arr1 = { processTypeId: row.processTypeId };
|
||||||
|
listProcess(arr1).then((response) => {
|
||||||
|
this.processOptions = response.rows;
|
||||||
|
});
|
||||||
var name = {};
|
var name = {};
|
||||||
if (row.originalName != undefined && row.originalName != "") {
|
if (row.originalName != undefined && row.originalName != "") {
|
||||||
this.$set(name, "name", row.originalName);
|
this.$set(name, "name", row.originalName);
|
||||||
@ -815,13 +868,6 @@ export default {
|
|||||||
this.$refs["form"].validate((valid) => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.recordId != null) {
|
if (this.form.recordId != null) {
|
||||||
// if (this.form.machineryTypeId == 229) {
|
|
||||||
// this.form.originalName = "";
|
|
||||||
// this.form.url = "";
|
|
||||||
// } else {
|
|
||||||
// this.form.lineId = "";
|
|
||||||
// this.form.pointId = "";
|
|
||||||
// }
|
|
||||||
updateRouteprocess(this.form).then((response) => {
|
updateRouteprocess(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
@ -117,7 +117,7 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8" style="margin-top: 10px">
|
<el-row :gutter="10" class="mb8" style="margin-top: 10px">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain size="mini" @click="production"
|
<el-button type="primary" plain size="mini" @click="handleproductione"
|
||||||
>批量执行生产</el-button
|
>批量执行生产</el-button
|
||||||
>
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -234,7 +234,7 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
v-if="scope.row.status == 'CONFIRMED'"
|
v-if="scope.row.status == 'PRODUCTION'"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['mes:pro:protask:edit']"
|
v-hasPermi="['mes:pro:protask:edit']"
|
||||||
>排产</el-button
|
>排产</el-button
|
||||||
@ -242,10 +242,24 @@
|
|||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
v-if="scope.row.status == 'CONFIRMED'"
|
v-if="scope.row.status == 'PRODUCTION'"
|
||||||
@click="handleproductione(scope.row)"
|
@click="handleproductione(scope.row)"
|
||||||
>执行生产</el-button
|
>执行生产</el-button
|
||||||
>
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
v-if="scope.row.status == 'WORKING'"
|
||||||
|
@click="Pendingproduction(scope.row)"
|
||||||
|
>暂停生产</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
v-if="scope.row.status == 'SUSPENDED'"
|
||||||
|
@click="handleSuspended(scope.row)"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -259,7 +273,12 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改生产工单对话框 -->
|
<!-- 添加或修改生产工单对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
|
<el-dialog
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="open"
|
||||||
|
width="1550px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
<el-form ref="form" :model="form" label-width="80px">
|
<el-form ref="form" :model="form" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -274,7 +293,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="12">
|
||||||
<el-form-item label="来源类型" prop="orderSource">
|
<el-form-item label="来源类型" prop="orderSource">
|
||||||
<el-radio-group v-model="form.orderSource" disabled>
|
<el-radio-group v-model="form.orderSource" disabled>
|
||||||
<el-radio
|
<el-radio
|
||||||
@ -286,12 +305,12 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" v-if="form.orderSource == 'ORDER'">
|
<el-col :span="12" v-if="form.orderSource == 'ORDER'">
|
||||||
<el-form-item label="订单编号" prop="sourceCode">
|
<el-form-item label="订单编号" prop="sourceCode">
|
||||||
<el-input v-model="form.sourceCode" readonly="readonly" />
|
<el-input v-model="form.sourceCode" readonly="readonly" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="12">
|
||||||
<el-form-item label="排产状态" prop="status">
|
<el-form-item label="排产状态" prop="status">
|
||||||
<el-select v-model="form.status" disabled>
|
<el-select v-model="form.status" disabled>
|
||||||
<el-option
|
<el-option
|
||||||
@ -374,6 +393,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<el-scrollbar style="height: 100%; background: #f5f7fa">
|
||||||
<el-steps
|
<el-steps
|
||||||
:active="activeProcess"
|
:active="activeProcess"
|
||||||
v-if="form.workorderId != null"
|
v-if="form.workorderId != null"
|
||||||
@ -387,6 +407,8 @@
|
|||||||
>
|
>
|
||||||
</el-step>
|
</el-step>
|
||||||
</el-steps>
|
</el-steps>
|
||||||
|
</el-scrollbar>
|
||||||
|
|
||||||
<el-card
|
<el-card
|
||||||
v-for="(item, index) in processOptions"
|
v-for="(item, index) in processOptions"
|
||||||
:key="index"
|
:key="index"
|
||||||
@ -397,6 +419,7 @@
|
|||||||
:routeId="item.routeId"
|
:routeId="item.routeId"
|
||||||
:processId="item.processId"
|
:processId="item.processId"
|
||||||
:colorCode="item.colorCode"
|
:colorCode="item.colorCode"
|
||||||
|
:orderNum="item.orderNum"
|
||||||
:optType="optType"
|
:optType="optType"
|
||||||
:recordId="item.recordId"
|
:recordId="item.recordId"
|
||||||
></ProTask>
|
></ProTask>
|
||||||
@ -431,6 +454,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import axios from "axios";
|
||||||
import {
|
import {
|
||||||
listWorkorder,
|
listWorkorder,
|
||||||
getWorkorder,
|
getWorkorder,
|
||||||
@ -511,6 +535,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
ids: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -634,14 +659,60 @@ export default {
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
var ids = [];
|
this.ids = selection.map((item) => item.workorderId);
|
||||||
ids = selection.map((item) => item.routeId);
|
},
|
||||||
|
// 执行生产
|
||||||
|
handleproductione(row) {
|
||||||
|
const routeId = row.workorderId || this.ids;
|
||||||
|
axios
|
||||||
|
.get("http://192.168.3.53:8077/manage/task/execute?ids=" + routeId)
|
||||||
|
// .get("http://127.0.0.1:8077/manage/task/execute?ids=" + routeId)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("执行成功");
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 暂停生产
|
||||||
|
Pendingproduction(row) {
|
||||||
|
const routeId = row.workorderId || this.ids;
|
||||||
|
axios
|
||||||
|
.get("http://192.168.3.53:8077/manage/task/suspension?id=" + routeId)
|
||||||
|
// .get("http://127.0.0.1:8077/manage/task/suspension?id=" + routeId)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("已暂停");
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
handleSuspended(row) {
|
||||||
|
// const workorderIds = row.workorderId || this.ids;
|
||||||
|
// this.$modal
|
||||||
|
// .confirm("确认删除数据项?")
|
||||||
|
// .then(function () {
|
||||||
|
// return dofinish(workorderIds); //完成工单
|
||||||
|
// })
|
||||||
|
// .then(() => {
|
||||||
|
// if (res.data.code === 200) {
|
||||||
|
// this.getList();
|
||||||
|
// this.$modal.msgSuccess("删除成功");
|
||||||
|
// } else {
|
||||||
|
// this.$message.error(res.data.msg);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// .catch(() => {});
|
||||||
},
|
},
|
||||||
production() {},
|
|
||||||
handleproductione() {},
|
|
||||||
|
|
||||||
selectable(row, index) {
|
selectable(row, index) {
|
||||||
if (row.status == "WORKING") {
|
if (row.status == "WORKING" || row.status == "PREPARE") {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<el-color-picker v-model="scope.row.colorCode" disabled></el-color-picker>
|
<el-color-picker v-model="scope.row.colorCode" disabled></el-color-picker>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="100px" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" width="150px" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -220,6 +220,7 @@ export default {
|
|||||||
endTime: null,
|
endTime: null,
|
||||||
colorCode: null,
|
colorCode: null,
|
||||||
requestDate: null,
|
requestDate: null,
|
||||||
|
orderNum: this.orderNum,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
@ -246,7 +247,8 @@ export default {
|
|||||||
routeId: null,
|
routeId: null,
|
||||||
processId: null,
|
processId: null,
|
||||||
optType: null,
|
optType: null,
|
||||||
recordId:null
|
recordId:null,
|
||||||
|
orderNum:null,
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
size="small"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
<el-form-item label="工单编码" prop="workorderCode">
|
<el-form-item label="工单编码" prop="workorderCode">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.workorderCode"
|
v-model="queryParams.workorderCode"
|
||||||
@ -68,16 +75,26 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="需求日期" prop="requestDate">
|
<el-form-item label="需求日期" prop="requestDate">
|
||||||
<el-date-picker clearable
|
<el-date-picker
|
||||||
|
clearable
|
||||||
v-model="queryParams.requestDate"
|
v-model="queryParams.requestDate"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
placeholder="请选择需求日期">
|
placeholder="请选择需求日期"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</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
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -90,7 +107,8 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['mes:pro:workorder:add']"
|
v-hasPermi="['mes:pro:workorder:add']"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -101,7 +119,8 @@
|
|||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['mes:pro:workorder:edit']"
|
v-hasPermi="['mes:pro:workorder:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -112,7 +131,8 @@
|
|||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['mes:pro:workorder:remove']"
|
v-hasPermi="['mes:pro:workorder:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -122,9 +142,13 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['mes:pro:workorder:export']"
|
v-hasPermi="['mes:pro:workorder: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
|
<el-table
|
||||||
@ -141,42 +165,104 @@
|
|||||||
type="text"
|
type="text"
|
||||||
@click="handleView(scope.row)"
|
@click="handleView(scope.row)"
|
||||||
v-hasPermi="['mes:pro:workorder:query']"
|
v-hasPermi="['mes:pro:workorder:query']"
|
||||||
>{{scope.row.workorderCode}}</el-button>
|
>{{ scope.row.workorderCode }}</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="工单名称" width="200" align="center" prop="workorderName" :show-overflow-tooltip="true"/>
|
<el-table-column
|
||||||
|
label="工单名称"
|
||||||
|
width="200"
|
||||||
|
align="center"
|
||||||
|
prop="workorderName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
<el-table-column label="工单类型" align="center" prop="workorderType">
|
<el-table-column label="工单类型" align="center" prop="workorderType">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType"/>
|
<dict-tag
|
||||||
|
:options="dict.type.mes_workorder_type"
|
||||||
|
:value="scope.row.workorderType"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="工单来源" align="center" prop="orderSource">
|
<el-table-column label="工单来源" align="center" prop="orderSource">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.mes_workorder_sourcetype" :value="scope.row.orderSource"/>
|
<dict-tag
|
||||||
|
:options="dict.type.mes_workorder_sourcetype"
|
||||||
|
:value="scope.row.orderSource"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="订单编号" width="140" align="center" prop="sourceCode" />
|
<el-table-column
|
||||||
<el-table-column label="产品编号" width="120" align="center" prop="productCode" />
|
label="订单编号"
|
||||||
<el-table-column label="产品名称" width="200" align="center" prop="productName" :show-overflow-tooltip="true"/>
|
width="140"
|
||||||
<el-table-column label="规格型号" align="center" prop="productSpc" :show-overflow-tooltip="true"/>
|
align="center"
|
||||||
|
prop="sourceCode"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="产品编号"
|
||||||
|
width="120"
|
||||||
|
align="center"
|
||||||
|
prop="productCode"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="产品名称"
|
||||||
|
width="200"
|
||||||
|
align="center"
|
||||||
|
prop="productName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="规格型号"
|
||||||
|
align="center"
|
||||||
|
prop="productSpc"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
||||||
<el-table-column label="计划数量" align="center" prop="quantity" />
|
<el-table-column label="计划数量" align="center" prop="quantity" />
|
||||||
<el-table-column label="调整数量" align="center" prop="quantityChanged" />
|
<el-table-column label="调整数量" align="center" prop="quantityChanged" />
|
||||||
<el-table-column label="已生产数量" align="center" width="100px" prop="quantityProduced" />
|
<el-table-column
|
||||||
<el-table-column label="批次号" align="center" width="100px" prop="batchCode" />
|
label="已生产数量"
|
||||||
|
align="center"
|
||||||
|
width="100px"
|
||||||
|
prop="quantityProduced"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="批次号"
|
||||||
|
align="center"
|
||||||
|
width="100px"
|
||||||
|
prop="batchCode"
|
||||||
|
/>
|
||||||
<el-table-column label="客户编码" align="center" prop="clientCode" />
|
<el-table-column label="客户编码" align="center" prop="clientCode" />
|
||||||
<el-table-column label="客户名称" align="center" prop="clientName" :show-overflow-tooltip="true"/>
|
<el-table-column
|
||||||
<el-table-column label="需求日期" align="center" prop="requestDate" width="180">
|
label="客户名称"
|
||||||
|
align="center"
|
||||||
|
prop="clientName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="需求日期"
|
||||||
|
align="center"
|
||||||
|
prop="requestDate"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.requestDate, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.requestDate, "{y}-{m}-{d}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单据状态" align="center" prop="status">
|
<el-table-column label="单据状态" align="center" prop="status">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.mes_order_status" :value="scope.row.status"/>
|
<dict-tag
|
||||||
|
:options="dict.type.mes_order_status"
|
||||||
|
:value="scope.row.status"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="150px" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
width="150px"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -185,15 +271,20 @@
|
|||||||
v-if="scope.row.status == 'PREPARE'"
|
v-if="scope.row.status == 'PREPARE'"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['mes:pro:workorder:edit']"
|
v-hasPermi="['mes:pro:workorder:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
v-if="scope.row.status =='CONFIRMED' && scope.row.workorderType =='SELF'"
|
v-if="
|
||||||
|
scope.row.status == 'CONFIRMED' &&
|
||||||
|
scope.row.workorderType == 'SELF'
|
||||||
|
"
|
||||||
@click="handleAdd(scope.row)"
|
@click="handleAdd(scope.row)"
|
||||||
v-hasPermi="['mes:pro:workorder:update']"
|
v-hasPermi="['mes:pro:workorder:update']"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@ -201,7 +292,8 @@
|
|||||||
v-if="scope.row.status == 'CONFIRMED'"
|
v-if="scope.row.status == 'CONFIRMED'"
|
||||||
@click="handleFinish(scope.row)"
|
@click="handleFinish(scope.row)"
|
||||||
v-hasPermi="['mes:pro:workorder:update']"
|
v-hasPermi="['mes:pro:workorder:update']"
|
||||||
>完成</el-button>
|
>完成</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@ -209,7 +301,8 @@
|
|||||||
v-if="scope.row.status == 'PREPARE'"
|
v-if="scope.row.status == 'PREPARE'"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['mes:pro:workorder:remove']"
|
v-hasPermi="['mes:pro:workorder:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -227,51 +320,73 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="工单编号" prop="workorderCode">
|
<el-form-item label="工单编号" prop="workorderCode">
|
||||||
<el-input v-model="form.workorderCode" placeholder="请输入工单编号" />
|
<el-input
|
||||||
|
v-model="form.workorderCode"
|
||||||
|
placeholder="请输入工单编号"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item label-width="80">
|
<el-form-item label-width="80">
|
||||||
<el-switch v-model="autoGenFlag"
|
<el-switch
|
||||||
|
v-model="autoGenFlag"
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
active-text="自动生成"
|
active-text="自动生成"
|
||||||
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view' && form.status =='PREPARE'">
|
@change="handleAutoGenChange(autoGenFlag)"
|
||||||
|
v-if="optType != 'view' && form.status == 'PREPARE'"
|
||||||
|
>
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="工单名称" prop="workorderName">
|
<el-form-item label="工单名称" prop="workorderName">
|
||||||
<el-input v-model="form.workorderName" placeholder="请输入工单名称" />
|
<el-input
|
||||||
|
v-model="form.workorderName"
|
||||||
|
placeholder="请输入工单名称"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="来源类型" prop="orderSource">
|
<el-form-item label="来源类型" prop="orderSource">
|
||||||
<el-radio-group v-model="form.orderSource" disabled v-if="optType=='view'">
|
<el-radio-group
|
||||||
|
v-model="form.orderSource"
|
||||||
|
disabled
|
||||||
|
v-if="optType == 'view'"
|
||||||
|
>
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.mes_workorder_sourcetype"
|
v-for="dict in dict.type.mes_workorder_sourcetype"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<el-radio-group v-model="form.orderSource" v-else>
|
<el-radio-group v-model="form.orderSource" v-else>
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.mes_workorder_sourcetype"
|
v-for="dict in dict.type.mes_workorder_sourcetype"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>{{dict.label}}</el-radio>
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" v-if="form.orderSource == 'ORDER'">
|
<el-col :span="8" v-if="form.orderSource == 'ORDER'">
|
||||||
<el-form-item label="订单编号" prop="sourceCode">
|
<el-form-item label="订单编号" prop="sourceCode">
|
||||||
<el-input v-model="form.sourceCode" placeholder="请输入订单编号" />
|
<el-input
|
||||||
|
v-model="form.sourceCode"
|
||||||
|
placeholder="请输入订单编号"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="单据状态" prop="status">
|
<el-form-item label="单据状态" prop="status">
|
||||||
<el-select v-model="form.status" disabled placeholder="请选择单据状态">
|
<el-select
|
||||||
|
v-model="form.status"
|
||||||
|
disabled
|
||||||
|
placeholder="请选择单据状态"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.mes_order_status"
|
v-for="dict in dict.type.mes_order_status"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -298,42 +413,65 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="产品编号" prop="productCode">
|
<el-form-item label="产品编号" prop="productCode">
|
||||||
<el-input v-model="form.productCode" placeholder="请选择产品">
|
<el-input v-model="form.productCode" placeholder="请选择产品">
|
||||||
<el-button slot="append" @click="handleSelectProduct" icon="el-icon-search"></el-button>
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
@click="handleSelectProduct"
|
||||||
|
icon="el-icon-search"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
<ItemSelect ref="itemSelect" @onSelected="onItemSelected" > </ItemSelect>
|
<ItemSelect ref="itemSelect" @onSelected="onItemSelected">
|
||||||
|
</ItemSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="产品名称" prop="productName">
|
<el-form-item label="产品名称" prop="productName">
|
||||||
<el-input v-model="form.productName" placeholder="请选择产品" disabled/>
|
<el-input
|
||||||
|
v-model="form.productName"
|
||||||
|
placeholder="请选择产品"
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="规格型号" prop="productSpc">
|
<el-form-item label="规格型号" prop="productSpc">
|
||||||
<el-input v-model="form.productSpc" placeholder="请选择产品" disabled/>
|
<el-input
|
||||||
|
v-model="form.productSpc"
|
||||||
|
placeholder="请选择产品"
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="单位" prop="unitOfMeasure">
|
<el-form-item label="单位" prop="unitOfMeasure">
|
||||||
<el-input v-model="form.unitOfMeasure" placeholder="请选择产品" disabled/>
|
<el-input
|
||||||
|
v-model="form.unitOfMeasure"
|
||||||
|
placeholder="请选择产品"
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="计划数量" prop="quantity">
|
<el-form-item label="计划数量" prop="quantity">
|
||||||
<el-input-number :min="1" v-model="form.quantity" placeholder="请输入计划数量" />
|
<el-input-number
|
||||||
|
:min="1"
|
||||||
|
v-model="form.quantity"
|
||||||
|
placeholder="请输入计划数量"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="需求日期" prop="requestDate">
|
<el-form-item label="需求日期" prop="requestDate">
|
||||||
<el-date-picker clearable
|
<el-date-picker
|
||||||
|
clearable
|
||||||
v-model="form.requestDate"
|
v-model="form.requestDate"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
placeholder="请选择需求日期">
|
placeholder="请选择需求日期"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -343,34 +481,66 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工件数量" prop="workpieceType">
|
||||||
|
<el-radio-group v-model="form.workpieceType">
|
||||||
|
<el-radio label="1">一个托盘单工件</el-radio>
|
||||||
|
<el-radio label="0">一个托盘多工件</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<el-row v-if="form.orderSource == 'ORDER'">
|
<el-row v-if="form.orderSource == 'ORDER'">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="客户编码" prop="clientCode">
|
<el-form-item label="客户编码" prop="clientCode">
|
||||||
<el-input v-model="form.clientCode" placeholder="请选择客户">
|
<el-input v-model="form.clientCode" placeholder="请选择客户">
|
||||||
<el-button slot="append" @click="handleSelectClient" icon="el-icon-search"></el-button>
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
@click="handleSelectClient"
|
||||||
|
icon="el-icon-search"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
<ClientSelect ref="clientSelect" @onSelected="onClientSelected" > </ClientSelect>
|
<ClientSelect ref="clientSelect" @onSelected="onClientSelected">
|
||||||
|
</ClientSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="客户名称" prop="clientName">
|
<el-form-item label="客户名称" prop="clientName">
|
||||||
<el-input v-model="form.clientName" readonly="readonly" placeholder="请输入客户名称" />
|
<el-input
|
||||||
|
v-model="form.clientName"
|
||||||
|
readonly="readonly"
|
||||||
|
placeholder="请输入客户名称"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col></el-col>
|
<el-col></el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row v-if="form.workorderType == 'OUTSOURCE' || form.workorderType == 'PURCHASE'">
|
<el-row
|
||||||
|
v-if="
|
||||||
|
form.workorderType == 'OUTSOURCE' ||
|
||||||
|
form.workorderType == 'PURCHASE'
|
||||||
|
"
|
||||||
|
>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="供应商编码" prop="vendorCode">
|
<el-form-item label="供应商编码" prop="vendorCode">
|
||||||
<el-input v-model="form.vendorCode" placeholder="请选择供应商">
|
<el-input v-model="form.vendorCode" placeholder="请选择供应商">
|
||||||
<el-button slot="append" @click="handleSelectVendor" icon="el-icon-search"></el-button>
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
@click="handleSelectVendor"
|
||||||
|
icon="el-icon-search"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
<VendorSelect ref="vendorSelect" @onSelected="onVendorSelected" />
|
<VendorSelect ref="vendorSelect" @onSelected="onVendorSelected" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="供应商名称" prop="vendorName">
|
<el-form-item label="供应商名称" prop="vendorName">
|
||||||
<el-input v-model="form.vendorName" readonly="readonly" placeholder="请选择供应商" />
|
<el-input
|
||||||
|
v-model="form.vendorName"
|
||||||
|
readonly="readonly"
|
||||||
|
placeholder="请选择供应商"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col></el-col>
|
<el-col></el-col>
|
||||||
@ -383,23 +553,49 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-tabs type="border-card" v-if="form.workorderId != null">
|
<el-tabs type="border-card" v-if="form.workorderId != null">
|
||||||
<el-tab-pane label="BOM组成">
|
<el-tab-pane label="BOM组成">
|
||||||
<Workorderbom ref="bomlist" :optType="optType" :workorder="form" @handleAddSub="handleSubAdd" ></Workorderbom>
|
<Workorderbom
|
||||||
</el-tab-pane>
|
ref="bomlist"
|
||||||
<el-tab-pane label="物料需求">
|
:optType="optType"
|
||||||
|
:workorder="form"
|
||||||
|
@handleAddSub="handleSubAdd"
|
||||||
|
></Workorderbom>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="物料需求"> </el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
|
<el-button
|
||||||
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">保 存</el-button>
|
type="primary"
|
||||||
<el-button type="success" @click="handleConfirm" v-if="form.status =='PREPARE' && optType !='view' && form.workorderId !=null">确 认</el-button>
|
@click="cancel"
|
||||||
|
v-if="optType == 'view' || form.status != 'PREPARE'"
|
||||||
|
>返回</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="submitForm"
|
||||||
|
v-if="form.status == 'PREPARE' && optType != 'view'"
|
||||||
|
>保 存</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
@click="handleConfirm"
|
||||||
|
v-if="
|
||||||
|
form.status == 'PREPARE' &&
|
||||||
|
optType != 'view' &&
|
||||||
|
form.workorderId != null
|
||||||
|
"
|
||||||
|
>确 认</el-button
|
||||||
|
>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -407,26 +603,33 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listWorkorder, getWorkorder, delWorkorder, addWorkorder, updateWorkorder ,dofinish} from "@/api/mes/pro/workorder";
|
import {
|
||||||
|
listWorkorder,
|
||||||
|
getWorkorder,
|
||||||
|
delWorkorder,
|
||||||
|
addWorkorder,
|
||||||
|
updateWorkorder,
|
||||||
|
dofinish,
|
||||||
|
} from "@/api/mes/pro/workorder";
|
||||||
import Workorderbom from "./bom/bom.vue";
|
import Workorderbom from "./bom/bom.vue";
|
||||||
import WorkorderItemList from "./items/item.vue";
|
import WorkorderItemList from "./items/item.vue";
|
||||||
import ItemSelect from "@/components/itemSelect/single.vue";
|
import ItemSelect from "@/components/itemSelect/single.vue";
|
||||||
import ClientSelect from "@/components/clientSelect/single.vue";
|
import ClientSelect from "@/components/clientSelect/single.vue";
|
||||||
import VendorSelect from "@/components/vendorSelect/single.vue";
|
import VendorSelect from "@/components/vendorSelect/single.vue";
|
||||||
import {genCode} from "@/api/system/autocode/rule"
|
import { genCode } from "@/api/system/autocode/rule";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Workorder",
|
name: "Workorder",
|
||||||
dicts: ['mes_order_status','mes_workorder_sourcetype','mes_workorder_type'],
|
dicts: ["mes_order_status", "mes_workorder_sourcetype", "mes_workorder_type"],
|
||||||
components: {
|
components: {
|
||||||
Treeselect,
|
Treeselect,
|
||||||
ItemSelect,
|
ItemSelect,
|
||||||
ClientSelect,
|
ClientSelect,
|
||||||
VendorSelect,
|
VendorSelect,
|
||||||
Workorderbom,
|
Workorderbom,
|
||||||
WorkorderItemList
|
WorkorderItemList,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -481,33 +684,33 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
workorderCode: [
|
workorderCode: [
|
||||||
{ required: true, message: "工单编码不能为空", trigger: "blur" }
|
{ required: true, message: "工单编码不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
workorderName: [
|
workorderName: [
|
||||||
{ required: true, message: "工单名称不能为空", trigger: "blur" }
|
{ required: true, message: "工单名称不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
// workorderType: [
|
// workorderType: [
|
||||||
// { required: true, message: "请选择生产工单类型", trigger: "blur" }
|
// { required: true, message: "请选择生产工单类型", trigger: "blur" }
|
||||||
// ],
|
// ],
|
||||||
orderSource: [
|
orderSource: [
|
||||||
{ required: true, message: "来源类型不能为空", trigger: "blur" }
|
{ required: true, message: "来源类型不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
productId: [
|
productId: [
|
||||||
{ required: true, message: "产品不能为空", trigger: "blur" }
|
{ required: true, message: "产品不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
productCode: [
|
productCode: [
|
||||||
{ required: true, message: "产品编号不能为空", trigger: "blur" }
|
{ required: true, message: "产品编号不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
productName: [
|
productName: [
|
||||||
{ required: true, message: "产品名称不能为空", trigger: "blur" }
|
{ required: true, message: "产品名称不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
quantity: [
|
quantity: [
|
||||||
{ required: true, message: "生产数量不能为空", trigger: "blur" }
|
{ required: true, message: "生产数量不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
requestDate: [
|
requestDate: [
|
||||||
{ required: true, message: "需求日期不能为空", trigger: "blur" }
|
{ required: true, message: "需求日期不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -517,8 +720,12 @@ export default {
|
|||||||
/** 查询生产工单列表 */
|
/** 查询生产工单列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listWorkorder(this.queryParams).then(response => {
|
listWorkorder(this.queryParams).then((response) => {
|
||||||
this.workorderList = this.handleTree(response.rows, "workorderId", "parentId");
|
this.workorderList = this.handleTree(
|
||||||
|
response.rows,
|
||||||
|
"workorderId",
|
||||||
|
"parentId"
|
||||||
|
);
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
@ -531,15 +738,23 @@ export default {
|
|||||||
return {
|
return {
|
||||||
id: node.workorderId,
|
id: node.workorderId,
|
||||||
label: node.workorderName,
|
label: node.workorderName,
|
||||||
children: node.children
|
children: node.children,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/** 查询生产工单下拉树结构 */
|
/** 查询生产工单下拉树结构 */
|
||||||
getTreeselect() {
|
getTreeselect() {
|
||||||
listWorkorder().then(response => {
|
listWorkorder().then((response) => {
|
||||||
this.workorderOptions = [];
|
this.workorderOptions = [];
|
||||||
const data = { workorderId: 0, workorderName: '顶级节点', children: [] };
|
const data = {
|
||||||
data.children = this.handleTree(response.data, "workorderId", "parentId");
|
workorderId: 0,
|
||||||
|
workorderName: "顶级节点",
|
||||||
|
children: [],
|
||||||
|
};
|
||||||
|
data.children = this.handleTree(
|
||||||
|
response.data,
|
||||||
|
"workorderId",
|
||||||
|
"parentId"
|
||||||
|
);
|
||||||
this.workorderOptions.push(data);
|
this.workorderOptions.push(data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -554,7 +769,7 @@ export default {
|
|||||||
workorderId: null,
|
workorderId: null,
|
||||||
workorderCode: null,
|
workorderCode: null,
|
||||||
workorderName: null,
|
workorderName: null,
|
||||||
workorderType: 'SELF',
|
workorderType: "SELF",
|
||||||
orderSource: null,
|
orderSource: null,
|
||||||
sourceCode: null,
|
sourceCode: null,
|
||||||
productId: null,
|
productId: null,
|
||||||
@ -579,7 +794,8 @@ export default {
|
|||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null
|
updateTime: null,
|
||||||
|
workpieceType: "1",
|
||||||
};
|
};
|
||||||
this.autoGenFlag = true;
|
this.autoGenFlag = true;
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
@ -627,7 +843,7 @@ export default {
|
|||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加生产工单";
|
this.title = "添加生产工单";
|
||||||
this.optType = "add";
|
this.optType = "add";
|
||||||
genCode('WORKORDER_CODE').then(response =>{
|
genCode("WORKORDER_CODE").then((response) => {
|
||||||
this.form.workorderCode = response;
|
this.form.workorderCode = response;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -636,7 +852,7 @@ export default {
|
|||||||
this.reset();
|
this.reset();
|
||||||
this.getTreeselect();
|
this.getTreeselect();
|
||||||
const workorderId = row.workorderId || this.ids;
|
const workorderId = row.workorderId || this.ids;
|
||||||
getWorkorder(workorderId).then(response => {
|
getWorkorder(workorderId).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "查看工单信息";
|
this.title = "查看工单信息";
|
||||||
@ -650,9 +866,9 @@ export default {
|
|||||||
if (row != null) {
|
if (row != null) {
|
||||||
this.form.parentId = row.workorderId;
|
this.form.parentId = row.workorderId;
|
||||||
}
|
}
|
||||||
getWorkorder(row.workorderId).then(response => {
|
getWorkorder(row.workorderId).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.form.workorderType = 'SELF'
|
this.form.workorderType = "SELF";
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改生产工单";
|
this.title = "修改生产工单";
|
||||||
this.optType = "edit";
|
this.optType = "edit";
|
||||||
@ -660,17 +876,17 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.workorderId != null) {
|
if (this.form.workorderId != null) {
|
||||||
updateWorkorder(this.form).then(response => {
|
updateWorkorder(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
//this.open = false;
|
//this.open = false;
|
||||||
this.$refs["bomlist"].getList();
|
this.$refs["bomlist"].getList();
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addWorkorder(this.form).then(response => {
|
addWorkorder(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
//this.open = false;
|
//this.open = false;
|
||||||
this.form.workorderId = response.data;
|
this.form.workorderId = response.data;
|
||||||
@ -682,12 +898,18 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal.confirm('是否确认删除生产工单编号为"' + row.workorderId + '"的数据项?').then(function() {
|
this.$modal
|
||||||
|
.confirm(
|
||||||
|
'是否确认删除生产工单编码为"' + row.workorderCode + '"的数据项?'
|
||||||
|
)
|
||||||
|
.then(function () {
|
||||||
return delWorkorder(row.workorderId);
|
return delWorkorder(row.workorderId);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
handleSelectProduct() {
|
handleSelectProduct() {
|
||||||
this.$refs.itemSelect.showFlag = true;
|
this.$refs.itemSelect.showFlag = true;
|
||||||
@ -697,25 +919,35 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('mes/pro/workorder/export', {
|
this.download(
|
||||||
...this.queryParams
|
"mes/pro/workorder/export",
|
||||||
}, `workorder_${new Date().getTime()}.xlsx`)
|
{
|
||||||
|
...this.queryParams,
|
||||||
|
},
|
||||||
|
`workorder_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
},
|
},
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
let that = this;
|
let that = this;
|
||||||
this.$modal.confirm('是否确认完成工单编制?【确认后将不能更改】').then(function(){
|
this.$modal
|
||||||
that.form.status = 'CONFIRMED';
|
.confirm("是否确认完成工单编制?【确认后将不能更改】")
|
||||||
|
.then(function () {
|
||||||
|
that.form.status = "PRODUCTION";
|
||||||
that.submitForm();
|
that.submitForm();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleFinish(row) {
|
handleFinish(row) {
|
||||||
const workorderIds = row.workorderId || this.ids;
|
const workorderIds = row.workorderId || this.ids;
|
||||||
this.$modal.confirm('确认完成工单?一旦完成,此工单将无法继续报工').then(function() {
|
this.$modal
|
||||||
return dofinish(workorderIds) //完成工单
|
.confirm("确认完成工单?一旦完成,此工单将无法继续报工")
|
||||||
}).then(() => {
|
.then(function () {
|
||||||
|
return dofinish(workorderIds); //完成工单
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("更改成功");
|
this.$modal.msgSuccess("更改成功");
|
||||||
}).catch(() => {});
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
//物料选择弹出框
|
//物料选择弹出框
|
||||||
onItemSelected(obj) {
|
onItemSelected(obj) {
|
||||||
@ -751,13 +983,13 @@ export default {
|
|||||||
//自动生成编码
|
//自动生成编码
|
||||||
handleAutoGenChange(autoGenFlag) {
|
handleAutoGenChange(autoGenFlag) {
|
||||||
if (autoGenFlag) {
|
if (autoGenFlag) {
|
||||||
genCode('WORKORDER_CODE').then(response =>{
|
genCode("WORKORDER_CODE").then((response) => {
|
||||||
this.form.workorderCode = response;
|
this.form.workorderCode = response;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.form.workorderCode = null;
|
this.form.workorderCode = null;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user