Compare commits
15 Commits
c99393dd12
...
75f59c3279
Author | SHA1 | Date | |
---|---|---|---|
75f59c3279 | |||
8c37647aab | |||
bad7175f87 | |||
231e9227a5 | |||
e82ee4e542 | |||
|
40e7d6b6d8 | ||
|
1d9b97f1d0 | ||
cfaa17ee28 | |||
d1cbac481d | |||
c895975703 | |||
6ef90a8eba | |||
e63b98161f | |||
23c1b4b3c6 | |||
|
010e51c0f6 | ||
|
a6b48280aa |
4
.env.dev
4
.env.dev
@ -12,8 +12,8 @@ ENV = 'development'
|
|||||||
VUE_APP_TITLE = MES系统
|
VUE_APP_TITLE = MES系统
|
||||||
|
|
||||||
# 芋道管理系统/开发环境
|
# 芋道管理系统/开发环境
|
||||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
||||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
|
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
|
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
|
||||||
|
12
src/assets/icons/svg/home.svg
Normal file
12
src/assets/icons/svg/home.svg
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>编组</title>
|
||||||
|
<g id="组件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="icon/banner/home" fill="#000" fill-rule="nonzero">
|
||||||
|
<g id="编组">
|
||||||
|
<rect id="矩形" opacity="0" x="0" y="0" width="24" height="24"></rect>
|
||||||
|
<path d="M11.1710783,2.42919989 C11.7298936,2.09409047 12.4328291,2.12455473 12.9654367,2.52059014 L20.3218013,7.99000647 L20.4665209,8.10559268 C21.0744501,8.62656431 21.4302636,9.40344805 21.4302636,10.227099 L21.4302636,19.0470569 L21.4250327,19.2212289 C21.3382831,20.6611171 20.1833875,21.8011882 18.7715031,21.8011882 L5.2284969,21.8011882 L5.06035624,21.7957697 C3.67032883,21.7059084 2.56973638,20.5095861 2.56973638,19.0470569 L2.56973638,10.2273587 L2.57600507,10.0381789 C2.63012926,9.22282649 3.03207443,8.47038558 3.67819781,7.99000711 L11.034559,2.52059336 Z M12.0713092,3.55793652 C11.9772762,3.53774358 11.8769764,3.55793433 11.7954857,3.6185066 L4.43911542,9.0879271 L4.32641124,9.18150853 C4.04059293,9.44596068 3.87451485,9.82573182 3.87451485,10.2273587 L3.87451485,19.0470569 L3.880713,19.1821318 C3.94632222,19.8933667 4.52470053,20.4496068 5.2284969,20.4496068 L11.2507497,20.4487759 L11.3507364,20.3451977 L11.3512202,14.4627186 L11.3582338,14.3683764 C11.4044406,14.0603828 11.6734228,13.8227675 12,13.8227675 C12.3345637,13.8227675 12.6123182,14.0734451 12.6454705,14.3976012 L12.6489183,14.4681588 L12.6487364,20.3451881 L12.7487231,20.4487759 L18.7714898,20.4496068 L18.9018895,20.4431864 C19.5885066,20.3752237 20.1254851,19.7760987 20.1254851,19.0470569 L20.1254851,10.2273587 L20.1177907,10.0779557 C20.0769951,9.68325297 19.8759128,9.32208831 19.5608746,9.08791971 L12.2045243,3.61851399 L12.1402672,3.58065321 Z" id="形状结合" stroke="#000" stroke-width="0.1"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.0 KiB |
@ -1,5 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="right-msg" :style="blackTitle ? 'color: #000' : 'color: #fff'">
|
<div class="right-msg" :style="blackTitle ? 'color: #000' : 'color: #fff'">
|
||||||
|
<div class="home-icon" v-if='blackTitle'>
|
||||||
|
<svg-icon icon-class="home" style="font-size: 24px; cursor: pointer;" @click="toHome"/>
|
||||||
|
</div>
|
||||||
<div class="time-msg">
|
<div class="time-msg">
|
||||||
<div class="line1">{{timeZone}} {{topTime}}</div>
|
<div class="line1">{{timeZone}} {{topTime}}</div>
|
||||||
<div class="line2">{{topDate}}</div>
|
<div class="line2">{{topDate}}</div>
|
||||||
@ -45,7 +48,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
this.getUserMsg()
|
this.getUserMsg()
|
||||||
this.getTime()
|
this.getTime()
|
||||||
},
|
},
|
||||||
@ -73,7 +76,10 @@ export default {
|
|||||||
this.$store.dispatch('LogOut').then(() => {
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
location.href = getPath('/');
|
location.href = getPath('/');
|
||||||
})
|
})
|
||||||
}).catch(() => {});
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
toHome() {
|
||||||
|
this.$router.push({ path: "/" })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,13 +89,16 @@ export default {
|
|||||||
float: right;
|
float: right;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
// color: #fff;
|
|
||||||
// padding-top: 15px;
|
|
||||||
// padding-right: 38px;
|
|
||||||
.time-msg {
|
.time-msg {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 30px;
|
margin-right: 30px;
|
||||||
}
|
}
|
||||||
|
.home-icon {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 30px;
|
||||||
|
vertical-align: top;
|
||||||
|
padding-top: 7px;
|
||||||
|
}
|
||||||
.base-msg {
|
.base-msg {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
.avatar {
|
.avatar {
|
||||||
|
@ -424,6 +424,7 @@ export default {
|
|||||||
// 表单参数
|
// 表单参数
|
||||||
form: {
|
form: {
|
||||||
id: null,
|
id: null,
|
||||||
|
files: []
|
||||||
},
|
},
|
||||||
showUploadComponents: false, // 是否显示上传组件
|
showUploadComponents: false, // 是否显示上传组件
|
||||||
};
|
};
|
||||||
@ -506,6 +507,7 @@ export default {
|
|||||||
spec: undefined,
|
spec: undefined,
|
||||||
description: undefined,
|
description: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
|
files: []
|
||||||
};
|
};
|
||||||
this.resetForm('form');
|
this.resetForm('form');
|
||||||
},
|
},
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="choicepart-container">
|
<div class="choicepart-container">
|
||||||
<navbar />
|
<navbar />
|
||||||
<div class="choicepart-wrapper">
|
<div class="choicepart-wrapper">
|
||||||
<div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1574px;height:538px;'">
|
<div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1574px;height:538px;'" v-show="showItem">
|
||||||
<div class="choicepart-line1">
|
<div class="choicepart-line1">
|
||||||
<div
|
<div
|
||||||
v-for="(item, index) in menuArr1"
|
v-for="(item, index) in menuArr1"
|
||||||
@ -37,7 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Navbar from './components/Navbar.vue'
|
import Navbar from './components/Navbar'
|
||||||
import { debounce } from '@/utils/debounce'
|
import { debounce } from '@/utils/debounce'
|
||||||
export default {
|
export default {
|
||||||
components: { Navbar },
|
components: { Navbar },
|
||||||
@ -154,6 +154,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
showItem: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// computed:{
|
// computed:{
|
||||||
@ -217,6 +218,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
resetSize() {
|
resetSize() {
|
||||||
|
let _this = this
|
||||||
|
_this.showItem = false
|
||||||
|
_this.loading = true
|
||||||
let choicepartBox = document.querySelector('#choicepartBox')
|
let choicepartBox = document.querySelector('#choicepartBox')
|
||||||
let rw = parseFloat(window.innerWidth)
|
let rw = parseFloat(window.innerWidth)
|
||||||
let rh = parseFloat(window.innerHeight)
|
let rh = parseFloat(window.innerHeight)
|
||||||
@ -224,8 +228,16 @@ export default {
|
|||||||
let bh = parseFloat(choicepartBox.style.height)
|
let bh = parseFloat(choicepartBox.style.height)
|
||||||
let wx = 0.82/(bw / rw)
|
let wx = 0.82/(bw / rw)
|
||||||
let hx = 0.56/(bh / rh)
|
let hx = 0.56/(bh / rh)
|
||||||
this.scale = wx > hx ? hx : wx
|
_this.scale = wx > hx ? hx : wx
|
||||||
|
setTimeout(_this.showItemFun, 700)
|
||||||
|
},
|
||||||
|
showItemFun() {
|
||||||
|
this.loading = false
|
||||||
|
this.showItem = true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.showItem = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -244,7 +256,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.choicepart-box {
|
.choicepart-box {
|
||||||
// border: 1px solid red;
|
// transition: all 0.3s linear;
|
||||||
.choicepart-line1 {
|
.choicepart-line1 {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 80px;
|
margin-bottom: 80px;
|
||||||
|
@ -127,18 +127,19 @@ export default {
|
|||||||
lineData[it.recordTime + '_area'] = it.area
|
lineData[it.recordTime + '_area'] = it.area
|
||||||
})
|
})
|
||||||
console.log('你好', this.monitorList)
|
console.log('你好', this.monitorList)
|
||||||
this.monitorList.forEach(m => {
|
if (this.monitorList.length > 0) {
|
||||||
console.log('455', m)
|
this.monitorList.forEach(m => {
|
||||||
if (m.lineName === lineData.proLineName) {
|
if (m.lineName === lineData.proLineName) {
|
||||||
m.data.forEach(bad => {
|
m.data.forEach(bad => {
|
||||||
// 转成时间戳
|
// 转成时间戳
|
||||||
// console.log('233', Date.parse(bad.dynamicName))
|
// console.log('233', Date.parse(bad.dynamicName))
|
||||||
const stamp = Date.parse(bad.dynamicName)
|
const stamp = Date.parse(bad.dynamicName)
|
||||||
lineData[stamp + '_bad'] = bad.dynamicValue
|
lineData[stamp + '_bad'] = bad.dynamicValue
|
||||||
lineData[stamp + '_percent'] = (lineData[stamp + '_bad'] / lineData[stamp + '_down'] * 100).toFixed(2) + '%'
|
lineData[stamp + '_percent'] = (lineData[stamp + '_bad'] / lineData[stamp + '_down'] * 100).toFixed(2) + '%'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
lineData['workOrderName'] = works.join(',')
|
lineData['workOrderName'] = works.join(',')
|
||||||
lineData['spec'] = specs.join(',')
|
lineData['spec'] = specs.join(',')
|
||||||
this.tableData.push(lineData)
|
this.tableData.push(lineData)
|
||||||
|
@ -22,7 +22,9 @@
|
|||||||
:line="item.lineName"
|
:line="item.lineName"
|
||||||
:desc="item.remark"
|
:desc="item.remark"
|
||||||
:isActive="item.enabled"
|
:isActive="item.enabled"
|
||||||
@edit="handleUpdate" />
|
@edit="handleUpdate"
|
||||||
|
@copy="handleCopy"
|
||||||
|
@delete="handleDelete" />
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<base-dialog
|
<base-dialog
|
||||||
@ -58,6 +60,12 @@ const ProcessItem = {
|
|||||||
handleEdit() {
|
handleEdit() {
|
||||||
this.$emit('edit', this.id);
|
this.$emit('edit', this.id);
|
||||||
},
|
},
|
||||||
|
handleCopy() {
|
||||||
|
this.$emit('copy', this.id);
|
||||||
|
},
|
||||||
|
handleDelete() {
|
||||||
|
this.$emit('delete', this.id);
|
||||||
|
},
|
||||||
handleViewDetail(e) {
|
handleViewDetail(e) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'ProcessFlowView',
|
name: 'ProcessFlowView',
|
||||||
@ -117,12 +125,18 @@ const ProcessItem = {
|
|||||||
<el-col
|
<el-col
|
||||||
span={8}
|
span={8}
|
||||||
style="text-align: center; border-right: 1px solid #0001">
|
style="text-align: center; border-right: 1px solid #0001">
|
||||||
<el-button type="text" style="color: #0007; line-height: 1.75">
|
<el-button
|
||||||
|
type="text"
|
||||||
|
style="color: #0007; line-height: 1.75"
|
||||||
|
onClick={this.handleCopy}>
|
||||||
复制
|
复制
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col span={8} style="text-align: center;">
|
<el-col span={8} style="text-align: center;">
|
||||||
<el-button type="text" style="color: #0007; line-height: 1.75">
|
<el-button
|
||||||
|
type="text"
|
||||||
|
style="color: #0007; line-height: 1.75"
|
||||||
|
onClick={this.handleDelete}>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -255,6 +269,43 @@ export default {
|
|||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '修改工艺';
|
this.title = '修改工艺';
|
||||||
},
|
},
|
||||||
|
async handleCopy(id) {
|
||||||
|
this.$confirm('确认拷贝操作?', '提示', {
|
||||||
|
confirmButtonText: '确 认',
|
||||||
|
cancelButtonText: '取 消',
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const { code } = await this.http(
|
||||||
|
'/extend/process-flow/copy',
|
||||||
|
'post',
|
||||||
|
{
|
||||||
|
id,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (code == 0) {
|
||||||
|
this.$modal.msgSuccess('复制成功');
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => console.info('操作取消'));
|
||||||
|
},
|
||||||
|
async handleDelete(id) {
|
||||||
|
this.$confirm('确认删除这个工艺吗?', '提示', {
|
||||||
|
confirmButtonText: '确 认',
|
||||||
|
cancelButtonText: '取 消',
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const { code } = await this.http(
|
||||||
|
'/extend/process-flow/delete?id=' + id,
|
||||||
|
'delete'
|
||||||
|
);
|
||||||
|
if (code == 0) {
|
||||||
|
this.$modal.msgSuccess('删除成功');
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => console.info('操作取消'));
|
||||||
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
|
@ -9,42 +9,68 @@
|
|||||||
<section class="process-bom">
|
<section class="process-bom">
|
||||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
||||||
|
|
||||||
<div class="btns" style="
|
<div
|
||||||
|
class="btns"
|
||||||
|
style="
|
||||||
text-align: right;
|
text-align: right;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 20px;
|
top: 20px;
|
||||||
right: 20px;
|
right: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
">
|
">
|
||||||
<el-button type="primary" plain :disabled="currentDet == null" class="btn-create" icon="el-icon-plus" @click="handleEqBtn">
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
:disabled="currentDet == null"
|
||||||
|
class="btn-create"
|
||||||
|
@click="handleAddEquipment"
|
||||||
|
icon="el-icon-plus">
|
||||||
分配设备
|
分配设备
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-input icon="el-icon-search" placeholder="搜索" v-model="searchText" style="margin-left: 20px">
|
<el-input
|
||||||
|
icon="el-icon-search"
|
||||||
|
placeholder="搜索"
|
||||||
|
v-model="searchText"
|
||||||
|
style="margin-left: 20px">
|
||||||
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="queryParams.pageNo"
|
||||||
|
:limit="queryParams.pageSize"
|
||||||
|
:table-data="list"
|
||||||
@emitFun="handleEmitFun">
|
@emitFun="handleEmitFun">
|
||||||
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" :method-list="tableBtn"
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
label="操作"
|
||||||
|
:width="120"
|
||||||
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleTableBtnClick" />
|
@clickBtn="handleTableBtnClick" />
|
||||||
</base-table>
|
</base-table>
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
<!-- 分页组件 -->
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList" />
|
@pagination="getList" />
|
||||||
|
|
||||||
<!-- 新增&编辑 -->
|
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="eqTitle"
|
dialogTitle="选择设备"
|
||||||
:dialogVisible="centervisible"
|
:dialogVisible="open"
|
||||||
@cancel="handleCancel"
|
@close="cancel"
|
||||||
@confirm="handleConfirm"
|
@cancel="cancel"
|
||||||
:before-close="handleCancel"
|
@confirm="submitForm">
|
||||||
width='70%'
|
<el-transfer v-model="choosedEquipments" :data="eqList">
|
||||||
>
|
<!-- <span slot-scope="{ option }">
|
||||||
123
|
{{ option.key }} - {{ option.label }}
|
||||||
|
</span> -->
|
||||||
|
</el-transfer>
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@ -56,20 +82,17 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
currentDet: {
|
currentDet: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
open: false,
|
||||||
|
eqList: [],
|
||||||
|
finalList: [],
|
||||||
|
choosedEquipments: [],
|
||||||
searchBarFormConfig: [{ label: '工序下设备' }],
|
searchBarFormConfig: [{ label: '工序下设备' }],
|
||||||
tableProps: [
|
tableProps: [
|
||||||
// {
|
|
||||||
// prop: 'createTime',
|
|
||||||
// label: '添加时间',
|
|
||||||
// fixed: true,
|
|
||||||
// width: 180,
|
|
||||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
// },
|
|
||||||
{ prop: 'equipmentId', label: '设备名称' },
|
{ prop: 'equipmentId', label: '设备名称' },
|
||||||
{ prop: 'materialName', label: '物料BOM' },
|
{ prop: 'materialName', label: '物料BOM' },
|
||||||
{ prop: 'valueName', label: '参数BOM' },
|
{ prop: 'valueName', label: '参数BOM' },
|
||||||
@ -81,10 +104,7 @@ export default {
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
searchText: '',
|
searchText: ''
|
||||||
eqTitle: '分配设备',
|
|
||||||
centervisible: false,
|
|
||||||
pageUrl: '/extend/process-flow-det-equipment/page'
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -97,12 +117,55 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
deep: true
|
deep: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleEmitFun() { },
|
renderFn(h, option) {
|
||||||
handleTableBtnClick() { },
|
console.log(option);
|
||||||
|
return <span>1</span>;
|
||||||
|
},
|
||||||
|
async getEqList() {
|
||||||
|
console.log('currentDet', this.currentDet);
|
||||||
|
const { sectionId } = this.currentDet;
|
||||||
|
const { code, data } = await this.http(
|
||||||
|
'base/core-equipment-bind-section/page',
|
||||||
|
'get',
|
||||||
|
{ workshopSectionId: sectionId, pageNo: 1, pageSize: 100 }
|
||||||
|
);
|
||||||
|
if (code == 0) {
|
||||||
|
console.log('workshopSectionId', data);
|
||||||
|
|
||||||
|
// 模拟数据
|
||||||
|
this.eqList = [
|
||||||
|
{ equipmentId: 1, equipmentName: '设备1' },
|
||||||
|
{ equipmentId: 2, equipmentName: '设备2' },
|
||||||
|
{ equipmentId: 3, equipmentName: '设备3' },
|
||||||
|
{ equipmentId: 4, equipmentName: '设备4' },
|
||||||
|
{ equipmentId: 5, equipmentName: '设备5' },
|
||||||
|
{ equipmentId: 6, equipmentName: '设备6' },
|
||||||
|
]; // ].map((item) => ({ label: item.equipmentName, key: item.equipmentId }));
|
||||||
|
|
||||||
|
// 获取参数bom和物料bom
|
||||||
|
// 需调用参数bom接口和 物料bom接口
|
||||||
|
this.finalList = this.eqList.map((item) => {
|
||||||
|
item.sub = [];
|
||||||
|
// key: equipmentId-参数bomId
|
||||||
|
item.sub.push({
|
||||||
|
key: item.equipmentId + '-' + '101',
|
||||||
|
label: '参数bom1',
|
||||||
|
});
|
||||||
|
item.sub.push({
|
||||||
|
key: item.equipmentId + '-' + '201',
|
||||||
|
label: '物料bom1',
|
||||||
|
});
|
||||||
|
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleEmitFun() {},
|
||||||
|
handleTableBtnClick() {},
|
||||||
put(payload) {
|
put(payload) {
|
||||||
return this.http(this.updateUrl, 'put', payload);
|
return this.http(this.updateUrl, 'put', payload);
|
||||||
},
|
},
|
||||||
@ -121,43 +184,34 @@ export default {
|
|||||||
method,
|
method,
|
||||||
params: method === 'get' ? payload : null,
|
params: method === 'get' ? payload : null,
|
||||||
data: method !== 'get' ? payload : null,
|
data: method !== 'get' ? payload : null,
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
submitForm() {},
|
||||||
async getList({ detId, detName, detDesc, flowId, sectionName } = {}) {
|
async getList({ detId, detName, detDesc, flowId, sectionName } = {}) {
|
||||||
const { code, data } = await this.recv({ pageNn: 1, pageSize: 100, flowDetId: detId });
|
console.log('get list', detId, detName, flowId);
|
||||||
|
const { data, code } = await this.http(
|
||||||
|
'/extend/process-flow-det-equipment/page',
|
||||||
|
'get',
|
||||||
|
{ flowDetId: detId, ...this.queryParams }
|
||||||
|
);
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
if (data) {
|
this.list = data.list;
|
||||||
this.list = data.list
|
this.total = data.total;
|
||||||
}
|
} else {
|
||||||
return { cells: [] };
|
this.list.splice(0);
|
||||||
|
this.total = 0;
|
||||||
}
|
}
|
||||||
return Promise.reject(this.infoUrl + ' 接口出错!');
|
|
||||||
},
|
},
|
||||||
|
async handleAddEquipment() {
|
||||||
// getList({ detId, detName, detDesc, flowId, sectionName } = {}) {
|
this.open = true;
|
||||||
// console.log('get list')
|
await this.getEqList();
|
||||||
|
},
|
||||||
// },
|
cancel() {
|
||||||
// getList() {
|
this.open = false;
|
||||||
// this.list = [
|
},
|
||||||
// { name: '1', code: 'bomg-1', remark: 'Tochter' },
|
|
||||||
// { name: '2', code: 'bomg-2', remark: 'Bruder' },
|
|
||||||
// { name: '3', code: 'bomg-3', remark: 'Kalt' },
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
clearList() {
|
clearList() {
|
||||||
this.list = [];
|
this.list = [];
|
||||||
},
|
},
|
||||||
handleEqBtn() {
|
|
||||||
this.centervisible = true
|
|
||||||
},
|
|
||||||
handleConfirm() {
|
|
||||||
this.centervisible = false
|
|
||||||
},
|
|
||||||
handleCancel() {
|
|
||||||
this.centervisible = false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -9,25 +9,57 @@
|
|||||||
<section class="process-graph">
|
<section class="process-graph">
|
||||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
||||||
|
|
||||||
<div class="btns" style="text-align: right; position: absolute; top: 20px; right: 20px">
|
<div
|
||||||
<el-button type="warning" @click="undo" plain v-if="allowUndo" :disabled="!allowUndo" icon="el-icon-back">
|
class="btns"
|
||||||
|
style="text-align: right; position: absolute; top: 20px; right: 20px">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
@click="undo"
|
||||||
|
plain
|
||||||
|
v-if="allowUndo"
|
||||||
|
:disabled="!allowUndo"
|
||||||
|
icon="el-icon-back">
|
||||||
撤销
|
撤销
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="warning" @click="redo" plain v-if="allowRedo" :disabled="!allowRedo">
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
@click="redo"
|
||||||
|
plain
|
||||||
|
v-if="allowRedo"
|
||||||
|
:disabled="!allowRedo">
|
||||||
下一步
|
下一步
|
||||||
<i class="el-icon-right el-icon--right"></i>
|
<i class="el-icon-right el-icon--right"></i>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button class="btn-refresh" @click="handleUpdateLayout" icon="el-icon-refresh">
|
<el-button
|
||||||
刷新布局</el-button>
|
class="btn-refresh"
|
||||||
<el-button type="primary" plain class="btn-create" icon="el-icon-plus" @click="handleAdd">
|
@click="handleUpdateLayout"
|
||||||
|
icon="el-icon-refresh">
|
||||||
|
刷新布局
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
class="btn-create"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="handleAdd">
|
||||||
新建工序
|
新建工序
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button class="btn-edit" :disabled="currentDet == null" @click="handleEdit">编辑</el-button>
|
<el-button
|
||||||
|
class="btn-edit"
|
||||||
|
:disabled="currentDet == null"
|
||||||
|
@click="handleEdit">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="process-graph__panel" ref="panel"></div>
|
<div class="process-graph__panel" ref="panel"></div>
|
||||||
|
|
||||||
<base-dialog :dialogTitle="title" :dialogVisible="open" width="35%" @close="cancel" @cancel="cancel"
|
<base-dialog
|
||||||
|
:dialogTitle="title"
|
||||||
|
:dialogVisible="open"
|
||||||
|
width="35%"
|
||||||
|
@close="cancel"
|
||||||
|
@cancel="cancel"
|
||||||
@confirm="submitForm">
|
@confirm="submitForm">
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
@ -36,11 +68,15 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Graph } from '@antv/x6';
|
import { Graph } from '@antv/x6';
|
||||||
import ProcessNode, { createProcessNode, CACHE_NAME, getSectionFrom } from './ProcessNode';
|
import ProcessNode, {
|
||||||
|
createProcessNode,
|
||||||
|
CACHE_NAME,
|
||||||
|
getSectionFrom,
|
||||||
|
} from './ProcessNode';
|
||||||
import DialogForm from '@/components/DialogForm';
|
import DialogForm from '@/components/DialogForm';
|
||||||
// import { IdToName } from '@/utils'
|
// import { IdToName } from '@/utils'
|
||||||
|
|
||||||
Graph.registerNode('process-node', ProcessNode,true);
|
Graph.registerNode('process-node', ProcessNode, true);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ProcessGraph',
|
name: 'ProcessGraph',
|
||||||
@ -79,7 +115,7 @@ export default {
|
|||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
},
|
},
|
||||||
cache: CACHE_NAME
|
cache: CACHE_NAME,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -99,42 +135,39 @@ export default {
|
|||||||
id: null,
|
id: null,
|
||||||
flowId: null,
|
flowId: null,
|
||||||
content: '',
|
content: '',
|
||||||
createTime: null
|
createTime: null,
|
||||||
},
|
},
|
||||||
currentDet: null,
|
currentDet: null,
|
||||||
currentNode: null
|
currentNode: null,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'form.sectionId': {
|
'form.sectionId': {
|
||||||
handler(id) {
|
handler(id) {},
|
||||||
},
|
|
||||||
immediate: false,
|
immediate: false,
|
||||||
},
|
},
|
||||||
currentDet: {
|
currentDet: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
this.$emit('det-selected', val)
|
this.$emit('det-selected', val);
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true
|
immediate: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
this.loadLayout().then(json => {
|
this.loadLayout().then((json) => {
|
||||||
this.initGraph(json)
|
this.initGraph(json);
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
deactivated() {
|
deactivated() {
|
||||||
this.graph.dispose();
|
this.graph.dispose();
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.resetLayout();
|
this.resetLayout();
|
||||||
this.graph = null;
|
this.graph = null;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
initGraph(json) {
|
initGraph(json) {
|
||||||
const graph = new Graph({
|
const graph = new Graph({
|
||||||
container: this.$refs.panel,
|
container: this.$refs.panel,
|
||||||
@ -144,7 +177,7 @@ export default {
|
|||||||
},
|
},
|
||||||
history: true,
|
history: true,
|
||||||
selecting: {
|
selecting: {
|
||||||
className: 'my-select'
|
className: 'my-select',
|
||||||
},
|
},
|
||||||
connecting: {
|
connecting: {
|
||||||
snap: true,
|
snap: true,
|
||||||
@ -155,24 +188,17 @@ export default {
|
|||||||
allowEdge: false,
|
allowEdge: false,
|
||||||
},
|
},
|
||||||
panning: true,
|
panning: true,
|
||||||
// scroller: {
|
|
||||||
// enabled: true,
|
|
||||||
// pannable: true,
|
|
||||||
// cursor: '',
|
|
||||||
// width: 800,
|
|
||||||
// height: 200
|
|
||||||
// },
|
|
||||||
mousewheel: {
|
mousewheel: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
modifiers: ['ctrl', 'meta']
|
modifiers: ['ctrl', 'meta'],
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
console.log(json)
|
|
||||||
graph.fromJSON(json)
|
graph.fromJSON(json);
|
||||||
this.graph = graph;
|
this.graph = graph;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.registerGraphEvents();
|
this.registerGraphEvents();
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
registerGraphEvents() {
|
registerGraphEvents() {
|
||||||
@ -182,31 +208,33 @@ export default {
|
|||||||
this.currentDet = null;
|
this.currentDet = null;
|
||||||
this.currentNode = null;
|
this.currentNode = null;
|
||||||
|
|
||||||
nodes.forEach(node => {
|
nodes.forEach((node) => {
|
||||||
node.attr('container/stroke', '#ccc');
|
node.attr('container/stroke', '#ccc');
|
||||||
});
|
});
|
||||||
edges.forEach(edge => {
|
edges.forEach((edge) => {
|
||||||
edge.attr('line/stroke', '#ccc')
|
edge.attr('line/stroke', '#ccc');
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
this.graph.on('node:click', ({ e, x, y, node, view }) => {
|
this.graph.on('node:click', ({ e, x, y, node, view }) => {
|
||||||
reset();
|
reset();
|
||||||
node.attr('container/stroke', '#0b58ff');
|
node.attr('container/stroke', '#0b58ff');
|
||||||
const { detId, detName, detDesc, processId, sectionId, sectionName } = node.attrs;
|
const { detId, detName, detDesc, processId, sectionId, sectionName } =
|
||||||
this.currentDet = {}
|
node.attrs;
|
||||||
this.$set(this.currentDet, 'detId', detId?.text)
|
console.log('node clicked!', node)
|
||||||
this.$set(this.currentDet, 'sectionId', sectionId?.text)
|
this.currentDet = {};
|
||||||
this.$set(this.currentDet, 'detName', detName?.text)
|
this.$set(this.currentDet, 'detId', detId?.text);
|
||||||
this.$set(this.currentDet, 'detDesc', detDesc?.text)
|
this.$set(this.currentDet, 'sectionId', sectionId?.text);
|
||||||
this.$set(this.currentDet, 'flowId', processId?.text)
|
this.$set(this.currentDet, 'detName', detName?.text);
|
||||||
this.$set(this.currentDet, 'sectionName', sectionName?.text)
|
this.$set(this.currentDet, 'detDesc', detDesc?.text);
|
||||||
this.currentNode = node
|
this.$set(this.currentDet, 'flowId', processId?.text);
|
||||||
|
this.$set(this.currentDet, 'sectionName', sectionName?.text);
|
||||||
|
this.currentNode = node;
|
||||||
});
|
});
|
||||||
this.graph.on('edge:click', ({ e, x, y, edge, view }) => {
|
this.graph.on('edge:click', ({ e, x, y, edge, view }) => {
|
||||||
// console.log('edge clicked!', edge)
|
// console.log('edge clicked!', edge)
|
||||||
reset();
|
reset();
|
||||||
edge.attr('line/stroke', '#0b58ff')
|
edge.attr('line/stroke', '#0b58ff');
|
||||||
});
|
});
|
||||||
this.graph.on('blank:click', ({ e, x, y }) => {
|
this.graph.on('blank:click', ({ e, x, y }) => {
|
||||||
reset();
|
reset();
|
||||||
@ -219,30 +247,30 @@ export default {
|
|||||||
y: 0,
|
y: 0,
|
||||||
offset: { x: 0, y: 0 },
|
offset: { x: 0, y: 0 },
|
||||||
onClick: ({ e, cell, view }) => {
|
onClick: ({ e, cell, view }) => {
|
||||||
this.$confirm(
|
this.$confirm('确定删除这个工序吗?', '提示', {
|
||||||
'确定删除这个工序吗?',
|
confirmButtonText: '确定',
|
||||||
'提示',
|
cancelButtonText: '取消',
|
||||||
{
|
type: 'warning',
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}
|
|
||||||
).then(async () => {
|
|
||||||
const id = node.attrs.detId.text;
|
|
||||||
const status = await this.handleDelete(id);
|
|
||||||
if (status) {
|
|
||||||
view.cell.remove();
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
return;
|
|
||||||
})
|
})
|
||||||
}
|
.then(async () => {
|
||||||
}
|
const id = node.attrs.detId.text;
|
||||||
})
|
const status = await this.handleDelete(id);
|
||||||
|
if (status) {
|
||||||
|
view.cell.remove();
|
||||||
|
// 更新布局,不然下次打开删除的节点还在
|
||||||
|
this.handleUpdateLayout();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
this.graph.on('node:mouseleave', ({ node }) => {
|
this.graph.on('node:mouseleave', ({ node }) => {
|
||||||
node.removeTools();
|
node.removeTools();
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
resetLayout() {
|
resetLayout() {
|
||||||
@ -250,13 +278,13 @@ export default {
|
|||||||
id: null,
|
id: null,
|
||||||
flowId: null,
|
flowId: null,
|
||||||
content: '',
|
content: '',
|
||||||
createTime: null
|
createTime: null,
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
async loadLayout() {
|
async loadLayout() {
|
||||||
const flowId = this.$route.params.id;
|
const flowId = this.$route.params.id;
|
||||||
if (!flowId) return { cells: [] }
|
if (!flowId) return { cells: [] };
|
||||||
const { code, data } = await this.info({ id: flowId });
|
const { code, data } = await this.info({ id: flowId });
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -269,9 +297,9 @@ export default {
|
|||||||
return Promise.reject(this.infoUrl + ' 接口出错!');
|
return Promise.reject(this.infoUrl + ' 接口出错!');
|
||||||
},
|
},
|
||||||
|
|
||||||
handleToJson() { },
|
handleToJson() {},
|
||||||
|
|
||||||
handleLoadJson() { },
|
handleLoadJson() {},
|
||||||
|
|
||||||
handleDumpJson() {
|
handleDumpJson() {
|
||||||
if (this.graph) {
|
if (this.graph) {
|
||||||
@ -282,17 +310,25 @@ export default {
|
|||||||
async handleUpdateLayout() {
|
async handleUpdateLayout() {
|
||||||
this.layout.content = JSON.stringify(this.graph.toJSON());
|
this.layout.content = JSON.stringify(this.graph.toJSON());
|
||||||
let code, data;
|
let code, data;
|
||||||
console.table([this.layout, this.$route.params.id])
|
console.table([this.layout, this.$route.params.id]);
|
||||||
// 手动刷新布局
|
// 手动刷新布局
|
||||||
if (this.layout.id) {
|
if (this.layout.id) {
|
||||||
({ code, data } = await this.http('/extend/process-flow-view/update', 'put', this.layout));
|
({ code, data } = await this.http(
|
||||||
|
'/extend/process-flow-view/update',
|
||||||
|
'put',
|
||||||
|
this.layout
|
||||||
|
));
|
||||||
} else {
|
} else {
|
||||||
this.layout.flowId = this.$route.params.id;
|
this.layout.flowId = this.$route.params.id;
|
||||||
({ code, data } = await this.http('/extend/process-flow-view/create', 'post', this.layout));
|
({ code, data } = await this.http(
|
||||||
|
'/extend/process-flow-view/create',
|
||||||
|
'post',
|
||||||
|
this.layout
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
this.$modal.msgSuccess('布局已刷新!')
|
this.$modal.msgSuccess('布局已刷新!');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -325,12 +361,11 @@ export default {
|
|||||||
this.title = '编辑工序';
|
this.title = '编辑工序';
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.open = true;
|
this.open = true;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async handleDelete(id) {
|
async handleDelete(id) {
|
||||||
const { code, data } = await this.delete({ id });
|
const { code, data } = await this.delete({ id });
|
||||||
debugger;
|
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
this.$modal.msgSuccess('成功删除一个工序!');
|
this.$modal.msgSuccess('成功删除一个工序!');
|
||||||
return true;
|
return true;
|
||||||
@ -349,17 +384,17 @@ export default {
|
|||||||
this.updateProcess()
|
this.updateProcess()
|
||||||
.then((form) => {
|
.then((form) => {
|
||||||
const { name, sectionId, remark } = form;
|
const { name, sectionId, remark } = form;
|
||||||
getSectionFrom(sectionId).then(sectionName => {
|
getSectionFrom(sectionId).then((sectionName) => {
|
||||||
// 修改当前node的信息
|
// 修改当前node的信息
|
||||||
this.currentNode.setAttrs({
|
this.currentNode.setAttrs({
|
||||||
detName: { text: name },
|
detName: { text: name },
|
||||||
sectionId: { text: sectionId },
|
sectionId: { text: sectionId },
|
||||||
sectionName: { text: sectionName },
|
sectionName: { text: sectionName },
|
||||||
detDesc: { text: remark }
|
detDesc: { text: remark },
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
})
|
})
|
||||||
.catch(err => { });
|
.catch((err) => {});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,19 +403,22 @@ export default {
|
|||||||
if (!id) return null;
|
if (!id) return null;
|
||||||
return createProcessNode({
|
return createProcessNode({
|
||||||
flowId: flowId,
|
flowId: flowId,
|
||||||
name, sectionId, remark,
|
name,
|
||||||
|
sectionId,
|
||||||
|
remark,
|
||||||
id,
|
id,
|
||||||
})
|
});
|
||||||
}).then(node => {
|
})
|
||||||
|
.then((node) => {
|
||||||
if (!node) {
|
if (!node) {
|
||||||
this.$modal.msgError('创建节点失败');
|
this.$modal.msgError('创建节点失败');
|
||||||
return;
|
return;
|
||||||
};
|
}
|
||||||
this.graph.addNode(node);
|
this.graph.addNode(node);
|
||||||
}).catch(err => {
|
})
|
||||||
|
.catch((err) => {
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -390,17 +428,16 @@ export default {
|
|||||||
this.$modal.msgError('工艺ID不能为空');
|
this.$modal.msgError('工艺ID不能为空');
|
||||||
return Promise.reject('工艺ID不能为空');
|
return Promise.reject('工艺ID不能为空');
|
||||||
}
|
}
|
||||||
return this.put({ flowId, ...this.form })
|
return this.put({ flowId, ...this.form }).then(({ code, data }) => {
|
||||||
.then(({ code, data }) => {
|
if (code == 0) {
|
||||||
if (code == 0) {
|
this.$modal.msgSuccess('修改成功');
|
||||||
this.$modal.msgSuccess('修改成功');
|
} else {
|
||||||
} else {
|
this.$modal.msgError('修改失败');
|
||||||
this.$modal.msgError('修改失败');
|
}
|
||||||
}
|
const formCopy = { ...this.form };
|
||||||
const formCopy = { ...this.form }
|
this.open = false;
|
||||||
this.open = false;
|
return formCopy;
|
||||||
return formCopy;
|
});
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
createProcess() {
|
createProcess() {
|
||||||
@ -410,22 +447,22 @@ export default {
|
|||||||
this.$modal.msgError('工艺ID不能为空');
|
this.$modal.msgError('工艺ID不能为空');
|
||||||
return Promise.reject('工艺ID不能为空');
|
return Promise.reject('工艺ID不能为空');
|
||||||
}
|
}
|
||||||
console.log('create process', this.form)
|
console.log('create process', this.form);
|
||||||
// 添加的提交
|
// 添加的提交
|
||||||
return this.post({ flowId, ...this.form }).then(
|
return this.post({ flowId, ...this.form })
|
||||||
({ code, data }) => {
|
.then(({ code, data }) => {
|
||||||
this.$modal.msgSuccess('新增成功');
|
this.$modal.msgSuccess('新增成功');
|
||||||
this.open = false;
|
this.open = false;
|
||||||
// this.getList();
|
// this.getList();
|
||||||
return {
|
return {
|
||||||
id: data, // 服务器返回的新建的工段id
|
id: data, // 服务器返回的新建的工段id
|
||||||
...this.form, // 保存一份 this.form 副本,当 open->false 时 this.form 里的信息就清空了
|
...this.form, // 保存一份 this.form 副本,当 open->false 时 this.form 里的信息就清空了
|
||||||
flowId
|
flowId,
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
).catch(err => {
|
.catch((err) => {
|
||||||
this.$modal.msgError(err)
|
this.$modal.msgError(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
put(payload) {
|
put(payload) {
|
||||||
@ -452,7 +489,7 @@ export default {
|
|||||||
method,
|
method,
|
||||||
params: method === 'get' ? payload : null,
|
params: method === 'get' ? payload : null,
|
||||||
data: method !== 'get' ? payload : null,
|
data: method !== 'get' ? payload : null,
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -114,7 +114,7 @@ export default {
|
|||||||
tableData: [],
|
tableData: [],
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi(`end-material:warehouse-realtime-location-his:query`)
|
this.$auth.hasPermi(`end-material:warehouse-location-his:query`)
|
||||||
? {
|
? {
|
||||||
type: 'info',
|
type: 'info',
|
||||||
btnName: '详情',
|
btnName: '详情',
|
||||||
|
@ -114,7 +114,7 @@ export default {
|
|||||||
tableData: [],
|
tableData: [],
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi(`out-material:warehouse-realtime-location-his:query`)
|
this.$auth.hasPermi(`out-material:warehouse-location-his:query`)
|
||||||
? {
|
? {
|
||||||
type: 'info',
|
type: 'info',
|
||||||
btnName: '详情',
|
btnName: '详情',
|
||||||
|
@ -114,7 +114,7 @@ export default {
|
|||||||
tableData: [],
|
tableData: [],
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi(`pack-material:warehouse-realtime-location-his:query`)
|
this.$auth.hasPermi(`pack-material:warehouse-location-his:query`)
|
||||||
? {
|
? {
|
||||||
type: 'info',
|
type: 'info',
|
||||||
btnName: '详情',
|
btnName: '详情',
|
||||||
|
@ -114,7 +114,7 @@ export default {
|
|||||||
tableData: [],
|
tableData: [],
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi(`part-material:warehouse-realtime-location-his:query`)
|
this.$auth.hasPermi(`part-material:warehouse-location-his:query`)
|
||||||
? {
|
? {
|
||||||
type: 'info',
|
type: 'info',
|
||||||
btnName: '详情',
|
btnName: '详情',
|
||||||
|
@ -114,7 +114,7 @@ export default {
|
|||||||
tableData: [],
|
tableData: [],
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi(`raw-material:warehouse-realtime-location-his:query`)
|
this.$auth.hasPermi(`raw-material:warehouse-location-his:query`)
|
||||||
? {
|
? {
|
||||||
type: 'info',
|
type: 'info',
|
||||||
btnName: '详情',
|
btnName: '详情',
|
||||||
|
Loading…
Reference in New Issue
Block a user