| | |
| | | <el-row> |
| | | <el-col :span="24" class="productorder-operates-col"> |
| | | <el-card class="productorder-operates" > |
| | | <el-row> |
| | | <!-- <el-row> |
| | | <el-col :span="2" class="frame1">序号 |
| | | </el-col> |
| | | <el-col :span="4" class="frame1">工序号 |
| | |
| | | </el-col> |
| | | <el-col :span="3" class="frame1">操作 |
| | | </el-col> |
| | | </el-row> |
| | | <!-- <el-table |
| | | </el-row> --> |
| | | <el-table |
| | | 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"> |
| | |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> --> |
| | | <zttdraggable |
| | | </el-table> |
| | | <!-- <zttdraggable |
| | | :forceFallback="true" |
| | | :list="operations" |
| | | :animation="200" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </zttdraggable> |
| | | </zttdraggable> --> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | |
| | | |
| | | </el-col> |
| | | <el-col :span="16"> |
| | | <el-tabs type="card" ref="paramTabs"> |
| | |
| | | .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> |
| | | /deep/ .el-input-number.is-without-controls .el-input__inner { |
| | | text-align: start; |
| | | } |
| | | |
| | | </style> |
| | | <script> |
| | | import { |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.rowDrop() |
| | | window.addEventListener( |
| | | 'hashchange', |
| | | () => { |
| | |
| | | } |
| | | }, |
| | | 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)) |
| | | } |
| | | // 拖拽结束后,保存新的排序 |
| | | let 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 |
| | |
| | | }) |
| | | changeOrder(data).then((res) =>{ |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }); |
| | | console.error(error) |
| | | }); |
| | | }, |
| | | getSysParam(paramKey) { |
| | | getSysParam(paramKey).then((response) => { |
| | |
| | | }, |
| | | // 2.tabs-工艺路线 |
| | | //工艺文件选择 |
| | | |
| | | |
| | | // 工艺路线选择 |
| | | routingSelectChanged(routingId) { |
| | | this.currentRouting = this.dataForm.routingList.find( |
| | |
| | | this.dataForm.bomId = null |
| | | }, |
| | | // 点击工艺工序行触发校验工艺是否修改,若修改则不可操作,需先保存,若未修改,则可查询出对应的参数集 |
| | | operationRowClick(event) { |
| | | const row = this.operations[event.oldIndex] |
| | | 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 |
| | |
| | | // 保存所有参数的修改 |
| | | saveAllParamChange() { |
| | | const paramJson = { routingOperationParam: this.templateParamList } |
| | | let num = 0 |
| | | this.templateParamList.forEach(e=>{ |
| | | var regex=/^[^\(\)|^,]+$/; |
| | | if(!regex.test(e.paramValue)){ |
| | | num+=1 |
| | | } |
| | | }) |
| | | if(num>0){ |
| | | this.$message.error("参数值不能包含英文括号或逗号,请检查") |
| | | return |
| | | } |
| | | putRoutingTemplateParamForOrder(paramJson).then((response) => { |
| | | const data = response.data |
| | | if (data.code === 0) { |