| | |
| | | <div style="display: flex"> |
| | | <el-button |
| | | v-waves |
| | | icon="el-icon-switch-button" |
| | | @click="orderClose" |
| | | >关闭订单 |
| | | type="primary" |
| | | icon="el-icon-bottom" |
| | | @click="batchHandle" |
| | | >批量下达 |
| | | </el-button> |
| | | <el-button |
| | | v-waves |
| | | icon="el-icon-delete" |
| | | @click="orderDel" |
| | | >删除订单 |
| | | </el-button> |
| | | <!-- <el-button--> |
| | | <!-- v-waves--> |
| | | <!-- icon="el-icon-switch-button"--> |
| | | <!-- @click="orderClose"--> |
| | | <!-- >关闭订单--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button--> |
| | | <!-- v-waves--> |
| | | <!-- icon="el-icon-delete"--> |
| | | <!-- @click="orderDel"--> |
| | | <!-- >删除订单--> |
| | | <!-- </el-button>--> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | @row-click="rowClick" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <!-- <el-table-column--> |
| | | <!-- type="selection"--> |
| | | <!-- width="50"--> |
| | | <!-- />--> |
| | | <!-- @row-click="rowClick"--> |
| | | <el-table-column |
| | | type="selection" |
| | | width="50" |
| | | fixed |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-radio |
| | | v-model="radioSelectedId" |
| | | :label="row.id" |
| | | style="color: transparent;padding-left: 10px;" |
| | | /> |
| | | <!-- @change.native="getCurrentRow(row.id)"--> |
| | | </template> |
| | | </el-table-column> |
| | | :selectable="selected" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- width="50"--> |
| | | <!-- fixed--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <el-radio--> |
| | | <!-- v-model="radioSelectedId"--> |
| | | <!-- :label="row.id"--> |
| | | <!-- style="color: transparent;padding-left: 10px;"--> |
| | | <!-- />--> |
| | | <!-- <!– @change.native="getCurrentRow(row.id)"–>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="RowNum" |
| | | width="50" |
| | |
| | | <el-table-column |
| | | label="操作" |
| | | fixed="right" |
| | | width="80" |
| | | width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip class="item" effect="dark" content="下达" placement="top"> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="订单下达" placement="top"> |
| | | <!-- <el-button v-waves type="text" @click="edit('edit',row)">下达</el-button>--> |
| | | <i |
| | | class="el-icon-bottom" |
| | | :style="{color:$store.state.settings.theme}" |
| | | style="cursor: pointer;margin-left: 5px" |
| | | @click="edit('edit',row)" |
| | | /> |
| | | </el-tooltip> |
| | | |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="订单关闭" placement="top"> |
| | | <i |
| | | class="el-icon-switch-button" |
| | | :style="{color:$store.state.settings.theme}" |
| | | style="cursor: pointer;margin-left: 15px" |
| | | @click="orderClose(row.id)" |
| | | /> |
| | | </el-tooltip> |
| | | |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="订单删除" placement="top"> |
| | | <i |
| | | class="el-icon-delete" |
| | | :style="{color:$store.state.settings.theme}" |
| | | style="cursor: pointer;margin-left: 15px" |
| | | @click="orderDel(row.id)" |
| | | /> |
| | | </el-tooltip> |
| | | </div> |
| | |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { ClosedErpOrder, DeleteErpOrder, ErpOrderSearch, MarkSaveErpOrder } from '@/api/produceManager' |
| | | import { |
| | | ClosedErpOrder, |
| | | DeleteErpOrder, |
| | | ErpOrderSearch, |
| | | MarkBatchSaveErpOrder, |
| | | MarkSaveErpOrder |
| | | } from '@/api/produceManager' |
| | | import { handleDatetime } from '@/utils/global' |
| | | import { SeaveSearchErpOrder } from '@/api/ErpSyncMes' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | |
| | | disabledDate(time) { |
| | | return time.getTime() < Date.now() - 8.64e7 |
| | | } |
| | | } |
| | | }, |
| | | multipleSelection: [] |
| | | |
| | | // expireTimeOption: { |
| | | // disabledDate(time) { |
| | |
| | | this.getErpOrderSearch() |
| | | }, |
| | | // 单选框选中获取当前行信息 |
| | | getCurrentRow(id) { |
| | | this.radioSelectedId = id |
| | | }, |
| | | rowClick(row) { |
| | | this.radioSelectedId = row.id |
| | | }, |
| | | // getCurrentRow(id) { |
| | | // this.radioSelectedId = id |
| | | // }, |
| | | // rowClick(row) { |
| | | // this.radioSelectedId = row.id |
| | | // }, |
| | | |
| | | // 订单删除 |
| | | orderDel() { |
| | | if (this.radioSelectedId.length < 1) { |
| | | return this.$message.info('请先选择订单!') |
| | | } |
| | | orderDel(id) { |
| | | this.tableData.forEach(item => { |
| | | if (item.id === this.radioSelectedId) { |
| | | if (item.id === id) { |
| | | if (item.status === 'CLOSED') { |
| | | return this.$message.info('此订单已关闭,无法删除!') |
| | | } else { |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | DeleteErpOrder({ erpordercode: item.wo, erporderid: this.radioSelectedId }).then(res => { |
| | | DeleteErpOrder({ erpordercode: item.wo, erporderid: id }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('订单删除成功!') |
| | | this.getErpOrderSearch() |
| | |
| | | }) |
| | | }, |
| | | // 订单关闭 |
| | | async orderClose() { |
| | | if (this.radioSelectedId.length < 1) { |
| | | return this.$message.info('请先选择订单!') |
| | | } |
| | | async orderClose(id) { |
| | | this.tableData.forEach(item => { |
| | | if (item.id === this.radioSelectedId) { |
| | | if (item.id === id) { |
| | | if (item.status !== 'NEW') { |
| | | return this.$message.info('此订单非新订单,无法关闭!') |
| | | } else { |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | ClosedErpOrder({ erpordercode: item.wo, erporderid: this.radioSelectedId }).then(res => { |
| | | ClosedErpOrder({ erpordercode: item.wo, erporderid: id }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('订单关闭成功!') |
| | | this.getErpOrderSearch() |
| | |
| | | } |
| | | }) |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.multipleSelection = val |
| | | }, |
| | | batchHandle() { |
| | | this.$confirm('是否批量下达?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | if (this.multipleSelection.length === 0) { |
| | | return this.$message.info('请先选择订单!') |
| | | } |
| | | // console.log(JSON.parse(JSON.stringify(this.multipleSelection))) |
| | | const data = [] |
| | | this.multipleSelection.forEach(i => { |
| | | data.push({ |
| | | 'erporderid': i.id, |
| | | 'erpordercode': i.wo, |
| | | 'partcode': i.partcode, |
| | | 'wkshopcode': i.wkshp_code, |
| | | 'warehousecode': i.stck_code, |
| | | 'erpqty': i.qty, |
| | | 'markqty': i.qty, |
| | | 'ordernum': 1, |
| | | 'relse_qty': i.qty, |
| | | 'saleordercode': i.saleOrderCode, |
| | | // 'saleOrderDeliveryDate': i.saleOrderDeliveryDate |
| | | 'saleOrderDeliveryDate': handleDatetime(new Date()) + ' 00:00:00' |
| | | }) |
| | | }) |
| | | // console.log(data) |
| | | MarkBatchSaveErpOrder(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.multipleSelection = [] |
| | | this.$message.success('批量下达成功!') |
| | | this.getErpOrderSearch() |
| | | } else { |
| | | this.$message.error('批量下达失败!') |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.info('已取消下达!') |
| | | }) |
| | | }, |
| | | selected(row, index) { |
| | | return row.status === 'NEW' |
| | | }, |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.$nextTick(() => { |