From f9576bd9e9c1212fa2b15592a299cfca1a2c1b78 Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期二, 17 三月 2026 17:55:30 +0800
Subject: [PATCH] 车间订单详情删除刷新工艺路线
---
src/views/plan/manufacturingorder/productorder-form.vue | 581 ++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 426 insertions(+), 155 deletions(-)
diff --git a/src/views/plan/manufacturingorder/productorder-form.vue b/src/views/plan/manufacturingorder/productorder-form.vue
index 039af71..544a9a2 100644
--- a/src/views/plan/manufacturingorder/productorder-form.vue
+++ b/src/views/plan/manufacturingorder/productorder-form.vue
@@ -7,7 +7,10 @@
<h2 v-if="!editable">鏌ョ湅-杞﹂棿璁㈠崟</h2>
</div>
<div class="btn-group header-right" v-if="editable">
- <el-button :disabled="isSubmit" v-thinclick="`dataFormSubmit`"
+ <el-button
+ :disabled="isSubmit"
+ v-thinclick="`dataFormSubmit`"
+ type="primary"
>淇濆瓨</el-button
>
</div>
@@ -65,19 +68,21 @@
</el-col>
<el-col :span="6">
<el-form-item label="闆朵欢" prop="partId">
- <el-input v-model="partStr" placeholder="" readonly>
- <el-button
- v-if="!this.dataForm.id"
- slot="append"
- icon="el-icon-search"
- @click="openRoutingDialog()"
- ></el-button>
- </el-input>
+ <el-tooltip class="item" effect="dark" :content="partStr">
+ <el-input v-model="partStr" placeholder="" readonly>
+ <el-button
+ v-if="!this.dataForm.id"
+ slot="append"
+ icon="el-icon-search"
+ @click="openRoutingDialog()"
+ ></el-button>
+ </el-input>
+ </el-tooltip>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
- <el-col :span="3">
+ <el-col :span="4">
<el-form-item label="闇�姹傛暟閲�" prop="qtyRequired">
<el-input
v-model="dataForm.qtyRequired"
@@ -86,9 +91,10 @@
></el-input>
</el-form-item>
</el-col>
- <el-col :span="3">
+ <el-col :span="4">
<el-form-item label="瀹屾垚鏁伴噺" prop="qtyFinished">
<el-input-number
+ style="width: 90%"
v-model="dataForm.qtyFinished"
placeholder=""
:controls="false"
@@ -107,7 +113,7 @@
</el-date-picker>
</el-form-item>
</el-col>
- <el-col :span="6">
+ <!-- <el-col :span="6">
<el-form-item label="澶栨姢棰滆壊" prop="outerColor">
<el-input
readonly
@@ -124,16 +130,20 @@
placeholder=""
></el-input>
</el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="10">
- <el-col :span="6">
+ </el-col> -->
+ <el-col :span="5">
<el-form-item label="澶囨敞" prop="remark">
- <el-input v-model="dataForm.remark" placeholder=""></el-input>
+ <el-tooltip
+ class="item"
+ effect="dark"
+ :content="dataForm.remark"
+ >
+ <el-input v-model="dataForm.remark" placeholder="">
+ </el-input>
+ </el-tooltip>
</el-form-item>
</el-col>
- <el-col :span="6">
+ <el-col :span="5">
<el-form-item label="鍒堕�犲睘鎬�" prop="manufactureAttr">
<el-select
v-model="dataForm.manufactureAttr"
@@ -151,45 +161,59 @@
</el-select>
</el-form-item>
</el-col>
- <el-col :span="8">
- <el-col
- :span="8"
- v-if="permissions.plan_manufacturingorder_bom_sure"
- >
- <el-form-item label="BOM纭">
- <el-switch v-model="dataForm.bomConfirmStatus"> </el-switch>
- </el-form-item>
- </el-col>
- <el-col
- :span="8"
- v-if="permissions.plan_manufacturingorder_process_sure"
- >
- <el-form-item label="宸ヨ壓纭">
- <el-switch v-model="dataForm.processConfirmStatus">
- </el-switch>
- </el-form-item>
- </el-col>
- <el-col
- :span="8"
- v-if="permissions.plan_manufacturingorder_test_sure"
- >
- <el-form-item label="妫�娴嬫爣鍑嗙‘璁�">
- <el-switch v-model="dataForm.standardConfirmStatus">
- </el-switch>
- </el-form-item>
- </el-col>
+ <el-col :span="10">
+ <el-form-item label="宸ヨ壓鏂囦欢" prop="technologyDocumentName">
+ <el-tooltip
+ class="item"
+ effect="dark"
+ :content="dataForm.technologyDocumentName"
+ >
+ <el-input
+ v-model="dataForm.technologyDocumentName"
+ placeholder=""
+ >
+ </el-input>
+ </el-tooltip>
+ </el-form-item>
</el-col>
- <el-col :span="4">
+ </el-row>
+ <!-- <el-col
+ :span="2"
+ v-if="permissions.plan_manufacturingorder_bom_sure"
+ >
+ <el-form-item label="BOM纭" label-width="110px">
+ <el-switch v-model="dataForm.bomConfirmStatus"> </el-switch>
+ </el-form-item>
+ </el-col>
+ <el-col
+ :span="2"
+ v-if="permissions.plan_manufacturingorder_process_sure"
+ >
+ <el-form-item label="宸ヨ壓纭" label-width="110px">
+ <el-switch v-model="dataForm.processConfirmStatus">
+ </el-switch>
+ </el-form-item>
+ </el-col>
+ <el-col
+ :span="2"
+ v-if="permissions.plan_manufacturingorder_test_sure"
+ >
+ <el-form-item label="妫�娴嬫爣鍑嗙‘璁�" label-width="140px">
+ <el-switch v-model="dataForm.standardConfirmStatus">
+ </el-switch>
+ </el-form-item>
+ </el-col> -->
+ <!-- <el-col :span="2">
<el-form-item
label="IFS杞﹂棿璁㈠崟鎺ユ敹鏃舵姤鍛婂伐搴�"
prop="isReportOperation"
- label-width="200px"
+ label-width="250px"
>
<el-switch v-model="dataForm.isReportOperation" disabled>
</el-switch>
</el-form-item>
- </el-col>
- <!-- <el-col :span="2">
+ </el-col> -->
+ <!-- <el-col :span="2">
<el-form-item label="BOM纭">
<el-switch >
</el-switch>
@@ -207,7 +231,6 @@
</el-switch>
</el-form-item>
</el-col> -->
- </el-row>
</div>
<div class="productorder-detail">
<el-card class="productorder-list">
@@ -229,15 +252,7 @@
<el-option
v-for="item in dataForm.routingList"
:key="item.id"
- :label="
- item.routingNo +
- '-' +
- item.bomTypeDb +
- '-' +
- item.alternativeNo +
- '-' +
- item.alternativeDesc
- "
+ :label="item.routingNo"
:value="item.id"
>
</el-option>
@@ -263,47 +278,83 @@
</el-form-item>
</el-col>
</el-row>
-
<el-row>
<el-col :span="24" class="productorder-operates-col">
<el-card class="productorder-operates">
+ <div style="display:flex;justify-content:flex-end;">
+ <el-button
+ style="padding: 3px 0;margin-right:10px;"
+ type="text"
+ size="medium"
+ @click="addOrderOperation"
+ >娣诲姞
+ </el-button>
+ </div>
+ <!-- <el-row>
+ <el-col :span="2" class="frame1">搴忓彿
+ </el-col>
+ <el-col :span="4" class="frame1">宸ュ簭鍙�
+ </el-col>
+ <el-col :span="5" class="frame1">宸ュ簭鎻忚堪
+ </el-col>
+ <el-col :span="9" class="frame1">闆朵欢
+ </el-col>
+ <el-col :span="3" class="frame1">鎿嶄綔
+ </el-col>
+ </el-row> -->
<el-table
+ v-if="operationIndex"
+ id="operationTable"
ref="operationTable"
+ class="basic-template-table"
:data="operations"
- style="width: 100%;"
height="593px"
+ border
highlight-current-row
:default-sort="{ prop: 'operationOrder' }"
@row-click="operationRowClick"
>
<el-table-column
prop="operationOrder"
+ min-width="50"
label="搴忓彿"
- ></el-table-column>
+ >
+ <template slot-scope="scope">
+ <div style="display:flex">
+ <span style="width:20px;">
+ <i
+ class="icon aufontAll h-icon-all-drag"
+ ></i
+ ></span>
+ <span>{{ scope.row.operationOrder }}</span>
+ </div>
+ </template>
+ </el-table-column>
<el-table-column
prop="operationNo"
header-align="center"
align="center"
+ min-width="100"
label="宸ュ簭鍙�"
></el-table-column>
<el-table-column
prop="operationName"
header-align="center"
align="center"
+ min-width="100"
label="宸ュ簭鎻忚堪"
></el-table-column>
-
<el-table-column
prop="partName"
header-align="center"
- align="center"
+ min-width="100px"
label="闆朵欢"
></el-table-column>
-
<el-table-column
prop="remark"
header-align="center"
align="center"
+ min-width="50"
label="鎿嶄綔"
>
<template slot-scope="scope">
@@ -313,9 +364,51 @@
@click.stop="openOrderOperation(scope.row)"
>缂栬緫
</el-button>
+ <el-button
+ style="color:#f56c6c;"
+ type="text"
+ size="mini"
+ @click.stop="deleteOrderOperation(scope.row)"
+ >鍒犻櫎
+ </el-button>
</template>
</el-table-column>
</el-table>
+ <!-- <zttdraggable
+ :forceFallback="true"
+ :list="operations"
+ :animation="200"
+ fallbackClass="fallbackStyle"
+ ghostClass="item_ghost"
+ @end="dragEnd"
+ :default-sort="{ prop: 'operationOrder' }"
+ @choose="operationRowClick"
+ >
+ <div
+ :class="{ dragItem: true, active: x.active }"
+ v-for="(x, i) in operations"
+ :key="i"
+ >
+ <el-row>
+ <el-col :span="2" class="frame">{{ i+1 }}
+ </el-col>
+ <el-col :span="4" class="frame">{{ x.operationNo }}
+ </el-col>
+ <el-col :span="5" class="frame">{{ x.operationName }}
+ </el-col>
+ <el-col :span="9" class="frame">{{ x.partName }}
+ </el-col>
+ <el-col :span="3" class="frame">
+ <el-button
+ type="text"
+ size="mini"
+ @click="openOrderOperation(x)"
+ >缂栬緫
+ </el-button>
+ </el-col>
+ </el-row>
+ </div>
+ </zttdraggable> -->
</el-card>
</el-col>
</el-row>
@@ -487,7 +580,7 @@
</el-table>
</el-card>
</el-tab-pane>
- <el-tab-pane
+ <!-- <el-tab-pane
label="妫�娴嬫爣鍑�"
key="tb1"
id="tb1"
@@ -500,7 +593,7 @@
:moRoutingOperationId="moRoutingOperationId"
@refreshTestStandardInfo="refreshTestStandardInfo"
></testStandardTable>
- </el-tab-pane>
+ </el-tab-pane> -->
<!-- <el-tab-pane
label="鎶芥瑙勫垯"
key="tb2"
@@ -595,8 +688,19 @@
<el-tab-pane label="浜у搧缁撴瀯" id="ta1" key="ta1" name="ta1">
<el-row>
- <el-col :span="11">
- <el-form-item label="瀹屾暣BOM">
+ <el-col :span="2" style="text-align: center">
+ <el-button
+ type="text"
+ size="small"
+ icon="el-icon-circle-plus-outline"
+ style="color:#f56c6c;"
+ :disabled="!dataForm.id"
+ @click="addStruct()"
+ >娣诲姞鍏冪礌
+ </el-button>
+ </el-col>
+ <el-col :offset="11" :span="11">
+ <!-- <el-form-item label="瀹屾暣BOM">
<el-select
@change="bomSelectChanged"
disabled
@@ -622,35 +726,18 @@
>
</el-option>
</el-select>
- </el-form-item>
- </el-col>
- <el-col :offset="11" :span="2" style="text-align: center">
- <el-button
- type="text"
- size="small"
- icon="el-icon-circle-plus-outline"
- style="color:#f56c6c;"
- :disabled="!dataForm.id"
- @click="addStruct()"
- >娣诲姞鍏冪礌
- </el-button>
+ </el-form-item> -->
</el-col>
</el-row>
<el-row>
<el-table
- default-expand-all
- :data="components"
+ :data="components[0]"
@selection-change="structSelectionChange"
- row-key="id"
border
- :tree-props="{
- children: 'children'
- }"
style="width: 100%"
height="400px"
- :default-sort="{ prop: 'index' }"
>
- <el-table-column type="selection" width="40" fixed="left" />
+ <!-- <el-table-column type="selection" width="40" fixed="left" /> -->
<el-table-column
type="index"
width="50"
@@ -668,7 +755,7 @@
/>
<el-table-column
prop="partName"
- width=""
+ width="200"
header-align="center"
align="left"
label="闆朵欢"
@@ -707,13 +794,13 @@
label="鍗曚綅"
/>
- <el-table-column
+ <!-- <el-table-column
prop="discNum"
width="150"
header-align="center"
align="center"
label="鐩樻暟(鐩�)"
- />
+ /> -->
<!-- <el-table-column
prop="version"
@@ -930,7 +1017,27 @@
/>
</div>
</template>
-<style>
+<style lang="scss">
+.frame {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100px;
+ // border-width: 1px;
+ // border-color: rgb(129, 129, 129);
+ // border-style: solid;
+ font-size: 15px;
+}
+.frame1 {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 50px;
+ // border-width: 1px;
+ // border-color: rgb(129, 129, 129);
+ // border-style: solid;
+ font-size: 15px;
+}
.productorder-basic {
background-color: #fff;
height: 150px;
@@ -969,6 +1076,7 @@
.productorder-operates {
height: 605px;
border: 1px solid #ddd;
+ overflow: auto;
}
.productorder-params-template {
@@ -997,6 +1105,33 @@
.productorder-operates-col {
margin-bottom: 0px;
}
+.basic-template-table .el-table__body .el-table__row td:first-child .cell {
+ padding-left: 0px;
+ padding-right: 0px;
+}
+
+.basic-template-table .el-table__body .el-table__row:hover {
+ cursor: move;
+}
+
+.basic-template-table .el-table__body .el-table__row:hover .icon {
+ display: inline-block;
+}
+
+.basic-template-table .el-table__body .el-table__row .icon {
+ color: rgba(0, 0, 0, 0.45);
+ font-size: 12px;
+ line-height: 18px;
+ display: none;
+}
+
+.aufontAll {
+ font-family: aufontAll !important;
+ font-size: 14px;
+ font-style: normal;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
</style>
<style scoped>
@@ -1020,7 +1155,9 @@
addRoutingTemplateParamLedForOrder,
updateMoBom,
delMoBom,
- bomSelectChange
+ bomSelectChange,
+ changeOrder,
+ addMoRoutingOperation
} from '@/api/plan/manufacturingorder'
import { qryMoSamplingRule, delMoSamplingRule } from '@/api/plan/mosamplingrule'
import {
@@ -1050,7 +1187,7 @@
import spotCheckRule from './orderSpotCheckRule'
import spotCheckRuleEdit from './orderSpotCheckRuleEdit'
import { mapGetters } from 'vuex'
-
+import zttdraggable from 'vuedraggable'
export default {
components: {
CustomerOrder,
@@ -1066,11 +1203,13 @@
operationDialog,
insertOperationDialog,
spotCheckRule,
- spotCheckRuleEdit
+ spotCheckRuleEdit,
+ zttdraggable
},
data() {
return {
+ componentsTable: [],
typeOptions: [],
paramTemplateSelArr: [],
paramTemplateSelCol: 'operationTemplateNo',
@@ -1124,17 +1263,23 @@
endDate: null,
manufactureAttr: 'N',
isReportOperation: false,
- outPutBatchList: []
+ outPutBatchList: [],
+ technologyDocumentId: null,
+ technologyDocumentName: null
},
currentRow: [],
currentRouting: {}, // 褰撳墠閫夋嫨鐨勫伐鑹�
operations: [], // 褰撳墠閫夋嫨宸ヨ壓瀵瑰簲鐨勫伐搴�
+ operationIndex: 10,
currentBom: {}, // 褰撳墠閫夋嫨鐨勪骇鍝佺粨鏋�
components: [], // 褰撳墠閫夋嫨浜у搧缁撴瀯瀵瑰簲鐨勭粨鏋勭粍浠�
factoryOptions: [],
operationTemplateList: [], // 鍙傛暟闆�
templateParamList: [], // 鍙傛暟
dataRule: {
+ technologyDocumentName: [
+ { required: true, message: '宸ヨ壓鏂囦欢涓嶈兘涓虹┖', trigger: 'blur' }
+ ],
workshopTypeCode: [
{ required: true, message: '杞﹂棿璁㈠崟绫诲瀷涓嶈兘涓虹┖', trigger: 'blur' }
],
@@ -1171,6 +1316,7 @@
}
},
mounted() {
+ this.rowDrop()
window.addEventListener(
'hashchange',
() => {
@@ -1245,7 +1391,7 @@
}
}
},
-
+ components(newVal, oldVal) {},
currentRouting(newValue, oldValue) {
if (newValue && newValue.id) {
if (this.dataForm.id != null && this.dataForm.id !== 0) {
@@ -1295,7 +1441,7 @@
if (newValue && newValue.id) {
// 鏌ヨ浜у搧缁撴瀯瀵瑰簲鐨勭粍浠�
getBom(newValue.id).then((response) => {
- this.components = [response.data.data.tree]
+ // this.components = [response.data.data.tree]
})
}
},
@@ -1329,6 +1475,81 @@
}
},
methods: {
+ rowDrop() {
+ const that = this
+ const tbody = document.querySelector(
+ '#operationTable .el-table__body-wrapper tbody'
+ )
+ Sortable.create(tbody, {
+ // 缁撴潫鎷栨嫿
+ onEnd({ newIndex, oldIndex }) {
+ if (newIndex > oldIndex) {
+ // 涓嬬Щ
+ that.operations
+ .filter((e) => e.operationOrder == oldIndex + 1)
+ .forEach((e) => (e.operationOrder = 'x'))
+ that.operations
+ .filter(
+ (e) =>
+ e.operationOrder > oldIndex + 1 &&
+ e.operationOrder <= newIndex + 1
+ )
+ .forEach((e) => (e.operationOrder = e.operationOrder - 1))
+ that.operations
+ .filter((e) => e.operationOrder == 'x')
+ .forEach((e) => (e.operationOrder = newIndex + 1))
+ } else if (oldIndex > newIndex) {
+ // 涓婄Щ
+ that.operations
+ .filter((e) => e.operationOrder == oldIndex + 1)
+ .forEach((e) => (e.operationOrder = 'x'))
+ that.operations
+ .filter(
+ (e) =>
+ e.operationOrder < oldIndex + 1 &&
+ e.operationOrder >= newIndex + 1
+ )
+ .forEach((e) => (e.operationOrder = e.operationOrder + 1))
+ that.operations
+ .filter((e) => e.operationOrder == 'x')
+ .forEach((e) => (e.operationOrder = newIndex + 1))
+ }
+ // 鎷栨嫿缁撴潫鍚庯紝淇濆瓨鏂扮殑鎺掑簭
+ const data = that.operations.map((el) => {
+ return {
+ id: el.id,
+ operationOrder: el.operationOrder
+ }
+ })
+ changeOrder(data)
+ .then()
+ .catch((error) => {
+ console.error(error)
+ })
+ }
+ })
+ },
+ dragEnd(e) {
+ this.operations.forEach((e, i) => {
+ e.index = i + 1
+ e.operationOrder = i + 1
+ })
+ console.log(this.operations, '鎷栨嫿缁撴潫kk')
+ this.dragEndstart()
+ },
+ dragEndstart() {
+ const data = this.operations.map((el) => {
+ return {
+ id: el.id,
+ operationOrder: el.operationOrder
+ }
+ })
+ changeOrder(data)
+ .then((res) => {})
+ .catch((error) => {
+ console.error(error)
+ })
+ },
getSysParam(paramKey) {
getSysParam(paramKey).then((response) => {
var paramVal = response.data.data
@@ -1397,6 +1618,7 @@
},
// 鏌ヨ褰撳墠杞﹂棿璁㈠崟淇℃伅
getOrderInfo() {
+ const that = this
getManufacturingOrder(this.dataForm.id).then((response) => {
this.dataForm = response.data.data
// 鎶婂伐鑹烘寕涓婂幓
@@ -1416,7 +1638,7 @@
}
// 鎶婁骇鍝佺粨鏋勭粍浠舵寕涓婂幓
if (this.dataForm.bomRoot) {
- this.components = [this.dataForm.bomRoot]
+ that.components = [this.dataForm.bomRoot]
}
})
},
@@ -1429,13 +1651,7 @@
checkPart(value, this.dataForm.workshopTypeCode)
.then((response) => {
const manufacturingOrderDTO = response.data.data
- /* this.dataForm.routingList = manufacturingOrderDTO.routingList.filter(
- (e) => e.bomTypeDb === this.dataForm.workshopTypeCode
- ) */
this.dataForm.routingList = manufacturingOrderDTO.routingList
- /* this.dataForm.bomList = manufacturingOrderDTO.bomList.filter(
- (e) => e.bomTypeDb === this.dataForm.workshopTypeCode
- ) */
this.dataForm.bomList = manufacturingOrderDTO.bomList
this.dataForm.technologyRoutingId =
manufacturingOrderDTO.technologyRoutingId
@@ -1497,6 +1713,7 @@
} else {
this.dataForm.bomRoot = null
}
+
if (this.dataForm.id) {
putManufacturingOrder(this.dataForm)
.then((response) => {
@@ -1571,10 +1788,13 @@
this.showRouting = true
},
selectRouting(param) {
+ console.log(param)
if (param) {
this.dataForm.partNo = param.partNo
this.dataForm.partName = param.partName
this.dataForm.partId = param.partId
+ this.dataForm.technologyDocumentId = param.id
+ this.dataForm.technologyDocumentName = param.name
this.$refs.dataForm.validateField('partId', (valid) => {})
}
},
@@ -1594,6 +1814,8 @@
})
},
// 2.tabs-宸ヨ壓璺嚎
+ // 宸ヨ壓鏂囦欢閫夋嫨
+
// 宸ヨ壓璺嚎閫夋嫨
routingSelectChanged(routingId) {
this.currentRouting = this.dataForm.routingList.find(
@@ -1667,6 +1889,8 @@
},
// 鐐瑰嚮宸ヨ壓宸ュ簭琛岃Е鍙戞牎楠屽伐鑹烘槸鍚︿慨鏀癸紝鑻ヤ慨鏀瑰垯涓嶅彲鎿嶄綔锛岄渶鍏堜繚瀛橈紝鑻ユ湭淇敼锛屽垯鍙煡璇㈠嚭瀵瑰簲鐨勫弬鏁伴泦
operationRowClick(row) {
+ // const row = this.operations[event.oldIndex]
+ console.log(row)
if (this.dataForm.id != null && this.dataForm.id !== 0) {
this.routingOperationId = row.technologyRoutingOperationId
this.moRoutingOperationId = row.id
@@ -1920,6 +2144,17 @@
},
// 淇濆瓨鎵�鏈夊弬鏁扮殑淇敼
saveAllParamChange() {
+ this.templateParamList.forEach((e) => {
+ if (e.paramValue != null) {
+ e.paramValue = e.paramValue
+ .replace(',', '锛�')
+ .replace('(', '锛�')
+ .replace(')', '锛�')
+ if (!isNaN(e.paramValue)) {
+ e.paramValue = '=' + e.paramValue
+ }
+ }
+ })
const paramJson = { routingOperationParam: this.templateParamList }
putRoutingTemplateParamForOrder(paramJson).then((response) => {
const data = response.data
@@ -2028,43 +2263,58 @@
},
// 鍒犻櫎褰撳墠宸ュ簭
deleteOrderOperation(row) {
- deleteMoRoutingOperation(row.id).then((response) => {
- const resData = response.data
- if (resData.code === 0) {
- const delOperation = this.operations.find((item) => {
- return item.id === row.id
- })
- const delIndex = this.operations.indexOf(delOperation)
- this.operations.splice(delIndex, 1)
-
- // 鏌ユ壘褰撳墠鐨勯�変腑鐨勫伐搴廼d
- const selectedOperation = this.operations.find((item) => {
- return item.id === this.moRoutingOperationId
- })
- // 瀛樺湪閫変腑鐨勫伐搴�
- if (selectedOperation) {
- this.operationRowClick(selectedOperation)
- } else {
- // 涓嶅瓨鍦ㄩ�変腑鐨勫伐搴忥紝鑻his.operations涓嶄负绌猴紝鍒欏彇绗竴鏉″伐搴忥紝鑻ヤ负绌猴紝鍒欐竻绌虹浉鍏冲伐搴�
- if (this.operations.length > 0) {
- this.operationRowClick(this.operations[0])
- } else {
- // 鍙栨秷閫変腑楂樹寒
- this.$refs.operationTable.setCurrentRow()
- // 娓呯┖褰撳墠宸ヨ壓宸ュ簭id銆佹竻绌簉outingTemplateId銆佹竻绌哄弬鏁伴泦operationTemplateList銆佹竻绌哄弬鏁皌emplateParamList
- this.routingOperationId = null
- this.moRoutingOperationId = null
- this.moRoutingOperationName = null
- this.routingTemplateId = null
- this.operationTemplateList = []
- this.templateParamList = []
- }
- }
- this.$message.success('璁㈠崟宸ュ簭鍒犻櫎鎴愬姛')
- } else {
- this.$message.error('璁㈠崟宸ュ簭鍒犻櫎澶辫触')
- }
+ this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
})
+ .then(() => {
+ deleteMoRoutingOperation(row.id).then((response) => {
+ const resData = response.data
+ if (resData.code === 0) {
+ const delOperation = this.operations.find((item) => {
+ return item.id === row.id
+ })
+ const delIndex = this.operations.indexOf(delOperation)
+ this.operations.splice(delIndex, 1)
+
+ // 鏌ユ壘褰撳墠鐨勯�変腑鐨勫伐搴廼d
+ const selectedOperation = this.operations.find((item) => {
+ return item.id === this.moRoutingOperationId
+ })
+ // 瀛樺湪閫変腑鐨勫伐搴�
+ if (selectedOperation) {
+ this.operationRowClick(selectedOperation)
+ } else {
+ // 涓嶅瓨鍦ㄩ�変腑鐨勫伐搴忥紝鑻his.operations涓嶄负绌猴紝鍒欏彇绗竴鏉″伐搴忥紝鑻ヤ负绌猴紝鍒欐竻绌虹浉鍏冲伐搴�
+ if (this.operations.length > 0) {
+ this.operationRowClick(this.operations[0])
+ } else {
+ // 鍙栨秷閫変腑楂樹寒
+ this.$refs.operationTable.setCurrentRow()
+ // 娓呯┖褰撳墠宸ヨ壓宸ュ簭id銆佹竻绌簉outingTemplateId銆佹竻绌哄弬鏁伴泦operationTemplateList銆佹竻绌哄弬鏁皌emplateParamList
+ this.routingOperationId = null
+ this.moRoutingOperationId = null
+ this.routingTemplateId = null
+ this.operationTemplateList = []
+ this.templateParamList = []
+ }
+ }
+ this.$message.success('璁㈠崟宸ュ簭鍒犻櫎鎴愬姛')
+ getMoRoutingOption(this.dataForm.id).then((response) => {
+ if (response.data.code === 0) {
+ this.operations = response.data.data
+ this.operationIndex += 1
+ } else {
+ this.operations = []
+ }
+ })
+ } else {
+ this.$message.error('璁㈠崟宸ュ簭鍒犻櫎澶辫触')
+ }
+ })
+ })
+ .catch(() => {})
},
// 寮瑰嚭鍩虹宸ュ簭鍒楄〃
addOrderOperation() {
@@ -2097,7 +2347,28 @@
},
// 鏂板宸ュ簭
addOperation(operation) {
- console.log('operation', operation)
+ operation.moId = this.dataForm.id
+ operation.moRoutingId = this.dataForm.technologyRoutingId
+ operation.operationId = operation.id
+ operation.partId = this.dataForm.partId
+ operation.loc = null
+ operation.operationOrder = this.operations.length + 1
+ operation.id = null
+ addMoRoutingOperation(operation).then((response) => {
+ const data = response.data
+ if (data.code === 0) {
+ getMoRoutingOption(this.dataForm.id).then((response) => {
+ if (response.data.code === 0) {
+ this.operations = response.data.data
+ this.operationIndex += 1
+ } else {
+ this.operations = []
+ }
+ })
+ } else {
+ this.$message.error('娣诲姞澶辫触')
+ }
+ })
},
insertOperation(operation) {},
structSelectionChange(val) {
@@ -2105,17 +2376,17 @@
},
// 鎵撳紑bom鑺傜偣
addStruct() {
- if (this.structSelection.length <= 0) {
- this.$message.error('璇烽�夋嫨闇�瑕佹坊鍔犲厓绱犵殑鑺傜偣')
- } else {
- if (this.structSelection.length === 1) {
- this.selectedStruct = this.structSelection[0]
- this.moId = this.dataForm.id
- this.showStructForm = true
- } else {
- this.$message.error('鍙兘涓哄崟涓妭鐐规坊鍔犲厓绱�')
- }
- }
+ this.selectedStruct = this.structSelection[0]
+ this.moId = this.dataForm.id
+ this.showStructForm = true
+ // if (this.structSelection.length <= 0) {
+ // this.$message.error('璇烽�夋嫨闇�瑕佹坊鍔犲厓绱犵殑鑺傜偣')
+ // } else {
+ // if (this.structSelection.length === 1) {
+ // } else {
+ // this.$message.error('鍙兘涓哄崟涓妭鐐规坊鍔犲厓绱�')
+ // }
+ // }
},
refreshBom(node) {
if (this.selectedStruct.children != null) {
--
Gitblit v1.9.3