| | |
| | | </div> |
| | | <el-table ref="multipleTableRef0" :data="tableData" border style="width: 100%" class="multipleTableRef" @selection-change="HandleSelectionChange" @row-click="rowClick"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column prop="index" label="工序顺序"></el-table-column> |
| | | <el-table-column prop="code" label="工序编号"></el-table-column> |
| | | <el-table-column prop="name" label="工序名称"></el-table-column> |
| | | <el-table-column prop="index" label="工序顺序"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.index}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="processCode" label="工序编号"></el-table-column> |
| | | <el-table-column prop="processName" label="工序名称"></el-table-column> |
| | | <el-table-column fixed="right" label="操作" width="200px"> |
| | | <template #default="scope"> |
| | | <el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index)">删除</el-button> |
| | | <el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button> |
| | | <el-button text type="primary" size="small" @click="table_del(scope.row, scope.$index)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <el-drawer v-model="drawer" title="添加工序" direction="rtl" :before-close="handleClose" size="60%" modal-class="viewData"> |
| | | <!-- 新增路线 --> |
| | | <div class="addworkmanship"> |
| | | <add-workmanship></add-workmanship> |
| | | <add-workmanship ref="addworkmanship" @success="handleSuccess" :isClear="isClear" :craftId="craftId"></add-workmanship> |
| | | </div> |
| | | </el-drawer> |
| | | </template> |
| | |
| | | export default { |
| | | name: 'workmanship', |
| | | components: {saveDialog,addWorkmanship}, |
| | | props: ["isCustomization"], |
| | | props: ["isCustomization","craftId"], |
| | | data() { |
| | | return { |
| | | isClear: false, |
| | | drawer: false, |
| | | tableData: [], |
| | | selection: [], |
| | |
| | | } |
| | | }, |
| | | mounted(){ |
| | | |
| | | }, |
| | | watch: { |
| | | craftId(val) { |
| | | if(val) { |
| | | this.getcraftlList(); |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | handleClose() { |
| | | |
| | | handleSuccess(value) { |
| | | this.drawer = false; |
| | | this.isClear = false; |
| | | this.getcraftlList(); |
| | | }, |
| | | getcraftlList() { |
| | | this.$HTTP.get(`/api/blade-cps/production-craft-version/detail/${this.craftId}`).then(res=> { |
| | | if(res.code == 200) { |
| | | res.data.processList.forEach((item,index)=> { |
| | | item.index = index + 1; |
| | | }); |
| | | this.tableData = res.data.processList; |
| | | } |
| | | }) |
| | | }, |
| | | handleClose(done) { |
| | | this.isClear = true; |
| | | done(); |
| | | }, |
| | | determineVersion() { |
| | | var that = this; |
| | |
| | | // this.getWorkDetail(); |
| | | // this.getPage1(); |
| | | }, |
| | | table_edit(row,index) { |
| | | this.$confirm(`确认要删除此工序吗?`, '', { |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.tableData.splice(index,1); |
| | | }).catch(() => { |
| | | |
| | | }) |
| | | }, |
| | | addRouteSuccess(selection) { |
| | | selection.forEach((item,i)=> { |
| | | item.index = i+1; |
| | |
| | | this.$refs.saveDialog.open(); |
| | | }) |
| | | } |
| | | }, |
| | | table_edit(row,index) { |
| | | this.drawer = true; |
| | | this.$nextTick(()=> { |
| | | this.$refs.addworkmanship.setData(row); |
| | | }) |
| | | }, |
| | | table_del(row,index) { |
| | | var that = this; |
| | | this.$confirm(`确认要删除此工序吗?`, '', { |
| | | type: 'warning' |
| | | }).then(() => { |
| | | var obj = { |
| | | mainProcess: [], |
| | | normalProcess: that.tableData, |
| | | removeIds: [row.id], |
| | | versionId: that.craftId |
| | | } |
| | | this.$HTTP.post(`/api/blade-cps/production-craft-process/child-process-update`,obj).then(res=> { |
| | | if(res.code == 200) { |
| | | that.$message.success("操作成功"); |
| | | that.getcraftlList(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | cursor: pointer; |
| | | } |
| | | .addworkmanship { |
| | | padding: 0 20px; |
| | | padding: 0 40px; |
| | | } |
| | | </style> |