Commit 4963c5b7 authored by tanjunxin's avatar tanjunxin

fix: 生产排产增加虚拟报工功能

parent 35f11bcc
...@@ -122,3 +122,11 @@ export function updateNotInspectionStatusApi(data) { ...@@ -122,3 +122,11 @@ export function updateNotInspectionStatusApi(data) {
method: "put", method: "put",
}); });
} }
// 虚拟报工
export function updateProTaskWorkunitApi(data) {
return request({
url: `/mes/pro/taskWorkunit/updateProTaskWorkunit/${data.taskWorkunitId}?virtualFlag=${data.virtualFlag}`,
method: "post",
});
}
\ No newline at end of file
...@@ -181,6 +181,15 @@ ...@@ -181,6 +181,15 @@
@click="handleDeleteTask" @click="handleDeleteTask"
>工序删除</el-button> >工序删除</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled='single'
@click="handleVirtualReporting"
>虚拟报工</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -623,7 +632,7 @@ import { ...@@ -623,7 +632,7 @@ import {
getworkstationList, getworkstationList,
gettaskWorkunitList, gettaskWorkunitList,
getdefaultWorkCenterList} from '@/api/mes/pro/scheduleList' getdefaultWorkCenterList} from '@/api/mes/pro/scheduleList'
import {putProtaskSplit, splitWorkstation, deleteTask} from '@/api/mes/pro/protask' import {putProtaskSplit, splitWorkstation, deleteTask, updateProTaskWorkunitApi} from '@/api/mes/pro/protask'
import BrandSelect from "@/components/TmTool/index.vue"; import BrandSelect from "@/components/TmTool/index.vue";
import shiftSelectMixin from '@/utils/shiftSelectMixin' import shiftSelectMixin from '@/utils/shiftSelectMixin'
import OrderList from './orderList.vue' import OrderList from './orderList.vue'
...@@ -796,6 +805,16 @@ export default { ...@@ -796,6 +805,16 @@ export default {
}); });
}) })
}, },
handleVirtualReporting() {
const params = {
taskWorkunitId: this.selectedRows[0].taskWorkunitId,
virtualFlag: !this.selectedRows[0].virtualFlag,
}
updateProTaskWorkunitApi(params).then(response => {
this.$modal.msgSuccess("更改成功");
this.getList();
})
},
async handleChangeWorkshopId() { async handleChangeWorkshopId() {
// this.workstationList = [] // this.workstationList = []
this.queryWorkunitParams.workstationId = null this.queryWorkunitParams.workstationId = null
......
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
</el-dialog> </el-dialog>
<el-table v-loading="loading" :data="workorderList" row-key="workorderId" default-expand-all :max-height="tableHeight" ref="tableRef" <el-table v-loading="loading" :data="workorderList" row-key="workorderId" default-expand-all :max-height="tableHeight" ref="tableRef"
@selection-change="handleSelectionChange" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> @selection-change="handleSelectionChange" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" :summary-method="getSummaries" show-summary>
<!-- 新增复选框 --> <!-- 新增复选框 -->
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="工单编码" width="180" prop="workorderCode"> <el-table-column label="工单编码" width="180" prop="workorderCode">
...@@ -1272,7 +1272,23 @@ export default { ...@@ -1272,7 +1272,23 @@ export default {
// this.single = selection.length!==1 // this.single = selection.length!==1
// this.multiple = !selection.length // this.multiple = !selection.length
// }, // },
getSummaries(param){
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 1) {
sums[index] = '总数量'
} else if (column.label === '工单数量') {
const temp = data.reduce((prev, curr) => {
return prev + Number(curr.quantity);
}, 0)
sums[index] = Number.isInteger(temp) ? temp : temp.toFixed(3);
} else {
sums[index] = ''
}
})
return sums
},
// 查询记录 // 查询记录
handleSelectChangerecord() { handleSelectChangerecord() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment